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

tdeui

  • tdeui
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 <tdelistview.h>
27
28class TQButtonGroup;
29class TQCheckBox;
30class TQGroupBox;
31class TQLabel;
32class TQLineEdit;
33class TQRadioButton;
34class TDEAccel;
35class TDEAccelActions;
36class TDEActionCollection;
37class TDEConfigBase;
38class TDEGlobalAccel;
39class KKeySequence;
40class TDEShortcut;
41class TDEShortcutList;
42class KKeyChooserItem;
43
58class TDEUI_EXPORT KKeyChooser : public TQWidget
59{
60 TQ_OBJECT
61 public:
62 enum ActionType { Application, ApplicationGlobal, Standard, Global };
63
72 KKeyChooser( TQWidget* parent, ActionType type = Application, bool bAllowLetterShortcuts = true );
80 KKeyChooser( TDEActionCollection* coll, TQWidget* parent, bool bAllowLetterShortcuts = true );
81
82 KKeyChooser( TDEAccel* actions, TQWidget* parent, bool bAllowLetterShortcuts = true );
83 KKeyChooser( TDEGlobalAccel* actions, TQWidget* parent );
84 KKeyChooser( TDEShortcutList*, TQWidget* parent, ActionType type = Application, bool bAllowLetterShortcuts = true );
85
86 virtual ~KKeyChooser();
87
92 bool insert( TDEActionCollection* ); // #### KDE4 : remove me
99 bool insert( TDEActionCollection *, const TQString &title);
100
101 void syncToConfig( const TQString& sConfigGroup, TDEConfigBase* pConfig, bool bClearUnset );
102
107 void commitChanges();
108
115 void save();
116
130 static bool checkGlobalShortcutsConflict( const TDEShortcut& cut, bool warnUser, TQWidget* parent );
131
145 static bool checkStandardShortcutsConflict( const TDEShortcut& 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( TDEAccel* );
172 bool insert( TDEGlobalAccel* );
173 bool insert( TDEShortcutList* );
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 TDEShortcut& cut );
182 bool isKeyPresent( const TDEShortcut& cut, bool warnuser = true );
183 bool isKeyPresentLocally( const TDEShortcut& 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 TDEShortcut& 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 TDEShortcut& 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 TDEShortcut &origCut, const TDEShortcut &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 TDEShortcut &origCut, const TDEShortcut &cut );
216 static void readGlobalKeys( TQMap< TQString, TDEShortcut >& map );
217 static bool checkGlobalShortcutsConflict( const TDEShortcut& cut, bool bWarnUser, TQWidget* parent,
218 const TQMap< TQString, TDEShortcut >& map, const TQString& ignoreAction );
219 // Remove the key sequences contained in cut from this item
220 bool removeShortcut( const TQString& name, const TDEShortcut &cut );
221
222private slots:
223 void captureCurrentItem();
224
225#ifndef KDE_NO_COMPAT
226 public:
230 KKeyChooser( TDEAccel* actions, TQWidget* parent,
231 bool bCheckAgainstStdKeys,
232 bool bAllowLetterShortcuts,
233 bool bAllowWinKey = false );
237 KKeyChooser( TDEGlobalAccel* 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};
256typedef KKeyChooser KKeyChooser;
257
274class TDEUI_EXPORT KKeyDialog : public KDialogBase
275{
276 TQ_OBJECT
277
278public:
284 KKeyDialog( bool bAllowLetterShortcuts = true, TQWidget* parent = 0, const char* name = 0 );
285
289 virtual ~KKeyDialog();
290
299 bool insert( TDEActionCollection* ); // #### KDE4: remove me
300
313 bool insert(TDEActionCollection *, const TQString &title);
314
319 bool configure( bool bSaveSettings = true );
320
326 void commitChanges();
327
335 static int configure( TDEActionCollection* coll, TQWidget* parent = 0, bool bSaveSettings = true );
336
342 static int configure( TDEAccel* keys, TQWidget* parent = 0, bool bSaveSettings = true );
343
348 static int configure( TDEGlobalAccel* keys, TQWidget* parent = 0, bool bSaveSettings = true );
349
350
362 static int configure( TDEActionCollection* coll, bool bAllowLetterShortcuts, TQWidget* parent = 0, bool bSaveSettings = true ); // BCI: merge with bAllowLetterShortcuts = true
363
368 static int configure( TDEAccel* keys, bool bAllowLetterShortcuts, TQWidget* parent = 0, bool bSaveSettings = true ); // BCI: merge with bAllowLetterShortcuts = true
369
374 static int configure( TDEGlobalAccel* keys, bool bAllowLetterShortcuts, TQWidget* parent = 0, bool bSaveSettings = true ); // BCI: merge with bAllowLetterShortcuts = true
375
380 static TDE_DEPRECATED int configureKeys( TDEAccel* keys, bool save_settings = true, TQWidget* parent = 0 )
381 { return configure( keys, parent, save_settings ); }
386 static TDE_DEPRECATED int configureKeys( TDEGlobalAccel* keys, bool save_settings = true, TQWidget* parent = 0 )
387 { return configure( keys, parent, save_settings ); }
392 static TDE_DEPRECATED int configureKeys( TDEActionCollection* coll, const TQString& /*xmlfile*/,
393 bool save_settings = true, TQWidget* parent = 0 )
394 { return configure( coll, parent, save_settings ); }
395
396private:
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__
KDialogBase
A dialog base class with standard buttons and predefined layouts.
Definition: kdialogbase.h:192
KKeyChooser
Widget for configuration of TDEAccel and TDEGlobalAccel.
Definition: kkeydialog.h:59
KKeyChooser::keyChange
void keyChange()
Emitted when an action's shortcut has been changed.
KKeyDialog
Dialog for configuration of TDEActionCollection, TDEAccel, and TDEGlobalAccel.
Definition: kkeydialog.h:275
KKeyDialog::configureKeys
static TDE_DEPRECATED int configureKeys(TDEGlobalAccel *keys, bool save_settings=true, TQWidget *parent=0)
Definition: kkeydialog.h:386
KKeyDialog::configureKeys
static TDE_DEPRECATED int configureKeys(TDEActionCollection *coll, const TQString &, bool save_settings=true, TQWidget *parent=0)
Definition: kkeydialog.h:392
KKeyDialog::configureKeys
static TDE_DEPRECATED int configureKeys(TDEAccel *keys, bool save_settings=true, TQWidget *parent=0)
Definition: kkeydialog.h:380
KKeySequence
TDEAccel
TDEActionCollection
A managed set of TDEAction objects.
Definition: tdeactioncollection.h:79
TDEConfigBase
TDEGlobalAccel
TDEShortcutList
TDEShortcut

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.9.4
This website is maintained by Timothy Pearson.