Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::TextModel Class Reference

The TextModel is a model interface for working with text data. More...

#include <vcf/ApplicationKit/TextModel.h>

Inheritance diagram for VCF::TextModel:

VCF::DefaultTextModel List of all members.

Public Types

enum  TextModelEvents { tmTextInserted = VCF::Model::MODEL_CHANGED + 3210, tmTextReplaced, tmTextSet, tmTextRemoved }

Public Member Functions

 TextModel ()
virtual ~TextModel ()
virtual void addTextModelChangedHandler (EventHandler *handler)=0
 adds a new TextModelEvent handler
virtual void removeTextModelChangedHandler (EventHandler *handler)=0
 removes a TextModelEvent handler
virtual void setText (const String &text)=0
 sets the contents of the text model, completely changes what was previously in the model
virtual void insertText (const uint32 &index, const String &text)=0
 inserts text into the model at the given index
virtual void replaceText (const uint32 &index, const uint32 &count, const String &text)=0
 replace text into the model in place of the selected text is any, or at the current position otherwise
virtual void deleteText (const uint32 &index, const uint32 &count)=0
 deletes text from the model, starting at index, and continuing for count characters, or until the text data is empty.
virtual String getText ()=0
 returns all of the TextModel's text in a string.
virtual String getText (const uint32 &index, const uint32 &count)=0
 returns a sub string of the TextModel's text in a string.
virtual uint32 getSize ()=0
 returns the size of the TextModel.

Detailed Description

The TextModel is a model interface for working with text data.

It does not inherit from the Model class directly. This is to allow different implementations different base classes. For example, you might have a simple list model that inherits/implements the Model class, and the ListModel class. This would be suitable for most controls. However you might want a fancier implementation, perhaps that is based off of the Document and ListModel classes. This would still allow you to use the same control with either style.

Version:
1.0
Author:
Jim Crafton


Member Enumeration Documentation

enum VCF::TextModel::TextModelEvents
 

Enumerator:
tmTextInserted 
tmTextReplaced 
tmTextSet 
tmTextRemoved 


Constructor & Destructor Documentation

VCF::TextModel::TextModel  )  [inline]
 

virtual VCF::TextModel::~TextModel  )  [inline, virtual]
 


Member Function Documentation

virtual void VCF::TextModel::addTextModelChangedHandler EventHandler handler  )  [pure virtual]
 

adds a new TextModelEvent handler

Implemented in VCF::DefaultTextModel.

virtual void VCF::TextModel::deleteText const uint32 index,
const uint32 count
[pure virtual]
 

deletes text from the model, starting at index, and continuing for count characters, or until the text data is empty.

Parameters:
uint32 the starting point. The index is zero based.
uint32 the number of characters to delete

Implemented in VCF::DefaultTextModel.

virtual uint32 VCF::TextModel::getSize  )  [pure virtual]
 

returns the size of the TextModel.

That is the number of charecters in text string that this model represents.

Implemented in VCF::DefaultTextModel.

virtual String VCF::TextModel::getText const uint32 index,
const uint32 count
[pure virtual]
 

returns a sub string of the TextModel's text in a string.

Implemented in VCF::DefaultTextModel.

virtual String VCF::TextModel::getText  )  [pure virtual]
 

returns all of the TextModel's text in a string.

Implemented in VCF::DefaultTextModel.

virtual void VCF::TextModel::insertText const uint32 index,
const String text
[pure virtual]
 

inserts text into the model at the given index

Parameters:
uint32 the starting point to begin inserting the text. This number represents a zero based index.
String the text to insert

Implemented in VCF::DefaultTextModel.

virtual void VCF::TextModel::removeTextModelChangedHandler EventHandler handler  )  [pure virtual]
 

removes a TextModelEvent handler

Implemented in VCF::DefaultTextModel.

virtual void VCF::TextModel::replaceText const uint32 index,
const uint32 count,
const String text
[pure virtual]
 

replace text into the model in place of the selected text is any, or at the current position otherwise

Parameters:
String the text to replace with

Implemented in VCF::DefaultTextModel.

virtual void VCF::TextModel::setText const String text  )  [pure virtual]
 

sets the contents of the text model, completely changes what was previously in the model

Implemented in VCF::DefaultTextModel.


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information