kexireportview.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
3 Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KEXIREPORTVIEW_H
22#define KEXIREPORTVIEW_H
23
24#include <tqscrollview.h>
25#include <tqtimer.h>
26
27#include <kexiviewbase.h>
28
29#include "kexiscrollview.h"
30#include "kexireportpart.h"
31
32class KexiReportForm;
33
34class KEXIREPORTUTILS_EXPORT KexiReportScrollView : public KexiScrollView
35{
36 TQ_OBJECT
37
38
39 public:
40 KexiReportScrollView(TQWidget *parent, bool preview);
41 virtual ~KexiReportScrollView();
42
43 void setForm(KFormDesigner::Form *form) { m_form = form; }
44
45 public slots:
47 virtual void show();
48
49 protected slots:
50 void slotResizingStarted();
51
52 private:
53 KFormDesigner::Form *m_form;
54};
55
56
58
63class KEXIREPORTUTILS_EXPORT KexiReportView : public KexiViewBase
64{
65 TQ_OBJECT
66
67
68 public:
69 enum ResizeMode {
70 ResizeAuto = 0,
71 ResizeDefault = ResizeAuto,
72 ResizeFixed = 1,
73 NoResize = 2
74 };
75
76 KexiReportView(KexiMainWindow *win, TQWidget *parent, const char *name, KexiDB::Connection *conn);
77 virtual ~KexiReportView();
78
79 KexiDB::Connection* connection() { return m_conn; }
80
81 virtual TQSize preferredSizeHint(const TQSize& otherSize);
82
83 int resizeMode() const { return m_resizeMode; }
84
85 public slots:
87 virtual void show();
88
89 protected slots:
90 void slotPropertySetSwitched(KoProperty::Set *set, bool forceReload = false);
91 void slotDirty(KFormDesigner::Form *f, bool isDirty);
92 void slotFocus(bool in);
93
94 /*void slotWidgetSelected(KFormDesigner::Form *form, bool multiple);
95 void slotFormWidgetSelected(KFormDesigner::Form *form);
96 void slotNoFormSelected();
97
98 void setUndoEnabled(bool enabled);
99 void setRedoEnabled(bool enabled); */
100
101 protected:
102 virtual tristate beforeSwitchTo(int mode, bool &dontStore);
103 virtual tristate afterSwitchFrom(int mode);
104 virtual KoProperty::Set* propertySet() { return m_propertySet; }
105
106 virtual KexiDB::SchemaData* storeNewData(const KexiDB::SchemaData& sdata, bool &cancel);
107 virtual tristate storeData(bool dontAsk = false);
108
109 KexiReportPart::TempData* tempData() const {
110 return static_cast<KexiReportPart::TempData*>(parentDialog()->tempData()); }
111 KexiReportPart* reportPart() const { return static_cast<KexiReportPart*>(part()); }
112
113 void disableWidgetActions();
114 void enableFormActions();
115
116 KFormDesigner::Form* form() const;
117 void setForm(KFormDesigner::Form *f);
118
119 void initForm();
120 void loadForm();
121
122 virtual void resizeEvent ( TQResizeEvent * );
123
124 private:
125 KexiReportForm *m_reportform;
126 KexiReportScrollView *m_scrollView;
127 KoProperty::Set *m_propertySet;
128 KexiDB::Connection *m_conn;
129 int m_resizeMode;
130};
131
132#endif
A simple class representing a form.
Definition form.h:136
Provides database connection, allowing queries and data modification.
Definition connection.h:62
Kexi's main window interface This interface is implemented by KexiMainWindowImpl class.
The report top widget.
Kexi Report Plugin It just creates a KexiReportView. See there for most of code.
The FormPart's view.
virtual KoProperty::Set * propertySet()
The scrollview which includes KexiDBForm.
Base class for single view embeddable of in KexiDialogBase.
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition tristate.h:100