| # kdecore Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | 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
    00027 class QPopupMenu; // for obsolete insertItem() methods below
    00028 class QWidget;
    00029 class KAccelAction;
    00030 class KAccelActions;
    00031 class KConfigBase;
    00032
    00033 class KAccelPrivate;
    00093 class 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
    00147         bool getAutoUpdate();
    00148
    00159         bool setAutoUpdate( bool bAuto );
    00160
    00182         KAccelAction* insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
    00183                          const KShortcut& cutDef,
    00184                          const QObject* pObjSlot, const char* psMethodSlot,
    00185                          bool bConfigurable = true, bool bEnabled = true );
    00190         KAccelAction* insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
    00191                          const KShortcut& cutDef3, const KShortcut& cutDef4,
    00192                          const QObject* pObjSlot, const char* psMethodSlot,
    00193                          bool bConfigurable = true, bool bEnabled = true );
    00207         KAccelAction* insert( const char* psAction, const KShortcut& cutDef,
    00208                          const QObject* pObjSlot, const char* psMethodSlot,
    00209                          bool bConfigurable = true, bool bEnabled = true );
    00216         KAccelAction* insert( KStdAccel::StdAccel id,
    00217                          const QObject* pObjSlot, const char* psMethodSlot,
    00218                          bool bConfigurable = true, bool bEnabled = true );
    00226         KAccelAction* insert( const QString& sName, const QString& sLabel );
    00227
    00234         bool remove( const QString& sAction );
    00235
    00244         bool updateConnections();
    00245
    00251         const KShortcut& shortcut( const QString& sAction ) const;
    00252
    00259         bool setShortcut( const QString& sAction, const KShortcut &shortcut );
    00260
    00269         bool setSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot );
    00276         bool setEnabled( const QString& sAction, bool bEnabled );
    00277
    00283         const QString& configGroup() const;
    00284
    00290         void setConfigGroup( const QString &name );
    00291
    00303         bool readSettings( KConfigBase* pConfig = 0 );
    00312         bool writeSettings( KConfigBase* pConfig = 0 ) const;
    00313
    00317         void emitKeycodeChanged();
    00318
    00319  signals:
    00323         void keycodeChanged();
    00324
    00325 #ifndef KDE_NO_COMPAT
    00326  public:
    00327         // Source compatibility to KDE 2.x
    00331         bool insertItem( const QString& sLabel, const QString& sAction,
    00332                          const char* psKey,
    00333                          int nIDMenu = 0, QPopupMenu* pMenu = 0, bool bConfigurable = true );
    00337         bool insertItem( const QString& sLabel, const QString& sAction,
    00338                          int key,
    00339                          int nIDMenu = 0, QPopupMenu* pMenu = 0, bool bConfigurable = true );
    00343         bool insertStdItem( KStdAccel::StdAccel id, const QString& descr = QString::null );
    00347         bool connectItem( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot, bool bActivate = true );
    00351         bool connectItem( KStdAccel::StdAccel accel, const QObject* pObjSlot, const char* psMethodSlot )
    00352                 { return insert( accel, pObjSlot, psMethodSlot ); }
    00356         bool removeItem( const QString& sAction );
    00360         bool setItemEnabled( const QString& sAction, bool bEnable );
    00364         void changeMenuAccel( QPopupMenu *menu, int id, const QString& action );
    00368         void changeMenuAccel( QPopupMenu *menu, int id, KStdAccel::StdAccel accel );
    00372         static int stringToKey( const QString& );
    00373
    00380         int currentKey( const QString& action ) const;
    00381
    00387         QString findKey( int key ) const;
    00388 #endif // !KDE_NO_COMPAT
    00389
    00390  protected:
    00392         virtual void virtual_hook( int id, void* data );
    00393  private:
    00394         class KAccelPrivate* d;
    00395         friend class KAccelPrivate;
    00396 };
    00397
    00398 #endif // _KACCEL_H

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 12:46:18 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001