@@ -25,12 +25,22 @@
25class QQuickItem;
25class QQuickItem;
26class QQuickItemGrabResult;
26class QQuickItemGrabResult;
29+ * SessionScreenshoter saves to disk screenshots of the given item.
30+ * Images are saved into $HOME/.cache/app_shots/appId.png
31+ * It also handles giving back the screenshot path if it already exists (e.g. because a reboot)
28class SessionScreenshoter : public QObject
33class SessionScreenshoter : public QObject
37+ /// appId is the key of the screenshot name.
32 Q_PROPERTY(QString appId READ appId WRITE setAppdId NOTIFY appdIdChanged)
38 Q_PROPERTY(QString appId READ appId WRITE setAppdId NOTIFY appdIdChanged)
40+ /// path where the screenshot is saved, can be empty if no screenshot has been taken yet.
33 Q_PROPERTY(QString path READ path NOTIFY pathChanged)
41 Q_PROPERTY(QString path READ path NOTIFY pathChanged)
43+ /// target item for the screenshot taking.
34 Q_PROPERTY(QQuickItem *target READ target WRITE setTarget NOTIFY targetChanged)
44 Q_PROPERTY(QQuickItem *target READ target WRITE setTarget NOTIFY targetChanged)
@@ -44,13 +54,18 @@ public:
45 QString path() const;
55 QString path() const;
57+ /// Starts taking a screenshot. Emits screenshotTaken when ready.
47 Q_INVOKABLE void take();
58 Q_INVOKABLE void take();
60+ /// Removes the existing screenshot
48 Q_INVOKABLE void removeScreenshot();
61 Q_INVOKABLE void removeScreenshot();
51 void appdIdChanged();
64 void appdIdChanged();
52 void targetChanged();
65 void targetChanged();
53 void pathChanged();
66 void pathChanged();
68+ /// Signals screenshot taking has finished.
54 void screenshotTaken();
69 void screenshotTaken();
56private Q_SLOTS:
71private Q_SLOTS: