KBlog

blog.h
Go to the documentation of this file.
1 /*
2  This file is part of the kblog library.
3 
4  SPDX-FileCopyrightText: 2004 Reinhold Kainhofer <[email protected]>
5  SPDX-FileCopyrightText: 2006-2007 Christian Weilbach <[email protected]>
6  SPDX-FileCopyrightText: 2007 Mike McQuaid <[email protected]>
7 
8  SPDX-License-Identifier: LGPL-2.0-or-later
9 */
10 
11 #ifndef KBLOG_BLOG_H
12 #define KBLOG_BLOG_H
13 
14 #include <kblog_export.h>
15 
16 #include <QObject>
17 
18 template <class T, class S> class QMap;
19 
20 class QTimeZone;
21 class QUrl;
22 
40 namespace KBlog
41 {
42 
43 class BlogPost;
44 class BlogComment;
45 class BlogMedia;
46 class BlogPrivate;
47 
59 class KBLOG_EXPORT Blog : public QObject
60 {
61  Q_OBJECT
62 public:
73  explicit Blog(const QUrl &server, QObject *parent = nullptr,
74  const QString &applicationName = QString(),
75  const QString &applicationVersion = QString());
76 
80  virtual ~Blog();
81 
85  enum ErrorType {
97  Other
98  };
99 
103  QString userAgent() const;
104 
114  void setUserAgent(const QString &applicationName,
115  const QString &applicationVersion);
116 
120  virtual QString interfaceName() const = 0;
121 
127  virtual void setBlogId(const QString &blogId);
128 
133  QString blogId() const;
134 
141  virtual void setPassword(const QString &password);
142 
147  QString password() const;
148 
154  virtual void setUsername(const QString &username);
155 
161  QString username() const;
162 
169  virtual void setUrl(const QUrl &url);
170 
176  QUrl url() const;
177 
184  virtual void setTimeZone(const QTimeZone &timeZone);
185 
191  QTimeZone timeZone();
192 
200  virtual void listRecentPosts(int number) = 0;
201 
212  virtual void fetchPost(KBlog::BlogPost *post) = 0;
213 
224  virtual void modifyPost(KBlog::BlogPost *post) = 0;
225 
232  virtual void createPost(KBlog::BlogPost *post) = 0;
233 
243  virtual void removePost(KBlog::BlogPost *post) = 0;
244 
245 Q_SIGNALS:
253  void listedRecentPosts(
254  const QList<KBlog::BlogPost> &posts);
255 
263  void createdPost(KBlog::BlogPost *post);
264 
272  void fetchedPost(KBlog::BlogPost *post);
273 
281  void modifiedPost(KBlog::BlogPost *post);
282 
290  void removedPost(KBlog::BlogPost *post);
291 
300  void error(KBlog::Blog::ErrorType type, const QString &errorMessage);
301 
311  void errorPost(KBlog::Blog::ErrorType type,
312  const QString &errorMessage, KBlog::BlogPost *post);
313 
323  void errorMedia(KBlog::Blog::ErrorType type,
324  const QString &errorMessage, KBlog::BlogMedia *media);
325 
336  void errorComment(KBlog::Blog::ErrorType type,
337  const QString &errorMessage, KBlog::BlogPost *post,
338  KBlog::BlogComment *comment);
339 
340 protected:
342  BlogPrivate *const d_ptr;
343 
355  Blog(const QUrl &server, BlogPrivate &dd, QObject *parent = nullptr,
356  const QString &applicationName = QString(),
357  const QString &applicationVersion = QString());
358 
359 private:
360  Q_DECLARE_PRIVATE(Blog)
361 };
362 
363 } //namespace KBlog
364 #endif
A class that represents a media object on the server.
Definition: blogmedia.h:36
Definition: blog.h:18
A parsing error.
Definition: blog.h:91
A class that represents a blog comment on the blog post.
Definition: blogcomment.h:38
ErrorType
Enumeration for possible errors.
Definition: blog.h:85
An error on authentication.
Definition: blog.h:93
Namespace for blog related classes.
Definition: blog.h:40
An error in the syndication client.
Definition: blog.h:89
A class that represents a blog post on the server.
Definition: blogpost.h:52
BlogPrivate *const d_ptr
A pointer to the corresponding &#39;Private&#39; class.
Definition: blog.h:342
An error where the method called is not supported by this object.
Definition: blog.h:95
A class that provides methods to call functions on a supported blog web application.
Definition: blog.h:59
An error in the XML-RPC client.
Definition: blog.h:87
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jul 13 2020 23:13:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.