KVIrc 5.2.6
Developer APIs
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)
 Constructs the command object.
 
void setStartPosition (int iStartPosition)
 Sets the start position.
 
void setText (const QString &szText)
 Sets the text of the command.
 
void setType (const Type &eType)
 Sets the type of the command.
 
int startPosition () const
 Returns the start position.
 
const QString & text () const
 Returns the text of the command.
 
const Typetype () const
 Returns the type of the command.
 

Private Attributes

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

Detailed Description

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

Member Enumeration Documentation

◆ Type

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

◆ EditCommand()

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

Constructs the command object.

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

References m_eType, m_iStartPosition, and m_szText.

Member Function Documentation

◆ setStartPosition()

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

Sets the start position.

Parameters
iStartPositionThe position
Returns
void

References m_iStartPosition.

◆ setText()

void KviInputEditor::EditCommand::setText ( const QString & szText)
inline

Sets the text of the command.

Parameters
szTextThe text to set

References m_szText.

◆ setType()

void KviInputEditor::EditCommand::setType ( const Type & eType)
inline

Sets the type of the command.

Parameters
eTypeThe type of the command
Returns
void

References m_eType.

◆ startPosition()

int KviInputEditor::EditCommand::startPosition ( ) const
inline

Returns the start position.

Returns
int

References m_iStartPosition.

◆ text()

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

Returns the text of the command.

Returns
const QString &

References m_szText.

◆ type()

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

Returns the type of the command.

Returns
const Type &

References m_eType.

Member Data Documentation

◆ m_eType

Type KviInputEditor::EditCommand::m_eType
private

The type of the command.

Referenced by EditCommand(), setType(), and type().

◆ m_iStartPosition

int KviInputEditor::EditCommand::m_iStartPosition
private

The start position.

Referenced by EditCommand(), setStartPosition(), and startPosition().

◆ m_szText

QString KviInputEditor::EditCommand::m_szText
private

The text of the command.

Referenced by EditCommand(), setText(), and text().


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