]> git.sven.stormbind.net Git - sven/vym.git/blob - src/vymmodelwrapper.h
Replace Pierre as the maintainer
[sven/vym.git] / src / vymmodelwrapper.h
1 #ifndef VYMMODELWRAPPER_H
2 #define VYMMODELWRAPPER_H
3
4 #include "scripting.h"
5 #include <QColor>
6 #include <QObject>
7 #include <QScriptContext>
8 #include <QScriptValue>
9 #include <QScriptable>
10 #include <QVariant>
11
12 class BranchItem;
13 class VymModel;
14
15 class VymModelWrapper : public VymScriptContext {
16     Q_OBJECT
17   public:
18     VymModelWrapper(VymModel *m);
19     /*
20     QString setResult( QString r );
21     bool setResult( bool r );
22     int setResult( int r );
23     */
24
25   private:
26     BranchItem *getSelectedBranch();
27     QVariant getParameter(bool &ok, const QString &key,
28                           const QStringList &parameters);
29
30   public slots:
31     void addBranch();
32     void addBranchBefore();
33     void addMapCenter(qreal x, qreal y);
34     void addMapInsert(QString filename, int pos, int contentFilter);
35     void addMapInsert(const QString &filename, int pos);
36     void addMapInsert(const QString &filename);
37     void addMapReplace(QString filename);
38     void addSlide();
39     void addXLink(const QString &begin, const QString &end, int width,
40                   const QString &color, const QString &penstyle);
41     int branchCount();
42     int centerCount();
43     void centerOnID(const QString &id); // tested: ok
44     void clearFlags();
45     void colorBranch(const QString &color);
46     void colorSubtree(const QString &color);
47     void copy();
48     void cut();
49     void cycleTask();
50     int depth();
51     bool exportMap();
52     int getBranchIndex();
53     QString getDestPath();
54     QString getFileDir();
55     QString getFileName();
56     QString getFrameType();
57     QString getHeadingPlainText();
58     QString getHeadingXML();
59     QString getMapAuthor();
60     QString getMapComment();
61     QString getMapTitle();
62     QString getNotePlainText();
63     QString getNoteXML();
64     QString getSelectionString();
65     int getTaskPriorityDelta();
66     QString getTaskSleep();
67     int getTaskSleepDays();
68     QString getURL();
69     QString getVymLink();
70     QString getXLinkColor();
71     int getXLinkWidth();
72     QString getXLinkPenStyle();
73     QString getXLinkStyleBegin();
74     QString getXLinkStyleEnd();
75     bool hasActiveFlag(const QString &flag);
76     bool hasNote();
77     bool hasRichTextNote();
78     bool hasTask();
79     void importDir(const QString &path);
80     bool initIterator(const QString &iname, bool deepLevelsFirst = false);
81     bool isScrolled();
82     void loadImage(const QString &filename);
83     void loadNote(const QString &filename);
84     void move(qreal x, qreal y);
85     void moveRel(qreal x, qreal y);
86     void moveDown();
87     void moveUp();
88     void moveSlideDown(int n);
89     void moveSlideDown();
90     void moveSlideUp(int n);
91     void moveSlideUp();
92     bool nextIterator(const QString &iname);
93     void nop();
94     void note2URLs();
95     bool parseVymText(const QString &text);
96     void paste();
97     void redo();
98     bool relinkTo(const QString &parent, int num, qreal x, qreal y);
99     bool relinkTo(const QString &parent, int num);
100     bool relinkTo(const QString &parent);
101     void remove();
102     void removeChildren();
103     void removeKeepChildren();
104     void removeSlide(int n);
105     QVariant repeatLastCommand();
106     void saveImage(const QString &filename);
107     void saveNote(const QString &filename);
108     void scroll();
109     bool select(const QString &s);
110     bool selectID(const QString &s);
111     bool selectFirstBranch();
112     bool selectFirstChildBranch();
113     bool selectLastBranch();
114     bool selectLastChildBranch();
115     bool selectLastImage();
116     bool selectParent();
117     bool selectLatestAdded();
118     bool selectToggle(const QString &selectString);
119     void setFlagByName(const QString &s);
120     void setHeadingConfluencePageName();
121     void setHeadingPlainText(const QString &s);
122     void setHideExport(bool b);
123     void setHideLinkUnselected(bool b);
124     void setIncludeImagesHorizontally(bool b);
125     void setIncludeImagesVertically(bool b);
126     void setMapAnimCurve(int n);
127     void setMapAnimDuration(int n);
128     void setMapAuthor(const QString &s);
129     void setMapBackgroundColor(const QString &color);
130     void setMapComment(const QString &s);
131     void setMapDefLinkColor(const QString &color);
132     void setMapLinkStyle(const QString &style);
133     void setMapRotation(float a); // tested: ok
134     void setMapTitle(const QString &s);
135     void setMapZoom(float z); // tested: ok
136     void setNotePlainText(const QString &s);
137     void setFrameBorderWidth(int border);
138     void setFrameBrushColor(const QString &color);
139     void setFrameIncludeChildren(bool b);
140     void setFramePadding(int padding);
141     void setFramePenColor(const QString &color);
142     void setFrameType(const QString &type);
143     void setScaleFactor(qreal f);
144     void setSelectionBrushColor(const QString &color);
145     void setSelectionPenColor(const QString &color);
146     void setSelectionPenWidth(const qreal &);
147     void setTaskPriorityDelta(const int &n);
148     bool setTaskSleep(const QString &s);
149     void setURL(const QString &s);
150     void setVymLink(const QString &s);
151     void setXLinkColor(const QString &color);
152     void setXLinkStyle(const QString &style);
153     void setXLinkStyleBegin(const QString &style);
154     void setXLinkStyleEnd(const QString &style);
155     void setXLinkWidth(int w);
156     void sleep(int n);
157     void sortChildren(bool b);
158     void sortChildren();
159     void toggleFlagByUid(const QString &s);
160     void toggleFlagByName(const QString &s);
161     void toggleFrameIncludeChildren();
162     void toggleScroll();
163     void toggleTarget();
164     void toggleTask();
165     void undo();
166     bool unscroll();
167     void unscrollChildren();
168     void unselectAll();
169     void unsetFlagByName(const QString &s);
170
171   private:
172     VymModel *model;
173 };
174
175 #endif