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

kdeui

  • kdeui
kactionselector.h
1 /* This file is part of the KDE project
2  Copyright (C) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk>
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 version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef _KACTION_SELECTOR_H_
20 #define _KACTION_SELECTOR_H_
21 
22 #include <tqwidget.h>
23 
24 #include <kdelibs_export.h>
25 
26 class TQListBox;
27 class TQListBoxItem;
28 class TQKeyEvent;
29 class TQEvent;
30 class TQIconSet;
31 
32 class KActionSelectorPrivate;
33 
79 class KDEUI_EXPORT KActionSelector : public TQWidget {
80  Q_OBJECT
81  Q_ENUMS( ButtonIconSize InsertionPolicy )
82  Q_PROPERTY( bool moveOnDoubleClick READ moveOnDoubleClick WRITE setMoveOnDoubleClick )
83  Q_PROPERTY( bool keyboardEnabled READ keyboardEnabled WRITE setKeyboardEnabled )
84  Q_PROPERTY( TQString availableLabel READ availableLabel WRITE setAvailableLabel )
85  Q_PROPERTY( TQString selectedLabel READ selectedLabel WRITE setSelectedLabel )
86  Q_PROPERTY( ButtonIconSize buttonIconSize READ buttonIconSize WRITE setButtonIconSize )
87  Q_PROPERTY( InsertionPolicy availableInsertionPolicy READ availableInsertionPolicy WRITE setAvailableInsertionPolicy )
88  Q_PROPERTY( InsertionPolicy selectedInsertionPolicy READ selectedInsertionPolicy WRITE setSelectedInsertionPolicy )
89  Q_PROPERTY( bool showUpDownButtons READ showUpDownButtons WRITE setShowUpDownButtons )
90 
91 public:
92  KActionSelector( TQWidget *parent=0, const char *name=0 );
93  ~KActionSelector();
94 
98  TQListBox *availableListBox() const;
99 
103  TQListBox *selectedListBox() const;
104 
108  enum MoveButton {
109  ButtonAdd,
110  ButtonRemove,
111  ButtonUp,
112  ButtonDown
113  };
114 
125  enum ButtonIconSize {
126  SmallIcon,
127  Small,
128  Medium,
129  Large,
130  XLarge
131  };
132 
145  enum InsertionPolicy {
146  BelowCurrent,
147  Sorted,
148  AtTop,
149  AtBottom
150  };
151 
159  bool moveOnDoubleClick() const;
160 
165  void setMoveOnDoubleClick( bool enable );
166 
185  bool keyboardEnabled() const;
186 
191  void setKeyboardEnabled( bool enable );
192 
196  TQString availableLabel() const;
197 
204  void setAvailableLabel( const TQString & text );
205 
209  TQString selectedLabel() const;
210 
217  void setSelectedLabel( const TQString & text );
218 
222  ButtonIconSize buttonIconSize() const;
223 
228  void setButtonIconSize( ButtonIconSize size );
229 
235  InsertionPolicy availableInsertionPolicy() const;
236 
241  void setAvailableInsertionPolicy( InsertionPolicy policy );
242 
248  InsertionPolicy selectedInsertionPolicy() const;
249 
254  void setSelectedInsertionPolicy( InsertionPolicy policy );
255 
259  bool showUpDownButtons() const;
260 
265  void setShowUpDownButtons( bool show );
266 
271  void setButtonIcon( const TQString &icon, MoveButton button );
272 
279  void setButtonIconSet( const TQIconSet &iconset, MoveButton button );
280 
284  void setButtonTooltip( const TQString &tip, MoveButton button );
285 
289  void setButtonWhatsThis( const TQString &text, MoveButton button );
290 
298  void setButtonsEnabled();
299 
300 signals:
304  void added( TQListBoxItem *item );
305 
309  void removed( TQListBoxItem *item );
310 
314  void movedUp( TQListBoxItem *item );
315 
319  void movedDown( TQListBoxItem *item );
320 
324 // void addedToSelection( TQListBoxItem *item );
325 
326 public slots:
331  void polish();
332 
333 protected:
337  void keyPressEvent( TQKeyEvent * );
338 
342  bool eventFilter( TQObject *, TQEvent * );
343 
344 private slots:
348  void buttonAddClicked();
349 
353  void buttonRemoveClicked();
354 
358  void buttonUpClicked();
359 
363  void buttonDownClicked();
364 
368  void itemDoubleClicked( TQListBoxItem *item );
369 
373  void slotCurrentChanged( TQListBoxItem * ) { setButtonsEnabled(); }
374 
375 private:
376 
380  void moveItem( TQListBoxItem *item );
381 
385  void loadIcons();
386 
394  int insertionIndex( TQListBox *lb, InsertionPolicy policy );
395 
399  KActionSelectorPrivate *d;
400 };
401 
402 #endif // _KACTION_SELECTOR_H_

kdeui

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

kdeui

Skip menu "kdeui"
  • 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 kdeui by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |