# gcu::Printable Class Reference

`#include <gcu/printable.h>`

Inheritance diagram for gcu::Printable:

List of all members.

## Public Member Functions

| Printable ()
virtual | ~Printable ()
virtual void | DoPrint (GtkPrintOperation *print, GtkPrintContext *context) const =0
virtual bool | SupportsHeaders ()
virtual bool | SupportMultiplePages ()
virtual GtkWindow * | GetGtkWindow ()=0
virtual int | GetPagesNumber ()
void | Print (bool preview)
void | SetPageSetup (GtkPageSetup *PageSetup)
GtkPrintSettings * | GetPrintSettings (void)
void | SetUnit (GtkUnit val)
GtkUnit | GetUnit (void) const
GtkUnit & | GetRefUnit (void)
void | SetHeaderHeight (double val)
double | GetHeaderHeight (void) const
double & | GetRefHeaderHeight (void)
void | SetFooterHeight (double val)
double | GetFooterHeight (void) const
double & | GetRefFooterHeight (void)
void | SetHorizCentered (bool val)
bool | GetHorizCentered (void) const
bool & | GetRefHorizCentered (void)
void | SetVertCentered (bool val)
bool | GetVertCentered (void) const
bool & | GetRefVertCentered (void)
void | SetScaleType (PrintScaleType val)
PrintScaleType | GetScaleType (void) const
PrintScaleType & | GetRefScaleType (void)
void | SetScale (double val)
double | GetScale (void) const
double & | GetRefScale (void)
void | SetHorizFit (bool val)
bool | GetHorizFit (void) const
bool & | GetRefHorizFit (void)
void | SetVertFit (bool val)
bool | GetVertFit (void) const
bool & | GetRefVertFit (void)
void | SetHPages (int val)
int | GetHPages (void) const
int & | GetRefHPages (void)
void | SetVPages (int val)
int | GetVPages (void) const
int & | GetRefVPages (void)

## Detailed Description

A base class for everything that might be printed.

Definition at line 58 of file printable.h.

## Constructor & Destructor Documentation

gcu::Printable::Printable | ( |  | ) |

The constructor.

virtual gcu::Printable::~Printable | ( |  | ) | `[virtual]`

The destructor.

## Member Function Documentation

virtual void gcu::Printable::DoPrint | ( | GtkPrintOperation * | print,
|  | GtkPrintContext * | context |
| ) |  |  | const`[pure virtual]`

Parameters:

  | print | a GtkPrintOperation*.
  | context | a GtkPrintContext*.

This is the method doing the real printing. It mustbe overloaded by derived classes and take parameters defined in gcu::Printable into account. Default implementation does not do anything.

Implemented in gcu::GLView, and gcp::Document.

virtual bool gcu::Printable::SupportsHeaders | ( |  | ) | `[inline, virtual]`

Derived classes supporting headers and footers must overload this method.

Returns:
  true if the document headers and footers. Default implementation returns false.

Definition at line 84 of file printable.h.

virtual bool gcu::Printable::SupportMultiplePages | ( |  | ) | `[inline, virtual]`

Derived classes able to print several pages must overload this method.

Returns:
  true if the document supports pagination. Default implementation returns false.

Definition at line 90 of file printable.h.

virtual GtkWindow* gcu::Printable::GetGtkWindow | ( |  | ) | `[pure virtual]`

Derived classes need to overload this pure virtual method.

Returns:
  the top level GtkWindow containing the document.

Implemented in gcu::GLView, and gcp::Document.

virtual int gcu::Printable::GetPagesNumber | ( |  | ) | `[inline, virtual]`

Derived classes able to print several pages must overload this method.

Returns:
  the page number for the document. Default implementation returns 1.

Definition at line 100 of file printable.h.

void gcu::Printable::Print | ( | bool | preview | ) |

Parameters:

  | preview | whether preview or real printing is requested.

Prints the documennt. It initializes printing, and then calls DoPrint.

void gcu::Printable::SetPageSetup | ( | GtkPageSetup * | PageSetup | ) |

Parameters:

  | PageSetup | a GtkPageSetup*.

This methods sets the page setup for the current printable object. Note that this does not increase the reference count of the GtkPageSetup*. The page setup will be unrefed when the Printable is destroyed or when a new page setup is set.

gcu::Printable::GetPrintSettings | ( | void |  | ) | `[inline]`

Returns:
  the GtkPrintSettings currently associated with the Printable instance.

  the GtkPageSetup currently associated with the Printable instance.

Definition at line 120 of file printable.h.

gcu::Printable::SetUnit | ( | GtkUnit | Unit | ) | `[inline]`

Parameters:

  | Unit | a GtkUnit.

Sets the current unit used in settings.

Definition at line 136 of file printable.h.

gcu::Printable::GetUnit | ( | void |  | ) | const`[inline]`

Returns:
  the current GtkUnit.

Definition at line 136 of file printable.h.

gcu::Printable::GetRefUnit | ( | void |  | ) | `[inline]`

Returns:
  the current GtkUnit as a reference.

Definition at line 136 of file printable.h.

gcu::Printable::SetHeaderHeight | ( | double | HeaderHeight | ) | `[inline]`

Parameters:

  | HeaderHeight | the height of the header.

Sets the height of the header to be printed on top of each page.

Definition at line 148 of file printable.h.

gcu::Printable::GetHeaderHeight | ( | void |  | ) | const`[inline]`

Returns:
  the current page header height.

Definition at line 148 of file printable.h.

gcu::Printable::GetRefHeaderHeight | ( | void |  | ) | `[inline]`

Returns:
  the current page header height as a reference.

Definition at line 148 of file printable.h.

gcu::Printable::SetFooterHeight | ( | double | FooterHeight | ) | `[inline]`

Parameters:

  | FooterHeight | the height of the header.

Sets the height of the footer to be printed at the bottom of each page.

Definition at line 160 of file printable.h.

gcu::Printable::GetFooterHeight | ( | void |  | ) | const`[inline]`

Returns:
  the current page footer height.

Definition at line 160 of file printable.h.

gcu::Printable::GetRefFooterHeight | ( | void |  | ) | `[inline]`

Returns:
  the current page footer height as a reference.

Definition at line 160 of file printable.h.

gcu::Printable::SetHorizCentered | ( | bool | HorizCentered | ) | `[inline]`

Parameters:

  | HorizCentered | whether to center horizontally or not.

Definition at line 171 of file printable.h.

gcu::Printable::GetHorizCentered | ( | void |  | ) | const`[inline]`

Returns:
  true if printing is horizontally centered.

Definition at line 171 of file printable.h.

gcu::Printable::GetRefHorizCentered | ( | void |  | ) | `[inline]`

Returns:
  a reference to the boolean indicating if printing is horizontally centered or not.

Definition at line 171 of file printable.h.

gcu::Printable::SetVertCentered | ( | bool | VertCentered | ) | `[inline]`

Parameters:

  | VertCentered | whether to center vertically or not.

Definition at line 182 of file printable.h.

gcu::Printable::GetVertCentered | ( | void |  | ) | const`[inline]`

Returns:
  true if printing is vertically centered.

Definition at line 182 of file printable.h.

gcu::Printable::GetRefVertCentered | ( | void |  | ) | `[inline]`

Returns:
  a reference to the boolean indicating if printing is vertically centered or not.

Definition at line 182 of file printable.h.

gcu::Printable::SetScaleType | ( | PrintScaleType | ScaleType | ) | `[inline]`

Parameters:

  | ScaleType | how to scale when printing.

Sets the printing scale type.

Definition at line 194 of file printable.h.

gcu::Printable::GetScaleType | ( | void |  | ) | const`[inline]`

Returns:
  the current printing scale type.

Definition at line 194 of file printable.h.

gcu::Printable::GetRefScaleType | ( | void |  | ) | `[inline]`

Returns:
  the current printing scale type as a reference.

Definition at line 194 of file printable.h.

gcu::Printable::SetScale | ( | double | Scale | ) | `[inline]`

Parameters:

  | Scale | the scale to use.

Sets the scale to use when the printing scale type is GCU_PRINT_SCALE_FIXED.

Definition at line 206 of file printable.h.

gcu::Printable::GetScale | ( | void |  | ) | const`[inline]`

Returns:
  the current scale.

Definition at line 206 of file printable.h.

gcu::Printable::GetRefScale | ( | void |  | ) | `[inline]`

Returns:
  the current scale as a reference.

Definition at line 206 of file printable.h.

gcu::Printable::SetHorizFit | ( | bool | HorizFit | ) | `[inline]`

Parameters:

  | HorizFit | whether to fill the page horizontally.

Definition at line 217 of file printable.h.

gcu::Printable::GetHorizFit | ( | void |  | ) | const`[inline]`

Returns:
  true if printing fills the page horizontally.

Definition at line 217 of file printable.h.

gcu::Printable::GetRefHorizFit | ( | void |  | ) | `[inline]`

Returns:
  a reference to the boolean indicating if printing fills the page horizontally.

Definition at line 217 of file printable.h.

gcu::Printable::SetVertFit | ( | bool | VertFit | ) | `[inline]`

Parameters:

  | VertFit | whether to fill the page vertically.

Definition at line 227 of file printable.h.

gcu::Printable::GetVertFit | ( | void |  | ) | const`[inline]`

vertically

Definition at line 227 of file printable.h.

gcu::Printable::GetRefVertFit | ( | void |  | ) | `[inline]`

Returns:
  a reference to the boolean indicating if printing fills the page vertically.

Definition at line 227 of file printable.h.

gcu::Printable::SetHPages | ( | int | HPages | ) | `[inline]`

Parameters:

  | HPages | the number of pages to which horizontally spread the print output.

Sets the full width in pages of the printing, when printing to several pages.

Definition at line 240 of file printable.h.

gcu::Printable::GetHPages | ( | void |  | ) | const`[inline]`

Returns:
  the current number of pages to which printing is horizontally spread.

Definition at line 240 of file printable.h.

gcu::Printable::GetRefHPages | ( | void |  | ) | `[inline]`

Returns:
  the current GtkUnnumber of pages to which printing is horizontally spread as a reference.

Definition at line 240 of file printable.h.

gcu::Printable::SetVPages | ( | int | VPages | ) | `[inline]`

Parameters:

  | VPages | the number of pages to which vertically spread the print output.

Sets the full height in pages of the printing, when printing to several pages.

Definition at line 253 of file printable.h.

gcu::Printable::GetVPages | ( | void |  | ) | const`[inline]`

Returns:
  the current number of pages to which printing is vertically spread.

Definition at line 253 of file printable.h.

gcu::Printable::GetRefVPages | ( | void |  | ) | `[inline]`

Returns:
  the current GtkUnnumber of pages to which printing is vertically spread as a reference.

Definition at line 253 of file printable.h.

The documentation for this class was generated from the following file:

- printable.h