printable.h
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
00033 namespace gcu {
00034
00035 typedef enum {
00036 GCU_PRINT_SCALE_NONE,
00037 GCU_PRINT_SCALE_FIXED,
00038 GCU_PRINT_SCALE_AUTO,
00039 } PrintScaleType;
00040
00041 class Printable: virtual public DialogOwner
00042 {
00043 public:
00044 Printable ();
00045 virtual ~Printable ();
00046
00047 virtual void DoPrint (GtkPrintOperation *print, GtkPrintContext *context) const = 0;
00048 virtual bool SupportsHeaders () {return false;}
00049 virtual bool SupportMultiplePages () {return false;}
00050 virtual GtkWindow *GetGtkWindow () = 0;
00051 virtual int GetPagesNumber () {return 1;}
00052
00053 void Print (bool preview);
00054 void SetPageSetup (GtkPageSetup *PageSetup);
00055
00056 GCU_RO_PROP (GtkPrintSettings *, PrintSettings)
00057 GCU_RO_PROP (GtkPageSetup *, PageSetup)
00058 GCU_PROP (GtkUnit, Unit)
00059 GCU_PROP (double, HeaderHeight)
00060 GCU_PROP (double, FooterHeight)
00061 GCU_PROP (bool, HorizCentered)
00062 GCU_PROP (bool, VertCentered)
00063 GCU_PROP (PrintScaleType, ScaleType)
00064 GCU_PROP (double, Scale)
00065 GCU_PROP (bool, HorizFit)
00066 GCU_PROP (bool, VertFit)
00067 GCU_PROP (int, HPages)
00068 GCU_PROP (int, VPages)
00069 };
00070
00071 GtkUnit gtk_unit_from_string (char const *name);
00072 char const *gtk_unit_to_string (GtkUnit unit);
00073
00074 }
00075
00076 #endif // GCU_PRINTABLE_H