voipplugins/voipadapters/provisioningfile/inc/WPProtocolProfileHandlerSIP.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Interface to SIP profiles.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef WPPROTOCOLPROFILEHANDLERSIP_H
       
    20 #define WPPROTOCOLPROFILEHANDLERSIP_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include    <e32base.h>
       
    24 #include    <sipobserver.h>
       
    25 #include    <sipprofileregistryobserver.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CSIP;
       
    29 class CSIPProfile;
       
    30 class CSIPProfileRegistry;
       
    31 class CSIPManagedProfile;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 *  Interface to SIP profiles.
       
    37 *
       
    38 *  @lib ProvisioningFile.lib
       
    39 *  @since Series 60 3.0
       
    40 */
       
    41 NONSHARABLE_CLASS(CWPProtocolProfileHandlerSIP) : public CBase,
       
    42                                                   public MSIPObserver,
       
    43                                                   public MSIPProfileRegistryObserver
       
    44     {
       
    45     
       
    46 #ifdef PROVISIONINGFILE_TEST
       
    47     
       
    48     friend class UT_ProvisioningFile;
       
    49     friend class UT_ProtocolProvider;
       
    50     
       
    51 #endif
       
    52     
       
    53     public:  // Constructors and destructor
       
    54         
       
    55         /**
       
    56         * Two-phased constructor.
       
    57         */
       
    58         static CWPProtocolProfileHandlerSIP* NewL();
       
    59 
       
    60         /**
       
    61         * Two-phased constructor.
       
    62         */
       
    63         static CWPProtocolProfileHandlerSIP* NewLC();
       
    64         
       
    65         /**
       
    66         * Destructor.
       
    67         */
       
    68         virtual ~CWPProtocolProfileHandlerSIP();
       
    69 
       
    70     private: 
       
    71                               
       
    72         /**
       
    73         * Find SIP profile from array by profile id.
       
    74         * @since Series 60 3.0
       
    75         * @param aProfileId Profile id to search for
       
    76         * @param aIndex     On completion, contains index of profile.
       
    77         * @return Pointer to SIP profile
       
    78         */
       
    79         CSIPProfile* FindSIPProfileByIdL( TUint32 aProfileId,
       
    80                                           TInt& aIndex );                              
       
    81                               
       
    82     public:
       
    83         
       
    84         /**
       
    85         * Set Protocol Profile use this IAP.
       
    86         * @since Series 60 3.0
       
    87         * @param aProfileId  Protocol Profiles array place.
       
    88         * @param aProfileIapId  Profiles new IAP Id.
       
    89         */                                     
       
    90         void SetProfilesIapL( TInt aProfileId, 
       
    91                               TUint32 aProfileIapId );
       
    92                               
       
    93         /**
       
    94         * Set provisioning Protocol Profiles Id in array.
       
    95         * @since Series 60 3.0
       
    96         */                                     
       
    97         void SetProvisioningIdL();
       
    98         
       
    99         /**
       
   100         * Get provisioned Protocol Profiles count.
       
   101         * @since Series 60 3.0
       
   102         * @return TInt count of provisioned profiles.
       
   103         */                                     
       
   104         TInt ProvisionedCount();
       
   105                               
       
   106     public: // Functions from base classes
       
   107         
       
   108         /**
       
   109         * From MSIPObserver
       
   110         * A SIP request has been received from the network.        
       
   111         * @pre aTransaction != 0
       
   112         * @param aIapId The IapId from which the SIP request was received.
       
   113         * @param aTransaction contains local address, remote address of a SIP
       
   114         *        message, as well as optional SIP message method, headers and
       
   115         *        body. The ownership is transferred.
       
   116         */
       
   117         void IncomingRequest( TUint32 aIapId,
       
   118                               CSIPServerTransaction* aTransaction );
       
   119 
       
   120         /**
       
   121         * From MSIPObserver
       
   122         * The received SIP request time-outed and it is invalid i.e. cannot be used
       
   123         * anymore.
       
   124         * This will be called if the user fails to create a SIP connection
       
   125         * and does not send an appropriate SIP response.
       
   126         * @param aTransaction The time-outed transaction.
       
   127         */
       
   128         void TimedOut( CSIPServerTransaction& aTransaction );
       
   129         
       
   130         /** 
       
   131         * From MSIPProfileRegistryObserver
       
   132         * An event related to SIP Profile has accorred
       
   133         * @param aProfileId a profile Id
       
   134         * @param aEvent an occurred event
       
   135         **/
       
   136         void ProfileRegistryEventOccurred( TUint32 aProfileId,
       
   137                                            MSIPProfileRegistryObserver::TEvent aEvent );
       
   138 
       
   139         /**
       
   140         * From MSIPProfileRegistryObserver
       
   141         * An asynchronous error has occurred related to SIP profile
       
   142         * Event is send to those observers, who have the
       
   143         * corresponding profile instantiated.
       
   144         * @param aProfileId the id of failed profile 
       
   145         * @param aError an occurred error
       
   146         */
       
   147         void ProfileRegistryErrorOccurred( TUint32 aProfileId,
       
   148                                            TInt aError );
       
   149                                            
       
   150     private:
       
   151 
       
   152         /**
       
   153         * C++ default constructor.
       
   154         */
       
   155         CWPProtocolProfileHandlerSIP();
       
   156 
       
   157         /**
       
   158         * By default Symbian 2nd phase constructor is private.
       
   159         */
       
   160         void ConstructL();
       
   161 
       
   162     private:    // Data
       
   163 
       
   164         // SIP objects.
       
   165         CSIP*                       iSIP;
       
   166         
       
   167         CSIPProfileRegistry*        iSIPProfileRegistry;
       
   168 
       
   169         // Array of SIP profile instances
       
   170         RPointerArray<CSIPProfile>  iSIPProfiles;
       
   171         
       
   172         // Array of SIP profile ids
       
   173         RArray<TInt32>              iSIPProfileIds;
       
   174 
       
   175     };
       
   176 
       
   177 #endif // WPPROTOCOLPROFILEHANDLERSIP_H   
       
   178             
       
   179 // End of File