Changeset View
Changeset View
Standalone View
Standalone View
src/script/katescriptdocument.h
Context not available. | |||||
60 | Q_INVOKABLE bool isModified(); | 60 | Q_INVOKABLE bool isModified(); | ||
---|---|---|---|---|---|
61 | Q_INVOKABLE QString text(); | 61 | Q_INVOKABLE QString text(); | ||
62 | Q_INVOKABLE QString text(int fromLine, int fromColumn, int toLine, int toColumn); | 62 | Q_INVOKABLE QString text(int fromLine, int fromColumn, int toLine, int toColumn); | ||
63 | QString text(const KTextEditor::Cursor &from, const KTextEditor::Cursor &to); | 63 | Q_INVOKABLE QString text(const QJSValue &jsfrom, const QJSValue &jsto); | ||
64 | QString text(const KTextEditor::Range &range); | | |||
65 | Q_INVOKABLE QString text(const QJSValue &jsrange); | 64 | Q_INVOKABLE QString text(const QJSValue &jsrange); | ||
66 | Q_INVOKABLE QString line(int line); | 65 | Q_INVOKABLE QString line(int line); | ||
67 | Q_INVOKABLE QString wordAt(int line, int column); | 66 | Q_INVOKABLE QString wordAt(int line, int column); | ||
68 | QString wordAt(const KTextEditor::Cursor &cursor); | 67 | Q_INVOKABLE QString wordAt(const QJSValue &jscursor); | ||
69 | Q_INVOKABLE QJSValue wordRangeAt(int line, int column); | 68 | Q_INVOKABLE QJSValue wordRangeAt(int line, int column); | ||
70 | QJSValue wordRangeAt(const KTextEditor::Cursor &cursor); | 69 | Q_INVOKABLE QJSValue wordRangeAt(const QJSValue &jscursor); | ||
71 | Q_INVOKABLE QString charAt(int line, int column); | 70 | Q_INVOKABLE QString charAt(int line, int column); | ||
72 | QString charAt(const KTextEditor::Cursor &cursor); | 71 | Q_INVOKABLE QString charAt(const QJSValue &jscursor); | ||
73 | Q_INVOKABLE QString charAt(const QJSValue &cursor); | | |||
74 | Q_INVOKABLE QString firstChar(int line); | 72 | Q_INVOKABLE QString firstChar(int line); | ||
75 | Q_INVOKABLE QString lastChar(int line); | 73 | Q_INVOKABLE QString lastChar(int line); | ||
76 | Q_INVOKABLE bool isSpace(int line, int column); | 74 | Q_INVOKABLE bool isSpace(int line, int column); | ||
77 | bool isSpace(const KTextEditor::Cursor &cursor); | | |||
78 | Q_INVOKABLE bool isSpace(const QJSValue &jscursor); | 75 | Q_INVOKABLE bool isSpace(const QJSValue &jscursor); | ||
79 | Q_INVOKABLE bool matchesAt(int line, int column, const QString &s); | 76 | Q_INVOKABLE bool matchesAt(int line, int column, const QString &s); | ||
80 | bool matchesAt(const KTextEditor::Cursor &cursor, const QString &s); | | |||
81 | Q_INVOKABLE bool matchesAt(const QJSValue &cursor, const QString &s); | 77 | Q_INVOKABLE bool matchesAt(const QJSValue &cursor, const QString &s); | ||
82 | Q_INVOKABLE bool setText(const QString &s); | 78 | Q_INVOKABLE bool setText(const QString &s); | ||
83 | Q_INVOKABLE bool clear(); | 79 | Q_INVOKABLE bool clear(); | ||
84 | Q_INVOKABLE bool truncate(int line, int column); | 80 | Q_INVOKABLE bool truncate(int line, int column); | ||
85 | bool truncate(const KTextEditor::Cursor &cursor); | 81 | Q_INVOKABLE bool truncate(const QJSValue &jscursor); | ||
86 | Q_INVOKABLE bool truncate(const QJSValue &cursor); | | |||
87 | Q_INVOKABLE bool insertText(int line, int column, const QString &s); | 82 | Q_INVOKABLE bool insertText(int line, int column, const QString &s); | ||
88 | bool insertText(const KTextEditor::Cursor &cursor, const QString &s); | | |||
89 | Q_INVOKABLE bool insertText(const QJSValue &jscursor, const QString &s); | 83 | Q_INVOKABLE bool insertText(const QJSValue &jscursor, const QString &s); | ||
90 | Q_INVOKABLE bool removeText(int fromLine, int fromColumn, int toLine, int toColumn); | 84 | Q_INVOKABLE bool removeText(int fromLine, int fromColumn, int toLine, int toColumn); | ||
91 | bool removeText(const KTextEditor::Cursor &from, const KTextEditor::Cursor &to); | | |||
92 | bool removeText(const KTextEditor::Range &range); | | |||
93 | Q_INVOKABLE bool removeText(const QJSValue &range); | 85 | Q_INVOKABLE bool removeText(const QJSValue &range); | ||
86 | Q_INVOKABLE bool removeText(const QJSValue &jsfrom, const QJSValue &jsto); | ||||
94 | Q_INVOKABLE bool insertLine(int line, const QString &s); | 87 | Q_INVOKABLE bool insertLine(int line, const QString &s); | ||
95 | Q_INVOKABLE bool removeLine(int line); | 88 | Q_INVOKABLE bool removeLine(int line); | ||
96 | Q_INVOKABLE bool wrapLine(int line, int column); | 89 | Q_INVOKABLE bool wrapLine(int line, int column); | ||
97 | bool wrapLine(const KTextEditor::Cursor &cursor); | | |||
98 | Q_INVOKABLE bool wrapLine(const QJSValue &cursor); | 90 | Q_INVOKABLE bool wrapLine(const QJSValue &cursor); | ||
99 | Q_INVOKABLE void joinLines(int startLine, int endLine); | 91 | Q_INVOKABLE void joinLines(int startLine, int endLine); | ||
100 | Q_INVOKABLE int lines(); | 92 | Q_INVOKABLE int lines(); | ||
Context not available. | |||||
109 | Q_INVOKABLE int firstColumn(int line); | 101 | Q_INVOKABLE int firstColumn(int line); | ||
110 | Q_INVOKABLE int lastColumn(int line); | 102 | Q_INVOKABLE int lastColumn(int line); | ||
111 | Q_INVOKABLE int prevNonSpaceColumn(int line, int column); | 103 | Q_INVOKABLE int prevNonSpaceColumn(int line, int column); | ||
112 | int prevNonSpaceColumn(const KTextEditor::Cursor &cursor); | 104 | Q_INVOKABLE int prevNonSpaceColumn(const QJSValue &jscursor); | ||
113 | Q_INVOKABLE int prevNonSpaceColumn(const QJSValue &cursor); | | |||
114 | Q_INVOKABLE int nextNonSpaceColumn(int line, int column); | 105 | Q_INVOKABLE int nextNonSpaceColumn(int line, int column); | ||
115 | int nextNonSpaceColumn(const KTextEditor::Cursor &cursor); | 106 | Q_INVOKABLE int nextNonSpaceColumn(const QJSValue &jscursor); | ||
116 | Q_INVOKABLE int nextNonSpaceColumn(const QJSValue &cursor); | | |||
117 | Q_INVOKABLE int prevNonEmptyLine(int line); | 107 | Q_INVOKABLE int prevNonEmptyLine(int line); | ||
118 | Q_INVOKABLE int nextNonEmptyLine(int line); | 108 | Q_INVOKABLE int nextNonEmptyLine(int line); | ||
119 | Q_INVOKABLE bool isInWord(const QString &character, int attribute); | 109 | Q_INVOKABLE bool isInWord(const QString &character, int attribute); | ||
Context not available. | |||||
126 | Q_INVOKABLE QJSValue documentRange(); | 116 | Q_INVOKABLE QJSValue documentRange(); | ||
127 | Q_INVOKABLE QJSValue documentEnd(); | 117 | Q_INVOKABLE QJSValue documentEnd(); | ||
128 | Q_INVOKABLE bool isValidTextPosition(int line, int column); | 118 | Q_INVOKABLE bool isValidTextPosition(int line, int column); | ||
129 | bool isValidTextPosition(const KTextEditor::Cursor& cursor); | | |||
130 | Q_INVOKABLE bool isValidTextPosition(const QJSValue& cursor); | 119 | Q_INVOKABLE bool isValidTextPosition(const QJSValue& cursor); | ||
131 | 120 | | |||
132 | /** | 121 | /** | ||
133 | * Get the syntax highlighting attribute at a given position in the document. | 122 | * Get the syntax highlighting attribute at a given position in the document. | ||
134 | */ | 123 | */ | ||
135 | Q_INVOKABLE int attribute(int line, int column); | 124 | Q_INVOKABLE int attribute(int line, int column); | ||
136 | int attribute(const KTextEditor::Cursor &cursor); | 125 | Q_INVOKABLE int attribute(const QJSValue &jscursor); | ||
137 | 126 | | |||
138 | /** | 127 | /** | ||
139 | * Return true if the highlight attribute equals @p attr. | 128 | * Return true if the highlight attribute equals @p attr. | ||
140 | */ | 129 | */ | ||
141 | Q_INVOKABLE bool isAttribute(int line, int column, int attr); | 130 | Q_INVOKABLE bool isAttribute(int line, int column, int attr); | ||
142 | bool isAttribute(const KTextEditor::Cursor &cursor, int attr); | 131 | Q_INVOKABLE bool isAttribute(const QJSValue &jscursor, int attr); | ||
143 | 132 | | |||
144 | /** | 133 | /** | ||
145 | * Get the name of the syntax highlighting attribute at the given position. | 134 | * Get the name of the syntax highlighting attribute at the given position. | ||
146 | */ | 135 | */ | ||
147 | Q_INVOKABLE QString attributeName(int line, int column); | 136 | Q_INVOKABLE QString attributeName(int line, int column); | ||
148 | QString attributeName(const KTextEditor::Cursor &cursor); | | |||
149 | Q_INVOKABLE QString attributeName(const QJSValue &jscursor); | 137 | Q_INVOKABLE QString attributeName(const QJSValue &jscursor); | ||
150 | 138 | | |||
151 | /** | 139 | /** | ||
152 | * Return true is the name of the syntax attribute equals @p name. | 140 | * Return true is the name of the syntax attribute equals @p name. | ||
153 | */ | 141 | */ | ||
154 | Q_INVOKABLE bool isAttributeName(int line, int column, const QString &name); | 142 | Q_INVOKABLE bool isAttributeName(int line, int column, const QString &name); | ||
155 | bool isAttributeName(const KTextEditor::Cursor &cursor, const QString &name); | | |||
156 | Q_INVOKABLE bool isAttributeName(const QJSValue &cursor, const QString &name); | 143 | Q_INVOKABLE bool isAttributeName(const QJSValue &cursor, const QString &name); | ||
157 | 144 | | |||
158 | Q_INVOKABLE QString variable(const QString &s); | 145 | Q_INVOKABLE QString variable(const QString &s); | ||
Context not available. | |||||
162 | Q_INVOKABLE int firstVirtualColumn(int line); | 149 | Q_INVOKABLE int firstVirtualColumn(int line); | ||
163 | Q_INVOKABLE int lastVirtualColumn(int line); | 150 | Q_INVOKABLE int lastVirtualColumn(int line); | ||
164 | Q_INVOKABLE int toVirtualColumn(int line, int column); | 151 | Q_INVOKABLE int toVirtualColumn(int line, int column); | ||
165 | int toVirtualColumn(const KTextEditor::Cursor &cursor); | | |||
166 | Q_INVOKABLE int toVirtualColumn(const QJSValue &cursor); | 152 | Q_INVOKABLE int toVirtualColumn(const QJSValue &cursor); | ||
167 | KTextEditor::Cursor toVirtualCursor(const KTextEditor::Cursor &cursor); | 153 | Q_INVOKABLE QJSValue toVirtualCursor(int line, int column); | ||
154 | Q_INVOKABLE QJSValue toVirtualCursor(const QJSValue &jscursor); | ||||
168 | Q_INVOKABLE int fromVirtualColumn(int line, int virtualColumn); | 155 | Q_INVOKABLE int fromVirtualColumn(int line, int virtualColumn); | ||
169 | int fromVirtualColumn(const KTextEditor::Cursor &virtualCursor); | 156 | Q_INVOKABLE int fromVirtualColumn(const QJSValue &jscursor); | ||
170 | KTextEditor::Cursor fromVirtualCursor(const KTextEditor::Cursor &virtualCursor); | 157 | Q_INVOKABLE QJSValue fromVirtualCursor(int line, int column); | ||
158 | Q_INVOKABLE QJSValue fromVirtualCursor(const QJSValue &jscursor); | ||||
171 | 159 | | |||
172 | KTextEditor::Cursor anchorInternal(int line, int column, QChar character); | 160 | KTextEditor::Cursor anchorInternal(int line, int column, QChar character); | ||
173 | KTextEditor::Cursor anchor(const KTextEditor::Cursor &cursor, QChar character); | 161 | KTextEditor::Cursor anchor(const KTextEditor::Cursor &cursor, QChar character); | ||
Context not available. | |||||
179 | Q_INVOKABLE QJSValue rfind(const QJSValue &cursor, const QString &text, int attribute = -1); | 167 | Q_INVOKABLE QJSValue rfind(const QJSValue &cursor, const QString &text, int attribute = -1); | ||
180 | 168 | | |||
181 | Q_INVOKABLE int defStyleNum(int line, int column); | 169 | Q_INVOKABLE int defStyleNum(int line, int column); | ||
182 | int defStyleNum(const KTextEditor::Cursor &cursor); | | |||
183 | Q_INVOKABLE int defStyleNum(const QJSValue &cursor); | 170 | Q_INVOKABLE int defStyleNum(const QJSValue &cursor); | ||
184 | Q_INVOKABLE bool isCode(int line, int column); | 171 | Q_INVOKABLE bool isCode(int line, int column); | ||
185 | bool isCode(const KTextEditor::Cursor &cursor); | | |||
186 | Q_INVOKABLE bool isCode(const QJSValue &cursor); | 172 | Q_INVOKABLE bool isCode(const QJSValue &cursor); | ||
187 | Q_INVOKABLE bool isComment(int line, int column); | 173 | Q_INVOKABLE bool isComment(int line, int column); | ||
188 | bool isComment(const KTextEditor::Cursor &cursor); | | |||
189 | Q_INVOKABLE bool isComment(const QJSValue &cursor); | 174 | Q_INVOKABLE bool isComment(const QJSValue &cursor); | ||
190 | Q_INVOKABLE bool isString(int line, int column); | 175 | Q_INVOKABLE bool isString(int line, int column); | ||
191 | bool isString(const KTextEditor::Cursor &cursor); | | |||
192 | Q_INVOKABLE bool isString(const QJSValue &cursor); | 176 | Q_INVOKABLE bool isString(const QJSValue &cursor); | ||
193 | Q_INVOKABLE bool isRegionMarker(int line, int column); | 177 | Q_INVOKABLE bool isRegionMarker(int line, int column); | ||
194 | bool isRegionMarker(const KTextEditor::Cursor &cursor); | | |||
195 | Q_INVOKABLE bool isRegionMarker(const QJSValue &cursor); | 178 | Q_INVOKABLE bool isRegionMarker(const QJSValue &cursor); | ||
196 | Q_INVOKABLE bool isChar(int line, int column); | 179 | Q_INVOKABLE bool isChar(int line, int column); | ||
197 | bool isChar(const KTextEditor::Cursor &cursor); | | |||
198 | Q_INVOKABLE bool isChar(const QJSValue &cursor); | 180 | Q_INVOKABLE bool isChar(const QJSValue &cursor); | ||
199 | Q_INVOKABLE bool isOthers(int line, int column); | 181 | Q_INVOKABLE bool isOthers(int line, int column); | ||
200 | bool isOthers(const KTextEditor::Cursor &cursor); | | |||
201 | Q_INVOKABLE bool isOthers(const QJSValue &cursor); | 182 | Q_INVOKABLE bool isOthers(const QJSValue &cursor); | ||
202 | 183 | | |||
203 | Q_INVOKABLE bool startsWith(int line, const QString &pattern, bool skipWhiteSpaces); | 184 | Q_INVOKABLE bool startsWith(int line, const QString &pattern, bool skipWhiteSpaces); | ||
204 | Q_INVOKABLE bool endsWith(int line, const QString &pattern, bool skipWhiteSpaces); | 185 | Q_INVOKABLE bool endsWith(int line, const QString &pattern, bool skipWhiteSpaces); | ||
205 | 186 | | |||
206 | void indent(KTextEditor::Range range, int change); | | |||
207 | Q_INVOKABLE void indent(const QJSValue &jsrange, int change); | 187 | Q_INVOKABLE void indent(const QJSValue &jsrange, int change); | ||
208 | 188 | | |||
209 | private: | 189 | private: | ||
Context not available. |