1 /*
2     SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com>
3     SPDX-License-Identifier: GPL-2.0-or-later
4 */
5 
6 #ifndef SETTINGSDATALAYOUT_H
7 #define SETTINGSDATALAYOUT_H
8 
9 // local
10 #include "genericdata.h"
11 #include "viewstable.h"
12 #include "../layout/abstractlayout.h"
13 
14 //Qt
15 #include <QMetaType>
16 #include <QString>
17 #include <QStringList>
18 
19 namespace Latte {
20 namespace Data {
21 
22 class Layout : public Generic
23 {
24 public:
25     static constexpr const char* ALLACTIVITIESID = "{0}";
26     static constexpr const char* FREEACTIVITIESID = "{free-activities}";
27     static constexpr const char* CURRENTACTIVITYID = "{current-activity}";
28     static constexpr const char* DEFAULTSCHEMEFILE = "kdeglobals";
29 
30     Layout();
31     Layout(Layout &&o);
32     Layout(const Layout &o);
33 
34     //! Layout data
35     QString icon;
36     QString color;
37     QString background;
38     QString textColor;
39     QString lastUsedActivity;
40     QString schemeFile{DEFAULTSCHEMEFILE};
41     bool isActive{false};
42     bool isConsideredActive{false}; //used from settings window to indicate activeness based on selected layouts mode
43     bool isLocked{false};
44     bool isShownInMenu{false};
45     bool isTemplate{false};
46     bool hasDisabledBorders{false};
47     int popUpMargin{-1};
48     QStringList activities;
49     int errors{0};
50     int warnings{0};
51 
52     Latte::Layout::BackgroundStyle backgroundStyle{Latte::Layout::ColorBackgroundStyle};
53 
54     ViewsTable views;
55 
56     //! Functionality
57     bool isOnAllActivities() const;
58     bool isForFreeActivities() const;
59     bool isTemporary() const;
60     bool isNull() const;
61     bool isEmpty() const;
62     bool isSystemTemplate() const;
63 
64     bool hasErrors() const;
65     bool hasWarnings() const;
66 
67     //! Operators
68     Layout &operator=(const Layout &rhs);
69     Layout &operator=(Layout &&rhs);
70     bool operator==(const Layout &rhs) const;
71     bool operator!=(const Layout &rhs) const;
72 };
73 
74 }
75 }
76 
77 Q_DECLARE_METATYPE(Latte::Data::Layout)
78 
79 #endif
80