epoc32/include/mw/sipprofilealrcontroller.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) 2007-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          : sipprofilealrcontroller.h
williamr@2
    16
* Part of       : SIP / SIP Profile Agent
williamr@2
    17
* Version       : SIP/6.0 
williamr@2
    18
*
williamr@2
    19
*/
williamr@2
    20
williamr@2
    21
williamr@2
    22
williamr@2
    23
#ifndef CSIPPROFILEALRCONTROLLER_H
williamr@2
    24
#define CSIPPROFILEALRCONTROLLER_H
williamr@2
    25
williamr@2
    26
// INCLUDES
williamr@2
    27
#include <e32base.h>
williamr@2
    28
williamr@2
    29
// FORWARD DECLARATIONS
williamr@2
    30
class CSIPProfileRegistryBase;
williamr@2
    31
class MSipProfileAlrObserver;
williamr@2
    32
williamr@2
    33
// CLASS DECLARATION
williamr@2
    34
/**
williamr@2
    35
*  @publishedAll
williamr@2
    36
*  @released
williamr@2
    37
*
williamr@2
    38
*  This class provides functions to control 
williamr@2
    39
*  ALR (Application Level Roaming) for SIP profiles that have 
williamr@2
    40
*  a SNAP (Service Network Access Point) ID configured. 
williamr@2
    41
*  By default the clients allow automatic roaming between 
williamr@2
    42
*  IAPs (Internet Access Point) for a SIP profile. 
williamr@2
    43
*  The clients wanting to control the roaming must instantiate this class.
williamr@2
    44
*  After that all the IAP availability events received through 
williamr@2
    45
*  MSipProfileAlrObserver::AlrEvent must be allowed or disallowed.
williamr@2
    46
*
williamr@2
    47
*  @lib sipprofilecli.lib
williamr@2
    48
*/
williamr@2
    49
class CSipProfileAlrController : public CBase
williamr@2
    50
    {
williamr@2
    51
    public: // Constructors and destructor
williamr@2
    52
    
williamr@2
    53
        /**
williamr@2
    54
        * Two-phased constructor.
williamr@2
    55
        * @param aRegistry a SIP profile registry instance.
williamr@2
    56
        * @param aObserver a observer for IAP migration events.
williamr@2
    57
        */
williamr@2
    58
        IMPORT_C static CSipProfileAlrController* NewL(
williamr@2
    59
            CSIPProfileRegistryBase& aRegistry,
williamr@2
    60
            MSipProfileAlrObserver& aObserver );
williamr@2
    61
williamr@2
    62
        /**
williamr@2
    63
        * Two-phased constructor.
williamr@2
    64
        * Constructs an object and adds the pointer to the cleanup stack.
williamr@2
    65
        * @param aRegistry a SIP profile registry instance.
williamr@2
    66
        * @param aObserver a observer for IAP migration events.
williamr@2
    67
        */
williamr@2
    68
        IMPORT_C static CSipProfileAlrController* NewLC(
williamr@2
    69
            CSIPProfileRegistryBase& aRegistry,
williamr@2
    70
            MSipProfileAlrObserver& aObserver );   
williamr@2
    71
    
williamr@2
    72
        /**
williamr@2
    73
        * Destructor.
williamr@2
    74
        */
williamr@2
    75
        ~CSipProfileAlrController();
williamr@2
    76
williamr@2
    77
    public: // New functions
williamr@2
    78
williamr@2
    79
        /**
williamr@2
    80
        * Allows SIP Profile Agent to start the migration 
williamr@2
    81
        * to a new IAP for the profile.
williamr@2
    82
        * If also all the other clients allow the migration,
williamr@2
    83
        * migration will be started and all the clients are informed
williamr@2
    84
        * with MSipProfileAlrObserver::AlrEvent(EMigrationStarted,...).
williamr@2
    85
        * When MSipProfileAlrObserver::AlrEvent(EMigrationCompleted,...)
williamr@2
    86
        * gets called the migration has been completed and
williamr@2
    87
        * the related SIP profile has been registered via the new IAP. 
williamr@2
    88
        * @param aProfileId the SIP profile id
williamr@2
    89
        * @param aIapId the new IAP id. 
williamr@2
    90
        */
williamr@2
    91
        IMPORT_C void AllowMigrationL( TUint32 aProfileId,
williamr@2
    92
                                       TUint32 aIapId );
williamr@2
    93
williamr@2
    94
        /**
williamr@2
    95
        * Disallows SIP Profile Agent to migrate 
williamr@2
    96
        * to a new IAP for the profile.
williamr@2
    97
        * After the client calls this function all the clients are informed
williamr@2
    98
        * with MSipProfileAlrObserver::AlrError(...).
williamr@2
    99
        * @param aProfileId the SIP profile id
williamr@2
   100
        * @param aIapId the new IAP id. 
williamr@2
   101
        */
williamr@2
   102
        IMPORT_C void DisallowMigrationL( TUint32 aProfileId,
williamr@2
   103
                                          TUint32 aIapId );
williamr@2
   104
                                          
williamr@2
   105
        /**
williamr@2
   106
        * Refreshes the list of available IAPs for 
williamr@2
   107
        * the SNAP configured for the profile.
williamr@2
   108
        * If a new better IAP is available, it is offered via
williamr@2
   109
        * MSipProfileAlrObserver::AlrEvent(EIapAvailable,...).
williamr@2
   110
        * This function should be called if migration 
williamr@2
   111
        * to a IAP has been previously disallowed and the client wants to 
williamr@2
   112
        * check whether the better IAP is still available.
williamr@2
   113
        * @param aProfileId the SIP profile id 
williamr@2
   114
        */
williamr@2
   115
        IMPORT_C void RefreshIapAvailabilityL( TUint32 aProfileId ); 
williamr@2
   116
williamr@2
   117
williamr@2
   118
    private: // Constructors:
williamr@2
   119
williamr@2
   120
        CSipProfileAlrController( CSIPProfileRegistryBase& aRegistry );        
williamr@2
   121
        void ConstructL( MSipProfileAlrObserver& aObserver );
williamr@2
   122
        
williamr@2
   123
    private: // Data
williamr@2
   124
    
williamr@2
   125
    	CSIPProfileRegistryBase& iRegistry;
williamr@2
   126
    
williamr@2
   127
    private: // For testing purposes	
williamr@4
   128
#ifdef CPPUNIT_TEST
williamr@2
   129
	    friend class CSIPProfileAlrControllerTest;        
williamr@4
   130
#endif
williamr@2
   131
    };
williamr@2
   132
williamr@2
   133
#endif // CSIPPROFILEALRCONTROLLER_H