The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Renard::Curie::Component::PageDrawingArea - Component that implements document page navigation

VERSION

version 0.001

EXTENDS

CONSUMES

ATTRIBUTES

document

The RenderableDocumentModel that this component displays.

current_rendered_page

A RenderablePageModel for the current page.

current_page_number

A PageNumber for the current page being drawn.

drawing_area

The Gtk3::DrawingArea that is used to draw the document on.

scrolled_window

The Gtk3::ScrolledWindow container for the "drawing_area".

METHODS

BUILD

  method BUILD

Initialises the component's contained widgets and signals.

setup_button_events

  method setup_button_events()

Sets up the signals for the navigational buttons.

setup_text_entry_events

  method setup_text_entry_events()

Sets up the signals for the text entry box so the user can enter in page numbers.

setup_drawing_area

  method setup_drawing_area()

Sets up the "drawing_area" so that it draws the current page.

setup_number_of_pages_label

  method setup_number_of_pages_label()

Sets up the label that shows the number of pages in the document.

setup_keybindings

  method setup_keybindings()

Sets up the signals to capture key presses on this component.

refresh_drawing_area

  method refresh_drawing_area()

This forces the drawing area to redraw.

set_current_page_forward

  method set_current_page_forward()

Increments the current page number if possible.

set_current_page_back

  method set_current_page_back()

Decrements the current page number if possible.

set_current_page_to_first

  method set_current_page_to_first()

Sets the page number to the first page of the document.

set_current_page_to_last

  method set_current_page_to_last()

Sets the current page to the last page of the document.

can_move_to_previous_page

  method can_move_to_previous_page() :ReturnType(Bool)

Predicate to check if we can decrement the current page number.

can_move_to_next_page

  method can_move_to_next_page() :ReturnType(Bool)

Predicate to check if we can increment the current page number.

set_navigation_buttons_sensitivity

  set_navigation_buttons_sensitivity()

Enables and disables forward and back navigation buttons when at the end and start of the document respectively.

CLASS METHODS

FOREIGNBUILDARGS

  classmethod FOREIGNBUILDARGS(@)

Initialises the Gtk3::Bin super-class.

FUNCTIONS

increment_scroll

  fun increment_scroll( (InstanceOf['Gtk3::Adjustment']) $current )

Helper function that scrolls down by the scrollbar's step increment.

decrement_scroll

  fun decrement_scroll( (InstanceOf['Gtk3::Adjustment']) $current )

Helper function that scrolls up by the scrollbar's step increment.

CALLBACKS

on_clicked_button_first_cb

  fun on_clicked_button_first_cb($button, $self)

Callback for when the "First" button is pressed. See "set_current_page_to_first".

on_clicked_button_last_cb

  fun on_clicked_button_last_cb($button, $self)

Callback for when the "Last" button is pressed. See "set_current_page_to_last".

on_clicked_button_forward_cb

  fun on_clicked_button_forward_cb($button, $self)

Callback for when the "Forward" button is pressed. See "set_current_page_forward".

on_clicked_button_back_cb

  fun on_clicked_button_back_cb($button, $self)

Callback for when the "Back" button is pressed. See "set_current_page_back".

on_key_press_event_cb

  fun on_key_press_event_cb($window, $event, $self)

Callback that responds to specific key events and dispatches to the appropriate handlers.

on_draw_page_cb

  method on_draw_page_cb( (InstanceOf['Cairo::Context']) $cr )

Callback that draws the current page on to the "drawing_area".

on_activate_page_number_entry_cb

  fun on_activate_page_number_entry_cb( $entry, $self )

Callback that is called when text has been entered into the page number entry.

AUTHOR

Project Renard

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Project Renard.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.