The Gnome Chemistry Utils  0.12.11
printable.h
Go to the documentation of this file.
1 /*
2  * Gnome Chemistry Utils
3  * printable.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_PRINTABLE_H
24 #define GCU_PRINTABLE_H
25 
26 #include "dialog-owner.h"
27 #include "macros.h"
28 #include <gtk/gtkprintoperation.h>
29 #include <gtk/gtkprintcontext.h>
30 #include <gtk/gtkpagesetup.h>
31 #include <gtk/gtkprintsettings.h>
32 
35 namespace gcu {
36 
40 typedef enum {
54 
58 class Printable: virtual public DialogOwner
59 {
60 public:
64  Printable ();
68  virtual ~Printable ();
69 
79  virtual void DoPrint (GtkPrintOperation *print, GtkPrintContext *context, int page) const = 0;
85  virtual bool SupportsHeaders () {return false;}
91  virtual bool SupportMultiplePages () {return false;}
96  virtual GtkWindow *GetGtkWindow () = 0;
101  virtual int GetPagesNumber () {return 1;}
102 
108  void Print (bool preview);
116  void SetPageSetup (GtkPageSetup *PageSetup);
117 
121 GCU_RO_PROP (GtkPrintSettings *, PrintSettings)
125 GCU_RO_PROP (GtkPageSetup *, PageSetup)
137 GCU_PROP (GtkUnit, Unit)
149 GCU_PROP (double, HeaderHeight)
161 GCU_PROP (double, FooterHeight)
172 GCU_PROP (bool, HorizCentered)
183 GCU_PROP (bool, VertCentered)
207 GCU_PROP (double, Scale)
218 GCU_PROP (bool, HorizFit)
228 GCU_PROP (bool, VertFit)
241 GCU_PROP (int, HPages)
254 GCU_PROP (int, VPages)
255 };
256 
261 GtkUnit gtk_unit_from_string (char const *name);
266 char const *gtk_unit_to_string (GtkUnit unit);
267 
268 } // namespace gcu
269 
270 #endif // GCU_PRINTABLE_H