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         void setCurrentClient( Client* c );
00037         int currentDesktop();
00038 
00039     // DesktopMode and WindowsMode are based on the order in which the desktop
00040     //  or window were viewed.
00041     // DesktopListMode lists them in the order created.
00042         enum Mode { DesktopMode, DesktopListMode, WindowsMode };
00043         void setMode( Mode mode );
00044         Mode mode() const;
00045 
00046         void reset();
00047         void nextPrev( bool next = TRUE);
00048 
00049         void delayedShow();
00050         void hide();
00051 
00052         void handleMouseEvent( XEvent* );
00053 
00054         Workspace* workspace() const;
00055 
00056         void reconfigure();
00057         void updateKeyMapping();
00058 
00059     protected:
00060         void showEvent( QShowEvent* );
00061         void hideEvent( QHideEvent* );
00062         void drawContents( QPainter * );
00063 
00064     private:
00065         void createClientList(ClientList &list, int desktop /*-1 = all*/, Client *start, bool chain);
00066         void updateOutline();
00067 
00068     private:
00069         Client* current_client;
00070         Mode m;
00071         Workspace* wspace;
00072         ClientList clients;
00073         int desk;
00074         int lineHeight;
00075         bool showMiniIcon;
00076         QTimer delayedShowTimer;
00077         QString no_tasks;
00078         bool options_traverse_all;
00079         Window outline_left, outline_right, outline_top, outline_bottom;
00080     };
00081 
00082 
00086 inline Workspace* TabBox::workspace() const
00087     {
00088     return wspace;
00089     }
00090 
00096 inline TabBox::Mode TabBox::mode() const
00097     {
00098     return m;
00099     }
00100 
00101 } // namespace
00102 
00103 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys