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

tdecore

tdeshortcutlist.h

00001 /*  This file is part of the KDE libraries
00002     Copyright (C) 2002 Ellis Whitehead <ellis@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef __TDESHORTCUTLIST_H
00021 #define __TDESHORTCUTLIST_H
00022 
00023 #include <tqglobal.h>   // For uint
00024 #include <tqstring.h>
00025 #include "tdelibs_export.h"
00026 
00027 class TQVariant;
00028 class TDEConfigBase;
00029 class TDEInstance;
00030 class KKeySequence;
00031 class TDEShortcut;
00032 
00033 /**********************************************************************
00034 * This is a wrapper class which allows a function to use one interface
00035 * to TDEActionCollection, TDEAccelActions, and TDEActionPtrList.
00036 **********************************************************************/
00037 
00048 class TDECORE_EXPORT TDEShortcutList
00049 {
00050  public:
00054     TDEShortcutList();
00055     virtual ~TDEShortcutList();
00056 
00061     virtual uint count() const = 0;
00062 
00068     virtual TQString name( uint index ) const = 0;
00069 
00075     virtual TQString label( uint index ) const = 0;
00076 
00082     virtual TQString whatsThis( uint index ) const = 0;
00083 
00084     // TODO KDE4: add virtual TQString toolTip( uint index ) const = 0
00085     // Will then be used by the listview in kkeydialog
00086 
00093     virtual const TDEShortcut& shortcut( uint index ) const = 0;
00094 
00101     virtual const TDEShortcut& shortcutDefault( uint index ) const = 0;
00102 
00108     virtual bool isConfigurable( uint index ) const = 0;
00109 
00115     virtual bool setShortcut( uint index, const TDEShortcut &shortcut ) = 0;
00116 
00123     virtual bool isGlobal( uint index ) const;
00124 
00130     virtual int index( const TQString& sName ) const;
00131 
00137     virtual int index( const KKeySequence& keySeq ) const;
00138 
00143     virtual const TDEInstance* instance() const;
00144 
00145     // These are here in order to handle expansion.
00146     enum Other { };
00148     virtual TQVariant getOther( Other, uint index ) const = 0;
00150     virtual bool setOther( Other, uint index, TQVariant ) = 0;
00151 
00156     virtual bool save() const = 0;
00157 
00165     virtual bool readSettings( const TQString& sConfigGroup = TQString::null, TDEConfigBase* pConfig = 0 );
00166 
00176     virtual bool writeSettings( const TQString& sConfigGroup = TQString::null, TDEConfigBase* pConfig = 0,
00177             bool bWriteAll = false, bool bGlobal = false ) const;
00178 
00179  protected:
00181         virtual void virtual_hook( int id, void* data );
00182  private:
00183     class TDEShortcutListPrivate* d;
00184 };
00185 
00186 //---------------------------------------------------------------------
00187 // TDEAccelShortcutList
00188 //---------------------------------------------------------------------
00189 
00190 class TDEAccel;
00191 class TDEAccelActions;
00192 class TDEGlobalAccel;
00193 
00198 class TDECORE_EXPORT TDEAccelShortcutList : public TDEShortcutList
00199 {
00200  public:
00205     TDEAccelShortcutList( TDEAccel* accel );
00206 
00212     TDEAccelShortcutList( TDEGlobalAccel* accel );
00213 
00222     TDEAccelShortcutList( TDEAccelActions &actions, bool bGlobal );
00223     virtual ~TDEAccelShortcutList();
00224 
00225     virtual uint count() const;
00226     virtual TQString name( uint index ) const;
00227     virtual TQString label( uint index ) const;
00228     virtual TQString whatsThis( uint index ) const;
00229     virtual const TDEShortcut& shortcut( uint index ) const;
00230     virtual const TDEShortcut& shortcutDefault( uint index ) const;
00231     virtual bool isConfigurable( uint index ) const;
00232     virtual bool setShortcut( uint index , const TDEShortcut& shortcut );
00233     virtual bool isGlobal( uint index ) const;
00234 
00236     virtual TQVariant getOther( Other, uint index ) const;
00238     virtual bool setOther( Other, uint index, TQVariant );
00239 
00240     virtual bool save() const;
00241 
00242  protected:
00244     TDEAccelActions& m_actions;
00246     bool m_bGlobal;
00247 
00248  protected:
00249     virtual void virtual_hook( int id, void* data );
00250  private:
00251     class TDEAccelShortcutListPrivate* d;
00252 };
00253 
00254 namespace TDEStdAccel {
00255 //---------------------------------------------------------------------
00256 // ShortcutList
00257 //---------------------------------------------------------------------
00258 
00263 class TDECORE_EXPORT ShortcutList : public TDEShortcutList
00264 {
00265  public:
00269     ShortcutList();
00270     virtual ~ShortcutList();
00271 
00272     virtual uint count() const;
00273     virtual TQString name( uint index ) const;
00274     virtual TQString label( uint index ) const;
00275     virtual TQString whatsThis( uint index ) const;
00276     virtual const TDEShortcut& shortcut( uint index ) const;
00277     virtual const TDEShortcut& shortcutDefault( uint index ) const;
00278     virtual bool isConfigurable( uint index ) const;
00279     virtual bool setShortcut( uint index , const TDEShortcut& shortcut );
00280 
00282     virtual TQVariant getOther( Other, uint index ) const;
00284     virtual bool setOther( Other, uint index, TQVariant );
00285 
00286     virtual bool save() const;
00287 
00288  protected:
00289     virtual void virtual_hook( int id, void* data );
00290  private:
00291     class ShortcutListPrivate* d;
00292 };
00293 }
00294 
00295 #endif // __TDESHORTCUTLIST_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.6.3
This website is maintained by Timothy Pearson.