Class: TModelSelection

Declaration: CompoundDocument.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TGUIModelSelectionFor TDocumentTextSelection TGUIEmbedderModelSelection TStandardCanvasModelSelection

Purpose:

Specifies the model data that is to be the target of a model command.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TModelSelection is derived from to create an appropriate selection for the associate TModel derived class. Usually, derived classes will add protocol and implementation for selecting content of the model.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TModelSelection::TModelSelection

  1. TModelSelection (const TModelReference & theModel)
  2. TModelSelection (const TModelSelection &)
  3. TModelSelection ()

Interface Category:

API.

Purpose:

  1. Constructs a selection on the model specified by the model reference.
  2. Copy constructor.
  3. Default constructor. This is only for internal use by Resurrect. This function is protected.

Calling Context:

  1. Call this function directly.
  2. Called to copy an object. You can also call this function directly.
  3. Only for internal use by Resurrect.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::~TModelSelection

virtual ~ TModelSelection ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object. You can also 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: TModelSelection::DeselectAll

virtual void DeselectAll ()

Interface Category:

API.

Purpose:

Resets the selection so that it no longer specifies any model data.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion ( IsDefined() ==true ). Postconditions: Assertion ( IsEmpty() ==true ).

Member Function: TModelSelection::SelectWholeModel

virtual void SelectWholeModel ()

Interface Category:

API.

Purpose:

Selects all the information contained in the model including its anchors and links.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Postconditions: Assertion ( IsDefined() ==true ).

Member Function: TModelSelection::SetUndefined

virtual void SetUndefined ()

Interface Category:

API.

Purpose:

Marks this selection as being undefined. It does not specify any model insertion point or model data.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Postconditions: Assertion ( IsDefined() ==false ).

Member Function: TModelSelection::SelectDefault

virtual void SelectDefault ()

Interface Category:

API.

Purpose:

Makes a default selection on this model's data.

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: TModelSelection::SelectAnchor

virtual void SelectAnchor (const TModelAnchorReference &)

Interface Category:

API.

Purpose:

Selects the anchor.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Postconditions: Assertion ( IsDefined() ==true ).

Member Function: TModelSelection::DeselectAnchor

virtual void DeselectAnchor (const TModelAnchorReference &)

Interface Category:

API.

Purpose:

Removes the anchor from the 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:

Preconditions: Assertion ( IsDefined() ==true ). Invariants: Assertion ( IsDefined() ==true ).

Member Function: TModelSelection::DeselectAllAnchors

virtual void DeselectAllAnchors ()

Interface Category:

API.

Purpose:

Removes all anchors from the 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:

Preconditions: Assertion ( IsDefined() ==true ). Invariants: Assertion ( IsDefined() ==true ).

Member Function: TModelSelection::ExtendSelectionToStart

virtual void ExtendSelectionToStart ()

Interface Category:

API.

Purpose:

Extends the selection to the start of the model's data. The meaning of start is model dependent.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion ( IsDefined() ==true ). Invariants: Assertion ( IsDefined() ==true ).

Member Function: TModelSelection::ExtendSelectionToEnd

virtual void ExtendSelectionToEnd ()

Interface Category:

API.

Purpose:

Extends the selection to the end of the model's data. The meaning of end is model dependent.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion ( IsDefined() ==true ). Invariants: Assertion ( IsDefined() ==true ).

Member Function: TModelSelection::GetModelReference

TModelReference GetModelReference () const

Interface Category:

API.

Purpose:

Returns a reference to the model this selection selects.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the model selected by this selection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion ( IsDefined() ==true ). Invariants: Assertion ( IsDefined() ==true ).

Member Function: TModelSelection::CreateAnchor

virtual TModelAnchor * CreateAnchor () const

Interface Category:

API.

Purpose:

Anchorizes the selection. That is, it creates an anchor that uses a duplicate of this selection to mark the same data.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a model anchor containing a copy of this selection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion ( IsDefined() ==true ). Invariants: Assertion ( IsDefined() ==true ).

Member Function: TModelSelection::IsReadable

virtual bool IsReadable () const

Interface Category:

API.

Purpose:

Tells the client whether the selected model data is readable. This is used by the copy and push data commands.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the data can be read.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::IsAnnotatable

virtual bool IsAnnotatable () const

Interface Category:

API.

Purpose:

Indicates whether the selection's data can be annotated.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the selection's data can be annotated.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::IsWriteable

virtual bool IsWriteable () const

Interface Category:

API.

Purpose:

Tells whether the selected data can be modified. This is used by commands such as paste.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the selected data can be modified.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::IsOrphanable

virtual bool IsOrphanable () const

Interface Category:

API.

Purpose:

Tells whether the selected data can be removed. This is used by commands such as cut.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the data can be orphaned.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::IsAnchorable

virtual bool IsAnchorable () const

Interface Category:

API.

Purpose:

Indicates whether the selection can be anchorized.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the selection can be anchorized.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::IsEmpty

virtual bool IsEmpty () const

Interface Category:

API.

Purpose:

Determines whether the selection specifies any data.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the selection does not specify any data.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::IsDefined

virtual bool IsDefined () const

Interface Category:

API.

Purpose:

Tells whether this selection is a valid defined selection.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the selection is a defined selection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::GetSelectedAnchorCount

virtual unsigned long GetSelectedAnchorCount () const

Interface Category:

API.

Purpose:

Determines how many anchors have been selected.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the number of selected anchors.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::IsAnchorSelected

virtual bool IsAnchorSelected (const TModelAnchorReference &) const

Interface Category:

API.

Purpose:

Tells whether the anchor referred to by the passed-in anchor reference has been selected by this selection.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the associated anchor has been selected by this selection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::GetSelectedAnchors

virtual void GetSelectedAnchors (TCollectionOf<TModelAnchorReference> &) const

Interface Category:

API.

Purpose:

Gets the collection of anchor references to anchors that have been selected.

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: TModelSelection::GetSubselections

virtual void GetSubselections (TSequenceOf<TModelSelection>&) const

Interface Category:

API.

Purpose:

A selection can have subselections that specify a portion of the total data that is selected. Such a case occurs when a selection includes a child component. Here the selection can have a subselection specifying the model data before the selected child, a subselection on the child model (not document component), and a subselection on the model data after the child component. In this case, GetSubselections returns with the sequence containing copies of the three subselections in it. If a selection does not have any subselections, then it simply places a duplicate of itself in the TSequence. In any case, the TSequence contains a flatten list of subselections. The caller owns both the collection and the subselections.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns an ordered collection containing all the subselections.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion (IsDefined() ==true ).

Member Function: TModelSelection::operator=

TModelSelection & operator =(const TModelSelection &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object. You can also call this function directly.

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:

None.

Member Function: TModelSelection::operator>>=

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

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data. You can also call this function directly.

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: TModelSelection::operator<<=

virtual TStream & operator <<= (TStream & fromwhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data. You can also call this function directly.

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: TModelSelection::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Generates a hash value.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the hash value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::GetModelForWriting

TModel* GetModelForWriting () const

Interface Category:

API.

Purpose:

Returns a pointer to the associated TModel instance.

Calling Context:

Called by derived classes of TModelSelection.

Parameters:

Return Value:

Returns a pointer to the associated TModel instance.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::GetModelForReading

const TModel* GetModelForReading () const

Interface Category:

API.

Purpose:

Returns a const pointer to the associated TModel instance.

Calling Context:

Called by derived classes of TModelSelection.

Parameters:

Return Value:

Returns a const pointer to the associated TModel instance.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::SetState

virtual void SetState (EState)

Interface Category:

API.

Purpose:

Sets the state of the selection. It can be kUndefined, kEmpty, or kNotEmpty.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::GetState

EState GetState () const

Interface Category:

API.

Purpose:

Gets the state of the selection. It can be kUndefined, kEmpty, or kNotEmpty.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

The current selection state.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::SetModelReference

void SetModelReference (const TModelReference&)

Interface Category:

API.

Purpose:

Sets the model specified by this selection.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSelection::IsEqual

virtual bool IsEqual (const MCollectible *) const

Interface Category:

API.

Purpose:

Compares two model selections for equality.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

Returns true if the other collection is the same kind of model selection and selects the same data.

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.