Class: TDocumentComponentCommandBinding

Declaration: CompoundDocumentCommand.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TAbstractDocumentComponentCommandBinding

Inherited By:

TDocumentComponentCommandBindingTo TDocumentComponentToolCommandBinding TGUIToolCommandBinding

Purpose:

Provides a binding for commands applied to data contained in a document component and compatible targets. Targets may be a TModelSelection, TPresenterStateSelection, or a TCommandBindingReference.

Instantiation:

Always allocate on the heap. Ownership of the command binding is handed off to the document for execution.

Deriving Classes:

Do not derive from this class. Derive from TDocumentComponentCommandBindingTo instead.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Invariants:

The command and target bound to the binding is never replaced.

Member Function: TDocumentComponentCommandBinding::~TDocumentComponentCommandBinding

virtual ~ TDocumentComponentCommandBinding ()

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: TDocumentComponentCommandBinding::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: TDocumentComponentCommandBinding::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: TDocumentComponentCommandBinding::TDocumentComponentCommandBinding

  1. TDocumentComponentCommandBinding (TCommonCommand * adoptCommand, const TModelAnchorReference &, EAnchorUse =kUseSelection)
  2. TDocumentComponentCommandBinding (TCommonCommand * adoptCommand)
  3. TDocumentComponentCommandBinding ()
  4. TDocumentComponentCommandBinding (const TDocumentComponentCommandBinding &)

Interface Category:

API.

Purpose:

  1. Creates a binding bound the specified command, whose target is the specified anchor.
  2. Creates a binding bound the specified command.
  3. Default constructor.
  4. Copy constructor.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.
  3. Only for internal use by Resurrect. Developers should treat as protected.
  4. Called to copy an object. Only for internal use by Resurrect. Developers should treat as protected.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

All the constructors for this class are protected.

Member Function: TDocumentComponentCommandBinding::operator=

TDocumentComponentCommandBinding & operator =(const TDocumentComponentCommandBinding &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

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:

This operator is protected.

Member Function: TDocumentComponentCommandBinding::GetPresenterSelection

  1. TPresenterStateSelection * GetPresenterSelection ()
  2. const TPresenterStateSelection * GetPresenterSelection () const

Interface Category:

API.

Purpose:

  1. Returns the presenter state selection, if one is bound to this command.
  2. Returns a const pointer to the presenter state selection, if one is bound to this command.

Calling Context:

  1. Called only from derived classes.
  2. Called only from derived classes.

Parameters:

Return Value:

  1. Returns the presenter state selection, if one is bound to this command. Returns NIL if no presenter state selection is bound to this object.
  2. Returns a const pointer to the presenter state selection, if one is bound to this command. Returns NIL if no presenter state selection is bound to this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDocumentComponentCommandBinding::GetCommonCommand

  1. TCommonCommand * GetCommonCommand ()
  2. const TCommonCommand * GetCommonCommand () const

Interface Category:

API.

Purpose:

  1. Returns a pointer to the command to which this object is bound.
  2. Returns a const pointer to the command to which this object is bound.

Calling Context:

  1. Derived classes can call this function directly.
  2. Derived classes can call this function directly.

Parameters:

Return Value:

Returns a pointer to the command to which this object is bound.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected.

Member Function: TDocumentComponentCommandBinding::GetVoidTarget

  1. void * GetVoidTarget ()
  2. const void * GetVoidTarget () const

Interface Category:

API.

Purpose:

  1. Returns a pointer to the command's target.
  2. Returns a const pointer to the command's target.

Calling Context:

  1. Derived classes can call this function directly.
  2. Derived classes can call this function directly.

Parameters:

Return Value:

Returns a pointer to the command's target.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Postconditions: Assertion(theTarget != NIL)

Member Function: TDocumentComponentCommandBinding::BindTo

void BindTo (const TModelAnchorReference &, EAnchorUse =kUseSelection)

Interface Category:

API.

Purpose:

Binds this object to the specified anchor reference.

Calling Context:

Derived classes can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TCompoundDocumentException::kUndefinedAnchorID if the input parameter is NIL.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected.

Member Function: TDocumentComponentCommandBinding::AdoptAndBindToTarget

void AdoptAndBindToTarget (void * theTarget)

Interface Category:

API.

Purpose:

Adopts and binds to this command to the specified target.

Calling Context:

Derived classes can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TCompoundDocumentException:: kNILSelection if the input parameter is NIL. Throws TCompoundDocumentException::kTargetNotAcceptable if the input parameter is of the wrong type.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected.

Member Function: TDocumentComponentCommandBinding::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 protected.

Member Function: TDocumentComponentCommandBinding::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 protected.

Member Function: TDocumentComponentCommandBinding::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 protected.

Member Function: TDocumentComponentCommandBinding::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 protected.

Member Function: TDocumentComponentCommandBinding::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 protected.

Member Function: TDocumentComponentCommandBinding::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 protected.

Member Function: TDocumentComponentCommandBinding::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 protected.

Member Function: TDocumentComponentCommandBinding::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 protected.

Member Function: TDocumentComponentCommandBinding::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 protected.

Member Function: TDocumentComponentCommandBinding::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 protected.

Member Function: TDocumentComponentCommandBinding::HandleDo

virtual void HandleDo ()

Interface Category:

API.

Purpose:

Performs the 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 protected.

Member Function: TDocumentComponentCommandBinding::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: TDocumentComponentCommandBinding::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: TDocumentComponentCommandBinding::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: TDocumentComponentCommandBinding::GetModelSelection

  1. TModelSelection * GetModelSelection ()
  2. const TModelSelection * GetModelSelection () const

Interface Category:

API.

Purpose:

  1. Returns the bound model selection.
  2. Returns the const bound model selection.

Calling Context:

  1. Called by derived classes.
  2. Called by derived classes.

Parameters:

Return Value:

TModelSelection * -The bound model selection. Returns NIL if the command is bound to a TPresentatorStateSelection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDocumentComponentCommandBinding::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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.