Content Hub  1.0.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_LOMIRI_CONTENT_PASTE_H_
19 #define COM_LOMIRI_CONTENT_PASTE_H_
20 
21 #include <QObject>
22 #include <QSharedPointer>
23 #include <QMimeData>
24 #include <QString>
25 
26 namespace com
27 {
28 namespace lomiri
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  {
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_LOMIRI_CONTENT_PASTE_H_
com::lomiri::content::Paste::Paste
Paste(const Paste &)=delete
QObject
com::lomiri::content::Hub
Definition: hub.h:41
com::lomiri::content::Paste::charged
@ charged
Definition: paste.h:44
com::lomiri::content::Paste::Private
friend struct Private
Definition: paste.h:59
com::lomiri::content::Paste::saved
@ saved
Definition: paste.h:45
com::lomiri::content::Paste::mimeData
virtual Q_INVOKABLE QMimeData * mimeData()
com::lomiri::content::Paste
Definition: paste.h:33
com::lomiri::content::Paste::id
int id
Definition: paste.h:37
com::lomiri::content::Paste::source
QString source
Definition: paste.h:38
com::lomiri::content::Paste::operator=
Paste & operator=(const Paste &)=delete
com
Definition: hub.h:31
com::lomiri::content::Paste::collected
@ collected
Definition: paste.h:46
com::lomiri::content::Paste::created
@ created
Definition: paste.h:43
com::lomiri::content::Paste::~Paste
virtual ~Paste()
com::lomiri::content::Paste::State
State
Definition: paste.h:41