sipplugins/sippsipsettingsui/inc/mgssipprofilehandler.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2003 - 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:  Mixin-class that provides functionality for manipulating 
       
    15 *                profiles
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef M_GS_SIP_PROFILE_HANDLER_H
       
    22 #define M_GS_SIP_PROFILE_HANDLER_H
       
    23 
       
    24 // INCLUDES
       
    25 
       
    26 #include "tsipsettingsdata.h"
       
    27 #include <sipmanagedprofile.h>
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 
       
    32 /**
       
    33 *  MGSSIPProfileHandler class
       
    34 *  @since 3.0
       
    35 *  Mixin class for profile manipulation
       
    36 *  Handles profile manipulations 
       
    37 */
       
    38 class MGSSIPProfileHandler
       
    39     {   
       
    40     public: // New functions
       
    41     
       
    42         /**
       
    43         * Setting the default profile is a special case of modifying a profile
       
    44         * attribute and it can be done directly here.
       
    45         * @param aIndex Index on the array table of the profile that is going
       
    46         *               to be a new default profile
       
    47         */
       
    48         virtual void SetDefaultProfileL( TInt aIndex ) = 0;
       
    49 
       
    50         /**
       
    51         * Gets the index of the default profile
       
    52         * @return KErrNotFound, if one does not exist, otherwise index to profile
       
    53         */
       
    54         virtual TInt DefaultProfileIndex() = 0;
       
    55 
       
    56         /**
       
    57         * Returns pointer to the profile array, does not change ownership
       
    58         * @return Pointer to the profile array
       
    59         */
       
    60         virtual CArrayPtr<CSIPManagedProfile>* ProfileArray() = 0;
       
    61 
       
    62         /**
       
    63         * Starts modifying a profile, copies profile's data to iProfileData
       
    64         * @param aIndex index on the array table
       
    65         * @return Ok to move to the next view?
       
    66         */
       
    67         virtual TBool EditProfileL( TInt aIndex ) = 0;
       
    68 
       
    69         /**
       
    70         * Starts editing a profile that is based on existing one. At the save
       
    71         * time a new profile is created and the information is copied there
       
    72         * @param aCopiedIndex index on the array table of the copied profile
       
    73         */
       
    74         virtual void CreateAndEditProfileL( TInt aCopiedIndex ) = 0;
       
    75 
       
    76         /**
       
    77         * Deletes a profile from permanent storage
       
    78         */
       
    79         virtual void DeleteProfileL( TInt aIndex ) = 0;
       
    80         
       
    81         /**
       
    82         * Checks if there has been an error in registration for some
       
    83         * particular probile
       
    84         * @param aIndex Index to the table
       
    85         * @return Error has happened in registration or then not
       
    86         */
       
    87         virtual TBool ErrorInRegistration( TInt aIndex ) = 0;
       
    88 
       
    89         /**
       
    90         * Returns pointer to profile data structure for modifying it directly
       
    91         * @return Pointer to iProfileData
       
    92         */
       
    93         virtual TSIPSettingsData* ProfileData() = 0;
       
    94       
       
    95         /**
       
    96         * Saves profile's changes or returns EFalse if no changes are present
       
    97         * and does not save anything then. Creates new profile if iProfileData's
       
    98         * iID member is -1
       
    99         * @return EFalse if no changes (not saved then), otherwise engine
       
   100         *         starts saving the modifications
       
   101         */
       
   102         virtual TBool SaveProfileL() = 0;
       
   103         
       
   104         /**
       
   105         * Returns list of different profile service types
       
   106         * @return list of types
       
   107         */
       
   108         virtual RArray<TSIPProfileTypeInfo>* TypeListL() = 0;
       
   109 
       
   110         /**
       
   111         * Checks that there are no duplicate profile names.
       
   112         * @param aProfileId for current profile to be checked.
       
   113         * @param aName for profile name to be checked.
       
   114         * @param aCreatedFromExistingProfile to inform if the profile
       
   115         * was created from existing profile and language specific
       
   116         * number conversions must be done.
       
   117         */
       
   118         virtual void CheckDuplicateNameL( TInt32 aProfileId, TDes& aName,
       
   119                                    TBool aCreatedFromExistingProfile = EFalse ) = 0;
       
   120     };
       
   121 
       
   122 #endif      // M_GS_SIP_PROFILE_HANDLER_H   
       
   123             
       
   124 // End of File