File indexing completed on 2024-04-21 05:30:46

0001 /*
0002     SPDX-FileCopyrightText: 2021 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef GENERICERRORDATA_H
0007 #define GENERICERRORDATA_H
0008 
0009 //! local
0010 #include "genericdata.h"
0011 #include "appletdata.h"
0012 #include "errorinformationdata.h"
0013 
0014 //! Qt
0015 #include <QList>
0016 #include <QMetaType>
0017 #include <QString>
0018 
0019 namespace Latte {
0020 namespace Data {
0021 
0022 class Error : public Data::Generic
0023 {
0024 public:
0025     //!errors and warnings use a step of four between them
0026     static constexpr const char* APPLETSWITHSAMEID = "E103";
0027     static constexpr const char* ORPHANEDPARENTAPPLETOFSUBCONTAINMENT = "E107";
0028     static constexpr const char* ORPHANEDSUBCONTAINMENT = "W201";
0029     static constexpr const char* APPLETANDCONTAINMENTWITHSAMEID = "W205";
0030 
0031     Error();
0032     Error(Error &&o);
0033     Error(const Error &o);
0034 
0035     bool isValid() const;
0036 
0037     //! Operators
0038     Error &operator=(const Error &rhs);
0039     Error &operator=(Error &&rhs);
0040     bool operator==(const Error &rhs) const;
0041     bool operator!=(const Error &rhs) const;
0042 
0043     GenericTable<Data::ErrorInformation> information;
0044 
0045 };
0046 
0047 typedef Error Warning;
0048 typedef QList<Error> ErrorsList;
0049 typedef QList<Warning> WarningsList;
0050 
0051 }
0052 }
0053 
0054 Q_DECLARE_METATYPE(Latte::Data::Error)
0055 Q_DECLARE_METATYPE(Latte::Data::ErrorsList)
0056 
0057 #endif