tabbox.h

00001 /*****************************************************************
00002  KWin - the KDE window manager
00003  This file is part of the KDE project.
00004 
00005 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
00006 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
00007 
00008 You can Freely distribute this program under the GNU General Public
00009 License. See the file "COPYING" for the exact licensing terms.
00010 ******************************************************************/
00011 
00012 #ifndef KWIN_TABBOX_H
00013 #define KWIN_TABBOX_H
00014 
00015 #include <qframe.h>
00016 #include <qtimer.h>
00017 #include <qvaluelist.h>
00018 #include "utils.h"
00019 
00020 class QLabel;
00021 
00022 namespace KWinInternal
00023 {
00024 
00025 class Workspace;
00026 class Client;
00027 
00028 class TabBox : public QFrame
00029     {
00030     Q_OBJECT
00031     public:
00032         TabBox( Workspace *ws, const char *name=0 );
00033         ~TabBox();
00034 
00035         Client* currentClient();
00036         int currentDesktop();
00037 
00038     // DesktopMode and WindowsMode are based on the order in which the desktop
00039     //  or window were viewed.
00040     // DesktopListMode lists them in the order created.
00041         enum Mode { DesktopMode, DesktopListMode, WindowsMode };
00042         void setMode( Mode mode );
00043         Mode mode() const;
00044 
00045         void reset();
00046         void nextPrev( bool next = TRUE);
00047 
00048         void delayedShow();
00049         void hide();
00050 
00051         void handleMouseEvent( XEvent* );
00052 
00053         Workspace* workspace() const;
00054 
00055         void reconfigure();
00056         void updateKeyMapping();
00057 
00058     protected:
00059         void showEvent( QShowEvent* );
00060         void hideEvent( QHideEvent* );
00061         void drawContents( QPainter * );
00062 
00063     private:
00064         void createClientList(ClientList &list, int desktop /*-1 = all*/, Client *start, bool chain);
00065 
00066     private:
00067         Client* client;
00068         Mode m;
00069         Workspace* wspace;
00070         ClientList clients;
00071         int desk;
00072         int lineHeight;
00073         bool showMiniIcon;
00074         QTimer delayedShowTimer;
00075         QString no_tasks;
00076         bool options_traverse_all;
00077     };
00078 
00079 
00083 inline Workspace* TabBox::workspace() const
00084     {
00085     return wspace;
00086     }
00087 
00093 inline TabBox::Mode TabBox::mode() const
00094     {
00095     return m;
00096     }
00097 
00098 } // namespace
00099 
00100 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys