KBlog Client Library
KBlog::BlogPost Class Reference
#include <blogpost.h>
Detailed Description
A class that represents a blog post on the server.
KBlog::BlogPost *post = new BlogPost(); post->setTitle( "This is the title." ); post->setContent( "Here is some the content..." ); post->setPrivate( true ); // false on default connect( backend, createdPost( KBlog::BlogPost* ), this, createdPost( KBlog::BlogPost* ); backend->createPost( post ); ... void createdPost( KBlog::BlogPost* post ) { setMyFancyGUIPostId( post->postId() ); setMyFancyGUIPermaLink( post->permaLink() ); }
Definition at line 68 of file blogpost.h.
Public Types | |
enum | Status { New, Fetched, Created, Modified, Removed, Error } |
Public Member Functions | |
BlogPost (const KCal::Journal &journal) | |
BlogPost (const QString &postId=QString()) | |
BlogPost (const KBlog::BlogPost &post) | |
QStringList | categories () const |
QString | content () const |
KDateTime | creationDateTime () const |
QString | error () const |
bool | isCommentAllowed () const |
bool | isPrivate () const |
bool | isTrackBackAllowed () const |
KCal::Journal * | journal (const Blog &blog) const |
QString | journalId () const |
KUrl | link () const |
KDateTime | modificationDateTime () const |
QString | mood () const |
QString | music () const |
BlogPost & | operator= (const BlogPost &post) |
KUrl | permaLink () const |
QString | postId () const |
void | setCategories (const QStringList &categories) |
void | setCommentAllowed (bool commentAllowed) |
void | setContent (const QString &content) |
void | setCreationDateTime (const KDateTime &datetime) |
void | setError (const QString &error) |
void | setLink (const KUrl &link) const |
void | setModificationDateTime (const KDateTime &datetime) |
void | setMood (const QString &mood) |
void | setMusic (const QString &music) |
void | setPermaLink (const KUrl &permalink) const |
void | setPostId (const QString &postId) |
void | setPrivate (bool privatePost) |
void | setStatus (Status status) |
void | setSummary (const QString &summary) |
void | setTags (const QStringList &tags) |
void | setTitle (const QString &title) |
void | setTrackBackAllowed (bool allowTrackBacks) |
Status | status () const |
QString | summary () const |
void | swap (BlogPost &other) |
QStringList | tags () const |
QString | title () const |
virtual | ~BlogPost () |
Member Enumeration Documentation
The enumartion of the different post status, reflecting the status changes on the server.
- Enumerator:
-
New Status of a freshly constructed post on the client. Fetched Status of a successfully fetched post. - See also:
- Blog::fetchPost( KBlog::BlogPost* )
Created Status of a successfully created post. - See also:
- Blog::createPost( KBlog::BlogPost* )
Modified Status of a successfully modified post. - See also:
- Blog::modifyPost( KBlog::BlogPost* )
Removed Status of a successfully removed post. - See also:
- Blog::removePost( KBlog::BlogPost* )
Error Status when an error on the server side occurred. - See also:
- error()
Definition at line 359 of file blogpost.h.
Constructor & Destructor Documentation
KBlog::BlogPost::BlogPost | ( | const KBlog::BlogPost & | post | ) |
Constructor.
- Parameters:
-
postId The ID of the post on the server.
Definition at line 52 of file blogpost.cpp.
KBlog::BlogPost::BlogPost | ( | const KCal::Journal & | journal | ) | [explicit] |
Constructor to create a blog post from a KCal Journal.
- Parameters:
-
journal The journal to use to create the post
Definition at line 61 of file blogpost.cpp.
KBlog::BlogPost::~BlogPost | ( | ) | [virtual] |
Member Function Documentation
QStringList KBlog::BlogPost::categories | ( | ) | const |
Returns the categories.
- Returns:
- categories
- See also:
- setCategories()
Definition at line 264 of file blogpost.cpp.
QString KBlog::BlogPost::content | ( | ) | const |
Returns the content.
- Returns:
- content
- See also:
- setContent()
Definition at line 150 of file blogpost.cpp.
KDateTime KBlog::BlogPost::creationDateTime | ( | ) | const |
Returns the creation date time.
- Returns:
- creationdatetime
- See also:
- setCreationDateTime()
Definition at line 274 of file blogpost.cpp.
QString KBlog::BlogPost::error | ( | ) | const |
Returns the last error.
- Returns:
- error
- See also:
- setError(), Error
Definition at line 304 of file blogpost.cpp.
bool KBlog::BlogPost::isCommentAllowed | ( | ) | const |
Returns whether comments should be allowed.
- Returns:
- commentAllowed
- See also:
- setCommentAllowed()
Definition at line 192 of file blogpost.cpp.
bool KBlog::BlogPost::isPrivate | ( | ) | const |
Returns if the post is published or not.
- Returns:
- bool
- See also:
- setPrivate()
Definition at line 120 of file blogpost.cpp.
bool KBlog::BlogPost::isTrackBackAllowed | ( | ) | const |
Returns whether track back should be allowed.
- Returns:
- trackBackAllowed
- See also:
- setTrackBackAllowed()
Definition at line 202 of file blogpost.cpp.
KCal::Journal * KBlog::BlogPost::journal | ( | const Blog & | blog | ) | const |
Returns a KCal journal from the blog post owned by the caller.
- Parameters:
-
blog The blog object to convert.
- Returns:
- journal
Definition at line 94 of file blogpost.cpp.
QString KBlog::BlogPost::journalId | ( | ) | const |
Returns the ID used by the journal in creation, if created from a journal.
- Returns:
- journal ID
Definition at line 115 of file blogpost.cpp.
KUrl KBlog::BlogPost::link | ( | ) | const |
KDateTime KBlog::BlogPost::modificationDateTime | ( | ) | const |
Returns the modification date time.
- Returns:
- modificationdatetime
- See also:
- setModificationDateTime(), creationDateTime()
Definition at line 284 of file blogpost.cpp.
QString KBlog::BlogPost::mood | ( | ) | const |
QString KBlog::BlogPost::music | ( | ) | const |
KUrl KBlog::BlogPost::permaLink | ( | ) | const |
Returns the perma link path.
- Returns:
- permaLink
- See also:
- setPermaLink()
Definition at line 182 of file blogpost.cpp.
QString KBlog::BlogPost::postId | ( | ) | const |
Returns the postId.
This is for fetched posts.
- Returns:
- postId
- See also:
- setPostId()
Definition at line 130 of file blogpost.cpp.
void KBlog::BlogPost::setCategories | ( | const QStringList & | categories | ) |
Sets the categories.
- Parameters:
-
categories set the categories.
- See also:
- categories()
Definition at line 269 of file blogpost.cpp.
void KBlog::BlogPost::setCommentAllowed | ( | bool | commentAllowed | ) |
Set whether comments should be allowed.
- Parameters:
-
commentAllowed
- See also:
- isCommentAllowed()
Definition at line 197 of file blogpost.cpp.
void KBlog::BlogPost::setContent | ( | const QString & | content | ) |
Sets the content.
- Parameters:
-
content set the content.
- See also:
- content()
Definition at line 155 of file blogpost.cpp.
void KBlog::BlogPost::setCreationDateTime | ( | const KDateTime & | datetime | ) |
Sets the creation time.
This is used by most Blogs and is generally the shown date. Set it if you want to change the shown date.
- Parameters:
-
datetime set the time the post has been created.
- See also:
- creationTime()
Definition at line 279 of file blogpost.cpp.
void KBlog::BlogPost::setError | ( | const QString & | error | ) |
void KBlog::BlogPost::setLink | ( | const KUrl & | link | ) | const |
Set the link path.
- Parameters:
-
link The path to set.
- See also:
- link()
Definition at line 177 of file blogpost.cpp.
void KBlog::BlogPost::setModificationDateTime | ( | const KDateTime & | datetime | ) |
Sets the modification time.
- Parameters:
-
datetime set the time the post has been modified.
- See also:
- modificationTime(), setCreationDateTime()
Definition at line 289 of file blogpost.cpp.
void KBlog::BlogPost::setMood | ( | const QString & | mood | ) |
Set the mood list.
- Parameters:
-
mood The mood.
- See also:
- mood()
Definition at line 249 of file blogpost.cpp.
void KBlog::BlogPost::setMusic | ( | const QString & | music | ) |
Set the music.
- Parameters:
-
music The music.
- See also:
- music()
Definition at line 259 of file blogpost.cpp.
void KBlog::BlogPost::setPermaLink | ( | const KUrl & | permalink | ) | const |
Set the perma link path.
- Parameters:
-
permalink The path to set.
- See also:
- permaLink()
Definition at line 187 of file blogpost.cpp.
void KBlog::BlogPost::setPostId | ( | const QString & | postId | ) |
Sets the post id value.
This is important for modifying posts.
- Parameters:
-
postId set this to the post id on the server.
- See also:
- postId()
Definition at line 135 of file blogpost.cpp.
void KBlog::BlogPost::setPrivate | ( | bool | privatePost | ) |
Sets the post to private viewings only.
- Parameters:
-
privatePost set this to false, if you don't want to publish the blog post immediately.
- See also:
- isPrivate()
Definition at line 125 of file blogpost.cpp.
void KBlog::BlogPost::setStatus | ( | BlogPost::Status | status | ) |
Sets the status.
- Parameters:
-
status The status on the server.
Definition at line 299 of file blogpost.cpp.
void KBlog::BlogPost::setSummary | ( | const QString & | summary | ) |
Set the summary.
- Parameters:
-
summary
- See also:
- summary()
Definition at line 217 of file blogpost.cpp.
void KBlog::BlogPost::setTags | ( | const QStringList & | tags | ) |
Set the tags list.
- Parameters:
-
tags The tags list.
- See also:
- tags()
Definition at line 227 of file blogpost.cpp.
void KBlog::BlogPost::setTitle | ( | const QString & | title | ) |
Sets the title.
- Parameters:
-
title set the title.
- See also:
- title()
Definition at line 145 of file blogpost.cpp.
void KBlog::BlogPost::setTrackBackAllowed | ( | bool | allowTrackBacks | ) |
Set whether track back should be allowed.
- Parameters:
-
allowTrackBacks
- See also:
- isTrackBackAllowed()
Definition at line 207 of file blogpost.cpp.
BlogPost::Status KBlog::BlogPost::status | ( | ) | const |
Returns the status on the server.
- Returns:
- status
- See also:
- setStatus(), Status
Definition at line 294 of file blogpost.cpp.
QString KBlog::BlogPost::summary | ( | ) | const |
Returns the summary.
- Returns:
- summary
- See also:
- setSummary()
Definition at line 212 of file blogpost.cpp.
void KBlog::BlogPost::swap | ( | BlogPost & | other | ) | [inline] |
QStringList KBlog::BlogPost::tags | ( | ) | const |
Returns the tags list as a QStringList.
- Returns:
- tags list
- See also:
- setTags()
Definition at line 222 of file blogpost.cpp.
QString KBlog::BlogPost::title | ( | ) | const |
The documentation for this class was generated from the following files: