The Gnome Chemistry Utils
0.13.7
|
00001 /* 00002 * Gnome Chemistry Utils 00003 * printable.h 00004 * 00005 * Copyright (C) 2008-2012 Jean Bréfort <jean.brefort@normalesup.org> 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License as 00009 * published by the Free Software Foundation; either version 3 of the 00010 * License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00020 * USA 00021 */ 00022 00023 #ifndef GCU_PRINTABLE_H 00024 #define GCU_PRINTABLE_H 00025 00026 #include <gcu/dialog-owner.h> 00027 #include <gcu/macros.h> 00028 #include <gtk/gtk.h> 00029 00032 namespace gcugtk { 00033 00037 typedef enum { 00041 GCU_PRINT_SCALE_NONE, 00045 GCU_PRINT_SCALE_FIXED, 00049 GCU_PRINT_SCALE_AUTO, 00050 } PrintScaleType; 00051 00055 class Printable: virtual public gcu::DialogOwner 00056 { 00057 public: 00061 Printable (); 00065 virtual ~Printable (); 00066 00076 virtual void DoPrint (GtkPrintOperation *print, GtkPrintContext *context, int page) const = 0; 00082 virtual bool SupportsHeaders () {return false;} 00088 virtual bool SupportMultiplePages () {return false;} 00093 virtual GtkWindow *GetGtkWindow () = 0; 00098 virtual int GetPagesNumber () {return 1;} 00099 00105 void Print (bool preview); 00113 void SetPageSetup (GtkPageSetup *PageSetup); 00114 00118 GCU_RO_PROP (GtkPrintSettings *, PrintSettings) 00122 GCU_RO_PROP (GtkPageSetup *, PageSetup) 00134 GCU_PROP (GtkUnit, Unit) 00146 GCU_PROP (double, HeaderHeight) 00158 GCU_PROP (double, FooterHeight) 00169 GCU_PROP (bool, HorizCentered) 00180 GCU_PROP (bool, VertCentered) 00192 GCU_PROP (PrintScaleType, ScaleType) 00204 GCU_PROP (double, Scale) 00215 GCU_PROP (bool, HorizFit) 00225 GCU_PROP (bool, VertFit) 00238 GCU_PROP (int, HPages) 00251 GCU_PROP (int, VPages) 00264 GCU_PROP (bool, HasBackground) 00276 GCU_PROP (bool, PrintBackground) 00277 }; 00278 00283 GtkUnit gtk_unit_from_string (char const *name); 00288 char const *gtk_unit_to_string (GtkUnit unit); 00289 00290 } // namespace gcu 00291 00292 #endif // GCU_PRINTABLE_H