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 QString additionalContent() const;
00182
00189 void setAdditionalContent( const QString &additionalContent );
00190
00198 QString slug() const;
00199
00207 void setSlug( const QString &slug );
00214 KUrl link() const;
00215
00222 void setLink( const KUrl &link ) const;
00223
00230 KUrl permaLink() const;
00231
00238 void setPermaLink( const KUrl &permalink ) const;
00239
00246 bool isCommentAllowed() const;
00247
00254 void setCommentAllowed( bool commentAllowed );
00255
00262 bool isTrackBackAllowed() const;
00263
00270 void setTrackBackAllowed ( bool allowTrackBacks );
00271
00278 QString summary() const;
00279
00286 void setSummary( const QString &summary );
00287
00294 QStringList tags() const;
00295
00302 void setTags( const QStringList &tags );
00303
00304
00305
00306
00313 QString mood() const;
00314
00321 void setMood( const QString &mood );
00322
00329 QString music() const;
00330
00337 void setMusic( const QString &music );
00338
00345 QStringList categories() const;
00346
00354 void setCategories( const QStringList &categories );
00355
00362 KDateTime creationDateTime() const;
00363
00371 void setCreationDateTime( const KDateTime &datetime );
00372
00379 KDateTime modificationDateTime() const;
00380
00387 void setModificationDateTime( const KDateTime &datetime );
00388
00393 enum Status {
00395 New,
00398 Fetched,
00401 Created,
00404 Modified,
00407 Removed,
00410 Error
00411 };
00412
00419 Status status() const;
00420
00427 void setStatus( Status status );
00428
00435 QString error() const;
00436
00443 void setError( const QString &error );
00444
00448 BlogPost &operator=( const BlogPost &post );
00449
00453 void swap( BlogPost &other ) { qSwap( this->d_ptr, other.d_ptr ); }
00454
00455 private:
00456 BlogPostPrivate *d_ptr;
00457 };
00458
00459 }
00460
00461 #endif