Main Page   Class Hierarchy   Compound List   File List   Compound Members  

xrclient.h

00001 /*
00002 
00003 qutexrlib QT-based XML-RPC library
00004 Copyright (C) 2003  P. Oscar Boykin <boykin@pobox.com>
00005 
00006 This program is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU General Public License
00008 as published by the Free Software Foundation; either version 2
00009 of the License, or (at your option) any later version.
00010 
00011 This program is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with this program; if not, write to the Free Software
00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019    
00020 */
00021 
00022 #ifndef xrclient
00023 #define xrclient
00024 
00025 #include <qurl.h>
00026 #include <qvariant.h>
00027 #include <qdom.h>
00028 #include <qhttp.h>
00029 #include <qmap.h>
00030 #include <qbuffer.h>
00031 #include <xrmethodcall.h>
00032 #include <xrmethodresponse.h>
00033 #include <xrfaultcodes.h>
00034 
00041 class XRClient : public QObject {
00042    Q_OBJECT
00043         
00044     public:
00048         XRClient(const QUrl& server_url,
00049                         QObject * parent = 0,
00050                         const char * name = 0);
00051         ~XRClient();
00057         void acceptCompressed(bool arg) { _accept_compressed = arg; }
00063         int call(const QString& method,
00064                  const QValueList<QVariant>& params);
00065         
00069         const QUrl& getUrl() const { return _url; }
00070         
00071         void setUrl(const QUrl& server_url);
00072 
00073     signals:
00082         void methodResponse(int response_num,
00083                             const QVariant& response);
00084 
00092         void fault(int response_num, int fault_num, const QString& fault_string);
00093         
00094     public slots:
00098         void setUrl(const QString& u);
00099         
00100     protected slots:
00104         void processHttpResponse(int http_resp, bool error);
00105         void processHeaders(const QHttpResponseHeader & resp);
00106             
00107     protected:
00108         QHttp _http_client;
00109         QUrl _url;
00110         bool _is_deflated;
00111         bool _accept_compressed;
00115         static const QString USER_AGENT;
00120         QMap<int, QBuffer*> _buffer_map;
00121 };
00122 
00123 #endif

Generated on Tue Feb 25 18:38:57 2003 for qutexr by doxygen1.2.15