kexi

kexisimpleprintingpagesetup.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 Jaroslaw Staniek <js@iidea.pl>
00003 
00004    This program is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this program; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #ifndef KEXISIMPLEPRINTINGPAGESETUP_H
00021 #define KEXISIMPLEPRINTINGPAGESETUP_H
00022 
00023 #include "kexisimpleprintingengine.h"
00024 #include <kexiviewbase.h>
00025 
00026 class KexiSimplePrintingPageSetupBase;
00027 class KoPageLayoutSize;
00028 class KexiSimplePrintPreviewWindow;
00029 
00038 class KexiSimplePrintingCommand : public QObject
00039 {
00040     Q_OBJECT
00041 
00042     public:
00043         KexiSimplePrintingCommand(KexiMainWindow* mainWin, int objectId, 
00044             QObject* parent = 0);
00045         ~KexiSimplePrintingCommand();
00046 
00047     public slots:
00048         bool print(const KexiSimplePrintingSettings& settings, 
00049             const QString& aTitleText = QString::null);
00050         bool print(const QString& aTitleText = QString::null);
00051         bool showPrintPreview(const KexiSimplePrintingSettings& settings, 
00052             const QString& aTitleText = QString::null, bool reload = false);
00053 //      void setPrintPreviewNeedsReloading();
00054 
00055     signals:
00057         void showPageSetupRequested(KexiPart::Item* item);
00058 
00059     protected slots:
00060         void slotShowPageSetupRequested();
00061 
00062     protected:
00063         KexiSimplePrintingEngine* m_previewEngine;
00064         KexiMainWindow* m_mainWin;
00065         int m_objectId;
00066         KexiSimplePrintingSettings m_settings;
00067         KexiSimplePrintPreviewWindow *m_previewWindow;
00068         bool m_printPreviewNeedsReloading : 1;
00069 };
00070 
00072 class KexiSimplePrintingPageSetup : public KexiViewBase
00073 {
00074     Q_OBJECT
00075 
00076     public:
00077         KexiSimplePrintingPageSetup( KexiMainWindow *mainWin, QWidget *parent, QMap<QString,QString>* args );
00078         ~KexiSimplePrintingPageSetup();
00079 
00080     public slots:
00081         void print();
00082         void printPreview();
00083 
00084     signals:
00085         void printItemRequested(KexiPart::Item* item, 
00086             const KexiSimplePrintingSettings& settings, const QString& titleText);
00087         void printPreviewForItemRequested(KexiPart::Item* item, 
00088             const KexiSimplePrintingSettings& settings, const QString& titleText, bool reload);
00089 
00090     protected slots:
00091         void slotOpenData();
00092         void slotSaveSetup();
00093         void slotChangeTitleFont();
00094         void slotChangePageSizeAndMargins();
00095         void slotAddPageNumbersCheckboxToggled(bool set);
00096         void slotAddDateTimeCheckboxToggled(bool set);
00097         void slotAddTableBordersCheckboxToggled(bool set);
00098         void slotTitleTextChanged(const QString&);
00099 
00100     protected:
00101         void setupPrintingCommand();
00102         void updatePageLayoutAndUnitInfo();
00103         void setDirty(bool set);
00104 
00105         KexiSimplePrintingSettings m_settings;
00106 //      KexiSimplePrintingEngine *m_engine;
00107         KoUnit::Unit m_unit;
00108         KexiSimplePrintingPageSetupBase *m_contents;
00109         KoPageLayoutSize *m_pageLayoutWidget;
00110         KexiPart::Item *m_item;
00111 //      KexiSimplePrintingCommand *m_command;
00112         QString m_origCaptionLabelText;
00113         bool m_printPreviewNeedsReloading : 1;
00114 
00115 };
00116 
00117 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys