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

kdeui

  • kdeui
kkeydialog.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1997 Nicolas Hadacek <hadacek@kde.org>
3  Copyright (C) 2001,2001 Ellis Whitehead <ellis@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef __KKEYDIALOG_H__
22 #define __KKEYDIALOG_H__
23 
24 #include <tqdict.h>
25 #include <kdialogbase.h>
26 #include <klistview.h>
27 
28 class TQButtonGroup;
29 class TQCheckBox;
30 class TQGroupBox;
31 class TQLabel;
32 class TQLineEdit;
33 class TQRadioButton;
34 class KAccel;
35 class KAccelActions;
36 class KActionCollection;
37 class KConfigBase;
38 class KGlobalAccel;
39 class KKeySequence;
40 class KShortcut;
41 class KShortcutList;
42 class KKeyChooserItem;
43 
58 class KDEUI_EXPORT KKeyChooser : public TQWidget
59 {
60  Q_OBJECT
61  public:
62  enum ActionType { Application, ApplicationGlobal, Standard, Global };
63 
72  KKeyChooser( TQWidget* parent, ActionType type = Application, bool bAllowLetterShortcuts = true );
80  KKeyChooser( KActionCollection* coll, TQWidget* parent, bool bAllowLetterShortcuts = true );
81 
82  KKeyChooser( KAccel* actions, TQWidget* parent, bool bAllowLetterShortcuts = true );
83  KKeyChooser( KGlobalAccel* actions, TQWidget* parent );
84  KKeyChooser( KShortcutList*, TQWidget* parent, ActionType type = Application, bool bAllowLetterShortcuts = true );
85 
86  virtual ~KKeyChooser();
87 
92  bool insert( KActionCollection* ); // #### KDE4 : remove me
99  bool insert( KActionCollection *, const TQString &title);
100 
101  void syncToConfig( const TQString& sConfigGroup, KConfigBase* pConfig, bool bClearUnset );
102 
107  void commitChanges();
108 
115  void save();
116 
130  static bool checkGlobalShortcutsConflict( const KShortcut& cut, bool warnUser, TQWidget* parent );
131 
145  static bool checkStandardShortcutsConflict( const KShortcut& cut, bool warnUser, TQWidget* parent );
146 
147  signals:
151  void keyChange();
152 
153  public slots:
157  void allDefault();
158 
164  void setPreferFourModifierKeys( bool preferFourModifierKeys );
165 
166  // KDE4 a lot of stuff in this class should be probably private:
167  protected:
168  enum { NoKey = 1, DefaultKey, CustomKey };
169 
170  void initGUI( ActionType type, bool bAllowLetterShortcuts );
171  bool insert( KAccel* );
172  bool insert( KGlobalAccel* );
173  bool insert( KShortcutList* );
175  void buildListView( uint iList, const TQString &title = TQString::null );
176 
177  void readGlobalKeys();
178 
179  void updateButtons();
180  void fontChange( const TQFont& _font );
181  void setShortcut( const KShortcut& cut );
182  bool isKeyPresent( const KShortcut& cut, bool warnuser = true );
183  bool isKeyPresentLocally( const KShortcut& cut, KKeyChooserItem* ignoreItem, const TQString& warnText );
184  void _warning( const KKeySequence& seq, TQString sAction, TQString sTitle );
185 
186  protected slots:
187  void slotNoKey();
188  void slotDefaultKey();
189  void slotCustomKey();
190  void slotListItemSelected( TQListViewItem *item );
191  void capturedShortcut( const KShortcut& cut );
192  void slotSettingsChanged( int );
193  void slotListItemDoubleClicked ( TQListViewItem * ipoQListViewItem, const TQPoint & ipoQPoint, int c );
194 
195  protected:
196  ActionType m_type;
197  bool m_bAllowLetterShortcuts;
198  bool m_bAllowWinKey; // unused KDE4 remove
199  // When set, pressing the 'Default' button will select the aDefaultKeycode4,
200  // otherwise aDefaultKeycode.
201  bool m_bPreferFourModifierKeys;
202 
203  TQRadioButton* m_prbNone;
204  TQRadioButton* m_prbDef;
205  TQRadioButton* m_prbCustom;
206 
207  private:
208  bool isKeyPresentLocally( const KShortcut& cut, KKeyChooserItem* ignoreItem, bool bWarnUser );
209  static bool promptForReassign( const KKeySequence& cut, const TQString& sAction, ActionType action, TQWidget* parent );
210  // Remove the key sequences contained in cut from the standard shortcut @p name
211  // which currently has @p origCut as shortcut.
212  static void removeStandardShortcut( const TQString& name, KKeyChooser* chooser, const KShortcut &origCut, const KShortcut &cut );
213  // Remove the key sequences contained in cut from the global shortcut @p name
214  // which currently has @p origCut as shortcut.
215  static void removeGlobalShortcut( const TQString& name, KKeyChooser* chooser, const KShortcut &origCut, const KShortcut &cut );
216  static void readGlobalKeys( TQMap< TQString, KShortcut >& map );
217  static bool checkGlobalShortcutsConflict( const KShortcut& cut, bool bWarnUser, TQWidget* parent,
218  const TQMap< TQString, KShortcut >& map, const TQString& ignoreAction );
219  // Remove the key sequences contained in cut from this item
220  bool removeShortcut( const TQString& name, const KShortcut &cut );
221 
222 private slots:
223  void captureCurrentItem();
224 
225 #ifndef KDE_NO_COMPAT
226  public:
230  KKeyChooser( KAccel* actions, TQWidget* parent,
231  bool bCheckAgainstStdKeys,
232  bool bAllowLetterShortcuts,
233  bool bAllowWinKey = false );
237  KKeyChooser( KGlobalAccel* actions, TQWidget* parent,
238  bool bCheckAgainstStdKeys,
239  bool bAllowLetterShortcuts,
240  bool bAllowWinKey = false );
241 
242  public slots:
247  void listSync();
248 
249 #endif
250  protected:
251  virtual void virtual_hook( int id, void* data );
252  private:
253  class KKeyChooserPrivate *d;
254  friend class KKeyDialog;
255 };
256 typedef KKeyChooser KKeyChooser;
257 
274 class KDEUI_EXPORT KKeyDialog : public KDialogBase
275 {
276  Q_OBJECT
277 
278 public:
284  KKeyDialog( bool bAllowLetterShortcuts = true, TQWidget* parent = 0, const char* name = 0 );
285 
289  virtual ~KKeyDialog();
290 
299  bool insert( KActionCollection* ); // #### KDE4: remove me
300 
313  bool insert(KActionCollection *, const TQString &title);
314 
319  bool configure( bool bSaveSettings = true );
320 
326  void commitChanges();
327 
335  static int configure( KActionCollection* coll, TQWidget* parent = 0, bool bSaveSettings = true );
336 
342  static int configure( KAccel* keys, TQWidget* parent = 0, bool bSaveSettings = true );
343 
348  static int configure( KGlobalAccel* keys, TQWidget* parent = 0, bool bSaveSettings = true );
349 
350 
362  static int configure( KActionCollection* coll, bool bAllowLetterShortcuts, TQWidget* parent = 0, bool bSaveSettings = true ); // BCI: merge with bAllowLetterShortcuts = true
363 
368  static int configure( KAccel* keys, bool bAllowLetterShortcuts, TQWidget* parent = 0, bool bSaveSettings = true ); // BCI: merge with bAllowLetterShortcuts = true
369 
374  static int configure( KGlobalAccel* keys, bool bAllowLetterShortcuts, TQWidget* parent = 0, bool bSaveSettings = true ); // BCI: merge with bAllowLetterShortcuts = true
375 
380  static KDE_DEPRECATED int configureKeys( KAccel* keys, bool save_settings = true, TQWidget* parent = 0 )
381  { return configure( keys, parent, save_settings ); }
386  static KDE_DEPRECATED int configureKeys( KGlobalAccel* keys, bool save_settings = true, TQWidget* parent = 0 )
387  { return configure( keys, parent, save_settings ); }
392  static KDE_DEPRECATED int configureKeys( KActionCollection* coll, const TQString& /*xmlfile*/,
393  bool save_settings = true, TQWidget* parent = 0 )
394  { return configure( coll, parent, save_settings ); }
395 
396 private:
397  KKeyDialog( KKeyChooser::ActionType, bool bAllowLetterShortcuts = true, TQWidget* parent = 0, const char* name = 0 );
398 
399  protected:
400  virtual void virtual_hook( int id, void* data );
401 
402  private:
403  class KKeyDialogPrivate* d;
404  KKeyChooser* m_pKeyChooser;
405 };
406 
407 #endif // __KKEYDIALOG_H__
KActionCollection
A managed set of KAction objects.
Definition: kactioncollection.h:78
KAccel
KDialogBase
A dialog base class with standard buttons and predefined layouts.
Definition: kdialogbase.h:191
KShortcut
KKeySequence
KShortcutList
KKeyDialog::configureKeys
static KDE_DEPRECATED int configureKeys(KActionCollection *coll, const TQString &, bool save_settings=true, TQWidget *parent=0)
Definition: kkeydialog.h:392
KConfigBase
KKeyDialog
Dialog for configuration of KActionCollection, KAccel, and KGlobalAccel.
Definition: kkeydialog.h:274
KKeyDialog::configureKeys
static KDE_DEPRECATED int configureKeys(KAccel *keys, bool save_settings=true, TQWidget *parent=0)
Definition: kkeydialog.h:380
KKeyChooser
Widget for configuration of KAccel and KGlobalAccel.
Definition: kkeydialog.h:58
KKeyDialog::configureKeys
static KDE_DEPRECATED int configureKeys(KGlobalAccel *keys, bool save_settings=true, TQWidget *parent=0)
Definition: kkeydialog.h:386
KGlobalAccel

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.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |