kdecore Library API Documentation

kglobalaccel.h

00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2001,2002 Ellis Whitehead <ellis@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 Boston, MA 02111-1307, USA. 00018 */ 00019 00020 #ifndef _KGLOBALACCEL_H_ 00021 #define _KGLOBALACCEL_H_ 00022 00023 #include <qobject.h> 00024 #include <kshortcut.h> 00025 00026 class QPopupMenu; 00027 class QWidget; 00028 class KAccelAction; 00029 class KAccelActions; 00030 class KConfigBase; 00031 00032 class KGlobalAccelPrivate; 00033 00045 class KGlobalAccel : public QObject 00046 { 00047 Q_OBJECT 00048 public: 00055 KGlobalAccel( QObject* pParent, const char* psName = 0 ); 00056 virtual ~KGlobalAccel(); 00057 00062 bool isEnabled(); 00063 00068 void setEnabled( bool bEnabled ); 00069 00092 KAccelAction* insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis, 00093 const KShortcut& cutDef3, const KShortcut& cutDef4, 00094 const QObject* pObjSlot, const char* psMethodSlot, 00095 bool bConfigurable = true, bool bEnabled = true ); 00096 00103 bool remove( const QString& sAction ); 00104 00112 KAccelAction* insert( const QString& sName, const QString& sLabel ); 00113 00118 bool updateConnections(); 00119 00125 const KShortcut& shortcut( const QString& sAction ) const; 00132 bool setShortcut( const QString& sAction, const KShortcut &shortcut ); 00141 bool setSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot ); 00142 00148 const QString& configGroup() const; 00149 00155 void setConfigGroup( const QString &cg ); 00156 00165 bool readSettings( KConfigBase* pConfig = 0 ); 00166 00176 bool writeSettings( KConfigBase* pConfig = 0 ) const; 00177 // BCI: merge these two writeSettings methods in KDE 4.0 00188 bool writeSettings( KConfigBase* pConfig, bool bGlobal ) const; 00189 00194 static bool useFourModifierKeys(); 00195 00196 private: 00197 00198 KAccelActions& actions(); 00199 const KAccelActions& actions() const; 00200 00201 friend class KGlobalAccelPrivate; 00202 friend class KAccelShortcutList; 00203 protected: 00205 virtual void virtual_hook( int id, void* data ); 00206 private: 00207 class KGlobalAccelPrivate* d; 00208 }; 00209 00210 #endif // _KGLOBALACCEL_H_
KDE Logo
This file is part of the documentation for kdecore Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 12 15:07:58 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003