~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy-backports

« back to all changes in this revision

Viewing changes to kwin/tabbox.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-09-05 20:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20070905204514-632hhspl0nvrc84i
Tags: upstream-3.93.0
ImportĀ upstreamĀ versionĀ 3.93.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************
 
2
 KWin - the KDE window manager
 
3
 This file is part of the KDE project.
 
4
 
 
5
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
 
6
Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
 
7
 
 
8
You can Freely distribute this program under the GNU General Public
 
9
License. See the file "COPYING" for the exact licensing terms.
 
10
******************************************************************/
 
11
 
 
12
#ifndef KWIN_TABBOX_H
 
13
#define KWIN_TABBOX_H
 
14
 
 
15
#include <QFrame>
 
16
#include <QTimer>
 
17
#include "utils.h"
 
18
 
 
19
 
 
20
namespace KWin
 
21
{
 
22
 
 
23
class Workspace;
 
24
class Client;
 
25
 
 
26
class TabBox : public QFrame
 
27
    {
 
28
    Q_OBJECT
 
29
    public:
 
30
        TabBox( Workspace *ws );
 
31
        ~TabBox();
 
32
 
 
33
        Client* currentClient();
 
34
        ClientList currentClientList();
 
35
        int currentDesktop();
 
36
        QList< int > currentDesktopList();
 
37
 
 
38
        void setCurrentClient( Client* newClient );
 
39
        void setCurrentDesktop( int newDesktop );
 
40
 
 
41
        enum SortOrder { StaticOrder, MostRecentlyUsedOrder };
 
42
        void setMode( TabBoxMode mode );
 
43
        TabBoxMode mode() const;
 
44
 
 
45
        void reset( bool partial_reset = false );
 
46
        void nextPrev( bool next = true);
 
47
 
 
48
        void delayedShow();
 
49
        void hide();
 
50
 
 
51
        void refDisplay();
 
52
        void unrefDisplay();
 
53
        bool isDisplayed() const;
 
54
 
 
55
        void handleMouseEvent( XEvent* );
 
56
 
 
57
        Workspace* workspace() const;
 
58
 
 
59
        void reconfigure();
 
60
 
 
61
    public slots:
 
62
        void show();
 
63
 
 
64
    protected:
 
65
        void showEvent( QShowEvent* );
 
66
        void hideEvent( QHideEvent* );
 
67
        void paintEvent( QPaintEvent* );
 
68
 
 
69
    private:
 
70
        void createClientList(ClientList &list, int desktop /*-1 = all*/, Client *start, bool chain);
 
71
        void createDesktopList(QList< int > &list, int start, SortOrder order);
 
72
 
 
73
    private:
 
74
        Workspace* wspace;
 
75
        TabBoxMode m;
 
76
        ClientList clients;
 
77
        Client* client;
 
78
        QList< int > desktops;
 
79
        int desk;
 
80
 
 
81
        QTimer delayedShowTimer;
 
82
        int display_refcount;
 
83
        QString no_tasks;
 
84
        int lineHeight;
 
85
        bool showMiniIcon;
 
86
        bool options_traverse_all;
 
87
    };
 
88
 
 
89
 
 
90
/*!
 
91
  Returns the tab box' workspace
 
92
 */
 
93
inline Workspace* TabBox::workspace() const
 
94
    {
 
95
    return wspace;
 
96
    }
 
97
 
 
98
/*!
 
99
  Returns the current mode, either TabBoxDesktopListMode or TabBoxWindowsMode
 
100
 
 
101
  \sa setMode()
 
102
 */
 
103
inline TabBoxMode TabBox::mode() const
 
104
    {
 
105
    return m;
 
106
    }
 
107
 
 
108
/*!
 
109
  Increase the reference count, preventing the default tabbox from showing.
 
110
 
 
111
  \sa unrefDisplay(), isDisplayed()
 
112
 */
 
113
inline void TabBox::refDisplay()
 
114
    {
 
115
    ++display_refcount;
 
116
    }
 
117
 
 
118
/*!
 
119
  Returns whether the tab box is being displayed, either natively or by an
 
120
  effect.
 
121
 
 
122
  \sa refDisplay(), unrefDisplay()
 
123
 */
 
124
inline bool TabBox::isDisplayed() const
 
125
    {
 
126
    return display_refcount > 0;
 
127
    }
 
128
 
 
129
} // namespace
 
130
 
 
131
#endif