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

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

item.h
Go to the documentation of this file.
1 /*
2 * Copyright © 2013 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: Thomas Voß <thomas.voss@canonical.com>
17 */
18 #ifndef COM_UBUNTU_CONTENT_ITEM_H_
19 #define COM_UBUNTU_CONTENT_ITEM_H_
20
21 #include <QtDBus>
22 #include <QObject>
23 #include <QSharedPointer>
24 #include <QUrl>
25
26 namespace com
27 {
28 namespace ubuntu
29 {
30 namespace content
31 {
32
33 class Item : public QObject
34 {
35 Q_OBJECT
36 Q_PROPERTY(QUrl url READ url() WRITE setUrl)
37 Q_PROPERTY(QString name READ name WRITE setName)
38 Q_PROPERTY(QString text READ text WRITE setText)
39 Q_PROPERTY(QByteArray stream READ stream WRITE setStream)
40 Q_PROPERTY(QString streamType READ streamType WRITE setStreamType)
41
42 public:
43 Item(const QUrl& = QUrl(), QObject* = nullptr);
44 Item(const Item&);
45 virtual ~Item();
46
47 Item& operator=(const Item&);
48 bool operator==(const Item&) const;
49
50 Q_INVOKABLE const QUrl& url() const;
51 Q_INVOKABLE void setUrl(const QUrl &url) const;
52 Q_INVOKABLE const QString& name() const;
53 Q_INVOKABLE void setName(const QString &name) const;
54 Q_INVOKABLE const QString text() const;
55 Q_INVOKABLE void setText(const QString &text) const;
56 Q_INVOKABLE const QByteArray& stream() const;
57 Q_INVOKABLE void setStream(const QByteArray &stream) const;
58 Q_INVOKABLE const QString& streamType() const;
59 Q_INVOKABLE void setStreamType(const QString &type) const;
60
61 private:
62 struct Private;
63 QSharedPointer<Private> d;
64 };
65
66 }
67 }
68 }
69
70 Q_DECL_EXPORT
71 QDBusArgument &operator<<(QDBusArgument &argument,
72 const com::ubuntu::content::Item &item);
73
74 Q_DECL_EXPORT
75 const QDBusArgument &operator>>(const QDBusArgument &argument,
76 com::ubuntu::content::Item &item);
77
78 Q_DECLARE_METATYPE(com::ubuntu::content::Item)
79
80
81 #endif // COM_UBUNTU_CONTENT_ITEM_H_
QObject
com::ubuntu::content::Item::name
setUrlQString name
Definition: item.h:37
com::ubuntu::content::Item::setStream
Q_INVOKABLE void setStream(const QByteArray &stream) const
com::ubuntu::content::Item::setUrl
Q_INVOKABLE void setUrl(const QUrl &url) const
com::ubuntu::content::Item::Item
Item(const QUrl &=QUrl(), QObject *=nullptr)
com::ubuntu::content::Item::setName
Q_INVOKABLE void setName(const QString &name) const
com::ubuntu::content::Item
Definition: item.h:34
com::ubuntu::content::Item::streamType
Q_INVOKABLE const QString & streamType() const
com::ubuntu::content::Item::url
Q_INVOKABLE const QUrl & url() const
operator>>
Q_DECL_EXPORT const QDBusArgument & operator>>(const QDBusArgument &argument, com::ubuntu::content::Item &item)
operator<<
Q_DECL_EXPORT QDBusArgument & operator<<(QDBusArgument &argument, const com::ubuntu::content::Item &item)
com::ubuntu::content::Item::text
QString text
Definition: item.h:38
com::ubuntu::content::Item::setStreamType
Q_INVOKABLE void setStreamType(const QString &type) const
com::ubuntu::content::Item::stream
Q_INVOKABLE const QByteArray & stream() const
com::ubuntu::content::Item::setText
Q_INVOKABLE void setText(const QString &text) const
com::ubuntu::content::Item::~Item
virtual ~Item()
com::ubuntu::content::Item::name
Q_INVOKABLE const QString & name() const
com::ubuntu::content::Item::url
QUrl url
Definition: item.h:36
com::ubuntu::content::Item::operator=
Item & operator=(const Item &)
com::ubuntu::content::Item::stream
QByteArray stream
Definition: item.h:39
com
Definition: hub.h:32
com::ubuntu::content::Item::Item
Item(const Item &)
com::ubuntu::content::Item::streamType
QString streamType
Definition: item.h:40
com::ubuntu::content::Item::operator==
bool operator==(const Item &) const
com::ubuntu::content::Item::text
Q_INVOKABLE const QString text() const