QCodeEdit  2.2
List of all members
QDocumentCommandBlock Class Reference

A meta command used for command grouping. More...

Inheritance diagram for QDocumentCommandBlock:
Inheritance graph
[legend]

Public Member Functions

 QDocumentCommandBlock (QDocument *d)
 ctor More...
 
virtual ~QDocumentCommandBlock ()
 dtor
 
virtual void redo ()
 Redo the command.
 
virtual void undo ()
 Undo the command.
 
void setWeakLock (bool l)
 Set whether the block is weakly locked.
 
bool isWeakLocked () const
 
virtual void addCommand (QDocumentCommand *c)
 Add a command to the group. More...
 
virtual void removeCommand (QDocumentCommand *c)
 Remove a command from the block. More...
 
- Public Member Functions inherited from QDocumentCommand
 QDocumentCommand (Command c, QDocument *d, QDocumentCommand *p=0)
 ctor
 
virtual ~QDocumentCommand ()
 dtor
 
virtual int id () const
 
virtual bool mergeWith (const QUndoCommand *command)
 Attempts to merge with another command. More...
 
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. More...
 
void setTargetCursor (QDocumentCursorHandle *h)
 Set the target cursor. More...
 
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. More...
 
void insertText (int line, int pos, const QString &s)
 Insert some text. More...
 
void removeText (int line, int pos, int length)
 Remove some text. More...
 
void insertLines (int after, const QList< QDocumentLineHandle * > &l)
 Insert some lines in the host document. More...
 
void removeLines (int after, int n)
 Remove some lines from the host document. More...
 
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 meta command used for command grouping.

Constructor & Destructor Documentation

◆ QDocumentCommandBlock()

QDocumentCommandBlock::QDocumentCommandBlock ( QDocument d)

ctor

Parameters
dhost document

Member Function Documentation

◆ addCommand()

void QDocumentCommandBlock::addCommand ( QDocumentCommand c)
virtual

Add a command to the group.

Warning
Doing that after having pushed the command on the undo/redo stack is likely to result in corruption of the undo/redo stack

Reimplemented in QSnippetInsertionCommand.

Referenced by QSnippetInsertionCommand::addCommand().

◆ isWeakLocked()

bool QDocumentCommandBlock::isWeakLocked ( ) const
Returns
whether the block is weakly locked

Weak locking of command block is an obscure internal feature which prevents the first redo() call from actually redo'ing the grouped commands

Referenced by redo().

◆ removeCommand()

void QDocumentCommandBlock::removeCommand ( QDocumentCommand c)
virtual

Remove a command from the block.

Warning
Doing that after having pushed the command on the undo/redo stack is likely to result in corruption of the undo/redo stack

Reimplemented in QSnippetInsertionCommand.

Referenced by QSnippetInsertionCommand::removeCommand().


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