• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

kactionselector.h

Go to the documentation of this file.
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 _KACTION_SELECTOR_H_
00020 #define _KACTION_SELECTOR_H_
00021 
00022 #include <kdeui_export.h>
00023 #include <QtGui/QWidget>
00024 
00025 class QListWidget;
00026 class QListWidgetItem;
00027 class QKeyEvent;
00028 class QEvent;
00029 class QIcon;
00030 
00031 class KActionSelectorPrivate;
00032 
00078 class KDEUI_EXPORT KActionSelector : public QWidget {
00079   Q_OBJECT
00080   Q_ENUMS( InsertionPolicy MoveButton )
00081   Q_PROPERTY( bool moveOnDoubleClick READ moveOnDoubleClick WRITE setMoveOnDoubleClick )
00082   Q_PROPERTY( bool keyboardEnabled READ keyboardEnabled WRITE setKeyboardEnabled )
00083   Q_PROPERTY( QString availableLabel READ availableLabel WRITE setAvailableLabel )
00084   Q_PROPERTY( QString selectedLabel READ selectedLabel WRITE setSelectedLabel )
00085   Q_PROPERTY( InsertionPolicy availableInsertionPolicy READ availableInsertionPolicy WRITE setAvailableInsertionPolicy )
00086   Q_PROPERTY( InsertionPolicy selectedInsertionPolicy READ selectedInsertionPolicy WRITE setSelectedInsertionPolicy )
00087   Q_PROPERTY( bool showUpDownButtons READ showUpDownButtons WRITE setShowUpDownButtons )
00088 
00089 public:
00090   explicit KActionSelector( QWidget *parent=0 );
00091   ~KActionSelector();
00092 
00096   QListWidget *availableListWidget() const;
00097 
00101   QListWidget *selectedListWidget() const;
00102 
00106   enum MoveButton {
00107     ButtonAdd,
00108     ButtonRemove,
00109     ButtonUp,
00110     ButtonDown
00111   };
00112 
00125   enum InsertionPolicy {
00126     BelowCurrent,
00127     Sorted,
00128     AtTop,
00129     AtBottom
00130   };
00131 
00140   bool moveOnDoubleClick() const;
00141 
00146   void setMoveOnDoubleClick( bool enable );
00147 
00166   bool keyboardEnabled() const;
00167 
00172   void setKeyboardEnabled( bool enable );
00173 
00177   QString availableLabel() const;
00178 
00185   void setAvailableLabel( const QString & text );
00186 
00190   QString selectedLabel() const;
00191 
00198   void setSelectedLabel( const QString & text );
00199 
00205   InsertionPolicy availableInsertionPolicy() const;
00206 
00211   void setAvailableInsertionPolicy( InsertionPolicy policy );
00212 
00218   InsertionPolicy selectedInsertionPolicy() const;
00219 
00224   void setSelectedInsertionPolicy( InsertionPolicy policy );
00225 
00229   bool showUpDownButtons() const;
00230 
00235   void setShowUpDownButtons( bool show );
00236 
00241   void setButtonIcon( const QString &icon, MoveButton button );
00242 
00249   void setButtonIconSet( const QIcon &iconset, MoveButton button );
00250 
00254   void setButtonTooltip( const QString &tip, MoveButton button );
00255 
00259   void setButtonWhatsThis( const QString &text, MoveButton button );
00260 
00268   void setButtonsEnabled();
00269 
00270 Q_SIGNALS:
00274   void added( QListWidgetItem *item );
00275 
00279   void removed( QListWidgetItem *item );
00280 
00284   void movedUp( QListWidgetItem *item );
00285 
00289   void movedDown( QListWidgetItem *item );
00290 
00294 //  void addedToSelection( QListWidgetItem *item );
00295 
00296 public Q_SLOTS:
00301   void polish();
00302 
00303 protected:
00307   void keyPressEvent( QKeyEvent * );
00308 
00312   bool eventFilter( QObject *, QEvent * );
00313 
00314 private:
00318   Q_PRIVATE_SLOT(d, void buttonAddClicked())
00319 
00320   
00323   Q_PRIVATE_SLOT(d, void buttonRemoveClicked())
00324 
00328   Q_PRIVATE_SLOT(d, void buttonUpClicked())
00329 
00333   Q_PRIVATE_SLOT(d, void buttonDownClicked())
00334 
00338   Q_PRIVATE_SLOT(d, void itemDoubleClicked( QListWidgetItem *item ))
00339 
00343   Q_PRIVATE_SLOT(d, void slotCurrentChanged( QListWidgetItem * ))
00344 
00345 private:
00346 
00350   friend class KActionSelectorPrivate;
00351   KActionSelectorPrivate * const d;
00352   
00353   Q_DISABLE_COPY(KActionSelector)
00354 };
00355 
00356 #endif // _KACTION_SELECTOR_H_

KDEUI

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal