edbee - Qt Editor Library
linedatachange.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "edbee/models/change.h"
9 
10 namespace edbee {
11 
12 class TextDocument;
13 class TextLineData;
14 
16 class LineDataChange : public Change
17 {
18 public:
19  LineDataChange(int line, int field);
20  virtual ~LineDataChange();
21 
22  void giveLineData( TextLineData* lineData );
23 
24  virtual void execute(TextDocument* document);
25  virtual void revert(TextDocument* doc);
26 
27  virtual bool giveAndMerge(TextDocument* document, Change* textChange );
28 
29  virtual void applyLineDelta( int line, int length, int newLength );
30 
31  virtual QString toString();
32 
33  int line() const;
34  void setLine( int line );
35 
36  int field() const;
37  void setField( int field );
38 
39 private:
40  void changeLineData( TextDocument* doc );
41 
42 private:
43 
44  int line_;
45  int field_;
46  TextLineData* lineData_;
47 
48 };
49 
50 } // edbee
This is the base and abstract class of a text document A TextDocument is the model part of the editor...
Definition: textdocument.h:40
LineDataChange(int line, int field)
Definition: linedatachange.cpp:15
virtual ~LineDataChange()
Definition: linedatachange.cpp:22
void giveLineData(TextLineData *lineData)
Definition: linedatachange.cpp:27
virtual void applyLineDelta(int line, int length, int newLength)
line is moved with the given delta
Definition: linedatachange.cpp:58
void setLine(int line)
Sets the line of this change.
Definition: linedatachange.cpp:90
virtual void execute(TextDocument *document)
This method should execute the command.
Definition: linedatachange.cpp:32
virtual QString toString()
Returns the debug text.
Definition: linedatachange.cpp:67
void setField(int field)
sets the field position
Definition: linedatachange.cpp:104
virtual bool giveAndMerge(TextDocument *document, Change *textChange)
merge is never a problem, simply
Definition: linedatachange.cpp:43
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
A basic change.
Definition: change.h:18
virtual void revert(TextDocument *doc)
this method reverts the given operation
Definition: linedatachange.cpp:37
int line() const
Returns the line index.
Definition: linedatachange.cpp:83
int field() const
retursn the field index of this line-data item
Definition: linedatachange.cpp:97
A text line item reference.
Definition: textlinedata.h:28
a class to handle line-data textchanges
Definition: linedatachange.h:16