1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/sipprofileregistry.h Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,180 @@
1.4 +/*
1.5 +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* 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
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* Name : sipprofileregistry.h
1.19 +* Part of : SIP Profile Client
1.20 +* Interface : SDK API, SIP Profile API
1.21 +* The class for using SIP profiles
1.22 +* Version : 1.0
1.23 +*
1.24 +*/
1.25 +
1.26 +
1.27 +
1.28 +#ifndef CSIPPROFILEREGISTRY_H
1.29 +#define CSIPPROFILEREGISTRY_H
1.30 +
1.31 +// INCLUDES
1.32 +#include <e32base.h>
1.33 +#include <e32std.h>
1.34 +#include <badesca.h>
1.35 +#include "sipprofileregistrybase.h"
1.36 +
1.37 +// FORWARD DECLARATIONS
1.38 +class CSIP;
1.39 +class CSIPConnection;
1.40 +class CSIPProfile;
1.41 +class MSIPProfileRegistryObserver;
1.42 +class MSIPConnectionObserver;
1.43 +
1.44 +
1.45 +// CLASS DECLARATION
1.46 +/**
1.47 +* @publishedAll
1.48 +* @released
1.49 +*
1.50 +* The class for retrieving SIP profiles from permanent storage.
1.51 +* This class provides services for retreiving SIP profiles
1.52 +* and enabling/disabling them for the usage.
1.53 +*
1.54 +* The user can create only one instance of this class (a singleton class).
1.55 +*
1.56 +* @lib sipprofilecli.lib
1.57 +*/
1.58 +class CSIPProfileRegistry: public CSIPProfileRegistryBase
1.59 + {
1.60 + public: // Constructors and destructor
1.61 + /**
1.62 + * Two-phased constructor.
1.63 + * This constructor should be used if the client intends
1.64 + * to use SIP services with profiles.
1.65 + * @param aSip a SIP client providing connection to SIP stack.
1.66 + * @param aObserver a observer for SIP profile change events.
1.67 + */
1.68 + IMPORT_C static CSIPProfileRegistry* NewL(
1.69 + CSIP& aSip,
1.70 + MSIPProfileRegistryObserver& aObserver);
1.71 +
1.72 + /**
1.73 + * Two-phased constructor.
1.74 + * This constructor should be used if the client intends
1.75 + * to use SIP services with profiles.
1.76 + * Constructs an object and adds the pointer to the cleanup stack;
1.77 + * @param aSip a SIP client providing connection to SIP stack.
1.78 + * @param aObserver a observer for SIP profile change events.
1.79 + */
1.80 + IMPORT_C static CSIPProfileRegistry* NewLC(
1.81 + CSIP& aSip,
1.82 + MSIPProfileRegistryObserver& aObserver);
1.83 +
1.84 + /**
1.85 + * Destructor
1.86 + */
1.87 + IMPORT_C ~CSIPProfileRegistry();
1.88 +
1.89 + public: // New functions
1.90 + /**
1.91 + * Gets handle to the SIP server
1.92 + * @return handle to the SIP server
1.93 + */
1.94 + IMPORT_C CSIP& SIP() const;
1.95 +
1.96 + /**
1.97 + * Gets the SIP connection to be used with this SIP profile.
1.98 + * @pre IsEnabled() == ETrue
1.99 + * @param aProfile a sip profile
1.100 + * @return a SIP connection to be used; the owneship is transfered
1.101 + * @leave KErrNoMemory if out of memory
1.102 + * @capability NetworkServices
1.103 + */
1.104 + IMPORT_C CSIPConnection* ConnectionL(
1.105 + CSIPProfile& aProfile);
1.106 +
1.107 + /**
1.108 + * Enables the SIP profile for use.
1.109 + * Enabling the SIP profile will cause the SIP profile to
1.110 + * be registered if its status was unregistered.
1.111 + * The user must check the profile status after calling this
1.112 + * function. In case the profile is not registered the user must
1.113 + * wait until the it is notified about profile registration
1.114 + * on MSIPProfileRegistryObserver-callback interface.
1.115 + * @param aProfile a sip profile to enable
1.116 + * @param aObserver a observer for SIP connection events
1.117 + * @leave KErrNotFound if non-existing profile is provided
1.118 + * @capability NetworkServices
1.119 + */
1.120 + IMPORT_C void EnableL(
1.121 + CSIPProfile& aProfile,
1.122 + MSIPConnectionObserver &aObserver);
1.123 +
1.124 + /**
1.125 + * Disables the usage of SIP profile
1.126 + * @param aProfile a sip profile to disable
1.127 + * @return KErrNone if SIP profile was successfully disabled;
1.128 + * system wide error otherwise
1.129 + * @capability NetworkServices
1.130 + */
1.131 + IMPORT_C TInt Disable(CSIPProfile& aProfile);
1.132 +
1.133 + /**
1.134 + * Tests is the SIP profile enabled for the use
1.135 + * @param aProfile a SIP profile to be checked
1.136 + * @return ETrue if SIP profile is enabled; EFalse otherwise
1.137 + */
1.138 + IMPORT_C TBool IsEnabled(const CSIPProfile& aProfile) const;
1.139 +
1.140 + /**
1.141 + * Force disables the usage of SIP profile
1.142 + * All Profile related activities will be stopped ungracefully
1.143 + * @param aProfile a sip profile to disable
1.144 + * @return KErrNone if SIP profile was successfully disabled;
1.145 + * system wide error otherwise
1.146 + * @capability NetworkControl
1.147 + */
1.148 + IMPORT_C TInt ForceDisable(CSIPProfile& aProfile);
1.149 +
1.150 + /**
1.151 + * Refreshes the Enabled SIP profile for use.
1.152 + * Refreshing the Enabled Profile will cause the SIP Profile to
1.153 + * get Registered if its status was not registered.
1.154 + * This function has to be used when the profile is in Enabled state and
1.155 + * might be unregistered due to a connection loss.
1.156 + * @param aProfile a sip profile to enable
1.157 + * @leave KErrNotFound if non-existing profile is provided
1.158 + * @leave KErrArgument if the profile is not previously Enabled and in Unregistered state.
1.159 + * @capability NetworkServices
1.160 + */
1.161 +
1.162 + IMPORT_C void RefreshEnableL(CSIPProfile& aProfile);
1.163 +
1.164 + public:
1.165 +
1.166 + /**
1.167 + * @internalComponent
1.168 + */
1.169 + CSIPProfile* NewInstanceL();
1.170 +
1.171 + private:
1.172 +
1.173 + CSIPProfileRegistry();
1.174 + CSIPProfileRegistry(CSIP& aSip, MSIPProfileRegistryObserver& aObserver);
1.175 + void ConstructL();
1.176 +
1.177 + private:
1.178 +
1.179 + CSIP& iSip;
1.180 + MSIPConnectionObserver* iConnectionObserver;
1.181 + };
1.182 +
1.183 +#endif // CSIPPROFILEREGISTRY_H