Zim::History.3pm

Langue: en

Version: 2009-03-16 (fedora - 05/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

Zim::History - History object for zim

SYNOPSIS

         use Zim::History;
         
         my $hist = Zim::History->new($HIST_FILE, $PAGEVIEW, $MAX_HIST);
         my $page_record = $hist->get_current;
 
 

DESCRIPTION

This object manages zim's page history. It keeps tree different stacks: one for the history, one for recently opened pages and one for the namespace.

The history stack is just the chronological order in which pages were opened.

The recent pages stack is derived from the history stack but avoids all redundancy.

The namespace stack keeps track of the namespaces you opened.

METHODS

"new(FILE, MAX, GUI)"
Constructor. Takes the name of the cache file as an argument and reads this cache file. MAX history records are stored in FILE.

The third argument is the GUI object. When a new record is made for the current page the "get_state()" method is called on this object to get state information that needs to be saved.

"set_GUI(GUI)"
Set GUI object.
"read"
Read the cache file.
"write"
Write the cache file.
"set_current(PAGE)"
Give the page object that is going to be displayed in the GUI. Set a new current before updating the GUI so the History object has time to save the state of the GUI. Returns the history record of the page.
"get_current()"
Returns the current history object.
"delete_recent(PAGE)"
Deletes the entry for PAGE from the recent pages stack.
"back(INT)"
Go back one or more steps in the history stack. Returns the record for this step or undef on failure.
"forw(INT)"
Go forward one or more steps in the history stack. Returns the record for this step or undef on failure.
"jump(NAME)"
Go to page NAME in the history stack.
"get_history()"
Returns an integer followed by a list of all records in the history stack. The integer is the index of the current page in this stack.
"get_recent()"
Returns an integer followed by a list of all records in the recent pages stack. The integer is the index of the current page in this stack.
"get_namespace"
This method matches the namespace of the current page to that of pages in the history. The result can be used as a namespace stack.
"get_state()"
Returns a hash ref which contains numbers that tell how many items there are on the history and namespace stacks in either direction.
"get_record(PAGE)"
Returns the history record for a given page object or undef.

AUTHOR

Jaap Karssenberg (Pardus) <pardus@cpan.org>

Copyright (c) 2005 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO