Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / kwin / tabbox.h
blobf1045b210e628758a8d98ff143ca1cda3cf60bb6
1 /********************************************************************
2 KWin - the KDE window manager
3 This file is part of the KDE project.
5 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
6 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *********************************************************************/
22 #ifndef KWIN_TABBOX_H
23 #define KWIN_TABBOX_H
25 #include <QFrame>
26 #include <QTimer>
27 #include "utils.h"
30 namespace KWin
33 class Workspace;
34 class Client;
36 class TabBox : public QFrame
38 Q_OBJECT
39 public:
40 TabBox( Workspace *ws );
41 ~TabBox();
43 Client* currentClient();
44 ClientList currentClientList();
45 int currentDesktop();
46 QList< int > currentDesktopList();
48 void setCurrentClient( Client* newClient );
49 void setCurrentDesktop( int newDesktop );
51 enum SortOrder { StaticOrder, MostRecentlyUsedOrder };
52 void setMode( TabBoxMode mode );
53 TabBoxMode mode() const;
55 void reset( bool partial_reset = false );
56 void nextPrev( bool next = true);
58 void delayedShow();
59 void hide();
61 void refDisplay();
62 void unrefDisplay();
63 bool isDisplayed() const;
65 void handleMouseEvent( XEvent* );
67 Workspace* workspace() const;
69 void reconfigure();
71 public slots:
72 void show();
74 protected:
75 void showEvent( QShowEvent* );
76 void hideEvent( QHideEvent* );
77 void paintEvent( QPaintEvent* );
79 private:
80 void createClientList(ClientList &list, int desktop /*-1 = all*/, Client *start, bool chain);
81 void createDesktopList(QList< int > &list, int start, SortOrder order);
83 private:
84 Workspace* wspace;
85 TabBoxMode m;
86 ClientList clients;
87 Client* client;
88 QList< int > desktops;
89 int desk;
91 QTimer delayedShowTimer;
92 int display_refcount;
93 QString no_tasks;
94 int lineHeight;
95 bool showMiniIcon;
96 bool options_traverse_all;
101 Returns the tab box' workspace
103 inline Workspace* TabBox::workspace() const
105 return wspace;
109 Returns the current mode, either TabBoxDesktopListMode or TabBoxWindowsMode
111 \sa setMode()
113 inline TabBoxMode TabBox::mode() const
115 return m;
119 Increase the reference count, preventing the default tabbox from showing.
121 \sa unrefDisplay(), isDisplayed()
123 inline void TabBox::refDisplay()
125 ++display_refcount;
129 Returns whether the tab box is being displayed, either natively or by an
130 effect.
132 \sa refDisplay(), unrefDisplay()
134 inline bool TabBox::isDisplayed() const
136 return display_refcount > 0;
139 } // namespace
141 #endif