KDECore
k3httpproxysocketdevice.h
Go to the documentation of this file.00001 /* -*- C++ -*- 00002 * Copyright (C) 2003,2005 Thiago Macieira <thiago@kde.org> 00003 * 00004 * 00005 * Permission is hereby granted, free of charge, to any person obtaining 00006 * a copy of this software and associated documentation files (the 00007 * "Software"), to deal in the Software without restriction, including 00008 * without limitation the rights to use, copy, modify, merge, publish, 00009 * distribute, sublicense, and/or sell copies of the Software, and to 00010 * permit persons to whom the Software is furnished to do so, subject to 00011 * the following conditions: 00012 * 00013 * The above copyright notice and this permission notice shall be included 00014 * in all copies or substantial portions of the Software. 00015 * 00016 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00017 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00018 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00019 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 00020 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 00021 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 00022 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00023 */ 00024 00025 #ifndef KHTTPPROXYSOCKETDEVICE_H 00026 #define KHTTPPROXYSOCKETDEVICE_H 00027 00028 #include "k3socketdevice.h" 00029 00030 namespace KNetwork { 00031 00032 class KHttpProxySocketDevicePrivate; 00033 00044 class KDECORE_EXPORT KHttpProxySocketDevice: public KSocketDevice 00045 { 00046 public: 00050 KHttpProxySocketDevice(const KSocketBase* = 0L); 00051 00055 explicit KHttpProxySocketDevice(const KResolverEntry& proxy); 00056 00060 virtual ~KHttpProxySocketDevice(); 00061 00065 virtual int capabilities() const; 00066 00070 const KResolverEntry& proxyServer() const; 00071 00075 void setProxyServer(const KResolverEntry& proxy); 00076 00080 virtual void close(); 00081 00085 virtual bool connect(const KResolverEntry& address); 00086 00091 virtual bool connect(const QString& name, const QString& service); 00092 00096 virtual KSocketAddress peerAddress() const; 00097 00102 virtual KSocketAddress externalAddress() const; 00103 00104 private: 00109 bool parseServerReply(); 00110 KHttpProxySocketDevicePrivate* const d; 00111 00112 public: 00118 static KResolverEntry defaultProxy; 00119 }; 00120 00121 } // namespace KNetwork 00122 00123 #endif