KVIrc  4.9.2
DeveloperAPIs
Public Types | Public Member Functions | Private Attributes | List of all members
KviInputEditor::EditCommand Class Reference

Holds the command used in the {un,re}do operations. More...

#include <KviInputEditor.h>

Public Types

enum  Type { InsertText, RemoveText }
 Defines the type of the command. More...
 

Public Member Functions

 EditCommand (Type eType, const QString &szText, int iStartPosition)
 Contructs the command object. More...
 
void setStartPosition (int iStartPosition)
 Sets the start position. More...
 
void setText (const QString &szText)
 Sets the text of the command. More...
 
void setType (const Type &eType)
 Sets the type of the command. More...
 
int startPosition () const
 Returns the start position. More...
 
const QString & text () const
 Returns the text of the command. More...
 
const Typetype () const
 Returns the type of the command. More...
 

Private Attributes

Type m_eType
 The type of the command. More...
 
int m_iStartPosition
 The start position. More...
 
QString m_szText
 The text of the command. More...
 

Detailed Description

Holds the command used in the {un,re}do operations.

Member Enumeration Documentation

Defines the type of the command.

Enumerator
InsertText 

Text insertion. Has text, position previous to the insert and length of the insert

RemoveText 

Text removal, Has text, position previous to the removal and length of the removed data

Constructor & Destructor Documentation

KviInputEditor::EditCommand::EditCommand ( Type  eType,
const QString &  szText,
int  iStartPosition 
)
inline

Contructs the command object.

Parameters
eTypeThe type of the command
szTextThe text of the command
iStartPositionThe start position of the command
Returns
EditCommand

Member Function Documentation

void KviInputEditor::EditCommand::setStartPosition ( int  iStartPosition)
inline

Sets the start position.

Parameters
iStartPositionThe position
Returns
void
void KviInputEditor::EditCommand::setText ( const QString &  szText)
inline

Sets the text of the command.

Parameters
szTextThe text to set
void KviInputEditor::EditCommand::setType ( const Type eType)
inline

Sets the type of the command.

Parameters
eTypeThe type of the command
Returns
void
int KviInputEditor::EditCommand::startPosition ( ) const
inline

Returns the start position.

Returns
int

Referenced by KviInputEditor::redo(), and KviInputEditor::undo().

const QString& KviInputEditor::EditCommand::text ( ) const
inline

Returns the text of the command.

Returns
const QString &

Referenced by KviInputEditor::redo(), and KviInputEditor::undo().

const Type& KviInputEditor::EditCommand::type ( ) const
inline

Returns the type of the command.

Returns
const Type &

Referenced by KviInputEditor::redo(), and KviInputEditor::undo().

Member Data Documentation

KviInputEditor::EditCommand::m_eType
private

The type of the command.

KviInputEditor::EditCommand::m_iStartPosition
private

The start position.

KviInputEditor::EditCommand::m_szText
private

The text of the command.


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