1/*
2 This file is part of the kblog library.
3
4 Copyright (c) 2006-2007 Christian Weilbach <christian_weilbach@web.de>
5 Copyright (c) 2007 Mike McQuaid <mike@mikemcquaid.com>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
22
23#ifndef BLOGGER1_P_H
24#define BLOGGER1_P_H
25
26#include "blogger1.h"
27#include "blog_p.h"
28
29#include <kxmlrpcclient/client.h>
30
31#include <QList>
32
33namespace KBlog {
34
35class Blogger1Private : public BlogPrivate
36{
37 public:
38 QString mAppId;
39 KXmlRpc::Client *mXmlRpcClient;
40 unsigned int mCallCounter; // TODO a better counter
41 QMap<unsigned int,KBlog::BlogPost*> mCallMap;
42 Blogger1Private();
43 virtual ~Blogger1Private();
44
45 virtual void slotFetchUserInfo( const QList<QVariant> &result, const QVariant &id );
46 virtual void slotListBlogs( const QList<QVariant> &result, const QVariant &id );
47 virtual void slotListRecentPosts( const QList<QVariant> &result, const QVariant &id );
48 virtual void slotFetchPost( const QList<QVariant> &result, const QVariant &id );
49 virtual void slotCreatePost( const QList<QVariant> &result, const QVariant &id );
50 virtual void slotModifyPost( const QList<QVariant> &result, const QVariant &id );
51 virtual void slotRemovePost( const QList<QVariant> &result, const QVariant &id );
52 virtual void slotError( int number, const QString &errorString, const QVariant &id );
53
54 Q_DECLARE_PUBLIC( KBlog::Blogger1 )
55
56 enum FunctionToCall {
57 GetRecentPosts,
58 CreatePost,
59 ModifyPost,
60 FetchPost
61 };
62 virtual QList<QVariant> defaultArgs( const QString &id = QString() );
63 QList<QVariant> blogger1Args( const QString &id = QString() );
64 virtual bool readPostFromMap( BlogPost *post,
65 const QMap<QString, QVariant> &postInfo );
66 virtual bool readArgsFromPost( QList<QVariant> *args, const BlogPost &post );
67 virtual QString getCallFromFunction( FunctionToCall type );
68};
69
70}
71
72#endif
73