vpnengine/vpnconnagt/inc/vpnsipobserver.h
branchRCL_3
changeset 8 032d3a818f49
equal deleted inserted replaced
4:29b591713d44 8:032d3a818f49
       
     1 /*
       
     2 * Copyright (c) 2010 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 : P&S key monitor for communication between VPN client
       
    15 *               and SIP Profile server
       
    16 * Name        : vpnsipobserver.h
       
    17 * Part of     : VPN client / VPN Connection Agent
       
    18 * Version     : 1.0
       
    19 *
       
    20 */
       
    21 
       
    22 #ifndef VPNSIPOBSERVER_H
       
    23 #define VPNSIPOBSERVER_H
       
    24 
       
    25 #include <e32base.h>
       
    26 #include "vpnconnagt.h"                   // Reference to CVPNConnAgt is needed for call back
       
    27 
       
    28 class CVPNConnAgt;
       
    29 
       
    30 NONSHARABLE_CLASS( CVpnSipObserver ): public CActive
       
    31     {      
       
    32 public: // Constructor & destructor
       
    33 
       
    34     /**
       
    35      * Two-phased constructor
       
    36      */
       
    37     static CVpnSipObserver* NewL( CVPNConnAgt& aAgent );
       
    38 
       
    39     /**
       
    40      * Destructor
       
    41      */
       
    42     virtual ~CVpnSipObserver();
       
    43         
       
    44         
       
    45 public: // New methods
       
    46 
       
    47     /**
       
    48      * Closes the sip connections
       
    49      * @return ETrue if connections are succesfully closed
       
    50      */
       
    51     TInt RequestDeregister();
       
    52         
       
    53     /**
       
    54      * Re-opens connection in case vpn session ends
       
    55      */
       
    56     TInt RequestRegister();
       
    57     
       
    58     
       
    59 private: // From CActive
       
    60 
       
    61     /**
       
    62      * From CActive
       
    63      */
       
    64     void RunL();
       
    65     
       
    66     /**
       
    67      * From CActive
       
    68      */
       
    69     void DoCancel();
       
    70         
       
    71         
       
    72 private: // New methods
       
    73 
       
    74     /**
       
    75      * Subscribes to the property
       
    76      */
       
    77     void Subscribe();
       
    78         
       
    79     /**
       
    80      * 2nd phase constructor
       
    81      */
       
    82     void ConstructL();
       
    83     
       
    84     /**
       
    85      * C++ constructor
       
    86      */
       
    87     CVpnSipObserver( CVPNConnAgt& aAgent );
       
    88 
       
    89 
       
    90 private: // Data
       
    91    
       
    92     /**
       
    93      * Own: P&S for communication between SIP Profile Server and VPN client
       
    94      */
       
    95     RProperty iSIPProperty;
       
    96     
       
    97     /**
       
    98      * Own: Owner of this observer
       
    99      */
       
   100     CVPNConnAgt& iAgent;
       
   101     };
       
   102     
       
   103 #endif    // VPNSIPOBSERVER_H