summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/kactioncollection.h
Unidiff
Diffstat (limited to 'microkde/kdeui/kactioncollection.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/kactioncollection.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/microkde/kdeui/kactioncollection.h b/microkde/kdeui/kactioncollection.h
index b9466d0..50cb02a 100644
--- a/microkde/kdeui/kactioncollection.h
+++ b/microkde/kdeui/kactioncollection.h
@@ -1,159 +1,161 @@
1/* This file is part of the KDE libraries 1/* This file is part of the KDE libraries
2 Copyright (C) 1999 Reginald Stadlbauer <reggie@kde.org> 2 Copyright (C) 1999 Reginald Stadlbauer <reggie@kde.org>
3 (C) 1999 Simon Hausmann <hausmann@kde.org> 3 (C) 1999 Simon Hausmann <hausmann@kde.org>
4 (C) 2000 Nicolas Hadacek <haadcek@kde.org> 4 (C) 2000 Nicolas Hadacek <haadcek@kde.org>
5 (C) 2000 Kurt Granroth <granroth@kde.org> 5 (C) 2000 Kurt Granroth <granroth@kde.org>
6 (C) 2000 Michael Koch <koch@kde.org> 6 (C) 2000 Michael Koch <koch@kde.org>
7 (C) 2001 Holger Freyther <freyther@kde.org> 7 (C) 2001 Holger Freyther <freyther@kde.org>
8 (C) 2002 Ellis Whitehead <ellis@kde.org> 8 (C) 2002 Ellis Whitehead <ellis@kde.org>
9 9
10 This library is free software; you can redistribute it and/or 10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Library General Public 11 modify it under the terms of the GNU Library General Public
12 License version 2 as published by the Free Software Foundation. 12 License version 2 as published by the Free Software Foundation.
13 13
14 This library is distributed in the hope that it will be useful, 14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Library General Public License for more details. 17 Library General Public License for more details.
18 18
19 You should have received a copy of the GNU Library General Public License 19 You should have received a copy of the GNU Library General Public License
20 along with this library; see the file COPYING.LIB. If not, write to 20 along with this library; see the file COPYING.LIB. If not, write to
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. 22 Boston, MA 02111-1307, USA.
23*/ 23*/
24//$Id$ 24//$Id$
25 25
26#ifndef __kactioncollection_h__ 26#ifndef __kactioncollection_h__
27#define __kactioncollection_h__ 27#define __kactioncollection_h__
28 28
29#include <kaction.h> 29#include <kaction.h>
30 30
31//US #include <qkeysequence.h> 31//US #include <qkeysequence.h>
32#include <qobject.h> 32#include <qobject.h>
33//Added by qt3to4:
34#include <Q3ValueList>
33//US#include <qvaluelist.h> 35//US#include <qvaluelist.h>
34//US#include <qguardedptr.h> 36//US#include <qguardedptr.h>
35//US #include <kguiitem.h> 37//US #include <kguiitem.h>
36//US#include <kshortcut.h> 38//US#include <kshortcut.h>
37//US#include <kstdaction.h> 39//US#include <kstdaction.h>
38//US#include <kicontheme.h> 40//US#include <kicontheme.h>
39 41
40//USclass QMenuBar; 42//USclass QMenuBar;
41//USclass QPopupMenu; 43//USclass QPopupMenu;
42//USclass QComboBox; 44//USclass QComboBox;
43//USclass QPoint; 45//USclass QPoint;
44//USclass QIconSet; 46//USclass QIconSet;
45//USclass QString; 47//USclass QString;
46//USclass KToolBar; 48//USclass KToolBar;
47 49
48//USclass KAccel; 50//USclass KAccel;
49//USclass KAccelActions; 51//USclass KAccelActions;
50//USclass KConfig; 52//USclass KConfig;
51//USclass KConfigBase; 53//USclass KConfigBase;
52//USclass KURL; 54//USclass KURL;
53//USclass KInstance; 55//USclass KInstance;
54//USclass KToolBar; 56//USclass KToolBar;
55//USclass KActionCollection; 57//USclass KActionCollection;
56//USclass KPopupMenu; 58//USclass KPopupMenu;
57//USclass KMainWindow; 59//USclass KMainWindow;
58 60
59//US added inclidefiles 61//US added inclidefiles
60class QWidget; 62class QWidget;
61 63
62 64
63typedef QValueList<KAction *> KActionPtrList; 65typedef Q3ValueList<KAction *> KActionPtrList;
64 66
65/** 67/**
66 * A managed set of KAction objects. 68 * A managed set of KAction objects.
67 */ 69 */
68class KActionCollection : public QObject 70class KActionCollection : public QObject
69{ 71{
70 friend class KAction; 72 friend class KAction;
71 friend class KXMLGUIClient; 73 friend class KXMLGUIClient;
72 74
73 Q_OBJECT 75 Q_OBJECT
74public: 76public:
75 KActionCollection( QWidget *parent, const char *name = 0/*US , KInstance *instance = 0 */); 77 KActionCollection( QWidget *parent, const char *name = 0/*US , KInstance *instance = 0 */);
76 /** 78 /**
77 * Use this constructor if you want the collection's actions to restrict 79 * Use this constructor if you want the collection's actions to restrict
78 * their accelerator keys to @p watch rather than the @p parent. If 80 * their accelerator keys to @p watch rather than the @p parent. If
79 * you don't require shortcuts, you can pass a null to the @p watch parameter. 81 * you don't require shortcuts, you can pass a null to the @p watch parameter.
80 */ 82 */
81 KActionCollection( QWidget *watch, QObject* parent, const char *name = 0/*US, KInstance *instance = 0 */); 83 KActionCollection( QWidget *watch, QObject* parent, const char *name = 0/*US, KInstance *instance = 0 */);
82 KActionCollection( const KActionCollection &copy ); 84 KActionCollection( const KActionCollection &copy );
83 virtual ~KActionCollection(); 85 virtual ~KActionCollection();
84 86
85 /** 87 /**
86 * This sets the widget to which the keyboard shortcuts should be attached. 88 * This sets the widget to which the keyboard shortcuts should be attached.
87 * You only need to call this if a null pointer was passed in the constructor. 89 * You only need to call this if a null pointer was passed in the constructor.
88 */ 90 */
89 virtual void setWidget( QWidget *widget ); 91 virtual void setWidget( QWidget *widget );
90 92
91 /** 93 /**
92 * This indicates whether new actions which are created in this collection 94 * This indicates whether new actions which are created in this collection
93 * should have their keyboard shortcuts automatically connected on 95 * should have their keyboard shortcuts automatically connected on
94 * construction. Set to 'false' if you will be loading XML-based settings. 96 * construction. Set to 'false' if you will be loading XML-based settings.
95 * This is automatically done by KParts. The default is 'true'. 97 * This is automatically done by KParts. The default is 'true'.
96 * @see isAutoConnectShortcuts() 98 * @see isAutoConnectShortcuts()
97 */ 99 */
98 void setAutoConnectShortcuts( bool ); 100 void setAutoConnectShortcuts( bool );
99 101
100 /** 102 /**
101 * This indicates whether new actions which are created in this collection 103 * This indicates whether new actions which are created in this collection
102 * have their keyboard shortcuts automatically connected on 104 * have their keyboard shortcuts automatically connected on
103 * construction. 105 * construction.
104 * @see setAutoConnectShortcuts() 106 * @see setAutoConnectShortcuts()
105 */ 107 */
106 bool isAutoConnectShortcuts(); 108 bool isAutoConnectShortcuts();
107 109
108 /** 110 /**
109 * This sets the default shortcut scope for new actions created in this 111 * This sets the default shortcut scope for new actions created in this
110 * collection. The default is ScopeUnspecified. Ideally the default 112 * collection. The default is ScopeUnspecified. Ideally the default
111 * would have been ScopeWidget, but that would cause some backwards 113 * would have been ScopeWidget, but that would cause some backwards
112 * compatibility problems. 114 * compatibility problems.
113 */ 115 */
114 //void setDefaultScope( KAction::Scope ); 116 //void setDefaultScope( KAction::Scope );
115 117
116 /** 118 /**
117 * Doc/View model. This lets you add the action collection of a document 119 * Doc/View model. This lets you add the action collection of a document
118 * to a view's action collection. 120 * to a view's action collection.
119 */ 121 */
120 bool addDocCollection( KActionCollection* pDoc ); 122 bool addDocCollection( KActionCollection* pDoc );
121 123
122 /** Returns the number of widgets which this collection is associated with. */ 124 /** Returns the number of widgets which this collection is associated with. */
123 //uint widgetCount() const; 125 //uint widgetCount() const;
124 126
125 /** 127 /**
126 * Returns true if the collection has its own KAccel object. This will be 128 * Returns true if the collection has its own KAccel object. This will be
127 * the case if it was constructed with a valid widget ptr or if setWidget() 129 * the case if it was constructed with a valid widget ptr or if setWidget()
128 * was called. 130 * was called.
129 */ 131 */
130 //bool ownsKAccel() const; 132 //bool ownsKAccel() const;
131 133
132 /** @deprecated Deprecated because of ambiguous name. Use kaccel() */ 134 /** @deprecated Deprecated because of ambiguous name. Use kaccel() */
133 virtual KAccel* accel(); 135 virtual KAccel* accel();
134 /** @deprecated Deprecated because of ambiguous name. Use kaccel() */ 136 /** @deprecated Deprecated because of ambiguous name. Use kaccel() */
135 virtual const KAccel* accel() const; 137 virtual const KAccel* accel() const;
136 138
137 /** Returns the KAccel object of the most recently set widget. */ 139 /** Returns the KAccel object of the most recently set widget. */
138 KAccel* kaccel(); 140 KAccel* kaccel();
139 /** Returns the KAccel object of the most recently set widget. Const version for convenience. */ 141 /** Returns the KAccel object of the most recently set widget. Const version for convenience. */
140 const KAccel* kaccel() const; 142 const KAccel* kaccel() const;
141 143
142 /** @internal, for KAction::kaccelCurrent() */ 144 /** @internal, for KAction::kaccelCurrent() */
143 KAccel* builderKAccel() const; 145 KAccel* builderKAccel() const;
144 /** Returns the KAccel object associated with widget #. */ 146 /** Returns the KAccel object associated with widget #. */
145 //KAccel* widgetKAccel( uint i ); 147 //KAccel* widgetKAccel( uint i );
146 //const KAccel* widgetKAccel( uint i ) const; 148 //const KAccel* widgetKAccel( uint i ) const;
147 149
148 /** Returns the number of actions in the collection */ 150 /** Returns the number of actions in the collection */
149 virtual uint count() const; 151 virtual uint count() const;
150 bool isEmpty() const { return count() == 0; } 152 bool isEmpty() const { return count() == 0; }
151 /** 153 /**
152 * Return the KAction* at position "index" in the action collection. 154 * Return the KAction* at position "index" in the action collection.
153 * @see count() 155 * @see count()
154 */ 156 */
155 virtual KAction* action( int index ) const; 157 virtual KAction* action( int index ) const;
156 /** 158 /**
157 * Find an action (optionally, of a given subclass of KAction) in the action collection. 159 * Find an action (optionally, of a given subclass of KAction) in the action collection.
158 * @param name Name of the KAction. 160 * @param name Name of the KAction.
159 * @param classname Name of the KAction subclass. 161 * @param classname Name of the KAction subclass.