ubit::UDoc Class Reference

Generic Document. More...

#include <udoc.hpp>

Inheritance diagram for ubit::UDoc:

ubit::UVbox ubit::UBox ubit::UGroup ubit::UControl ubit::UBrick ubit::UObject ubit::UFlatDoc ubit::UPluginDoc ubit::UXmlDoc List of all members.

Public Member Functions

virtual bool isEditable () const
virtual void setEditable (bool state=true)
virtual const UStrgetPath () 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 UDocFactorygetDefaultFactory ()
 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

Detailed Description

Generic Document.

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


Member Function Documentation

virtual int ubit::UDoc::loadAttachments ( bool  reload = false  )  [virtual]

loads the attachments.

Reimplemented in ubit::UXmlDoc.

void ubit::UDoc::makePath ( UStr fullpath,
const UStr url 
) [virtual]

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))
 


The documentation for this class was generated from the following files:
Generated on Mon Jan 29 00:20:48 2007 for Ubit by  doxygen 1.4.7