Content Hub: /build/content-hub-git/src/content-hub/include/com/ubuntu/content/paste.h Source File

Content Hub 0.2.0 A session-wide content-exchange service |

paste.h
Go to the documentation of this file.
1 /*
2 * Copyright © 2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Ken VanDine <ken.vandine@canonical.com>
17 */
18 #ifndef COM_UBUNTU_CONTENT_PASTE_H_
19 #define COM_UBUNTU_CONTENT_PASTE_H_
20
21 #include <QObject>
22 #include <QSharedPointer>
23 #include <QMimeData>
24 #include <QString>
25
26 namespace com
27 {
28 namespace ubuntu
29 {
30 namespace content
31 {
32
33 class Paste : public QObject
34 {
35 Q_OBJECT
36 Q_ENUMS(State)
37 Q_PROPERTY(int id READ id)
38 Q_PROPERTY(QString source READ source)
39
40 public:
41 enum State
42 {
43 created,
44 charged,
45 saved,
46 collected
47 };
48
49 Paste(const Paste&) = delete;
50 virtual ~Paste();
51
52 Paste& operator=(const Paste&) = delete;
53
54 Q_INVOKABLE virtual int id() const;
55 Q_INVOKABLE virtual QMimeData* mimeData();
56 Q_INVOKABLE virtual QString source() const;
57
58 private:
59 struct Private;
60 friend struct Private;
61 friend class Hub;
62 QSharedPointer<Private> d;
63
64 Paste(const QSharedPointer<Private>&, QObject* parent = nullptr);
65 };
66 }
67 }
68 }
69
70 #endif // COM_UBUNTU_CONTENT_PASTE_H_
com::ubuntu::content::Paste::source
virtual Q_INVOKABLE QString source() const
QObject
com::ubuntu::content::Paste
Definition: paste.h:34
com::ubuntu::content::Paste::Paste
Paste(const Paste &)=delete
com::ubuntu::content::Paste::id
virtual Q_INVOKABLE int id() const
com::ubuntu::content::Paste::created
@ created
Definition: paste.h:43
com::ubuntu::content::Paste::charged
@ charged
Definition: paste.h:44
com::ubuntu::content::Paste::mimeData
virtual Q_INVOKABLE QMimeData * mimeData()
com::ubuntu::content::Hub
Definition: hub.h:42
com::ubuntu::content::Paste::Private
friend struct Private
Definition: paste.h:59
com::ubuntu::content::Paste::saved
@ saved
Definition: paste.h:45
com::ubuntu::content::Paste::collected
@ collected
Definition: paste.h:46
com::ubuntu::content::Paste::State
State
Definition: paste.h:42
com::ubuntu::content::Paste::~Paste
virtual ~Paste()
com
Definition: hub.h:32
com::ubuntu::content::Paste::operator=
Paste & operator=(const Paste &)=delete
com::ubuntu::content::Paste::source
QString source
Definition: paste.h:38