author | William Roberts <williamr@symbian.org> |
Tue, 16 Mar 2010 16:12:26 +0000 | |
branch | Symbian2 |
changeset 2 | 2fe1408b6811 |
parent 0 | 061f57f2323e |
permissions | -rw-r--r-- |
williamr@2 | 1 |
/* |
williamr@2 | 2 |
* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 3 |
* All rights reserved. |
williamr@2 | 4 |
* This component and the accompanying materials are made available |
williamr@2 | 5 |
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
williamr@2 | 6 |
* which accompanies this distribution, and is available |
williamr@2 | 7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
williamr@2 | 8 |
* |
williamr@2 | 9 |
* Initial Contributors: |
williamr@2 | 10 |
* Nokia Corporation - initial contribution. |
williamr@2 | 11 |
* |
williamr@2 | 12 |
* Contributors: |
williamr@2 | 13 |
* |
williamr@2 | 14 |
* Description: |
williamr@2 | 15 |
* Name : sipmanagedprofileregistry.h |
williamr@2 | 16 |
* Part of : SIP Profile Client |
williamr@2 | 17 |
* Interface : SDK API, SIP Profile API |
williamr@2 | 18 |
* The class for managing SIP profiles |
williamr@2 | 19 |
* Version : 1.0 |
williamr@2 | 20 |
* |
williamr@2 | 21 |
*/ |
williamr@2 | 22 |
|
williamr@2 | 23 |
|
williamr@2 | 24 |
|
williamr@2 | 25 |
#ifndef CSIPMANAGEDPROFILEREGISTRY_H |
williamr@2 | 26 |
#define CSIPMANAGEDPROFILEREGISTRY_H |
williamr@2 | 27 |
|
williamr@2 | 28 |
// INCLUDES |
williamr@2 | 29 |
#include <e32base.h> |
williamr@2 | 30 |
#include <e32std.h> |
williamr@2 | 31 |
#include "sipprofileregistrybase.h" |
williamr@2 | 32 |
|
williamr@2 | 33 |
// FORWARD DECLARATIONS |
williamr@2 | 34 |
class CSIPProfile; |
williamr@2 | 35 |
class CSIPManagedProfile; |
williamr@2 | 36 |
class MSIPProfileRegistryObserver; |
williamr@2 | 37 |
|
williamr@2 | 38 |
|
williamr@2 | 39 |
// CLASS DECLARATION |
williamr@2 | 40 |
/** |
williamr@2 | 41 |
* @publishedAll |
williamr@2 | 42 |
* @released |
williamr@2 | 43 |
* |
williamr@2 | 44 |
* The class for managing SIP profiles. |
williamr@2 | 45 |
* This class provides the functions for |
williamr@2 | 46 |
* adding/updating/removing profiles. |
williamr@2 | 47 |
* |
williamr@2 | 48 |
* @lib sipprofilecli.lib |
williamr@2 | 49 |
*/ |
williamr@2 | 50 |
class CSIPManagedProfileRegistry: public CSIPProfileRegistryBase |
williamr@2 | 51 |
{ |
williamr@2 | 52 |
public: // Constructors and destructor |
williamr@2 | 53 |
/** |
williamr@2 | 54 |
* Two-phased constructor. |
williamr@2 | 55 |
* @param aObserver a observer for SIP profile change events. |
williamr@2 | 56 |
*/ |
williamr@2 | 57 |
IMPORT_C static CSIPManagedProfileRegistry* NewL( |
williamr@2 | 58 |
MSIPProfileRegistryObserver& aObserver); |
williamr@2 | 59 |
|
williamr@2 | 60 |
/** |
williamr@2 | 61 |
* Two-phased constructor. |
williamr@2 | 62 |
* Constructs an object and adds the pointer to the cleanup stack; |
williamr@2 | 63 |
* @param aObserver a observer for SIP profile change events. |
williamr@2 | 64 |
*/ |
williamr@2 | 65 |
IMPORT_C static CSIPManagedProfileRegistry* NewLC( |
williamr@2 | 66 |
MSIPProfileRegistryObserver& aObserver); |
williamr@2 | 67 |
|
williamr@2 | 68 |
/** |
williamr@2 | 69 |
* Destructor |
williamr@2 | 70 |
*/ |
williamr@2 | 71 |
IMPORT_C ~CSIPManagedProfileRegistry(); |
williamr@2 | 72 |
public: //new functions |
williamr@2 | 73 |
|
williamr@2 | 74 |
/** |
williamr@2 | 75 |
* Instantiates new profile with default values |
williamr@2 | 76 |
* for given type. |
williamr@2 | 77 |
* @param aType a SIP profile type to be created |
williamr@2 | 78 |
* @return pre-filled instance of given type profile type; |
williamr@2 | 79 |
* the ownership is transferred |
williamr@2 | 80 |
*/ |
williamr@2 | 81 |
IMPORT_C CSIPManagedProfile* CreateL(const TSIPProfileTypeInfo& aType); |
williamr@2 | 82 |
|
williamr@2 | 83 |
/** |
williamr@2 | 84 |
* Checks if profile is not used by other applications. |
williamr@2 | 85 |
* If no other application is using the profile, profile |
williamr@2 | 86 |
* can be updated. |
williamr@2 | 87 |
* @param aSIPProfile a SIP profile |
williamr@2 | 88 |
* @return ETrue if available for update, EFalse otherwise |
williamr@2 | 89 |
* @capability ReadUserData |
williamr@2 | 90 |
*/ |
williamr@2 | 91 |
IMPORT_C TBool IsInUseL(const CSIPProfile& aSIPProfile) const; |
williamr@2 | 92 |
|
williamr@2 | 93 |
/** |
williamr@2 | 94 |
* Saves new profile or changes to a profile to the persistent storage. |
williamr@2 | 95 |
* This function must be called after desired values are set or updated |
williamr@2 | 96 |
* in the SIP profile. |
williamr@2 | 97 |
* If the profile is marked for auto-registration and the profile is |
williamr@2 | 98 |
* updated the profile will be re-registered. |
williamr@2 | 99 |
* Function leaves on failure. |
williamr@2 | 100 |
* @pre IsInUse(aSIPProfile)==EFalse |
williamr@2 | 101 |
* @param aSIPProfile a sip profile to save |
williamr@2 | 102 |
* @capability WriteDeviceData |
williamr@2 | 103 |
* @capability NetworkServices |
williamr@2 | 104 |
*/ |
williamr@2 | 105 |
IMPORT_C void SaveL(CSIPProfile& aSIPProfile); |
williamr@2 | 106 |
|
williamr@2 | 107 |
/** |
williamr@2 | 108 |
* Removes and deletes SIP profile from the persistent storage. |
williamr@2 | 109 |
* Function leaves on failure. |
williamr@2 | 110 |
* If the profile is registered it will be de-registered before the |
williamr@2 | 111 |
* removal from the persistent storage. |
williamr@2 | 112 |
* @param aSIPProfile a sip profile to delete |
williamr@2 | 113 |
* @capability WriteDeviceData |
williamr@2 | 114 |
* @capability NetworkServices |
williamr@2 | 115 |
*/ |
williamr@2 | 116 |
IMPORT_C void DestroyL(CSIPProfile& aSIPProfile); |
williamr@2 | 117 |
|
williamr@2 | 118 |
private: |
williamr@2 | 119 |
|
williamr@2 | 120 |
CSIPManagedProfileRegistry(MSIPProfileRegistryObserver& aObserver); |
williamr@2 | 121 |
|
williamr@2 | 122 |
void ConstructL(); |
williamr@2 | 123 |
|
williamr@2 | 124 |
/** |
williamr@2 | 125 |
* Creates a new instance of type CSIPManagedProfile |
williamr@2 | 126 |
* @return new instance |
williamr@2 | 127 |
*/ |
williamr@2 | 128 |
CSIPProfile* NewInstanceL(); |
williamr@2 | 129 |
}; |
williamr@2 | 130 |
|
williamr@2 | 131 |
#endif // CSIPMANAGEDPROFILEREGISTRY_H |