• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

kaccel.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., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef _KACCEL_H
00021 #define _KACCEL_H
00022 
00023 #include <tqaccel.h>
00024 #include <kshortcut.h>
00025 #include <kstdaccel.h>
00026 #include "kdelibs_export.h"
00027 
00028 class TQPopupMenu; // for obsolete insertItem() methods below
00029 class TQWidget;
00030 class KAccelAction;
00031 class KAccelActions;
00032 class KConfigBase;
00033 
00034 class KAccelPrivate;
00093 class KDECORE_EXPORT KAccel : public TQAccel
00094 {
00095     Q_OBJECT
00096  public:
00104     KAccel( TQWidget* pParent, const char* psName = 0 );
00105 
00113     KAccel( TQWidget* watch, TQObject* parent, const char* psName = 0 );
00114     virtual ~KAccel();
00115 
00121     KAccelActions& actions();
00122 
00128     const KAccelActions& actions() const;
00129 
00134     bool isEnabled();
00135 
00140     void setEnabled( bool bEnabled );
00141 
00152     bool setAutoUpdate( bool bAuto );
00153 
00175     KAccelAction* insert( const TQString& sAction, const TQString& sLabel, const TQString& sWhatsThis,
00176                      const KShortcut& cutDef,
00177                      const TQObject* pObjSlot, const char* psMethodSlot,
00178                      bool bConfigurable = true, bool bEnabled = true );
00183     KAccelAction* insert( const TQString& sAction, const TQString& sLabel, const TQString& sWhatsThis,
00184                      const KShortcut& cutDef3, const KShortcut& cutDef4,
00185                      const TQObject* pObjSlot, const char* psMethodSlot,
00186                      bool bConfigurable = true, bool bEnabled = true );
00204     KAccelAction* insert( const char* psAction, const KShortcut& cutDef,
00205                      const TQObject* pObjSlot, const char* psMethodSlot,
00206                      bool bConfigurable = true, bool bEnabled = true );
00213     KAccelAction* insert( KStdAccel::StdAccel id,
00214                      const TQObject* pObjSlot, const char* psMethodSlot,
00215                      bool bConfigurable = true, bool bEnabled = true );
00216 
00223     bool remove( const TQString& sAction );
00224 
00233     bool updateConnections();
00234 
00240     const KShortcut& shortcut( const TQString& sAction ) const;
00241 
00248     bool setShortcut( const TQString& sAction, const KShortcut &shortcut );
00249 
00258     bool setSlot( const TQString& sAction, const TQObject* pObjSlot, const char* psMethodSlot );
00265     bool setEnabled( const TQString& sAction, bool bEnabled );
00266 
00272     const TQString& configGroup() const;
00273 
00279     void setConfigGroup( const TQString &name );
00280 
00292     bool readSettings( KConfigBase* pConfig = 0 );
00301     bool writeSettings( KConfigBase* pConfig = 0 ) const;
00302 
00306     void emitKeycodeChanged();
00307 
00308  signals:
00312     void keycodeChanged();
00313 
00314 #ifndef KDE_NO_COMPAT
00315  public:
00316     // Source compatibility to KDE 2.x
00320     bool insertItem( const TQString& sLabel, const TQString& sAction,
00321                      const char* psKey,
00322                      int nIDMenu = 0, TQPopupMenu* pMenu = 0, bool bConfigurable = true ) KDE_DEPRECATED;
00326     bool insertItem( const TQString& sLabel, const TQString& sAction,
00327                      int key,
00328                      int nIDMenu = 0, TQPopupMenu* pMenu = 0, bool bConfigurable = true ) KDE_DEPRECATED;
00332     bool insertStdItem( KStdAccel::StdAccel id, const TQString& descr = TQString::null ) KDE_DEPRECATED;
00336     bool connectItem( const TQString& sAction, const TQObject* pObjSlot, const char* psMethodSlot, bool bActivate = true ) KDE_DEPRECATED;
00341     KDE_DEPRECATED bool connectItem( KStdAccel::StdAccel accel, const TQObject* pObjSlot, const char* psMethodSlot )
00342         { return insert( accel, pObjSlot, psMethodSlot ); }
00346     bool removeItem( const TQString& sAction ) KDE_DEPRECATED;
00350     bool setItemEnabled( const TQString& sAction, bool bEnable ) KDE_DEPRECATED;
00354     void changeMenuAccel( TQPopupMenu *menu, int id, const TQString& action ) KDE_DEPRECATED;
00358     void changeMenuAccel( TQPopupMenu *menu, int id, KStdAccel::StdAccel accel ) KDE_DEPRECATED;
00362     static int stringToKey( const TQString& ) KDE_DEPRECATED;
00363 
00371     int currentKey( const TQString& action ) const KDE_DEPRECATED;
00372 
00379     TQString findKey( int key ) const KDE_DEPRECATED;
00380 #endif // !KDE_NO_COMPAT
00381 
00382  protected:
00384     virtual void virtual_hook( int id, void* data );
00385  private:
00386     class KAccelPrivate* d;
00387     friend class KAccelPrivate;
00388 };
00389 
00390 #endif // _KACCEL_H

kdecore

Skip menu "kdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |