Changeset View
Changeset View
Standalone View
Standalone View
src/script/katescript.h
Show All 23 Lines | |||||
24 | #include <QString> | 24 | #include <QString> | ||
25 | #include <QMap> | 25 | #include <QMap> | ||
26 | #include <QJSValue> | 26 | #include <QJSValue> | ||
27 | 27 | | |||
28 | class QJSEngine; | 28 | class QJSEngine; | ||
29 | 29 | | |||
30 | namespace KTextEditor { class ViewPrivate; } | 30 | namespace KTextEditor { class ViewPrivate; } | ||
31 | 31 | | |||
32 | class KateScriptEditor; | ||||
32 | class KateScriptDocument; | 33 | class KateScriptDocument; | ||
33 | class KateScriptView; | 34 | class KateScriptView; | ||
34 | 35 | | |||
35 | namespace Kate | 36 | namespace Kate | ||
36 | { | 37 | { | ||
37 | enum ScriptType { | 38 | enum ScriptType { | ||
38 | /** The script is an indenter */ | 39 | /** The script is an indenter */ | ||
39 | IndentationScript, | 40 | IndentationScript, | ||
▲ Show 20 Lines • Show All 149 Lines • ▼ Show 20 Line(s) | 119 | public: | |||
189 | KateScriptHeader &generalHeader(); | 190 | KateScriptHeader &generalHeader(); | ||
190 | 191 | | |||
191 | protected: | 192 | protected: | ||
192 | /** Checks for exception and gives feedback on the console. */ | 193 | /** Checks for exception and gives feedback on the console. */ | ||
193 | bool hasException(const QJSValue &object, const QString &file); | 194 | bool hasException(const QJSValue &object, const QString &file); | ||
194 | 195 | | |||
195 | private: | 196 | private: | ||
196 | /** Whether or not there has been a call to load */ | 197 | /** Whether or not there has been a call to load */ | ||
197 | bool m_loaded; | 198 | bool m_loaded = false; | ||
198 | 199 | | |||
199 | /** Whether or not the script loaded successfully into memory */ | 200 | /** Whether or not the script loaded successfully into memory */ | ||
200 | bool m_loadSuccessful; | 201 | bool m_loadSuccessful = false; | ||
201 | 202 | | |||
202 | /** The script's URL */ | 203 | /** The script's URL */ | ||
203 | QString m_url; | 204 | QString m_url; | ||
204 | 205 | | |||
205 | /** An error message set when an error occurs */ | 206 | /** An error message set when an error occurs */ | ||
206 | QString m_errorMessage; | 207 | QString m_errorMessage; | ||
207 | 208 | | |||
208 | protected: | 209 | protected: | ||
209 | /** The Qt interpreter for this script */ | 210 | /** The Qt interpreter for this script */ | ||
210 | QJSEngine *m_engine; | 211 | QJSEngine *m_engine = nullptr; | ||
211 | 212 | | |||
212 | private: | 213 | private: | ||
213 | /** general header data */ | 214 | /** general header data */ | ||
214 | KateScriptHeader m_generalHeader; | 215 | KateScriptHeader m_generalHeader; | ||
215 | 216 | | |||
216 | /** document/view wrapper objects */ | 217 | /** wrapper objects */ | ||
217 | KateScriptDocument *m_document; | 218 | KateScriptEditor *m_editor = nullptr; | ||
218 | KateScriptView *m_view; | 219 | KateScriptDocument *m_document = nullptr; | ||
220 | KateScriptView *m_view = nullptr; | ||||
219 | 221 | | |||
220 | private: | 222 | private: | ||
221 | /** if input is script or url**/ | 223 | /** if input is script or url**/ | ||
222 | enum InputType m_inputType; | 224 | enum InputType m_inputType; | ||
223 | QString m_script; | 225 | QString m_script; | ||
224 | }; | 226 | }; | ||
225 | 227 | | |||
226 | //END | 228 | //END | ||
227 | 229 | | |||
228 | #endif | 230 | #endif | ||
229 | 231 | |