1 /*
2     KWin - the KDE window manager
3     This file is part of the KDE project.
4 
5     SPDX-FileCopyrightText: 2009 Martin Gräßlin <mgraesslin@kde.org>
6 
7     SPDX-License-Identifier: GPL-2.0-or-later
8 */
9 
10 #include "tabboxconfig.h"
11 
12 namespace KWin
13 {
14 namespace TabBox
15 {
16 class TabBoxConfigPrivate
17 {
18 public:
TabBoxConfigPrivate()19     TabBoxConfigPrivate()
20         : showTabBox(TabBoxConfig::defaultShowTabBox())
21         , highlightWindows(TabBoxConfig::defaultHighlightWindow())
22         , tabBoxMode(TabBoxConfig::ClientTabBox)
23         , clientDesktopMode(TabBoxConfig::defaultDesktopMode())
24         , clientActivitiesMode(TabBoxConfig::defaultActivitiesMode())
25         , clientApplicationsMode(TabBoxConfig::defaultApplicationsMode())
26         , clientMinimizedMode(TabBoxConfig::defaultMinimizedMode())
27         , showDesktopMode(TabBoxConfig::defaultShowDesktopMode())
28         , clientMultiScreenMode(TabBoxConfig::defaultMultiScreenMode())
29         , clientSwitchingMode(TabBoxConfig::defaultSwitchingMode())
30         , desktopSwitchingMode(TabBoxConfig::MostRecentlyUsedDesktopSwitching)
31         , layoutName(TabBoxConfig::defaultLayoutName()) {
32     }
~TabBoxConfigPrivate()33     ~TabBoxConfigPrivate() {
34     }
35     bool showTabBox;
36     bool highlightWindows;
37 
38     TabBoxConfig::TabBoxMode tabBoxMode;
39     TabBoxConfig::ClientDesktopMode clientDesktopMode;
40     TabBoxConfig::ClientActivitiesMode clientActivitiesMode;
41     TabBoxConfig::ClientApplicationsMode clientApplicationsMode;
42     TabBoxConfig::ClientMinimizedMode clientMinimizedMode;
43     TabBoxConfig::ShowDesktopMode showDesktopMode;
44     TabBoxConfig::ClientMultiScreenMode clientMultiScreenMode;
45     TabBoxConfig::ClientSwitchingMode clientSwitchingMode;
46     TabBoxConfig::DesktopSwitchingMode desktopSwitchingMode;
47     QString layoutName;
48 };
49 
TabBoxConfig()50 TabBoxConfig::TabBoxConfig()
51     : d(new TabBoxConfigPrivate)
52 {
53 }
54 
~TabBoxConfig()55 TabBoxConfig::~TabBoxConfig()
56 {
57     delete d;
58 }
59 
operator =(const KWin::TabBox::TabBoxConfig & object)60 TabBoxConfig& TabBoxConfig::operator=(const KWin::TabBox::TabBoxConfig& object)
61 {
62     d->showTabBox = object.isShowTabBox();
63     d->highlightWindows = object.isHighlightWindows();
64     d->tabBoxMode = object.tabBoxMode();
65     d->clientDesktopMode = object.clientDesktopMode();
66     d->clientActivitiesMode = object.clientActivitiesMode();
67     d->clientApplicationsMode = object.clientApplicationsMode();
68     d->clientMinimizedMode = object.clientMinimizedMode();
69     d->showDesktopMode = object.showDesktopMode();
70     d->clientMultiScreenMode = object.clientMultiScreenMode();
71     d->clientSwitchingMode = object.clientSwitchingMode();
72     d->desktopSwitchingMode = object.desktopSwitchingMode();
73     d->layoutName = object.layoutName();
74     return *this;
75 }
76 
setHighlightWindows(bool highlight)77 void TabBoxConfig::setHighlightWindows(bool highlight)
78 {
79     d->highlightWindows = highlight;
80 }
81 
isHighlightWindows() const82 bool TabBoxConfig::isHighlightWindows() const
83 {
84     return d->highlightWindows;
85 }
86 
setShowTabBox(bool show)87 void TabBoxConfig::setShowTabBox(bool show)
88 {
89     d->showTabBox = show;
90 }
91 
isShowTabBox() const92 bool TabBoxConfig::isShowTabBox() const
93 {
94     return d->showTabBox;
95 }
96 
setTabBoxMode(TabBoxConfig::TabBoxMode mode)97 void TabBoxConfig::setTabBoxMode(TabBoxConfig::TabBoxMode mode)
98 {
99     d->tabBoxMode = mode;
100 }
101 
tabBoxMode() const102 TabBoxConfig::TabBoxMode TabBoxConfig::tabBoxMode() const
103 {
104     return d->tabBoxMode;
105 }
106 
clientDesktopMode() const107 TabBoxConfig::ClientDesktopMode TabBoxConfig::clientDesktopMode() const
108 {
109     return d->clientDesktopMode;
110 }
111 
setClientDesktopMode(ClientDesktopMode desktopMode)112 void TabBoxConfig::setClientDesktopMode(ClientDesktopMode desktopMode)
113 {
114     d->clientDesktopMode = desktopMode;
115 }
116 
clientActivitiesMode() const117 TabBoxConfig::ClientActivitiesMode TabBoxConfig::clientActivitiesMode() const
118 {
119     return d->clientActivitiesMode;
120 }
121 
setClientActivitiesMode(ClientActivitiesMode activitiesMode)122 void TabBoxConfig::setClientActivitiesMode(ClientActivitiesMode activitiesMode)
123 {
124     d->clientActivitiesMode = activitiesMode;
125 }
126 
clientApplicationsMode() const127 TabBoxConfig::ClientApplicationsMode TabBoxConfig::clientApplicationsMode() const
128 {
129     return d->clientApplicationsMode;
130 }
131 
setClientApplicationsMode(ClientApplicationsMode applicationsMode)132 void TabBoxConfig::setClientApplicationsMode(ClientApplicationsMode applicationsMode)
133 {
134     d->clientApplicationsMode = applicationsMode;
135 }
136 
clientMinimizedMode() const137 TabBoxConfig::ClientMinimizedMode TabBoxConfig::clientMinimizedMode() const
138 {
139     return d->clientMinimizedMode;
140 }
141 
setClientMinimizedMode(ClientMinimizedMode minimizedMode)142 void TabBoxConfig::setClientMinimizedMode(ClientMinimizedMode minimizedMode)
143 {
144     d->clientMinimizedMode = minimizedMode;
145 }
146 
showDesktopMode() const147 TabBoxConfig::ShowDesktopMode TabBoxConfig::showDesktopMode() const
148 {
149     return d->showDesktopMode;
150 }
151 
setShowDesktopMode(ShowDesktopMode showDesktopMode)152 void TabBoxConfig::setShowDesktopMode(ShowDesktopMode showDesktopMode)
153 {
154     d->showDesktopMode = showDesktopMode;
155 }
156 
clientMultiScreenMode() const157 TabBoxConfig::ClientMultiScreenMode TabBoxConfig::clientMultiScreenMode() const
158 {
159     return d->clientMultiScreenMode;
160 }
161 
setClientMultiScreenMode(ClientMultiScreenMode multiScreenMode)162 void TabBoxConfig::setClientMultiScreenMode(ClientMultiScreenMode multiScreenMode)
163 {
164     d->clientMultiScreenMode = multiScreenMode;
165 }
166 
clientSwitchingMode() const167 TabBoxConfig::ClientSwitchingMode TabBoxConfig::clientSwitchingMode() const
168 {
169     return d->clientSwitchingMode;
170 }
171 
setClientSwitchingMode(ClientSwitchingMode switchingMode)172 void TabBoxConfig::setClientSwitchingMode(ClientSwitchingMode switchingMode)
173 {
174     d->clientSwitchingMode = switchingMode;
175 }
176 
desktopSwitchingMode() const177 TabBoxConfig::DesktopSwitchingMode TabBoxConfig::desktopSwitchingMode() const
178 {
179     return d->desktopSwitchingMode;
180 }
181 
setDesktopSwitchingMode(DesktopSwitchingMode switchingMode)182 void TabBoxConfig::setDesktopSwitchingMode(DesktopSwitchingMode switchingMode)
183 {
184     d->desktopSwitchingMode = switchingMode;
185 }
186 
layoutName() const187 QString& TabBoxConfig::layoutName() const
188 {
189     return d->layoutName;
190 }
191 
setLayoutName(const QString & name)192 void TabBoxConfig::setLayoutName(const QString& name)
193 {
194     d->layoutName = name;
195 }
196 
197 } // namespace TabBox
198 } // namespace KWin
199