Reference

Zim::Page::Text(3pm)

Zim::Page::Text - Page object for Zim This class defines a page object that represents a text buffer. This can either be a plain text or a formatted text (rich text). The interfaces supported by this class are "source" and "formatted". An individual object can have one of these or both. The source interface uses "IO::*" objects and requires the repository to support an interface for opening and closing these objects. The formatted interface uses parse trees to represent the logical structure of the text. If a formatted text also has a source, a formatter object ("Zim::Formats::*") is used to parse the source. Returns a list of interfaces supported by this page. Import content from object PAGE into this object using the first common interface found.
Source Interface SOURCE is a scalar used to fetch a "IO::*" object from the repository later. This can for example be a filename but also a complex structure containing all the parameters needed to open an IO object.

This method should only be used by the repository. The GUI is not allowed to know anything about the real source of pages, it can only use the IO objects resulting from "get_source(MODE)".

This method sets the 'read_only' property to FALSE. Returns an IO object or undef when there is none. This method dies when it fails opening a given source. In general pages that have status "new" will not yet have a source.

MODE is optional and can either be 'r' or 'w' depending on whether you would like the source to be opened for reading or for writing.

Do not forget to close the IO object when you are done with it !

( When using source the repository should also support the "get_source(SOURCE, MODE)" method. )
Formatted Interface Sets a source format for this page. This can either be an object of the class Zim::Formats (or similar), or a name in which case this will be looked up in the "Zim::Formats::*" namespace.

Formats are only used for pages that also have a source object. Get the parse tree for this page.

When using source this method will return the tree resulting from running the given source through the given formatter. Set the parse tree for this page.

When using source this method will use the formatter to save the parse tree to the IO object. Jaap Karssenberg (Pardus) <[email protected]> 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. Zim, Zim::Page, Zim::Formats, Zim::Repository