File indexing completed on 2024-05-19 15:27:50

0001 /* This file is part of KGraphViewer.
0002    Copyright (C) 2005-2007 Gael de Chalendar <kleag@free.fr>
0003 
0004    KGraphViewer is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU General Public
0006    License as published by the Free Software Foundation, version 2.
0007 
0008    This program is distributed in the hope that it will be useful,
0009    but WITHOUT ANY WARRANTY; without even the implied warranty of
0010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0011    General Public License for more details.
0012 
0013    You should have received a copy of the GNU General Public License
0014    along with this program; if not, write to the Free Software
0015    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
0016    02110-1301, USA
0017 */
0018 
0019 /* This file was part of the KDE project
0020    Copyright (C) 2005 Jarosław Staniek <staniek@kde.org>
0021 
0022    This program is free software; you can redistribute it and/or
0023    modify it under the terms of the GNU Library General Public
0024    License as published by the Free Software Foundation; either
0025    version 2 of the License, or (at your option) any later version.
0026  */
0027 
0028 // Description: Page Layout Dialog (sources)
0029 
0030 #ifndef kgvpagelayoutcolumns_h
0031 #define kgvpagelayoutcolumns_h
0032 
0033 #include <KgvPageLayout.h>
0034 #include <KgvUnit.h>
0035 #include <ui_KgvPageLayoutColumnsBase.h>
0036 
0037 class QWidget;
0038 class KgvUnitDoubleSpinBox;
0039 class KgvPagePreview;
0040 
0041 /**
0042  * This class is a widget that shows the KgvColumns data structure and allows the user to change it.
0043  */
0044 class KgvPageLayoutColumns : public QWidget, public Ui::KgvPageLayoutColumnsBase
0045 {
0046     Q_OBJECT
0047 
0048 public:
0049     /**
0050      * Constructor
0051      * @param parent the parent widget
0052      * @param columns the KgvColumns data structure that this dialog should be initialized with
0053      * @param unit the unit-type (mm/cm/inch) that the dialog should show
0054      * @param layout the page layout that the preview should be initialized with.
0055      */
0056     KgvPageLayoutColumns(QWidget *parent, const KgvColumns &columns, KgvUnit::Unit unit, const KgvPageLayout &layout);
0057 
0058     /**
0059      * Update the page preview widget with the param layout.
0060      * @param layout the new layout
0061      */
0062     void setLayout(KgvPageLayout &layout);
0063 public Q_SLOTS:
0064 
0065     /**
0066      * Enable the user to edit the columns
0067      * @param on if true enable the user to change the columns count
0068      */
0069     void setEnableColumns(bool on);
0070 
0071 Q_SIGNALS:
0072     void propertyChange(KgvColumns &columns);
0073 
0074 protected:
0075     KgvColumns m_columns;
0076     KgvPagePreview *m_preview;
0077     KgvUnitDoubleSpinBox *m_spacing;
0078 
0079 private Q_SLOTS:
0080     void nColChanged(int);
0081     void nSpaceChanged(double);
0082 };
0083 
0084 #endif