kdecore Library: kaccel.h Source File (kdecore Library)

| # kdecore Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# kaccel.h

    00001 /* This file is part of the KDE libraries
    00002     Copyright (C) 2001,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., 59 Temple Place - Suite 330,
    00017     Boston, MA 02111-1307, USA.
    00018 */
    00019
    00020 #ifndef _KACCEL_H
    00021 #define _KACCEL_H
    00022
    00023 #include <qaccel.h>
    00024 #include <kshortcut.h>
    00025 #include <kstdaccel.h>
    00026 #include "kdelibs_export.h"
    00027
    00028 class QPopupMenu; // for obsolete insertItem() methods below
    00029 class QWidget;
    00030 class KAccelAction;
    00031 class KAccelActions;
    00032 class KConfigBase;
    00033
    00034 class KAccelPrivate;
    00093 class KDECORE_EXPORT KAccel : public QAccel
    00094 {
    00095     Q_OBJECT
    00096  public:
    00104     KAccel( QWidget* pParent, const char* psName = 0 );
    00105
    00113     KAccel( QWidget* watch, QObject* parent, const char* psName = 0 );
    00114     virtual ~KAccel();
    00115
    00121     KAccelActions& actions();
    00122
    00128     const KAccelActions& actions() const;
    00129
    00134     bool isEnabled();
    00135
    00140     void setEnabled( bool bEnabled );
    00141
    00152     bool setAutoUpdate( bool bAuto );
    00153
    00175     KAccelAction* insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
    00176                      const KShortcut& cutDef,
    00177                      const QObject* pObjSlot, const char* psMethodSlot,
    00178                      bool bConfigurable = true, bool bEnabled = true );
    00183     KAccelAction* insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
    00184                      const KShortcut& cutDef3, const KShortcut& cutDef4,
    00185                      const QObject* pObjSlot, const char* psMethodSlot,
    00186                      bool bConfigurable = true, bool bEnabled = true );
    00204     KAccelAction* insert( const char* psAction, const KShortcut& cutDef,
    00205                      const QObject* pObjSlot, const char* psMethodSlot,
    00206                      bool bConfigurable = true, bool bEnabled = true );
    00213     KAccelAction* insert( KStdAccel::StdAccel id,
    00214                      const QObject* pObjSlot, const char* psMethodSlot,
    00215                      bool bConfigurable = true, bool bEnabled = true );
    00216
    00223     bool remove( const QString& sAction );
    00224
    00233     bool updateConnections();
    00234
    00240     const KShortcut& shortcut( const QString& sAction ) const;
    00241
    00248     bool setShortcut( const QString& sAction, const KShortcut &shortcut );
    00249
    00258     bool setSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot );
    00265     bool setEnabled( const QString& sAction, bool bEnabled );
    00266
    00272     const QString& configGroup() const;
    00273
    00279     void setConfigGroup( const QString &name );
    00280
    00292     bool readSettings( KConfigBase* pConfig = 0 );
    00301     bool writeSettings( KConfigBase* pConfig = 0 ) const;
    00302
    00306     void emitKeycodeChanged();
    00307
    00308  signals:
    00312     void keycodeChanged();
    00313
    00314 #ifndef KDE_NO_COMPAT
    00315  public:
    00316     // Source compatibility to KDE 2.x
    00320     bool insertItem( const QString& sLabel, const QString& sAction,
    00321                      const char* psKey,
    00322                      int nIDMenu = 0, QPopupMenu* pMenu = 0, bool bConfigurable = true ) KDE_DEPRECATED;
    00326     bool insertItem( const QString& sLabel, const QString& sAction,
    00327                      int key,
    00328                      int nIDMenu = 0, QPopupMenu* pMenu = 0, bool bConfigurable = true ) KDE_DEPRECATED;
    00332     bool insertStdItem( KStdAccel::StdAccel id, const QString& descr = QString::null ) KDE_DEPRECATED;
    00336     bool connectItem( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot, bool bActivate = true ) KDE_DEPRECATED;
    00341     KDE_DEPRECATED bool connectItem( KStdAccel::StdAccel accel, const QObject* pObjSlot, const char* psMethodSlot )
    00342         { return insert( accel, pObjSlot, psMethodSlot ); }
    00346     bool removeItem( const QString& sAction ) KDE_DEPRECATED;
    00350     bool setItemEnabled( const QString& sAction, bool bEnable ) KDE_DEPRECATED;
    00354     void changeMenuAccel( QPopupMenu *menu, int id, const QString& action ) KDE_DEPRECATED;
    00358     void changeMenuAccel( QPopupMenu *menu, int id, KStdAccel::StdAccel accel ) KDE_DEPRECATED;
    00362     static int stringToKey( const QString& ) KDE_DEPRECATED;
    00363
    00371     int currentKey( const QString& action ) const KDE_DEPRECATED;
    00372
    00379     QString findKey( int key ) const KDE_DEPRECATED;
    00380 #endif // !KDE_NO_COMPAT
    00381
    00382  protected:
    00384     virtual void virtual_hook( int id, void* data );
    00385  private:
    00386     class KAccelPrivate* d;
    00387     friend class KAccelPrivate;
    00388 };
    00389
    00390 #endif // _KACCEL_H

This file is part of the documentation for kdecore Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:18:00 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003