• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

KBlog Client Library

blog.cpp
00001 /*
00002   This file is part of the kblog library.
00003 
00004   Copyright (c) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00005   Copyright (c) 2006-2007 Christian Weilbach <christian_weilbach@web.de>
00006   Copyright (c) 2007 Mike McQuaid <mike@mikemcquaid.com>
00007 
00008   This library is free software; you can redistribute it and/or
00009   modify it under the terms of the GNU Library General Public
00010   License as published by the Free Software Foundation; either
00011   version 2 of the License, or (at your option) any later version.
00012 
00013   This library is distributed in the hope that it will be useful,
00014   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016   Library General Public License for more details.
00017 
00018   You should have received a copy of the GNU Library General Public License
00019   along with this library; see the file COPYING.LIB.  If not, write to
00020   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021   Boston, MA 02110-1301, USA.
00022 */
00023 
00024 #include "blog.h"
00025 #include "blog_p.h"
00026 #include "blogpost_p.h"
00027 
00028 #include <kdeversion.h>
00029 
00030 #include <KDebug>
00031 
00032 using namespace KBlog;
00033 
00034 Blog::Blog( const KUrl &server, QObject *parent, const QString &applicationName,
00035             const QString &applicationVersion ) :
00036     QObject( parent ), d_ptr( new BlogPrivate )
00037 {
00038   Q_UNUSED( server );
00039   d_ptr->q_ptr = this;
00040   setUserAgent( applicationName, applicationVersion );
00041 }
00042 
00043 Blog::Blog( const KUrl &server, BlogPrivate &dd, QObject *parent,
00044             const QString &applicationName, const QString &applicationVersion )
00045   : QObject( parent ), d_ptr( &dd )
00046 {
00047   Q_UNUSED( server );
00048   d_ptr->q_ptr = this;
00049   setUserAgent( applicationName, applicationVersion );
00050 }
00051 
00052 Blog::~Blog()
00053 {
00054   kDebug() << "~Blog()";
00055   delete d_ptr;
00056 }
00057 
00058 QString Blog::userAgent() const
00059 {
00060   Q_D( const Blog );
00061   return d->mUserAgent;
00062 }
00063 
00064 void Blog::setUserAgent( const QString &applicationName,
00065                          const QString &applicationVersion )
00066 {
00067   Q_D( Blog );
00068   QString userAgent;
00069   if ( !applicationName.isEmpty() && !applicationVersion.isEmpty() ) {
00070     userAgent = '(' + applicationName + '/' + applicationVersion + ") KDE-KBlog/";
00071   } else {
00072     userAgent = "KDE-KBlog/";
00073   }
00074   userAgent += KDE_VERSION_STRING;
00075   d->mUserAgent = userAgent;
00076 }
00077 
00078 void Blog::setPassword( const QString &pass )
00079 {
00080   Q_D( Blog );
00081   d->mPassword = pass;
00082 }
00083 
00084 QString Blog::password() const
00085 {
00086   Q_D( const Blog );
00087   return d->mPassword;
00088 }
00089 
00090 QString Blog::username() const
00091 {
00092   Q_D( const Blog );
00093   return d->mUsername;
00094 }
00095 
00096 void Blog::setUsername( const QString &username )
00097 {
00098   Q_D( Blog );
00099   d->mUsername = username;
00100 }
00101 
00102 void Blog::setBlogId( const QString &blogId )
00103 {
00104   Q_D( Blog );
00105   d->mBlogId = blogId;
00106 }
00107 
00108 QString Blog::blogId() const
00109 {
00110   Q_D( const Blog );
00111   return d->mBlogId;
00112 }
00113 
00114 void Blog::setUrl( const KUrl &url )
00115 {
00116   Q_D( Blog );
00117   d->mUrl = url;
00118 }
00119 
00120 KUrl Blog::url() const
00121 {
00122   Q_D( const Blog );
00123   return d->mUrl;
00124 }
00125 
00126 void Blog::setTimeZone( const KTimeZone &tz )
00127 {
00128   Q_D( Blog );
00129   d->mTimeZone = tz;
00130 }
00131 
00132 KTimeZone Blog::timeZone()
00133 {
00134   Q_D( const Blog );
00135   return d->mTimeZone;
00136 }
00137 
00138 BlogPrivate::BlogPrivate() : q_ptr(0)
00139 {
00140 }
00141 
00142 BlogPrivate::~BlogPrivate()
00143 {
00144   kDebug() << "~BlogPrivate()";
00145 }
00146 
00147 #include "blog.moc"

KBlog Client Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal