kexi
kexireportview.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KEXIREPORTVIEW_H
00022 #define KEXIREPORTVIEW_H
00023
00024 #include <qscrollview.h>
00025 #include <qtimer.h>
00026
00027 #include <kexiviewbase.h>
00028
00029 #include "kexiscrollview.h"
00030 #include "kexireportpart.h"
00031
00032 class KexiReportForm;
00033
00034 class KEXIREPORTUTILS_EXPORT KexiReportScrollView : public KexiScrollView
00035 {
00036 Q_OBJECT
00037
00038 public:
00039 KexiReportScrollView(QWidget *parent, bool preview);
00040 virtual ~KexiReportScrollView();
00041
00042 void setForm(KFormDesigner::Form *form) { m_form = form; }
00043
00044 public slots:
00046 virtual void show();
00047
00048 protected slots:
00049 void slotResizingStarted();
00050
00051 private:
00052 KFormDesigner::Form *m_form;
00053 };
00054
00055
00057
00062 class KEXIREPORTUTILS_EXPORT KexiReportView : public KexiViewBase
00063 {
00064 Q_OBJECT
00065
00066 public:
00067 enum ResizeMode {
00068 ResizeAuto = 0,
00069 ResizeDefault = ResizeAuto,
00070 ResizeFixed = 1,
00071 NoResize = 2
00072 };
00073
00074 KexiReportView(KexiMainWindow *win, QWidget *parent, const char *name, KexiDB::Connection *conn);
00075 virtual ~KexiReportView();
00076
00077 KexiDB::Connection* connection() { return m_conn; }
00078
00079 virtual QSize preferredSizeHint(const QSize& otherSize);
00080
00081 int resizeMode() const { return m_resizeMode; }
00082
00083 public slots:
00085 virtual void show();
00086
00087 protected slots:
00088 void slotPropertySetSwitched(KoProperty::Set *set, bool forceReload = false);
00089 void slotDirty(KFormDesigner::Form *f, bool isDirty);
00090 void slotFocus(bool in);
00091
00092
00093
00094
00095
00096
00097
00098
00099 protected:
00100 virtual tristate beforeSwitchTo(int mode, bool &dontStore);
00101 virtual tristate afterSwitchFrom(int mode);
00102 virtual KoProperty::Set* propertySet() { return m_propertySet; }
00103
00104 virtual KexiDB::SchemaData* storeNewData(const KexiDB::SchemaData& sdata, bool &cancel);
00105 virtual tristate storeData(bool dontAsk = false);
00106
00107 KexiReportPart::TempData* tempData() const {
00108 return static_cast<KexiReportPart::TempData*>(parentDialog()->tempData()); }
00109 KexiReportPart* reportPart() const { return static_cast<KexiReportPart*>(part()); }
00110
00111 void disableWidgetActions();
00112 void enableFormActions();
00113
00114 KFormDesigner::Form* form() const;
00115 void setForm(KFormDesigner::Form *f);
00116
00117 void initForm();
00118 void loadForm();
00119
00120 virtual void resizeEvent ( QResizeEvent * );
00121
00122 private:
00123 KexiReportForm *m_reportform;
00124 KexiReportScrollView *m_scrollView;
00125 KoProperty::Set *m_propertySet;
00126 KexiDB::Connection *m_conn;
00127 int m_resizeMode;
00128 };
00129
00130 #endif
|