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

tdeui

  • tdeui
kjanuswidget.h
1 /* This file is part of the KDE Libraries
2  * Copyright (C) 1999-2000 Espen Sand (espen@kde.org)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef _KJANUS_WIDGET_H_
21 #define _KJANUS_WIDGET_H_
22 
23 #include <tqptrlist.h>
24 #include <tqpixmap.h>
25 #include <tqsplitter.h>
26 
27 #include <tdelistbox.h>
28 #include <tqstringlist.h>
29 #include <tqmap.h>
30 
31 class TDEListView;
32 
33 class TQGrid;
34 class TQHBox;
35 class TQLabel;
36 class TQTabWidget;
37 class TQVBox;
38 class TQWidgetStack;
39 class KSeparator;
40 class TQListViewItem;
41 class KGuiItem;
42 
67 class TDEUI_EXPORT KJanusWidget : public TQWidget
68 {
69  Q_OBJECT
70 
71  private:
72  class IconListBox : public TDEListBox
73  {
74  friend class KJanusWidget;
75 
76  public:
77  IconListBox( TQWidget *parent=0, const char *name=0, WFlags f=0 );
78  void updateMinimumHeight();
79  void updateWidth();
80  void invalidateHeight();
81  void invalidateWidth();
82  void setShowAll( bool showAll );
83 
84  protected:
85  void slotOnItem( TQListBoxItem *item );
86  virtual void leaveEvent( TQEvent * );
87 
88  private:
89  bool mShowAll;
90  bool mHeightValid;
91  bool mWidthValid;
92  TQListBoxItem *mOldItem;
93  };
94 
95  public:
96  enum Face
97  {
104  TreeList = 0,
111  Tabbed,
117  Plain,
125  Swallow,
133  IconList
134  };
135 
136  public:
137 
146  KJanusWidget( TQWidget *parent=0, const char *name=0, int face=Plain );
147 
151  ~KJanusWidget();
152 
158  virtual bool showPage( int index );
159 
166  virtual int activePageIndex() const;
167 
174  virtual bool isValid() const;
175 
181  virtual int face() const;
182 
189  virtual TQSize minimumSizeHint() const;
190 
197  virtual TQSize sizeHint() const;
198 
204  virtual TQFrame *plainPage();
205 
225  virtual TQFrame *addPage(const TQString &item,const TQString &header=TQString::null,
226  const TQPixmap &pixmap=TQPixmap() );
227 
242  virtual TQFrame *addPage(const TQStringList &items, const TQString &header=TQString::null,
243  const TQPixmap &pixmap=TQPixmap() );
244 
264  virtual TQVBox *addVBoxPage( const TQString &item,
265  const TQString &header=TQString::null,
266  const TQPixmap &pixmap=TQPixmap() );
267 
280  virtual TQVBox *addVBoxPage( const TQStringList &items,
281  const TQString &header=TQString::null,
282  const TQPixmap &pixmap=TQPixmap() );
283 
304  virtual TQHBox *addHBoxPage( const TQString &itemName,
305  const TQString &header=TQString::null,
306  const TQPixmap &pixmap=TQPixmap() );
307 
320  virtual TQHBox *addHBoxPage( const TQStringList &items,
321  const TQString &header=TQString::null,
322  const TQPixmap &pixmap=TQPixmap() );
323 
347  virtual TQGrid *addGridPage( int n, Orientation dir,
348  const TQString &itemName,
349  const TQString &header=TQString::null,
350  const TQPixmap &pixmap=TQPixmap() );
351 
364  virtual TQGrid *addGridPage( int n, Orientation dir,
365  const TQStringList &items,
366  const TQString &header=TQString::null,
367  const TQPixmap &pixmap=TQPixmap() );
368 
378  void removePage( TQWidget *page );
379 
380 
397  virtual int pageIndex( TQWidget *widget ) const;
398 
408  virtual bool setSwallowedWidget( TQWidget *widget );
409 
420  virtual void setTreeListAutoResize( bool state );
421 
434  virtual void setShowIconsInTreeList(bool state);
435 
444  virtual void setRootIsDecorated( bool state );
445 
459  /*virtual*/ void unfoldTreeList( bool persist = false ); //### KDE4 BIC add virtual
460 
469  /*virtual*/ void addWidgetBelowList( TQWidget * widget ); // ### KDE4
470 
481  /*virtual*/ void addButtonBelowList( const TQString & text, TQObject * recv,
482  const char * slot ); //### KDE4
483 
495  /*virtual*/ void addButtonBelowList( const KGuiItem & guiitem, TQObject *
496  recv, const char * slot ); //### KDE4
497 
510  virtual void setIconListAllVisible( bool state );
511 
517  virtual void setFolderIcon(const TQStringList &path, const TQPixmap &pixmap);
524  /*virtual*/ TQString pageTitle(int index) const;
532  /*virtual*/ TQWidget *pageWidget(int index) const;
533 
534  signals:
540  void aboutToShowPage(TQWidget *page);
541 
542  public slots:
546  virtual void setFocus();
547 
548  protected:
553  virtual void showEvent( TQShowEvent * );
554 
563  virtual bool eventFilter( TQObject *o, TQEvent *e );
564 
565  private slots:
566  bool slotShowPage();
567  void slotFontChanged();
568 
569  void slotOnItem(TQListBoxItem *item);
570  void slotItemClicked(TQListViewItem *it);
571  void pageGone(TQObject *obj); // signal from the added page's "destroyed" signal
572  void slotReopen(TQListViewItem *item);
573 
574  protected:
575  bool showPage( TQWidget *w );
576  void addPageWidget( TQFrame *page, const TQStringList &items,
577  const TQString &header, const TQPixmap &pixmap );
578  void InsertTreeListItem(const TQStringList &items, const TQPixmap &pixmap, TQFrame *page);
579  TQWidget *FindParent();
580 
581  private:
582  bool mValid;
583 
584  // Obsolete members. Remove in KDE 4.
585  TQPtrList<TQWidget> *mPageList;
586  TQStringList *mTitleList;
587 
588  int mFace;
589  TDEListView *mTreeList;
590  IconListBox *mIconList;
591  TQWidgetStack *mPageStack;
592  TQLabel *mTitleLabel;
593  TQTabWidget *mTabControl;
594  TQFrame *mPlainPage;
595  TQWidget *mSwallowPage;
596  TQWidget *mActivePageWidget;
597  KSeparator *mTitleSep;
598  TQSplitter::ResizeMode mTreeListResizeMode;
599  bool mShowIconsInTreeList;
600  TQMap<TQListViewItem *, TQWidget *> mTreeListToPageStack;
601  TQMap<TQListBoxItem *, TQWidget *> mIconListToPageStack;
602  TQMap<TQString, TQPixmap> mFolderIconMap;
603  TQMap<TQString, TQStringList> mChildrenNames;
604  TQMap<TQString, TQWidget *> mChildPages;
605 
606  public:
607  class IconListItem;
608  protected:
609  virtual void virtual_hook( int id, void* data );
610  private:
611  class KJanusWidgetPrivate;
612  KJanusWidgetPrivate *d;
613 };
614 
615 #endif

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.