vpnui/vpnmanagementui/inc/vpnapiwrapper.h
branchRCL_3
changeset 23 473321461bba
parent 22 9f4e37332ce5
child 24 e06095241a65
equal deleted inserted replaced
22:9f4e37332ce5 23:473321461bba
     1 /*
       
     2 * Copyright (c) 2003-2009 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:   Declaration of the CVpnApiWrapper class.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __VPNAPIWRAPPER_H__
       
    19 #define __VPNAPIWRAPPER_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 #include "vpnextapi.h"
       
    24 
       
    25 
       
    26 class MVpnApiWrapperCaller
       
    27     {
       
    28 public:
       
    29   
       
    30     virtual void NotifySynchroniseServerCompleteL(TInt aResult) = 0;
       
    31     };
       
    32 
       
    33 /**
       
    34  * The class definitions for CVpnApiWrapper -
       
    35  * Wrapper class for VPN API calls 
       
    36  */
       
    37 class CVpnApiWrapper : public CActive
       
    38     {
       
    39 public:
       
    40     /**
       
    41      * NewL method starts the standard two phase construction.
       
    42      */	
       
    43     static CVpnApiWrapper* NewL();
       
    44 
       
    45     /**
       
    46      * Destructor
       
    47      */
       
    48     ~CVpnApiWrapper();
       
    49 
       
    50     CArrayFixFlat<TVpnPolicyInfo>* PolicyListL();
       
    51     
       
    52     /**
       
    53      * Deletes the specified policy.
       
    54      *
       
    55      * @param aPolicyIndex Index of the listbox in the policy view
       
    56      */
       
    57     void DeletePolicyL(TInt aPolicyIndex);
       
    58     
       
    59     /**
       
    60      * Gets detailed information about the specified policy.
       
    61      *
       
    62      * @param aPolicyIndex Index of the listbox in the policy view
       
    63      * 
       
    64      * @param aPolicyDetails [out] Policy information structure
       
    65      */
       
    66     void GetPolicyDetailsL(
       
    67         TInt aPolicyIndex, TVpnPolicyDetails& aPolicyDetails);
       
    68     
       
    69     /**
       
    70      * Cretes the specified server definition.
       
    71      *
       
    72      * @param aServerDetails [in] Server details structure
       
    73     */
       
    74      TInt CreateServer( const TAgileProvisionApiServerSettings& aServerDetails );
       
    75      
       
    76      TAgileProvisionApiServerListElem& ServerListL();
       
    77      
       
    78      void GetServerDetailsL( TAgileProvisionApiServerSettings& aServerDetails );
       
    79      TInt DeleteServer();
       
    80      void SynchroniseServerL(  MVpnApiWrapperCaller* aCaller  );
       
    81      void CancelSynchronise( );
       
    82 
       
    83 protected: // From CActive
       
    84     void DoCancel();
       
    85     void RunL();
       
    86     
       
    87 private:
       
    88     /**
       
    89      * Constructor
       
    90      */
       
    91     CVpnApiWrapper();
       
    92 
       
    93     /**
       
    94      * Second phase constructor
       
    95      */
       
    96     void ConstructL();
       
    97 
       
    98     /**
       
    99      * Builds the list of the installed policies.
       
   100      */
       
   101     void BuildPolicyListL();
       
   102 
       
   103     /**
       
   104      * Deletes all VPN AP that referes to policy aPolicyId.
       
   105      * Ignores possible errors --> In case of an error the remaining
       
   106      * APs are not deleted.
       
   107      */
       
   108     void DeleteReferringVpnAps(const TVpnPolicyId& aPolicyId) const;
       
   109     void DeleteReferringVpnApsL(const TVpnPolicyId& aPolicyId) const;
       
   110     
       
   111 private:
       
   112 
       
   113     enum TTask
       
   114         {
       
   115         ETaskNone = 1,
       
   116         ETaskSynchroniseServer,
       
   117 
       
   118         };
       
   119 
       
   120 
       
   121     RVpnExtApi iVpnExtApi;
       
   122     TAgileProvisionApiServerSettings iPolicyServer;
       
   123     TAgileProvisionApiServerListElem iVpnPolicyServerList;
       
   124     CArrayFixFlat<TVpnPolicyInfo>* iPolicyList;
       
   125     TFileName iImportDir;
       
   126 
       
   127     TTask iOngoingTask;
       
   128     MVpnApiWrapperCaller* iCaller;
       
   129     };
       
   130 
       
   131 #endif  // __VPNAPIWRAPPER_H__