KBlog

blogpost.h
1 /*
2  This file is part of the kblog library.
3 
4  Copyright (c) 2007 Christian Weilbach <[email protected]>
5  Copyright (c) 2007 Mike McQuaid <[email protected]>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #ifndef KBLOG_BLOGPOSTING_H
24 #define KBLOG_BLOGPOSTING_H
25 
26 #include <kblog_export.h>
27 
28 #include <QUrl>
29 #include <kcalendarcore/journal.h>
30 #include <QtAlgorithms>
31 
32 class QStringList;
33 
34 class QDateTime;
35 class QUrl;
36 
37 namespace KBlog
38 {
39 class Blog;
40 class BlogPostPrivate;
41 
65 class KBLOG_EXPORT BlogPost
66 {
67 
68 public:
69 
73  BlogPost(const KBlog::BlogPost &post);
74 
79  explicit BlogPost(const QString &postId = QString());
80 
84  explicit BlogPost(const KCalendarCore::Journal::Ptr &journal);
85 
89  virtual ~BlogPost();
90 
96  KCalendarCore::Journal::Ptr journal(const Blog &blog) const;
97 
102  QString journalId() const;
103 
110  bool isPrivate() const;
111 
119  void setPrivate(bool privatePost);
120 
127  QString postId() const;
128 
135  void setPostId(const QString &postId);
136 
143  QString title() const;
144 
151  void setTitle(const QString &title);
152 
159  QString content() const;
160 
167  void setContent(const QString &content);
168 
169 // QString abbreviatedContent() const; // TODO check if necessary
170 // void setAbbreviatedContent( const QString &abbreviatedContent );
171 
178  QString additionalContent() const;
179 
186  void setAdditionalContent(const QString &additionalContent);
187 
195  QString slug() const;
196 
204  void setSlug(const QString &slug);
211  QUrl link() const;
212 
219  void setLink(const QUrl &link) const;
220 
227  QUrl permaLink() const;
228 
235  void setPermaLink(const QUrl &permalink) const;
236 
243  bool isCommentAllowed() const;
244 
251  void setCommentAllowed(bool commentAllowed);
252 
259  bool isTrackBackAllowed() const; // pings in Movable Type
260 
267  void setTrackBackAllowed(bool allowTrackBacks);
268 
275  QString summary() const; // excerpts in Movable Type
276 
283  void setSummary(const QString &summary);
284 
291  QStringList tags() const; // keywords in Movable Type
292 
299  void setTags(const QStringList &tags);
300 
301 // QList<QUrl> trackBackUrls() const; // TODO check if necessary
302 // void setTrackBackUrls( const QList<QUrl> &trackBackUrls );
303 
310  QString mood() const;
311 
318  void setMood(const QString &mood);
319 
326  QString music() const;
327 
334  void setMusic(const QString &music);
335 
342  QStringList categories() const;
343 
351  void setCategories(const QStringList &categories);
352 
359  QDateTime creationDateTime() const;
360 
368  void setCreationDateTime(const QDateTime &datetime);
369 
376  QDateTime modificationDateTime() const;
377 
384  void setModificationDateTime(const QDateTime &datetime);
385 
390  enum Status {
407  Error
408  };
409 
416  Status status() const;
417 
424  void setStatus(Status status);
425 
432  QString error() const;
433 
440  void setError(const QString &error);
441 
445  BlogPost &operator=(const BlogPost &post);
446 
450  void swap(BlogPost &other)
451  {
452  qSwap(this->d_ptr, other.d_ptr);
453  }
454 
455 private:
456  BlogPostPrivate *d_ptr; //krazy:exclude=dpointer can't constify due to bic and swap being declared inline
457 };
458 
459 } //namespace KBlog
460 
461 #endif
Status of a successfully fetched post.
Definition: blogpost.h:395
Status of a successfully created post.
Definition: blogpost.h:398
Status
The enumartion of the different post status, reflecting the status changes on the server...
Definition: blogpost.h:390
Status of a successfully modified post.
Definition: blogpost.h:401
Namespace for blog related classes.
Definition: blog.h:53
A class that represents a blog post on the server.
Definition: blogpost.h:65
Status of a freshly constructed post on the client.
Definition: blogpost.h:392
A class that provides methods to call functions on a supported blog web application.
Definition: blog.h:72
Status of a successfully removed post.
Definition: blogpost.h:404
void swap(BlogPost &other)
The swap operator.
Definition: blogpost.h:450
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon May 25 2020 22:45:27 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.