epoc32/include/mw/sipprofileregistry.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
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@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.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        : sipprofileregistry.h
williamr@2
    16
* Part of     : SIP Profile Client
williamr@2
    17
* Interface   : SDK API, SIP Profile API
williamr@2
    18
* The class for using 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 CSIPPROFILEREGISTRY_H
williamr@2
    26
#define CSIPPROFILEREGISTRY_H
williamr@2
    27
williamr@2
    28
//  INCLUDES
williamr@2
    29
#include <e32base.h>
williamr@2
    30
#include <e32std.h>
williamr@2
    31
#include <badesca.h>
williamr@2
    32
#include "sipprofileregistrybase.h"
williamr@2
    33
williamr@2
    34
// FORWARD DECLARATIONS
williamr@2
    35
class CSIP;
williamr@2
    36
class CSIPConnection;
williamr@2
    37
class CSIPProfile;
williamr@2
    38
class MSIPProfileRegistryObserver;
williamr@2
    39
class MSIPConnectionObserver;
williamr@2
    40
williamr@2
    41
williamr@2
    42
// CLASS DECLARATION
williamr@2
    43
/**
williamr@2
    44
*  @publishedAll
williamr@2
    45
*  @released
williamr@2
    46
*
williamr@2
    47
*  The class for retrieving SIP profiles from permanent storage.
williamr@2
    48
*  This class provides services for retreiving SIP profiles
williamr@2
    49
*  and enabling/disabling them for the usage.
williamr@2
    50
*
williamr@2
    51
*  The user can create only one instance of this class (a singleton class).
williamr@2
    52
*
williamr@2
    53
*  @lib sipprofilecli.lib
williamr@2
    54
*/
williamr@2
    55
class CSIPProfileRegistry: public CSIPProfileRegistryBase
williamr@2
    56
    {
williamr@2
    57
    public:  // Constructors and destructor
williamr@2
    58
        /**
williamr@2
    59
        * Two-phased constructor.
williamr@2
    60
        * This constructor should be used if the client intends
williamr@2
    61
        * to use SIP services with profiles.
williamr@2
    62
        * @param aSip a SIP client providing connection to SIP stack.
williamr@2
    63
        * @param aObserver a observer for SIP profile change events.
williamr@2
    64
        */
williamr@2
    65
        IMPORT_C static CSIPProfileRegistry* NewL(
williamr@2
    66
            CSIP& aSip,
williamr@2
    67
            MSIPProfileRegistryObserver& aObserver);
williamr@2
    68
williamr@2
    69
        /**
williamr@2
    70
        * Two-phased constructor.
williamr@2
    71
        * This constructor should be used if the client intends
williamr@2
    72
        * to use SIP services with profiles.
williamr@2
    73
        * Constructs an object and adds the pointer to the cleanup stack;
williamr@2
    74
        * @param aSip a SIP client providing connection to SIP stack.
williamr@2
    75
        * @param aObserver a observer for SIP profile change events.
williamr@2
    76
        */
williamr@2
    77
        IMPORT_C static CSIPProfileRegistry* NewLC(
williamr@2
    78
            CSIP& aSip,
williamr@2
    79
            MSIPProfileRegistryObserver& aObserver);
williamr@2
    80
williamr@2
    81
        /**
williamr@2
    82
        * Destructor
williamr@2
    83
        */
williamr@2
    84
        IMPORT_C ~CSIPProfileRegistry();
williamr@2
    85
williamr@2
    86
    public: // New functions
williamr@2
    87
        /**
williamr@2
    88
        * Gets handle to the SIP server
williamr@2
    89
        * @return handle to the SIP server
williamr@2
    90
        */
williamr@2
    91
        IMPORT_C CSIP& SIP() const;
williamr@2
    92
williamr@2
    93
        /**
williamr@2
    94
        * Gets the SIP connection to be used with this SIP profile.
williamr@2
    95
        * @pre IsEnabled() == ETrue
williamr@2
    96
        * @param aProfile a sip profile
williamr@2
    97
        * @return a SIP connection to be used; the owneship is transfered
williamr@2
    98
        * @leave KErrNoMemory if out of memory
williamr@2
    99
        * @capability NetworkServices
williamr@2
   100
        */
williamr@2
   101
        IMPORT_C CSIPConnection* ConnectionL(
williamr@2
   102
            CSIPProfile& aProfile);
williamr@2
   103
williamr@2
   104
        /**
williamr@2
   105
        * Enables the SIP profile for use.
williamr@2
   106
        * Enabling the SIP profile will cause the SIP profile to
williamr@2
   107
        * be registered if its status was unregistered.
williamr@2
   108
        * The user must check the profile status after calling this
williamr@2
   109
        * function. In case the profile is not registered the user must
williamr@2
   110
        * wait until the it is notified about profile registration 
williamr@2
   111
        * on MSIPProfileRegistryObserver-callback interface.
williamr@2
   112
        * @param aProfile a sip profile to enable
williamr@2
   113
        * @param aObserver a observer for SIP connection events
williamr@2
   114
        * @leave KErrNotFound if non-existing profile is provided
williamr@2
   115
        * @capability NetworkServices
williamr@2
   116
        */
williamr@2
   117
        IMPORT_C void EnableL(
williamr@2
   118
            CSIPProfile& aProfile,
williamr@2
   119
            MSIPConnectionObserver &aObserver);
williamr@2
   120
        
williamr@2
   121
        /**
williamr@2
   122
        * Disables the usage of SIP profile
williamr@2
   123
        * @param aProfile a sip profile to disable
williamr@2
   124
        * @return KErrNone if SIP profile was successfully disabled; 
williamr@2
   125
        *         system wide error otherwise
williamr@2
   126
        * @capability NetworkServices
williamr@2
   127
        */
williamr@2
   128
        IMPORT_C TInt Disable(CSIPProfile& aProfile);
williamr@2
   129
williamr@2
   130
        /**
williamr@2
   131
        * Tests is the SIP profile enabled for the use
williamr@2
   132
        * @param aProfile a SIP profile to be checked
williamr@2
   133
        * @return ETrue if SIP profile is enabled; EFalse otherwise
williamr@2
   134
        */
williamr@2
   135
        IMPORT_C TBool IsEnabled(const CSIPProfile& aProfile) const;
williamr@2
   136
        
williamr@2
   137
        /**
williamr@2
   138
        * Force disables the usage of SIP profile
williamr@2
   139
        * All Profile related activities will be stopped ungracefully
williamr@2
   140
        * @param aProfile a sip profile to disable
williamr@2
   141
        * @return KErrNone if SIP profile was successfully disabled; 
williamr@2
   142
        *         system wide error otherwise
williamr@2
   143
        * @capability NetworkControl
williamr@2
   144
        */
williamr@2
   145
        IMPORT_C TInt ForceDisable(CSIPProfile& aProfile);
williamr@2
   146
        
williamr@2
   147
        /**
williamr@2
   148
        * Refreshes the Enabled SIP profile for use.
williamr@2
   149
        * Refreshing the Enabled Profile will cause the SIP Profile to
williamr@2
   150
        * get Registered if its status was not registered. 
williamr@2
   151
        * This function has to be used when the profile is in Enabled state and 
williamr@2
   152
        * might be unregistered due to a connection loss.
williamr@2
   153
        * @param aProfile a sip profile to enable
williamr@2
   154
        * @leave KErrNotFound if non-existing profile is provided
williamr@2
   155
        * @leave KErrArgument if the profile is not previously Enabled and in Unregistered state.
williamr@2
   156
        * @capability NetworkServices
williamr@2
   157
        */
williamr@2
   158
        
williamr@2
   159
        IMPORT_C void RefreshEnableL(CSIPProfile& aProfile);
williamr@2
   160
williamr@2
   161
    public: 
williamr@2
   162
williamr@2
   163
        /**
williamr@2
   164
        * @internalComponent
williamr@2
   165
        */
williamr@2
   166
        CSIPProfile* NewInstanceL();
williamr@2
   167
    
williamr@2
   168
    private:
williamr@2
   169
        
williamr@2
   170
        CSIPProfileRegistry();
williamr@2
   171
        CSIPProfileRegistry(CSIP& aSip, MSIPProfileRegistryObserver& aObserver);
williamr@2
   172
        void ConstructL();
williamr@2
   173
        
williamr@2
   174
    private: 
williamr@2
   175
williamr@2
   176
        CSIP& iSip;
williamr@2
   177
        MSIPConnectionObserver* iConnectionObserver;
williamr@2
   178
    };
williamr@2
   179
williamr@2
   180
#endif // CSIPPROFILEREGISTRY_H