lib
KoTabBar.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 #ifndef kotabbar_h
00026 #define kotabbar_h
00027
00028 #include <qwidget.h>
00029 #include <qstringlist.h>
00030 #include <koffice_export.h>
00031 class KoTabBarPrivate;
00032
00061 class KOFFICEUI_EXPORT KoTabBar : public QWidget
00062 {
00063 Q_OBJECT
00064
00065 Q_PROPERTY( QString activeTab READ activeTab WRITE setActiveTab )
00066 Q_PROPERTY( bool readOnly READ readOnly WRITE setReadOnly )
00067 Q_PROPERTY( QStringList tabs READ tabs WRITE setTabs )
00068 Q_PROPERTY( unsigned count READ count )
00069
00070 public:
00071
00075 KoTabBar( QWidget* parent = 0, const char *name = 0 );
00076
00080 virtual ~KoTabBar();
00081
00085 bool readOnly() const;
00086
00091 bool reverseLayout() const;
00092
00096 QStringList tabs() const;
00097
00102 unsigned count() const;
00103
00107 QString activeTab() const;
00108
00114 bool canScrollBack() const;
00115
00121 bool canScrollForward() const;
00122
00126 void ensureVisible( const QString& tab );
00127
00128 public slots:
00129
00133 void setTabs( const QStringList& list );
00134
00142 void setReadOnly( bool ro );
00143
00148 void setReverseLayout( bool reverse );
00149
00153 void addTab( const QString& text );
00154
00160 void removeTab( const QString& text );
00161
00165 void renameTab( const QString& old_name, const QString& new_name );
00166
00177 void moveTab( unsigned tab, unsigned target );
00178
00185 void scrollBack();
00186
00193 void scrollForward();
00194
00201 void scrollFirst();
00202
00209 void scrollLast();
00210
00214 void setActiveTab( const QString& text );
00215
00219 void clear();
00220
00221 QSize sizeHint() const;
00222
00223 signals:
00224
00228 void tabChanged( const QString& _text );
00229
00240 void tabMoved( unsigned tab, unsigned target );
00241
00246 void contextMenu( const QPoint& pos );
00247
00251 void doubleClicked();
00252
00253 protected slots:
00254 void autoScrollBack();
00255 void autoScrollForward();
00256
00257 protected:
00258 virtual void paintEvent ( QPaintEvent* ev );
00259 virtual void resizeEvent( QResizeEvent* ev );
00260 virtual void mousePressEvent ( QMouseEvent* ev );
00261 virtual void mouseReleaseEvent ( QMouseEvent* ev );
00262 virtual void mouseDoubleClickEvent ( QMouseEvent* ev );
00263 virtual void mouseMoveEvent ( QMouseEvent* ev );
00264 virtual void wheelEvent ( QWheelEvent * e );
00265
00266 private:
00267 KoTabBarPrivate *d;
00268
00269
00270 KoTabBar( const KoTabBar& );
00271 KoTabBar& operator=( const KoTabBar& );
00272 };
00273
00274
00275 #endif // kotabbar_h
|