Maliit Plugins  0.92.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Private Attributes
MaliitKeyboard::Model::Text Class Reference

Represents the text state of the editor. More...

#include <text.h>

List of all members.

Public Member Functions

 Text ()
 offset of cursor position in surrounding text.
QString preedit () const
 Returns current preedit.
void setPreedit (const QString &preedit)
void appendToPreedit (const QString &appendix)
void commitPreedit ()
QString surrounding () const
 Returns text surrounding cursor position.
QString surroundingLeft () const
 Returns text left of cursor position. Depends on surroundingOffset.
QString surroundingRight () const
 Returns text right of cursor position. Depends on surroundingOffset.
void setSurrounding (const QString &surrounding)
uint surroundingOffset () const
 Returns offset of cursor position in surrounding text.
void setSurroundingOffset (uint offset)

Private Attributes

QString m_preedit
 current text segment that is edited.
QString m_surrounding
 text to left and right side of cursor position, in current text block.
uint m_surrounding_offset

Detailed Description

Represents the text state of the editor.

To avoid needless copying and to keep synchronization between consumers of this model simple, the master copy is shared as SharedText between AbstractTextEditor, LayoutUpdater and WordEngine. The model itself is a passive component; users of this model are responsible for notifying other users whenever they update the shared master copy.


Constructor & Destructor Documentation

MaliitKeyboard::Model::Text::Text ( )
explicit

offset of cursor position in surrounding text.

C'tor


Member Function Documentation

void MaliitKeyboard::Model::Text::appendToPreedit ( const QString &  appendix)

Append to preedit.

Parameters:
appendixthe string to append to current preedit.
void MaliitKeyboard::Model::Text::commitPreedit ( )

Commits current preedit. Insert preedit into surrounding text and updates surrounding offset to match expected cursor position.

QString MaliitKeyboard::Model::Text::preedit ( ) const

Returns current preedit.

void MaliitKeyboard::Model::Text::setPreedit ( const QString &  preedit)

Set current preedit.

Parameters:
preeditthe updated preedit.
void MaliitKeyboard::Model::Text::setSurrounding ( const QString &  surrounding)

Set text surrounding cursor position.

Parameters:
surroundingthe updated surrounding text.
void MaliitKeyboard::Model::Text::setSurroundingOffset ( uint  offset)

Set offset of cursor position in surrounding text. Affects surroundingLeft and surroundingRight.

Parameters:
offsetthe updated offset.
QString MaliitKeyboard::Model::Text::surrounding ( ) const

Returns text surrounding cursor position.

QString MaliitKeyboard::Model::Text::surroundingLeft ( ) const

Returns text left of cursor position. Depends on surroundingOffset.

uint MaliitKeyboard::Model::Text::surroundingOffset ( ) const

Returns offset of cursor position in surrounding text.

QString MaliitKeyboard::Model::Text::surroundingRight ( ) const

Returns text right of cursor position. Depends on surroundingOffset.


Member Data Documentation

QString MaliitKeyboard::Model::Text::m_preedit
private

current text segment that is edited.

QString MaliitKeyboard::Model::Text::m_surrounding
private

text to left and right side of cursor position, in current text block.

uint MaliitKeyboard::Model::Text::m_surrounding_offset
private

The documentation for this class was generated from the following files: