1/********************************************************************
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5Copyright (C) 2009 Martin Gräßlin <mgraesslin@kde.org>
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*********************************************************************/
20
21#ifndef TABBOXCONFIG_H
22#define TABBOXCONFIG_H
23
24#include <QString>
25
26/**
27* @file
28* This file defines the class TabBoxConfig.
29*
30* @author Martin Gräßlin <mgraesslin@kde.org>
31* @since 4.4
32*/
33
34namespace KWin
35{
36namespace TabBox
37{
38class TabBoxConfigPrivate;
39
40/**
41* The TabBoxConfig class holds all configuration options for the TabBox.
42* The TabBoxHandler contains a pointer to an object of this class and is
43* used by all classes of TabBox. The config defines what kind of data the
44* TabBox is displaying and how the layout looks like. There can be different
45* Config sets and by setting a new config in the TabBoxHandler the behaviour
46* of the TabBox is changed immediately.
47*
48* @author Martin Gräßlin <mgraesslin@kde.org>
49* @since 4.4
50*/
51class TabBoxConfig
52{
53public:
54 /**
55 * ClientDesktopMode defines whether windows from the current desktop or from all
56 * desktops are included in the TabBoxClient List in the TabBoxClientModel
57 */
58 enum ClientDesktopMode {
59 AllDesktopsClients, ///< TabBoxClients from all desktops are included.
60 OnlyCurrentDesktopClients, ///< Only TabBoxClients on current desktop are included
61 ExcludeCurrentDesktopClients ///< Exclude TabBoxClients on current desktop
62 };
63 /**
64 * ClientActivitiesMode defines whether windows from the current activity or from all
65 * activities are included in the TabBoxClient List in the TabBoxClientModel
66 */
67 enum ClientActivitiesMode {
68 AllActivitiesClients, ///< TabBoxClients from all Activities are included.
69 OnlyCurrentActivityClients, ///< Only TabBoxClients on current activity are included
70 ExcludeCurrentActivityClients ///< Exclude TabBoxClients on current activity
71 };
72 /**
73 * ClientApplicationsMode defines which windows from the current application or from all
74 * applications are included in the TabBoxClient List in the TabBoxClientModel
75 */
76 enum ClientApplicationsMode {
77 AllWindowsAllApplications, ///< TabBoxClients from all applications are included
78 OneWindowPerApplication, ///< Only one TabBoxClient for each application is included
79 AllWindowsCurrentApplication ///< Only TabBoxClients for the current application are included
80 };
81 /**
82 * ClientMinimizedMode defines which windows are included in the TabBoxClient List
83 * in the TabBoxClientModel based on whether they are minimized or not
84 */
85 enum ClientMinimizedMode {
86 IgnoreMinimizedStatus, ///< TabBoxClients are included no matter they are minimized or not
87 ExcludeMinimizedClients, ///< Exclude minimized TabBoxClients
88 OnlyMinimizedClients ///< Only minimized TabBoxClients are included
89 };
90 /**
91 * ShowDesktopMode defines whether a TabBoxClient representing the desktop
92 * is included in the TabBoxClient List in the TabBoxClientModel
93 */
94 enum ShowDesktopMode {
95 DoNotShowDesktopClient, ///< A TabBoxClient representing the desktop is not included
96 ShowDesktopClient ///< A TabBoxClient representing the desktop is included
97 };
98 /**
99 * ClientActivitiesMode defines whether windows from the current activity or from all
100 * activities are included in the TabBoxClient List in the TabBoxClientModel
101 */
102 enum ClientMultiScreenMode {
103 IgnoreMultiScreen, ///< TabBoxClients are included independently of the screen they are on
104 OnlyCurrentScreenClients, ///< Only TabBoxClients on current screen are included
105 ExcludeCurrentScreenClients ///< Exclude TabBoxClients from the current screen
106 };
107 /**
108 * ClientSwitchingMode defines the sorting of the TabBoxClients in the
109 * TabBoxClientModel.
110 */
111 enum ClientSwitchingMode {
112 FocusChainSwitching, ///< Sort by recently used. Most recently used TabBoxClient is the first
113 StackingOrderSwitching ///< Sort by current stacking order
114 };
115 /**
116 * DesktopSwitchingMode defines the sorting of the desktops in the
117 * TabBoxDesktopModel.
118 */
119 enum DesktopSwitchingMode {
120 MostRecentlyUsedDesktopSwitching,///< Sort by recently used. Most recently used desktop is the first
121 StaticDesktopSwitching///< Static sorting in numerical ascending order
122 };
123 /**
124 * TabBoxMode defines what kind of items the TabBox is displaying and which
125 * Model is used
126 */
127 enum TabBoxMode {
128 ClientTabBox,///< TabBox uses TabBoxClientModel
129 DesktopTabBox///< TabBox uses TabBoxDesktopModel
130 };
131 TabBoxConfig();
132 ~TabBoxConfig();
133 TabBoxConfig& operator=(const TabBoxConfig& object);
134
135 // getters
136 /**
137 * @return If the TabBox should be shown or not
138 * This option does not apply for TabBoxMode DesktopTabBox.
139 * @see setShowTabBox
140 * @see defaultShowTabBox
141 */
142 bool isShowTabBox() const;
143 /**
144 * @return If Highlight Window effect should be used.
145 * This option does not apply for TabBoxMode DesktopTabBox.
146 * @see setHighlightWindows
147 * @see defaultHighlightWindows
148 */
149 bool isHighlightWindows() const;
150 /**
151 * @return The current TabBoxMode
152 * @see setTabBoxMode
153 */
154 TabBoxMode tabBoxMode() const;
155 /**
156 * @return The current ClientDesktopMode
157 * This option only applies for TabBoxMode ClientTabBox.
158 * @see setClientDesktopMode
159 * @see defaultDesktopMode
160 */
161 ClientDesktopMode clientDesktopMode() const;
162 /**
163 * @return The current ClientActivitiesMode
164 * This option only applies for TabBoxMode ClientTabBox.
165 * @see setClientActivitiesMode
166 * @see defaultActivitiesMode
167 */
168 ClientActivitiesMode clientActivitiesMode() const;
169 /**
170 * @return The current ClientApplicationsMode
171 * This option only applies for TabBoxMode ClientTabBox.
172 * @see setClientApplicationsMode
173 * @see defaultApplicationsMode
174 */
175 ClientApplicationsMode clientApplicationsMode() const;
176 /**
177 * @return The current ClientMinimizedMode
178 * This option only applies for TabBoxMode ClientTabBox.
179 * @see setClientMinimizedMode
180 * @see defaultMinimizedMode
181 */
182 ClientMinimizedMode clientMinimizedMode() const;
183 /**
184 * @return The current ShowDesktopMode
185 * This option only applies for TabBoxMode ClientTabBox.
186 * @see setShowDesktopMode
187 * @see defaultShowDesktopMode
188 */
189 ShowDesktopMode showDesktopMode() const;
190 /**
191 * @return The current ClientMultiScreenMode
192 * This option only applies for TabBoxMode ClientTabBox.
193 * @see setClientMultiScreenMode
194 * @see defaultMultiScreenMode
195 */
196 ClientMultiScreenMode clientMultiScreenMode() const;
197 /**
198 * @return The current ClientSwitchingMode.
199 * This option only applies for TabBoxMode ClientTabBox.
200 * @see setClientSwitchingMode
201 * @see defaultSwitchingMode
202 */
203 ClientSwitchingMode clientSwitchingMode() const;
204 /**
205 * @return The current DesktopSwitchingMode
206 * This option only applies for TabBoxMode DesktopTabBox.
207 * @see setDesktopSwitchingMode
208 */
209 DesktopSwitchingMode desktopSwitchingMode() const;
210 /**
211 * @return Then name of the current ItemLayout
212 * @see setlayoutName
213 */
214 QString& layoutName() const;
215
216 // setters
217 /**
218 * @param show The tabbox should be shown or not.
219 * This option does not apply for TabBoxMode DesktopTabBox.
220 * @see isShowTabBox
221 */
222 void setShowTabBox(bool show);
223 /**
224 * @param highlight Highlight Windows effect should be used or not.
225 * This option does not apply for TabBoxMode DesktopTabBox.
226 * @see isHighlightWindows
227 */
228 void setHighlightWindows(bool highlight);
229 /**
230 * @param mode The new TabBoxMode to be used.
231 * @see tabBoxMode
232 */
233 void setTabBoxMode(TabBoxMode mode);
234 /**
235 * @param desktopMode The new ClientDesktopMode to be used.
236 * This option only applies for TabBoxMode ClientTabBox.
237 * @see clientDesktopMode
238 */
239 void setClientDesktopMode(ClientDesktopMode desktopMode);
240 /**
241 * @param activitiesMode The new ClientActivitiesMode to be used.
242 * This option only applies for TabBoxMode ClientTabBox.
243 * @see clientActivitiesMode
244 */
245 void setClientActivitiesMode(ClientActivitiesMode activitiesMode);
246 /**
247 * @param applicationsMode The new ClientApplicationsMode to be used.
248 * This option only applies for TabBoxMode ClientTabBox.
249 * @see clientApplicationsMode
250 */
251 void setClientApplicationsMode(ClientApplicationsMode applicationsMode);
252 /**
253 * @param minimizedMode The new ClientMinimizedMode to be used.
254 * This option only applies for TabBoxMode ClientTabBox.
255 * @see clientMinimizedMode
256 */
257 void setClientMinimizedMode(ClientMinimizedMode minimizedMode);
258 /**
259 * @param showDesktopMode The new ShowDesktopMode to be used.
260 * This option only applies for TabBoxMode ClientTabBox.
261 * @see showDesktopMode
262 */
263 void setShowDesktopMode(ShowDesktopMode showDesktopMode);
264 /**
265 * @param multiScreenMode The new ClientMultiScreenMode to be used.
266 * This option only applies for TabBoxMode ClientTabBox.
267 * @see clientMultiScreenMode
268 */
269 void setClientMultiScreenMode(ClientMultiScreenMode multiScreenMode);
270 /**
271 * @param switchingMode The new ClientSwitchingMode to be used.
272 * This option only applies for TabBoxMode ClientTabBox.
273 * @see clientSwitchingMode
274 */
275 void setClientSwitchingMode(ClientSwitchingMode switchingMode);
276 /**
277 * @param switchingMode The new DesktopSwitchingMode to be used.
278 * This option only applies for TabBoxMode DesktopTabBox.
279 * @see desktopSwitchingMode
280 */
281 void setDesktopSwitchingMode(DesktopSwitchingMode switchingMode);
282 /**
283 * @param name The new ItemLayout config name
284 * @see layoutName
285 */
286 void setLayoutName(const QString& name);
287
288 // some static methods to access default values
289 static ClientDesktopMode defaultDesktopMode() {
290 return OnlyCurrentDesktopClients;
291 }
292 static ClientActivitiesMode defaultActivitiesMode() {
293 return OnlyCurrentActivityClients;
294 }
295 static ClientApplicationsMode defaultApplicationsMode() {
296 return AllWindowsAllApplications;
297 }
298 static ClientMinimizedMode defaultMinimizedMode() {
299 return IgnoreMinimizedStatus;
300 }
301 static ShowDesktopMode defaultShowDesktopMode() {
302 return DoNotShowDesktopClient;
303 }
304 static ClientMultiScreenMode defaultMultiScreenMode() {
305 return IgnoreMultiScreen;
306 }
307 static ClientSwitchingMode defaultSwitchingMode() {
308 return FocusChainSwitching;
309 }
310 static bool defaultShowTabBox() {
311 return true;
312 }
313 static bool defaultHighlightWindow() {
314 return true;
315 }
316 static QString defaultLayoutName() {
317 return QString("thumbnails");
318 }
319private:
320 TabBoxConfigPrivate* d;
321};
322
323} // namespace TabBox
324} // namespace KWin
325
326#endif // TABBOXCONFIG_H
327