kivio

kiviooptionsdialog.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Peter Simonsson <psn@linux.se>
00003 
00004    This library 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 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 KIVIOOPTIONSDIALOG_H
00021 #define KIVIOOPTIONSDIALOG_H
00022 
00023 #include <kdialogbase.h>
00024 #include <KoPageLayout.h>
00025 #include <KoUnit.h>
00026 #include <klistview.h>
00027 
00028 class KivioView;
00029 class QComboBox;
00030 class QCheckBox;
00031 class QLabel;
00032 class QRadioButton;
00033 class KColorButton;
00034 class KURLRequester;
00035 class KoUnitDoubleSpinBox;
00036 class KivioGuideLineData;
00037 class QGroupBox;
00038 class QFont;
00039 
00040 // class GuidesListViewItem : public KListViewItem
00041 // {
00042 //   public:
00043 //     GuidesListViewItem(QListView* parent, KivioGuideLineData *gd, KoUnit::Unit u);
00044 //     ~GuidesListViewItem();
00045 // 
00046 //     void setUnit(KoUnit::Unit u);
00047 //     void setPosition(double p, KoUnit::Unit u);
00048 //     void setOrientation(Qt::Orientation o);
00049 //     KivioGuideLineData* guideData() { return m_data; }
00050 // 
00051 //   private:
00052 //     KivioGuideLineData* m_data;
00053 // };
00054 
00055 /***********************************************************************/
00056 
00057 class KivioOptionsDialog : public KDialogBase
00058 {
00059   Q_OBJECT
00060   public:
00061     KivioOptionsDialog(KivioView* parent, const char* name = 0);
00062 
00063   protected:
00064     void initPage();
00065     void initGrid();
00066 
00067     void applyPage();
00068     void applyGrid();
00069 
00070     void defaultPage();
00071     void defaultGrid();
00072 
00073     void setLayoutText(const KoPageLayout& l);
00074     void setFontText(const QFont& f);
00075 
00076   protected slots:
00077     void pageLayoutDlg();
00078     void fontDlg();
00079     void unitChanged(int u);
00080     void slotOk();
00081     void slotApply();
00082     void slotDefault();
00083     void setMaxHorizSnap(double v);
00084     void setMaxVertSnap(double v);
00085 
00086   private:
00087     // Page indecies
00088     int m_pageIndex;
00089     int m_gridIndex;
00090 
00091     QComboBox* m_unitCombo;
00092     QCheckBox* m_marginsChBox;
00093     QCheckBox* m_rulersChBox;
00094     QLabel* m_layoutTxtLbl;
00095     KoPageLayout m_layout;
00096     QLabel* m_fontTxtLbl;
00097     QFont m_font;
00098     KoUnitDoubleSpinBox* m_spaceHorizUSpin;
00099     KoUnitDoubleSpinBox* m_spaceVertUSpin;
00100     KoUnitDoubleSpinBox* m_snapHorizUSpin;
00101     KoUnitDoubleSpinBox* m_snapVertUSpin;
00102     QCheckBox* m_gridChBox;
00103     QCheckBox* m_snapChBox;
00104     KColorButton* m_gridColorBtn;
00105 };
00106 
00107 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys