summaryrefslogtreecommitdiffstats
path: root/twin/tabbox.h
blob: 3fd419ad7f34ab6c06f602b48d94d33f58a5f3fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*****************************************************************
 KWin - the KDE window manager
 This file is part of the KDE project.

Copyright (C) 1999, 2000 Matthias Ettrich <[email protected]>
Copyright (C) 2003 Lubos Lunak <[email protected]>

You can Freely distribute this program under the GNU General Public
License. See the file "COPYING" for the exact licensing terms.
******************************************************************/

#ifndef KWIN_TABBOX_H
#define KWIN_TABBOX_H

#include <tqframe.h>
#include <tqtimer.h>
#include <tqvaluelist.h>
#include "utils.h"

class TQLabel;

namespace KWinInternal
{

class Workspace;
class Client;

class TabBox : public TQFrame
    {
    TQ_OBJECT
    public:
        TabBox( Workspace *ws, const char *name=0 );
        ~TabBox();

        Client* currentClient();
        void setCurrentClient( Client* c );
        int currentDesktop();
        
    // DesktopMode and WindowsMode are based on the order in which the desktop
    //  or window were viewed.
    // DesktopListMode lists them in the order created.
        enum Mode { DesktopMode, DesktopListMode, WindowsMode };
        void setMode( Mode mode );
        void setAppsOnly( bool a );
        Mode mode() const;
        bool isAppsOnly() const;

        void reset();
        void nextPrev( bool next = TRUE);

        void delayedShow();
        void hide();

        void handleMouseEvent( XEvent* );

        Workspace* workspace() const;

        void reconfigure();

    protected:
        void showEvent( TQShowEvent* );
        void hideEvent( TQHideEvent* );
        void drawContents( TQPainter * );

    private:
        void createClientList(ClientList &list, int desktop /*-1 = all*/, Client *start, bool chain);
        void updateOutline();

    private:
        Client* current_client;
        Mode m;
        Workspace* wspace;
        ClientList clients;
        int desk;
        int lineHeight;
        bool showMiniIcon;
        bool appsOnly;
        TQTimer delayedShowTimer;
        TQString no_tasks;
        bool options_traverse_all;
        Window outline_left, outline_right, outline_top, outline_bottom;
    };


/*!
  Returns the tab box' workspace
 */
inline Workspace* TabBox::workspace() const
    {
    return wspace;
    }

/*!
  Returns the current mode, either DesktopListMode or WindowsMode

  \sa setMode()
 */
inline TabBox::Mode TabBox::mode() const
    {
    return m;
    }

/*! 
  Returns the appsOnly variable

  \sa setAppsOnly()
  */
inline bool TabBox::isAppsOnly() const
    {
    return appsOnly;
    }


} // namespace

#endif