kglobalaccel.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "kglobalaccel.h"
00021 #ifdef Q_WS_X11
00022 #include "kglobalaccel_x11.h"
00023 #elif defined(Q_WS_WIN)
00024 #include "kglobalaccel_win.h"
00025 #elif defined(Q_WS_MACX)
00026 #include "kglobalaccel_mac.h"
00027 #else
00028 #include "kglobalaccel_emb.h"
00029 #endif
00030
00031 #include <qstring.h>
00032 #include "kaccelbase.h"
00033 #include <kdebug.h>
00034 #include <kshortcut.h>
00035 #include <klocale.h>
00036
00037
00038
00039 KGlobalAccel::KGlobalAccel( QObject* pParent, const char* psName )
00040 : QObject( pParent, psName )
00041 {
00042 kdDebug(125) << "KGlobalAccel(): this = " << this << endl;
00043 d = new KGlobalAccelPrivate();
00044 }
00045
00046 KGlobalAccel::~KGlobalAccel()
00047 {
00048 kdDebug(125) << "~KGlobalAccel(): this = " << this << endl;
00049 delete d;
00050 }
00051
00052
00053
00054
00055
00056 KAccelActions& KGlobalAccel::actions()
00057 { return d->actions(); }
00058
00059 const KAccelActions& KGlobalAccel::actions() const
00060 { return d->actions(); }
00061
00062 bool KGlobalAccel::isEnabled()
00063 { return ((KAccelBase*)d)->isEnabled(); }
00064
00065 void KGlobalAccel::setEnabled( bool bEnabled )
00066 { d->setEnabled( bEnabled ); }
00067
00068 KAccelAction* KGlobalAccel::insert( const QString& sAction, const QString& sDesc, const QString& sHelp,
00069 const KShortcut& cutDef3, const KShortcut& cutDef4,
00070 const QObject* pObjSlot, const char* psMethodSlot,
00071 bool bConfigurable, bool bEnabled )
00072 {
00073 return d->insert( sAction, sDesc, sHelp,
00074 cutDef3, cutDef4,
00075 pObjSlot, psMethodSlot,
00076 bConfigurable, bEnabled );
00077 }
00078
00079 KAccelAction* KGlobalAccel::insert( const QString& sName, const QString& sDesc )
00080 { return d->insert( sName, sDesc ); }
00081 bool KGlobalAccel::updateConnections()
00082 { return d->updateConnections(); }
00083
00084 bool KGlobalAccel::remove( const QString& sAction )
00085 { return d->remove( sAction ); }
00086
00087 const KShortcut& KGlobalAccel::shortcut( const QString& sAction ) const
00088 {
00089 const KAccelAction* pAction = d->actions().actionPtr( sAction );
00090 return (pAction) ? pAction->shortcut() : KShortcut::null();
00091 }
00092
00093 bool KGlobalAccel::setShortcut( const QString& sAction, const KShortcut& cut )
00094 { return d->setShortcut( sAction, cut ); }
00095 bool KGlobalAccel::setSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot )
00096 { return d->setActionSlot( sAction, pObjSlot, psMethodSlot ); }
00097 QString KGlobalAccel::label( const QString& sAction ) const
00098 {
00099 const KAccelAction* pAction = d->actions().actionPtr( sAction );
00100 return (pAction) ? pAction->label() : QString();
00101 }
00102 bool KGlobalAccel::setActionEnabled( const QString& sAction, bool bEnable )
00103 {
00104 return d->setActionEnabled( sAction, bEnable );
00105 }
00106
00107 const QString& KGlobalAccel::configGroup() const
00108 { return d->configGroup(); }
00109
00110 void KGlobalAccel::setConfigGroup( const QString& s )
00111 { d->setConfigGroup( s ); }
00112
00113 bool KGlobalAccel::readSettings( KConfigBase* pConfig )
00114 { d->readSettings( pConfig ); return true; }
00115 bool KGlobalAccel::writeSettings( KConfigBase* pConfig ) const
00116 { d->writeSettings( pConfig ); return true; }
00117 bool KGlobalAccel::writeSettings( KConfigBase* pConfig, bool bGlobal ) const
00118 {
00119 d->setConfigGlobal( bGlobal );
00120 d->writeSettings( pConfig );
00121 return true;
00122 }
00123
00124 bool KGlobalAccel::useFourModifierKeys()
00125 { return KAccelAction::useFourModifierKeys(); }
00126
00127 void KGlobalAccel::virtual_hook( int, void* )
00128 { }
00129
00130 #include "kglobalaccel.moc"
This file is part of the documentation for kdecore Library Version 3.4.3.