epoc32/include/mw/senhttptransportproperties.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/senhttptransportproperties.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/senhttptransportproperties.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,465 @@
     1.4 -senhttptransportproperties.h
     1.5 +/*
     1.6 +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors: 
    1.17 +*
    1.18 +* Description: Http transport properties class declaration     
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +#ifndef SEN_HTTP_TRANSPORT_PROPERTIES_H
    1.23 +#define SEN_HTTP_TRANSPORT_PROPERTIES_H
    1.24 +
    1.25 +// INCLUDE
    1.26 +#include <SenTransportProperties.h>
    1.27 +
    1.28 +// CONSTANTS
    1.29 +_LIT8(KSenHttpAcceptHeaderDelimiter, ",");
    1.30 +
    1.31 +// Supported Http properties:
    1.32 +
    1.33 +//// -- session properties:
    1.34 +_LIT8(KHttpMethodLocalName,     "HttpMethod");
    1.35 +_LIT8(KHttpVersionLocalName,    "HttpVersion");
    1.36 +
    1.37 +//// -- HTTP headers names:
    1.38 +_LIT8(KContentTypeLocalName,    "Content-Type");
    1.39 +_LIT8(KAcceptLocalName,         "Accept");
    1.40 +_LIT8(KSlugLocalName,           "Slug");
    1.41 +
    1.42 +// Supported Http methods:
    1.43 +_LIT8(KHttpGet,                 "Get");
    1.44 +_LIT8(KHttpPost,                "Post");
    1.45 +_LIT8(KHttpPut,                 "Put");
    1.46 +_LIT8(KHttpDelete,              "Delete");
    1.47 +
    1.48 +// Supported Http versions:
    1.49 +_LIT8(KHttp10,                  "Http1.0");
    1.50 +_LIT8(KHttp11,                  "Http1.1");
    1.51 +
    1.52 +//NOTE:
    1.53 +/**	In SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties)
    1.54 + *	or
    1.55 + *	SubmitL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties, HBufc8*& aResponseTO)  
    1.56 + *	aProperties could be "HTTP GET" or "HTTP DELETE"
    1.57 + *  aMessage is a soap message or serialized XML.
    1.58 + *	This scenario is not supported. 
    1.59 + *
    1.60 + *	These are the function calls get called during this scenario
    1.61 + *	iHttpProperties->SetHttpHeaderL(const TDesC8& aHeaderName, const TDesC8& aValue);
    1.62 + *	iHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
    1.63 + *	SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties);
    1.64 +**/
    1.65 +
    1.66 +// CLASS DECLARATION
    1.67 +class CSenHttpTransportProperties : public CSenTransportProperties
    1.68 +    {
    1.69 +    public:
    1.70 +		/**
    1.71 +		 * HttpMethod Enumeration
    1.72 +		 */    		
    1.73 +        enum TSenHttpMethod
    1.74 +        	{
    1.75 +        	ESenHttpPut,
    1.76 +        	ESenHttpDelete,
    1.77 +        	ESenHttpGet,
    1.78 +            ESenHttpPost        	
    1.79 +            };
    1.80 +		/**
    1.81 +		 * HttpVersion Enumeration
    1.82 +		 */    		            
    1.83 +        enum TSenHttpVersion
    1.84 +        	{
    1.85 +        	ESenHttp10,
    1.86 +        	ESenHttp11
    1.87 +            };            
    1.88 +        /**
    1.89 +        * Basic constructor.
    1.90 +        * @return a pointer to new CSenHttpTransportProperties class instance.
    1.91 +        */
    1.92 +        IMPORT_C static CSenHttpTransportProperties* NewL();
    1.93 +        /**
    1.94 +        * Basic constructor.
    1.95 +        * @return a pointer to new CSenHttpTransportProperties class instance.
    1.96 +        */
    1.97 +        IMPORT_C static CSenHttpTransportProperties* NewLC();
    1.98 +
    1.99 +        /**
   1.100 +        * Basic constructor.
   1.101 +		* @param aXmlUtf8 
   1.102 +    	* @param aParser It is a XML reader        
   1.103 +        * @return a pointer to new CSenHttpTransportProperties class instance.
   1.104 +        */
   1.105 +        IMPORT_C static CSenHttpTransportProperties* NewL(const TDesC8& aXmlUtf8,
   1.106 +                                                          CSenXmlReader& aParser);
   1.107 +
   1.108 +        /**
   1.109 +        * Basic constructor.
   1.110 +		* @param aXmlUtf8 
   1.111 +    	* @param aParser It is a XML reader        
   1.112 +        * @return a pointer to new CSenHttpTransportProperties class instance.
   1.113 +        */
   1.114 +        IMPORT_C static CSenHttpTransportProperties* NewLC(const TDesC8& aXmlUtf8,
   1.115 +                                                           CSenXmlReader& aParser);
   1.116 +
   1.117 +        /**
   1.118 +        * Basic constructor.
   1.119 +		* @param aElement
   1.120 +        * @return a pointer to new CSenHttpTransportProperties class instance.
   1.121 +        */
   1.122 +        IMPORT_C static CSenHttpTransportProperties* NewL(const CSenElement& aElement);
   1.123 +        /**
   1.124 +        * Basic constructor.
   1.125 +		* @param aElement 
   1.126 +        * @return a pointer to new CSenHttpTransportProperties class instance.
   1.127 +        */
   1.128 +        IMPORT_C static CSenHttpTransportProperties* NewLC(const CSenElement& aElement);
   1.129 +         
   1.130 +        /**
   1.131 +        * Gets the IAP ID.
   1.132 +        * @param aCurrentIapId  A TUint32 reference to be filled in with the
   1.133 +        *                       value of the IAP ID.
   1.134 +        * @return               KErrNone if no error, or some of the system
   1.135 +        *                       wide error codes.
   1.136 +        */
   1.137 +        virtual TInt IapIdL(TUint32& aCurrentIapId);
   1.138 +
   1.139 +        /**
   1.140 +        * Sets the IAP ID.
   1.141 +        * @param aIapId is the new IAP ID.
   1.142 +        */
   1.143 +        virtual void SetIapIdL(TUint32 aIapId);
   1.144 +
   1.145 +        /**
   1.146 +        * Gets the Proxy Port.
   1.147 +        * @param aProxyPort  A TInt reference to be filled in with the
   1.148 +        *                    value of the Proxy Port.
   1.149 +        * @return            KErrNone if no error, or some of the system
   1.150 +        *                    wide error codes.
   1.151 +        */
   1.152 +        virtual TInt ProxyPortL(TInt& aProxyPort);
   1.153 +
   1.154 +        /**
   1.155 +        * Sets the Proxy Port.
   1.156 +        * @param aProxyPort is the new Proxy Port.
   1.157 +        */
   1.158 +        virtual void SetProxyPortL(TInt aProxyPort);
   1.159 +
   1.160 +        /**
   1.161 +        * Gets the Proxy Host.
   1.162 +        * @param aProxyHost  A TPtrC8 reference to be filled in with the
   1.163 +        *                    value of the Proxy Host.
   1.164 +        * @return            KErrNone if no error, or some of the system
   1.165 +        *                    wide error codes.
   1.166 +        */
   1.167 +        virtual TInt ProxyHostL(TPtrC8& aProxyHost);
   1.168 +
   1.169 +        /**
   1.170 +        * Sets the Proxy Host.
   1.171 +        * @param aProxyHost is the new Proxy Host.
   1.172 +        */
   1.173 +        virtual void SetProxyHostL(const TDesC8& aProxyHost);
   1.174 +        
   1.175 +        /**
   1.176 +        * Gets the Proxy Usage flag.
   1.177 +        * @param aProxyUsage A TBool reference to be filled in with the
   1.178 +        *                    value of the Proxy Usage.
   1.179 +        * @return            KErrNone if no error, or some of the system
   1.180 +        *                    wide error codes.
   1.181 +        */
   1.182 +        virtual TInt ProxyUsageL(TBool& aProxyUsage);
   1.183 +
   1.184 +        /**
   1.185 +        * Sets the Proxy Usage flag.
   1.186 +        * @param aProxyUsage is the new value for Proxy Usage.
   1.187 +        */
   1.188 +        virtual void SetProxyUsageL(TBool aProxyUsage);
   1.189 +
   1.190 +        /**
   1.191 +        * Gets the information if SecureDialog is shown or not.
   1.192 +        * @param aProxyUsage A TBool reference to be filled in with the
   1.193 +        *                    value of the SecureDialog flag.
   1.194 +        * @return            KErrNone if no error, or some of the system
   1.195 +        *                    wide error codes.
   1.196 +        */
   1.197 +        virtual TInt SecureDialogL(TBool& aSecureDialog);
   1.198 +
   1.199 +        /**
   1.200 +        * Sets the flag which controls showing of SecureDialog.
   1.201 +        * @param aSecureDialog is the new value for SecureDialog flag.
   1.202 +        */
   1.203 +        virtual void SetSecureDialogL(TBool aSecureDialog);
   1.204 +        
   1.205 +        /**
   1.206 +        * Gets the information if IAPDialog is shown or not.
   1.207 +        * @param aIAPDialog A TBool reference to be filled in with the
   1.208 +        *                   value of the IAPDialog flag.
   1.209 +        * @return           KErrNone if no error, or some of the system
   1.210 +        *                   wide error codes.
   1.211 +        */
   1.212 +//        virtual TInt IAPDialogL(TBool& aIAPDialog);
   1.213 +
   1.214 +        /**
   1.215 +        * Sets the flag which controls showing of IAPDialog.
   1.216 +        * @param aIAPDialog is the new value for IAPDialog flag.
   1.217 +        */
   1.218 +//        virtual void SetIAPDialogL(TBool aIAPDialog);
   1.219 +
   1.220 +        /**
   1.221 +        * Gets the Content Type.
   1.222 +        * @param aContentType A TPtrC8 reference to be filled in with the
   1.223 +        *                     value of the Content Type.
   1.224 +        * @return             KErrNone if no error, or some of the system
   1.225 +        *                     wide error codes.
   1.226 +        */
   1.227 +        virtual TInt ContentTypeL(TPtrC8& aContentType);
   1.228 +        
   1.229 +        /**
   1.230 +        * Sets the Content Type.
   1.231 +        * @param aContentType is the new Content Type.
   1.232 +        */
   1.233 +        virtual void SetContentTypeL(const TDesC8& aContentType);
   1.234 +        
   1.235 +        /**
   1.236 +        * Gets the SoapAction.
   1.237 +        * @param aSoapAction A TPtrC8 reference to be filled in with the
   1.238 +        *                    value of the SoapAction.
   1.239 +        * @return            KErrNone if no error, or some of the system
   1.240 +        *                    wide error codes.
   1.241 +        */
   1.242 +        virtual TInt SoapActionL(TPtrC8& aSoapAction);
   1.243 +        
   1.244 +        /**
   1.245 +        * Sets the Soap Action.
   1.246 +        * @param aSoapAction is the new Soap Action.
   1.247 +        */
   1.248 +        virtual void SetSoapActionL(const TDesC8& aSoapAction);
   1.249 +        
   1.250 +        /**
   1.251 +        * Gets the UserAgent.
   1.252 +        * @param aUserAgent  A TPtrC8 reference to be filled in with the
   1.253 +        *                    value of the UserAgent.
   1.254 +        * @return            KErrNone if no error, or some of the system
   1.255 +        *                    wide error codes.
   1.256 +        */
   1.257 +        virtual TInt UserAgentL(TPtrC8& aUserAgent);
   1.258 +        
   1.259 +        /**
   1.260 +        * Sets the UserAgent.
   1.261 +        * @param aUserAgent is the new User Agent.
   1.262 +        */
   1.263 +        virtual void SetUserAgentL(const TDesC8& aUserAgent);
   1.264 +
   1.265 +        /**
   1.266 +        * Gets the Accept.
   1.267 +        * @param aAccept     A TPtrC8 reference to be filled in with the
   1.268 +        *                    value of the Accept.
   1.269 +        * @return            KErrNone if no error, or some of the system
   1.270 +        *                    wide error codes.
   1.271 +        */
   1.272 +        virtual TInt AcceptL(TPtrC8& aAccept);
   1.273 +        
   1.274 +        /**
   1.275 +        * Sets the Accept.
   1.276 +        * @param aAccept is the new Accept value.
   1.277 +        */
   1.278 +        virtual void SetAcceptL(const TDesC8& aAccept);
   1.279 +        
   1.280 +        /**
   1.281 +        * Gets the Http method.
   1.282 +        * @param aHttpMethod A TSenHttpMethod reference to be filled in with
   1.283 +        *                    the value of the Http method.
   1.284 +        * @return            KErrNone if no error, or some of the system
   1.285 +        *                    wide error codes.
   1.286 +        */
   1.287 +        virtual TInt HttpMethodL(TSenHttpMethod& aHttpMethod);
   1.288 +        
   1.289 +        /**
   1.290 +        * Sets the Http method.
   1.291 +        * @param aHttpMethod is the new Http method.
   1.292 +        */
   1.293 +        virtual void SetHttpMethodL(TSenHttpMethod aHttpMethod);
   1.294 +
   1.295 +        /**
   1.296 +        * Gets the Http version.
   1.297 +        * @param aHttpVersion A TSenHttpVersion reference to be filled in with
   1.298 +        *                     the value of the Http version.
   1.299 +        * @return             KErrNone if no error, or some of the system
   1.300 +        *                     wide error codes.
   1.301 +        */
   1.302 +        virtual TInt HttpVersionL(TSenHttpVersion& aHttpVersion);
   1.303 +        
   1.304 +        /**
   1.305 +        * Sets the Http version.
   1.306 +        * @param aHttpVersion is the new Http version.
   1.307 +        */
   1.308 +        virtual void SetHttpVersionL(TSenHttpVersion aHttpVersion);        
   1.309 +
   1.310 +        /**
   1.311 +        * Gets the Http header.
   1.312 +        * @param aHeaderName  Name of the Http header.
   1.313 +        * @param aValue       A TPtrC8 reference to be filled in with the
   1.314 +        *                     value of the Http header.
   1.315 +        * @return             KErrNone if no error, or some of the system
   1.316 +        *                     wide error codes.
   1.317 +        */
   1.318 +        virtual TInt HttpHeaderL(const TDesC8& aHeaderName, TPtrC8& aValue);
   1.319 +        
   1.320 +        /**
   1.321 +        * Sets the Http header.
   1.322 +        * @param aHeaderName  Name of the Http header.
   1.323 +        * @param aValue       Value of the Http header
   1.324 +        */
   1.325 +        virtual void SetHttpHeaderL(const TDesC8& aHeaderName,
   1.326 +                                    const TDesC8& aValue);
   1.327 +
   1.328 +
   1.329 +        /**
   1.330 +        * Gets the device ID
   1.331 +        * @param aDeviceID  A TPtrC8 reference to be filled in with the
   1.332 +        *                    value of the Device ID.
   1.333 +        * @return            KErrNone if no error, or some of the system
   1.334 +        *                    wide error codes.
   1.335 +        */
   1.336 +        virtual TInt DeviceIDL(TPtrC8& aDeviceID);
   1.337 +
   1.338 +        /**
   1.339 +        * Sets the Device ID.
   1.340 +        * @param aDeviceID is the new Device ID.
   1.341 +        */
   1.342 +        virtual void SetDeviceIDL(const TDesC8& aDeviceID);
   1.343 +
   1.344 +        /**
   1.345 +        * Gets download folder for incoming BLOB (binary large objects)
   1.346 +        * @param aDownloadFolder - A TPtrC8 reference to be filled in with the
   1.347 +        *                    value of the shared, public folder for downloaded 
   1.348 +        *                    content
   1.349 +        * @return            KErrNone if no error, or some of the system
   1.350 +        *                    wide error codes.
   1.351 +        */
   1.352 +        virtual TInt DownloadFolderL(TPtrC8& aDownloadFolder);
   1.353 +        
   1.354 +        /**
   1.355 +        * Sets download folder for incoming BLOB (binary large objects)
   1.356 +        * @param aDownloadFolder - shared, public folder for downloaded content
   1.357 +        */
   1.358 +        virtual void SetDownloadFolderL(const TDesC8& aDownloadFolder);
   1.359 +             
   1.360 +        /**
   1.361 +        * Gets filename of file attachment
   1.362 +        * @param aCid - cid for filename
   1.363 +        * @param aFileName - filename of file attachment with current cid
   1.364 +        * @return            KErrNone if no error, or some of the system
   1.365 +        *                    wide error codes.
   1.366 +        */
   1.367 +        virtual TInt FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName);
   1.368 +        
   1.369 +        /**
   1.370 +        * Sets filename of file attachment
   1.371 +        * @param aCid - cid for filename
   1.372 +        * @param aFileName - filename of file attachment with current cid
   1.373 +        * @return            KErrNone if no error, or some of the system
   1.374 +        *                    wide error codes.
   1.375 +        */
   1.376 +        virtual TInt SetFileAttachmentL(const TDesC8& aCid, const TDesC8& aFileName);
   1.377 +
   1.378 +        /**
   1.379 +        * Apply binding.
   1.380 +        * @param aSoapVersion is a soap1.2 or soap1.1.
   1.381 +        */
   1.382 +        virtual void ApplyBindingL(TSOAPVersion aSoapVersion);
   1.383 +
   1.384 +        /**
   1.385 +        * Gets namespace of Microsoft schema
   1.386 +        * @param aMwsNamespace - namespace 
   1.387 +        * @return            KErrNone if no error, or some of the system
   1.388 +        *                    wide error codes.
   1.389 +        */
   1.390 +        virtual TInt MwsNamespaceL(TPtrC8& aMwsNamespace);
   1.391 +        
   1.392 +        /**
   1.393 +        * Sets namespace of Microsoft schema
   1.394 +        * @param aMwsNamespace - namespace
   1.395 +        * @return            KErrNone if no error, or some of the system
   1.396 +        *                    wide error codes.
   1.397 +        */
   1.398 +        virtual void SetMwsNamespaceL(const TDesC8& aMwsNamespace);
   1.399 +
   1.400 +        // From MSenProperties
   1.401 +        virtual void SetReader(CSenXmlReader& aReader);
   1.402 +        virtual TSenPropertiesClassType PropertiesClassType();
   1.403 +        virtual void WriteToL(RWriteStream& aWriteStream);
   1.404 +        virtual void ReadFromL(const TDesC8& aBuffer);
   1.405 +        virtual HBufC8* AsUtf8L();
   1.406 +        virtual HBufC8* AsUtf8LC();
   1.407 +        virtual TBool IsSafeToCast(TSenPropertiesClassType aClass);
   1.408 +        virtual MSenProperties* CloneL() const;
   1.409 +        
   1.410 +        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue);
   1.411 +        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);        
   1.412 +        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aType);
   1.413 +        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue, TPtrC8& aType);
   1.414 +        virtual TInt SetIntPropertyL(const TDesC8& aName, const TInt aValue);
   1.415 +        virtual TInt IntPropertyL(const TDesC8& aName, TInt& aValue);
   1.416 +        virtual TInt SetBoolPropertyL(const TDesC8& aName, const TBool aValue);        
   1.417 +        virtual TInt BoolPropertyL(const TDesC8& aName, TBool& aValue);
   1.418 +        virtual TInt SetOmittedL(const TDesC8& aName, TBool aValue);
   1.419 +        virtual TInt RemovePropertyL(const TDesC8& aName);
   1.420 +
   1.421 +       /**
   1.422 +        * Destructor.
   1.423 +        */
   1.424 +        virtual ~CSenHttpTransportProperties();
   1.425 +
   1.426 +    protected: // base class functions
   1.427 +
   1.428 +        virtual void BaseConstructL(const TDesC8& aLocalname, 
   1.429 +                                    const TDesC8& aXml,
   1.430 +                                    CSenXmlReader* aParser = NULL);
   1.431 +
   1.432 +        virtual void BaseConstructL(const TDesC8& aNamespace, 
   1.433 +                                    const TDesC8& aLocalname, 
   1.434 +                                    const TDesC8& aXml,
   1.435 +                                    CSenXmlReader* aParser = NULL);
   1.436 +
   1.437 +        virtual void BaseConstructL(const TDesC8& aNamespace, 
   1.438 +                                    const TDesC8& aLocalname, 
   1.439 +                                    const TDesC8& aQualifiedName, 
   1.440 +                                    const TDesC8& aXml,
   1.441 +                                    CSenXmlReader* aParser = NULL);
   1.442 +
   1.443 +        virtual void BaseConstructL(const CSenElement& aElement);
   1.444 +
   1.445 +	public:
   1.446 +        /**
   1.447 +        * Sets the SNAP ID.
   1.448 +        * @param aSnapId is the new SNAP ID.
   1.449 +        */
   1.450 +		virtual void SetSnapIdL(TUint32 aSnapId);
   1.451 +
   1.452 +        /**
   1.453 +        * Gets the SNAP ID.
   1.454 +        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
   1.455 +        *                       value of the SNAP ID.
   1.456 +        * @return               KErrNone if no error, or some of the system
   1.457 +        *                       wide error codes.
   1.458 +        */
   1.459 +        virtual TInt SnapIdL(TUint32& aCurrentSnapId);
   1.460 +    protected:
   1.461 +        /**
   1.462 +        * Constructor.
   1.463 +        */
   1.464 +        CSenHttpTransportProperties();
   1.465 +    private:
   1.466 +        HBufC8* AdaptDblQutesLC(const TDesC8& aValue);
   1.467 +    };
   1.468 +
   1.469 +#endif // SEN_HTTP_TRANSPORT_PROPERTIES_H