The Gnome Chemistry Utils  0.12.13
print-setup-dlg.h
Go to the documentation of this file.
1 /*
2  * Gnome Chemistry Utils
3  * print-setup-dlg.h
4  *
5  * Copyright (C) 2008 Jean Bréfort <jean.brefort@normalesup.org>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 
23 #ifndef GCU_PRINT_SETUP_DLG_H
24 #define GCU_PRINT_SETUP_DLG_H
25 
26 #include "dialog.h"
27 #include "printable.h"
28 
30 namespace gcu {
31 
32 class Application;
33 
37 class PrintSetupDlg: public Dialog
38 {
39 friend class PrintSetupDlgPrivate;
40 public:
47  PrintSetupDlg (Application* App, Printable *printable);
51  virtual ~PrintSetupDlg ();
52 
53  void DoPrint (bool preview);
54  void OnPrinterSetup ();
55  void UpdatePageSetup (GtkPageSetup *page_setup);
56  void OnOrientation (GtkPageOrientation orientation);
57  bool SelectUnit (GtkTreeIter *iter);
58  void OnUnitChanged ();
59  void OnTopMarginChanged (double x);
60  void OnBottomMarginChanged (double x);
61  void OnRightMarginChanged (double x);
62  void OnLeftMarginChanged (double x);
63  void OnHeaderHeightChanged (double x);
64  void OnFooterHeightChanged (double x);
65  void OnHorizCenter ();
66  void OnVertCenter ();
67  void UpdateScale ();
68  void OnScaleType (PrintScaleType type);
69  void OnScale (double scale);
70  void OnHFit (bool fit);
71  void OnVFit (bool fit);
72  void OnHPages (int pages);
73  void OnVPages (int pages);
74 
75 private:
76  Printable *m_Printable;
77  GtkLabel *m_PageSizeLbl, *m_PageTypeLbl;
78  GtkToggleButton *m_PortraitBtn, *m_RPortraitBtn, *m_LandscapeBtn, *m_RLandscapeBtn;
79  gulong m_PortraitId, m_RPortraitId, m_LandscapeId, m_RLandscapeId;
80  GtkSpinButton *m_MarginTopBtn, *m_MarginBottomBtn, *m_MarginRightBtn, *m_MarginLeftBtn, *m_HeaderHeightBtn, *m_FooterHeightBtn;
81  gulong m_MarginTopId, m_MarginBottomId, m_MarginRightId, m_MarginLeftId, m_HeaderHeightId, m_FooterHeightId;
82  GtkListStore *m_UnitList;
83  GtkComboBox *m_UnitBox;
84  GtkToggleButton *m_HBtn, *m_VBtn;
85  gulong m_UnitId, m_HId, m_VId;
86  GtkToggleButton *m_ScalingNoneBtn, *m_ScalingFixedBtn, *m_ScalingAutoBtn, *m_HFitBtn, *m_VFitBtn;
87  gulong m_ScalingNoneId, m_ScalingFixedId, m_ScalingAutoId, m_HFitId, m_VFitId;
88  GtkSpinButton *m_HPagesBtn, *m_VPagesBtn, *m_ScaleBtn;
89  GtkLabel *m_ScaleLbl, *m_FitHLbl, *m_FitVLbl;
90 };
91 
92 } // namespace gcu
93 
94 #endif // GCU_PRINT_SETUP_DLG_H