kexi

kexisharedactionhost.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
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#ifndef KEXISHAREDACTIONHOST_H
21#define KEXISHAREDACTIONHOST_H
22
23#include <tqguardedptr.h>
24#include <tqasciidict.h>
25#include <tqobject.h>
26#include <tqpair.h>
27
28#include <kstdaction.h>
29#include <tdeaction.h>
30
31class TDEShortcut;
32class KGuiItem;
33class TDEMainWindow;
34class KexiActionProxy;
35class KexiSharedActionHostPrivate;
36
37namespace KexiPart {
38 class Part;
39}
40
42
51
52class KEXICORE_EXPORT KexiSharedActionHost
53{
54 public:
55
57 KexiSharedActionHost(TDEMainWindow* mainWin);
58
59 virtual ~KexiSharedActionHost();
60
70 virtual bool acceptsSharedActions(TQObject *o);
71
78 TQWidget* focusWindow();
79
81 void setAsDefaultHost();
82
87
89 TDEActionPtrList sharedActions() const;
90
92 void setActionVolatile( TDEAction *a, bool set );
93
94
95 protected:
96
109 virtual void invalidateSharedActions(TQObject *o);
110
111 void setActionAvailable(const char *action_name, bool avail);
112
114 void plugActionProxy(KexiActionProxy *proxy);
115
118 void updateActionAvailable(const char *action_name, bool avail, TQObject *obj);
119
121 TDEMainWindow* mainWindow() const;
122
129 TDEAction* createSharedAction(const TQString &text, const TQString &pix_name,
130 const TDEShortcut &cut, const char *name, TDEActionCollection* col = 0,
131 const char *subclassName = 0);
132
135 TDEAction* createSharedAction( KStdAction::StdAction id, const char *name,
136 TDEActionCollection* col = 0);
137
141 TDEAction* createSharedAction(const KGuiItem& guiItem, const TDEShortcut &cut, const char *name,
142 TDEActionCollection* col = 0);
143
146 KexiActionProxy* actionProxyFor(TQObject *o) const;
147
150 KexiActionProxy* takeActionProxyFor(TQObject *o);
151
152 private:
154 TDEAction* createSharedActionInternal( TDEAction *action );
155
156 KexiSharedActionHostPrivate *d;
157
158 friend class KexiActionProxy;
159 friend class KexiPart::Part;
160 friend class KexiViewBase;
161 friend class KexiDialogBase;
162};
163
164#endif
165
An interface that acts as proxy for shared actions within the application.
The main class for kexi frontend parts like tables, queries, forms and reports.
Definition kexipart.h:66
void setActionVolatile(TDEAction *a, bool set)
KexiActionProxy * actionProxyFor(TQObject *o) const
void plugActionProxy(KexiActionProxy *proxy)
void updateActionAvailable(const char *action_name, bool avail, TQObject *obj)
virtual bool acceptsSharedActions(TQObject *o)
TDEMainWindow * mainWindow() const
virtual void invalidateSharedActions(TQObject *o)
static KexiSharedActionHost & defaultHost()
KexiSharedActionHost(TDEMainWindow *mainWin)
TDEActionPtrList sharedActions() const
TDEAction * createSharedAction(const TQString &text, const TQString &pix_name, const TDEShortcut &cut, const char *name, TDEActionCollection *col=0, const char *subclassName=0)
KexiActionProxy * takeActionProxyFor(TQObject *o)