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

tdecore

  • tdecore
tdeshortcutlist.h
1/* This file is part of the KDE libraries
2 Copyright (C) 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 __TDESHORTCUTLIST_H
21#define __TDESHORTCUTLIST_H
22
23#include <tqglobal.h> // For uint
24#include <tqstring.h>
25#include "tdelibs_export.h"
26
27class TQVariant;
28class TDEConfigBase;
29class TDEInstance;
30class KKeySequence;
31class TDEShortcut;
32
33/**********************************************************************
34* This is a wrapper class which allows a function to use one interface
35* to TDEActionCollection, TDEAccelActions, and TDEActionPtrList.
36**********************************************************************/
37
48class TDECORE_EXPORT TDEShortcutList
49{
50 public:
54 TDEShortcutList();
55 virtual ~TDEShortcutList();
56
61 virtual uint count() const = 0;
62
68 virtual TQString name( uint index ) const = 0;
69
75 virtual TQString label( uint index ) const = 0;
76
82 virtual TQString whatsThis( uint index ) const = 0;
83
84 // TODO KDE4: add virtual TQString toolTip( uint index ) const = 0
85 // Will then be used by the listview in kkeydialog
86
93 virtual const TDEShortcut& shortcut( uint index ) const = 0;
94
101 virtual const TDEShortcut& shortcutDefault( uint index ) const = 0;
102
108 virtual bool isConfigurable( uint index ) const = 0;
109
115 virtual bool setShortcut( uint index, const TDEShortcut &shortcut ) = 0;
116
123 virtual bool isGlobal( uint index ) const;
124
130 virtual int index( const TQString& sName ) const;
131
137 virtual int index( const KKeySequence& keySeq ) const;
138
143 virtual const TDEInstance* instance() const;
144
145 // These are here in order to handle expansion.
146 enum Other { };
148 virtual TQVariant getOther( Other, uint index ) const = 0;
150 virtual bool setOther( Other, uint index, TQVariant ) = 0;
151
156 virtual bool save() const = 0;
157
165 virtual bool readSettings( const TQString& sConfigGroup = TQString::null, TDEConfigBase* pConfig = 0 );
166
176 virtual bool writeSettings( const TQString& sConfigGroup = TQString::null, TDEConfigBase* pConfig = 0,
177 bool bWriteAll = false, bool bGlobal = false ) const;
178
179 protected:
181 virtual void virtual_hook( int id, void* data );
182 private:
183 class TDEShortcutListPrivate* d;
184};
185
186//---------------------------------------------------------------------
187// TDEAccelShortcutList
188//---------------------------------------------------------------------
189
190class TDEAccel;
191class TDEAccelActions;
192class TDEGlobalAccel;
193
198class TDECORE_EXPORT TDEAccelShortcutList : public TDEShortcutList
199{
200 public:
205 TDEAccelShortcutList( TDEAccel* accel );
206
212 TDEAccelShortcutList( TDEGlobalAccel* accel );
213
222 TDEAccelShortcutList( TDEAccelActions &actions, bool bGlobal );
223 virtual ~TDEAccelShortcutList();
224
225 virtual uint count() const;
226 virtual TQString name( uint index ) const;
227 virtual TQString label( uint index ) const;
228 virtual TQString whatsThis( uint index ) const;
229 virtual const TDEShortcut& shortcut( uint index ) const;
230 virtual const TDEShortcut& shortcutDefault( uint index ) const;
231 virtual bool isConfigurable( uint index ) const;
232 virtual bool setShortcut( uint index , const TDEShortcut& shortcut );
233 virtual bool isGlobal( uint index ) const;
234
236 virtual TQVariant getOther( Other, uint index ) const;
238 virtual bool setOther( Other, uint index, TQVariant );
239
240 virtual bool save() const;
241
242 protected:
244 TDEAccelActions& m_actions;
246 bool m_bGlobal;
247
248 protected:
249 virtual void virtual_hook( int id, void* data );
250 private:
251 class TDEAccelShortcutListPrivate* d;
252};
253
254namespace TDEStdAccel {
255//---------------------------------------------------------------------
256// ShortcutList
257//---------------------------------------------------------------------
258
263class TDECORE_EXPORT ShortcutList : public TDEShortcutList
264{
265 public:
269 ShortcutList();
270 virtual ~ShortcutList();
271
272 virtual uint count() const;
273 virtual TQString name( uint index ) const;
274 virtual TQString label( uint index ) const;
275 virtual TQString whatsThis( uint index ) const;
276 virtual const TDEShortcut& shortcut( uint index ) const;
277 virtual const TDEShortcut& shortcutDefault( uint index ) const;
278 virtual bool isConfigurable( uint index ) const;
279 virtual bool setShortcut( uint index , const TDEShortcut& shortcut );
280
282 virtual TQVariant getOther( Other, uint index ) const;
284 virtual bool setOther( Other, uint index, TQVariant );
285
286 virtual bool save() const;
287
288 protected:
289 virtual void virtual_hook( int id, void* data );
290 private:
291 class ShortcutListPrivate* d;
292};
293}
294
295#endif // __TDESHORTCUTLIST_H
KKeySequence
A KKeySequence object holds a sequence of up to 4 keys.
Definition: tdeshortcut.h:289
TDEAccelShortcutList
TDEShortcutList implementation to access TDEAccel and TDEGlobalAccel lists.
Definition: tdeshortcutlist.h:199
TDEAccelShortcutList::m_actions
TDEAccelActions & m_actions
Actions (collection) for this shortcut list.
Definition: tdeshortcutlist.h:244
TDEAccelShortcutList::m_bGlobal
bool m_bGlobal
Is this shortcut list global? Access through isGlobal()
Definition: tdeshortcutlist.h:246
TDEAccel
Handle shortcuts.
Definition: tdeaccel.h:94
TDEConfigBase
KDE Configuration Management abstract base class.
Definition: tdeconfigbase.h:71
TDEGlobalAccel
TDEGlobalAccel allows you to have global accelerators that are independent of the focused window.
Definition: tdeglobalaccel.h:46
TDEInstance
Access to KDE global objects for use in shared libraries.
Definition: kinstance.h:48
TDEShortcutList
TDEShortcutList is an abstract base class for TDEAccelShortcutList and TDEStdAccel::ShortcutList.
Definition: tdeshortcutlist.h:49
TDEShortcutList::count
virtual uint count() const =0
Returns the number of entries.
TDEShortcutList::shortcutDefault
virtual const TDEShortcut & shortcutDefault(uint index) const =0
Returns default shortcut with the given index.
TDEShortcutList::shortcut
virtual const TDEShortcut & shortcut(uint index) const =0
Returns the shortcut with the given index.
TDEShortcutList::name
virtual TQString name(uint index) const =0
Returns the name of the shortcut with the given index.
TDEShortcutList::label
virtual TQString label(uint index) const =0
Returns the (i18n'd) label of the shortcut with the given index.
TDEShortcutList::setShortcut
virtual bool setShortcut(uint index, const TDEShortcut &shortcut)=0
Sets the shortcut of the given entry.
TDEShortcutList::isConfigurable
virtual bool isConfigurable(uint index) const =0
Checks whether the shortcut with the given index is configurable.
TDEShortcutList::save
virtual bool save() const =0
Save the shortcut list.
TDEShortcutList::whatsThis
virtual TQString whatsThis(uint index) const =0
Returns the (i18n'd) What's This text of the shortcut with the given index.
TDEShortcut
The TDEShortcut class is used to represent a keyboard shortcut to an action.
Definition: tdeshortcut.h:544
TDEStdAccel::ShortcutList
TDEShortcutList implementation that accesses TDEStdAccel actions.
Definition: tdeshortcutlist.h:264
TDEStdAccel
Convenient methods for access to the common accelerator keys in the key configuration.
Definition: tdeshortcutlist.h:254
TDEStdAccel::name
TQString name(StdAccel id)
Returns a unique name for the given accel.
Definition: tdestdaccel.cpp:148
TDEStdAccel::shortcutDefault
TDEShortcut shortcutDefault(StdAccel id)
Returns the hardcoded default shortcut for id.
Definition: tdestdaccel.cpp:202
TDEStdAccel::save
const TDEShortcut & save()
Save current document.
Definition: tdestdaccel.cpp:273
TDEStdAccel::whatsThis
TQString whatsThis(StdAccel)
Returns an extended WhatsThis description for the given accelerator.
Definition: tdestdaccel.cpp:165
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.