multimediacommsengine/mmcesrv/mmceserver/inc/mcesipdefaultdata.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 __CMCESIPDEFAULTDATA_H
       
    22 #define __CMCESIPDEFAULTDATA_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <badesca.h>
       
    27 #include "mcesrv.h"
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  Default data (headers) for certain SIP request. 
       
    33 *
       
    34 *  @lib 
       
    35 */
       
    36 class CMceSipDefaultData : public CBase
       
    37     {
       
    38     public: // Constructors and destructor
       
    39         
       
    40         /**
       
    41         * Two-phased constructor.
       
    42         * @param aMethod the SIP method for which the headers are set
       
    43         * @param aHeaders the default headers, ownership is taken
       
    44         * @param aDataArray the data array
       
    45         */
       
    46         static CMceSipDefaultData* NewL(
       
    47                         const TDesC8& aMethod,
       
    48                         CDesC8Array* aHeaders,
       
    49                         RPointerArray< CMceSipDefaultData >& aDataArray );
       
    50         /*
       
    51 	    * Destructor.
       
    52 	    */
       
    53 		~CMceSipDefaultData();
       
    54 
       
    55     public: // New functions
       
    56         
       
    57         /**
       
    58         * Compares given method to the method index.
       
    59         * @oaram aMethod the method
       
    60         * @return ETrue, if the given method is the one this.
       
    61         *                instance stroes headers for.
       
    62         */
       
    63         TBool Match( const TDesC8& aMethod );
       
    64         
       
    65         /**
       
    66         * Compares given method index to the method index.
       
    67         * @oaram aMethodInd the method index
       
    68         * @return ETrue, if the given method is the one this.
       
    69         *                instance stroes headers for.
       
    70         */
       
    71         TBool Match( TInt aMethodInd );
       
    72         
       
    73         /**
       
    74         * Resets dehault headers for this method
       
    75         * @param aHeaders the new headers, ownership is taken.
       
    76         */
       
    77         void SetHeaders( CDesC8Array* aHeaders );
       
    78         
       
    79         /**
       
    80         * Returns the default headers seet for this method.
       
    81         * @return the headers.
       
    82         */
       
    83         CDesC8Array& DefaultHeaders();
       
    84            
       
    85     private:
       
    86     
       
    87         /**
       
    88 	    * C++ default constructor.
       
    89 	    */
       
    90         CMceSipDefaultData();
       
    91         
       
    92         /**
       
    93 	    * By default Symbian 2nd phase constructor is private.
       
    94 	    */
       
    95 	    void ConstructL( const TDesC8& aMethod,
       
    96                          CDesC8Array* aHeaders,
       
    97                          RPointerArray< CMceSipDefaultData >& aDataArray );
       
    98 
       
    99 
       
   100     private: // Data
       
   101         
       
   102         // Index of the method in SIP String table.
       
   103         TInt iMethodIndex;
       
   104         
       
   105         // Default headers, owned
       
   106         CDesC8Array* iHeaders;
       
   107         
       
   108         __DECLARE_TEST;
       
   109         
       
   110         //definitions for unit testing
       
   111 	    MCESRV_UT_DEFINITIONS
       
   112 
       
   113     };
       
   114 
       
   115 #endif  // __CMCESIPDEFAULTDATA_H
       
   116 
       
   117 // End of File