NAME

dtRdr::GUI::Wx::BookView - view of an open book

SYNOPSIS

This contains the history, widget, book, tree, ...

Contructor

new

my $bv = dtRdr::GUI::Wx::BookView->new($book);

init

$bv->init($bvm);

_error

A shortcut.

$self->_error($message);

set_widgets

$bv->set_widgets(%args);

make_hooks

$bv->make_hooks($frame);

URL Handling

load_url

This serves as both a dispatch point (for onclick handlers) and as an external interface. In order to properly use the history, you should call this rather than the htmlwidget methods.

$is_handled = $bv->load_url($url);

refresh

Only if you're reading a book (for now.)

$self->refresh;

is_visible

Returns true if the TOC node is visible.

$bv->is_visible($node);

jump_to

Jump to an object (currently this must be an annotation, but all it needs to be is something which responds to id(), book(), and node() methods, where the value of id maps to an anchor name on the resultant page.)

$bv->jump_to($annotation);

show_note

$self->show_note($id);

set_requested_toc

$self->set_requested_toc($reqtoc);

utilities

selection_as_range

my $range = $bv->selection_as_range;

Annotations

highlight_at_selection

my $hl = $bv->highlight_at_selection;

Notes

note_at_selection

Create a note and launch the note editor.

my $nt = $bv->note_at_selection;

bookmark_at_selection

my $bm = $bv->bookmark_at_selection;

Notifications

annotation_created

$bv->annotation_created($anno);

annotation_changed

$bv->annotation_changed($anno);

annotation_deleted

$bv->annotation_deleted($anno);

Book Handling

render_node

Probably a private method -- else you break the history.

$bv->render_node($toc);

render_node_by_id

Because some book formats allow toc items to point to other nodes, book->find_toc is called to determine which node to render. This method is preferred over render_node() because it gives the book a chance to switcharoo the rendered node in the event of a reference/goto.

Sets requested_toc to the node given by $id, but sets current_toc to the found node and renders that.

$bv->render_node_by_id($id);

show_literal_section

$self->show_literal_section($id);

Up and Down

Renders the next or previous "page" of the book. This should be analogous to turning pages in a physical book.

notes

PageDown shows the next linear piece of content.

PageUp is the opposite of PageDown.

Ctrl+PageUp/down does a tree jump, staying on the same depth if possible.

Home/End do scrolling.

render_next_page

Moves to the next page in the book. Within a node, "page" is a relative term equal to one visible screen of content. At the end of the node, the "next node" will be loaded.

$bv->render_next_page

render_prev_page

Page-up in the widget. If at the top of the screen, load the (linearly) previous node and scroll to the bottom.

$bv->render_prev_page;

State Switching

freeze

$bv->freeze;

thaw

$bv->thaw;

History Methods

These take no arguments. The view has everything it needs to handle the moments.

history_back

$bv->history_back;

history_next

$bv->history_next;

_history_action

$self->_history_action($subref);

remember

$bv->remember;

history_add

Add the current url and position to the history (call this before moving onward.)

$self->history_add;

AUTHOR

Eric Wilhelm <ewilhelm at cpan dot org>

http://scratchcomputing.com/

COPYRIGHT

Copyright (C) 2006 Eric L. Wilhelm and OSoft, All Rights Reserved.

NO WARRANTY

Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.

LICENSE

The dotReader(TM) is OSI Certified Open Source Software licensed under the GNU General Public License (GPL) Version 2, June 1991. Non-encrypted and encrypted packages are usable in connection with the dotReader(TM). The ability to create, edit, or otherwise modify content of such encrypted packages is self-contained within the packages, and NOT provided by the dotReader(TM), and is addressed in a separate commercial license.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.