blog.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KBLOG_BLOG_H
00025 #define KBLOG_BLOG_H
00026
00027 #include <kblog/kblog_export.h>
00028
00029 #include <QtCore/QObject>
00030
00031 template <class T,class S> class QMap;
00032
00033 class KTimeZone;
00034 class KUrl;
00035
00053 namespace KBlog {
00054
00055 class BlogPost;
00056 class BlogComment;
00057 class BlogMedia;
00058 class BlogPrivate;
00059
00071 class KBLOG_EXPORT Blog : public QObject
00072 {
00073 Q_OBJECT
00074 public:
00085 explicit Blog( const KUrl &server, QObject *parent = 0,
00086 const QString &applicationName = QString(),
00087 const QString &applicationVersion = QString() );
00088
00092 virtual ~Blog();
00093
00097 enum ErrorType {
00099 XmlRpc,
00101 Atom,
00103 ParsingError,
00105 AuthenticationError,
00107 NotSupported,
00109 Other
00110 };
00111
00115 QString userAgent() const;
00116
00126 void setUserAgent( const QString &applicationName,
00127 const QString &applicationVersion );
00128
00132 virtual QString interfaceName() const = 0;
00133
00139 virtual void setBlogId( const QString &blogId );
00140
00145 QString blogId() const;
00146
00153 virtual void setPassword( const QString &password );
00154
00159 QString password() const;
00160
00166 virtual void setUsername( const QString &username );
00167
00173 QString username() const;
00174
00181 virtual void setUrl( const KUrl &url );
00182
00188 KUrl url() const;
00189
00196 virtual void setTimeZone( const KTimeZone &timeZone );
00197
00203 KTimeZone timeZone();
00204
00212 virtual void listRecentPosts( int number ) = 0;
00213
00224 virtual void fetchPost( KBlog::BlogPost *post ) = 0;
00225
00236 virtual void modifyPost( KBlog::BlogPost *post ) = 0;
00237
00244 virtual void createPost( KBlog::BlogPost *post ) = 0;
00245
00255 virtual void removePost( KBlog::BlogPost *post ) = 0;
00256
00257 Q_SIGNALS:
00265 void listedRecentPosts(
00266 const QList<KBlog::BlogPost>& posts );
00267
00275 void createdPost( KBlog::BlogPost *post );
00276
00284 void fetchedPost( KBlog::BlogPost *post );
00285
00293 void modifiedPost( KBlog::BlogPost *post );
00294
00302 void removedPost( KBlog::BlogPost *post );
00303
00312 void error( KBlog::Blog::ErrorType type, const QString &errorMessage );
00313
00323 void errorPost( KBlog::Blog::ErrorType type,
00324 const QString &errorMessage, KBlog::BlogPost *post );
00325
00335 void errorMedia( KBlog::Blog::ErrorType type,
00336 const QString &errorMessage, KBlog::BlogMedia *media );
00337
00348 void errorComment( KBlog::Blog::ErrorType type,
00349 const QString &errorMessage, KBlog::BlogPost *post,
00350 KBlog::BlogComment *comment );
00351
00352 protected:
00354 BlogPrivate *const d_ptr;
00355
00367 Blog( const KUrl &server, BlogPrivate &dd, QObject *parent = 0,
00368 const QString &applicationName = QString(),
00369 const QString &applicationVersion = QString() );
00370
00371 private:
00372 Q_DECLARE_PRIVATE( Blog )
00373 };
00374
00375 }
00376 #endif
|