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

kdecore

  • kdecore
kaccel.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001,2002 Ellis Whitehead <ellis@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef _KACCEL_H
21 #define _KACCEL_H
22 
23 #include <tqaccel.h>
24 #include <kshortcut.h>
25 #include <kstdaccel.h>
26 #include "kdelibs_export.h"
27 
28 class TQPopupMenu; // for obsolete insertItem() methods below
29 class TQWidget;
30 class KAccelAction;
31 class KAccelActions;
32 class KConfigBase;
33 
34 class KAccelPrivate;
93 class KDECORE_EXPORT KAccel : public TQAccel
94 {
95  Q_OBJECT
96  public:
104  KAccel( TQWidget* pParent, const char* psName = 0 );
105 
113  KAccel( TQWidget* watch, TQObject* parent, const char* psName = 0 );
114  virtual ~KAccel();
115 
121  KAccelActions& actions();
122 
128  const KAccelActions& actions() const;
129 
134  bool isEnabled();
135 
140  void setEnabled( bool bEnabled );
141 
152  bool setAutoUpdate( bool bAuto );
153 
175  KAccelAction* insert( const TQString& sAction, const TQString& sLabel, const TQString& sWhatsThis,
176  const KShortcut& cutDef,
177  const TQObject* pObjSlot, const char* psMethodSlot,
178  bool bConfigurable = true, bool bEnabled = true );
183  KAccelAction* insert( const TQString& sAction, const TQString& sLabel, const TQString& sWhatsThis,
184  const KShortcut& cutDef3, const KShortcut& cutDef4,
185  const TQObject* pObjSlot, const char* psMethodSlot,
186  bool bConfigurable = true, bool bEnabled = true );
204  KAccelAction* insert( const char* psAction, const KShortcut& cutDef,
205  const TQObject* pObjSlot, const char* psMethodSlot,
206  bool bConfigurable = true, bool bEnabled = true );
213  KAccelAction* insert( KStdAccel::StdAccel id,
214  const TQObject* pObjSlot, const char* psMethodSlot,
215  bool bConfigurable = true, bool bEnabled = true );
216 
223  bool remove( const TQString& sAction );
224 
233  bool updateConnections();
234 
240  const KShortcut& shortcut( const TQString& sAction ) const;
241 
248  bool setShortcut( const TQString& sAction, const KShortcut &shortcut );
249 
258  bool setSlot( const TQString& sAction, const TQObject* pObjSlot, const char* psMethodSlot );
265  bool setEnabled( const TQString& sAction, bool bEnabled );
266 
272  const TQString& configGroup() const;
273 
279  void setConfigGroup( const TQString &name );
280 
292  bool readSettings( KConfigBase* pConfig = 0 );
301  bool writeSettings( KConfigBase* pConfig = 0 ) const;
302 
306  void emitKeycodeChanged();
307 
308  signals:
312  void keycodeChanged();
313 
314 #ifndef KDE_NO_COMPAT
315  public:
316  // Source compatibility to KDE 2.x
320  bool insertItem( const TQString& sLabel, const TQString& sAction,
321  const char* psKey,
322  int nIDMenu = 0, TQPopupMenu* pMenu = 0, bool bConfigurable = true ) KDE_DEPRECATED;
326  bool insertItem( const TQString& sLabel, const TQString& sAction,
327  int key,
328  int nIDMenu = 0, TQPopupMenu* pMenu = 0, bool bConfigurable = true ) KDE_DEPRECATED;
332  bool insertStdItem( KStdAccel::StdAccel id, const TQString& descr = TQString::null ) KDE_DEPRECATED;
336  bool connectItem( const TQString& sAction, const TQObject* pObjSlot, const char* psMethodSlot, bool bActivate = true ) KDE_DEPRECATED;
341  KDE_DEPRECATED bool connectItem( KStdAccel::StdAccel accel, const TQObject* pObjSlot, const char* psMethodSlot )
342  { return insert( accel, pObjSlot, psMethodSlot ); }
346  bool removeItem( const TQString& sAction ) KDE_DEPRECATED;
350  bool setItemEnabled( const TQString& sAction, bool bEnable ) KDE_DEPRECATED;
354  void changeMenuAccel( TQPopupMenu *menu, int id, const TQString& action ) KDE_DEPRECATED;
358  void changeMenuAccel( TQPopupMenu *menu, int id, KStdAccel::StdAccel accel ) KDE_DEPRECATED;
362  static int stringToKey( const TQString& ) KDE_DEPRECATED;
363 
371  int currentKey( const TQString& action ) const KDE_DEPRECATED;
372 
379  TQString findKey( int key ) const KDE_DEPRECATED;
380 #endif // !KDE_NO_COMPAT
381 
382  protected:
384  virtual void virtual_hook( int id, void* data );
385  private:
386  class KAccelPrivate* d;
387  friend class KAccelPrivate;
388 };
389 
390 #endif // _KACCEL_H
KAccel
Handle shortcuts.
Definition: kaccel.h:93
KAccel::connectItem
KDE_DEPRECATED bool connectItem(KStdAccel::StdAccel accel, const TQObject *pObjSlot, const char *psMethodSlot)
Definition: kaccel.h:341
KShortcut
The KShortcut class is used to represent a keyboard shortcut to an action.
Definition: kshortcut.h:543
KConfigBase
KDE Configuration Management abstract base class.
Definition: kconfigbase.h:70
KStdAccel::StdAccel
StdAccel
Defines the identifier of all standard accelerators.
Definition: kstdaccel.h:47

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.8.13
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |