Changeset View
Changeset View
Standalone View
Standalone View
tabbox/tabbox.h
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | |||||
114 | }; | 114 | }; | ||
115 | 115 | | |||
116 | class KWIN_EXPORT TabBox : public QObject | 116 | class KWIN_EXPORT TabBox : public QObject | ||
117 | { | 117 | { | ||
118 | Q_OBJECT | 118 | Q_OBJECT | ||
119 | public: | 119 | public: | ||
120 | ~TabBox(); | 120 | ~TabBox(); | ||
121 | 121 | | |||
122 | /** | ||||
123 | * Returns the currently displayed client ( only works in TabBoxWindowsMode ). | ||||
124 | * Returns 0 if no client is displayed. | ||||
125 | **/ | ||||
122 | AbstractClient *currentClient(); | 126 | AbstractClient *currentClient(); | ||
127 | | ||||
128 | /** | ||||
129 | * Returns the list of clients potentially displayed ( only works in | ||||
130 | * TabBoxWindowsMode ). | ||||
131 | * Returns an empty list if no clients are available. | ||||
132 | **/ | ||||
123 | QList<AbstractClient*> currentClientList(); | 133 | QList<AbstractClient*> currentClientList(); | ||
134 | | ||||
135 | /** | ||||
136 | * Returns the currently displayed virtual desktop ( only works in | ||||
137 | * TabBoxDesktopListMode ) | ||||
138 | * Returns -1 if no desktop is displayed. | ||||
139 | **/ | ||||
124 | int currentDesktop(); | 140 | int currentDesktop(); | ||
141 | | ||||
142 | /** | ||||
143 | * Returns the list of desktops potentially displayed ( only works in | ||||
144 | * TabBoxDesktopListMode ) | ||||
145 | * Returns an empty list if no are available. | ||||
146 | **/ | ||||
125 | QList< int > currentDesktopList(); | 147 | QList< int > currentDesktopList(); | ||
126 | 148 | | |||
149 | /** | ||||
150 | * Change the currently selected client, and notify the effects. | ||||
151 | * | ||||
152 | * @see setCurrentDesktop | ||||
153 | **/ | ||||
127 | void setCurrentClient(AbstractClient *newClient); | 154 | void setCurrentClient(AbstractClient *newClient); | ||
155 | | ||||
156 | /** | ||||
157 | * Change the currently selected desktop, and notify the effects. | ||||
158 | * | ||||
159 | * @see setCurrentClient | ||||
160 | **/ | ||||
128 | void setCurrentDesktop(int newDesktop); | 161 | void setCurrentDesktop(int newDesktop); | ||
129 | 162 | | |||
163 | /** | ||||
164 | * Sets the current mode to \a mode, either TabBoxDesktopListMode or TabBoxWindowsMode | ||||
165 | * | ||||
166 | * @see mode | ||||
167 | **/ | ||||
130 | void setMode(TabBoxMode mode); | 168 | void setMode(TabBoxMode mode); | ||
131 | TabBoxMode mode() const { | 169 | TabBoxMode mode() const { | ||
132 | return m_tabBoxMode; | 170 | return m_tabBoxMode; | ||
133 | } | 171 | } | ||
134 | 172 | | |||
173 | /** | ||||
174 | * Resets the tab box to display the active client in TabBoxWindowsMode, or the | ||||
175 | * current desktop in TabBoxDesktopListMode | ||||
176 | **/ | ||||
135 | void reset(bool partial_reset = false); | 177 | void reset(bool partial_reset = false); | ||
178 | | ||||
179 | /** | ||||
180 | * Shows the next or previous item, depending on \a next | ||||
181 | **/ | ||||
136 | void nextPrev(bool next = true); | 182 | void nextPrev(bool next = true); | ||
137 | 183 | | |||
184 | /** | ||||
185 | * Shows the tab box after some delay. | ||||
186 | * | ||||
187 | * If the 'ShowDelay' setting is false, show() is simply called. | ||||
188 | * | ||||
189 | * Otherwise, we start a timer for the delay given in the settings and only | ||||
190 | * do a show() when it times out. | ||||
191 | * | ||||
192 | * This means that you can alt-tab between windows and you don't see the | ||||
193 | * tab box immediately. Not only does this make alt-tabbing faster, it gives | ||||
194 | * less 'flicker' to the eyes. You don't need to see the tab box if you're | ||||
195 | * just quickly switching between 2 or 3 windows. It seems to work quite | ||||
196 | * nicely. | ||||
197 | **/ | ||||
138 | void delayedShow(); | 198 | void delayedShow(); | ||
139 | void hide(bool abort = false); | | |||
140 | 199 | | |||
141 | /*! | 200 | /** | ||
142 | Increase the reference count, preventing the default tabbox from showing. | 201 | * Notify effects that the tab box is being hidden. | ||
202 | **/ | ||||
203 | void hide(bool abort = false); | ||||
143 | 204 | | |||
144 | \sa unreference(), isDisplayed() | 205 | /** | ||
145 | */ | 206 | * Increases the reference count, preventing the default tabbox from showing. | ||
207 | * | ||||
208 | * @see unreference | ||||
209 | * @see isDisplayed | ||||
210 | **/ | ||||
146 | void reference() { | 211 | void reference() { | ||
147 | ++m_displayRefcount; | 212 | ++m_displayRefcount; | ||
148 | } | 213 | } | ||
149 | /*! | 214 | | ||
150 | Decrease the reference count. Only when the reference count is 0 will | 215 | /** | ||
151 | the default tab box be shown. | 216 | * Decreases the reference count. Only when the reference count is 0 will | ||
152 | */ | 217 | * the default tab box be shown. | ||
218 | **/ | ||||
153 | void unreference() { | 219 | void unreference() { | ||
154 | --m_displayRefcount; | 220 | --m_displayRefcount; | ||
155 | } | 221 | } | ||
156 | /*! | | |||
157 | Returns whether the tab box is being displayed, either natively or by an | | |||
158 | effect. | | |||
159 | 222 | | |||
160 | \sa reference(), unreference() | 223 | /** | ||
161 | */ | 224 | * Returns whether the tab box is being displayed, either natively or by an | ||
225 | * effect. | ||||
226 | * | ||||
227 | * @see reference | ||||
228 | * @see unreference | ||||
229 | **/ | ||||
162 | bool isDisplayed() const { | 230 | bool isDisplayed() const { | ||
163 | return m_displayRefcount > 0; | 231 | return m_displayRefcount > 0; | ||
164 | } | 232 | } | ||
165 | 233 | | |||
166 | /** | 234 | /** | ||
167 | * @returns @c true if TabBox is shown, @c false if replaced by Effect | 235 | * @returns @c true if TabBox is shown, @c false if replaced by Effect | ||
168 | **/ | 236 | **/ | ||
169 | bool isShown() const { | 237 | bool isShown() const { | ||
Show All 25 Lines | 262 | bool noModifierGrab() const { | |||
195 | return m_noModifierGrab; | 263 | return m_noModifierGrab; | ||
196 | } | 264 | } | ||
197 | void setCurrentIndex(QModelIndex index, bool notifyEffects = true); | 265 | void setCurrentIndex(QModelIndex index, bool notifyEffects = true); | ||
198 | 266 | | |||
199 | static TabBox *self(); | 267 | static TabBox *self(); | ||
200 | static TabBox *create(QObject *parent); | 268 | static TabBox *create(QObject *parent); | ||
201 | 269 | | |||
202 | public Q_SLOTS: | 270 | public Q_SLOTS: | ||
271 | /** | ||||
272 | * Notify effects that the tab box is being shown, and only display the | ||||
273 | * default tab box QFrame if no effect has referenced the tab box. | ||||
274 | **/ | ||||
203 | void show(); | 275 | void show(); | ||
204 | void close(bool abort = false); | 276 | void close(bool abort = false); | ||
205 | void accept(bool closeTabBox = true); | 277 | void accept(bool closeTabBox = true); | ||
206 | void slotWalkThroughDesktops(); | 278 | void slotWalkThroughDesktops(); | ||
207 | void slotWalkBackThroughDesktops(); | 279 | void slotWalkBackThroughDesktops(); | ||
208 | void slotWalkThroughDesktopList(); | 280 | void slotWalkThroughDesktopList(); | ||
209 | void slotWalkBackThroughDesktopList(); | 281 | void slotWalkBackThroughDesktopList(); | ||
210 | void slotWalkThroughWindows(); | 282 | void slotWalkThroughWindows(); | ||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |