• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KBlog Client Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kblog
blog.cpp
1 /*
2  This file is part of the kblog library.
3 
4  Copyright (c) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
5  Copyright (c) 2006-2007 Christian Weilbach <christian_weilbach@web.de>
6  Copyright (c) 2007 Mike McQuaid <mike@mikemcquaid.com>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License as published by the Free Software Foundation; either
11  version 2 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public License
19  along with this library; see the file COPYING.LIB. If not, write to
20  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  Boston, MA 02110-1301, USA.
22 */
23 
24 #include "blog.h"
25 #include "blog_p.h"
26 #include "blogpost_p.h"
27 
28 #include <kdeversion.h>
29 
30 #include <KDebug>
31 
32 using namespace KBlog;
33 
34 Blog::Blog( const KUrl &server, QObject *parent, const QString &applicationName,
35  const QString &applicationVersion ) :
36  QObject( parent ), d_ptr( new BlogPrivate )
37 {
38  Q_UNUSED( server );
39  d_ptr->q_ptr = this;
40  setUserAgent( applicationName, applicationVersion );
41 }
42 
43 Blog::Blog( const KUrl &server, BlogPrivate &dd, QObject *parent,
44  const QString &applicationName, const QString &applicationVersion )
45  : QObject( parent ), d_ptr( &dd )
46 {
47  Q_UNUSED( server );
48  d_ptr->q_ptr = this;
49  setUserAgent( applicationName, applicationVersion );
50 }
51 
52 Blog::~Blog()
53 {
54  kDebug() << "~Blog()";
55  delete d_ptr;
56 }
57 
58 QString Blog::userAgent() const
59 {
60  Q_D( const Blog );
61  return d->mUserAgent;
62 }
63 
64 void Blog::setUserAgent( const QString &applicationName,
65  const QString &applicationVersion )
66 {
67  Q_D( Blog );
68  QString userAgent;
69  if ( !applicationName.isEmpty() &&
70  !applicationVersion.isEmpty() ) {
71  userAgent = QLatin1Char('(') + applicationName + QLatin1Char('/') + applicationVersion + QLatin1String(") KDE-KBlog/");
72  } else {
73  userAgent = QLatin1String("KDE-KBlog/");
74  }
75  userAgent += QLatin1String(KDE_VERSION_STRING);
76  d->mUserAgent = userAgent;
77 }
78 
79 void Blog::setPassword( const QString &pass )
80 {
81  Q_D( Blog );
82  d->mPassword = pass;
83 }
84 
85 QString Blog::password() const
86 {
87  Q_D( const Blog );
88  return d->mPassword;
89 }
90 
91 QString Blog::username() const
92 {
93  Q_D( const Blog );
94  return d->mUsername;
95 }
96 
97 void Blog::setUsername( const QString &username )
98 {
99  Q_D( Blog );
100  d->mUsername = username;
101 }
102 
103 void Blog::setBlogId( const QString &blogId )
104 {
105  Q_D( Blog );
106  d->mBlogId = blogId;
107 }
108 
109 QString Blog::blogId() const
110 {
111  Q_D( const Blog );
112  return d->mBlogId;
113 }
114 
115 void Blog::setUrl( const KUrl &url )
116 {
117  Q_D( Blog );
118  d->mUrl = url;
119 }
120 
121 KUrl Blog::url() const
122 {
123  Q_D( const Blog );
124  return d->mUrl;
125 }
126 
127 void Blog::setTimeZone( const KTimeZone &tz )
128 {
129  Q_D( Blog );
130  d->mTimeZone = tz;
131 }
132 
133 KTimeZone Blog::timeZone()
134 {
135  Q_D( const Blog );
136  return d->mTimeZone;
137 }
138 
139 BlogPrivate::BlogPrivate() : q_ptr(0)
140 {
141 }
142 
143 BlogPrivate::~BlogPrivate()
144 {
145  kDebug() << "~BlogPrivate()";
146 }
KBlog::Blog::~Blog
virtual ~Blog()
Destroys the Blog object.
Definition: blog.cpp:52
KBlog::Blog::setBlogId
virtual void setBlogId(const QString &blogId)
Sets the unique ID for the specific blog on the server.
Definition: blog.cpp:103
KBlog::Blog::setUrl
virtual void setUrl(const KUrl &url)
Sets the URL for the blog's XML-RPC interface.
Definition: blog.cpp:115
KBlog::Blog::setUsername
virtual void setUsername(const QString &username)
Sets the username used in blog authentication.
Definition: blog.cpp:97
KBlog::Blog::username
QString username() const
Returns the username used in blog authentication.
Definition: blog.cpp:91
KBlog::Blog::blogId
QString blogId() const
Returns the unique ID for the specific blog on the server.
Definition: blog.cpp:109
KBlog::Blog::url
KUrl url() const
Get the URL for the blog's XML-RPC interface.
Definition: blog.cpp:121
KBlog::Blog::Blog
Blog(const KUrl &server, QObject *parent=0, const QString &applicationName=QString(), const QString &applicationVersion=QString())
Constructor used by the remote interface implementations.
Definition: blog.cpp:34
KBlog::Blog::setPassword
virtual void setPassword(const QString &password)
Sets the password used in blog authentication.
Definition: blog.cpp:79
KBlog::Blog::d_ptr
BlogPrivate *const d_ptr
A pointer to the corresponding 'Private' class.
Definition: blog.h:354
KBlog::Blog::timeZone
KTimeZone timeZone()
Get the time zone of the blog's server.
Definition: blog.cpp:133
KBlog::Blog::setTimeZone
virtual void setTimeZone(const KTimeZone &timeZone)
Sets the time zone of the blog's server.
Definition: blog.cpp:127
KBlog::Blog::setUserAgent
void setUserAgent(const QString &applicationName, const QString &applicationVersion)
Sets the HTTP user agent string used to make the HTTP requests.
Definition: blog.cpp:64
KBlog::Blog
A class that provides methods to call functions on a supported blog web application.
Definition: blog.h:71
blog.h
This is the main interface for blogging APIs.
KBlog::Blog::userAgent
QString userAgent() const
Returns the HTTP user agent string used to make the HTTP requests.
Definition: blog.cpp:58
KBlog::Blog::password
QString password() const
Returns the password of the blog.
Definition: blog.cpp:85
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:55 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KBlog Client Library

Skip menu "KBlog Client Library"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal