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

tdecore

  • tdecore
tdeaccelaction.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 _TDEACCELACTION_H
21#define _TDEACCELACTION_H
22
23#include <tqmap.h>
24#include <tqptrvector.h>
25#include <tqstring.h>
26#include <tqvaluevector.h>
27
28#include <tdeshortcut.h>
29
30class TDEAccelBase;
31
32class TQObject;
33class TDEConfig;
34class TDEConfigBase;
35
72class TDECORE_EXPORT TDEAccelAction
73{
74 public:
79 TDEAccelAction();
80
84 TDEAccelAction( const TDEAccelAction& );
85
100 TDEAccelAction( const TQString& sName, const TQString& sLabel, const TQString& sWhatsThis,
101 const TDEShortcut& cutDef3, const TDEShortcut& cutDef4,
102 const TQObject* pObjSlot, const char* psMethodSlot,
103 bool bConfigurable, bool bEnabled );
104 ~TDEAccelAction();
105
109 void clear();
110
126 bool init( const TQString& sName, const TQString& sLabel, const TQString& sWhatsThis,
127 const TDEShortcut& cutDef3, const TDEShortcut& cutDef4,
128 const TQObject* pObjSlot, const char* psMethodSlot,
129 bool bConfigurable, bool bEnabled );
130
134 TDEAccelAction& operator=( const TDEAccelAction& );
135
141 const TQString& name() const { return m_sName; }
142
148 const TQString& label() const { return m_sLabel; }
149
155 const TQString& whatsThis() const { return m_sWhatsThis; }
156
162 const TDEShortcut& shortcut() const { return m_cut; }
163
171 const TDEShortcut& shortcutDefault() const;
172
181 const TDEShortcut& shortcutDefault3() const { return m_cutDefault3; }
182
191 const TDEShortcut& shortcutDefault4() const { return m_cutDefault4; }
192
197 const TQObject* objSlotPtr() const { return m_pObjSlot; }
198
203 const char* methodSlotPtr() const { return m_psMethodSlot; }
204
209 bool isConfigurable() const { return m_bConfigurable; }
210
215 bool isEnabled() const { return m_bEnabled; }
216
221 void setName( const TQString& name );
222
227 void setLabel( const TQString& label );
228
233 void setWhatsThis( const TQString& whatsThis );
234
240 bool setShortcut( const TDEShortcut& rgCuts );
241
247 void setSlot( const TQObject* pObjSlot, const char* psMethodSlot );
248
253 void setConfigurable( bool configurable );
254
259 void setEnabled( bool enable );
260
265 int getID() const { return m_nIDAccel; }
266
274 void setID( int n ) { m_nIDAccel = n; }
275
280 bool isConnected() const;
281
289 bool setKeySequence( uint i, const KKeySequence &keySeq );
290
296 void clearShortcut();
297
304 bool contains( const KKeySequence &keySeq );
305
311 TQString toString() const;
312
316 TQString toStringInternal() const;
317
322 static bool useFourModifierKeys();
323
329 static void useFourModifierKeys( bool use );
330
331 protected:
332 TQString m_sName ,
333 m_sLabel ,
334 m_sWhatsThis ;
335 TDEShortcut m_cut ;
336 TDEShortcut m_cutDefault3 ,
337 m_cutDefault4 ;
338 const TQObject* m_pObjSlot ;
339 const char* m_psMethodSlot ;
340 bool m_bConfigurable ,
341 m_bEnabled ;
342 int m_nIDAccel ;
343 uint m_nConnections ;
344
346 void incConnections();
348 void decConnections();
349
350 private:
351 static int g_bUseFourModifierKeys;
352 class TDEAccelActionPrivate* d;
353
354 friend class TDEAccelActions;
355 friend class TDEAccelBase;
356};
357
358//---------------------------------------------------------------------
359// TDEAccelActions
360//---------------------------------------------------------------------
361
369class TDECORE_EXPORT TDEAccelActions
370{
371 public:
375 TDEAccelActions();
376
380 TDEAccelActions( const TDEAccelActions& );
381 virtual ~TDEAccelActions();
382
386 void clear();
387
394 bool init( const TDEAccelActions &actions );
395
403 bool init( TDEConfigBase& config, const TQString& sGroup );
404
411 void updateShortcuts( TDEAccelActions &shortcuts );
412
418 int actionIndex( const TQString& sAction ) const;
419
427 TDEAccelAction* actionPtr( uint index );
428
436 const TDEAccelAction* actionPtr( uint index ) const;
437
444 TDEAccelAction* actionPtr( const TQString& sAction );
445
452 const TDEAccelAction* actionPtr( const TQString& sAction ) const;
453
460 TDEAccelAction* actionPtr( KKeySequence cut );
461
470 TDEAccelAction& operator []( uint index );
471
480 const TDEAccelAction& operator []( uint index ) const;
481
497 TDEAccelAction* insert( const TQString& sAction, const TQString& sLabel, const TQString& sWhatsThis,
498 const TDEShortcut& rgCutDefaults3, const TDEShortcut& rgCutDefaults4,
499 const TQObject* pObjSlot = 0, const char* psMethodSlot = 0,
500 bool bConfigurable = true, bool bEnabled = true );
501
508 TDEAccelAction* insert( const TQString& sName, const TQString& sLabel );
509
515 bool remove( const TQString& sAction );
516
524 bool readActions( const TQString& sConfigGroup = "Shortcuts", TDEConfigBase* pConfig = 0 );
525
535 bool writeActions( const TQString& sConfigGroup = "Shortcuts", TDEConfigBase* pConfig = 0,
536 bool bWriteAll = false, bool bGlobal = false ) const;
537
541 void emitKeycodeChanged();
542
547 uint count() const;
548
549 protected:
551 TDEAccelBase* m_pTDEAccelBase;
553 TDEAccelAction** m_prgActions;
554 uint m_nSizeAllocated ,
555 m_nSize ;
556
562 void resize( uint new_size );
564 void insertPtr( TDEAccelAction* );
565
566 private:
567 class TDEAccelActionsPrivate* d;
568
569 TDEAccelActions( TDEAccelBase* );
570 void initPrivate( TDEAccelBase* );
571 TDEAccelActions& operator =( TDEAccelActions& );
572
573 friend class TDEAccelBase;
574};
575
576#endif // _TDEACCELACTION_H
KKeySequence
A KKeySequence object holds a sequence of up to 4 keys.
Definition: tdeshortcut.h:289
TDEConfigBase
KDE Configuration Management abstract base class.
Definition: tdeconfigbase.h:71
TDEConfig
Access KDE Configuration entries.
Definition: tdeconfig.h:44
TDEShortcut
The TDEShortcut class is used to represent a keyboard shortcut to an action.
Definition: tdeshortcut.h:544
KStdAction::whatsThis
TDEAction * whatsThis(const TQObject *recvr, const char *slot, TDEActionCollection *parent, const char *name=0)
KStdAction::clear
TDEAction * clear(const TQObject *recvr, const char *slot, TDEActionCollection *parent, const char *name=0)
KStdAction::name
const char * name(StdAction id)
TDEStdAccel::shortcutDefault3
TDEShortcut shortcutDefault3(StdAccel id)
Returns the hardcoded default 3 modifier shortcut for id.
Definition: tdestdaccel.cpp:208
TDEStdAccel::shortcutDefault4
TDEShortcut shortcutDefault4(StdAccel id)
Returns the hardcoded default 4 modifier shortcut for id.
Definition: tdestdaccel.cpp:225
TDEStdAccel::insert
const TDEShortcut & insert()
Toggle insert/overwrite (with visual feedback, e.g.
TDEStdAccel::shortcutDefault
TDEShortcut shortcutDefault(StdAccel id)
Returns the hardcoded default shortcut for id.
Definition: tdestdaccel.cpp:202
TDEStdAccel::label
TQString label(StdAccel id)
Returns a localized label for user-visible display.
Definition: tdestdaccel.cpp:156
TDEStdAccel::shortcut
const TDEShortcut & shortcut(StdAccel id)
Returns the keybinding for accel.
Definition: tdestdaccel.cpp:174

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.