KXMLRPC Client Library
client.h
Go to the documentation of this file.
00001 /****************************************************************************** 00002 * Copyright (C) 2003 - 2004 by Frerich Raabe <raabe@kde.org> * 00003 * Tobias Koenig <tokoe@kde.org> * 00004 * Copyright (C) 2006 by Narayan Newton <narayannewton@gmail.com> * 00005 * * 00006 * This program is distributed in the hope that it will be useful, but * 00007 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * 00008 * or FITNESS FOR A PARTICULAR PURPOSE. For licensing and distribution * 00009 * details, check the accompanying file 'COPYING.BSD'. * 00010 *****************************************************************************/ 00024 #ifndef KXML_RPC_CLIENT_H 00025 #define KXML_RPC_CLIENT_H 00026 00027 #include "kxmlrpcclient_export.h" 00028 00029 #include <kurl.h> 00030 00031 #include <QtCore/QList> 00032 #include <QtCore/QObject> 00033 #include <QtCore/QVariant> 00034 00036 namespace KXmlRpc { 00037 00053 class KXMLRPCCLIENT_EXPORT Client : public QObject 00054 { 00055 Q_OBJECT 00056 00057 public: 00063 explicit Client( QObject *parent = 0 ); 00064 00071 explicit Client( const KUrl &url, QObject *parent = 0 ); 00072 00076 ~Client(); 00077 00083 KUrl url() const; 00084 00092 void setUrl( const KUrl &url ); 00093 00099 QString userAgent() const; 00100 00108 void setUserAgent( const QString &userAgent ); 00109 00116 bool isDigestAuthEnabled() const; 00117 00124 void setDigestAuthEnabled( bool enabled ); 00125 00126 public Q_SLOTS: 00139 void call( const QString &method, const QList<QVariant> &args, 00140 QObject *msgObj, const char *messageSlot, 00141 QObject *faultObj, const char *faultSlot, 00142 const QVariant &id = QVariant() ); 00143 00156 void call( const QString &method, const QVariant &arg, 00157 QObject *msgObj, const char *messageSlot, 00158 QObject *faultObj, const char *faultSlot, 00159 const QVariant &id = QVariant() ); 00160 00173 void call( const QString &method, int arg, 00174 QObject *msgObj, const char *messageSlot, 00175 QObject *faultObj, const char *faultSlot, 00176 const QVariant &id = QVariant() ); 00177 00190 void call( const QString &method, bool arg, 00191 QObject *msgObj, const char *messageSlot, 00192 QObject *faultObj, const char *faultSlot, 00193 const QVariant &id = QVariant() ); 00194 00207 void call( const QString &method, double arg, 00208 QObject *msgObj, const char *messageSlot, 00209 QObject *faultObj, const char *faultSlot, 00210 const QVariant &id = QVariant() ); 00211 00224 void call( const QString &method, const QString &arg, 00225 QObject *msgObj, const char *messageSlot, 00226 QObject *faultObj, const char *faultSlot, 00227 const QVariant &id = QVariant() ); 00228 00241 void call( const QString &method, const QByteArray &arg, 00242 QObject *msgObj, const char *messageSlot, 00243 QObject *faultObj, const char *faultSlot, 00244 const QVariant &id = QVariant() ); 00245 00258 void call( const QString &method, const QDateTime &arg, 00259 QObject *msgObj, const char *messageSlot, 00260 QObject *faultObj, const char *faultSlot, 00261 const QVariant &id = QVariant() ); 00262 00275 void call( const QString &method, const QStringList &arg, 00276 QObject *msgObj, const char *messageSlot, 00277 QObject *faultObj, const char *faultSlot, 00278 const QVariant &id = QVariant() ); 00279 00280 private: 00281 class Private; 00282 Private *const d; 00283 00284 template <typename T> 00285 void call( const QString &method, const QList<T> &arg, 00286 QObject *obj1, const char *messageSlot, 00287 QObject *obj2, const char *faultSlot, 00288 const QVariant &id = QVariant() ); 00289 00290 Q_PRIVATE_SLOT( d, void queryFinished( Query * ) ) 00291 }; 00292 00305 template <typename T> 00306 void Client::call( const QString &method, const QList<T> &arg, 00307 QObject *msgObj, const char *messageSlot, 00308 QObject *faultObj, const char *faultSlot, 00309 const QVariant &id ) 00310 { 00311 QList<QVariant> args; 00312 00313 for ( int i = 0; i < arg.count(); ++i ) { 00314 args << QVariant( arg[ i ] ); 00315 } 00316 00317 return call( method, args, faultObj, faultSlot, msgObj, messageSlot, id ); 00318 } 00319 00320 } 00321 00322 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:45:22 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:45:22 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.