20 #ifndef __kate_jscript_h__
21 #define __kate_jscript_h__
23 #include "../interfaces/document.h"
24 #include "kateindentscriptabstracts.h"
71 KJS::ObjectImp *
wrapDocument (KJS::ExecState *exec, KateDocument *doc);
79 KJS::ObjectImp *
wrapView (KJS::ExecState *exec, KateView *view);
90 bool execute (KateView *view,
const TQString &script, TQString &errorMsg);
127 inline TQString desktopFilename () {
return filename.left(filename.length()-2).append (
"desktop"); }
143 bool desktopFileExists;
147 KateJScriptManager ();
148 ~KateJScriptManager ();
155 void collectScripts (
bool force =
false);
168 bool exec(
class Kate::View *view,
const TQString &cmd, TQString &errorMsg );
177 bool help(
class Kate::View *view,
const TQString &cmd, TQString &msg );
189 TQDict<KateJScriptManager::Script> m_scripts;
192 class KateIndentJScriptImpl:
public KateIndentScriptImplAbstract {
194 KateIndentJScriptImpl(
const TQString& internalName,
195 const TQString &filePath,
const TQString &niceName,
196 const TQString ©right,
double version);
197 ~KateIndentJScriptImpl();
199 virtual bool processChar(
class Kate::View *view, TQChar c, TQString &errorMsg );
201 virtual bool processNewline(
class Kate::View *view,
const KateDocCursor &begin,
bool needcontinue, TQString &errorMsg );
203 virtual void decRef();
205 KateJSView *m_viewWrapper;
206 KateJSDocument *m_docWrapper;
207 KJS::Object *m_indenter;
208 KJS::Interpreter *m_interpreter;
209 bool setupInterpreter(TQString &errorMsg);
210 void deleteInterpreter();
213 class KateIndentJScriptManager:
public KateIndentScriptManagerAbstract
217 KateIndentJScriptManager ();
218 virtual ~KateIndentJScriptManager ();
219 virtual KateIndentScript script(
const TQString &scriptname);
225 void collectScripts (
bool force =
false);
226 void parseScriptHeader(
const TQString &filePath,
227 TQString *niceName,TQString *copyright,
double *version);
228 TQDict<KateIndentJScriptImpl> m_scripts;