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