Class: TSimpleTextStore

Declaration: SimpleTextStore.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible, MTextRepresentation

Inherited By:

None.

Purpose:

TSimpleTextStore is a lightweight concrete class derived from MTextRepresentation that provides storage for text that is not model-based. It uses a TNotifier for change notification. It does not provide synchronized access to the text.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This class is designed to be used directly.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TSimpleTextStore::TSimpleTextStore

  1. TSimpleTextStore ()
  2. TSimpleTextStore (TText * textToAdopt)
  3. TSimpleTextStore (const TText& textToCopy)
  4. TSimpleTextStore (const TSimpleTextStore &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Constructs a simple text storage object containing the specified text.
  3. Constructs a simple text storage object containing a copy of the specified text.
  4. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to construct a simple text store containing the specified text.
  3. Called to construct a simple text store containing a copy of the specified text.
  4. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextStore::~TSimpleTextStore

virtual ~ TSimpleTextStore ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextStore::operator=

TSimpleTextStore & operator =(const TSimpleTextStore &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

A non-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: TSimpleTextStore::operator>>=

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

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

May be called directly by clients.

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

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

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

Exceptions:

Throws TInvalidVersionError if the object has detected an unsupportable version during the stream-in process.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextStore::HandleReplaceText

virtual void HandleReplaceText (const TText & textToInsert, const TTextArea & whatToRemoveBeforeInsert)

Interface Category:

API.

Purpose:

Replaces the text in the specified selection with the specified text. If the specified replacement text has a length of zero, this function simply deletes the specified selection. Any styling information already applied to the text argument is retained. Typing styles are not applied.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected, and overrides the inherited pure virtual function in MTextRepresentation.

Member Function: TSimpleTextStore::HandleRemoveText

virtual void HandleRemoveText (const TTextArea & whereToRemove)

Interface Category:

API.

Purpose:

Deletes the text in the specified selection. Called to delete a selection of text, for example, during backspacing over single characters or a highlighted selection.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected, and overrides the inherited pure virtual function in MTextRepresentation.

Member Function: TSimpleTextStore::HandleTypeText

virtual void HandleTypeText (const TText & textToInsert, const TTextArea & whereToInsert)

Interface Category:

API.

Purpose:

Inserts the specified text in the specified selection. If the selection has a length greater than 0, that selection of text is deleted before the new text is inserted. The typing styles appropriate for the specified selection are applied to the inserted text. This function is the same as the ReplaceText function except that it also applies the defined typing styles to text being inserted.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected, and overrides the inherited pure virtual function in MTextRepresentation.

Member Function: TSimpleTextStore::HandleAddStyles

virtual void HandleAddStyles (const TStyleSet & stylesToAdd, const TTextArea & whereToAdd, const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind ())

Interface Category:

API.

Purpose:

Applies the specified set of styles of the given kind to the specified selection of text. Called to apply character or paragraph styling information to a selection of text. Called by the AddStyles function of the MTextRepresentation base class.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected, and overrides the inherited pure virtual function in MTextRepresentation.

Member Function: TSimpleTextStore::HandleRemoveStyles

virtual void HandleRemoveStyles (const TStyleSet & stylesToRemove, const TTextArea & whereToRemove, const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind ())

Interface Category:

API.

Purpose:

Removes the specified set of styles of the given kind from the selected text. Called to remove specific styles from the specified selection of text. Called by the RemoveStyles function of the MTextRepresentation base class.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected, and overrides the inherited pure virtual function in MTextRepresentation.

Member Function: TSimpleTextStore::HandleReplaceStyles

virtual void HandleReplaceStyles (const TStyleSet & incomingStyles, const TTextArea & whereToReplace, const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind ())

Interface Category:

API.

Purpose:

Replaces the styling information of the given kind for the selected text with the specified style set. This function removes all existing styles before adding the specified style set. Called to replace the current style set for a selection of text with a new style set. Called by the ReplaceStyles function of the MTextRepresentation base class.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected, and overrides the inherited pure virtual function in MTextRepresentation.

Member Function: TSimpleTextStore::GetText

virtual const TText * GetText () const

Interface Category:

API.

Purpose:

Returns a pointer to a TText object reflecting the text contained by the representation. For synchronized access to text, use a read/write entry class, not this member function.

Calling Context:

Clients can call this function to obtain the TText pointer, then use TText API to read the text.

Parameters:

Return Value:

A pointer to the TText object contained by the simple text store.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited MTextRepresentation function.

Member Function: TSimpleTextStore::CreateTextSelection

virtual MTextSelection * CreateTextSelection () const

Interface Category:

API.

Purpose:

Creates an empty text selection on this simple text store.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

A pointer to the new text selection object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited MTextRepresentation function.

Member Function: TSimpleTextStore::GetTextChangedInterest

virtual const TInterest & GetTextChangedInterest () const

Interface Category:

API.

Purpose:

Returns the TInterest associated with this simple text store. Called to obtain the TInterest required to register for notification of changes to the text store.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

The TInterest object required to register for notification of changes to the text store.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited MTextRepresentation function.

Member Function: TSimpleTextStore::NotifyOfTextChanged

virtual void NotifyOfTextChanged (TTextNotification& notification)

Interface Category:

API.

Purpose:

Issues the specified notification to all objects registered to receive the notification (typically the view and the formatter). Uses a TNotifier for the connection. Called whenever the data in the simple text data store is changed. This function will most frequently be called by other functions in this representation after they make changes to the data in this representation.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function overrides the inherited MTextRepresentation function.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.