00001
00002
00003
00004
00005
00006 #ifndef __DOWNLOADPROPERTIES_H_
00007 #define __DOWNLOADPROPERTIES_H_
00008
00009 #include <inetfile/inetfile.h>
00010
00011 enum fsNetworkProtocol
00012 {
00013 NP_HTTP,
00014 NP_HTTPS,
00015 NP_FTP,
00016 NP_FILE
00017 };
00018
00019 #define FTP_USEPASSIVEMODE 1
00020
00021 #define FTP_DONTSENDLIST 2
00022
00023 enum fsInternetAccessTypeEx
00024 {
00025 IATE_NOPROXY = IAT_NOPROXY,
00026 IATE_PRECONFIGPROXY = IAT_PRECONFIGPROXY,
00027 IATE_MANUALPROXY = IAT_MANUALPROXY,
00028 IATE_FIREFOXPROXY,
00029 };
00030
00031 struct fsDownload_NetworkProperties
00032 {
00033 WORD wRollBackSize;
00034
00035 LPSTR pszAgent;
00036
00037 fsInternetAccessTypeEx enAccType;
00038 LPSTR pszProxyName;
00039 LPSTR pszProxyUserName;
00040 LPSTR pszProxyPassword;
00041
00042 fsNetworkProtocol enProtocol;
00043 LPSTR pszServerName;
00044 INTERNET_PORT uServerPort;
00045 LPSTR pszUserName;
00046 LPSTR pszPassword;
00047
00048 LPSTR pszPathName;
00049
00050 BOOL bUseHttp11;
00051 LPSTR pszReferer;
00052 BOOL bUseCookie;
00053
00054 DWORD dwFtpFlags;
00055 fsFtpTransferType enFtpTransferType;
00056
00057 LPSTR pszASCIIExts;
00058
00059 LPSTR pszCookies;
00060 LPSTR pszPostData;
00061
00062 DWORD dwFlags;
00063
00064 WORD wLowSpeed_Factor;
00065
00066 WORD wLowSpeed_Duration;
00067 };
00068
00069 #define DNPF_RESTARTSECTIONWHENSPEEDTOOLOW 1
00070
00071 #define DNPF_IMMEDIATELY_SEND_AUTH_AS_BASIC 2
00072
00073 struct fsDNP_BuffersInfo
00074 {
00075 UINT nAgentSize;
00076 UINT nProxyNameSize;
00077 UINT nProxyUserNameSize;
00078 UINT nProxyPasswordSize;
00079 UINT nServerNameSize;
00080 UINT nUserNameSize;
00081 UINT nPasswordSize;
00082 UINT nPathNameSize;
00083 UINT nRefferSize;
00084 UINT nTransferTypeExtsSize;
00085 UINT nCookiesSize;
00086 UINT nPostDataSize;
00087 };
00088
00089 enum fsDownloadFileError
00090 {
00091 DFE_NOTFOUND = 0,
00092 DFE_ACCDENIED = 1,
00093
00094 DFE_UNKNOWN = 2
00095 };
00096
00097 enum fsDownloadFileErrorProcessing
00098 {
00099 DFEP_STOP,
00100 DFEP_IGNORE
00101 };
00102
00103 enum fsAlreadyExistReaction
00104 {
00105 AER_ASKUSER,
00106 AER_REWRITE,
00107 AER_RENAME,
00108 AER_RESUME,
00109 AER_STOP,
00110 AER_RENAME_2
00111 };
00112
00113 enum fsSizeChangeReaction
00114 {
00115 SCR_ASKUSER,
00116 SCR_RESTART,
00117 SCR_ADJUSTFORNEWSIZE,
00118 SCR_STOP,
00119 };
00120
00121 enum vmsIntegrityCheckFailedReaction
00122 {
00123 ICFR_ASKUSER,
00124 ICFR_RESTART,
00125 ICFR_IGNORE,
00126 };
00127
00128 #define DPF_DONTRESTARTIFNORESUME 1
00129 #define DPF_USEZIPPREVIEW 2
00130
00131 #define DPF_USEHIDDENATTRIB 4
00132
00133 #define DPF_APPENDCOMMENTTOFILENAME 8
00134
00135 #define DPF_STARTWHENDONE 16
00136
00137 #define DPF_STARTWHENDONE_NOCONF 32
00138
00139 #define DPF_RETRDATEFROMSERVER 64
00140
00141 #define DPF_GENERATEDESCFILE 128
00142
00143 struct fsDownload_Properties
00144 {
00145 WORD wStructSize;
00146
00147 UINT uTrafficRestriction;
00148 UINT uMaxAttempts;
00149 UINT uRetriesTime;
00150 UINT uTimeout;
00151
00152 UINT uSectionMinSize;
00153 UINT uMaxSections;
00154 BOOL bRestartSpeedLow;
00155
00156 LPSTR pszFileName;
00157 BOOL bReserveDiskSpace;
00158
00159 BOOL bIgnoreRestrictions;
00160
00161 fsDownloadFileErrorProcessing aEP [DFE_UNKNOWN];
00162 fsAlreadyExistReaction enAER;
00163 fsSizeChangeReaction enSCR;
00164 LPSTR pszAdditionalExt;
00165 DWORD dwFlags;
00166 LPSTR pszCreateExt;
00167
00168 BOOL bCheckIntegrityWhenDone;
00169 vmsIntegrityCheckFailedReaction enICFR;
00170 LPSTR pszCheckSum;
00171
00172 DWORD dwIntegrityCheckAlgorithm;
00173 };
00174
00175 struct fsDP_BuffersInfo
00176 {
00177 UINT nAdditionalExtSize;
00178 };
00179
00180 extern void fsDNP_SetAuth (fsDownload_NetworkProperties* dnp, LPCSTR pszUser, LPCSTR pszPassword);
00181
00182 extern BOOL fsDNP_GetDefaults (fsDownload_NetworkProperties *pDNP, fsDNP_BuffersInfo* pBuffs, BOOL bAllocate);
00183
00184 extern void fsDNP_GetDefaults_Free (fsDownload_NetworkProperties *pDNP);
00185
00186 extern fsInternetResult fsDNP_ApplyUrl (fsDownload_NetworkProperties *dnp, LPCSTR pszUrl);
00187
00188 extern BOOL fsDP_GetDefaults (fsDownload_Properties *pDP, fsDP_BuffersInfo* pBuffs, BOOL bAllocate);
00189
00190 extern fsInternetResult fsDNP_GetByUrl (fsDownload_NetworkProperties *pDNP, fsDNP_BuffersInfo* pBuffs, BOOL bAllocate, LPCSTR pszUrl);
00191
00192 extern void fsDNP_GetByUrl_Free (fsDownload_NetworkProperties *pDNP);
00193
00194 extern fsNetworkProtocol fsSchemeToNP (INTERNET_SCHEME scheme);
00195 extern INTERNET_SCHEME fsNPToScheme (fsNetworkProtocol np);
00196
00197 extern fsInternetResult fsGetProxyByNP (fsDownload_NetworkProperties *pDNP, fsDNP_BuffersInfo* pBuffs, BOOL bAllocate);
00198
00199 extern BOOL fsGetProxy (fsNetworkProtocol np, CString& strProxy, CString& strUser, CString& strPassword);
00200
00201 extern BOOL fsDNP_CloneSettings (fsDownload_NetworkProperties *dst, fsDownload_NetworkProperties *src);
00202
00203 extern void fsDNP_GetURL (fsDownload_NetworkProperties* dnp, LPSTR pszURL);
00204
00205 #endif