kexi

kexiviewbase.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 KEXIVIEWBASE_H
21#define KEXIVIEWBASE_H
22
23#include <tqwidget.h>
24
25#include "kexiactionproxy.h"
26
27class KexiMainWindow;
28class KexiDialogBase;
29
30namespace KoProperty {
31 class Set;
32}
33
34namespace KexiDB {
35 class SchemaData;
36}
37
39
52class KEXICORE_EXPORT KexiViewBase : public TQWidget, public KexiActionProxy
53{
54 TQ_OBJECT
55
56
57 public:
58 KexiViewBase(KexiMainWindow *mainWin, TQWidget *parent, const char *name = 0);
59 virtual ~KexiViewBase();
60
62 inline KexiMainWindow *mainWin() const { return m_mainWin; }
63
65 KexiDialogBase* parentDialog() const { return m_dialog; }
66
70 KexiPart::Part* part() const;
71
77 virtual TQSize preferredSizeHint(const TQSize& otherSize);
78
79 virtual bool eventFilter( TQObject *o, TQEvent *e );
80
81 void addChildView( KexiViewBase* childView );
82
91 virtual bool dirty() const { return m_dirty; }
92
94 int viewMode() const { return m_viewMode; }
95
100 virtual TDEAction* sharedAction( const char *action_name );
101
104 virtual void setAvailable(const char* action_name, bool set);
105
106 public slots:
107 virtual void setFocus();
108
112 virtual void propertySetSwitched();
113
119 void setDirty(bool set);
120
122 void setDirty() { setDirty(true); }
123
124 signals:
126 void closing(bool& cancel);
127
128 void focus(bool in);
129
130 protected:
139 virtual tristate beforeSwitchTo(int mode, bool &dontStore);
140
147 virtual tristate afterSwitchFrom(int mode);
148
149 virtual void closeEvent( TQCloseEvent * e );
150
152 virtual KoProperty::Set *propertySet();
153
160 void propertySetReloaded(bool preservePrevSelection = false, const TQCString& propertyToSelect = TQCString());
161
181 virtual KexiDB::SchemaData* storeNewData(const KexiDB::SchemaData& sdata, bool &cancel);
182
189 bool loadDataBlock( TQString &dataString, const TQString& dataID = TQString(), bool canBeEmpty = false );
190
203 virtual tristate storeData(bool dontAsk = false);
204
215 bool storeDataBlock( const TQString &dataString, const TQString &dataID = TQString() );
216
222 bool removeDataBlock( const TQString& dataID = TQString());
223
224 void setViewWidget(TQWidget* w, bool focusProxy = false);
225
232 virtual void updateActions(bool activated);
233
234 virtual void setFocusInternal() { TQWidget::setFocus(); }
235
240 virtual void parentDialogDetached() {};
241
246 virtual void parentDialogAttached() {};
247
248 TQString m_defaultIconName;
249
250 KexiMainWindow *m_mainWin;
251
252 KexiDialogBase *m_dialog;
253
254 TQWidget *m_viewWidget;
255
256 KexiViewBase *m_parentView;
257
258 TQGuardedPtr<TQWidget> m_lastFocusedChildBeforeFocusOut;
259
260 private:
267 int m_newlyAssignedID;
268
271 int m_viewMode;
272
273 TQPtrList<KexiViewBase> m_children;
274
275 bool m_dirty : 1;
276
277 friend class KexiDialogBase;
278};
279
280#endif
281
An interface that acts as proxy for shared actions within the application.
virtual TDEAction * sharedAction(const char *action_name)
Base class for child window of Kexi's main application window.
Kexi's main window interface This interface is implemented by KexiMainWindowImpl class.
The main class for kexi frontend parts like tables, queries, forms and reports.
Definition kexipart.h:66
Base class for single view embeddable of in KexiDialogBase.
virtual void parentDialogDetached()
virtual bool dirty() const
int viewMode() const
virtual void parentDialogAttached()
void closing(bool &cancel)
emitted when the view is about to close
KexiDialogBase * parentDialog() const
KexiMainWindow * mainWin() const
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition tristate.h:100
High-level database connectivity library with database backend drivers.