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  {
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_
friend struct Private
Definition: paste.h:59
Definition: hub.h:31
virtual Q_INVOKABLE QString source() const
virtual Q_INVOKABLE QMimeData * mimeData()
Paste & operator=(const Paste &)=delete
Paste(const Paste &)=delete
virtual Q_INVOKABLE int id() const