X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=src%2Fscripting.h;fp=src%2Fscripting.h;h=c724512dcfdd01b054a0ba8bd06a82e1a414777d;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=0000000000000000000000000000000000000000;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/src/scripting.h b/src/scripting.h new file mode 100644 index 0000000..c724512 --- /dev/null +++ b/src/scripting.h @@ -0,0 +1,65 @@ +#ifndef SCRIPTING_H +#define SCRIPTING_H + +#include +#include +#include +#include +#include +#include + +class BranchItem; +class VymModelWrapper; + +void logError(QScriptContext *context, QScriptContext::Error error, + const QString &text); + +/////////////////////////////////////////////////////////////////////////// +class VymScriptContext : public QObject, protected QScriptable { + Q_OBJECT + public: + VymScriptContext(); + QString setResult(const QString &r); + bool setResult(bool r); + int setResult(int r); + uint setResult(uint r); +}; + +/////////////////////////////////////////////////////////////////////////// +class VymWrapper : public VymScriptContext { + Q_OBJECT + public: + VymWrapper(); + + public slots: + void clearConsole(); + bool isConfluenceAgentAvailable(); + QObject *currentMap(); + void editHeading(); + bool loadMap(const QString &filename); + int mapCount(); + void gotoMap(uint n); + bool closeMapWithID(uint n); + void selectQuickColor(int n); + QString currentColor(); + uint currentMapID(); + void toggleTreeEditor(); + QString loadFile(const QString &filename); + void saveFile(const QString &filename, const QString &s); + QString version(); +}; + +class Selection : public VymScriptContext { + Q_OBJECT + public: + Selection(); + + public slots: + void test(); + void setModel(VymModelWrapper *mw); + + private: + VymModelWrapper *modelWrapper; +}; + +#endif