kmditaskbar.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _KMDITASKBAR_H_
00029 #define _KMDITASKBAR_H_
00030
00031 #include <ktoolbar.h>
00032 #include <qptrlist.h>
00033 #include <qpixmap.h>
00034 #include <qlabel.h>
00035 #include <qpushbutton.h>
00036
00037 #include "kmdidefines.h"
00038
00039 class KMdiMainFrm;
00040 class KMdiChildView;
00041 class KMdiTaskBar;
00042
00043 class KMdiTaskBarButtonPrivate;
00044
00051 class KMDI_EXPORT KMdiTaskBarButton : public QPushButton
00052 {
00053 Q_OBJECT
00054
00055 public:
00059 KMdiTaskBarButton( KMdiTaskBar *pTaskBar, KMdiChildView *win_ptr );
00063 ~KMdiTaskBarButton();
00067 QString actualText() const;
00071 void fitText( const QString&, int newWidth );
00075 void setText( const QString& );
00076 signals:
00080 void clicked( KMdiChildView* );
00084 void leftMouseButtonClicked( KMdiChildView* );
00088 void rightMouseButtonClicked( KMdiChildView* );
00092 void buttonTextChanged( int );
00093 public slots:
00097 void setNewText( const QString& );
00098 protected slots:
00102 void mousePressEvent( QMouseEvent* );
00103
00104
00105 public:
00109 KMdiChildView *m_pWindow;
00110 protected:
00114 QString m_actualText;
00115
00116 private:
00117 KMdiTaskBarButtonPrivate *d;
00118 };
00119
00120
00121 class KMdiTaskBarPrivate;
00129 class KMDI_EXPORT KMdiTaskBar : public KToolBar
00130 {
00131 Q_OBJECT
00132 public:
00136 KMdiTaskBar( KMdiMainFrm *parent, QMainWindow::ToolBarDock dock );
00140 ~KMdiTaskBar();
00146 KMdiTaskBarButton * addWinButton( KMdiChildView *win_ptr );
00151 void removeWinButton( KMdiChildView *win_ptr, bool haveToLayoutTaskBar = true );
00156 KMdiTaskBarButton * getNextWindowButton( bool bRight, KMdiChildView *win_ptr );
00160 KMdiTaskBarButton * getButton( KMdiChildView *win_ptr );
00164 void switchOn( bool bOn );
00168 bool isSwitchedOn() const
00169 {
00170 return m_bSwitchedOn;
00171 };
00172 protected:
00176 void resizeEvent( QResizeEvent* );
00177 protected slots:
00185 void layoutTaskBar( int taskBarWidth = 0 );
00186 public slots:
00191 void setActiveButton( KMdiChildView *win_ptr );
00192 protected:
00197 QPtrList<KMdiTaskBarButton>* m_pButtonList;
00201 KMdiMainFrm* m_pFrm;
00205 KMdiChildView* m_pCurrentFocusedWindow;
00209 QLabel* m_pStretchSpace;
00210 bool m_layoutIsPending;
00211 bool m_bSwitchedOn;
00212
00213 private:
00214 KMdiTaskBarPrivate *d;
00215 };
00216
00217 #endif //_KMDITASKBAR_H_
00218
00219
|