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

tdeui

tdeactionselector.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #ifndef _TDEACTION_SELECTOR_H_
00020 #define _TDEACTION_SELECTOR_H_
00021 
00022 #include <tqwidget.h>
00023 
00024 #include <tdelibs_export.h>
00025 
00026 class TQListBox;
00027 class TQListBoxItem;
00028 class TQKeyEvent;
00029 class TQEvent;
00030 class TQIconSet;
00031 
00032 class TDEActionSelectorPrivate;
00033 
00079 class TDEUI_EXPORT TDEActionSelector : public TQWidget {
00080   Q_OBJECT
00081   TQ_ENUMS( ButtonIconSize InsertionPolicy )
00082   TQ_PROPERTY( bool moveOnDoubleClick READ moveOnDoubleClick WRITE setMoveOnDoubleClick )
00083   TQ_PROPERTY( bool keyboardEnabled READ keyboardEnabled WRITE setKeyboardEnabled )
00084   TQ_PROPERTY( TQString availableLabel READ availableLabel WRITE setAvailableLabel )
00085   TQ_PROPERTY( TQString selectedLabel READ selectedLabel WRITE setSelectedLabel )
00086   TQ_PROPERTY( ButtonIconSize buttonIconSize READ buttonIconSize WRITE setButtonIconSize )
00087   TQ_PROPERTY( InsertionPolicy availableInsertionPolicy READ availableInsertionPolicy WRITE setAvailableInsertionPolicy )
00088   TQ_PROPERTY( InsertionPolicy selectedInsertionPolicy READ selectedInsertionPolicy WRITE setSelectedInsertionPolicy )
00089   TQ_PROPERTY( bool showUpDownButtons READ showUpDownButtons WRITE setShowUpDownButtons )
00090 
00091 public:
00092   TDEActionSelector( TQWidget *parent=0, const char *name=0 );
00093   ~TDEActionSelector();
00094 
00098   TQListBox *availableListBox() const;
00099 
00103   TQListBox *selectedListBox() const;
00104 
00108   enum MoveButton {
00109     ButtonAdd,
00110     ButtonRemove,
00111     ButtonUp,
00112     ButtonDown
00113   };
00114 
00125   enum ButtonIconSize {
00126     SmallIcon,
00127     Small,
00128     Medium,
00129     Large,
00130     XLarge
00131   };
00132 
00145   enum InsertionPolicy {
00146     BelowCurrent,
00147     Sorted,
00148     AtTop,
00149     AtBottom
00150   };
00151 
00159   bool moveOnDoubleClick() const;
00160 
00165   void setMoveOnDoubleClick( bool enable );
00166 
00185   bool keyboardEnabled() const;
00186 
00191   void setKeyboardEnabled( bool enable );
00192 
00196   TQString availableLabel() const;
00197 
00204   void setAvailableLabel( const TQString & text );
00205 
00209   TQString selectedLabel() const;
00210 
00217   void setSelectedLabel( const TQString & text );
00218 
00222   ButtonIconSize buttonIconSize() const;
00223 
00228   void setButtonIconSize( ButtonIconSize size );
00229 
00235   InsertionPolicy availableInsertionPolicy() const;
00236 
00241   void setAvailableInsertionPolicy( InsertionPolicy policy );
00242 
00248   InsertionPolicy selectedInsertionPolicy() const;
00249 
00254   void setSelectedInsertionPolicy( InsertionPolicy policy );
00255 
00259   bool showUpDownButtons() const;
00260 
00265   void setShowUpDownButtons( bool show );
00266 
00271   void setButtonIcon( const TQString &icon, MoveButton button );
00272 
00279   void setButtonIconSet( const TQIconSet &iconset, MoveButton button );
00280 
00284   void setButtonTooltip( const TQString &tip, MoveButton button );
00285 
00289   void setButtonWhatsThis( const TQString &text, MoveButton button );
00290 
00298   void setButtonsEnabled();
00299 
00300 signals:
00304   void added( TQListBoxItem *item );
00305 
00309   void removed( TQListBoxItem *item );
00310 
00314   void movedUp( TQListBoxItem *item );
00315 
00319   void movedDown( TQListBoxItem *item );
00320 
00324 //  void addedToSelection( TQListBoxItem *item );
00325 
00326 public slots:
00331   void polish();
00332 
00333 protected:
00337   void keyPressEvent( TQKeyEvent * );
00338 
00342   bool eventFilter( TQObject *, TQEvent * );
00343 
00344 private slots:
00348   void buttonAddClicked();
00349 
00353   void buttonRemoveClicked();
00354 
00358   void buttonUpClicked();
00359 
00363   void buttonDownClicked();
00364 
00368   void  itemDoubleClicked( TQListBoxItem *item );
00369 
00373   void slotCurrentChanged( TQListBoxItem * ) { setButtonsEnabled(); }
00374 
00375 private:
00376 
00380   void moveItem( TQListBoxItem *item );
00381 
00385   void loadIcons();
00386 
00394   int insertionIndex( TQListBox *lb, InsertionPolicy policy );
00395 
00399   TDEActionSelectorPrivate *d;
00400 };
00401 
00402 #endif // _TDEACTION_SELECTOR_H_

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.6.3
This website is maintained by Timothy Pearson.