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

tdecore

  • tdecore
kglobalaccel.cpp
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 #include "kglobalaccel.h"
21 #ifdef Q_WS_X11
22 #include "kglobalaccel_x11.h"
23 #elif defined(Q_WS_WIN)
24 #include "kglobalaccel_win.h"
25 #elif defined(Q_WS_MACX)
26 #include "kglobalaccel_mac.h"
27 #else
28 #include "kglobalaccel_emb.h"
29 #endif
30 
31 #include <tqstring.h>
32 #include "tdeaccelbase.h"
33 #include <kdebug.h>
34 #include <tdeshortcut.h>
35 #include <tdelocale.h>
36 
37 //----------------------------------------------------
38 
39 TDEGlobalAccel::TDEGlobalAccel( TQObject* pParent, const char* psName )
40 : TQObject( pParent, psName )
41 {
42  kdDebug(125) << "TDEGlobalAccel(): this = " << this << endl;
43  d = new TDEGlobalAccelPrivate();
44 }
45 
46 TDEGlobalAccel::~TDEGlobalAccel()
47 {
48  kdDebug(125) << "~TDEGlobalAccel(): this = " << this << endl;
49  delete d;
50 }
51 
52 /*
53 void TDEGlobalAccel::clear()
54  { d->clearActions(); }
55 */
56 TDEAccelActions& TDEGlobalAccel::actions()
57  { return d->TDEAccelBase::actions(); }
58 
59 const TDEAccelActions& TDEGlobalAccel::actions() const
60  { return d->TDEAccelBase::actions(); }
61 
62 bool TDEGlobalAccel::isEnabled()
63  { return ((TDEAccelBase*)d)->isEnabled(); }
64 
65 void TDEGlobalAccel::setEnabled( bool bEnabled )
66  { d->setEnabled( bEnabled ); }
67 
68 void TDEGlobalAccel::suspend( bool s )
69  { d->suspend( s ); }
70 
71 void TDEGlobalAccel::blockShortcuts( bool block )
72  { TDEGlobalAccelPrivate::blockShortcuts( block ); }
73 
74 void TDEGlobalAccel::disableBlocking( bool disable )
75  { d->disableBlocking( disable ); }
76 
77 TDEAccelAction* TDEGlobalAccel::insert( const TQString& sAction, const TQString& sDesc, const TQString& sHelp,
78  const TDEShortcut& cutDef3, const TDEShortcut& cutDef4,
79  const TQObject* pObjSlot, const char* psMethodSlot,
80  bool bConfigurable, bool bEnabled )
81 {
82  return d->insert( sAction, sDesc, sHelp,
83  cutDef3, cutDef4,
84  pObjSlot, psMethodSlot,
85  bConfigurable, bEnabled );
86 }
87 
88 TDEAccelAction* TDEGlobalAccel::insert( const TQString& sName, const TQString& sDesc )
89  { return d->insert( sName, sDesc ); }
90 bool TDEGlobalAccel::updateConnections()
91  { return d->updateConnections(); }
92 
93 bool TDEGlobalAccel::remove( const TQString& sAction )
94  { return d->remove( sAction ); }
95 
96 const TDEShortcut& TDEGlobalAccel::shortcut( const TQString& sAction ) const
97 {
98  const TDEAccelAction* pAction = d->TDEAccelBase::actions().actionPtr( sAction );
99  return (pAction) ? pAction->shortcut() : TDEShortcut::null();
100 }
101 
102 bool TDEGlobalAccel::setShortcut( const TQString& sAction, const TDEShortcut& cut )
103  { return d->setShortcut( sAction, cut ); }
104 bool TDEGlobalAccel::setSlot( const TQString& sAction, const TQObject* pObjSlot, const char* psMethodSlot )
105  { return d->setActionSlot( sAction, pObjSlot, psMethodSlot ); }
106 TQString TDEGlobalAccel::label( const TQString& sAction ) const
107 {
108  const TDEAccelAction* pAction = d->TDEAccelBase::actions().actionPtr( sAction );
109  return (pAction) ? pAction->label() : TQString();
110 }
111 bool TDEGlobalAccel::setActionEnabled( const TQString& sAction, bool bEnable )
112 {
113  return d->setActionEnabled( sAction, bEnable );
114 }
115 
116 const TQString& TDEGlobalAccel::configGroup() const
117  { return d->configGroup(); }
118 // for tdemultimedia/kmix
119 void TDEGlobalAccel::setConfigGroup( const TQString& s )
120  { d->setConfigGroup( s ); }
121 
122 bool TDEGlobalAccel::readSettings( TDEConfigBase* pConfig )
123  { d->readSettings( pConfig ); return true; }
124 bool TDEGlobalAccel::writeSettings( TDEConfigBase* pConfig ) const
125  { d->writeSettings( pConfig ); return true; }
126 bool TDEGlobalAccel::writeSettings( TDEConfigBase* pConfig, bool bGlobal ) const
127 {
128  d->setConfigGlobal( bGlobal );
129  d->writeSettings( pConfig );
130  return true;
131 }
132 
133 bool TDEGlobalAccel::useFourModifierKeys()
134  { return TDEAccelAction::useFourModifierKeys(); }
135 
136 void TDEGlobalAccel::virtual_hook( int, void* )
137 { /*BASE::virtual_hook( id, data );*/ }
138 
139 #include "kglobalaccel.moc"
TDEGlobalAccel::isEnabled
bool isEnabled()
Checks whether the accelerators are enabled.
Definition: kglobalaccel.cpp:62
TDEGlobalAccel::setConfigGroup
void setConfigGroup(const TQString &cg)
Sets the configuration group that is used to save the accelerators.
Definition: kglobalaccel.cpp:119
TDEGlobalAccel::setSlot
bool setSlot(const TQString &sAction, const TQObject *pObjSlot, const char *psMethodSlot)
Set the slot to be called when the shortcut of the action named by sAction is pressed.
Definition: kglobalaccel.cpp:104
TDEGlobalAccel::setActionEnabled
bool setActionEnabled(const TQString &sAction, bool bEnable)
Enables or disables action sAction.
Definition: kglobalaccel.cpp:111
TDEGlobalAccel::setShortcut
bool setShortcut(const TQString &sAction, const TDEShortcut &shortcut)
Set the shortcut to be associated with the action named by sAction.
Definition: kglobalaccel.cpp:102
TDEGlobalAccel::readSettings
bool readSettings(TDEConfigBase *pConfig=0)
Read all shortcuts from pConfig, or (if pConfig is zero) from the application's configuration file TD...
Definition: kglobalaccel.cpp:122
TDEConfigBase
KDE Configuration Management abstract base class.
Definition: tdeconfigbase.h:70
tdelocale.h
TDEGlobalAccel::insert
TDEAccelAction * insert(const TQString &sAction, const TQString &sLabel, const TQString &sWhatsThis, const TDEShortcut &cutDef3, const TDEShortcut &cutDef4, const TQObject *pObjSlot, const char *psMethodSlot, bool bConfigurable=true, bool bEnabled=true)
Create an accelerator action.
Definition: kglobalaccel.cpp:77
TDEGlobalAccel::writeSettings
bool writeSettings(TDEConfigBase *pConfig=0) const
Write the current shortcuts to pConfig, or (if pConfig is zero) to the application's configuration fi...
Definition: kglobalaccel.cpp:124
TDEGlobalAccel::label
TQString label(const TQString &sAction) const
Return the label (i18n'ized short description) associated with the action named by sAction...
Definition: kglobalaccel.cpp:106
TDEGlobalAccel::shortcut
const TDEShortcut & shortcut(const TQString &sAction) const
Return the shortcut associated with the action named by sAction.
Definition: kglobalaccel.cpp:96
TDEShortcut
The TDEShortcut class is used to represent a keyboard shortcut to an action.
Definition: tdeshortcut.h:543
TDEShortcut::null
static TDEShortcut & null()
Returns a null shortcut.
Definition: tdeshortcut.cpp:667
TDEGlobalAccel::remove
bool remove(const TQString &sAction)
Removes the accelerator action identified by the name.
Definition: kglobalaccel.cpp:93
TDEGlobalAccel::configGroup
const TQString & configGroup() const
Returns the configuration group that is used to save the accelerators.
Definition: kglobalaccel.cpp:116
TDEGlobalAccel::updateConnections
bool updateConnections()
Updates the connections of the accelerations after changing them.
Definition: kglobalaccel.cpp:90
endl
kndbgstream & endl(kndbgstream &s)
Does nothing.
Definition: kdebug.h:583
TDEGlobalAccel::setEnabled
void setEnabled(bool bEnabled)
Enables or disables the TDEGlobalAccel.
Definition: kglobalaccel.cpp:65
TDEGlobalAccel::TDEGlobalAccel
TDEGlobalAccel(TQObject *pParent, const char *psName=0)
Creates a new TDEGlobalAccel object with the given pParent and psName.
Definition: kglobalaccel.cpp:39

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.8.8
This website is maintained by Timothy Pearson.