KBlog Client Library
blogpost.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KBLOG_BLOGPOSTING_H
00024 #define KBLOG_BLOGPOSTING_H
00025
00026 #include <kblog/kblog_export.h>
00027
00028 #include <kurl.h>
00029
00030 #include <QtCore/QtAlgorithms>
00031
00032 class QStringList;
00033
00034 class KDateTime;
00035 class KUrl;
00036
00037 namespace KCal {
00038 class Journal;
00039 }
00040
00041 namespace KBlog {
00042 class Blog;
00043 class BlogPostPrivate;
00044
00068 class KBLOG_EXPORT BlogPost
00069 {
00070
00071 public:
00072
00076 BlogPost( const KBlog::BlogPost &post );
00077
00082 explicit BlogPost( const QString &postId = QString() );
00083
00087 explicit BlogPost( const KCal::Journal &journal );
00088
00092 virtual ~BlogPost();
00093
00099 KCal::Journal *journal( const Blog &blog ) const;
00100
00105 QString journalId() const;
00106
00113 bool isPrivate() const;
00114
00122 void setPrivate( bool privatePost );
00123
00130 QString postId() const;
00131
00138 void setPostId( const QString &postId );
00139
00146 QString title() const;
00147
00154 void setTitle( const QString &title );
00155
00162 QString content() const;
00163
00170 void setContent( const QString &content );
00171
00172
00173
00174
00181 KUrl link() const;
00182
00189 void setLink( const KUrl &link ) const;
00190
00197 KUrl permaLink() const;
00198
00205 void setPermaLink( const KUrl &permalink ) const;
00206
00213 bool isCommentAllowed() const;
00214
00221 void setCommentAllowed( bool commentAllowed );
00222
00229 bool isTrackBackAllowed() const;
00230
00237 void setTrackBackAllowed ( bool allowTrackBacks );
00238
00245 QString summary() const;
00246
00253 void setSummary( const QString &summary );
00254
00261 QStringList tags() const;
00262
00269 void setTags( const QStringList &tags );
00270
00271
00272
00273
00280 QString mood() const;
00281
00288 void setMood( const QString &mood );
00289
00296 QString music() const;
00297
00304 void setMusic( const QString &music );
00305
00312 QStringList categories() const;
00313
00320 void setCategories( const QStringList &categories );
00321
00328 KDateTime creationDateTime() const;
00329
00337 void setCreationDateTime( const KDateTime &datetime );
00338
00345 KDateTime modificationDateTime() const;
00346
00353 void setModificationDateTime( const KDateTime &datetime );
00354
00359 enum Status {
00361 New,
00364 Fetched,
00367 Created,
00370 Modified,
00373 Removed,
00376 Error
00377 };
00378
00385 Status status() const;
00386
00393 void setStatus( Status status );
00394
00401 QString error() const;
00402
00409 void setError( const QString &error );
00410
00414 BlogPost &operator=( const BlogPost &post );
00415
00419 void swap( BlogPost &other ) { qSwap( this->d_ptr, other.d_ptr ); }
00420
00421 private:
00422 BlogPostPrivate *d_ptr;
00423 };
00424
00425 }
00426
00427 #endif