edbee - Qt Editor Library
Public Types | Public Member Functions | List of all members
edbee::NewlineCommand Class Reference

Inserts a newline. When smarttab is enabled it also inser leading tabs/spaces. More...

#include <newlinecommand.h>

+ Inheritance diagram for edbee::NewlineCommand:
+ Collaboration diagram for edbee::NewlineCommand:

Public Types

enum  NewLineType { NormalNewline = 0, AddLineBefore = 1, AddLineAfter = 2 }
 

Public Member Functions

 NewlineCommand (NewLineType method)
 Constructs the newline command. More...
 
QString calculateSmartIndent (TextEditorController *controller, TextRange &range)
 This method calculates the required 'smart' indent value at the given positon. More...
 
virtual void executeNormalNewline (TextEditorController *controller)
 Executes a 'normal' newline operation. More...
 
virtual void executeSpecialNewline (TextEditorController *controller, bool nextLine)
 Executes a special newline operation. (Inserts a newline before or the current line) More...
 
virtual void execute (TextEditorController *controller)
 Executes the insert newline command. More...
 
virtual QString toString ()
 Returns the command name. More...
 
- Public Member Functions inherited from edbee::TextEditorCommand
 TextEditorCommand ()
 The default constructor. More...
 
virtual ~TextEditorCommand ()
 A blank virtual destructor. More...
 

Detailed Description

Inserts a newline. When smarttab is enabled it also inser leading tabs/spaces.

Member Enumeration Documentation

◆ NewLineType

Enumerator
NormalNewline 
AddLineBefore 
AddLineAfter 

Constructor & Destructor Documentation

◆ NewlineCommand()

edbee::NewlineCommand::NewlineCommand ( NewlineCommand::NewLineType  method)

Constructs the newline command.

Parameters
metodthe method

Member Function Documentation

◆ calculateSmartIndent()

QString edbee::NewlineCommand::calculateSmartIndent ( TextEditorController controller,
TextRange range 
)

This method calculates the required 'smart' indent value at the given positon.

Parameters
controllerthe controller
rangethe range to calculate the smart tab for

◆ execute()

void edbee::NewlineCommand::execute ( TextEditorController controller)
virtual

Executes the insert newline command.

Parameters
controllerthe controller to execute this command for

Implements edbee::TextEditorCommand.

◆ executeNormalNewline()

void edbee::NewlineCommand::executeNormalNewline ( TextEditorController controller)
virtual

Executes a 'normal' newline operation.

◆ executeSpecialNewline()

void edbee::NewlineCommand::executeSpecialNewline ( TextEditorController controller,
bool  nextLine 
)
virtual

Executes a special newline operation. (Inserts a newline before or the current line)

Parameters
controllerthe controller to execute this operation for
nextLinea nextline operation

◆ toString()

QString edbee::NewlineCommand::toString ( )
virtual

Returns the command name.

Implements edbee::TextEditorCommand.


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