Class: TAbstractDocumentComponentCommandBinding

Declaration: CompoundDocumentCommand.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TCommandBinding

Inherited By:

TDocumentComponentCommandBinding

Purpose:

TAbstractDocumentComponentCommandBinding derives from TCommandBinding and is an abstract base class that defines protocol for document command and target binding. This class provides developers with a convenient abstraction for binding model or presentation state commands to targets. It also provides the benefit of allowing the commands to be managed by a document command history.

Instantiation:

Abstract base class; do not allocate.

Deriving Classes:

Derived classes must override the pure virtual functions: IsThisIncrementRequired, StreamOutIncrementDelta, StreamInIncrementDelta, HandleDo, HandleDoBegin, HandleDoIncrement, HandleDoEnd, HandleUndo, HandleRedo, HandleCommit, HandleGetUndoType, HandleCanDo, HandleCanUndo, HandleCanRedo, and HandleFixupDataBeforeDo.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TAbstractDocumentComponentCommandBinding::~TAbstractDocumentComponentCommandBinding

virtual ~ TAbstractDocumentComponentCommandBinding ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::GetReference

TCommandBindingReference GetReference () const

Interface Category:

API.

Purpose:

Returns a reference to this command binding.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to this command binding.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws a TInvalidVersionError if the version of the object on the stream is unknown to the version of the shared library installed.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::Do

virtual void Do ()

Interface Category:

API.

Purpose:

Does a command passing the bound target.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::DoBegin

virtual void DoBegin ()

Interface Category:

API.

Purpose:

Begins a command passing the bound target.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::DoIncrement

virtual void DoIncrement ()

Interface Category:

API.

Purpose:

Increments a command passing the bound target.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::DoEnd

virtual void DoEnd ()

Interface Category:

API.

Purpose:

Ends on the command previously begin with a bound target.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::Undo

virtual void Undo ()

Interface Category:

API.

Purpose:

Undoes a command passing a bound target.

Calling Context:

You can call this function directly after a command has been done.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::Redo

virtual void Redo ()

Interface Category:

API.

Purpose:

Redoes a command on the bound target.

Calling Context:

You can call this function directly after a command has been undone.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::Commit

virtual void Commit ()

Interface Category:

API.

Purpose:

Commits the command passing the bound target.

Calling Context:

You can call this function directly after a command has been, done, undone, redone.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::CanDo

virtual bool CanDo () const

Interface Category:

API.

Purpose:

Calls CanDo on a command passing the bound target.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the bound command returns true.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::CanUndo

virtual bool CanUndo () const

Interface Category:

API.

Purpose:

Calls CanUndo on a command passing the bound target.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the bound command returns true.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::CanRedo

virtual bool CanRedo () const

Interface Category:

API.

Purpose:

Calls CanRedo on a command passing the bound target.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if if the bound command returns true.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::IsThisIncrementRequired

virtual bool IsThisIncrementRequired () const

Interface Category:

API.

Purpose:

Indicates if the value of this increment of the command is necessary for reconstructing the command's execution.

Calling Context:

Called to determine if the command increment needs to be streamed to the command log.

Parameters:

Return Value:

Returns true if HandleIsThisIncrementRequired returns true.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::StreamOutIncrementDelta

virtual void StreamOutIncrementDelta (TStream &) const

Interface Category:

API.

Purpose:

Streams the change from a DoIncrement.

Calling Context:

Called to log the effects of an incremental command

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::StreamInIncrementDelta

virtual void StreamInIncrementDelta (TStream &)

Interface Category:

API.

Purpose:

Restores the effect of a DoIncrement from a stream.

Calling Context:

Called to stream in an incremental delta from a command log.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::FixupDataBeforeDo

void FixupDataBeforeDo ()

Interface Category:

API.

Purpose:

Fixes up the data before executing the command. This is used by commands that use model data that must be fixed up prior to passing the data to a target selection.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::TAbstractDocumentComponentCommandBinding

  1. TAbstractDocumentComponentCommandBinding ()
  2. TAbstractDocumentComponentCommandBinding (const TAbstractDocumentComponentCommandBinding &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

TAbstractDocumentComponentCommandBinding is an abstract base class--all the constructors are protected. Do not instantiate this class.

Member Function: TAbstractDocumentComponentCommandBinding::operator=

TAbstractDocumentComponentCommandBinding & operator =(const TAbstractDocumentComponentCommandBinding &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

Returns a const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

TAbstractDocumentComponentCommandBinding is an abstract base class--all the constructors are protected. Do not instantiate this class.

Member Function: TAbstractDocumentComponentCommandBinding::HandleDo

virtual void HandleDo ()

Interface Category:

API.

Purpose:

Performs the command. Derived classes override this function to implement the actual command.

Calling Context:

Called only from Do.

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 TAbstractDocumentComponentCommandBinding.

Member Function: TAbstractDocumentComponentCommandBinding::HandleDoBegin

virtual void HandleDoBegin ()

Interface Category:

API.

Purpose:

Starts command execution.

Calling Context:

Called by DoBegin after command state has been verified.

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 TAbstractDocumentComponentCommandBinding.

Member Function: TAbstractDocumentComponentCommandBinding::HandleDoIncrement

virtual void HandleDoIncrement ()

Interface Category:

API.

Purpose:

Performs incremental command functionality.

Calling Context:

Called by DoIncrement after command state has been verified.

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 TAbstractDocumentComponentCommandBinding.

Member Function: TAbstractDocumentComponentCommandBinding::HandleDoEnd

virtual void HandleDoEnd ()

Interface Category:

API.

Purpose:

Cleans up after command execution.

Calling Context:

Called by DoEnd after command state has been verified.

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 TAbstractDocumentComponentCommandBinding.

Member Function: TAbstractDocumentComponentCommandBinding::HandleUndo

virtual void HandleUndo ()

Interface Category:

API.

Purpose:

Undoes the effect of a reversible command.

Calling Context:

Called by Undo after command state has been verified.

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 TAbstractDocumentComponentCommandBinding.

Member Function: TAbstractDocumentComponentCommandBinding::HandleRedo

virtual void HandleRedo ()

Interface Category:

API.

Purpose:

Restores the effect of an undone command.

Calling Context:

Called by Redo after command state has been verified.

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 TAbstractDocumentComponentCommandBinding.

Member Function: TAbstractDocumentComponentCommandBinding::HandleCommit

virtual void HandleCommit ()

Interface Category:

API.

Purpose:

Commits a command that is in the done state.

Calling Context:

Called by Commit after the command state is determined to be Done.

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 TAbstractDocumentComponentCommandBinding.

Member Function: TAbstractDocumentComponentCommandBinding::HandleCanDo

virtual bool HandleCanDo () const

Interface Category:

API.

Purpose:

Returns whether or not the command is currently able to be executed.

Calling Context:

Called by CanDo after the state of the command has been verified.

Parameters:

Return Value:

Returns true if the command can be executed; false otherwise.

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 TAbstractDocumentComponentCommandBinding.

Member Function: TAbstractDocumentComponentCommandBinding::HandleCanUndo

virtual bool HandleCanUndo () const

Interface Category:

API.

Purpose:

Returns whether or not the effects of the command is currently able to be reversed.

Calling Context:

Called by CanUndo after the state of the command has been verified.

Parameters:

Return Value:

Returns true if the command can be reversed; false otherwise.

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 TAbstractDocumentComponentCommandBinding.

Member Function: TAbstractDocumentComponentCommandBinding::HandleCanRedo

virtual bool HandleCanRedo () const

Interface Category:

API.

Purpose:

Returns whether or not the effects of an undone command can currently be restored.

Calling Context:

Called by CanRedo after the state of the command has been verified.

Parameters:

Return Value:

Returns true if the command can be restored; false otherwise.

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 TAbstractDocumentComponentCommandBinding.

Member Function: TAbstractDocumentComponentCommandBinding::HandleFixupDataBeforeDo

virtual void HandleFixupDataBeforeDo ()

Interface Category:

API.

Purpose:

Fixes up the data before executing the command. This is used by commands that use model data that must be fixed up prior to passing the data to a target selection.

Calling Context:

Called only by FixupDataBeforeDo.

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 TAbstractDocumentComponentCommandBinding.

Member Function: TAbstractDocumentComponentCommandBinding::HandleGetUndoType

virtual TCommonCommand :: UndoType HandleGetUndoType () const

Interface Category:

API.

Purpose:

Return the undo type of the command contained in this binding. Must be overridden by derived classes.

Calling Context:

Called by GetUndoType.

Parameters:

Return Value:

TCommonCommand :: UndoType -The command's undo type.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentComponentCommandBinding::GetUndoType

virtual TCommonCommand :: UndoType GetUndoType () const

Interface Category:

API.

Purpose:

Provides access to the undo type of the bound command.

Calling Context:

Call this function directly.

Parameters:

Return Value:

TCommonCommand :: UndoType -The command's undo type.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.