Changeset View
Changeset View
Standalone View
Standalone View
tabbox/tabboxhandler.h
Show All 32 Lines | |||||
33 | /** | 33 | /** | ||
34 | * @file | 34 | * @file | ||
35 | * This file contains the classes which hide KWin core from tabbox. | 35 | * This file contains the classes which hide KWin core from tabbox. | ||
36 | * It defines the pure virtual classes TabBoxHandler and TabBoxClient. | 36 | * It defines the pure virtual classes TabBoxHandler and TabBoxClient. | ||
37 | * The classes have to be implemented in KWin Core. | 37 | * The classes have to be implemented in KWin Core. | ||
38 | * | 38 | * | ||
39 | * @author Martin Gräßlin <mgraesslin@kde.org> | 39 | * @author Martin Gräßlin <mgraesslin@kde.org> | ||
40 | * @since 4.4 | 40 | * @since 4.4 | ||
41 | */ | 41 | **/ | ||
42 | 42 | | |||
43 | class QKeyEvent; | 43 | class QKeyEvent; | ||
44 | 44 | | |||
45 | namespace KWin | 45 | namespace KWin | ||
46 | { | 46 | { | ||
47 | /** | 47 | /** | ||
48 | * The TabBox is a model based view for displaying a list while switching windows or desktops. | 48 | * The TabBox is a model based view for displaying a list while switching windows or desktops. | ||
49 | * This functionality is mostly referred to as Alt+Tab. TabBox itself does not provide support for | 49 | * This functionality is mostly referred to as Alt+Tab. TabBox itself does not provide support for | ||
Show All 19 Lines | |||||
69 | * necessary to retrieve the last selected item this has to be done before calling the hide method. | 69 | * necessary to retrieve the last selected item this has to be done before calling the hide method. | ||
70 | * | 70 | * | ||
71 | * The layout of the TabBox View and the items is completely customizable. Therefore TabBox provides | 71 | * The layout of the TabBox View and the items is completely customizable. Therefore TabBox provides | ||
72 | * a widget LayoutConfig which includes a live preview (in kcmkwin/kwintabbox). The layout of items | 72 | * a widget LayoutConfig which includes a live preview (in kcmkwin/kwintabbox). The layout of items | ||
73 | * can be defined by an xml document. That way the user is able to define own custom layouts. The view | 73 | * can be defined by an xml document. That way the user is able to define own custom layouts. The view | ||
74 | * itself is made up of two widgets: one to show the complete list and one to show only the selected | 74 | * itself is made up of two widgets: one to show the complete list and one to show only the selected | ||
75 | * item. This way it is possible to have a view which shows for example a list containing only small | 75 | * item. This way it is possible to have a view which shows for example a list containing only small | ||
76 | * icons and nevertheless show the title of the currently selected client. | 76 | * icons and nevertheless show the title of the currently selected client. | ||
77 | */ | 77 | **/ | ||
78 | namespace TabBox | 78 | namespace TabBox | ||
79 | { | 79 | { | ||
80 | class DesktopModel; | 80 | class DesktopModel; | ||
81 | class ClientModel; | 81 | class ClientModel; | ||
82 | class TabBoxConfig; | 82 | class TabBoxConfig; | ||
83 | class TabBoxClient; | 83 | class TabBoxClient; | ||
84 | class TabBoxHandlerPrivate; | 84 | class TabBoxHandlerPrivate; | ||
85 | typedef QList< QWeakPointer< TabBoxClient > > TabBoxClientList; | 85 | typedef QList< QWeakPointer< TabBoxClient > > TabBoxClientList; | ||
86 | 86 | | |||
87 | /** | 87 | /** | ||
88 | * This class is a wrapper around KWin Workspace. It is used for accessing the | 88 | * This class is a wrapper around KWin Workspace. It is used for accessing the | ||
89 | * required core methods from inside TabBox and has to be implemented in KWin core. | 89 | * required core methods from inside TabBox and has to be implemented in KWin core. | ||
90 | * | 90 | * | ||
91 | * @author Martin Gräßlin <mgraesslin@kde.org> | 91 | * @author Martin Gräßlin <mgraesslin@kde.org> | ||
92 | * @since 4.4 | 92 | * @since 4.4 | ||
93 | */ | 93 | **/ | ||
94 | class TabBoxHandler : public QObject | 94 | class TabBoxHandler : public QObject | ||
95 | { | 95 | { | ||
96 | Q_OBJECT | 96 | Q_OBJECT | ||
97 | public: | 97 | public: | ||
98 | TabBoxHandler(QObject *parent); | 98 | TabBoxHandler(QObject *parent); | ||
99 | virtual ~TabBoxHandler(); | 99 | virtual ~TabBoxHandler(); | ||
100 | 100 | | |||
101 | /** | 101 | /** | ||
102 | * @return The id of the active screen | 102 | * @return The id of the active screen | ||
103 | */ | 103 | **/ | ||
104 | virtual int activeScreen() const = 0; | 104 | virtual int activeScreen() const = 0; | ||
105 | /** | 105 | /** | ||
106 | * @return The current active TabBoxClient or NULL | 106 | * @return The current active TabBoxClient or NULL | ||
107 | * if there is no active client. | 107 | * if there is no active client. | ||
108 | */ | 108 | **/ | ||
109 | virtual QWeakPointer<TabBoxClient> activeClient() const = 0; | 109 | virtual QWeakPointer<TabBoxClient> activeClient() const = 0; | ||
110 | /** | 110 | /** | ||
111 | * @param client The client which is starting point to find the next client | 111 | * @param client The client which is starting point to find the next client | ||
112 | * @return The next TabBoxClient in focus chain | 112 | * @return The next TabBoxClient in focus chain | ||
113 | */ | 113 | **/ | ||
114 | virtual QWeakPointer<TabBoxClient> nextClientFocusChain(TabBoxClient* client) const = 0; | 114 | virtual QWeakPointer<TabBoxClient> nextClientFocusChain(TabBoxClient* client) const = 0; | ||
115 | /** | 115 | /** | ||
116 | * This method is used by the ClientModel to find an entrance into the focus chain in case | 116 | * This method is used by the ClientModel to find an entrance into the focus chain in case | ||
117 | * there is no active Client. | 117 | * there is no active Client. | ||
118 | * | 118 | * | ||
119 | * @return The first Client of the focus chain | 119 | * @return The first Client of the focus chain | ||
120 | * @since 4.9.1 | 120 | * @since 4.9.1 | ||
121 | **/ | 121 | **/ | ||
Show All 11 Lines | |||||
133 | * @return @c true in case the Client is part of the focus chain, @c false otherwise. | 133 | * @return @c true in case the Client is part of the focus chain, @c false otherwise. | ||
134 | * @since 4.9.2 | 134 | * @since 4.9.2 | ||
135 | **/ | 135 | **/ | ||
136 | virtual bool isInFocusChain(TabBoxClient* client) const = 0; | 136 | virtual bool isInFocusChain(TabBoxClient* client) const = 0; | ||
137 | /** | 137 | /** | ||
138 | * @param client The client whose desktop name should be retrieved | 138 | * @param client The client whose desktop name should be retrieved | ||
139 | * @return The desktop name of the given TabBoxClient. If the client is | 139 | * @return The desktop name of the given TabBoxClient. If the client is | ||
140 | * on all desktops the name of current desktop will be returned. | 140 | * on all desktops the name of current desktop will be returned. | ||
141 | */ | 141 | **/ | ||
142 | virtual QString desktopName(TabBoxClient* client) const = 0; | 142 | virtual QString desktopName(TabBoxClient* client) const = 0; | ||
143 | /** | 143 | /** | ||
144 | * @param desktop The desktop whose name should be retrieved | 144 | * @param desktop The desktop whose name should be retrieved | ||
145 | * @return The desktop name of given desktop | 145 | * @return The desktop name of given desktop | ||
146 | */ | 146 | **/ | ||
147 | virtual QString desktopName(int desktop) const = 0; | 147 | virtual QString desktopName(int desktop) const = 0; | ||
148 | /** | 148 | /** | ||
149 | * @return The number of current desktop | 149 | * @return The number of current desktop | ||
150 | */ | 150 | **/ | ||
151 | virtual int currentDesktop() const = 0; | 151 | virtual int currentDesktop() const = 0; | ||
152 | /** | 152 | /** | ||
153 | * @return The number of virtual desktops | 153 | * @return The number of virtual desktops | ||
154 | */ | 154 | **/ | ||
155 | virtual int numberOfDesktops() const = 0; | 155 | virtual int numberOfDesktops() const = 0; | ||
156 | /** | 156 | /** | ||
157 | * @param desktop The desktop which is the starting point to find the next desktop | 157 | * @param desktop The desktop which is the starting point to find the next desktop | ||
158 | * @return The next desktop in the current focus chain. | 158 | * @return The next desktop in the current focus chain. | ||
159 | */ | 159 | **/ | ||
160 | virtual int nextDesktopFocusChain(int desktop) const = 0; | 160 | virtual int nextDesktopFocusChain(int desktop) const = 0; | ||
161 | 161 | | |||
162 | /** | 162 | /** | ||
163 | * whether KWin is currently compositing and it's related features (elevating) can be used | 163 | * whether KWin is currently compositing and it's related features (elevating) can be used | ||
164 | */ | 164 | **/ | ||
165 | virtual bool isKWinCompositing() const = 0; | 165 | virtual bool isKWinCompositing() const = 0; | ||
166 | 166 | | |||
167 | /** | 167 | /** | ||
168 | * De-/Elevate a client using the compositor (if enabled) | 168 | * De-/Elevate a client using the compositor (if enabled) | ||
169 | */ | 169 | **/ | ||
170 | virtual void elevateClient(TabBoxClient* c, QWindow *tabbox, bool elevate) const = 0; | 170 | virtual void elevateClient(TabBoxClient* c, QWindow *tabbox, bool elevate) const = 0; | ||
171 | 171 | | |||
172 | /** | 172 | /** | ||
173 | * Raise a client (w/o activating it) | 173 | * Raise a client (w/o activating it) | ||
174 | */ | 174 | **/ | ||
175 | virtual void raiseClient(TabBoxClient* c) const = 0; | 175 | virtual void raiseClient(TabBoxClient* c) const = 0; | ||
176 | 176 | | |||
177 | /** | 177 | /** | ||
178 | * @param c The client to be restacked | 178 | * @param c The client to be restacked | ||
179 | * @param under The client the other one will be placed below | 179 | * @param under The client the other one will be placed below | ||
180 | */ | 180 | **/ | ||
181 | virtual void restack(TabBoxClient *c, TabBoxClient *under) = 0; | 181 | virtual void restack(TabBoxClient *c, TabBoxClient *under) = 0; | ||
182 | 182 | | |||
183 | /** | 183 | /** | ||
184 | * Toggle between ShadeHover and ShadeNormal - not shaded windows are unaffected | 184 | * Toggle between ShadeHover and ShadeNormal - not shaded windows are unaffected | ||
185 | * @param c The client to be shaded | 185 | * @param c The client to be shaded | ||
186 | * @param b Whether to un- or shade | 186 | * @param b Whether to un- or shade | ||
187 | */ | 187 | **/ | ||
188 | virtual void shadeClient(TabBoxClient *c, bool b) const = 0; | 188 | virtual void shadeClient(TabBoxClient *c, bool b) const = 0; | ||
189 | 189 | | |||
190 | virtual void highlightWindows(TabBoxClient *window = nullptr, QWindow *controller = nullptr) = 0; | 190 | virtual void highlightWindows(TabBoxClient *window = nullptr, QWindow *controller = nullptr) = 0; | ||
191 | 191 | | |||
192 | /** | 192 | /** | ||
193 | * @return The current stacking order of TabBoxClients | 193 | * @return The current stacking order of TabBoxClients | ||
194 | */ | 194 | **/ | ||
195 | virtual TabBoxClientList stackingOrder() const = 0; | 195 | virtual TabBoxClientList stackingOrder() const = 0; | ||
196 | /** | 196 | /** | ||
197 | * Determines if given client will be added to the list: | 197 | * Determines if given client will be added to the list: | ||
198 | * <UL> | 198 | * <UL> | ||
199 | * <LI>Depends on desktop</LI> | 199 | * <LI>Depends on desktop</LI> | ||
200 | * <LI>if the client wants to have tab focus.</LI> | 200 | * <LI>if the client wants to have tab focus.</LI> | ||
201 | * <LI>The client won't be added if it has modal dialogs</LI> | 201 | * <LI>The client won't be added if it has modal dialogs</LI> | ||
202 | * <LI>In that case the modal dialog will be returned if it isn't already | 202 | * <LI>In that case the modal dialog will be returned if it isn't already | ||
203 | * included</LI> | 203 | * included</LI> | ||
204 | * <LI>Won't be added if it isn't on active screen when using separate | 204 | * <LI>Won't be added if it isn't on active screen when using separate | ||
205 | * screen focus</LI> | 205 | * screen focus</LI> | ||
206 | * </UL> | 206 | * </UL> | ||
207 | * @param client The client to be checked for inclusion | 207 | * @param client The client to be checked for inclusion | ||
208 | * @param desktop The desktop the client should be on. This is irrelevant if allDesktops is set | 208 | * @param desktop The desktop the client should be on. This is irrelevant if allDesktops is set | ||
209 | * @param allDesktops Add clients from all desktops or only from current | 209 | * @param allDesktops Add clients from all desktops or only from current | ||
210 | * @return The client to be included in the list or NULL if it isn't to be included | 210 | * @return The client to be included in the list or NULL if it isn't to be included | ||
211 | */ | 211 | **/ | ||
212 | virtual QWeakPointer<TabBoxClient> clientToAddToList(TabBoxClient* client, int desktop) const = 0; | 212 | virtual QWeakPointer<TabBoxClient> clientToAddToList(TabBoxClient* client, int desktop) const = 0; | ||
213 | /** | 213 | /** | ||
214 | * @return The first desktop window in the stacking order. | 214 | * @return The first desktop window in the stacking order. | ||
215 | */ | 215 | **/ | ||
216 | virtual QWeakPointer<TabBoxClient> desktopClient() const = 0; | 216 | virtual QWeakPointer<TabBoxClient> desktopClient() const = 0; | ||
217 | /** | 217 | /** | ||
218 | * Activates the currently selected client and closes the TabBox. | 218 | * Activates the currently selected client and closes the TabBox. | ||
219 | **/ | 219 | **/ | ||
220 | virtual void activateAndClose() = 0; | 220 | virtual void activateAndClose() = 0; | ||
221 | 221 | | |||
222 | /** | 222 | /** | ||
223 | * @return The currently used TabBoxConfig | 223 | * @return The currently used TabBoxConfig | ||
224 | */ | 224 | **/ | ||
225 | const TabBoxConfig& config() const; | 225 | const TabBoxConfig& config() const; | ||
226 | /** | 226 | /** | ||
227 | * Call this method when you want to change the currently used TabBoxConfig. | 227 | * Call this method when you want to change the currently used TabBoxConfig. | ||
228 | * It fires the signal configChanged. | 228 | * It fires the signal configChanged. | ||
229 | * @param config Updates the currently used TabBoxConfig to config | 229 | * @param config Updates the currently used TabBoxConfig to config | ||
230 | */ | 230 | **/ | ||
231 | void setConfig(const TabBoxConfig& config); | 231 | void setConfig(const TabBoxConfig& config); | ||
232 | 232 | | |||
233 | /** | 233 | /** | ||
234 | * Call this method to show the TabBoxView. Depending on current | 234 | * Call this method to show the TabBoxView. Depending on current | ||
235 | * configuration this method might not do anything. | 235 | * configuration this method might not do anything. | ||
236 | * If highlight windows effect is to be used it will be activated. | 236 | * If highlight windows effect is to be used it will be activated. | ||
237 | * Highlight windows and outline are not shown if | 237 | * Highlight windows and outline are not shown if | ||
238 | * TabBoxConfig::TabBoxMode is TabBoxConfig::DesktopTabBox. | 238 | * TabBoxConfig::TabBoxMode is TabBoxConfig::DesktopTabBox. | ||
239 | * @see TabBoxConfig::isShowTabBox | 239 | * @see TabBoxConfig::isShowTabBox | ||
240 | * @see TabBoxConfig::isHighlightWindows | 240 | * @see TabBoxConfig::isHighlightWindows | ||
241 | */ | 241 | **/ | ||
242 | void show(); | 242 | void show(); | ||
243 | /** | 243 | /** | ||
244 | * Hides the TabBoxView if shown. | 244 | * Hides the TabBoxView if shown. | ||
245 | * Deactivates highlight windows effect if active. | 245 | * Deactivates highlight windows effect if active. | ||
246 | * @see show | 246 | * @see show | ||
247 | */ | 247 | **/ | ||
248 | void hide(bool abort = false); | 248 | void hide(bool abort = false); | ||
249 | 249 | | |||
250 | /** | 250 | /** | ||
251 | * Sets the current model index in the view and updates | 251 | * Sets the current model index in the view and updates | ||
252 | * highlight windows if active. | 252 | * highlight windows if active. | ||
253 | * @param index The current Model index | 253 | * @param index The current Model index | ||
254 | */ | 254 | **/ | ||
255 | void setCurrentIndex(const QModelIndex& index); | 255 | void setCurrentIndex(const QModelIndex& index); | ||
256 | /** | 256 | /** | ||
257 | * @returns the current index | 257 | * @returns the current index | ||
258 | **/ | 258 | **/ | ||
259 | const QModelIndex ¤tIndex() const; | 259 | const QModelIndex ¤tIndex() const; | ||
260 | 260 | | |||
261 | /** | 261 | /** | ||
262 | * Retrieves the next or previous item of the current item. | 262 | * Retrieves the next or previous item of the current item. | ||
263 | * @param forward next or previous item | 263 | * @param forward next or previous item | ||
264 | * @return The next or previous item. If there is no matching item | 264 | * @return The next or previous item. If there is no matching item | ||
265 | * the current item will be returned. | 265 | * the current item will be returned. | ||
266 | */ | 266 | **/ | ||
267 | QModelIndex nextPrev(bool forward) const; | 267 | QModelIndex nextPrev(bool forward) const; | ||
268 | 268 | | |||
269 | /** | 269 | /** | ||
270 | * Initializes the model based on the current config. | 270 | * Initializes the model based on the current config. | ||
271 | * This method has to be invoked before showing the TabBox. | 271 | * This method has to be invoked before showing the TabBox. | ||
272 | * It can also be invoked when clients are added or removed. | 272 | * It can also be invoked when clients are added or removed. | ||
273 | * In that case partialReset has to be true. | 273 | * In that case partialReset has to be true. | ||
274 | * | 274 | * | ||
275 | * @param partialReset Keep the currently selected item or regenerate everything | 275 | * @param partialReset Keep the currently selected item or regenerate everything | ||
276 | */ | 276 | **/ | ||
277 | void createModel(bool partialReset = false); | 277 | void createModel(bool partialReset = false); | ||
278 | 278 | | |||
279 | /** | 279 | /** | ||
280 | * @param desktop The desktop whose index should be retrieved | 280 | * @param desktop The desktop whose index should be retrieved | ||
281 | * @return The model index of given desktop. If TabBoxMode is not | 281 | * @return The model index of given desktop. If TabBoxMode is not | ||
282 | * TabBoxConfig::DesktopTabBox an invalid model index will be returned. | 282 | * TabBoxConfig::DesktopTabBox an invalid model index will be returned. | ||
283 | */ | 283 | **/ | ||
284 | QModelIndex desktopIndex(int desktop) const; | 284 | QModelIndex desktopIndex(int desktop) const; | ||
285 | /** | 285 | /** | ||
286 | * @return The current list of desktops. | 286 | * @return The current list of desktops. | ||
287 | * If TabBoxMode is not TabBoxConfig::DesktopTabBox an empty list will | 287 | * If TabBoxMode is not TabBoxConfig::DesktopTabBox an empty list will | ||
288 | * be returned. | 288 | * be returned. | ||
289 | * @see DesktopModel::desktopList | 289 | * @see DesktopModel::desktopList | ||
290 | */ | 290 | **/ | ||
291 | QList< int > desktopList() const; | 291 | QList< int > desktopList() const; | ||
292 | /** | 292 | /** | ||
293 | * @return The desktop for given model index. If the index is not valid | 293 | * @return The desktop for given model index. If the index is not valid | ||
294 | * or TabBoxMode is not TabBoxConfig::DesktopTabBox -1 will be returned. | 294 | * or TabBoxMode is not TabBoxConfig::DesktopTabBox -1 will be returned. | ||
295 | * @see DesktopModel::desktopIndex | 295 | * @see DesktopModel::desktopIndex | ||
296 | */ | 296 | **/ | ||
297 | int desktop(const QModelIndex& index) const; | 297 | int desktop(const QModelIndex& index) const; | ||
298 | 298 | | |||
299 | /** | 299 | /** | ||
300 | * Handles additional grabbed key events by the TabBox controller. | 300 | * Handles additional grabbed key events by the TabBox controller. | ||
301 | * @param event The key event which has been grabbed | 301 | * @param event The key event which has been grabbed | ||
302 | */ | 302 | **/ | ||
303 | virtual void grabbedKeyEvent(QKeyEvent* event) const; | 303 | virtual void grabbedKeyEvent(QKeyEvent* event) const; | ||
304 | /** | 304 | /** | ||
305 | * @param pos The position to be tested in global coordinates | 305 | * @param pos The position to be tested in global coordinates | ||
306 | * @return True if the view contains the point, otherwise false. | 306 | * @return True if the view contains the point, otherwise false. | ||
307 | */ | 307 | **/ | ||
308 | bool containsPos(const QPoint& pos) const; | 308 | bool containsPos(const QPoint& pos) const; | ||
309 | /** | 309 | /** | ||
310 | * @param client The TabBoxClient whose index should be returned | 310 | * @param client The TabBoxClient whose index should be returned | ||
311 | * @return Returns the ModelIndex of given TabBoxClient or an invalid ModelIndex | 311 | * @return Returns the ModelIndex of given TabBoxClient or an invalid ModelIndex | ||
312 | * if the model does not contain the given TabBoxClient. | 312 | * if the model does not contain the given TabBoxClient. | ||
313 | * @see ClientModel::index | 313 | * @see ClientModel::index | ||
314 | */ | 314 | **/ | ||
315 | QModelIndex index(QWeakPointer<TabBoxClient> client) const; | 315 | QModelIndex index(QWeakPointer<TabBoxClient> client) const; | ||
316 | /** | 316 | /** | ||
317 | * @return Returns the current list of TabBoxClients. | 317 | * @return Returns the current list of TabBoxClients. | ||
318 | * If TabBoxMode is not TabBoxConfig::ClientTabBox an empty list will | 318 | * If TabBoxMode is not TabBoxConfig::ClientTabBox an empty list will | ||
319 | * be returned. | 319 | * be returned. | ||
320 | * @see ClientModel::clientList | 320 | * @see ClientModel::clientList | ||
321 | */ | 321 | **/ | ||
322 | TabBoxClientList clientList() const; | 322 | TabBoxClientList clientList() const; | ||
323 | /** | 323 | /** | ||
324 | * @param index The index of the client to be returned | 324 | * @param index The index of the client to be returned | ||
325 | * @return Returns the TabBoxClient at given model index. If | 325 | * @return Returns the TabBoxClient at given model index. If | ||
326 | * the index is invalid, does not point to a Client or the list | 326 | * the index is invalid, does not point to a Client or the list | ||
327 | * is empty, NULL will be returned. | 327 | * is empty, NULL will be returned. | ||
328 | */ | 328 | **/ | ||
329 | TabBoxClient* client(const QModelIndex& index) const; | 329 | TabBoxClient* client(const QModelIndex& index) const; | ||
330 | /** | 330 | /** | ||
331 | * @return The first model index. That is the model index at position 0, 0. | 331 | * @return The first model index. That is the model index at position 0, 0. | ||
332 | * It is valid, as desktop has at least one desktop and if there are no | 332 | * It is valid, as desktop has at least one desktop and if there are no | ||
333 | * clients an empty item is created. | 333 | * clients an empty item is created. | ||
334 | */ | 334 | **/ | ||
335 | QModelIndex first() const; | 335 | QModelIndex first() const; | ||
336 | 336 | | |||
337 | bool eventFilter(QObject *watcher, QEvent *event) override; | 337 | bool eventFilter(QObject *watcher, QEvent *event) override; | ||
338 | 338 | | |||
339 | /** | 339 | /** | ||
340 | * @returns whether the TabBox operates in a no modifier grab mode. | 340 | * @returns whether the TabBox operates in a no modifier grab mode. | ||
341 | * In this mode a click on an item should directly accept and close the tabbox. | 341 | * In this mode a click on an item should directly accept and close the tabbox. | ||
342 | **/ | 342 | **/ | ||
343 | virtual bool noModifierGrab() const = 0; | 343 | virtual bool noModifierGrab() const = 0; | ||
344 | 344 | | |||
345 | Q_SIGNALS: | 345 | Q_SIGNALS: | ||
346 | /** | 346 | /** | ||
347 | * This signal is fired when the TabBoxConfig changes | 347 | * This signal is fired when the TabBoxConfig changes | ||
348 | * @see setConfig | 348 | * @see setConfig | ||
349 | */ | 349 | **/ | ||
350 | void configChanged(); | 350 | void configChanged(); | ||
351 | void selectedIndexChanged(); | 351 | void selectedIndexChanged(); | ||
352 | 352 | | |||
353 | private Q_SLOTS: | 353 | private Q_SLOTS: | ||
354 | void initHighlightWindows(); | 354 | void initHighlightWindows(); | ||
355 | 355 | | |||
356 | private: | 356 | private: | ||
357 | friend class TabBoxHandlerPrivate; | 357 | friend class TabBoxHandlerPrivate; | ||
358 | TabBoxHandlerPrivate* d; | 358 | TabBoxHandlerPrivate* d; | ||
359 | }; | 359 | }; | ||
360 | 360 | | |||
361 | /** | 361 | /** | ||
362 | * This class is a wrapper around a KWin Client. It is used for accessing the | 362 | * This class is a wrapper around a KWin Client. It is used for accessing the | ||
363 | * required client methods from inside TabBox and has to be implemented in KWin core. | 363 | * required client methods from inside TabBox and has to be implemented in KWin core. | ||
364 | * | 364 | * | ||
365 | * @author Martin Gräßlin <mgraesslin@kde.org> | 365 | * @author Martin Gräßlin <mgraesslin@kde.org> | ||
366 | * @since 4.4 | 366 | * @since 4.4 | ||
367 | */ | 367 | **/ | ||
368 | class TabBoxClient | 368 | class TabBoxClient | ||
369 | { | 369 | { | ||
370 | public: | 370 | public: | ||
371 | TabBoxClient(); | 371 | TabBoxClient(); | ||
372 | virtual ~TabBoxClient(); | 372 | virtual ~TabBoxClient(); | ||
373 | 373 | | |||
374 | /** | 374 | /** | ||
375 | * @return The caption of the client | 375 | * @return The caption of the client | ||
376 | */ | 376 | **/ | ||
377 | virtual QString caption() const = 0; | 377 | virtual QString caption() const = 0; | ||
378 | /** | 378 | /** | ||
379 | * @param size Requested size of the icon | 379 | * @param size Requested size of the icon | ||
380 | * @return The icon of the client | 380 | * @return The icon of the client | ||
381 | */ | 381 | **/ | ||
382 | virtual QIcon icon() const = 0; | 382 | virtual QIcon icon() const = 0; | ||
383 | /** | 383 | /** | ||
384 | * @return The window Id of the client | 384 | * @return The window Id of the client | ||
385 | */ | 385 | **/ | ||
386 | virtual WId window() const = 0; | 386 | virtual WId window() const = 0; | ||
387 | /** | 387 | /** | ||
388 | * @return Minimized state of the client | 388 | * @return Minimized state of the client | ||
389 | */ | 389 | **/ | ||
390 | virtual bool isMinimized() const = 0; | 390 | virtual bool isMinimized() const = 0; | ||
391 | virtual int x() const = 0; | 391 | virtual int x() const = 0; | ||
392 | virtual int y() const = 0; | 392 | virtual int y() const = 0; | ||
393 | virtual int width() const = 0; | 393 | virtual int width() const = 0; | ||
394 | virtual int height() const = 0; | 394 | virtual int height() const = 0; | ||
395 | virtual bool isCloseable() const = 0; | 395 | virtual bool isCloseable() const = 0; | ||
396 | virtual void close() = 0; | 396 | virtual void close() = 0; | ||
397 | virtual bool isFirstInTabBox() const = 0; | 397 | virtual bool isFirstInTabBox() const = 0; | ||
Show All 12 Lines |