xdmprotocols/XcapProtocol/XcapHttpTransport/inc/XcapHttpTransport.h
branchRCL_3
changeset 35 fbd2e7cec7ef
parent 0 c8caa15ef882
child 12 e6a66db4e9d0
equal deleted inserted replaced
34:2669f8761a99 35:fbd2e7cec7ef
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  CXcapHttpTransport 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __XCAPHTTPTRANSPORT__
       
    22 #define __XCAPHTTPTRANSPORT__
       
    23 
       
    24 // INCLUDES
       
    25 #include <http.h>
       
    26 #include <XdmCredentials.h>
       
    27 
       
    28 //COMMON CONSTANTS
       
    29 _LIT( KTransportLogFile,                        "HttpTransport" );
       
    30 const TInt KTransportLogBufMaxSize              = 2000;
       
    31 _LIT( KTransportDateFormat,                     "%D%M%Y%/0%1%/1%2%/2%3%/3 %:0%H%:1%T%:2%S.%C%:3");
       
    32 const TInt KMaxSubmitSize                       = 1024;
       
    33 const TInt KMaxHeaderNameLen                    = 32;
       
    34 const TInt KMaxHeaderValueLen                   = 128;
       
    35 const TInt KBufferMaxSize                       = 2048;
       
    36 
       
    37 //FORWARD DECLARATIONS
       
    38 class CXdmLogWriter;
       
    39 class MMsgConnManager;
       
    40 class CXcapHttpReqGet;
       
    41 class CXcapHttpReqPut;
       
    42 class CXcapHttpReqDelete;
       
    43 class CXcapHttpAuthManager;
       
    44 class CXcapHttpReqMkcol;
       
    45 class CXcapHttpReqHead;
       
    46 
       
    47 // CLASS DECLARATION
       
    48 class CXcapHttpTransport : public CBase
       
    49 
       
    50     {
       
    51     public:  // Constructors and destructor
       
    52         
       
    53         /**
       
    54         * Symbian OS default constructor.
       
    55         */     
       
    56         IMPORT_C static CXcapHttpTransport* NewL( const TDesC& aRootUri,
       
    57                                                   MMsgConnManager& aConnManager,
       
    58                                                   const TXdmCredentials& aDigestCredentials );
       
    59         
       
    60         /**
       
    61         * A global logging function for 8 bit data.
       
    62         * @param aCommand command to be handled
       
    63         */
       
    64         IMPORT_C TPtrC8 RootUri();
       
    65 
       
    66         /**
       
    67         * Send one IMPS message.
       
    68         */
       
    69         IMPORT_C CXcapHttpReqGet* GetL( const TDesC& aUri );
       
    70 
       
    71         /**
       
    72         * Send one IMPS message.
       
    73         */
       
    74         IMPORT_C CXcapHttpReqPut* PutL( const TDesC& aUri );
       
    75         
       
    76         /**
       
    77         * Send one IMPS message.
       
    78         */
       
    79         IMPORT_C CXcapHttpReqMkcol* MkcolL( const TDesC& aUri );
       
    80 
       
    81         /**
       
    82         * Send one IMPS message.
       
    83         */
       
    84         IMPORT_C CXcapHttpReqHead* HeadL( const TDesC& aUri );
       
    85 
       
    86         /**
       
    87         * Send one IMPS message.
       
    88         */
       
    89         IMPORT_C CXcapHttpReqDelete* DeleteL( const TDesC& aUri );
       
    90         
       
    91         /**
       
    92         * Stores the address of the proxy currently in use
       
    93         * @param aProxy Address of the HTTP proxy server
       
    94         */
       
    95         IMPORT_C void SetRootUriL( const TDesC& aRootUri );
       
    96         
       
    97         /**
       
    98         * Destructor.
       
    99         */      
       
   100         IMPORT_C virtual ~CXcapHttpTransport();
       
   101 
       
   102     public:   //New functions   
       
   103         
       
   104         /**
       
   105         * A global logging function for 8 bit data.
       
   106         * @param aCommand command to be handled
       
   107         */
       
   108         static TXdmCredentials& Credentials();
       
   109     
       
   110     #ifdef _DEBUG
       
   111     
       
   112         /**
       
   113         * A global logging function for 8 bit data.
       
   114         * @param aCommand command to be handled
       
   115         */
       
   116         void WriteToLog( TRefByValue<const TDesC8> aFmt,... ) const;
       
   117         
       
   118         /**
       
   119         * A global logging function for 16 bit data.
       
   120         * @param aCommand command to be handled
       
   121         */
       
   122         void WriteToLog( TRefByValue<const TDesC> aFmt,... ) const;
       
   123     
       
   124     #endif //_DEBUG
       
   125          
       
   126     private:
       
   127         
       
   128         /**
       
   129         * C++ default constructor.
       
   130         */      
       
   131         CXcapHttpTransport( MMsgConnManager& aConnManager );
       
   132 
       
   133         /**
       
   134         * Symbian OS default constructor.
       
   135         * @param aMimeType MIME type of the messages
       
   136         */     
       
   137         void ConstructL( const TDesC& aRootUri, const TXdmCredentials& aDigestCredentials );
       
   138                               
       
   139         /**
       
   140         * Symbian OS default constructor.
       
   141         * @param aMimeType MIME type of the messages
       
   142         */     
       
   143         HBufC8* ConstructRequestUriLC( const TDesC& aDocumentSelector );
       
   144         
       
   145         /**
       
   146         * Initialises an HTTP session
       
   147         */
       
   148         void InitialiseSessionL();
       
   149         
       
   150     private: //Data
       
   151         
       
   152         TBool                                       iCredValidity;
       
   153         TBool                                       iSessionClosed;
       
   154         HBufC8*                                     iRootUri;
       
   155         HBufC8*                                     iProxyBuffer;
       
   156         RHTTPSession                                iHttpSession;
       
   157         CXdmLogWriter*                              iLogWriter;
       
   158         MMsgConnManager&                            iConnManager;
       
   159         CXcapHttpAuthManager*                       iAuthManager;
       
   160     };
       
   161 
       
   162 #endif
       
   163 
       
   164 // End of File