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

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • kdeui
  • widgets
kactionselector.h
Go to the documentation of this file.
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 <kdeui_export.h>
23 #include <QtGui/QWidget>
24 
25 class QListWidget;
26 class QListWidgetItem;
27 class QKeyEvent;
28 class QEvent;
29 class QIcon;
30 
31 class KActionSelectorPrivate;
32 
80 class KDEUI_EXPORT KActionSelector : public QWidget {
81  Q_OBJECT
82  Q_ENUMS( InsertionPolicy MoveButton )
83  Q_PROPERTY( bool moveOnDoubleClick READ moveOnDoubleClick WRITE setMoveOnDoubleClick )
84  Q_PROPERTY( bool keyboardEnabled READ keyboardEnabled WRITE setKeyboardEnabled )
85  Q_PROPERTY( QString availableLabel READ availableLabel WRITE setAvailableLabel )
86  Q_PROPERTY( QString selectedLabel READ selectedLabel WRITE setSelectedLabel )
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  explicit KActionSelector( QWidget *parent=0 );
93  ~KActionSelector();
94 
98  QListWidget *availableListWidget() const;
99 
103  QListWidget *selectedListWidget() const;
104 
108  enum MoveButton {
109  ButtonAdd,
110  ButtonRemove,
111  ButtonUp,
112  ButtonDown
113  };
114 
127  enum InsertionPolicy {
128  BelowCurrent,
129  Sorted,
130  AtTop,
131  AtBottom
132  };
133 
142  bool moveOnDoubleClick() const;
143 
148  void setMoveOnDoubleClick( bool enable );
149 
168  bool keyboardEnabled() const;
169 
174  void setKeyboardEnabled( bool enable );
175 
179  QString availableLabel() const;
180 
187  void setAvailableLabel( const QString & text );
188 
192  QString selectedLabel() const;
193 
200  void setSelectedLabel( const QString & text );
201 
207  InsertionPolicy availableInsertionPolicy() const;
208 
213  void setAvailableInsertionPolicy( InsertionPolicy policy );
214 
220  InsertionPolicy selectedInsertionPolicy() const;
221 
226  void setSelectedInsertionPolicy( InsertionPolicy policy );
227 
231  bool showUpDownButtons() const;
232 
237  void setShowUpDownButtons( bool show );
238 
243  void setButtonIcon( const QString &icon, MoveButton button );
244 
251  void setButtonIconSet( const QIcon &iconset, MoveButton button );
252 
256  void setButtonTooltip( const QString &tip, MoveButton button );
257 
261  void setButtonWhatsThis( const QString &text, MoveButton button );
262 
270  void setButtonsEnabled();
271 
272 Q_SIGNALS:
276  void added( QListWidgetItem *item );
277 
281  void removed( QListWidgetItem *item );
282 
286  void movedUp( QListWidgetItem *item );
287 
291  void movedDown( QListWidgetItem *item );
292 
296 // void addedToSelection( QListWidgetItem *item );
297 
298 public Q_SLOTS:
303  void polish();
304 
305 protected:
309  void keyPressEvent( QKeyEvent * );
310 
314  bool eventFilter( QObject *, QEvent * );
315 
316 private:
320  Q_PRIVATE_SLOT(d, void buttonAddClicked())
321 
322 
325  Q_PRIVATE_SLOT(d, void buttonRemoveClicked())
326 
330  Q_PRIVATE_SLOT(d, void buttonUpClicked())
331 
335  Q_PRIVATE_SLOT(d, void buttonDownClicked())
336 
340  Q_PRIVATE_SLOT(d, void itemDoubleClicked( QListWidgetItem *item ))
341 
345  Q_PRIVATE_SLOT(d, void slotCurrentChanged( QListWidgetItem * ))
346 
347 private:
348 
352  friend class KActionSelectorPrivate;
353  KActionSelectorPrivate * const d;
354 
355  Q_DISABLE_COPY(KActionSelector)
356 };
357 
358 #endif // _KACTION_SELECTOR_H_
KActionSelector::BelowCurrent
Definition: kactionselector.h:128
KActionSelector::InsertionPolicy
InsertionPolicy
This enum defines policies for where to insert moved items in a listbox.
Definition: kactionselector.h:127
QWidget
QListWidget
QString
QObject
KActionSelector::ButtonUp
Definition: kactionselector.h:111
KActionSelector::ButtonRemove
Definition: kactionselector.h:110
KActionSelector::Sorted
Definition: kactionselector.h:129
KActionSelector::AtTop
Definition: kactionselector.h:130
kdeui_export.h
KActionSelector
A widget for selecting and arranging actions/objects.
Definition: kactionselector.h:80
KActionSelector::ButtonAdd
Definition: kactionselector.h:109
KActionSelector::MoveButton
MoveButton
This enum indentifies the moving buttons.
Definition: kactionselector.h:108
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal