kexi

kexireportview.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
00003    Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
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         /*void slotWidgetSelected(KFormDesigner::Form *form, bool multiple);
00093         void slotFormWidgetSelected(KFormDesigner::Form *form);
00094         void slotNoFormSelected();
00095 
00096         void setUndoEnabled(bool enabled);
00097         void setRedoEnabled(bool enabled); */
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
KDE Home | KDE Accessibility Home | Description of Access Keys