kstdaccel.cpp
/* This file is part of the KDE libraries
Copyright (C) 1997 Stefan Taferner (taferner@alpin.or.at)
Copyright (C) 2000 Nicolas Hadacek (haadcek@kde.org)
Copyright (C) 2001,2002 Ellis Whitehead (ellis@kde.org)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#define __KSTDACCEL_CPP_ 1
#include "kstdaccel.h"
#include "kaccelaction.h"
#include "kaccelbase.h"
#include <kconfig.h>
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
#include <kshortcut.h>
#include <kshortcutlist.h>
namespace KStdAccel
{
struct KStdAccelInfo
{
StdAccel id;
const char* psName;
const char* psDesc;
int cutDefault, cutDefault4, cutDefault3B, cutDefault4B;
KShortcut cut;
bool bInitialized;
};
static KStdAccelInfo g_infoStdAccel[] =
{
{AccelNone, "Group:File", I18N_NOOP("File"), 0, 0, 0, 0, KShortcut(), false },
{ Open, I18N_NOOP("Open"), 0, Qt::CTRL+Qt::Key_O, 0, 0, 0, KShortcut(), false },
{ New, I18N_NOOP("New"), 0, Qt::CTRL+Qt::Key_N, 0, 0, 0, KShortcut(), false },
{ Close, I18N_NOOP("Close"), 0, Qt::CTRL+Qt::Key_W, Qt::CTRL+Qt::Key_Escape, 0, Qt::CTRL+Qt::Key_W, KShortcut(), false },
{ Save, I18N_NOOP("Save"), 0, Qt::CTRL+Qt::Key_S, 0, 0, 0, KShortcut(), false },
{ Print, I18N_NOOP("Print"), 0, Qt::CTRL+Qt::Key_P, 0, 0, 0, KShortcut(), false },
{ Quit, I18N_NOOP("Quit"), 0, Qt::CTRL+Qt::Key_Q, 0, 0, 0, KShortcut(), false },
{AccelNone, "Group:Edit", I18N_NOOP("Edit"), 0, 0, 0, 0, KShortcut(), false },
{ Undo, I18N_NOOP("Undo"), 0, Qt::CTRL+Qt::Key_Z, 0, 0, 0, KShortcut(), false },
{ Redo, I18N_NOOP("Redo"), 0, Qt::CTRL+Qt::SHIFT+Qt::Key_Z, 0, 0, 0, KShortcut(), false },
{ Cut, I18N_NOOP("Cut"), 0, Qt::CTRL+Qt::Key_X, 0, Qt::SHIFT+Qt::Key_Delete, 0, KShortcut(), false },
{ Copy, I18N_NOOP("Copy"), 0, Qt::CTRL+Qt::Key_C, 0, Qt::CTRL+Qt::Key_Insert, 0, KShortcut(), false },
{ Paste, I18N_NOOP("Paste"), 0, Qt::CTRL+Qt::Key_V, 0, Qt::SHIFT+Qt::Key_Insert, 0, KShortcut(), false },
{ PasteSelection, I18N_NOOP("Paste Selection"), 0, 0, 0, Qt::CTRL+Qt::SHIFT+Qt::Key_Insert, 0, KShortcut(), false },
{ SelectAll, "SelectAll", I18N_NOOP("Select All"), Qt::CTRL+Qt::Key_A, 0, 0, 0, KShortcut(), false },
{ Deselect, I18N_NOOP("Deselect"), 0, Qt::CTRL+Qt::SHIFT+Qt::Key_A, 0, 0, 0, KShortcut(), false },
{ DeleteWordBack, "DeleteWordBack", I18N_NOOP("Delete Word Backwards"), Qt::CTRL+Qt::Key_Backspace, 0, 0, 0, KShortcut(), false },
{ DeleteWordForward, "DeleteWordForward", I18N_NOOP("Delete Word Forward"), Qt::CTRL+Qt::Key_Delete, 0, 0, 0, KShortcut(), false },
{ Find, I18N_NOOP("Find"), 0, Qt::CTRL+Qt::Key_F, 0, 0, 0, KShortcut(), false },
{ FindNext, "FindNext", I18N_NOOP("Find Next"), Qt::Key_F3, 0, 0, 0, KShortcut(), false },
{ FindPrev, "FindPrev", I18N_NOOP("Find Prev"), Qt::SHIFT+Qt::Key_F3, 0, 0, 0, KShortcut(), false },
{ Replace, I18N_NOOP("Replace"), 0, Qt::CTRL+Qt::Key_R, 0, 0, 0, KShortcut(), false },
{AccelNone, "Group:Navigation", I18N_NOOP("Navigation"), 0, 0, 0, 0, KShortcut(), false },
{ Home, I18N_NOOP2("Opposite to End","Home"), 0, Qt::CTRL+Qt::Key_Home, 0, Qt::Key_HomePage, 0, KShortcut(), false },
{ End, I18N_NOOP("End"), 0, Qt::CTRL+Qt::Key_End, 0, 0, 0, KShortcut(), false },
{ BeginningOfLine, "BeginningOfLine", I18N_NOOP("Beginning of Line"), Qt::Key_Home, 0, 0, 0, KShortcut(), false},
{ EndOfLine, "EndOfLine", I18N_NOOP("End of Line"), Qt::Key_End, 0, 0, 0, KShortcut(), false},
{ Prior, I18N_NOOP("Prior"), 0, Qt::Key_Prior, 0, 0, 0, KShortcut(), false },
{ Next, I18N_NOOP2("Opposite to Prior","Next"), 0, Qt::Key_Next, 0, 0, 0, KShortcut(), false },
{ GotoLine, "GotoLine", I18N_NOOP("Go to Line"), Qt::CTRL+Qt::Key_G, 0, 0, 0, KShortcut(), false },
{ AddBookmark, "AddBookmark", I18N_NOOP("Add Bookmark"), Qt::CTRL+Qt::Key_B, 0, 0, 0, KShortcut(), false },
{ ZoomIn, "ZoomIn", I18N_NOOP("Zoom In"), Qt::CTRL+Qt::Key_Plus, 0, 0, 0, KShortcut(), false },
{ ZoomOut, "ZoomOut", I18N_NOOP("Zoom Out"), Qt::CTRL+Qt::Key_Minus, 0, 0, 0, KShortcut(), false },
{ Up, I18N_NOOP("Up"), 0, Qt::ALT+Qt::Key_Up, 0, 0, 0, KShortcut(), false },
{ Back, I18N_NOOP("Back"), 0, Qt::ALT+Qt::Key_Left, 0, Qt::Key_Back, 0, KShortcut(), false },
{ Forward, I18N_NOOP("Forward"), 0, Qt::ALT+Qt::Key_Right, 0, Qt::Key_Forward, 0, KShortcut(), false },
{ Reload, I18N_NOOP("Reload"), 0, Qt::Key_F5, 0, Qt::Key_Refresh, 0, KShortcut(), false },
{ PopupMenuContext, "PopupMenuContext", I18N_NOOP("Popup Menu Context"), Qt::Key_Menu, 0, 0, 0, KShortcut(), false },
{ ShowMenubar, "ShowMenubar", I18N_NOOP("Show Menu Bar"), Qt::CTRL+Qt::Key_M, 0, 0, 0, KShortcut(), false },
{ BackwardWord, "BackwardWord", I18N_NOOP("Backward Word"), Qt::CTRL+Qt::Key_Left, 0, 0, 0, KShortcut(), false },
{ ForwardWord, "ForwardWord", I18N_NOOP("Forward Word"), Qt::CTRL+Qt::Key_Right, 0, 0, 0, KShortcut(), false },
{ TabNext, I18N_NOOP("Activate Next Tab"), 0, Qt::CTRL+Qt::Key_Period, 0, Qt::CTRL+Qt::Key_BracketRight, 0, KShortcut(), false },
{ TabPrev, I18N_NOOP("Activate Previous Tab"), 0, Qt::CTRL+Qt::Key_Comma, 0, Qt::CTRL+Qt::Key_BracketLeft, 0, KShortcut(), false },
{ FullScreen, "FullScreen", I18N_NOOP("Full Screen Mode"), Qt::CTRL+Qt::SHIFT+Qt::Key_F, 0, 0, 0, KShortcut(), false },
{AccelNone, "Group:Help", I18N_NOOP("Help"), 0, 0, 0, 0, KShortcut(), false },
{ Help, I18N_NOOP("Help"), 0, Qt::Key_F1, 0, 0, 0, KShortcut(), false },
{ WhatsThis, "WhatsThis", I18N_NOOP("What's This"), Qt::SHIFT+Qt::Key_F1, 0, 0, 0, KShortcut(), false },
{AccelNone, "Group:TextCompletion", I18N_NOOP("Text Completion"), 0, 0, 0, 0, KShortcut(), false },
{ TextCompletion, "TextCompletion", I18N_NOOP("Text Completion"), Qt::CTRL+Qt::Key_E, 0, 0, 0, KShortcut(), false },
{ PrevCompletion, "PrevCompletion", I18N_NOOP("Previous Completion Match"), Qt::CTRL+Qt::Key_Up, 0, 0, 0, KShortcut(), false },
{ NextCompletion, "NextCompletion", I18N_NOOP("Next Completion Match"), Qt::CTRL+Qt::Key_Down, 0, 0, 0, KShortcut(), false },
{ SubstringCompletion, "SubstringCompletion", I18N_NOOP("Substring Completion"), Qt::CTRL+Qt::Key_T, 0, 0, 0, KShortcut(), false },
{ RotateUp, "RotateUp", I18N_NOOP("Previous Item in List"), Qt::Key_Up, 0, 0, 0, KShortcut(), false },
{ RotateDown, "RotateDown", I18N_NOOP("Next Item in List"), Qt::Key_Down, 0, 0, 0, KShortcut(), false },
{ AccelNone, 0, 0, 0, 0, 0, 0, KShortcut(), false }
};
static KStdAccelInfo* infoPtr( StdAccel id )
{
if( id != AccelNone ) {
// Linear search. Changing the data structure doesn't seem possible
// (since we need groups for the config stuff), but maybe a little
// additional hashtable wouldn't hurt.
for( uint i = 0; g_infoStdAccel[i].psName != 0; i++ ) {
if( g_infoStdAccel[i].id == id )
return &g_infoStdAccel[i];
}
}
return 0;
}
static void initialize( StdAccel id )
{
KConfigGroupSaver saver( KGlobal::config(), "Shortcuts" );
KStdAccelInfo* pInfo = infoPtr( id );
if( !pInfo ) {
kdWarning(125) << "KStdAccel: id not found!" << endl; // -- ellis
return;
}
if( saver.config()->hasKey( pInfo->psName ) ) {
QString s = saver.config()->readEntry( pInfo->psName );
if( s != "none" )
pInfo->cut.init( s );
else
pInfo->cut.clear();
} else
pInfo->cut = shortcutDefault( id );
pInfo->bInitialized = true;
}
QString name( StdAccel id )
{
KStdAccelInfo* pInfo = infoPtr( id );
if( !pInfo )
return QString::null;
return pInfo->psName;
}
QString label( StdAccel id )
{
KStdAccelInfo* pInfo = infoPtr( id );
if( !pInfo )
return QString::null;
return i18n((pInfo->psDesc) ? pInfo->psDesc : pInfo->psName);
}
// TODO: Add psWhatsThis entry to KStdAccelInfo
QString whatsThis( StdAccel /*id*/ )
{
// KStdAccelInfo* pInfo = infoPtr( id );
// if( pInfo && pInfo->psWhatsThis )
// return i18n(pInfo->psWhatsThis);
// else
return QString::null;
}
const KShortcut& shortcut( StdAccel id )
{
KStdAccelInfo* pInfo = infoPtr( id );
if( !pInfo )
return KShortcut::null();
if( !pInfo->bInitialized )
initialize( id );
return pInfo->cut;
}
StdAccel findStdAccel( const KKeySequence& seq )
{
if( !seq.isNull() ) {
for( uint i = 0; g_infoStdAccel[i].psName != 0; i++ ) {
StdAccel id = g_infoStdAccel[i].id;
if( id != AccelNone ) {
if( !g_infoStdAccel[i].bInitialized )
initialize( id );
if( g_infoStdAccel[i].cut.contains( seq ) )
return id;
}
}
}
return AccelNone;
}
KShortcut shortcutDefault( StdAccel id )
{
return (KAccelAction::useFourModifierKeys())
? shortcutDefault4(id) : shortcutDefault3(id);
}
KShortcut shortcutDefault3( StdAccel id )
{
KShortcut cut;
KStdAccelInfo* pInfo = infoPtr( id );
if( pInfo ) {
if( pInfo->cutDefault )
cut.init( pInfo->cutDefault );
// FIXME: if there is no cutDefault, then this we be made the primary
// instead of alternate shortcut.
if( pInfo->cutDefault3B )
cut.append( KKey(pInfo->cutDefault3B) );
}
return cut;
}
KShortcut shortcutDefault4( StdAccel id )
{
KShortcut cut;
KStdAccelInfo* pInfo = infoPtr( id );
if( pInfo ) {
KStdAccelInfo& info = *pInfo;
KKeySequence key2;
cut.init( (info.cutDefault4) ?
QKeySequence(info.cutDefault) : QKeySequence(info.cutDefault4) );
if( info.cutDefault4B )
key2.init( QKeySequence(info.cutDefault4B) );
else if( info.cutDefault3B )
key2.init( QKeySequence(info.cutDefault3B) );
if( key2.count() )
cut.append( key2 );
}
return cut;
}
#if 0 // unused
void createAccelActions( KAccelActions& actions )
{
actions.clear();
for( uint i = 0; g_infoStdAccel[i].psName != 0; i++ ) {
StdAccel id = g_infoStdAccel[i].id;
KStdAccelInfo* pInfo = &g_infoStdAccel[i];
if( id != AccelNone ) {
actions.insert( pInfo->psName,
i18n((pInfo->psDesc) ? pInfo->psDesc : pInfo->psName),
QString::null, // pInfo->psWhatsThis,
shortcutDefault3(id),
shortcutDefault4(id) );
} else
actions.insert( pInfo->psName, i18n(pInfo->psDesc) );
}
}
#endif
const KShortcut& open() { return shortcut( Open ); }
const KShortcut& openNew() { return shortcut( New ); }
const KShortcut& close() { return shortcut( Close ); }
const KShortcut& save() { return shortcut( Save ); }
const KShortcut& print() { return shortcut( Print ); }
const KShortcut& quit() { return shortcut( Quit ); }
const KShortcut& cut() { return shortcut( Cut ); }
const KShortcut& copy() { return shortcut( Copy ); }
const KShortcut& paste() { return shortcut( Paste ); }
const KShortcut& pasteSelection() { return shortcut( PasteSelection ); }
const KShortcut& deleteWordBack() { return shortcut( DeleteWordBack ); }
const KShortcut& deleteWordForward() { return shortcut( DeleteWordForward ); }
const KShortcut& undo() { return shortcut( Undo ); }
const KShortcut& redo() { return shortcut( Redo ); }
const KShortcut& find() { return shortcut( Find ); }
const KShortcut& findNext() { return shortcut( FindNext ); }
const KShortcut& findPrev() { return shortcut( FindPrev ); }
const KShortcut& replace() { return shortcut( Replace ); }
const KShortcut& home() { return shortcut( Home ); }
const KShortcut& end() { return shortcut( End ); }
const KShortcut& beginningOfLine() { return shortcut( BeginningOfLine ); }
const KShortcut& endOfLine() { return shortcut( EndOfLine ); }
const KShortcut& prior() { return shortcut( Prior ); }
const KShortcut& next() { return shortcut( Next ); }
const KShortcut& backwardWord() { return shortcut( BackwardWord ); }
const KShortcut& forwardWord() { return shortcut( ForwardWord ); }
const KShortcut& gotoLine() { return shortcut( GotoLine ); }
const KShortcut& addBookmark() { return shortcut( AddBookmark ); }
const KShortcut& tabNext() { return shortcut( TabNext ); }
const KShortcut& tabPrev() { return shortcut( TabPrev ); }
const KShortcut& fullScreen() { return shortcut( FullScreen ); }
const KShortcut& zoomIn() { return shortcut( ZoomIn ); }
const KShortcut& zoomOut() { return shortcut( ZoomOut ); }
const KShortcut& help() { return shortcut( Help ); }
const KShortcut& completion() { return shortcut( TextCompletion ); }
const KShortcut& prevCompletion() { return shortcut( PrevCompletion ); }
const KShortcut& nextCompletion() { return shortcut( NextCompletion ); }
const KShortcut& rotateUp() { return shortcut( RotateUp ); }
const KShortcut& rotateDown() { return shortcut( RotateDown ); }
const KShortcut& substringCompletion() { return shortcut( SubstringCompletion ); }
const KShortcut& popupMenuContext() { return shortcut( PopupMenuContext ); }
const KShortcut& whatsThis() { return shortcut( WhatsThis ); }
const KShortcut& reload() { return shortcut( Reload ); }
const KShortcut& selectAll() { return shortcut( SelectAll ); }
const KShortcut& up() { return shortcut( Up ); }
const KShortcut& back() { return shortcut( Back ); }
const KShortcut& forward() { return shortcut( Forward ); }
const KShortcut& showMenubar() { return shortcut( ShowMenubar ); }
//---------------------------------------------------------------------
// ShortcutList
//---------------------------------------------------------------------
ShortcutList::ShortcutList()
{ }
ShortcutList::~ShortcutList()
{ }
uint ShortcutList::count() const
{
static uint g_nAccels = 0;
if( g_nAccels == 0 ) {
for( ; g_infoStdAccel[g_nAccels].psName != 0; g_nAccels++ )
;
}
return g_nAccels;
}
QString ShortcutList::name( uint i ) const
{ return g_infoStdAccel[i].psName; }
QString ShortcutList::label( uint i ) const
{ return i18n((g_infoStdAccel[i].psDesc) ? g_infoStdAccel[i].psDesc : g_infoStdAccel[i].psName); }
QString ShortcutList::whatsThis( uint ) const
{ return QString::null; }
const KShortcut& ShortcutList::shortcut( uint i ) const
{
if( !g_infoStdAccel[i].bInitialized )
initialize( g_infoStdAccel[i].id );
return g_infoStdAccel[i].cut;
}
const KShortcut& ShortcutList::shortcutDefault( uint i ) const
{
static KShortcut cut;
cut = KStdAccel::shortcutDefault( g_infoStdAccel[i].id );
return cut;
}
bool ShortcutList::isConfigurable( uint i ) const
{ return (g_infoStdAccel[i].id != AccelNone); }
bool ShortcutList::setShortcut( uint i, const KShortcut& cut )
{ g_infoStdAccel[i].cut = cut; return true; }
QVariant ShortcutList::getOther( Other, uint ) const
{ return QVariant(); }
bool ShortcutList::setOther( Other, uint, QVariant )
{ return false; }
bool ShortcutList::save() const
{
return writeSettings( QString::null, 0, false, true );
}
KDECORE_EXPORT QString action(StdAccel id)
{ return name(id); }
KDECORE_EXPORT QString description(StdAccel id)
{ return label(id); }
KDECORE_EXPORT int key(StdAccel id)
{ return shortcut(id).keyCodeQt(); }
KDECORE_EXPORT int defaultKey(StdAccel id)
{ return shortcutDefault(id).keyCodeQt(); }
KDECORE_EXPORT bool isEqual(const QKeyEvent* ev, int keyQt)
{
KKey key1( ev ), key2( keyQt );
return key1 == key2;
}
}
#undef __KSTDACCEL_CPP_
KStdAccel::next
const KShortcut & next()
Scroll down one page.
Definition: kstdaccel.cpp:293
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::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:664
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:420
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::findPrev
const KShortcut & findPrev()
Find/search previous.
Definition: kstdaccel.cpp:286
KStdAccel::forwardWord
const KShortcut & forwardWord()
ForwardWord.
Definition: kstdaccel.cpp:295
KConfigBase::hasKey
bool hasKey(const QString &key) const
Checks whether the key has an entry in the currently active group.
Definition: kconfigbase.cpp:109
KKeySequence::init
bool init(const QKeySequence &keySeq)
Copies the given qt key sequence over this key sequence.
Definition: kshortcut.cpp:226
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:415
KStdAccel::zoomOut
const KShortcut & zoomOut()
Zoom out.
Definition: kstdaccel.cpp:302
KStdAccel::ShortcutList::ShortcutList
ShortcutList()
Creates a new ShortcutList.
Definition: kstdaccel.cpp:323
KStdAccel::description
QString description(StdAccel id)
Definition: kstdaccel.cpp:381
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
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
KStdAccel::action
QString action(StdAccel id)
Definition: kstdaccel.cpp:379
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::isEqual
bool isEqual(const QKeyEvent *ev, int keyQt)
Definition: kstdaccel.cpp:388
KStdAccel::redo
const KShortcut & redo()
Redo.
Definition: kstdaccel.cpp:283
KStdAccel::ShortcutList::name
virtual QString name(uint index) const
Returns the name of the shortcut with the given index.
Definition: kstdaccel.cpp:339
KStdAccel::back
const KShortcut & back()
Back.
Definition: kstdaccel.cpp:315
KStdAccel::label
QString label(StdAccel id)
Returns a localized label for user-visible display.
Definition: kstdaccel.cpp:156
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::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:2057
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::whatsThis
QString whatsThis(StdAccel)
Returns an extended WhatsThis description for the given accelerator.
Definition: kstdaccel.cpp:165
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::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
KStdAccel::endOfLine
const KShortcut & endOfLine()
Goto end of current line.
Definition: kstdaccel.cpp:291
KConfigBase::readEntry
QString readEntry(const QString &pKey, const QString &aDefault=QString::null) const
Reads the value of an entry specified by pKey in the current group.
Definition: kconfigbase.cpp:203
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:584
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
KShortcut::contains
bool contains(const KKey &key) const
Checks whether this shortcut contains a sequence that starts with the given key.
Definition: kshortcut.cpp:529
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:507
KStdAccel::defaultKey
int defaultKey(StdAccel id)
Definition: kstdaccel.cpp:385
endl
kndbgstream & endl(kndbgstream &s)
Does nothing.
Definition: kdebug.h:583
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
KShortcutList::writeSettings
virtual bool writeSettings(const QString &sConfigGroup=QString::null, KConfigBase *pConfig=0, bool bWriteAll=false, bool bGlobal=false) const
Writes the shortcuts to the given configuration file.
Definition: kshortcutlist.cpp:109
KKeySequence::isNull
bool isNull() const
Returns true if the key sequence is null (after clear() or empty constructor).
Definition: kshortcut.cpp:315
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::ShortcutList::label
virtual QString label(uint index) const
Returns the (i18n'd) label of the shortcut with the given index.
Definition: kstdaccel.cpp:342
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::name
QString name(StdAccel id)
Returns a unique name for the given accel.
Definition: kstdaccel.cpp:148
KStdAccel::ShortcutList::whatsThis
virtual QString whatsThis(uint index) const
Returns the (i18n'd) What's This text of the shortcut with the given index.
Definition: kstdaccel.cpp:345
KStdAccel::BeginningOfLine
Definition: kstdaccel.h:76
KKeySequence::count
uint count() const
Returns the number of key strokes of this sequence.
Definition: kshortcut.cpp:288

KDE Home | KDE Accessibility Home | Description of Access Keys