QCodeEdit  2.2
QDocumentInsertCommand Class Reference

A specialized command to insert text. More...

Inheritance diagram for QDocumentInsertCommand:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 QDocumentInsertCommand (int l, int offset, const QString &text, QDocument *doc, QDocumentCommand *p=0)
 ctor
virtual ~QDocumentInsertCommand ()
 dtor
virtual bool mergeWith (const QUndoCommand *command)
 Attempts to merge with another command.
virtual void redo ()
 Redo the command.
virtual void undo ()
 Undo the command.
- Public Member Functions inherited from QDocumentCommand
 QDocumentCommand (Command c, QDocument *d, QDocumentCommand *p=0)
 ctor
virtual ~QDocumentCommand ()
 dtor
virtual int id () const
bool isSilent () const
void setSilent (bool y)
 Set whether the command is silent.
bool keepAnchor () const
void setKeepAnchor (bool y)
 Set whether the command preserve selection of the target cursor.
void setTargetCursor (QDocumentCursorHandle *h)
 Set the target cursor.
void setRedoOffset (int off)
 ?
void setUndoOffset (int off)
 ?

Additional Inherited Members

- Public Types inherited from QDocumentCommand
enum  Command {
  None, Insert, Erase, Replace,
  Custom
}
- Static Public Member Functions inherited from QDocumentCommand
static bool isAutoUpdated (const QDocumentCursorHandle *h)
static void enableAutoUpdate (QDocumentCursorHandle *h)
 Enable auto update for a given cursor.
static void disableAutoUpdate (QDocumentCursorHandle *h)
 Disable auto update for a given cursor.
static void discardHandlesFromDocument (QDocument *d)
- Protected Member Functions inherited from QDocumentCommand
void markRedone (QDocumentLineHandle *h, bool firstTime)
 Change the modification status of a line.
void markUndone (QDocumentLineHandle *h)
 Change the modifiaction status of a line.
void updateTarget (int l, int offset)
 Update the target cursor.
void insertText (int line, int pos, const QString &s)
 Insert some text.
void removeText (int line, int pos, int length)
 Remove some text.
void insertLines (int after, const QList< QDocumentLineHandle * > &l)
 Insert some lines in the host document.
void removeLines (int after, int n)
 Remove some lines from the host document.
void updateCursorsOnInsertion (int line, int column, int prefixLength, int numLines, int suffixLength)
void updateCursorsOnDeletion (int line, int column, int prefixLength, int numLines, int suffixLength)
- Protected Attributes inherited from QDocumentCommand
bool m_state
bool m_first
QDocumentm_doc
int m_redoOffset
int m_undoOffset

Detailed Description

A specialized command to insert text.


Constructor & Destructor Documentation

QDocumentInsertCommand::QDocumentInsertCommand ( int  l,
int  offset,
const QString &  text,
QDocument doc,
QDocumentCommand p = 0 
)

ctor

Parameters:
ltarget line
offsettarget text position within target line
texttext to insert (can contain line feeds, "\n", which will result in the creation of new lines)
dochost document
pparent command

References QDocumentLine::length(), QDocument::line(), and QDocumentLine::text().


Member Function Documentation

bool QDocumentInsertCommand::mergeWith ( const QUndoCommand command)
virtual

Attempts to merge with another command.

Command merging is not implemented.

Reimplemented from QDocumentCommand.


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