kglobalaccel.h
/* This file is part of the KDE libraries
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 as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
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.
*/
#ifndef _KGLOBALACCEL_H_
#define _KGLOBALACCEL_H_
#include <qobject.h>
#include <kshortcut.h>
class QPopupMenu;
class QWidget;
class KAccelAction;
class KAccelActions;
class KConfigBase;
class KGlobalAccelPrivate;
class KDECORE_EXPORT KGlobalAccel : public QObject
{
Q_OBJECT
public:
KGlobalAccel( QObject* pParent, const char* psName = 0 );
virtual ~KGlobalAccel();
bool isEnabled();
void setEnabled( bool bEnabled );
KAccelAction* insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
const KShortcut& cutDef3, const KShortcut& cutDef4,
const QObject* pObjSlot, const char* psMethodSlot,
bool bConfigurable = true, bool bEnabled = true );
bool remove( const QString& sAction );
KAccelAction* insert( const QString& sName, const QString& sLabel );
bool updateConnections();
const KShortcut& shortcut( const QString& sAction ) const;
bool setShortcut( const QString& sAction, const KShortcut &shortcut );
bool setSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot );
bool setActionEnabled( const QString& sAction, bool bEnable );
QString label( const QString& sAction ) const;
const QString& configGroup() const;
void setConfigGroup( const QString &cg );
bool readSettings( KConfigBase* pConfig = 0 );
bool writeSettings( KConfigBase* pConfig = 0 ) const;
// BCI: merge these two writeSettings methods in KDE 4.0
bool writeSettings( KConfigBase* pConfig, bool bGlobal ) const;
static bool useFourModifierKeys();
static void blockShortcuts( bool block );
void disableBlocking( bool disable );
// like setEnabled(), but doesn't ungrab (see in KGlobalAccelPrivate)
void suspend( bool s );
private:
KAccelActions& actions();
const KAccelActions& actions() const;
friend class KGlobalAccelPrivate;
friend class KAccelShortcutList;
protected:
virtual void virtual_hook( int id, void* data );
private:
class KGlobalAccelPrivate* d;
};
#endif // _KGLOBALACCEL_H_
KAccelShortcutList::virtual_hook
virtual void virtual_hook(int id, void *data)
used to extend the interface with virtuals without breaking binary compatibility
Definition: kshortcutlist.cpp:215
KShortcut
The KShortcut class is used to represent a keyboard shortcut to an action.
Definition: kshortcut.h:543
KAccelShortcutList
KShortcutList implementation to access KAccel and KGlobalAccel lists.
Definition: kshortcutlist.h:198
KConfigBase
KDE Configuration Management abstract base class.
Definition: kconfigbase.h:70
KGlobalAccel
KGlobalAccel allows you to have global accelerators that are independent of the focused window...
Definition: kglobalaccel.h:45

KDE Home | KDE Accessibility Home | Description of Access Keys