Doc Class Reference

The Doc class extends AbstractModel and DomAccessibleState to provide the basis for a document model. More...

#include <doc.h>

Inheritance diagram for Doc:

AbstractModel DomAccessibleState MvcBase AttributeDoc ElementDoc Diagram List of all members.

Public Member Functions

 Doc (QObject *parent)
 Doc (const QString &name, QObject *parent)
DocControllerdocController () const
const QString & name () const
const QString & filename () const
bool isModified () const
virtual const QByteArray & key () const
virtual QDomElement domElement (QDomDocument &doc) const
virtual void initFromDomElement (const QDomElement &e, InitModeFlags modeFlags)

Static Public Member Functions

static const QByteArray & classKey ()

Protected Member Functions

virtual void customEvent (QEvent *e)
virtual void dispatchEvent (MEvent *)
virtual void changeControllerEvent (MChangeControllerEvent *)
virtual void renameEvent (MRenameEvent *)
virtual void changeFilenameEvent (MChangeFilenameEvent *)
virtual void changeModifiedStateEvent (MChangeModifiedStateEvent *)

Detailed Description

The Doc class extends AbstractModel and DomAccessibleState to provide the basis for a document model.

Warning: The doc controller must be set in order for instances of this doc class or any of its model classes to send messages back to it.s


Constructor & Destructor Documentation

Doc::Doc ( QObject *  parent  ) 

Default constructor.

Doc::Doc ( const QString &  name,
QObject *  parent 
)

Convenience constructor.


Member Function Documentation

DocController * Doc::docController (  )  const

Convenience method.

Returns a cached guarded pointer that has been dynamically cast to DocController* from AbstractController*.

See also AbstractModel::controller().

const QString& Doc::name (  )  const [inline]

const QString& Doc::filename (  )  const [inline]

bool Doc::isModified (  )  const [inline]

Returns true IFF there have been modifications to the project since it was last saved. The value of this variable is set by the ProjectController.

const QByteArray & Doc::classKey (  )  [static]

virtual const QByteArray& Doc::key (  )  const [inline, virtual]

Having this method as pure-virtual forces sub-classes to implement it, which is a requirement for both it and ther other methods to work correctly.

Sub-classes must return their version of classKey().

Implements DomAccessibleState.

QDomElement Doc::domElement ( QDomDocument &  doc  )  const [virtual]

Creates an XML QDomElement that represents the Doc.

Use initFromDOMElement() to restore the Doc state from the resulting QDomElement.

Reimplemented from DomAccessibleState.

Reimplemented in ElementDoc.

void Doc::initFromDomElement ( const QDomElement &  e,
InitModeFlags  modeFlags 
) [virtual]

Restore the Doc state from a QDomElement created by domElement().

CURRENT ASSUMPTION: If (mode & BuildObjectStrcuture)==1 then Doc is assumed and asserted to be currently empty!

Please see DomAccessibleState::initFromDomElement() for more information.

Note: Returns immediately if e.tagName() != typeName().

Reimplemented from DomAccessibleState.

Reimplemented in ElementDoc.

virtual void Doc::customEvent ( QEvent *  e  )  [inline, protected, virtual]

void Doc::dispatchEvent ( MEvent event  )  [protected, virtual]

The model's event dispatcher.

Warning! It is assumed that the events have their correct type set (as it uses static casts).

Asserts that the event is non-null.

Reimplemented from AbstractModel.

Reimplemented in AttributeDoc, and ElementDoc.

void Doc::changeControllerEvent ( MChangeControllerEvent event  )  [protected, virtual]

Re-implemented, as to also have the pointer returned by docController() updated.

Asserts that the event is non-null.

Reimplemented from AbstractModel.

Reimplemented in AttributeDoc, ElementDoc, and Diagram.

void Doc::renameEvent ( MRenameEvent event  )  [protected, virtual]

Changes the doc's name.

Asserts that the event is non-null.

void Doc::changeFilenameEvent ( MChangeFilenameEvent event  )  [protected, virtual]

Changes the doc's filename.

Asserts that the event is non-null.

void Doc::changeModifiedStateEvent ( MChangeModifiedStateEvent event  )  [protected, virtual]

Changes the doc's modification state. If "true", then it will indicate that the doc has been modified since it was lasted saved.

Asserts that the event is non-null.


The documentation for this class was generated from the following files:
Generated on Mon Jul 30 09:46:52 2007 for Digest by  doxygen 1.5.2