1 /*
2     SPDX-FileCopyrightText: 2021 Michail Vourlakos <mvourlakos@gmail.com>
3     SPDX-License-Identifier: GPL-2.0-or-later
4 */
5 
6 #ifndef GENERICERRORDATA_H
7 #define GENERICERRORDATA_H
8 
9 //! local
10 #include "genericdata.h"
11 #include "appletdata.h"
12 #include "errorinformationdata.h"
13 
14 //! Qt
15 #include <QList>
16 #include <QMetaType>
17 #include <QString>
18 
19 namespace Latte {
20 namespace Data {
21 
22 class Error : public Data::Generic
23 {
24 public:
25     //!errors and warnings use a step of four between them
26     static constexpr const char* APPLETSWITHSAMEID = "E103";
27     static constexpr const char* ORPHANEDPARENTAPPLETOFSUBCONTAINMENT = "E107";
28     static constexpr const char* ORPHANEDSUBCONTAINMENT = "W201";
29     static constexpr const char* APPLETANDCONTAINMENTWITHSAMEID = "W205";
30 
31     Error();
32     Error(Error &&o);
33     Error(const Error &o);
34 
35     bool isValid() const;
36 
37     //! Operators
38     Error &operator=(const Error &rhs);
39     Error &operator=(Error &&rhs);
40     bool operator==(const Error &rhs) const;
41     bool operator!=(const Error &rhs) const;
42 
43     GenericTable<Data::ErrorInformation> information;
44 
45 };
46 
47 typedef Error Warning;
48 typedef QList<Error> ErrorsList;
49 typedef QList<Warning> WarningsList;
50 
51 }
52 }
53 
54 Q_DECLARE_METATYPE(Latte::Data::Error)
55 Q_DECLARE_METATYPE(Latte::Data::ErrorsList)
56 
57 #endif
58