Kitlist
1.1.0
|
Prints the kitlist. More...
#include <printing.hpp>
Public Member Functions | |
void | set_items (ItemContainer *items) |
Sets the list of items to be printed. More... | |
void | set_page_title (const Glib::ustring page_title) |
~KitPrintOperation () | |
Destructor. More... | |
Static Public Member Functions | |
static Glib::RefPtr< KitPrintOperation > | create () |
Factory to create instances. More... | |
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. More... | |
std::vector< int > | m_page_breaks |
A list of line numbers where a page break is required. More... | |
std::vector< layout_refptr > | m_ref_headers |
A list of headers, one for each page. More... | |
std::vector< layout_refptr > | m_ref_footers |
A list of footers, one for each page. More... | |
Private Attributes | |
ItemContainer * | m_items |
Glib::ustring | m_page_title |
Prints the kitlist.
Definition at line 35 of file printing.hpp.
KitPrintOperation::~KitPrintOperation | ( | ) |
Destructor.
Definition at line 44 of file printing.cpp.
References m_items.
Referenced by set_page_title().
|
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().
|
protected |
Creates a new footer element for a page
context | the print context |
Definition at line 76 of file printing.cpp.
References FOOTER_TEXT, and m_ref_footers.
Referenced by on_begin_print(), and set_page_title().
|
protected |
Creates a new header element for a page
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(), and set_page_title().
|
protectedvirtual |
Called prior to pages being printed. Calculates what is printed on each page.
context | the print context |
Definition at line 93 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.
Referenced by set_page_title().
|
protectedvirtual |
Prints a specified page.
context | the print context |
page_number | the number of the page to be printed |
Definition at line 159 of file printing.cpp.
References BORDER_SPACING, HEADER_SPACING, m_page_breaks, m_ref_footers, m_ref_headers, and m_ref_layout.
Referenced by set_page_title().
|
inline |
Sets the list of items to be printed.
Definition at line 41 of file printing.hpp.
|
inline |
Definition at line 42 of file printing.hpp.
References new_footer(), new_header(), on_begin_print(), on_draw_page(), and ~KitPrintOperation().
|
private |
Definition at line 36 of file printing.hpp.
Referenced by on_begin_print(), and ~KitPrintOperation().
|
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().
|
private |
Definition at line 37 of file printing.hpp.
Referenced by new_header().
|
protected |
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().
|
protected |
A list of headers, one for each page.
Definition at line 54 of file printing.hpp.
Referenced by new_header(), and on_draw_page().
|
protected |
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().