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

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • shortcuts
kstandardshortcut.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 1997 Stefan Taferner (taferner@alpin.or.at)
3  Copyright (C) 2000 Nicolas Hadacek (haadcek@kde.org)
4  Copyright (C) 2001,2002 Ellis Whitehead (ellis@kde.org)
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
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 #include "kstandardshortcut.h"
22 
23 #include "kconfig.h"
24 #include "kdebug.h"
25 #include "kglobal.h"
26 #include "klocale.h"
27 #include "kshortcut.h"
28 #include <kconfiggroup.h>
29 
30 #include <QtGui/QKeySequence>
31 #ifdef Q_WS_X11
32 #include <qx11info_x11.h>
33 #endif
34 
35 namespace KStandardShortcut
36 {
37 
38 struct KStandardShortcutInfo
39 {
41  StandardShortcut id;
42 
48  const char* name;
49 
51  const char* translation_context;
52 
54  const char* description;
55 
57  int cutDefault, cutDefault2;
58 
60  KShortcut cut;
61 
63  bool isInitialized;
64 };
65 
67 #undef I18N_NOOP2
68 #define I18N_NOOP2(comment,x) comment, x
69 
70 #define CTRL(x) Qt::CTRL+Qt::Key_##x
71 #define SHIFT(x) Qt::SHIFT+Qt::Key_##x
72 #define CTRLSHIFT(x) Qt::CTRL+Qt::SHIFT+Qt::Key_##x
73 #define ALT(x) Qt::ALT+Qt::Key_##x
74 #define ALTSHIFT(x) Qt::ALT+Qt::SHIFT+Qt::Key_##x
75 
80 // STUFF WILL BREAK IF YOU DON'T READ THIS!!!
81 // Read the comments of the big enum in kstandardshortcut.h before you change anything!
82 static KStandardShortcutInfo g_infoStandardShortcut[] =
83 {
84 //Group File,
85  {AccelNone, 0 , 0 , 0 , 0 , 0 , KShortcut(), false },
86  { Open , "Open" , I18N_NOOP2("@action", "Open") , CTRL(O), 0 , KShortcut(), false } ,
87  { New , "New" , I18N_NOOP2("@action", "New") , CTRL(N), 0 , KShortcut(), false } ,
88  { Close , "Close", I18N_NOOP2("@action", "Close"), CTRL(W), CTRL(Escape), KShortcut(), false } ,
89  { Save , "Save" , I18N_NOOP2("@action", "Save") , CTRL(S), 0 , KShortcut(), false } ,
90  { Print , "Print", I18N_NOOP2("@action", "Print"), CTRL(P), 0 , KShortcut(), false } ,
91  { Quit , "Quit" , I18N_NOOP2("@action", "Quit") , CTRL(Q), 0 , KShortcut(), false } ,
92 
93 //Group Edit
94  { Undo , "Undo" , I18N_NOOP2("@action", "Undo") , CTRL(Z) , 0 , KShortcut(), false },
95  { Redo , "Redo" , I18N_NOOP2("@action", "Redo") , CTRLSHIFT(Z) , 0 , KShortcut(), false },
96  { Cut , "Cut" , I18N_NOOP2("@action", "Cut") , CTRL(X) , SHIFT(Delete), KShortcut(), false },
97  { Copy , "Copy" , I18N_NOOP2("@action", "Copy") , CTRL(C) , CTRL(Insert) , KShortcut(), false },
98  { Paste , "Paste" , I18N_NOOP2("@action", "Paste") , CTRL(V) , SHIFT(Insert), KShortcut(), false },
99  { PasteSelection , "Paste Selection" , I18N_NOOP2("@action", "Paste Selection") , CTRLSHIFT(Insert), 0 , KShortcut(), false },
100 
101  { SelectAll , "SelectAll" , I18N_NOOP2("@action", "Select All") , CTRL(A) , 0 , KShortcut(), false },
102  { Deselect , "Deselect" , I18N_NOOP2("@action", "Deselect") , CTRLSHIFT(A) , 0 , KShortcut(), false },
103  { DeleteWordBack , "DeleteWordBack" , I18N_NOOP2("@action", "Delete Word Backwards"), CTRL(Backspace) , 0 , KShortcut(), false },
104  { DeleteWordForward, "DeleteWordForward", I18N_NOOP2("@action", "Delete Word Forward") , CTRL(Delete) , 0 , KShortcut(), false },
105 
106  { Find , "Find" , I18N_NOOP2("@action", "Find") , CTRL(F) , 0 , KShortcut(), false },
107  { FindNext , "FindNext" , I18N_NOOP2("@action", "Find Next") , Qt::Key_F3 , 0 , KShortcut(), false },
108  { FindPrev , "FindPrev" , I18N_NOOP2("@action", "Find Prev") , SHIFT(F3) , 0 , KShortcut(), false },
109  { Replace , "Replace" , I18N_NOOP2("@action", "Replace") , CTRL(R) , 0 , KShortcut(), false },
110 
111 //Group Navigation
112  { Home , "Home" , I18N_NOOP2("@action Go to main page" , "Home") , ALT(Home) , Qt::Key_HomePage , KShortcut(), false },
113  { Begin , "Begin" , I18N_NOOP2("@action Beginning of document", "Begin") , CTRL(Home) , 0 , KShortcut(), false },
114  { End , "End" , I18N_NOOP2("@action End of document" , "End") , CTRL(End) , 0 , KShortcut(), false },
115  { Prior , "Prior" , I18N_NOOP2("@action" , "Prior") , Qt::Key_PageUp , 0 , KShortcut(), false },
116  { Next , "Next" , I18N_NOOP2("@action Opposite to Prior" , "Next") , Qt::Key_PageDown, 0 , KShortcut(), false },
117 
118  { Up , "Up" , I18N_NOOP2("@action" , "Up") , ALT(Up) , 0 , KShortcut(), false },
119  { Back , "Back" , I18N_NOOP2("@action" , "Back") , ALT(Left) , Qt::Key_Back , KShortcut(), false },
120  { Forward , "Forward" , I18N_NOOP2("@action" , "Forward") , ALT(Right) , Qt::Key_Forward , KShortcut(), false },
121  { Reload , "Reload" , I18N_NOOP2("@action" , "Reload") , Qt::Key_F5 , Qt::Key_Refresh , KShortcut(), false },
122 
123  { BeginningOfLine, "BeginningOfLine" , I18N_NOOP2("@action" , "Beginning of Line") , Qt::Key_Home , 0 , KShortcut(), false },
124  { EndOfLine , "EndOfLine" , I18N_NOOP2("@action" , "End of Line") , Qt::Key_End , 0 , KShortcut(), false },
125  { GotoLine , "GotoLine" , I18N_NOOP2("@action" , "Go to Line") , CTRL(G) , 0 , KShortcut(), false },
126  { BackwardWord , "BackwardWord" , I18N_NOOP2("@action" , "Backward Word") , CTRL(Left) , 0 , KShortcut(), false },
127  { ForwardWord , "ForwardWord" , I18N_NOOP2("@action" , "Forward Word") , CTRL(Right) , 0 , KShortcut(), false },
128 
129  { AddBookmark , "AddBookmark" , I18N_NOOP2("@action" , "Add Bookmark") , CTRL(B) , 0 , KShortcut(), false },
130  { ZoomIn , "ZoomIn" , I18N_NOOP2("@action" , "Zoom In") , CTRL(Plus) , CTRL(Equal) , KShortcut(), false },
131  { ZoomOut , "ZoomOut" , I18N_NOOP2("@action" , "Zoom Out") , CTRL(Minus) , 0 , KShortcut(), false },
132  { FullScreen , "FullScreen" , I18N_NOOP2("@action" , "Full Screen Mode") , CTRLSHIFT(F) , 0 , KShortcut(), false },
133 
134  { ShowMenubar , "ShowMenubar" , I18N_NOOP2("@action" , "Show Menu Bar") , CTRL(M) , 0 , KShortcut(), false },
135  { TabNext , "Activate Next Tab" , I18N_NOOP2("@action" , "Activate Next Tab") , CTRL(Period) , CTRL(BracketRight), KShortcut(), false },
136  { TabPrev , "Activate Previous Tab", I18N_NOOP2("@action" , "Activate Previous Tab"), CTRL(Comma) , CTRL(BracketLeft) , KShortcut(), false },
137 
138  //Group Help
139  { Help , "Help" , I18N_NOOP2("@action" , "Help") , Qt::Key_F1 , 0 , KShortcut(), false },
140  { WhatsThis , "WhatsThis" , I18N_NOOP2("@action" , "What's This") , SHIFT(F1) , 0 , KShortcut(), false },
141 
142 //Group TextCompletion
143  { TextCompletion , "TextCompletion" , I18N_NOOP2("@action", "Text Completion") , CTRL(E) , 0, KShortcut(), false },
144  { PrevCompletion , "PrevCompletion" , I18N_NOOP2("@action", "Previous Completion Match"), CTRL(Up) , 0, KShortcut(), false },
145  { NextCompletion , "NextCompletion" , I18N_NOOP2("@action", "Next Completion Match") , CTRL(Down) , 0, KShortcut(), false },
146  { SubstringCompletion , "SubstringCompletion" , I18N_NOOP2("@action", "Substring Completion") , CTRL(T) , 0, KShortcut(), false },
147 
148  { RotateUp , "RotateUp" , I18N_NOOP2("@action", "Previous Item in List") , Qt::Key_Up , 0, KShortcut(), false },
149  { RotateDown , "RotateDown" , I18N_NOOP2("@action", "Next Item in List") , Qt::Key_Down, 0, KShortcut(), false },
150 
151  { OpenRecent , "OpenRecent" , I18N_NOOP2("@action", "Open Recent") , 0 , 0, KShortcut(), false },
152  { SaveAs , "SaveAs" , I18N_NOOP2("@action", "Save As") , CTRLSHIFT(S) , 0, KShortcut(), false },
153  { Revert , "Revert" , I18N_NOOP2("@action", "Revert") , 0 , 0, KShortcut(), false },
154  { PrintPreview , "PrintPreview" , I18N_NOOP2("@action", "Print Preview") , 0 , 0, KShortcut(), false },
155  { Mail , "Mail" , I18N_NOOP2("@action", "Mail") , 0 , 0, KShortcut(), false },
156  { Clear , "Clear" , I18N_NOOP2("@action", "Clear") , 0 , 0, KShortcut(), false },
157  { ActualSize , "ActualSize" , I18N_NOOP2("@action", "Actual Size") , 0 , 0, KShortcut(), false },
158  { FitToPage , "FitToPage" , I18N_NOOP2("@action", "Fit To Page") , 0 , 0, KShortcut(), false },
159  { FitToWidth , "FitToWidth" , I18N_NOOP2("@action", "Fit To Width") , 0 , 0, KShortcut(), false },
160  { FitToHeight , "FitToHeight" , I18N_NOOP2("@action", "Fit To Height") , 0 , 0, KShortcut(), false },
161  { Zoom , "Zoom" , I18N_NOOP2("@action", "Zoom") , 0 , 0, KShortcut(), false },
162  { Goto , "Goto" , I18N_NOOP2("@action", "Goto") , 0 , 0, KShortcut(), false },
163  { GotoPage , "GotoPage" , I18N_NOOP2("@action", "Goto Page") , 0 , 0, KShortcut(), false },
164  { DocumentBack , "DocumentBack" , I18N_NOOP2("@action", "Document Back") , ALTSHIFT(Left), 0, KShortcut(), false },
165  { DocumentForward , "DocumentForward" , I18N_NOOP2("@action", "Document Forward") , ALTSHIFT(Right), 0, KShortcut(), false },
166  { EditBookmarks , "EditBookmarks" , I18N_NOOP2("@action", "Edit Bookmarks") , 0 , 0, KShortcut(), false },
167  { Spelling , "Spelling" , I18N_NOOP2("@action", "Spelling") , 0 , 0, KShortcut(), false },
168  { ShowToolbar , "ShowToolbar" , I18N_NOOP2("@action", "Show Toolbar") , 0 , 0, KShortcut(), false },
169  { ShowStatusbar , "ShowStatusbar" , I18N_NOOP2("@action", "Show Statusbar") , 0 , 0, KShortcut(), false },
170  { SaveOptions , "SaveOptions" , I18N_NOOP2("@action", "Save Options") , 0 , 0, KShortcut(), false },
171  { KeyBindings , "KeyBindings" , I18N_NOOP2("@action", "Key Bindings") , 0 , 0, KShortcut(), false },
172  { Preferences , "Preferences" , I18N_NOOP2("@action", "Preferences") , 0 , 0, KShortcut(), false },
173  { ConfigureToolbars , "ConfigureToolbars" , I18N_NOOP2("@action", "Configure Toolbars") , 0 , 0, KShortcut(), false },
174  { ConfigureNotifications , "ConfigureNotifications" , I18N_NOOP2("@action", "Configure Notifications") , 0 , 0, KShortcut(), false },
175  { TipofDay , "TipofDay" , I18N_NOOP2("@action", "Tip Of Day") , 0 , 0, KShortcut(), false },
176  { ReportBug , "ReportBug" , I18N_NOOP2("@action", "Report Bug") , 0 , 0, KShortcut(), false },
177  { SwitchApplicationLanguage, "SwitchApplicationLanguage", I18N_NOOP2("@action", "Switch Application Language"), 0 , 0, KShortcut(), false },
178  { AboutApp , "AboutApp" , I18N_NOOP2("@action", "About Application") , 0 , 0, KShortcut(), false },
179  { AboutKDE , "AboutKDE" , I18N_NOOP2("@action", "About KDE") , 0 , 0, KShortcut(), false },
180 
181  //dummy entry to catch simple off-by-one errors. Insert new entries before this line.
182  { AccelNone , 0 , 0 , 0 , 0, 0, KShortcut(), false }
183 };
184 
185 
189 static KStandardShortcutInfo *guardedStandardShortcutInfo(StandardShortcut id)
190 {
191  if (id >= static_cast<int>(sizeof(g_infoStandardShortcut) / sizeof(KStandardShortcutInfo)) ||
192  id < 0) {
193  kWarning(125) << "KStandardShortcut: id not found!";
194  return &g_infoStandardShortcut[AccelNone];
195  } else
196  return &g_infoStandardShortcut[id];
197 }
198 
204 static void initialize(StandardShortcut id)
205 {
206  KStandardShortcutInfo *info = guardedStandardShortcutInfo(id);
207 
208  // All three are needed.
209  if (info->id!=AccelNone) {
210  Q_ASSERT(info->description);
211  Q_ASSERT(info->translation_context);
212  Q_ASSERT(info->name);
213  }
214 
215  KConfigGroup cg(KGlobal::config(), "Shortcuts");
216 
217 #ifdef Q_WS_X11
218  // Code within this block breaks if we aren't running in GUI mode.
219  if(QX11Info::display() && cg.hasKey(info->name))
220 #else
221  if(cg.hasKey(info->name))
222 #endif
223  {
224  QString s = cg.readEntry(info->name);
225  if (s != "none")
226  info->cut = KShortcut(s);
227  else
228  info->cut = KShortcut();
229  } else {
230  info->cut = hardcodedDefaultShortcut(id);
231  }
232 
233  info->isInitialized = true;
234 }
235 
236 void saveShortcut(StandardShortcut id, const KShortcut &newShortcut)
237 {
238  KStandardShortcutInfo *info = guardedStandardShortcutInfo(id);
239  // If the action has no standard shortcut associated there is nothing to
240  // save
241  if(info->id == AccelNone)
242  return;
243 
244  KConfigGroup cg(KGlobal::config(), "Shortcuts");
245 
246  info->cut = newShortcut;
247  bool sameAsDefault = (newShortcut == hardcodedDefaultShortcut(id));
248 
249  if (sameAsDefault) {
250  // If the shortcut is the equal to the hardcoded one we remove it from
251  // kdeglobal if necessary and return.
252  if(cg.hasKey(info->name))
253  cg.deleteEntry(info->name, KConfig::Global|KConfig::Persistent);
254 
255  return;
256  }
257 
258  // Write the changed shortcut to kdeglobals
259  cg.writeEntry(info->name, info->cut.toString(), KConfig::Global|KConfig::Persistent);
260 }
261 
262 QString name(StandardShortcut id)
263 {
264  return guardedStandardShortcutInfo(id)->name;
265 }
266 
267 QString label(StandardShortcut id)
268 {
269  KStandardShortcutInfo *info = guardedStandardShortcutInfo( id );
270  return i18nc(
271  info->translation_context,
272  info->description);
273 }
274 
275 // TODO: Add psWhatsThis entry to KStandardShortcutInfo
276 QString whatsThis( StandardShortcut /*id*/ )
277 {
278 // KStandardShortcutInfo* info = guardedStandardShortcutInfo( id );
279 // if( info && info->whatsThis )
280 // return i18n(info->whatsThis);
281 // else
282  return QString();
283 }
284 
285 const KShortcut &shortcut(StandardShortcut id)
286 {
287  KStandardShortcutInfo *info = guardedStandardShortcutInfo(id);
288 
289  if(!info->isInitialized)
290  initialize(id);
291 
292  return info->cut;
293 }
294 
295 StandardShortcut find(const QKeySequence &seq)
296 {
297  if( !seq.isEmpty() ) {
298  for(uint i = 0; i < sizeof(g_infoStandardShortcut) / sizeof(KStandardShortcutInfo); i++) {
299  StandardShortcut id = g_infoStandardShortcut[i].id;
300  if( id != AccelNone ) {
301  if(!g_infoStandardShortcut[i].isInitialized)
302  initialize(id);
303  if(g_infoStandardShortcut[i].cut.contains(seq))
304  return id;
305  }
306  }
307  }
308  return AccelNone;
309 }
310 
311 StandardShortcut find(const char *keyName)
312 {
313  for(uint i = 0; i < sizeof(g_infoStandardShortcut) / sizeof(KStandardShortcutInfo); i++)
314  if (qstrcmp(g_infoStandardShortcut[i].name, keyName))
315  return g_infoStandardShortcut[i].id;
316 
317  return AccelNone;
318 }
319 
320 KShortcut hardcodedDefaultShortcut(StandardShortcut id)
321 {
322  KShortcut cut;
323  KStandardShortcutInfo *info = guardedStandardShortcutInfo(id);
324 
325  return KShortcut(info->cutDefault, info->cutDefault2);
326 }
327 
328 const KShortcut& open() { return shortcut( Open ); }
329 const KShortcut& openNew() { return shortcut( New ); }
330 const KShortcut& close() { return shortcut( Close ); }
331 const KShortcut& save() { return shortcut( Save ); }
332 const KShortcut& print() { return shortcut( Print ); }
333 const KShortcut& quit() { return shortcut( Quit ); }
334 const KShortcut& cut() { return shortcut( Cut ); }
335 const KShortcut& copy() { return shortcut( Copy ); }
336 const KShortcut& paste() { return shortcut( Paste ); }
337 const KShortcut& pasteSelection() { return shortcut( PasteSelection ); }
338 const KShortcut& deleteWordBack() { return shortcut( DeleteWordBack ); }
339 const KShortcut& deleteWordForward() { return shortcut( DeleteWordForward ); }
340 const KShortcut& undo() { return shortcut( Undo ); }
341 const KShortcut& redo() { return shortcut( Redo ); }
342 const KShortcut& find() { return shortcut( Find ); }
343 const KShortcut& findNext() { return shortcut( FindNext ); }
344 const KShortcut& findPrev() { return shortcut( FindPrev ); }
345 const KShortcut& replace() { return shortcut( Replace ); }
346 const KShortcut& home() { return shortcut( Home ); }
347 const KShortcut& begin() { return shortcut( Begin ); }
348 const KShortcut& end() { return shortcut( End ); }
349 const KShortcut& beginningOfLine() { return shortcut( BeginningOfLine ); }
350 const KShortcut& endOfLine() { return shortcut( EndOfLine ); }
351 const KShortcut& prior() { return shortcut( Prior ); }
352 const KShortcut& next() { return shortcut( Next ); }
353 const KShortcut& backwardWord() { return shortcut( BackwardWord ); }
354 const KShortcut& forwardWord() { return shortcut( ForwardWord ); }
355 const KShortcut& gotoLine() { return shortcut( GotoLine ); }
356 const KShortcut& addBookmark() { return shortcut( AddBookmark ); }
357 const KShortcut& tabNext() { return shortcut( TabNext ); }
358 const KShortcut& tabPrev() { return shortcut( TabPrev ); }
359 const KShortcut& fullScreen() { return shortcut( FullScreen ); }
360 const KShortcut& zoomIn() { return shortcut( ZoomIn ); }
361 const KShortcut& zoomOut() { return shortcut( ZoomOut ); }
362 const KShortcut& help() { return shortcut( Help ); }
363 const KShortcut& completion() { return shortcut( TextCompletion ); }
364 const KShortcut& prevCompletion() { return shortcut( PrevCompletion ); }
365 const KShortcut& nextCompletion() { return shortcut( NextCompletion ); }
366 const KShortcut& rotateUp() { return shortcut( RotateUp ); }
367 const KShortcut& rotateDown() { return shortcut( RotateDown ); }
368 const KShortcut& substringCompletion() { return shortcut( SubstringCompletion ); }
369 const KShortcut& whatsThis() { return shortcut( WhatsThis ); }
370 const KShortcut& reload() { return shortcut( Reload ); }
371 const KShortcut& selectAll() { return shortcut( SelectAll ); }
372 const KShortcut& up() { return shortcut( Up ); }
373 const KShortcut& back() { return shortcut( Back ); }
374 const KShortcut& forward() { return shortcut( Forward ); }
375 const KShortcut& showMenubar() { return shortcut( ShowMenubar ); }
376 
377 }
KStandardShortcut::findNext
const KShortcut & findNext()
Find/search next.
Definition: kstandardshortcut.cpp:343
KStandardShortcut::ActualSize
Definition: kstandardshortcut.h:92
KStandardShortcut::FitToHeight
Definition: kstandardshortcut.h:95
KShortcut::contains
bool contains(const QKeySequence &needle) const
Returns whether at least one of the key sequences is equal to needle.
Definition: kshortcut.cpp:149
KStandardShortcut::deleteWordForward
const KShortcut & deleteWordForward()
Delete a word forward from mouse/cursor position.
Definition: kstandardshortcut.cpp:339
KStandardShortcut::print
const KShortcut & print()
Print current document.
Definition: kstandardshortcut.cpp:332
KStandardShortcut::Back
Definition: kstandardshortcut.h:70
KStandardShortcut::Find
Definition: kstandardshortcut.h:67
KConfig::Persistent
KStandardShortcut::next
const KShortcut & next()
Scroll down one page.
Definition: kstandardshortcut.cpp:352
KStandardShortcut::Close
Definition: kstandardshortcut.h:60
KStandardShortcut::SelectAll
Definition: kstandardshortcut.h:66
kdebug.h
KStandardShortcut::ShowToolbar
Definition: kstandardshortcut.h:103
KStandardShortcut::up
const KShortcut & up()
Up.
Definition: kstandardshortcut.cpp:372
T
#define T
I18N_NOOP2
#define I18N_NOOP2(comment, x)
We need to remember the context to get the correct translation.
Definition: kstandardshortcut.cpp:68
KStandardShortcut::forwardWord
const KShortcut & forwardWord()
ForwardWord.
Definition: kstandardshortcut.cpp:354
KStandardShortcut::SubstringCompletion
Definition: kstandardshortcut.h:82
KStandardShortcut::redo
const KShortcut & redo()
Redo.
Definition: kstandardshortcut.cpp:341
KStandardShortcut::find
StandardShortcut find(const QKeySequence &seq)
Return the StandardShortcut id of the standard accel action which uses this key sequence, or AccelNone if none of them do.
Definition: kstandardshortcut.cpp:295
KStandardShortcut::Prior
Definition: kstandardshortcut.h:69
KConfig::Global
KStandardShortcut::ShowStatusbar
Definition: kstandardshortcut.h:104
KStandardShortcut::Spelling
Definition: kstandardshortcut.h:102
KStandardShortcut::BeginningOfLine
Definition: kstandardshortcut.h:72
QX11Info::display
Display * display()
KStandardShortcut::open
const KShortcut & open()
Open file.
Definition: kstandardshortcut.cpp:328
KStandardShortcut::shortcut
const KShortcut & shortcut(StandardShortcut id)
Returns the keybinding for accel.
Definition: kstandardshortcut.cpp:285
KStandardShortcut::label
QString label(StandardShortcut id)
Returns a localized label for user-visible display.
Definition: kstandardshortcut.cpp:267
KStandardShortcut::undo
const KShortcut & undo()
Undo last operation.
Definition: kstandardshortcut.cpp:340
kconfig.h
KStandardShortcut::Cut
Definition: kstandardshortcut.h:65
KStandardShortcut::substringCompletion
const KShortcut & substringCompletion()
Find a string within another string or list of strings.
Definition: kstandardshortcut.cpp:368
KStandardShortcut::Paste
Definition: kstandardshortcut.h:65
KStandardShortcut::selectAll
const KShortcut & selectAll()
Select all.
Definition: kstandardshortcut.cpp:371
KStandardShortcut::Help
Definition: kstandardshortcut.h:80
KStandardShortcut::SaveAs
Definition: kstandardshortcut.h:87
KStandardShortcut::tabPrev
const KShortcut & tabPrev()
Previous Tab.
Definition: kstandardshortcut.cpp:358
KStandardShortcut::back
const KShortcut & back()
Back.
Definition: kstandardshortcut.cpp:373
KStandardShortcut::Replace
Definition: kstandardshortcut.h:67
KStandardShortcut::zoomIn
const KShortcut & zoomIn()
Zoom in.
Definition: kstandardshortcut.cpp:360
kshortcut.h
Defines platform-independent classes for keyboard shortcut handling.
KStandardShortcut::findPrev
const KShortcut & findPrev()
Find/search previous.
Definition: kstandardshortcut.cpp:344
KConfigGroup::writeEntry
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
CTRLSHIFT
#define CTRLSHIFT(x)
Definition: kstandardshortcut.cpp:72
KStandardShortcut::name
QString name(StandardShortcut id)
Returns a unique name for the given accel.
Definition: kstandardshortcut.cpp:262
KStandardShortcut::BackwardWord
Definition: kstandardshortcut.h:73
KStandardShortcut::PasteSelection
Definition: kstandardshortcut.h:65
klocale.h
KStandardShortcut::Next
Definition: kstandardshortcut.h:69
KStandardShortcut::addBookmark
const KShortcut & addBookmark()
Add current page to bookmarks.
Definition: kstandardshortcut.cpp:356
i18nc
QString i18nc(const char *ctxt, const char *text)
KGlobal::config
KSharedConfigPtr config()
KStandardShortcut::FullScreen
Definition: kstandardshortcut.h:75
KStandardShortcut::SwitchApplicationLanguage
Definition: kstandardshortcut.h:112
KShortcut
Represents a keyboard shortcut.
Definition: kshortcut.h:57
KStandardShortcut::gotoLine
const KShortcut & gotoLine()
Go to line.
Definition: kstandardshortcut.cpp:355
KConfigGroup::deleteEntry
void deleteEntry(const QString &pKey, WriteConfigFlags pFlags=Normal)
KStandardShortcut::DeleteWordBack
Definition: kstandardshortcut.h:66
M
#define M(h, p)
kglobal.h
KStandardShortcut::ConfigureNotifications
Definition: kstandardshortcut.h:109
KStandardShortcut::TabPrev
Definition: kstandardshortcut.h:78
KStandardShortcut::End
Definition: kstandardshortcut.h:69
KStandardShortcut::zoomOut
const KShortcut & zoomOut()
Zoom out.
Definition: kstandardshortcut.cpp:361
F
#define F
KStandardShortcut::GotoLine
Definition: kstandardshortcut.h:72
KStandardShortcut::Open
Definition: kstandardshortcut.h:60
KStandardShortcut::PrevCompletion
Definition: kstandardshortcut.h:82
KStandardGuiItem::Delete
Definition: kstandardguiitem.h:52
KStandardShortcut::tabNext
const KShortcut & tabNext()
Next Tab.
Definition: kstandardshortcut.cpp:357
KStandardShortcut::AddBookmark
Definition: kstandardshortcut.h:75
KStandardShortcut::StandardShortcut
StandardShortcut
Defines the identifier of all standard accelerators.
Definition: kstandardshortcut.h:55
KStandardGuiItem::Insert
Definition: kstandardguiitem.h:52
SHIFT
#define SHIFT(x)
Definition: kstandardshortcut.cpp:71
KStandardShortcut::guardedStandardShortcutInfo
static KStandardShortcutInfo * guardedStandardShortcutInfo(StandardShortcut id)
Search for the KStandardShortcutInfo object associated with the given id.
Definition: kstandardshortcut.cpp:189
KStandardShortcut::endOfLine
const KShortcut & endOfLine()
Goto end of current line.
Definition: kstandardshortcut.cpp:350
CTRL
#define CTRL(x)
Definition: kstandardshortcut.cpp:70
KStandardShortcut::save
const KShortcut & save()
Save current document.
Definition: kstandardshortcut.cpp:331
KStandardShortcut::OpenRecent
Definition: kstandardshortcut.h:86
KStandardShortcut::Copy
Definition: kstandardshortcut.h:65
KStandardShortcut::ReportBug
Definition: kstandardshortcut.h:111
KStandardShortcut::ZoomOut
Definition: kstandardshortcut.h:75
KStandardShortcut::AboutKDE
Definition: kstandardshortcut.h:114
KStandardShortcut::backwardWord
const KShortcut & backwardWord()
BackwardWord.
Definition: kstandardshortcut.cpp:353
KStandardShortcut::beginningOfLine
const KShortcut & beginningOfLine()
Goto beginning of current line.
Definition: kstandardshortcut.cpp:349
KStandardShortcut::EditBookmarks
Definition: kstandardshortcut.h:101
KStandardShortcut::Begin
Definition: kstandardshortcut.h:69
ALT
#define ALT(x)
Definition: kstandardshortcut.cpp:73
KStandardShortcut::replace
const KShortcut & replace()
Find and replace matches.
Definition: kstandardshortcut.cpp:345
QString
KStandardShortcut::hardcodedDefaultShortcut
KShortcut hardcodedDefaultShortcut(StandardShortcut id)
Returns the hardcoded default shortcut for id.
Definition: kstandardshortcut.cpp:320
KStandardShortcut::initialize
static void initialize(StandardShortcut id)
Initialize the accelerator id by checking if it is overridden in the configuration file (and if it is...
Definition: kstandardshortcut.cpp:204
KStandardShortcut::Goto
Definition: kstandardshortcut.h:97
KStandardShortcut::Redo
Definition: kstandardshortcut.h:65
KStandardShortcut::help
const KShortcut & help()
Help the user in the current situation.
Definition: kstandardshortcut.cpp:362
KStandardShortcut::reload
const KShortcut & reload()
Reload.
Definition: kstandardshortcut.cpp:370
KStandardShortcut::g_infoStandardShortcut
static KStandardShortcutInfo g_infoStandardShortcut[]
Array of predefined KStandardShortcutInfo objects, which cover all the "standard" accelerators...
Definition: kstandardshortcut.cpp:82
KStandardShortcut::ForwardWord
Definition: kstandardshortcut.h:73
KStandardShortcut::copy
const KShortcut & copy()
Copy selected area into the clipboard.
Definition: kstandardshortcut.cpp:335
KStandardShortcut::FitToWidth
Definition: kstandardshortcut.h:94
KStandardShortcut::Preferences
Definition: kstandardshortcut.h:107
KStandardShortcut::saveShortcut
void saveShortcut(StandardShortcut id, const KShortcut &newShortcut)
Saves the new shortcut cut for standard accel id.
Definition: kstandardshortcut.cpp:236
kstandardshortcut.h
KStandardShortcut::Clear
Definition: kstandardshortcut.h:91
KStandardShortcut::forward
const KShortcut & forward()
Forward.
Definition: kstandardshortcut.cpp:374
KStandardShortcut::Home
Definition: kstandardshortcut.h:69
KStandardShortcut::Mail
Definition: kstandardshortcut.h:90
QKeySequence::isEmpty
bool isEmpty() const
KStandardShortcut::cut
const KShortcut & cut()
Cut selected area and store it in the clipboard.
Definition: kstandardshortcut.cpp:334
KConfigGroup::hasKey
bool hasKey(const QString &key) const
KStandardShortcut::Forward
Definition: kstandardshortcut.h:70
KStandardShortcut::FindNext
Definition: kstandardshortcut.h:67
ALTSHIFT
#define ALTSHIFT(x)
Definition: kstandardshortcut.cpp:74
KStandardShortcut::TextCompletion
Definition: kstandardshortcut.h:82
KStandardShortcut::ZoomIn
Definition: kstandardshortcut.h:75
KStandardShortcut::close
const KShortcut & close()
Close current document.
Definition: kstandardshortcut.cpp:330
KConfigGroup
KStandardShortcut::PrintPreview
Definition: kstandardshortcut.h:89
KStandardShortcut::nextCompletion
const KShortcut & nextCompletion()
Iterate through a list when completion returns multiple items.
Definition: kstandardshortcut.cpp:365
KStandardShortcut::TipofDay
Definition: kstandardshortcut.h:110
KStandardShortcut::deleteWordBack
const KShortcut & deleteWordBack()
Delete a word back from mouse/cursor position.
Definition: kstandardshortcut.cpp:338
KStandardShortcut::FindPrev
Definition: kstandardshortcut.h:67
KStandardShortcut::DocumentBack
Definition: kstandardshortcut.h:99
QKeySequence
KStandardShortcut::KeyBindings
Definition: kstandardshortcut.h:106
KStandardShortcut::prior
const KShortcut & prior()
Scroll up one page.
Definition: kstandardshortcut.cpp:351
KStandardShortcut::pasteSelection
const KShortcut & pasteSelection()
Paste the selection at mouse/cursor position.
Definition: kstandardshortcut.cpp:337
KStandardShortcut::NextCompletion
Definition: kstandardshortcut.h:82
KStandardShortcut::AboutApp
Definition: kstandardshortcut.h:113
KStandardShortcut::whatsThis
QString whatsThis(StandardShortcut)
What's This button.
Definition: kstandardshortcut.cpp:276
KStandardShortcut::prevCompletion
const KShortcut & prevCompletion()
Iterate through a list when completion returns multiple items.
Definition: kstandardshortcut.cpp:364
KStandardShortcut::RotateUp
Definition: kstandardshortcut.h:84
KStandardShortcut::DocumentForward
Definition: kstandardshortcut.h:100
KStandardShortcut::Zoom
Definition: kstandardshortcut.h:96
KStandardShortcut::Quit
Definition: kstandardshortcut.h:63
KStandardShortcut::FitToPage
Definition: kstandardshortcut.h:93
KStandardShortcut::Deselect
Definition: kstandardshortcut.h:66
KStandardShortcut::Print
Definition: kstandardshortcut.h:62
kWarning
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KStandardShortcut::Reload
Definition: kstandardshortcut.h:70
KStandardShortcut::quit
const KShortcut & quit()
Quit the program.
Definition: kstandardshortcut.cpp:333
X
#define X
KStandardShortcut::RotateDown
Definition: kstandardshortcut.h:84
KStandardShortcut::rotateDown
const KShortcut & rotateDown()
Help users iterate through a list of entries.
Definition: kstandardshortcut.cpp:367
KStandardShortcut::Save
Definition: kstandardshortcut.h:60
KStandardShortcut::AccelNone
Definition: kstandardshortcut.h:58
KStandardShortcut::fullScreen
const KShortcut & fullScreen()
Full Screen Mode.
Definition: kstandardshortcut.cpp:359
KStandardShortcut::New
Definition: kstandardshortcut.h:60
KStandardShortcut::DeleteWordForward
Definition: kstandardshortcut.h:66
KStandardShortcut::Up
Definition: kstandardshortcut.h:70
KStandardShortcut::TabNext
Definition: kstandardshortcut.h:78
KStandardShortcut::end
const KShortcut & end()
Goto end of the document.
Definition: kstandardshortcut.cpp:348
KStandardShortcut::rotateUp
const KShortcut & rotateUp()
Help users iterate through a list of entries.
Definition: kstandardshortcut.cpp:366
KStandardShortcut::GotoPage
Definition: kstandardshortcut.h:98
KConfigGroup::readEntry
T readEntry(const QString &key, const T &aDefault) const
KStandardShortcut::showMenubar
const KShortcut & showMenubar()
Show Menu Bar.
Definition: kstandardshortcut.cpp:375
KStandardShortcut::completion
const KShortcut & completion()
Complete text in input widgets.
Definition: kstandardshortcut.cpp:363
KStandardShortcut::WhatsThis
Definition: kstandardshortcut.h:80
KStandardShortcut::ShowMenubar
Definition: kstandardshortcut.h:76
KStandardShortcut::ConfigureToolbars
Definition: kstandardshortcut.h:108
KStandardShortcut::openNew
const KShortcut & openNew()
Create a new document (or whatever).
Definition: kstandardshortcut.cpp:329
kconfiggroup.h
KStandardShortcut::Undo
Definition: kstandardshortcut.h:65
KStandardShortcut::paste
const KShortcut & paste()
Paste contents of clipboard at mouse/cursor position.
Definition: kstandardshortcut.cpp:336
KStandardShortcut::begin
const KShortcut & begin()
Goto beginning of the document.
Definition: kstandardshortcut.cpp:347
KStandardShortcut::SaveOptions
Definition: kstandardshortcut.h:105
KStandardShortcut::Revert
Definition: kstandardshortcut.h:88
KStandardShortcut::home
const KShortcut & home()
Goto home page.
Definition: kstandardshortcut.cpp:346
KStandardShortcut::EndOfLine
Definition: kstandardshortcut.h:72
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • 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