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

tdecore

  • tdecore
tdeglobalaccel.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 "tdeglobalaccel.h"
21#ifdef TQ_WS_X11
22#include "tdeglobalaccel_x11.h"
23#elif defined(TQ_WS_WIN)
24#include "tdeglobalaccel_win.h"
25#elif defined(TQ_WS_MACX)
26#include "tdeglobalaccel_mac.h"
27#else
28#include "tdeglobalaccel_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
39TDEGlobalAccel::TDEGlobalAccel( TQObject* pParent, const char* psName )
40: TQObject( pParent, psName )
41{
42 kdDebug(125) << "TDEGlobalAccel(): this = " << this << endl;
43 d = new TDEGlobalAccelPrivate();
44}
45
46TDEGlobalAccel::~TDEGlobalAccel()
47{
48 kdDebug(125) << "~TDEGlobalAccel(): this = " << this << endl;
49 delete d;
50}
51
52/*
53void TDEGlobalAccel::clear()
54 { d->clearActions(); }
55*/
56TDEAccelActions& TDEGlobalAccel::actions()
57 { return d->TDEAccelBase::actions(); }
58
59const TDEAccelActions& TDEGlobalAccel::actions() const
60 { return d->TDEAccelBase::actions(); }
61
62bool TDEGlobalAccel::isEnabled()
63 { return ((TDEAccelBase*)d)->isEnabled(); }
64
65void TDEGlobalAccel::setEnabled( bool bEnabled )
66 { d->setEnabled( bEnabled ); }
67
68void TDEGlobalAccel::suspend( bool s )
69 { d->suspend( s ); }
70
71void TDEGlobalAccel::blockShortcuts( bool block )
72 { TDEGlobalAccelPrivate::blockShortcuts( block ); }
73
74void TDEGlobalAccel::disableBlocking( bool disable )
75 { d->disableBlocking( disable ); }
76
77TDEAccelAction* 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
88TDEAccelAction* TDEGlobalAccel::insert( const TQString& sName, const TQString& sDesc )
89 { return d->insert( sName, sDesc ); }
90bool TDEGlobalAccel::updateConnections()
91 { return d->updateConnections(); }
92
93bool TDEGlobalAccel::remove( const TQString& sAction )
94 { return d->remove( sAction ); }
95
96const 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
102bool TDEGlobalAccel::setShortcut( const TQString& sAction, const TDEShortcut& cut )
103 { return d->setShortcut( sAction, cut ); }
104bool TDEGlobalAccel::setSlot( const TQString& sAction, const TQObject* pObjSlot, const char* psMethodSlot )
105 { return d->setActionSlot( sAction, pObjSlot, psMethodSlot ); }
106TQString TDEGlobalAccel::label( const TQString& sAction ) const
107{
108 const TDEAccelAction* pAction = d->TDEAccelBase::actions().actionPtr( sAction );
109 return (pAction) ? pAction->label() : TQString();
110}
111bool TDEGlobalAccel::setActionEnabled( const TQString& sAction, bool bEnable )
112{
113 return d->setActionEnabled( sAction, bEnable );
114}
115
116const TQString& TDEGlobalAccel::configGroup() const
117 { return d->configGroup(); }
118// for tdemultimedia/kmix
119void TDEGlobalAccel::setConfigGroup( const TQString& s )
120 { d->setConfigGroup( s ); }
121
122bool TDEGlobalAccel::readSettings( TDEConfigBase* pConfig )
123 { d->readSettings( pConfig ); return true; }
124bool TDEGlobalAccel::writeSettings( TDEConfigBase* pConfig ) const
125 { d->writeSettings( pConfig ); return true; }
126bool TDEGlobalAccel::writeSettings( TDEConfigBase* pConfig, bool bGlobal ) const
127{
128 d->setConfigGlobal( bGlobal );
129 d->writeSettings( pConfig );
130 return true;
131}
132
133bool TDEGlobalAccel::useFourModifierKeys()
134 { return TDEAccelAction::useFourModifierKeys(); }
135
136void TDEGlobalAccel::virtual_hook( int, void* )
137{ /*BASE::virtual_hook( id, data );*/ }
138
139#include "tdeglobalaccel.moc"
TDEConfigBase
KDE Configuration Management abstract base class.
Definition: tdeconfigbase.h:71
TDEGlobalAccel::setConfigGroup
void setConfigGroup(const TQString &cg)
Sets the configuration group that is used to save the accelerators.
Definition: tdeglobalaccel.cpp:119
TDEGlobalAccel::isEnabled
bool isEnabled()
Checks whether the accelerators are enabled.
Definition: tdeglobalaccel.cpp:62
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: tdeglobalaccel.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: tdeglobalaccel.cpp:106
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: tdeglobalaccel.cpp:77
TDEGlobalAccel::updateConnections
bool updateConnections()
Updates the connections of the accelerations after changing them.
Definition: tdeglobalaccel.cpp:90
TDEGlobalAccel::setEnabled
void setEnabled(bool bEnabled)
Enables or disables the TDEGlobalAccel.
Definition: tdeglobalaccel.cpp:65
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: tdeglobalaccel.cpp:122
TDEGlobalAccel::setActionEnabled
bool setActionEnabled(const TQString &sAction, bool bEnable)
Enables or disables action sAction.
Definition: tdeglobalaccel.cpp:111
TDEGlobalAccel::TDEGlobalAccel
TDEGlobalAccel(TQObject *pParent, const char *psName=0)
Creates a new TDEGlobalAccel object with the given pParent and psName.
Definition: tdeglobalaccel.cpp:39
TDEGlobalAccel::setShortcut
bool setShortcut(const TQString &sAction, const TDEShortcut &shortcut)
Set the shortcut to be associated with the action named by sAction.
Definition: tdeglobalaccel.cpp:102
TDEGlobalAccel::shortcut
const TDEShortcut & shortcut(const TQString &sAction) const
Return the shortcut associated with the action named by sAction.
Definition: tdeglobalaccel.cpp:96
TDEGlobalAccel::remove
bool remove(const TQString &sAction)
Removes the accelerator action identified by the name.
Definition: tdeglobalaccel.cpp:93
TDEGlobalAccel::configGroup
const TQString & configGroup() const
Returns the configuration group that is used to save the accelerators.
Definition: tdeglobalaccel.cpp:116
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: tdeglobalaccel.cpp:104
TDEShortcut
The TDEShortcut class is used to represent a keyboard shortcut to an action.
Definition: tdeshortcut.h:544
TDEShortcut::null
static TDEShortcut & null()
Returns a null shortcut.
Definition: tdeshortcut.cpp:667
endl
kndbgstream & endl(kndbgstream &s)
Does nothing.
Definition: kdebug.h:583
tdelocale.h

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.