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 <tqframe.h> 00016 #include <tqtimer.h> 00017 #include <tqvaluelist.h> 00018 #include "utils.h" 00019 00020 class TQLabel; 00021 00022 namespace KWinInternal 00023 { 00024 00025 class Workspace; 00026 class Client; 00027 00028 class TabBox : public TQFrame 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 00058 protected: 00059 void showEvent( TQShowEvent* ); 00060 void hideEvent( TQHideEvent* ); 00061 void drawContents( TQPainter * ); 00062 00063 private: 00064 void createClientList(ClientList &list, int desktop /*-1 = all*/, Client *start, bool chain); 00065 void updateOutline(); 00066 00067 private: 00068 Client* current_client; 00069 Mode m; 00070 Workspace* wspace; 00071 ClientList clients; 00072 int desk; 00073 int lineHeight; 00074 bool showMiniIcon; 00075 TQTimer delayedShowTimer; 00076 TQString no_tasks; 00077 bool options_traverse_all; 00078 Window outline_left, outline_right, outline_top, outline_bottom; 00079 }; 00080 00081 00085 inline Workspace* TabBox::workspace() const 00086 { 00087 return wspace; 00088 } 00089 00095 inline TabBox::Mode TabBox::mode() const 00096 { 00097 return m; 00098 } 00099 00100 } // namespace 00101 00102 #endif