/usr/include/kblog/blog.h is in kdepimlibs5-dev 4:4.13.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | /*
This file is part of the kblog library.
Copyright (c) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
Copyright (c) 2006-2007 Christian Weilbach <christian_weilbach@web.de>
Copyright (c) 2007 Mike McQuaid <mike@mikemcquaid.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KBLOG_BLOG_H
#define KBLOG_BLOG_H
#include <kblog/kblog_export.h>
#include <QtCore/QObject>
template <class T,class S> class QMap;
class KTimeZone;
class KUrl;
/**
This is the main interface for blogging APIs.
It's methods represent the core functionality of a blogging API.
@author Reinhold Kainhofer, Christian Weilbach and Mike McQuaid.
*/
/**
@file
This file is part of the library for accessing blogs and defines the
Blog class.
@author Christian Weilbach \<christian_weilbach\@web.de\>
@author Mike McQuaid \<mike\@mikemcquaid.com\>
@author Reinhold Kainhofer \<reinhold\@kainhofer.com\>
*/
/** Namespace for blog related classes. */
namespace KBlog {
class BlogPost;
class BlogComment;
class BlogMedia;
class BlogPrivate;
/**
@brief
A class that provides methods to call functions on a supported blog
web application.
This is the main interface to the blogging client library.
@author Christian Weilbach \<christian_weilbach\@web.de\>
@author Mike McQuaid \<mike\@mikemcquaid.com\>
@author Reinhold Kainhofer \<reinhold\@kainhofer.com\>
*/
class KBLOG_EXPORT Blog : public QObject
{
Q_OBJECT
public:
/**
Constructor used by the remote interface implementations.
@param server URL for the blog's remote interface.
@param parent the parent of this object, defaults to null.
@param applicationName the client application's name to use in the
HTTP user agent string, defaults to KBlog's own.
@param applicationVersion the client application's version to use in the
HTTP user agent string, defaults to KBlog's own.
*/
explicit Blog( const KUrl &server, QObject *parent = 0,
const QString &applicationName = QString(),
const QString &applicationVersion = QString() );
/**
Destroys the Blog object.
*/
virtual ~Blog();
/**
Enumeration for possible errors.
*/
enum ErrorType {
/** An error in the XML-RPC client. */
XmlRpc,
/** An error in the syndication client. */
Atom,
/** A parsing error. */
ParsingError,
/** An error on authentication. */
AuthenticationError,
/** An error where the method called is not supported by this object. */
NotSupported,
/** Any other miscellaneous error. */
Other
};
/**
Returns the HTTP user agent string used to make the HTTP requests.
*/
QString userAgent() const;
/**
Sets the HTTP user agent string used to make the HTTP requests.
@param applicationName the client application's name to use in the
HTTP user agent string.
@param applicationVersion the client application's version to use in the
HTTP user agent string.
@see userAgent()
*/
void setUserAgent( const QString &applicationName,
const QString &applicationVersion );
/**
Returns the name of the blogging API this object implements.
*/
virtual QString interfaceName() const = 0;
/**
Sets the unique ID for the specific blog on the server.
@param blogId the ID of the blog to send/receive from.
@see blogId();
*/
virtual void setBlogId( const QString &blogId );
/**
Returns the unique ID for the specific blog on the server.
@see setBlogId( const QString &blogId );
*/
QString blogId() const;
/**
Sets the password used in blog authentication.
@param password the blog's password.
@see password();
*/
virtual void setPassword( const QString &password );
/**
Returns the password of the blog.
@see setPassword( const QString & );
*/
QString password() const;
/**
Sets the username used in blog authentication.
@param username the blog's username.
@see username()
*/
virtual void setUsername( const QString &username );
/**
Returns the username used in blog authentication.
@see setUsername( const QString & )
*/
QString username() const;
/**
Sets the URL for the blog's XML-RPC interface.
@param url the blog's XML-RPC URL.
@see url()
*/
virtual void setUrl( const KUrl &url );
/**
Get the URL for the blog's XML-RPC interface.
@see setUrl( const KUrl & )
*/
KUrl url() const;
/**
Sets the time zone of the blog's server.
@param timeZone the time zone of the server.
@see timeZone()
*/
virtual void setTimeZone( const KTimeZone &timeZone );
/**
Get the time zone of the blog's server.
@see void setTimeZone()
*/
KTimeZone timeZone();
/**
List a number of recent posts from the server.
The posts are returned in descending chronological order.
@param number the number of posts to fetch.
@see listedRecentPosts( const QList<KBlog::BlogPost>& posts )
*/
virtual void listRecentPosts( int number ) = 0;
/**
Fetch a blog post from the server with a specific ID.
The ID of the existing post must be retrieved using getRecentPosts
and then be modified and provided to this method or a new BlogPost
created with the existing ID.
@param post a blog post with the ID identifying the blog post to fetch.
@see fetchedPost()
@see listedRecentPosts( int number )
*/
virtual void fetchPost( KBlog::BlogPost *post ) = 0;
/**
Modify an existing blog post on the server.
The ID of the existing post must be retrieved using getRecentPosts
and then be modified and provided to this method or a new BlogPost
created with the existing ID.
@param post the new blog post.
@see modifiedPost()
@see listedRecentPosts( int number )
*/
virtual void modifyPost( KBlog::BlogPost *post ) = 0;
/**
Create a new blog post on the server.
@param post the blog post to create.
@see createdPost()
*/
virtual void createPost( KBlog::BlogPost *post ) = 0;
/**
Remove an existing blog post from the server.
The BlogPost object representing the existing post must be retrieved
using getRecentPosts and then provided to this method.
@param post* the blog post to remove.
@see removedPost()
@see listedRecentPosts( int number )
*/
virtual void removePost( KBlog::BlogPost *post ) = 0;
Q_SIGNALS:
/**
This signal is emitted when a listRecentPosts() job fetches a post
from the blogging server.
@param posts the list of posts.
@see listRecentPosts()
*/
void listedRecentPosts(
const QList<KBlog::BlogPost>& posts );
/**
This signal is emitted when a createPost() job creates a new blog post
on the blogging server.
@param post the created post.
@see createPost()
*/
void createdPost( KBlog::BlogPost *post );
/**
This signal is emitted when a fetchPost() job fetches a post
from the blogging server.
@param post the fetched post.
@see fetchPost()
*/
void fetchedPost( KBlog::BlogPost *post );
/**
This signal is emitted when a modifyPost() job modifies a post
on the blogging server.
@param post the modified post.
@see modifyPost()
*/
void modifiedPost( KBlog::BlogPost *post );
/**
This signal is emitted when a removePost() job removes a post
from the blogging server.
@param post the removed post.
@see removePost()
*/
void removedPost( KBlog::BlogPost *post );
/**
This signal is emitted when an error occurs with XML parsing or a
structural problem.
@param type the type of the error.
@param errorMessage the error message.
@see ErrorType
*/
void error( KBlog::Blog::ErrorType type, const QString &errorMessage );
/**
This signal is emitted when an error occurs with XML parsing or a
structural problem in an operation involving a blog post.
@param type the type of the error.
@param errorMessage the error message.
@param post the post that caused the error.
@see ErrorType
*/
void errorPost( KBlog::Blog::ErrorType type,
const QString &errorMessage, KBlog::BlogPost *post );
/**
This signal is emitted when an error occurs with XML parsing or a
structural problem in an operation involving some blog media.
@param type the type of the error.
@param errorMessage the error message.
@param media the media that caused the error.
@see ErrorType
*/
void errorMedia( KBlog::Blog::ErrorType type,
const QString &errorMessage, KBlog::BlogMedia *media );
/**
This signal is emitted when an error occurs with XML parsing or a
structural problem in an operation involving a blog post's comment.
@param type the type of the error.
@param errorMessage the error message.
@param post the post that caused the error.
@param comment the comment that caused the error.
@see ErrorType
*/
void errorComment( KBlog::Blog::ErrorType type,
const QString &errorMessage, KBlog::BlogPost *post,
KBlog::BlogComment *comment );
protected:
/** A pointer to the corresponding 'Private' class */
BlogPrivate *const d_ptr;
/**
Constructor needed to allow private inheritance of 'Private' classes.
@param server URL for the blog's XML-RPC interface.
@param dd URL for the corresponding private class.
@param parent the parent of this object, defaults to null.
@param applicationName the client application's name to use in the
HTTP user agent string, defaults to KBlog's own.
@param applicationVersion the client application's version to use in the
HTTP user agent string, defaults to KBlog's own.
*/
Blog( const KUrl &server, BlogPrivate &dd, QObject *parent = 0,
const QString &applicationName = QString(),
const QString &applicationVersion = QString() );
private:
Q_DECLARE_PRIVATE( Blog )
};
} //namespace KBlog
#endif
|