realtimenetprots/sipfw/SampleApp/gameUI_techview/Inc/ProfileUtil.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2003-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        : ProfileUtil.h
       
    16 * Part of     : SIP Profile Client / Settings User Interface
       
    17 * Interface   : 
       
    18 * Utility class for manipulating profiles and their attributes
       
    19 * Version     : 1.0
       
    20 *
       
    21 */
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 #ifndef PROFILEUTIL_H
       
    27 #define PROFILEUTIL_H
       
    28 
       
    29 // INCLUDES
       
    30 
       
    31 #include "sipprofile.h"
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 
       
    35 class TSIPProfileData;
       
    36 class TSIPServerData;
       
    37 class CSIPManagedProfile;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  Utility class for manipulating profiles and their attributes.
       
    43 *  Contains only static methods and can never be instantiatewd
       
    44 *
       
    45 *  @lib SIPSettingsUI.app
       
    46 *  @since 1.0
       
    47 */
       
    48 class ProfileUtil
       
    49     {    
       
    50     public: // New functions
       
    51         
       
    52         /**
       
    53         * Copies profile parameters from temporary data structure
       
    54         * to profile
       
    55         * @since 1.0
       
    56         * @param aProfile     Profile where the attributes are copied to
       
    57         * @param aProfileData Temporary data structure       
       
    58         */
       
    59         static void CopyProfileAttributesL( 
       
    60             CSIPManagedProfile* aProfile, 
       
    61             const TSIPProfileData& aProfileData );
       
    62         
       
    63         /**
       
    64         * Copies proxy server parameters from temporary data structure
       
    65         * to profile
       
    66         * @since 1.0
       
    67         * @param aProfile     Profile where the attributes are copied to
       
    68         * @param aServer      Proxy server/registrar server
       
    69         * @param aProfileData Temporary data structure       
       
    70         */
       
    71         static void CopyServerAttributesL(
       
    72             CSIPManagedProfile* aProfile,
       
    73             const TUint32 aServer,
       
    74             const TSIPServerData& aProfileData );
       
    75 
       
    76         /**
       
    77         * Copies profiles attributes to temporary data structure
       
    78         * @since 1.0
       
    79         * @param aProfile      Profile where the attributes are copied from
       
    80         * @param aProfileData  Temporary data structure where attribs
       
    81         *                      are copied to
       
    82         */
       
    83         static void CopyToTempStruct(
       
    84             CSIPManagedProfile* aProfile,
       
    85             TSIPProfileData& aProfileData );
       
    86 
       
    87         /**
       
    88         * Copies server attributes to temporary data structure
       
    89         * @since 1.0
       
    90         * @param aProfile      Profile where the attributes are copied from
       
    91         * @param aServer       Proxy server/registrar server
       
    92         * @param aProfileData  Temporary data structure where attribs
       
    93         *                      are copied to
       
    94         */
       
    95         static void CopyServerSettingsToTempStructL(
       
    96             CSIPManagedProfile* aProfile,
       
    97             const TUint32 aServer,
       
    98             TSIPServerData& aProfileData );                
       
    99                                                  
       
   100         /**
       
   101         * Compares the temporary data structure with given profile
       
   102         * @since 1.0
       
   103         * @param aProfile     Profile
       
   104         * @param aProfileData Temporary data structure
       
   105         * @return ETrue if the profiles differ
       
   106         */
       
   107         static TBool ProfileModificationsL(
       
   108             CSIPManagedProfile* aProfile,
       
   109             const TSIPProfileData& aProfileData );
       
   110 
       
   111         /**
       
   112         * Compares the temporary data structure with given profile
       
   113         * @since 1.0
       
   114         * @param aProfile    Profile
       
   115         * @param aServer     Proxy server/registrar server
       
   116         * @param aData       Temporary data structure       
       
   117         * @return ETrue if the attributes differ
       
   118         */
       
   119         static TBool ServerModificationsL(
       
   120             CSIPManagedProfile* aProfile,
       
   121             const TUint32 aServer,
       
   122             const TSIPServerData& aData );
       
   123         
       
   124         /**
       
   125         * Copies profile information from one profile to another
       
   126         * @since 1.0
       
   127         * @param aOrigProfile   Attributes from here 
       
   128         * @param aCopiedProfile Attributes stored here               
       
   129         */
       
   130         static void CopyProfileL(
       
   131             CSIPManagedProfile* aOrigProfile,
       
   132             CSIPManagedProfile* aCopiedProfile );
       
   133 
       
   134         /**
       
   135         * Copies and sets server URI from given parameters
       
   136         * Used by CopyServerAttributesL()
       
   137         * @since 1.0
       
   138         */
       
   139         static void CopyServerURIL(
       
   140             CSIPManagedProfile* aProfile,
       
   141             const TUint32 aServer,
       
   142             const TSIPServerData& aProfileData );
       
   143 
       
   144 
       
   145     private:
       
   146 
       
   147         /**
       
   148         * C++ default constructor.
       
   149         * This class can never be instantiated and thus
       
   150         * the constructor is declared as private.
       
   151         */
       
   152         ProfileUtil();    
       
   153     };
       
   154 
       
   155 #endif      // PROFILEUTIL_H   
       
   156             
       
   157 // End of File