• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kutils
 

kutils

kmultitabbar.h
00001 /***************************************************************************
00002                           kmultitabbar.h -  description
00003                              -------------------
00004     begin                :  2001
00005     copyright            : (C) 2001,2002,2003 by Joseph Wenninger <jowenn@kde.org>
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009     This library is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU Library General Public
00011     License as published by the Free Software Foundation; either
00012     version 2 of the License, or (at your option) any later version.
00013 
00014     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Library General Public License for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with this library; see the file COPYING.LIB.  If not, write to
00021     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00022     Boston, MA 02110-1301, USA.
00023  ***************************************************************************/
00024 
00025 #ifndef _KMultitabbar_h_
00026 #define _KMultitabbar_h_
00027 
00028 #include <tqscrollview.h>
00029 #include <tqvbox.h>
00030 #include <tqhbox.h>
00031 #include <tqlayout.h>
00032 #include <tqstring.h>
00033 #include <tqptrlist.h>
00034 #include <tqpushbutton.h>
00035 
00036 #include <kdelibs_export.h>
00037 
00038 class TQPixmap;
00039 class TQPainter;
00040 class TQFrame;
00041 
00042 class KMultiTabBarPrivate;
00043 class KMultiTabBarTabPrivate;
00044 class KMultiTabBarButtonPrivate;
00045 class KMultiTabBarInternal;
00046 
00056 class KUTILS_EXPORT KMultiTabBar: public TQWidget
00057 {
00058     Q_OBJECT
00059 public:
00063     enum KMultiTabBarMode {
00064         Horizontal,  
00065         Vertical     
00066     };
00067     
00071     enum KMultiTabBarPosition {
00072         Left,   
00073         Right,  
00074         Top,    
00075         Bottom  
00076     };
00077 
00081     enum KMultiTabBarStyle {
00082         VSNET=0,          
00083         KDEV3=1,          
00084         KONQSBC=2,        
00085         KDEV3ICON=3,      
00086         STYLELAST=0xffff  
00087     };
00088 
00095     KMultiTabBar(KMultiTabBarMode bm,TQWidget *parent=0,const char *name=0);
00096     
00100     virtual ~KMultiTabBar();
00101 
00111     int appendButton(const TQPixmap &pic,int id=-1,TQPopupMenu* popup=0,const TQString& not_used_yet=TQString::null);
00115     void removeButton(int id);
00123     int appendTab(const TQPixmap &pic,int id=-1,const TQString& text=TQString::null);
00128     void removeTab(int id);
00134     void setTab(int id ,bool state);
00139     bool isTabRaised(int id) const;
00144     class KMultiTabBarButton *button(int id) const;
00145 
00149     class KMultiTabBarTab *tab(int id) const;
00154     void setPosition(KMultiTabBarPosition pos);
00159     KMultiTabBarPosition position() const;
00164     void setStyle(KMultiTabBarStyle style);
00169     KMultiTabBarStyle tabStyle() const;
00175         TQPtrList<KMultiTabBarTab>* tabs();
00181     TQPtrList<KMultiTabBarButton>* buttons();
00182 
00186     void showActiveTabTexts(bool show=true);
00187 protected:
00188     friend class KMultiTabBarButton;
00189     virtual void fontChange( const TQFont& );
00190     void updateSeparator();
00191 private:
00192     class KMultiTabBarInternal *m_internal;
00193     TQBoxLayout *m_l;
00194     TQFrame *m_btnTabSep;
00195     TQPtrList<KMultiTabBarButton> m_buttons;
00196     KMultiTabBarPosition m_position;
00197     KMultiTabBarPrivate *d;
00198 };
00199 
00205 class KUTILS_EXPORT KMultiTabBarButton: public TQPushButton
00206 {
00207     Q_OBJECT
00208 public:
00210     KMultiTabBarButton(const TQPixmap& pic,const TQString&, TQPopupMenu *popup,
00211         int id,TQWidget *parent, KMultiTabBar::KMultiTabBarPosition pos, KMultiTabBar::KMultiTabBarStyle style);
00213     KMultiTabBarButton(const TQString&, TQPopupMenu *popup,
00214         int id,TQWidget *parent, KMultiTabBar::KMultiTabBarPosition pos, KMultiTabBar::KMultiTabBarStyle style);
00218     virtual  ~KMultiTabBarButton();
00223     int id() const;
00224 
00225 public slots:
00230     void setPosition(KMultiTabBar::KMultiTabBarPosition);
00235     void setStyle(KMultiTabBar::KMultiTabBarStyle);
00236 
00240     void setText(const TQString &);
00241 
00242     TQSize sizeHint() const;
00243 
00244 protected:
00245     KMultiTabBar::KMultiTabBarPosition m_position;
00246     KMultiTabBar::KMultiTabBarStyle m_style;
00247     TQString m_text;
00248     virtual void hideEvent( class TQHideEvent*);
00249     virtual void showEvent( class TQShowEvent*);
00250 private:
00251     int m_id;
00252     KMultiTabBarButtonPrivate *d;
00253 signals:
00258     void clicked(int id);
00259 protected slots:
00260     virtual void slotClicked();
00261 };
00262 
00268 class KUTILS_EXPORT KMultiTabBarTab: public KMultiTabBarButton
00269 {
00270     Q_OBJECT
00271 public:
00273     KMultiTabBarTab(const TQPixmap& pic,const TQString&,int id,TQWidget *parent,
00274         KMultiTabBar::KMultiTabBarPosition pos,KMultiTabBar::KMultiTabBarStyle style);
00278     virtual ~KMultiTabBarTab();
00283     void setState(bool state);
00289     void showActiveTabText(bool show);
00293     void resize(){ setSize( neededSize() ); }
00294 private:
00295     bool m_showActiveTabText;
00296     int m_expandedSize;
00297     KMultiTabBarTabPrivate *d;
00298 protected:
00299     friend class KMultiTabBarInternal;
00300     void setSize(int);
00301     int neededSize();
00302     void updateState();
00303     virtual void drawButton(TQPainter *);
00304     virtual void drawButtonLabel(TQPainter *);
00305     void drawButtonStyled(TQPainter *);
00306     void drawButtonClassic(TQPainter *);
00307 protected slots:
00308     virtual void slotClicked();
00309     void setTabsPosition(KMultiTabBar::KMultiTabBarPosition);
00310 
00311 public slots:
00312     virtual void setIcon(const TQString&);
00313     virtual void setIcon(const TQPixmap&);
00314 };
00315 
00316 #endif

kutils

Skip menu "kutils"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kutils

Skip menu "kutils"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kutils by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |