lib
KoPageLayoutSize.h
00001 /* This file is part of the KDE project 00002 * Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org> 00003 * Copyright (C) 2005 Thomas Zander <zander@kde.org> 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; version 2. 00008 * 00009 * This library 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 library; 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 kopagelayoutsize_h 00021 #define kopagelayoutsize_h 00022 00023 #include <qgroupbox.h> 00024 #include <KoGlobal.h> 00025 #include <KoUnit.h> 00026 #include <kdialogbase.h> 00027 #include <KoPageLayout.h> 00028 #include <KoPageLayoutDia.h> 00029 00030 class QComboBox; 00031 class KoUnitDoubleSpinBox; 00032 class KoPageLayoutColumns; 00033 00037 class KoPageLayoutSize : public QWidget { 00038 Q_OBJECT 00039 00040 public: 00050 KoPageLayoutSize(QWidget *parent, const KoPageLayout& layout, KoUnit::Unit unit, 00051 const KoColumns& columns, bool unitChooser, bool enableBorders); 00052 00056 bool queryClose(); 00061 void setColumns(KoColumns &columns); 00062 00063 public slots: 00068 void setUnit( KoUnit::Unit unit ); 00073 void setEnableBorders(bool on); 00074 00075 signals: 00082 void propertyChange(KoPageLayout &layout); 00083 00084 protected: 00085 QComboBox *cpgFormat; 00086 KoUnitDoubleSpinBox *epgWidth; 00087 KoUnitDoubleSpinBox *epgHeight; 00088 KoUnitDoubleSpinBox *ebrLeft; 00089 KoUnitDoubleSpinBox *ebrRight; 00090 KoUnitDoubleSpinBox *ebrTop; 00091 KoUnitDoubleSpinBox *ebrBottom; 00092 KoPagePreview *pgPreview; 00093 QButtonGroup *m_orientGroup; 00094 00095 protected slots: 00096 void formatChanged( int ); 00097 void widthChanged( double ); 00098 void heightChanged( double ); 00099 void leftChanged( double ); 00100 void rightChanged( double ); 00101 void topChanged( double ); 00102 void bottomChanged( double ); 00103 void orientationChanged( int ); 00104 void setUnitInt( int unit ); 00105 00106 private: 00107 void updatePreview(); 00108 void setValues(); 00109 00110 KoUnit::Unit m_unit; 00111 KoPageLayout m_layout; 00112 00113 bool m_blockSignals, m_haveBorders; 00114 }; 00115 00116 #endif