File indexing completed on 2024-05-12 05:22:11
0001 /* 0002 * SPDX-FileCopyrightText: 2014 Daniel Vrátil <dvratil@redhat.com> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #pragma once 0008 0009 #include "kgapiblogger_export.h" 0010 #include "object.h" 0011 0012 #include <QStringList> 0013 #include <QVariant> 0014 0015 #include <QDateTime> 0016 0017 namespace KGAPI2 0018 { 0019 namespace Blogger 0020 { 0021 0022 class KGAPIBLOGGER_EXPORT Post : public KGAPI2::Object 0023 { 0024 public: 0025 Post(); 0026 ~Post() override; 0027 0028 QString id(); 0029 void setId(const QString &id); 0030 0031 QString blogId(); 0032 void setBlogId(const QString &id); 0033 0034 QDateTime published() const; 0035 void setPublished(const QDateTime &published); 0036 0037 QDateTime updated() const; 0038 void setUpdated(const QDateTime &updated); 0039 0040 QUrl url() const; 0041 void setUrl(const QUrl &url); 0042 0043 QString title() const; 0044 void setTitle(const QString &title); 0045 0046 QString content() const; 0047 void setContent(const QString &content); 0048 0049 QString authorId() const; 0050 QString authorName() const; 0051 QUrl authorUrl() const; 0052 QUrl authorImageUrl() const; 0053 0054 uint commentsCount() const; 0055 0056 QStringList labels() const; 0057 void setLabels(const QStringList &labels); 0058 0059 QVariant customMetaData() const; 0060 void setCustomMetaData(const QVariant &metadata); 0061 0062 QString location() const; 0063 void setLocation(const QString &location); 0064 0065 double latitude() const; 0066 void setLatitude(double lat); 0067 0068 double longitude() const; 0069 void setLongitute(double lng); 0070 0071 QList<QUrl> images() const; 0072 void setImages(const QList<QUrl> &images); 0073 0074 QString status() const; 0075 0076 static PostPtr fromJSON(const QByteArray &json); 0077 static ObjectsList fromJSONFeed(const QByteArray &json, FeedData &feedData); 0078 static QByteArray toJSON(const PostPtr &post); 0079 0080 private: 0081 Q_DISABLE_COPY(Post) 0082 0083 class Private; 0084 Private *const d; 0085 friend class Private; 0086 }; 0087 0088 } // namespace Blogger 0089 } // namespace KGAPI2