TextBuffer Class Reference

#include <Ample.h>

Inheritance diagram for TextBuffer:
Inheritance graph
[legend]
Collaboration diagram for TextBuffer:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Observer
< TextBufferObserver
ObserverType
typedef std::vector
< TextBufferObserver * > 
ObserverList

Public Member Functions

void replaceRange (uint32 position, uint32 length, const std::string &text)
void destroy (void)
VBufferID getID (void) const
const std::string & getName (void) const
void setName (const std::string &name)
const std::string & getText (void) const
void setText (const std::string &text)
TextNodegetNode (void) const
unsigned int getDataVersion (void) const
unsigned int getStructureVersion (void) const
void addObserver (TextBufferObserver &observer)
void removeObserver (TextBufferObserver &observer)
void removeObserver (Observer< TextBufferObserver > &observer)
const ObserverListgetObservers (void) const

Friends

class Session
class TextNode

Detailed Description

Text node buffer class. Represents a single buffer in a text node.


Member Typedef Documentation

typedef std::vector<TextBufferObserver *> ObserverList [inherited]
typedef Observer<TextBufferObserver > ObserverType [inherited]

Member Function Documentation

void addObserver ( TextBufferObserver observer  )  [inline, inherited]

Adds the specified observer to this object.

Parameters:
observer The observer to add.
Remarks:
An observer can only be added once. Additional additions are ignored.
void destroy ( void   ) 

Destroys this text buffer.

Remarks:
This call is asynchronous. It will not take effect until, at the earliest, after the first subsequent call to Session::update.
unsigned int getDataVersion ( void   )  const [inherited]
Returns:
The current version of the internal state.
Remarks:
This value is updated for any kind of change.
VBufferID getID ( void   )  const
Returns:
The ID of this text buffer.
const std::string& getName ( void   )  const
Returns:
The name of this text buffer.
TextNode& getNode ( void   )  const
Returns:
The node containing this text buffer.
const ObserverList& getObservers ( void   )  const [inline, inherited]
Returns:
The list of observers attached to this object.
unsigned int getStructureVersion ( void   )  const [inherited]
Returns:
The current version of the internal structure.
Remarks:
This value is only updated when the internal structure changes.
const std::string& getText ( void   )  const
Returns:
The current contents of this text buffer.
void removeObserver ( Observer< TextBufferObserver > &  observer  )  [inline, inherited]

Removes the specified observer from this object.

Parameters:
observer The observer to remove.
void removeObserver ( TextBufferObserver observer  )  [inline, inherited]

Removes the specified observer from this object.

Parameters:
observer The observer to remove.
void replaceRange ( uint32  position,
uint32  length,
const std::string &  text 
)

Replaces the specified portion (range) with the specified string.

Parameters:
position The start of the range to replace.
length The number of characters to replace.
text The string to replace the specified range with.
Remarks:
This call is asynchronous. It will not take effect until, at the earliest, after the first subsequent call to Session::update.
void setName ( const std::string &  name  ) 

Changes the name of this text buffer.

Parameters:
name The desired name.
Remarks:
This call is asynchronous. It will not take effect until, at the earliest, after the first subsequent call to Session::update.
void setText ( const std::string &  text  ) 

Replaces the entire contents of this text buffer with the specified string.

Parameters:
text The desired contents.
Remarks:
This call is asynchronous. It will not take effect until, at the earliest, after the first subsequent call to Session::update.

Friends And Related Function Documentation

friend class Session [friend]

Reimplemented from Versioned.

friend class TextNode [friend]

Reimplemented from Versioned.


Generated on Thu Nov 19 20:19:27 2009 for Ample by  doxygen 1.6.1