printable.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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
00079 virtual void DoPrint (GtkPrintOperation *print, GtkPrintContext *context, int page) const = 0;
00085 virtual bool SupportsHeaders () {return false;}
00091 virtual bool SupportMultiplePages () {return false;}
00096 virtual GtkWindow *GetGtkWindow () = 0;
00101 virtual int GetPagesNumber () {return 1;}
00102
00108 void Print (bool preview);
00116 void SetPageSetup (GtkPageSetup *PageSetup);
00117
00121 GCU_RO_PROP (GtkPrintSettings *, PrintSettings)
00125 GCU_RO_PROP (GtkPageSetup *, PageSetup)
00137 GCU_PROP (GtkUnit, Unit)
00149 GCU_PROP (double, HeaderHeight)
00161 GCU_PROP (double, FooterHeight)
00172 GCU_PROP (bool, HorizCentered)
00183 GCU_PROP (bool, VertCentered)
00195 GCU_PROP (PrintScaleType, ScaleType)
00207 GCU_PROP (double, Scale)
00218 GCU_PROP (bool, HorizFit)
00228 GCU_PROP (bool, VertFit)
00241 GCU_PROP (int, HPages)
00254 GCU_PROP (int, VPages)
00255 };
00256
00261 GtkUnit gtk_unit_from_string (char const *name);
00266 char const *gtk_unit_to_string (GtkUnit unit);
00267
00268 }
00269
00270 #endif // GCU_PRINTABLE_H