Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/plugin/smartlaunchers/smartlauncheritem.h
1 | /*************************************************************************** | 1 | /*************************************************************************** | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2016 Kai Uwe Broulik <kde@privat.broulik.de> * | 2 | * Copyright (C) 2016, 2019 Kai Uwe Broulik <kde@privat.broulik.de> * | ||
3 | * * | 3 | * * | ||
4 | * This program is free software; you can redistribute it and/or modify * | 4 | * This program is free software; you can redistribute it and/or modify * | ||
5 | * it under the terms of the GNU General Public License as published by * | 5 | * it under the terms of the GNU General Public License as published by * | ||
6 | * the Free Software Foundation; either version 2 of the License, or * | 6 | * the Free Software Foundation; either version 2 of the License, or * | ||
7 | * (at your option) any later version. * | 7 | * (at your option) any later version. * | ||
8 | * * | 8 | * * | ||
9 | * This program is distributed in the hope that it will be useful, * | 9 | * This program is distributed in the hope that it will be useful, * | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
Show All 19 Lines | |||||
30 | namespace SmartLauncher { | 30 | namespace SmartLauncher { | ||
31 | 31 | | |||
32 | class Item : public QObject | 32 | class Item : public QObject | ||
33 | { | 33 | { | ||
34 | Q_OBJECT | 34 | Q_OBJECT | ||
35 | 35 | | |||
36 | Q_PROPERTY(QUrl launcherUrl READ launcherUrl WRITE setLauncherUrl NOTIFY launcherUrlChanged) | 36 | Q_PROPERTY(QUrl launcherUrl READ launcherUrl WRITE setLauncherUrl NOTIFY launcherUrlChanged) | ||
37 | 37 | | |||
38 | Q_PROPERTY(bool available READ available NOTIFY availableChanged) | | |||
39 | | ||||
40 | Q_PROPERTY(int count READ count NOTIFY countChanged) | 38 | Q_PROPERTY(int count READ count NOTIFY countChanged) | ||
41 | Q_PROPERTY(bool countVisible READ countVisible NOTIFY countVisibleChanged) | 39 | Q_PROPERTY(bool countVisible READ countVisible NOTIFY countVisibleChanged) | ||
42 | Q_PROPERTY(int progress READ progress NOTIFY progressChanged) | 40 | Q_PROPERTY(int progress READ progress NOTIFY progressChanged) | ||
43 | Q_PROPERTY(bool progressVisible READ progressVisible NOTIFY progressVisibleChanged) | 41 | Q_PROPERTY(bool progressVisible READ progressVisible NOTIFY progressVisibleChanged) | ||
44 | Q_PROPERTY(bool urgent READ urgent NOTIFY urgentChanged) | 42 | Q_PROPERTY(bool urgent READ urgent NOTIFY urgentChanged) | ||
45 | 43 | | |||
46 | public: | 44 | public: | ||
47 | explicit Item(QObject *parent = nullptr); | 45 | explicit Item(QObject *parent = nullptr); | ||
48 | ~Item() override = default; | 46 | ~Item() override = default; | ||
49 | 47 | | |||
50 | QUrl launcherUrl() const; | 48 | QUrl launcherUrl() const; | ||
51 | void setLauncherUrl(const QUrl &launcherUrl); | 49 | void setLauncherUrl(const QUrl &launcherUrl); | ||
52 | 50 | | |||
53 | bool available() const; | | |||
54 | | ||||
55 | int count() const; | 51 | int count() const; | ||
56 | bool countVisible() const; | 52 | bool countVisible() const; | ||
57 | int progress() const; | 53 | int progress() const; | ||
58 | bool progressVisible() const; | 54 | bool progressVisible() const; | ||
59 | bool urgent() const; | 55 | bool urgent() const; | ||
60 | 56 | | |||
61 | signals: | 57 | signals: | ||
62 | void launcherUrlChanged(const QUrl &launcherUrl); | 58 | void launcherUrlChanged(const QUrl &launcherUrl); | ||
63 | 59 | | |||
64 | void availableChanged(bool available); | | |||
65 | | ||||
66 | void countChanged(int count); | 60 | void countChanged(int count); | ||
67 | void countVisibleChanged(bool countVisible); | 61 | void countVisibleChanged(bool countVisible); | ||
68 | void progressChanged(int progress); | 62 | void progressChanged(int progress); | ||
69 | void progressVisibleChanged(bool progressVisible); | 63 | void progressVisibleChanged(bool progressVisible); | ||
70 | void urgentChanged(bool urgent); | 64 | void urgentChanged(bool urgent); | ||
71 | 65 | | |||
72 | private: | 66 | private: | ||
73 | void init(); | 67 | void init(); | ||
Show All 9 Lines | |||||
83 | 77 | | |||
84 | static QWeakPointer<Backend> s_backend; | 78 | static QWeakPointer<Backend> s_backend; | ||
85 | 79 | | |||
86 | QSharedPointer<Backend> m_backendPtr; | 80 | QSharedPointer<Backend> m_backendPtr; | ||
87 | 81 | | |||
88 | QUrl m_launcherUrl; | 82 | QUrl m_launcherUrl; | ||
89 | QString m_storageId; | 83 | QString m_storageId; | ||
90 | 84 | | |||
91 | bool m_available = false; | | |||
92 | bool m_inited = false; | 85 | bool m_inited = false; | ||
93 | 86 | | |||
94 | int m_count = 0; | 87 | int m_count = 0; | ||
95 | bool m_countVisible = false; | 88 | bool m_countVisible = false; | ||
96 | int m_progress = 0; | 89 | int m_progress = 0; | ||
97 | bool m_progressVisible = false; | 90 | bool m_progressVisible = false; | ||
98 | bool m_urgent = false; | 91 | bool m_urgent = false; | ||
99 | 92 | | |||
100 | }; | 93 | }; | ||
101 | 94 | | |||
102 | } // namespace SmartLauncher | 95 | } // namespace SmartLauncher | ||
103 | 96 | | |||
104 | #endif // SMARTLAUNCHER_ITEM_H | 97 | #endif // SMARTLAUNCHER_ITEM_H |