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

kdecore

  • kdecore
kstdaccel.cpp
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 #define __KSTDACCEL_CPP_ 1
21 
22 #include "kstdaccel.h"
23 
24 #include "kaccelaction.h"
25 #include "kaccelbase.h"
26 #include <kconfig.h>
27 #include <kdebug.h>
28 #include <kglobal.h>
29 #include <klocale.h>
30 #include <kshortcut.h>
31 #include <kshortcutlist.h>
32 
33 namespace KStdAccel
34 {
35 
36 struct KStdAccelInfo
37 {
38  StdAccel id;
39  const char* psName;
40  const char* psDesc;
41  int cutDefault, cutDefault4, cutDefault3B, cutDefault4B;
42  KShortcut cut;
43  bool bInitialized;
44 };
45 
50 static KStdAccelInfo g_infoStdAccel[] =
51 {
52  {AccelNone, "Group:File", I18N_NOOP("File"), 0, 0, 0, 0, KShortcut(), false },
53  { Open, I18N_NOOP("Open"), 0, Qt::CTRL+Qt::Key_O, 0, 0, 0, KShortcut(), false },
54  { New, I18N_NOOP("New"), 0, Qt::CTRL+Qt::Key_N, 0, 0, 0, KShortcut(), false },
55  { Close, I18N_NOOP("Close"), 0, Qt::CTRL+Qt::Key_W, Qt::CTRL+Qt::Key_Escape, 0, Qt::CTRL+Qt::Key_W, KShortcut(), false },
56  { Save, I18N_NOOP("Save"), 0, Qt::CTRL+Qt::Key_S, 0, 0, 0, KShortcut(), false },
57  { Print, I18N_NOOP("Print"), 0, Qt::CTRL+Qt::Key_P, 0, 0, 0, KShortcut(), false },
58  { Quit, I18N_NOOP("Quit"), 0, Qt::CTRL+Qt::Key_Q, 0, 0, 0, KShortcut(), false },
59  {AccelNone, "Group:Edit", I18N_NOOP("Edit"), 0, 0, 0, 0, KShortcut(), false },
60  { Undo, I18N_NOOP("Undo"), 0, Qt::CTRL+Qt::Key_Z, 0, 0, 0, KShortcut(), false },
61  { Redo, I18N_NOOP("Redo"), 0, Qt::CTRL+Qt::SHIFT+Qt::Key_Z, 0, 0, 0, KShortcut(), false },
62  { Cut, I18N_NOOP("Cut"), 0, Qt::CTRL+Qt::Key_X, 0, Qt::SHIFT+Qt::Key_Delete, 0, KShortcut(), false },
63  { Copy, I18N_NOOP("Copy"), 0, Qt::CTRL+Qt::Key_C, 0, Qt::CTRL+Qt::Key_Insert, 0, KShortcut(), false },
64  { Paste, I18N_NOOP("Paste"), 0, Qt::CTRL+Qt::Key_V, 0, Qt::SHIFT+Qt::Key_Insert, 0, KShortcut(), false },
65  { PasteSelection, I18N_NOOP("Paste Selection"), 0, 0, 0, Qt::CTRL+Qt::SHIFT+Qt::Key_Insert, 0, KShortcut(), false },
66  { SelectAll, "SelectAll", I18N_NOOP("Select All"), Qt::CTRL+Qt::Key_A, 0, 0, 0, KShortcut(), false },
67  { Deselect, I18N_NOOP("Deselect"), 0, Qt::CTRL+Qt::SHIFT+Qt::Key_A, 0, 0, 0, KShortcut(), false },
68  { DeleteWordBack, "DeleteWordBack", I18N_NOOP("Delete Word Backwards"), Qt::CTRL+Qt::Key_Backspace, 0, 0, 0, KShortcut(), false },
69  { DeleteWordForward, "DeleteWordForward", I18N_NOOP("Delete Word Forward"), Qt::CTRL+Qt::Key_Delete, 0, 0, 0, KShortcut(), false },
70  { Find, I18N_NOOP("Find"), 0, Qt::CTRL+Qt::Key_F, 0, 0, 0, KShortcut(), false },
71  { FindNext, "FindNext", I18N_NOOP("Find Next"), Qt::Key_F3, 0, 0, 0, KShortcut(), false },
72  { FindPrev, "FindPrev", I18N_NOOP("Find Prev"), Qt::SHIFT+Qt::Key_F3, 0, 0, 0, KShortcut(), false },
73  { Replace, I18N_NOOP("Replace"), 0, Qt::CTRL+Qt::Key_R, 0, 0, 0, KShortcut(), false },
74  {AccelNone, "Group:Navigation", I18N_NOOP("Navigation"), 0, 0, 0, 0, KShortcut(), false },
75  { Home, I18N_NOOP2("Opposite to End","Home"), 0, Qt::CTRL+Qt::Key_Home, 0, Qt::Key_HomePage, 0, KShortcut(), false },
76  { End, I18N_NOOP("End"), 0, Qt::CTRL+Qt::Key_End, 0, 0, 0, KShortcut(), false },
77  { BeginningOfLine, "BeginningOfLine", I18N_NOOP("Beginning of Line"), Qt::Key_Home, 0, 0, 0, KShortcut(), false},
78  { EndOfLine, "EndOfLine", I18N_NOOP("End of Line"), Qt::Key_End, 0, 0, 0, KShortcut(), false},
79  { Prior, I18N_NOOP("Prior"), 0, TQt::Key_Prior, 0, 0, 0, KShortcut(), false },
80  { Next, I18N_NOOP2("Opposite to Prior","Next"), 0, TQt::Key_Next, 0, 0, 0, KShortcut(), false },
81  { GotoLine, "GotoLine", I18N_NOOP("Go to Line"), Qt::CTRL+Qt::Key_G, 0, 0, 0, KShortcut(), false },
82  { AddBookmark, "AddBookmark", I18N_NOOP("Add Bookmark"), Qt::CTRL+Qt::Key_B, 0, 0, 0, KShortcut(), false },
83  { ZoomIn, "ZoomIn", I18N_NOOP("Zoom In"), Qt::CTRL+Qt::Key_Plus, 0, 0, 0, KShortcut(), false },
84  { ZoomOut, "ZoomOut", I18N_NOOP("Zoom Out"), Qt::CTRL+Qt::Key_Minus, 0, 0, 0, KShortcut(), false },
85  { Up, I18N_NOOP("Up"), 0, Qt::ALT+Qt::Key_Up, 0, 0, 0, KShortcut(), false },
86  { Back, I18N_NOOP("Back"), 0, Qt::ALT+Qt::Key_Left, 0, Qt::Key_Back, 0, KShortcut(), false },
87  { Forward, I18N_NOOP("Forward"), 0, Qt::ALT+Qt::Key_Right, 0, Qt::Key_Forward, 0, KShortcut(), false },
88  { Reload, I18N_NOOP("Reload"), 0, Qt::Key_F5, 0, Qt::Key_Refresh, 0, KShortcut(), false },
89  { PopupMenuContext, "PopupMenuContext", I18N_NOOP("Popup Menu Context"), Qt::Key_Menu, 0, 0, 0, KShortcut(), false },
90  { ShowMenubar, "ShowMenubar", I18N_NOOP("Show Menu Bar"), Qt::CTRL+Qt::Key_M, 0, 0, 0, KShortcut(), false },
91  { BackwardWord, "BackwardWord", I18N_NOOP("Backward Word"), Qt::CTRL+Qt::Key_Left, 0, 0, 0, KShortcut(), false },
92  { ForwardWord, "ForwardWord", I18N_NOOP("Forward Word"), Qt::CTRL+Qt::Key_Right, 0, 0, 0, KShortcut(), false },
93  { TabNext, I18N_NOOP("Activate Next Tab"), 0, Qt::CTRL+Qt::Key_Period, 0, Qt::CTRL+Qt::Key_BracketRight, 0, KShortcut(), false },
94  { TabPrev, I18N_NOOP("Activate Previous Tab"), 0, Qt::CTRL+Qt::Key_Comma, 0, Qt::CTRL+Qt::Key_BracketLeft, 0, KShortcut(), false },
95  { FullScreen, "FullScreen", I18N_NOOP("Full Screen Mode"), Qt::CTRL+Qt::SHIFT+Qt::Key_F, 0, 0, 0, KShortcut(), false },
96  {AccelNone, "Group:Help", I18N_NOOP("Help"), 0, 0, 0, 0, KShortcut(), false },
97  { Help, I18N_NOOP("Help"), 0, Qt::Key_F1, 0, 0, 0, KShortcut(), false },
98  { WhatsThis, "WhatsThis", I18N_NOOP("What's This"), Qt::SHIFT+Qt::Key_F1, 0, 0, 0, KShortcut(), false },
99  {AccelNone, "Group:TextCompletion", I18N_NOOP("Text Completion"), 0, 0, 0, 0, KShortcut(), false },
100  { TextCompletion, "TextCompletion", I18N_NOOP("Text Completion"), Qt::CTRL+Qt::Key_E, 0, 0, 0, KShortcut(), false },
101  { PrevCompletion, "PrevCompletion", I18N_NOOP("Previous Completion Match"), Qt::CTRL+Qt::Key_Up, 0, 0, 0, KShortcut(), false },
102  { NextCompletion, "NextCompletion", I18N_NOOP("Next Completion Match"), Qt::CTRL+Qt::Key_Down, 0, 0, 0, KShortcut(), false },
103  { SubstringCompletion, "SubstringCompletion", I18N_NOOP("Substring Completion"), Qt::CTRL+Qt::Key_T, 0, 0, 0, KShortcut(), false },
104  { RotateUp, "RotateUp", I18N_NOOP("Previous Item in List"), Qt::Key_Up, 0, 0, 0, KShortcut(), false },
105  { RotateDown, "RotateDown", I18N_NOOP("Next Item in List"), Qt::Key_Down, 0, 0, 0, KShortcut(), false },
106  { AccelNone, 0, 0, 0, 0, 0, 0, KShortcut(), false }
107 };
108 
110 static KStdAccelInfo* infoPtr( StdAccel id )
111 {
112  if( id != AccelNone ) {
113  // Linear search. Changing the data structure doesn't seem possible
114  // (since we need groups for the config stuff), but maybe a little
115  // additional hashtable wouldn't hurt.
116  for( uint i = 0; g_infoStdAccel[i].psName != 0; i++ ) {
117  if( g_infoStdAccel[i].id == id )
118  return &g_infoStdAccel[i];
119  }
120  }
121  return 0;
122 }
123 
127 static void initialize( StdAccel id )
128 {
129  KConfigGroupSaver saver( KGlobal::config(), "Shortcuts" );
130  KStdAccelInfo* pInfo = infoPtr( id );
131 
132  if( !pInfo ) {
133  kdWarning(125) << "KStdAccel: id not found!" << endl; // -- ellis
134  return;
135  }
136 
137  if( saver.config()->hasKey( pInfo->psName ) ) {
138  TQString s = saver.config()->readEntry( pInfo->psName );
139  if( s != "none" )
140  pInfo->cut.init( s );
141  else
142  pInfo->cut.clear();
143  } else
144  pInfo->cut = shortcutDefault( id );
145  pInfo->bInitialized = true;
146 }
147 
148 TQString name( StdAccel id )
149 {
150  KStdAccelInfo* pInfo = infoPtr( id );
151  if( !pInfo )
152  return TQString::null;
153  return pInfo->psName;
154 }
155 
156 TQString label( StdAccel id )
157 {
158  KStdAccelInfo* pInfo = infoPtr( id );
159  if( !pInfo )
160  return TQString::null;
161  return i18n((pInfo->psDesc) ? pInfo->psDesc : pInfo->psName);
162 }
163 
164 // TODO: Add psWhatsThis entry to KStdAccelInfo
165 TQString whatsThis( StdAccel /*id*/ )
166 {
167 // KStdAccelInfo* pInfo = infoPtr( id );
168 // if( pInfo && pInfo->psWhatsThis )
169 // return i18n(pInfo->psWhatsThis);
170 // else
171  return TQString::null;
172 }
173 
174 const KShortcut& shortcut( StdAccel id )
175 {
176  KStdAccelInfo* pInfo = infoPtr( id );
177  if( !pInfo )
178  return KShortcut::null();
179 
180  if( !pInfo->bInitialized )
181  initialize( id );
182 
183  return pInfo->cut;
184 }
185 
186 StdAccel findStdAccel( const KKeySequence& seq )
187 {
188  if( !seq.isNull() ) {
189  for( uint i = 0; g_infoStdAccel[i].psName != 0; i++ ) {
190  StdAccel id = g_infoStdAccel[i].id;
191  if( id != AccelNone ) {
192  if( !g_infoStdAccel[i].bInitialized )
193  initialize( id );
194  if( g_infoStdAccel[i].cut.contains( seq ) )
195  return id;
196  }
197  }
198  }
199  return AccelNone;
200 }
201 
202 KShortcut shortcutDefault( StdAccel id )
203 {
204  return (KAccelAction::useFourModifierKeys())
205  ? shortcutDefault4(id) : shortcutDefault3(id);
206 }
207 
208 KShortcut shortcutDefault3( StdAccel id )
209 {
210  KShortcut cut;
211 
212  KStdAccelInfo* pInfo = infoPtr( id );
213  if( pInfo ) {
214  if( pInfo->cutDefault )
215  cut.init( pInfo->cutDefault );
216  // FIXME: if there is no cutDefault, then this we be made the primary
217  // instead of alternate shortcut.
218  if( pInfo->cutDefault3B )
219  cut.append( KKey(pInfo->cutDefault3B) );
220  }
221 
222  return cut;
223 }
224 
225 KShortcut shortcutDefault4( StdAccel id )
226 {
227  KShortcut cut;
228 
229  KStdAccelInfo* pInfo = infoPtr( id );
230  if( pInfo ) {
231  KStdAccelInfo& info = *pInfo;
232  KKeySequence key2;
233 
234  cut.init( (info.cutDefault4) ?
235  TQKeySequence(info.cutDefault) : TQKeySequence(info.cutDefault4) );
236 
237  if( info.cutDefault4B )
238  key2.init( TQKeySequence(info.cutDefault4B) );
239  else if( info.cutDefault3B )
240  key2.init( TQKeySequence(info.cutDefault3B) );
241 
242  if( key2.count() )
243  cut.append( key2 );
244  }
245 
246  return cut;
247 }
248 
249 #if 0 // unused
250 void createAccelActions( KAccelActions& actions )
251 {
252  actions.clear();
253 
254  for( uint i = 0; g_infoStdAccel[i].psName != 0; i++ ) {
255  StdAccel id = g_infoStdAccel[i].id;
256  KStdAccelInfo* pInfo = &g_infoStdAccel[i];
257 
258  if( id != AccelNone ) {
259  actions.insert( pInfo->psName,
260  i18n((pInfo->psDesc) ? pInfo->psDesc : pInfo->psName),
261  TQString::null, // pInfo->psWhatsThis,
262  shortcutDefault3(id),
263  shortcutDefault4(id) );
264  } else
265  actions.insert( pInfo->psName, i18n(pInfo->psDesc) );
266  }
267 }
268 #endif
269 
270 const KShortcut& open() { return shortcut( Open ); }
271 const KShortcut& openNew() { return shortcut( New ); }
272 const KShortcut& close() { return shortcut( Close ); }
273 const KShortcut& save() { return shortcut( Save ); }
274 const KShortcut& print() { return shortcut( Print ); }
275 const KShortcut& quit() { return shortcut( Quit ); }
276 const KShortcut& cut() { return shortcut( Cut ); }
277 const KShortcut& copy() { return shortcut( Copy ); }
278 const KShortcut& paste() { return shortcut( Paste ); }
279 const KShortcut& pasteSelection() { return shortcut( PasteSelection ); }
280 const KShortcut& deleteWordBack() { return shortcut( DeleteWordBack ); }
281 const KShortcut& deleteWordForward() { return shortcut( DeleteWordForward ); }
282 const KShortcut& undo() { return shortcut( Undo ); }
283 const KShortcut& redo() { return shortcut( Redo ); }
284 const KShortcut& find() { return shortcut( Find ); }
285 const KShortcut& findNext() { return shortcut( FindNext ); }
286 const KShortcut& findPrev() { return shortcut( FindPrev ); }
287 const KShortcut& replace() { return shortcut( Replace ); }
288 const KShortcut& home() { return shortcut( Home ); }
289 const KShortcut& end() { return shortcut( End ); }
290 const KShortcut& beginningOfLine() { return shortcut( BeginningOfLine ); }
291 const KShortcut& endOfLine() { return shortcut( EndOfLine ); }
292 const KShortcut& prior() { return shortcut( Prior ); }
293 const KShortcut& next() { return shortcut( Next ); }
294 const KShortcut& backwardWord() { return shortcut( BackwardWord ); }
295 const KShortcut& forwardWord() { return shortcut( ForwardWord ); }
296 const KShortcut& gotoLine() { return shortcut( GotoLine ); }
297 const KShortcut& addBookmark() { return shortcut( AddBookmark ); }
298 const KShortcut& tabNext() { return shortcut( TabNext ); }
299 const KShortcut& tabPrev() { return shortcut( TabPrev ); }
300 const KShortcut& fullScreen() { return shortcut( FullScreen ); }
301 const KShortcut& zoomIn() { return shortcut( ZoomIn ); }
302 const KShortcut& zoomOut() { return shortcut( ZoomOut ); }
303 const KShortcut& help() { return shortcut( Help ); }
304 const KShortcut& completion() { return shortcut( TextCompletion ); }
305 const KShortcut& prevCompletion() { return shortcut( PrevCompletion ); }
306 const KShortcut& nextCompletion() { return shortcut( NextCompletion ); }
307 const KShortcut& rotateUp() { return shortcut( RotateUp ); }
308 const KShortcut& rotateDown() { return shortcut( RotateDown ); }
309 const KShortcut& substringCompletion() { return shortcut( SubstringCompletion ); }
310 const KShortcut& popupMenuContext() { return shortcut( PopupMenuContext ); }
311 const KShortcut& whatsThis() { return shortcut( WhatsThis ); }
312 const KShortcut& reload() { return shortcut( Reload ); }
313 const KShortcut& selectAll() { return shortcut( SelectAll ); }
314 const KShortcut& up() { return shortcut( Up ); }
315 const KShortcut& back() { return shortcut( Back ); }
316 const KShortcut& forward() { return shortcut( Forward ); }
317 const KShortcut& showMenubar() { return shortcut( ShowMenubar ); }
318 
319 //---------------------------------------------------------------------
320 // ShortcutList
321 //---------------------------------------------------------------------
322 
323 ShortcutList::ShortcutList()
324  { }
325 
326 ShortcutList::~ShortcutList()
327  { }
328 
329 uint ShortcutList::count() const
330 {
331  static uint g_nAccels = 0;
332  if( g_nAccels == 0 ) {
333  for( ; g_infoStdAccel[g_nAccels].psName != 0; g_nAccels++ )
334  ;
335  }
336  return g_nAccels;
337 }
338 
339 TQString ShortcutList::name( uint i ) const
340  { return g_infoStdAccel[i].psName; }
341 
342 TQString ShortcutList::label( uint i ) const
343  { return i18n((g_infoStdAccel[i].psDesc) ? g_infoStdAccel[i].psDesc : g_infoStdAccel[i].psName); }
344 
345 TQString ShortcutList::whatsThis( uint ) const
346  { return TQString::null; }
347 
348 const KShortcut& ShortcutList::shortcut( uint i ) const
349 {
350  if( !g_infoStdAccel[i].bInitialized )
351  initialize( g_infoStdAccel[i].id );
352  return g_infoStdAccel[i].cut;
353 }
354 
355 const KShortcut& ShortcutList::shortcutDefault( uint i ) const
356 {
357  static KShortcut cut;
358  cut = KStdAccel::shortcutDefault( g_infoStdAccel[i].id );
359  return cut;
360 }
361 
362 bool ShortcutList::isConfigurable( uint i ) const
363  { return (g_infoStdAccel[i].id != AccelNone); }
364 
365 bool ShortcutList::setShortcut( uint i, const KShortcut& cut )
366  { g_infoStdAccel[i].cut = cut; return true; }
367 
368 TQVariant ShortcutList::getOther( Other, uint ) const
369  { return TQVariant(); }
370 
371 bool ShortcutList::setOther( Other, uint, TQVariant )
372  { return false; }
373 
374 bool ShortcutList::save() const
375 {
376  return writeSettings( TQString::null, 0, false, true );
377 }
378 
379 KDECORE_EXPORT TQString action(StdAccel id)
380  { return name(id); }
381 KDECORE_EXPORT TQString description(StdAccel id)
382  { return label(id); }
383 KDECORE_EXPORT int key(StdAccel id)
384  { return shortcut(id).keyCodeQt(); }
385 KDECORE_EXPORT int defaultKey(StdAccel id)
386  { return shortcutDefault(id).keyCodeQt(); }
387 
388 KDECORE_EXPORT bool isEqual(const TQKeyEvent* ev, int keyQt)
389 {
390  KKey key1( ev ), key2( keyQt );
391  return key1 == key2;
392 }
393 
394 }
395 
396 #undef __KSTDACCEL_CPP_
KStdAccel::next
const KShortcut & next()
Scroll down one page.
Definition: kstdaccel.cpp:293
KStdAccel::isEqual
bool isEqual(const TQKeyEvent *ev, int keyQt)
Definition: kstdaccel.cpp:388
KStdAccel::ForwardWord
Definition: kstdaccel.h:75
KStdAccel::deleteWordBack
const KShortcut & deleteWordBack()
Delete a word back from mouse/cursor position.
Definition: kstdaccel.cpp:280
KStdAccel::shortcut
const KShortcut & shortcut(StdAccel id)
Returns the keybinding for accel.
Definition: kstdaccel.cpp:174
KStdAccel::forward
const KShortcut & forward()
Forward.
Definition: kstdaccel.cpp:316
KStdAccel::shortcutDefault
KShortcut shortcutDefault(StdAccel id)
Returns the hardcoded default shortcut for id.
Definition: kstdaccel.cpp:202
KStdAccel::quit
const KShortcut & quit()
Quit the program.
Definition: kstdaccel.cpp:275
KStdAccel::ShortcutList::whatsThis
virtual TQString whatsThis(uint index) const
Returns the (i18n&#39;d) What&#39;s This text of the shortcut with the given index.
Definition: kstdaccel.cpp:345
KStdAccel::openNew
const KShortcut & openNew()
Create a new document (or whatever).
Definition: kstdaccel.cpp:271
KShortcut::null
static KShortcut & null()
Returns a null shortcut.
Definition: kshortcut.cpp:667
KStdAccel::paste
const KShortcut & paste()
Paste contents of clipboard at mouse/cursor position.
Definition: kstdaccel.cpp:278
KShortcut::init
bool init(int keyQt)
Initializes the shortcut with the given Qt key code as the only key sequence.
Definition: kshortcut.cpp:421
KStdAccel::reload
const KShortcut & reload()
Reload.
Definition: kstdaccel.cpp:312
KStdAccel::completion
const KShortcut & completion()
Complete text in input widgets.
Definition: kstdaccel.cpp:304
KStdAccel::ShortcutList::shortcutDefault
virtual const KShortcut & shortcutDefault(uint index) const
Returns default shortcut with the given index.
Definition: kstdaccel.cpp:355
KStdAccel::label
TQString label(StdAccel id)
Returns a localized label for user-visible display.
Definition: kstdaccel.cpp:156
KStdAccel::ShortcutList::label
virtual TQString label(uint index) const
Returns the (i18n&#39;d) label of the shortcut with the given index.
Definition: kstdaccel.cpp:342
KStdAccel::findPrev
const KShortcut & findPrev()
Find/search previous.
Definition: kstdaccel.cpp:286
KStdAccel::forwardWord
const KShortcut & forwardWord()
ForwardWord.
Definition: kstdaccel.cpp:295
KStdAccel::shortcutDefault4
KShortcut shortcutDefault4(StdAccel id)
Returns the hardcoded default 4 modifier shortcut for id.
Definition: kstdaccel.cpp:225
KStdAccel::showMenubar
const KShortcut & showMenubar()
Show Menu Bar.
Definition: kstdaccel.cpp:317
KShortcut::clear
void clear()
Clears the shortcut.
Definition: kshortcut.cpp:416
KStdAccel::zoomOut
const KShortcut & zoomOut()
Zoom out.
Definition: kstdaccel.cpp:302
KStdAccel::ShortcutList::ShortcutList
ShortcutList()
Creates a new ShortcutList.
Definition: kstdaccel.cpp:323
KStdAccel::whatsThis
TQString whatsThis(StdAccel)
Returns an extended WhatsThis description for the given accelerator.
Definition: kstdaccel.cpp:165
KKeySequence::init
bool init(const TQKeySequence &keySeq)
Copies the given qt key sequence over this key sequence.
Definition: kshortcut.cpp:227
klocale.h
KStdAccel::cut
const KShortcut & cut()
Cut selected area and store it in the clipboard.
Definition: kstdaccel.cpp:276
KStdAccel::addBookmark
const KShortcut & addBookmark()
Add current page to bookmarks.
Definition: kstdaccel.cpp:297
KStdAccel::gotoLine
const KShortcut & gotoLine()
Go to line.
Definition: kstdaccel.cpp:296
KConfigBase::readEntry
TQString readEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
Reads the value of an entry specified by pKey in the current group.
Definition: kconfigbase.cpp:222
KStdAccel::ShortcutList::count
virtual uint count() const
Returns the number of entries.
Definition: kstdaccel.cpp:329
KStdAccel::popupMenuContext
const KShortcut & popupMenuContext()
popup a context menu.
Definition: kstdaccel.cpp:310
KStdAccel::zoomIn
const KShortcut & zoomIn()
Zoom in.
Definition: kstdaccel.cpp:301
KShortcut
The KShortcut class is used to represent a keyboard shortcut to an action.
Definition: kshortcut.h:543
KStdAccel::pasteSelection
const KShortcut & pasteSelection()
Paste the selection at mouse/cursor position.
Definition: kstdaccel.cpp:279
KKeySequence
A KKeySequence object holds a sequence of up to 4 keys.
Definition: kshortcut.h:288
KStdAccel::save
const KShortcut & save()
Save current document.
Definition: kstdaccel.cpp:273
KStdAccel::prior
const KShortcut & prior()
Scroll up one page.
Definition: kstdaccel.cpp:292
KStdAccel::description
TQString description(StdAccel id)
Definition: kstdaccel.cpp:381
KStdAccel::redo
const KShortcut & redo()
Redo.
Definition: kstdaccel.cpp:283
KStdAccel::back
const KShortcut & back()
Back.
Definition: kstdaccel.cpp:315
KStdAccel::infoPtr
static KStdAccelInfo * infoPtr(StdAccel id)
Search for the KStdAccelInfo object associated with the given id.
Definition: kstdaccel.cpp:110
KStdAccel::findStdAccel
StdAccel findStdAccel(const KKeySequence &seq)
Return the StdAccel id of the standard accel action which uses this key sequence, or AccelNone if non...
Definition: kstdaccel.cpp:186
KStdAccel::g_infoStdAccel
static KStdAccelInfo g_infoStdAccel[]
Array of predefined KStdAccelInfo objects, which cover all the "standard" accelerators.
Definition: kstdaccel.cpp:50
KStdAccel::replace
const KShortcut & replace()
Find and replace matches.
Definition: kstdaccel.cpp:287
KStdAccel::close
const KShortcut & close()
Close current document.
Definition: kstdaccel.cpp:272
KStdAccel::fullScreen
const KShortcut & fullScreen()
Full Screen Mode.
Definition: kstdaccel.cpp:300
KStdAccel::action
TQString action(StdAccel id)
Definition: kstdaccel.cpp:379
KStdAccel::rotateDown
const KShortcut & rotateDown()
Help users iterate through a list of entries.
Definition: kstdaccel.cpp:308
KConfigGroupSaver
Helper class to facilitate working with KConfig / KSimpleConfig groups.
Definition: kconfigbase.h:2059
KStdAccel::key
int key(StdAccel id)
Definition: kstdaccel.cpp:383
KStdAccel::shortcutDefault3
KShortcut shortcutDefault3(StdAccel id)
Returns the hardcoded default 3 modifier shortcut for id.
Definition: kstdaccel.cpp:208
KStdAccel::PasteSelection
Definition: kstdaccel.h:79
KStdAccel::selectAll
const KShortcut & selectAll()
Reload.
Definition: kstdaccel.cpp:313
KStdAccel::ShortcutList::isConfigurable
virtual bool isConfigurable(uint index) const
Checks whether the shortcut with the given index is configurable.
Definition: kstdaccel.cpp:362
KStdAccel::EndOfLine
Definition: kstdaccel.h:77
KStdAccel::initialize
static void initialize(StdAccel id)
Initialize the accelerator id by checking if it is overridden in the configuration file (and if it is...
Definition: kstdaccel.cpp:127
KStdAccel::backwardWord
const KShortcut & backwardWord()
BackwardWord.
Definition: kstdaccel.cpp:294
KStdAccel::FullScreen
Definition: kstdaccel.h:71
KStdAccel::open
const KShortcut & open()
Open file.
Definition: kstdaccel.cpp:270
KStdAccel::name
TQString name(StdAccel id)
Returns a unique name for the given accel.
Definition: kstdaccel.cpp:148
KStdAccel::prevCompletion
const KShortcut & prevCompletion()
Iterate through a list when completion returns multiple items.
Definition: kstdaccel.cpp:305
KKey
A KKey object represents a single key with possible modifiers (Shift, Ctrl, Alt, Win).
Definition: kshortcut.h:40
KConfigBase::hasKey
bool hasKey(const TQString &key) const
Checks whether the key has an entry in the currently active group.
Definition: kconfigbase.cpp:110
KStdAccel::endOfLine
const KShortcut & endOfLine()
Goto end of current line.
Definition: kstdaccel.cpp:291
KStdAccel::nextCompletion
const KShortcut & nextCompletion()
Iterate through a list when completion returns multiple items.
Definition: kstdaccel.cpp:306
KStdAccel::BackwardWord
Definition: kstdaccel.h:74
KStdAccel::TabPrev
Definition: kstdaccel.h:68
KShortcut::append
bool append(const KKeySequence &keySeq)
Appends the given key sequence.
Definition: kshortcut.cpp:587
KStdAccel::StdAccel
StdAccel
Defines the identifier of all standard accelerators.
Definition: kstdaccel.h:47
KStdAccel::ShortcutList::shortcut
virtual const KShortcut & shortcut(uint index) const
Returns the shortcut with the given index.
Definition: kstdaccel.cpp:348
KStdAccel::undo
const KShortcut & undo()
Undo last operation.
Definition: kstdaccel.cpp:282
KStdAccel::rotateUp
const KShortcut & rotateUp()
Help users iterate through a list of entries.
Definition: kstdaccel.cpp:307
KStdAccel::home
const KShortcut & home()
Goto beginning of the document.
Definition: kstdaccel.cpp:288
KStdAccel
Convenient methods for access to the common accelerator keys in the key configuration.
Definition: kshortcutlist.h:254
KShortcut::contains
bool contains(const KKey &key) const
Checks whether this shortcut contains a sequence that starts with the given key.
Definition: kshortcut.cpp:532
KStdAccel::help
const KShortcut & help()
Help the user in the current situation.
Definition: kstdaccel.cpp:303
KShortcut::keyCodeQt
int keyCodeQt() const
Returns the key code of the first key sequence, or null if there is no first key sequence.
Definition: kshortcut.cpp:510
KStdAccel::defaultKey
int defaultKey(StdAccel id)
Definition: kstdaccel.cpp:385
endl
kndbgstream & endl(kndbgstream &s)
Does nothing.
Definition: kdebug.h:583
KStdAccel::ShortcutList::name
virtual TQString name(uint index) const
Returns the name of the shortcut with the given index.
Definition: kstdaccel.cpp:339
KStdAccel::ShortcutList::save
virtual bool save() const
Save the shortcut list.
Definition: kstdaccel.cpp:374
KStdAccel::deleteWordForward
const KShortcut & deleteWordForward()
Delete a word forward from mouse/cursor position.
Definition: kstdaccel.cpp:281
KStdAccel::print
const KShortcut & print()
Print current document.
Definition: kstdaccel.cpp:274
KStdAccel::tabPrev
const KShortcut & tabPrev()
Previous Tab.
Definition: kstdaccel.cpp:299
KStdAccel::ShortcutList::setShortcut
virtual bool setShortcut(uint index, const KShortcut &shortcut)
Sets the shortcut of the given entry.
Definition: kstdaccel.cpp:365
KStdAccel::TabNext
Definition: kstdaccel.h:67
KStdAccel::tabNext
const KShortcut & tabNext()
Next Tab.
Definition: kstdaccel.cpp:298
KKeySequence::isNull
bool isNull() const
Returns true if the key sequence is null (after clear() or empty constructor).
Definition: kshortcut.cpp:316
KStdAccel::up
const KShortcut & up()
Up.
Definition: kstdaccel.cpp:314
KStdAccel::substringCompletion
const KShortcut & substringCompletion()
Find a string within another string or list of strings.
Definition: kstdaccel.cpp:309
KStdAccel::end
const KShortcut & end()
Goto end of the document.
Definition: kstdaccel.cpp:289
KGlobal::config
static KConfig * config()
Returns the general config object.
Definition: kglobal.cpp:61
KStdAccel::findNext
const KShortcut & findNext()
Find/search next.
Definition: kstdaccel.cpp:285
KStdAccel::find
const KShortcut & find()
Find, search.
Definition: kstdaccel.cpp:284
KStdAccel::copy
const KShortcut & copy()
Copy selected area into the clipboard.
Definition: kstdaccel.cpp:277
KStdAccel::beginningOfLine
const KShortcut & beginningOfLine()
Goto beginning of current line.
Definition: kstdaccel.cpp:290
KStdAccel::BeginningOfLine
Definition: kstdaccel.h:76
KKeySequence::count
uint count() const
Returns the number of key strokes of this sequence.
Definition: kshortcut.cpp:289

kdecore

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

kdecore

Skip menu "kdecore"
  • 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 kdecore by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |