Class: MCompoundDocument

Declaration: CompoundDocument.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TCompoundDocument TCompoundDocumentSurrogate

Purpose:

MCompoundDocument extends the behavior of TDocument to provide support for a hierarchy of document documents. Compound Document also adds support to command history and the save-always operation.

Instantiation:

Abstract base class; do not instantiate.

Deriving Classes:

MCompoundDocument is mixed into TCompoundDocument and TCompoundDocumentSurrogate to provide common API for compound documents. Do not derive from this class.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: MCompoundDocument::GetRootComponentReference

virtual TDocumentComponentReference GetRootComponentReference () const

Interface Category:

API.

Purpose:

Provides access to the root document component of the document. A compound document is a hierarchy of document components. The root component is owned and managed by the document.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to the root component of the document.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from MCompoundDocument.

Member Function: MCompoundDocument::GetRootModelReference

virtual TModelReference GetRootModelReference () const

Interface Category:

API.

Purpose:

Provides access to the model in the root document component of the document. A compound document is a hierarchy of document components. The root component is owned and managed by the document.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to the model in the root component of the document.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from MCompoundDocument.

Member Function: MCompoundDocument::GetRootPresenterStateReference

virtual TPresenterStateReference GetRootPresenterStateReference () const

Interface Category:

API.

Purpose:

Provides access to the presenter state in the root document component of the document. A compound document is a hierarchy of document components. The root component is owned and managed by the document.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns reference to the presenter state in the root component of the document.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from MCompoundDocument.

Member Function: MCompoundDocument::AdoptAndDo

virtual void AdoptAndDo (TAbstractDocumentComponentCommandBinding *)

Interface Category:

API.

Purpose:

Adopts a document component command binding and executes it. The binding contains a command and a target, which can be a model selection or a presenter state selection. Modify document data only using commands. The command is added to the document history if it modifies the document and is undoable. If it modifies the document and is not undoable, the document history is cleared.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from MCompoundDocument.

Member Function: MCompoundDocument::DoBegin

virtual void DoBegin (TAbstractDocumentComponentCommandBinding &)

Interface Category:

API.

Purpose:

Takes an incremental command and begins execution. The binding contains a command and a target, which can be a model selection or a presenter state selection. Modify document data only using commands. The command is added to the document history if it modifies the document and is undoable. If it modifies the document and is not undoable, the document history is cleared. Only one incremental command can be outstanding at any one time. If another command is started, the currently executing incremental command is automatically ended.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from MCompoundDocument.

Member Function: MCompoundDocument::DoIncrement

virtual void DoIncrement (TAbstractDocumentComponentCommandBinding &)

Interface Category:

API.

Purpose:

Takes an incremental command and continues execution. The command binding must be the same binding used in a previous DoBegin.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TCompoundDocumentException::kExpectedDoBegin if DoBegin was not previously called for this command.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from MCompoundDocument. Preconditions: Assertion (DoBegin previously called for this command).

Member Function: MCompoundDocument::AdoptAndDoEnd

virtual void AdoptAndDoEnd (TAbstractDocumentComponentCommandBinding *)

Interface Category:

API.

Purpose:

Adopts an incremental command and ends execution. The command binding must be the same binding used in a previous DoBegin.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TCompoundDocumentException::kExpectedDoBegin if DoBegin was not previously called for this command.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from MCompoundDocument. Preconditions: Assertion (DoBegin previously called for this command).

Member Function: MCompoundDocument::GetUndoRedoStatus

virtual void GetUndoRedoStatus (bool & undoAllowed, bool & redoAllowed) const

Interface Category:

API.

Purpose:

Returns the status on the availability of commands in the command history for undo and redo.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from MCompoundDocument.

Member Function: MCompoundDocument::HistoryUndo

virtual void HistoryUndo ()

Interface Category:

API.

Purpose:

Undoes the last command done for the document. This undoes the last command completed or an incremental command that is still in progress. The incremental command is ended before it is undone.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws kNoCommandsToUndo if a command is not available for undo.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from MCompoundDocument. Preconditions: Assertion(GetUndoRedoStatus returns undoAllowed ==true).

Member Function: MCompoundDocument::HistoryRedo

virtual void HistoryRedo ()

Interface Category:

API.

Purpose:

Redoes the last command undone for the document.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws kNoCommandsToRedo if a command is not available for redo.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from MCompoundDocument. Preconditions: Assertion(GetUndoRedoStatus returns redoAllowed ==true).
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.