realtimenetprots/sipfw/ProfileAgent/Profile/Inc/sipconcreteprofileholder.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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:
       
    15 * Name        : sipconcreteprofileholder.h
       
    16 * Part of     : SIP / SIP Profile Agent / SIP Concrete Profile
       
    17 * Version     : %version: 2.1.2 %
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 #ifndef CSIPCONCRETEPROFILEHOLDER_H
       
    29 #define CSIPCONCRETEPROFILEHOLDER_H
       
    30 
       
    31 //  INCLUDES
       
    32 #include <e32base.h>
       
    33 #include <badesca.h>
       
    34 #include "sipconcreteprofile.h"
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 class CSIPConcreteProfileHolderTest;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 /**
       
    41 * Class is a holder for multiple CSIPConcreteProfile instances
       
    42 * Provides serialization and deserialization functions
       
    43 */
       
    44 class CSIPConcreteProfileHolder: public CBase
       
    45     {
       
    46     public: // Constructors and destructor
       
    47 
       
    48         /**
       
    49         * Constructs an object
       
    50         * @returns new instance
       
    51         */
       
    52         IMPORT_C static CSIPConcreteProfileHolder* NewL();
       
    53 
       
    54         /**
       
    55         * Constructs an object and adds the pointer to the cleanup stack;
       
    56         * leaves on failure
       
    57         * @return new instance
       
    58         */
       
    59         IMPORT_C static CSIPConcreteProfileHolder* NewLC();
       
    60 
       
    61         /**
       
    62         * Destructor. 
       
    63         */            
       
    64         IMPORT_C ~CSIPConcreteProfileHolder();
       
    65 
       
    66     public: // New functions
       
    67 
       
    68         /** 
       
    69         * Deserialize profile holder from stream, ownership is transferred
       
    70         * @param aReadStream stream holding serialized profile holder
       
    71         * @return new instance
       
    72         */
       
    73         IMPORT_C static CSIPConcreteProfileHolder* InternalizeL(
       
    74             RReadStream& aReadStream);
       
    75 
       
    76         /**
       
    77         * Get hold array of profiles 
       
    78         * @return array of profiles
       
    79         */
       
    80         IMPORT_C RPointerArray<CSIPConcreteProfile>& SIPProfiles();
       
    81 
       
    82         /** 
       
    83         * Serialize profile holder to stream
       
    84         * @param aWriteStream stream where profile holder is to be serialized
       
    85         */
       
    86         IMPORT_C void ExternalizeL(
       
    87             RWriteStream& aWriteStream) const;
       
    88 
       
    89         /** 
       
    90         * Get serialized profile holder size
       
    91         * @return size needed to serialize profile holder
       
    92         */
       
    93         IMPORT_C TUint ExternalizedSizeL() const;
       
    94 
       
    95     private: // Constructors
       
    96 
       
    97         CSIPConcreteProfileHolder();
       
    98         void ConstructL();
       
    99 
       
   100 	private: // For internal use
       
   101 		/**
       
   102 		* Cleans proxy- and registrar server passwords from the profile.
       
   103 		* Leaves copy of the profile into the cleanup stack.
       
   104 		* @param aProfile Profile whose password is deleted
       
   105 		* @return Copy of the profile without passwords
       
   106 		*/
       
   107         static CSIPConcreteProfile* CloneProfileWithoutPasswordsLC(
       
   108         	const CSIPConcreteProfile* aProfile);
       
   109 
       
   110     private: // New functions
       
   111         void DoInternalizeL(RReadStream& aReadStream);
       
   112     
       
   113     private: // Data
       
   114 
       
   115         RPointerArray<CSIPConcreteProfile> iSIPProfiles;
       
   116         TBool iInternalized;
       
   117 	private: //For testing purposes
       
   118 #ifdef CPPUNIT_TEST	
       
   119     friend class CSIPConcreteProfileHolderTest;
       
   120 #endif
       
   121     };
       
   122 
       
   123 #endif // CSIPCONCRETEPROFILEHOLDER_H