edbee - Qt Editor Library
newlinecommand.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 
10 
11 
12 namespace edbee {
13 
14 class TextRange;
15 
19 {
20 public:
21  enum NewLineType {
25  };
26 
27 
28  NewlineCommand( NewLineType method );
29 
30  QString calculateSmartIndent( TextEditorController* controller, TextRange& range );
31 
32  virtual void executeNormalNewline( TextEditorController* controller );
33 
34  virtual void executeSpecialNewline( TextEditorController* controller, bool nextLine );
35 
36  virtual void execute( TextEditorController* controller );
37  virtual QString toString();
38 
39 private:
40  NewLineType newLineType_;
41 };
42 
43 
44 } // edbee
NewLineType
Definition: newlinecommand.h:21
Definition: newlinecommand.h:22
This is the abstract base class for a textcommand.
Definition: texteditorcommand.h:49
QString calculateSmartIndent(TextEditorController *controller, TextRange &range)
This method calculates the required 'smart' indent value at the given positon.
Definition: newlinecommand.cpp:32
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
virtual void executeSpecialNewline(TextEditorController *controller, bool nextLine)
Executes a special newline operation. (Inserts a newline before or the current line) ...
Definition: newlinecommand.cpp:110
The texteditor works via the controller. The controller is the central point/mediater which maps/cont...
Definition: texteditorcontroller.h:37
Inserts a newline. When smarttab is enabled it also inser leading tabs/spaces.
Definition: newlinecommand.h:18
NewlineCommand(NewLineType method)
Constructs the newline command.
Definition: newlinecommand.cpp:23
Definition: newlinecommand.h:23
virtual void execute(TextEditorController *controller)
Executes the insert newline command.
Definition: newlinecommand.cpp:161
virtual void executeNormalNewline(TextEditorController *controller)
Executes a 'normal' newline operation.
Definition: newlinecommand.cpp:76
A single text region A region constists of an anchor and a caret: The anchor defines the 'start' of t...
Definition: textrange.h:29
Definition: newlinecommand.h:24
virtual QString toString()
Returns the command name.
Definition: newlinecommand.cpp:184