25 #include "../interfaces/document.h"
41 {
return c1.m_line == c2.m_line && c1.m_col == c2.m_col; }
44 {
return !(c1 == c2); }
47 {
return c1.m_line > c2.m_line || (c1.m_line == c2.m_line && c1.m_col > c2.m_col); }
50 {
return c1.m_line > c2.m_line || (c1.m_line == c2.m_line && c1.m_col >= c2.m_col); }
53 {
return !(c1 >= c2); }
56 {
return !(c1 > c2); }
59 stream << c.m_line <<
"," << c.m_col;
71 inline void pos(
int *pline,
int *pcol)
const {
72 if(pline) *pline = m_line;
73 if(pcol) *pcol = m_col;
76 inline int line()
const {
return m_line; };
77 inline int col()
const {
return m_col; };
79 virtual void setLine(
int line) { m_line = line; };
80 virtual void setCol(
int col) { m_col = col; };
81 virtual void setPos(
const KateTextCursor& pos) { m_line = pos.line(); m_col = pos.col(); };
82 virtual void setPos(
int line,
int col) { m_line = line; m_col = col; };
99 bool validPosition(uint line, uint col);
100 bool validPosition();
103 bool gotoPreviousLine();
104 bool gotoEndOfNextLine();
105 bool gotoEndOfPreviousLine();
107 int nbCharsOnLineAfter();
108 bool moveForward(uint nbChar);
109 bool moveBackward(uint nbChar);
112 void position(uint *line, uint *col)
const;
113 bool setPosition(uint line, uint col);
114 bool insertText(
const TQString& text);
115 bool removeText(uint numberOfCharacters);
116 TQChar currentChar()
const;
118 uchar currentAttrib()
const;
148 virtual ~KateRange () {};
150 virtual bool isValid()
const = 0;
157 class KateTextRange :
public KateRange
165 KateTextRange(
int startline,
int startcol,
int endline,
int endcol)
166 : m_start(startline, startcol)
167 , m_end(endline, endcol)
181 virtual ~KateTextRange () {};
183 virtual bool isValid()
const {
return m_valid; };
184 void setValid(
bool valid) {
198 return ((cursor<m_start)?(-1):((cursor>m_end)?1:0));
201 inline void normalize() {
202 if( m_start > m_end )
203 tqSwap(m_start, m_end);
212 class KateBracketRange :
public KateTextRange
221 KateBracketRange(
int startline,
int startcol,
int endline,
int endcol,
int minIndent)
222 : KateTextRange(startline, startcol, endline, endcol)
223 , m_minIndent(minIndent)
228 : KateTextRange(start,
end)
229 , m_minIndent(minIndent)
233 int getMinIndent()
const
238 void setIndentMin(
int m)
Cursor class with a pointer to its document.
bool previousNonSpaceChar()
Find the position (line and col) of the previous char that is not a space.
bool nextNonSpaceChar()
Find the position (line and col) of the next char that is not a space.
Simple cursor class with no document pointer.
const TDEShortcut & end()