#include <udoc.hpp>
Inheritance diagram for ubit::UDoc:
Public Member Functions | |
virtual bool | isEditable () const |
virtual void | setEditable (bool state=true) |
virtual const UStr & | getPath () const |
returns the pathname of the document. | |
virtual void | setPath (const UStr &path) |
virtual void | makePath (UStr &fullpath, const UStr &url) |
creates a full pathname from an attachment or an URL. | |
virtual const UDocAttachments * | getAttachments () const |
returns the objects (images, stylesheets, etc) that are attached to this document. | |
virtual int | loadAttachments (bool reload=false) |
loads the attachments. | |
virtual bool | loadAttachment (UDocAttachment *, bool reload=false) |
loads this attachment. | |
virtual void | onElementEvent (const UArgs &) |
detect events performed on active elements such as hyperlinks. | |
virtual void | dispatchEvent (UEvent &, const UStr *path) |
Static Public Member Functions | |
static UDocFactory & | getDefaultFactory () |
returns the default factory (for reading/creating documents). | |
Protected Member Functions | |
UDoc (const UStr &path) | |
NB: the constr is protected: use read() or a subclass to create a UDoc. | |
Friends | |
class | UDoc::Class |
a UDoc is just a tree (or acyclic graph) of various Ubit objects. It can be modified in the same way as other Ubit instance trees.
UDoc can't be instantiated directly, only appropriate subclasses can be (such as UXmlDoc, etc.)
UDocFactory::read() reads a document file and creates an instance of the appropriate UDoc subclass depending on the file suffix
virtual int ubit::UDoc::loadAttachments | ( | bool | reload = false |
) | [virtual] |
loads the attachments.
Reimplemented in ubit::UXmlDoc.
creates a full pathname from an attachment or an URL.
returns true if the fullname is a local filename. returns false otherwise (typically is the fullname starts with http:)
void ubit::UDoc::onElementEvent | ( | const UArgs & | ) | [virtual] |
detect events performed on active elements such as hyperlinks.
example:
doc->onElementEvent( UOn::enter/ucall(arg1, func1) + UOn::action/ucall(arg2, func2))