summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/cutils.hpp
blob: e1319a44a73da5ae9a80d3d1198df89a73b95730 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include <qobject.h>
#include <QtQuick/QQuickItem>

class CUtils : public QObject {
    Q_OBJECT;
    QML_NAMED_ELEMENT(CUtils);
    QML_SINGLETON;

public:
    Q_INVOKABLE void saveItem(QQuickItem* target, const QUrl& path) const;
    Q_INVOKABLE void saveItem(QQuickItem* target, const QUrl& path, const QRect& rect) const;
    Q_INVOKABLE void saveItem(QQuickItem* target, const QUrl& path, QJSValue onSaved) const;
    Q_INVOKABLE void saveItem(QQuickItem* target, const QUrl& path, QJSValue onSaved, QJSValue onFailed) const;
    Q_INVOKABLE void saveItem(QQuickItem* target, const QUrl& path, const QRect& rect, QJSValue onSaved) const;
    Q_INVOKABLE void saveItem(QQuickItem* target, const QUrl& path, const QRect& rect, QJSValue onSaved, QJSValue onFailed) const;

    Q_INVOKABLE bool copyFile(const QUrl& source, const QUrl& target) const;
    Q_INVOKABLE bool copyFile(const QUrl& source, const QUrl& target, bool overwrite) const;
};