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 void setAppsOnly( bool a ); 00045 Mode mode() const; 00046 bool isAppsOnly() const; 00047 00048 void reset(); 00049 void nextPrev( bool next = TRUE); 00050 00051 void delayedShow(); 00052 void hide(); 00053 00054 void handleMouseEvent( XEvent* ); 00055 00056 Workspace* workspace() const; 00057 00058 void reconfigure(); 00059 00060 protected: 00061 void showEvent( TQShowEvent* ); 00062 void hideEvent( TQHideEvent* ); 00063 void drawContents( TQPainter * ); 00064 00065 private: 00066 void createClientList(ClientList &list, int desktop /*-1 = all*/, Client *start, bool chain); 00067 void updateOutline(); 00068 00069 private: 00070 Client* current_client; 00071 Mode m; 00072 Workspace* wspace; 00073 ClientList clients; 00074 int desk; 00075 int lineHeight; 00076 bool showMiniIcon; 00077 bool appsOnly; 00078 TQTimer delayedShowTimer; 00079 TQString no_tasks; 00080 bool options_traverse_all; 00081 Window outline_left, outline_right, outline_top, outline_bottom; 00082 }; 00083 00084 00088 inline Workspace* TabBox::workspace() const 00089 { 00090 return wspace; 00091 } 00092 00098 inline TabBox::Mode TabBox::mode() const 00099 { 00100 return m; 00101 } 00102 00108 inline bool TabBox::isAppsOnly() const 00109 { 00110 return appsOnly; 00111 } 00112 00113 00114 } // namespace 00115 00116 #endif