Changeset View
Changeset View
Standalone View
Standalone View
applets/mediaframe/plugin/mediaframe.h
Show All 27 Lines | |||||
28 | 28 | | |||
29 | #include <KIO/Job> | 29 | #include <KIO/Job> | ||
30 | 30 | | |||
31 | class MediaFrame : public QObject | 31 | class MediaFrame : public QObject | ||
32 | { | 32 | { | ||
33 | Q_OBJECT | 33 | Q_OBJECT | ||
34 | 34 | | |||
35 | Q_PROPERTY(int count READ count NOTIFY countChanged) | 35 | Q_PROPERTY(int count READ count NOTIFY countChanged) | ||
36 | Q_PROPERTY(int historyLength READ historyLength NOTIFY historyLengthChanged) | ||||
36 | Q_PROPERTY(bool random READ random WRITE setRandom NOTIFY randomChanged) | 37 | Q_PROPERTY(bool random READ random WRITE setRandom NOTIFY randomChanged) | ||
37 | 38 | | |||
38 | public: | 39 | public: | ||
39 | 40 | | |||
40 | enum AddOption | 41 | enum AddOption | ||
41 | { | 42 | { | ||
42 | NON_RECURSIVE, | 43 | NON_RECURSIVE, | ||
43 | RECURSIVE | 44 | RECURSIVE | ||
44 | }; | 45 | }; | ||
45 | Q_ENUM(AddOption) | 46 | Q_ENUM(AddOption) | ||
46 | 47 | | |||
47 | explicit MediaFrame(QObject *parent = nullptr); | 48 | explicit MediaFrame(QObject *parent = nullptr); | ||
48 | ~MediaFrame() override; | 49 | ~MediaFrame() override; | ||
49 | 50 | | |||
50 | int count() const; | 51 | int count() const; | ||
51 | 52 | | |||
53 | int historyLength() const; | ||||
54 | | ||||
52 | bool random() const; | 55 | bool random() const; | ||
53 | void setRandom(bool random); | 56 | void setRandom(bool random); | ||
54 | 57 | | |||
55 | Q_INVOKABLE bool isDir(const QString &path); | 58 | Q_INVOKABLE bool isDir(const QString &path); | ||
56 | Q_INVOKABLE bool isDirEmpty(const QString &path); | 59 | Q_INVOKABLE bool isDirEmpty(const QString &path); | ||
57 | Q_INVOKABLE bool isFile(const QString &path); | 60 | Q_INVOKABLE bool isFile(const QString &path); | ||
58 | 61 | | |||
59 | Q_INVOKABLE void add(const QString &path); | 62 | Q_INVOKABLE void add(const QString &path); | ||
60 | Q_INVOKABLE void add(const QString &path, AddOption option); | 63 | Q_INVOKABLE void add(const QString &path, AddOption option); | ||
61 | Q_INVOKABLE void clear(); | 64 | Q_INVOKABLE void clear(); | ||
62 | 65 | | |||
63 | Q_INVOKABLE void watch(const QString &path); | 66 | Q_INVOKABLE void watch(const QString &path); | ||
64 | 67 | | |||
65 | Q_INVOKABLE bool isAdded(const QString &path); | 68 | Q_INVOKABLE bool isAdded(const QString &path); | ||
66 | 69 | | |||
67 | Q_INVOKABLE void get(QJSValue callback); | 70 | Q_INVOKABLE void get(QJSValue callback); | ||
68 | Q_INVOKABLE void get(QJSValue callback, QJSValue error_callback); | 71 | Q_INVOKABLE void get(QJSValue callback, QJSValue error_callback); | ||
69 | 72 | | |||
70 | Q_INVOKABLE void pushHistory(const QString &string); | 73 | Q_INVOKABLE void pushHistory(const QString &string); | ||
71 | Q_INVOKABLE QString popHistory(); | 74 | Q_INVOKABLE QString popHistory(); | ||
72 | Q_INVOKABLE int historyLength(); | | |||
73 | 75 | | |||
74 | Q_INVOKABLE void pushFuture(const QString &string); | 76 | Q_INVOKABLE void pushFuture(const QString &string); | ||
75 | Q_INVOKABLE QString popFuture(); | 77 | Q_INVOKABLE QString popFuture(); | ||
76 | Q_INVOKABLE int futureLength(); | 78 | Q_INVOKABLE int futureLength(); | ||
77 | 79 | | |||
78 | Q_SIGNALS: | 80 | Q_SIGNALS: | ||
79 | void countChanged(); | 81 | void countChanged(); | ||
82 | void historyLengthChanged(); | ||||
80 | void randomChanged(); | 83 | void randomChanged(); | ||
81 | void itemChanged(const QString &path); | 84 | void itemChanged(const QString &path); | ||
82 | 85 | | |||
83 | private Q_SLOTS: | 86 | private Q_SLOTS: | ||
84 | void slotItemChanged(const QString &path); | 87 | void slotItemChanged(const QString &path); | ||
85 | void slotFinished(KJob *job); | 88 | void slotFinished(KJob *job); | ||
86 | 89 | | |||
87 | private: | 90 | private: | ||
Show All 22 Lines |