Loading...
Searching...
No Matches
ViewContext.hpp
1#pragma once
2#include <score_plugin_js_export.h>
3
4#include <QObject>
5#include <QString>
6#include <QStringList>
7
8#include <verdigris>
9
10namespace score
11{
12struct DocumentContext;
13}
14namespace Scenario
15{
16class ScenarioDocumentView;
17class ScenarioDocumentPresenter;
18}
19
20namespace JS
21{
26class SCORE_PLUGIN_JS_EXPORT JsViewContext : public QObject
27{
28 W_OBJECT(JsViewContext)
29public:
30 // Screenshots
31 bool grabScene(QString path);
32 W_SLOT(grabScene)
33 bool grabMainWindow(QString path);
34 W_SLOT(grabMainWindow)
35 bool grabScreen(QString path);
36 W_SLOT(grabScreen)
37
38
40 bool grabWidget(QObject* widget, QString path);
41 W_SLOT(grabWidget)
42
43 // Reaching the rest of the UI. Anything declared a slot on a QObject is
44 // already callable from QML; what was missing was a way to get at the
45 // objects. expandAll, setCurrentIndex, resize and the rest are Qt's own.
46
47
49 QObject* panel(QString name);
50 W_SLOT(panel)
51
52
54 QObject* child(QObject* parent, QString className);
55 W_SLOT(child)
56
57
60 QStringList panels();
61 W_SLOT(panels)
62
63 // Zoom / scroll
64 void zoom(double zx, double zy);
65 W_SLOT(zoom)
66 void scroll(double dx, double dy);
67 W_SLOT(scroll)
68 void setZoomRatio(double r);
69 W_SLOT(setZoomRatio)
70
71 // Navigation / focus
72 void centerOn(QObject* process);
73 W_SLOT(centerOn)
74 void goToInterval(QObject* interval);
75 W_SLOT(goToInterval)
76 void fit();
77 W_SLOT(fit)
78 void recenter();
79 W_SLOT(recenter)
80
81 // Dataflow / temporal mode
82 void setNodal(bool nodal);
83 W_SLOT(setNodal)
84 bool isNodal();
85 W_SLOT(isNodal)
86
87private:
88 const score::DocumentContext* ctx();
91};
92}
Definition ViewContext.hpp:27
The ScenarioDocumentPresenter class.
Definition ScenarioDocumentPresenter.hpp:59
Definition ScenarioDocumentView.hpp:157
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
Base toolkit upon which the software is built.
Definition Application.cpp:116
Definition DocumentContext.hpp:18