00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __UT_WebConnection_h__
00022 #define __UT_WebConnection_h__
00023
00024 #include "UT_API.h"
00025 #include "UT_Pair.h"
00026 #include "UT_String.h"
00027 #include "UT_RefArray.h"
00028 class UT_WorkBuffer;
00029
00030 class UT_API UT_WebConnection
00031 {
00032 public:
00033
00034 UT_WebConnection();
00035 ~UT_WebConnection();
00036
00037 void setHostName(const char *host_name);
00038
00039
00040 void setPort(int port) { myPort = port; }
00041
00042
00043 void setProxy(const char *host_name, int port);
00044 void doNotUseProxy();
00045
00046
00047 void setPageName(const char *page_name);
00048
00049
00050
00051 void setSessionId(const char *session_id);
00052
00053
00054
00055 void addVariable(const char *variable_name,
00056 const char *variable_value);
00057 void addVariable(const char *variable_name,
00058 int variable_value);
00059 void clearVariables();
00060
00061
00062
00063
00064
00065
00066 bool retrievePage(UT_WorkBuffer &result,
00067 UT_WorkBuffer &session_id);
00068 void setModTime(const char *src);
00069 int getModTime() const;
00070
00071
00072
00073 static void encodeURIData(const char *data_to_encode,
00074 UT_WorkBuffer &encoded_value);
00075
00076 private:
00077 void setProxyFromEnvironmentVariable();
00078
00079 typedef UT_Pair<UT_String, UT_String> UT_Variable;
00080
00081 UT_String myHostName;
00082 UT_String myProxyHostName;
00083 int myPort;
00084 int myProxyPort;
00085 UT_String myPageName;
00086 UT_String mySessionId;
00087 UT_RefArray<UT_Variable> myVariables;
00088 int myModTime;
00089 };
00090
00091 #endif