# printable.h

Go to the documentation of this file.

    00001 /*
    00002  * Gnome Chemistry Utils
    00003  * printable.h
    00004  *
    00005  * Copyright (C) 2008 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 2 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 "dialog-owner.h"
    00027 #include "macros.h"
    00028 #include <gtk/gtkprintoperation.h>
    00029 #include <gtk/gtkprintcontext.h>
    00030 #include <gtk/gtkpagesetup.h>
    00031 #include <gtk/gtkprintsettings.h>
    00032
    00035 namespace gcu {
    00036
    00040 typedef enum {
    00044         GCU_PRINT_SCALE_NONE,
    00048         GCU_PRINT_SCALE_FIXED,
    00052         GCU_PRINT_SCALE_AUTO,
    00053 } PrintScaleType;
    00054
    00058 class Printable: virtual public DialogOwner
    00059 {
    00060 public:
    00064         Printable ();
    00068         virtual ~Printable ();
    00069
    00078         virtual void DoPrint (GtkPrintOperation *print, GtkPrintContext *context) const = 0;
    00084         virtual bool SupportsHeaders () {return false;}
    00090         virtual bool SupportMultiplePages () {return false;}
    00095         virtual GtkWindow *GetGtkWindow () = 0;
    00100         virtual int GetPagesNumber () {return 1;}
    00101
    00107         void Print (bool preview);
    00115         void SetPageSetup (GtkPageSetup *PageSetup);
    00116
    00120 GCU_RO_PROP (GtkPrintSettings *, PrintSettings)
    00124 GCU_RO_PROP (GtkPageSetup *, PageSetup)
    00136 GCU_PROP (GtkUnit, Unit)
    00148 GCU_PROP (double, HeaderHeight)
    00160 GCU_PROP (double, FooterHeight)
    00171 GCU_PROP (bool, HorizCentered)
    00182 GCU_PROP (bool, VertCentered)
    00194 GCU_PROP (PrintScaleType, ScaleType)
    00206 GCU_PROP (double, Scale)
    00217 GCU_PROP (bool, HorizFit)
    00227 GCU_PROP (bool, VertFit)
    00240 GCU_PROP (int, HPages)
    00253 GCU_PROP (int, VPages)
    00254 };
    00255
    00260 GtkUnit gtk_unit_from_string (char const *name);
    00265 char const *gtk_unit_to_string (GtkUnit unit);
    00266
    00267 }       //      namespace gcu
    00268
    00269 #endif  //      GCU_PRINTABLE_H