multimediacommsengine/mmcesrv/mmceserver/inc/mcesipdefaults.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004-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:    Default data (headers) for certain SIP request. 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __CMCESIPDEFAULTS_H
       
    22 #define __CMCESIPDEFAULTS_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <badesca.h>
       
    27 #include "mcesrv.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CMceSipDefaultData;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  Default SIP data container. 
       
    36 *
       
    37 *  @lib 
       
    38 */
       
    39 class CMceSipDefaults : public CBase
       
    40     {
       
    41     public: // Constructors and destructor
       
    42         
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         */
       
    46         static CMceSipDefaults* NewL();
       
    47         
       
    48         /**
       
    49 	    * Destructor.
       
    50 	    */
       
    51 		~CMceSipDefaults();
       
    52 
       
    53     public: // New functions
       
    54         
       
    55         /**
       
    56         * Store default headers
       
    57         * @param aMethods the methods
       
    58         * @param aHeaders the default headers
       
    59         */
       
    60         void StoreDefaultHeadersL( const CDesC8Array& aMethods,
       
    61                                    CDesC8Array* aHeaders );
       
    62 
       
    63         /**
       
    64         * Returns the default headers for the given method.
       
    65         * NULL, if not stored.
       
    66         * @param aMehtod the method
       
    67         */
       
    68         CDesC8Array& DefaultHeaders( const TDesC8& aMethod );
       
    69         
       
    70         /**
       
    71 	    * Returns the default headers for the given method
       
    72 	    * @param aMethodInd the method index in SIP Strings
       
    73 	    */ 
       
    74 	    CDesC8Array& DefaultHeaders( TInt aMethodInd );
       
    75 	
       
    76 	    
       
    77     private:
       
    78     
       
    79         /**
       
    80 	    * C++ default constructor.
       
    81 	    */
       
    82         CMceSipDefaults();
       
    83         
       
    84         /**
       
    85 	    * By default Symbian 2nd phase constructor is private.
       
    86 	    */
       
    87 	    void ConstructL( );
       
    88 	    
       
    89     private: 
       
    90         
       
    91         /**
       
    92         * Store default headers
       
    93         * @param aMethod, the method
       
    94         * @param aHeaders, the default headers
       
    95         */
       
    96         void StoreDefaultHeadersL( const TDesC8& aMethod, 
       
    97                                    CDesC8Array* aHeaders );
       
    98                                
       
    99         /**
       
   100         * Finds default data for a given method
       
   101         * @param aMethod, the method
       
   102         * @return the index of the data, KErrNotFound, if not found.
       
   103         */
       
   104         TInt FindData( const TDesC8& aMethod ) const;
       
   105         
       
   106         /**
       
   107         * Finds default data for a given method index
       
   108         * @param aMethodInd, the methodInd
       
   109         * @return the index of the data, KErrNotFound, if not found.
       
   110         */
       
   111         TInt FindData( TInt aMethodInd ) const;
       
   112         
       
   113         
       
   114         /**
       
   115         * Clear the defaults.
       
   116         */
       
   117         void Clear();
       
   118         
       
   119         /**
       
   120         * Copy headers.
       
   121         * @param the headers to be copied.
       
   122         * @return the copied headers, ownership is transfered.
       
   123         */
       
   124         CDesC8Array* CopyHeadersL( const CDesC8Array* aHeaders );
       
   125         
       
   126     private: // Data
       
   127         
       
   128         // The stored default data in array, owned.
       
   129         RPointerArray< CMceSipDefaultData > iDataArray;
       
   130         
       
   131         CDesC8Array* iEmptyHeaders;
       
   132         
       
   133         //definitions for unit testing
       
   134 	    MCESRV_UT_DEFINITIONS
       
   135 
       
   136     };
       
   137 
       
   138 #endif  // __CMCESIPDEFAULTS_H
       
   139 
       
   140 // End of File