SenHttpTransportProperties.h

Go to the documentation of this file.
00001 /*
00002 * =========================================================================
00003 *  Name     : SenHttpTransportProperties.h
00004 *  Part of  : Nokia Web Services Framework
00005 *  Created  : 2005-09-26 by Nokia
00006 *  Descr.   :
00007 *   
00008 *  Copyright © 2002-2007 Nokia. All rights reserved.
00009 *  This material, including documentation and any related 
00010 *  computer programs, is protected by copyright controlled by 
00011 *  Nokia. All rights are reserved. Copying, including 
00012 *  reproducing, storing, adapting or translating, any 
00013 *  or all of this material requires the prior written consent of 
00014 *  Nokia. This material also contains confidential 
00015 *  information which may not be disclosed to others without the 
00016 *  prior written consent of Nokia.
00017 * ==============================================================================
00018 */
00019 
00020 
00021 #ifndef SEN_HTTP_TRANSPORT_PROPERTIES_H
00022 #define SEN_HTTP_TRANSPORT_PROPERTIES_H
00023 
00024 // INCLUDE
00025 #include <SenTransportProperties.h>
00026 
00027 // CONSTANTS
00028 _LIT8(KSenHttpAcceptHeaderDelimiter, ",");
00029 
00030 // Supported Http properties:
00031 
00033 _LIT8(KHttpMethodLocalName,     "HttpMethod");
00034 _LIT8(KHttpVersionLocalName,    "HttpVersion");
00035 
00037 _LIT8(KContentTypeLocalName,    "Content-Type");
00038 _LIT8(KAcceptLocalName,         "Accept");
00039 _LIT8(KSlugLocalName,           "Slug");
00040 
00041 // Supported Http methods:
00042 _LIT8(KHttpGet,                 "Get");
00043 _LIT8(KHttpPost,                "Post");
00044 _LIT8(KHttpPut,                 "Put");
00045 _LIT8(KHttpDelete,              "Delete");
00046 
00047 // Supported Http versions:
00048 _LIT8(KHttp10,                  "Http1.0");
00049 _LIT8(KHttp11,                  "Http1.1");
00050 
00051 //NOTE:
00065 // CLASS DECLARATION
00066 class CSenHttpTransportProperties : public CSenTransportProperties
00067     {
00068     public:
00072         enum TSenHttpMethod
00073                 {
00074                 ESenHttpPut,
00075                 ESenHttpDelete,
00076                 ESenHttpGet,
00077             ESenHttpPost                
00078             };
00082         enum TSenHttpVersion
00083                 {
00084                 ESenHttp10,
00085                 ESenHttp11
00086             };            
00091         IMPORT_C static CSenHttpTransportProperties* NewL();
00096         IMPORT_C static CSenHttpTransportProperties* NewLC();
00097 
00104         IMPORT_C static CSenHttpTransportProperties* NewL(const TDesC8& aXmlUtf8,
00105                                                           CSenXmlReader& aParser);
00106 
00113         IMPORT_C static CSenHttpTransportProperties* NewLC(const TDesC8& aXmlUtf8,
00114                                                            CSenXmlReader& aParser);
00115 
00121         IMPORT_C static CSenHttpTransportProperties* NewL(const CSenElement& aElement);
00127         IMPORT_C static CSenHttpTransportProperties* NewLC(const CSenElement& aElement);
00128          
00136         virtual TInt IapIdL(TUint32& aCurrentIapId);
00137 
00142         virtual void SetIapIdL(TUint32 aIapId);
00143 
00151         virtual TInt ProxyPortL(TInt& aProxyPort);
00152 
00157         virtual void SetProxyPortL(TInt aProxyPort);
00158 
00166         virtual TInt ProxyHostL(TPtrC8& aProxyHost);
00167 
00172         virtual void SetProxyHostL(const TDesC8& aProxyHost);
00173         
00181         virtual TInt ProxyUsageL(TBool& aProxyUsage);
00182 
00187         virtual void SetProxyUsageL(TBool aProxyUsage);
00188 
00196         virtual TInt SecureDialogL(TBool& aSecureDialog);
00197 
00202         virtual void SetSecureDialogL(TBool aSecureDialog);
00203         
00211 //        virtual TInt IAPDialogL(TBool& aIAPDialog);
00212 
00217 //        virtual void SetIAPDialogL(TBool aIAPDialog);
00218 
00226         virtual TInt ContentTypeL(TPtrC8& aContentType);
00227         
00232         virtual void SetContentTypeL(const TDesC8& aContentType);
00233         
00241         virtual TInt SoapActionL(TPtrC8& aSoapAction);
00242         
00247         virtual void SetSoapActionL(const TDesC8& aSoapAction);
00248         
00256         virtual TInt UserAgentL(TPtrC8& aUserAgent);
00257         
00262         virtual void SetUserAgentL(const TDesC8& aUserAgent);
00263 
00271         virtual TInt AcceptL(TPtrC8& aAccept);
00272         
00277         virtual void SetAcceptL(const TDesC8& aAccept);
00278         
00286         virtual TInt HttpMethodL(TSenHttpMethod& aHttpMethod);
00287         
00292         virtual void SetHttpMethodL(TSenHttpMethod aHttpMethod);
00293 
00301         virtual TInt HttpVersionL(TSenHttpVersion& aHttpVersion);
00302         
00307         virtual void SetHttpVersionL(TSenHttpVersion aHttpVersion);        
00308 
00317         virtual TInt HttpHeaderL(const TDesC8& aHeaderName, TPtrC8& aValue);
00318         
00324         virtual void SetHttpHeaderL(const TDesC8& aHeaderName,
00325                                     const TDesC8& aValue);
00326 
00327 
00335         virtual TInt DeviceIDL(TPtrC8& aDeviceID);
00336 
00341         virtual void SetDeviceIDL(const TDesC8& aDeviceID);
00342 
00351         virtual TInt DownloadFolderL(TPtrC8& aDownloadFolder);
00352         
00357         virtual void SetDownloadFolderL(const TDesC8& aDownloadFolder);
00358              
00366         virtual TInt FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName);
00367         
00375         virtual TInt SetFileAttachmentL(const TDesC8& aCid, const TDesC8& aFileName);
00376 
00381         virtual void ApplyBindingL(TSOAPVersion aSoapVersion);
00382 
00389         virtual TInt MwsNamespaceL(TPtrC8& aMwsNamespace);
00390         
00397         virtual void SetMwsNamespaceL(const TDesC8& aMwsNamespace);
00398 
00399         // From MSenProperties
00400         virtual void SetReader(CSenXmlReader& aReader);
00401         virtual TSenPropertiesClassType PropertiesClassType();
00402         virtual void WriteToL(RWriteStream& aWriteStream);
00403         virtual void ReadFromL(const TDesC8& aBuffer);
00404         virtual HBufC8* AsUtf8L();
00405         virtual HBufC8* AsUtf8LC();
00406         virtual TBool IsSafeToCast(TSenPropertiesClassType aClass);
00407         virtual MSenProperties* CloneL() const;
00408         
00409         virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue);
00410         virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);        
00411         virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aType);
00412         virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue, TPtrC8& aType);
00413         virtual TInt SetIntPropertyL(const TDesC8& aName, const TInt aValue);
00414         virtual TInt IntPropertyL(const TDesC8& aName, TInt& aValue);
00415         virtual TInt SetBoolPropertyL(const TDesC8& aName, const TBool aValue);        
00416         virtual TInt BoolPropertyL(const TDesC8& aName, TBool& aValue);
00417         virtual TInt SetOmittedL(const TDesC8& aName, TBool aValue);
00418         virtual TInt RemovePropertyL(const TDesC8& aName);
00419 
00423         virtual ~CSenHttpTransportProperties();
00424 
00425     protected: // base class functions
00426 
00427         virtual void BaseConstructL(const TDesC8& aLocalname, 
00428                                     const TDesC8& aXml,
00429                                     CSenXmlReader* aParser = NULL);
00430 
00431         virtual void BaseConstructL(const TDesC8& aNamespace, 
00432                                     const TDesC8& aLocalname, 
00433                                     const TDesC8& aXml,
00434                                     CSenXmlReader* aParser = NULL);
00435 
00436         virtual void BaseConstructL(const TDesC8& aNamespace, 
00437                                     const TDesC8& aLocalname, 
00438                                     const TDesC8& aQualifiedName, 
00439                                     const TDesC8& aXml,
00440                                     CSenXmlReader* aParser = NULL);
00441 
00442         virtual void BaseConstructL(const CSenElement& aElement);
00443 
00444         public:
00449                 virtual void SetSnapIdL(TUint32 aSnapId);
00450 
00458         virtual TInt SnapIdL(TUint32& aCurrentSnapId);
00459     protected:
00463         CSenHttpTransportProperties();
00464     private:
00465         HBufC8* AdaptDblQutesLC(const TDesC8& aValue);
00466     };
00467 
00468 #endif // SEN_HTTP_TRANSPORT_PROPERTIES_H

Copyright © Nokia Corporation 2001-2007
Back to top