KitPrintOperation Class Reference

Prints the kitlist. More...

#include <printing.hpp>

List of all members.

Public Member Functions

void set_items (ItemContainer *items)
 Sets the list of items to be printed.
void set_page_title (const Glib::ustring page_title)
 ~KitPrintOperation ()
 Destructor.

Static Public Member Functions

static Glib::RefPtr
< KitPrintOperation
create ()
 Factory to create instances.

Protected Member Functions

layout_refptr new_header (const Glib::RefPtr< Gtk::PrintContext > &context)
layout_refptr new_footer (const Glib::RefPtr< Gtk::PrintContext > &context)
virtual void on_begin_print (const Glib::RefPtr< Gtk::PrintContext > &context)
virtual void on_draw_page (const Glib::RefPtr< Gtk::PrintContext > &context, int page_number)

Protected Attributes

layout_refptr m_ref_layout
 A layout to hold the body of the entire kitlist to be printed.
std::vector< int > m_page_breaks
 A list of line numbers where a page break is required.
std::vector< layout_refptrm_ref_headers
 A list of headers, one for each page.
std::vector< layout_refptrm_ref_footers
 A list of footers, one for each page.

Private Attributes

ItemContainerm_items
Glib::ustring m_page_title


Detailed Description

Prints the kitlist.

Definition at line 35 of file printing.hpp.


Constructor & Destructor Documentation

KitPrintOperation::~KitPrintOperation (  ) 

Destructor.

Definition at line 44 of file printing.cpp.

References m_items.


Member Function Documentation

Glib::RefPtr< KitPrintOperation > KitPrintOperation::create (  )  [static]

Factory to create instances.

Definition at line 51 of file printing.cpp.

Referenced by KitListGui::on_menu_export_to_pdf(), and KitListGui::on_menu_print().

void KitPrintOperation::set_items ( ItemContainer items  )  [inline]

Sets the list of items to be printed.

Definition at line 41 of file printing.hpp.

References m_items.

void KitPrintOperation::set_page_title ( const Glib::ustring  page_title  )  [inline]

Definition at line 42 of file printing.hpp.

References m_page_title.

layout_refptr KitPrintOperation::new_header ( const Glib::RefPtr< Gtk::PrintContext > &  context  )  [protected]

Creates a new header element for a page

Parameters:
context the print context

Definition at line 60 of file printing.cpp.

References m_page_title, and m_ref_headers.

Referenced by on_begin_print().

layout_refptr KitPrintOperation::new_footer ( const Glib::RefPtr< Gtk::PrintContext > &  context  )  [protected]

Creates a new footer element for a page

Parameters:
context the print context

Definition at line 82 of file printing.cpp.

References FOOTER_TEXT, and m_ref_footers.

Referenced by on_begin_print().

void KitPrintOperation::on_begin_print ( const Glib::RefPtr< Gtk::PrintContext > &  context  )  [protected, virtual]

Called prior to pages being printed. Calculates what is printed on each page.

Parameters:
context the print context

Definition at line 99 of file printing.cpp.

References BORDER_SPACING, FOOTER_SPACING, FOOTER_TEXT, Item::get_description(), HEADER_SPACING, m_items, m_page_breaks, m_ref_footers, m_ref_layout, new_footer(), new_header(), and PAGE_TOLERANCE.

void KitPrintOperation::on_draw_page ( const Glib::RefPtr< Gtk::PrintContext > &  context,
int  page_number 
) [protected, virtual]

Prints a specified page.

Parameters:
context the print context
page_number the number of the page to be printed

Definition at line 171 of file printing.cpp.

References BORDER_SPACING, HEADER_SPACING, m_page_breaks, m_ref_footers, m_ref_headers, and m_ref_layout.


Member Data Documentation

Definition at line 36 of file printing.hpp.

Referenced by on_begin_print(), set_items(), and ~KitPrintOperation().

Glib::ustring KitPrintOperation::m_page_title [private]

Definition at line 37 of file printing.hpp.

Referenced by new_header(), and set_page_title().

A layout to hold the body of the entire kitlist to be printed.

Definition at line 50 of file printing.hpp.

Referenced by on_begin_print(), and on_draw_page().

std::vector<int> KitPrintOperation::m_page_breaks [protected]

A list of line numbers where a page break is required.

Definition at line 52 of file printing.hpp.

Referenced by on_begin_print(), and on_draw_page().

A list of headers, one for each page.

Definition at line 54 of file printing.hpp.

Referenced by new_header(), and on_draw_page().

A list of footers, one for each page.

Definition at line 56 of file printing.hpp.

Referenced by new_footer(), on_begin_print(), and on_draw_page().


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

Copyright 2008-2010 Frank Dean