vpnui/vpnmanagementui/inc/vpnapiwrapper.h
branchRCL_3
changeset 49 5960d2d03390
parent 41 e06095241a65
equal deleted inserted replaced
46:29c8f9bc68e1 49:5960d2d03390
    17 
    17 
    18 #ifndef __VPNAPIWRAPPER_H__
    18 #ifndef __VPNAPIWRAPPER_H__
    19 #define __VPNAPIWRAPPER_H__
    19 #define __VPNAPIWRAPPER_H__
    20 
    20 
    21 #include <e32base.h>
    21 #include <e32base.h>
    22 
    22 #include "vpnapi.h"
    23 #include "vpnextapi.h"
       
    24 
    23 
    25 
    24 
    26 class MVpnApiWrapperCaller
    25 class MVpnApiWrapperCaller
    27     {
    26     {
    28 public:
    27 public:
    29   
    28     virtual void NotifyPolicyImportComplete(TInt aResult) = 0;
    30     virtual void NotifySynchroniseServerCompleteL(TInt aResult) = 0;
       
    31     };
    29     };
    32 
    30 
    33 /**
    31 /**
    34  * The class definitions for CVpnApiWrapper -
    32  * The class definitions for CVpnApiWrapper -
    35  * Wrapper class for VPN API calls 
    33  * Wrapper class for VPN API calls 
    65      */
    63      */
    66     void GetPolicyDetailsL(
    64     void GetPolicyDetailsL(
    67         TInt aPolicyIndex, TVpnPolicyDetails& aPolicyDetails);
    65         TInt aPolicyIndex, TVpnPolicyDetails& aPolicyDetails);
    68     
    66     
    69     /**
    67     /**
    70      * Cretes the specified server definition.
    68      * Imports a new VPN policy to the policy store.
    71      *
    69      *
    72      * @param aServerDetails [in] Server details structure
    70      * @param aImportDir An absolute path to the VPN policy files directory
    73     */
    71      * 
    74      TInt CreateServer( const TAgileProvisionApiServerSettings& aServerDetails );
    72      * @param aCaller
    75      
    73      */
    76      TAgileProvisionApiServerListElem& ServerListL();
    74     void ImportPolicyL(
    77      
    75         const TDesC& aImportDir, MVpnApiWrapperCaller* aCaller);
    78      void GetServerDetailsL( TAgileProvisionApiServerSettings& aServerDetails );
    76 
    79      TInt DeleteServer();
    77     /**
    80      void SynchroniseServerL(  MVpnApiWrapperCaller* aCaller  );
    78      * Gets the last update time of the specified policy.
    81      void CancelSynchronise( );
    79      * @param aPolicyIndex Index of the listbox in the policy view.
       
    80      * @param aTime Last update time to be returned.
       
    81      * @return Returns KErrNone if succeed.
       
    82      * Otherwise it returns KErrNotFound.
       
    83      */
       
    84     TInt GetLastUpdateTime(TInt aPolicyIndex, TTime& aTime);
    82 
    85 
    83 protected: // From CActive
    86 protected: // From CActive
    84     void DoCancel();
    87     void DoCancel();
    85     void RunL();
    88     void RunL();
    86     
    89     
    98     /**
   101     /**
    99      * Builds the list of the installed policies.
   102      * Builds the list of the installed policies.
   100      */
   103      */
   101     void BuildPolicyListL();
   104     void BuildPolicyListL();
   102 
   105 
   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:
   106 private:
   112 
   107 
   113     enum TTask
   108     enum TTask
   114         {
   109         {
   115         ETaskNone = 1,
   110         ETaskNone = 1,
   116         ETaskSynchroniseServer,
   111         ETaskImportPolicies
   117 
       
   118         };
   112         };
   119 
   113 
       
   114     RVpnApi iVpnApi;
   120 
   115 
   121     RVpnExtApi iVpnExtApi;
       
   122     TAgileProvisionApiServerSettings iPolicyServer;
       
   123     TAgileProvisionApiServerListElem iVpnPolicyServerList;
       
   124     CArrayFixFlat<TVpnPolicyInfo>* iPolicyList;
   116     CArrayFixFlat<TVpnPolicyInfo>* iPolicyList;
   125     TFileName iImportDir;
   117     TFileName iImportDir;
   126 
   118 
   127     TTask iOngoingTask;
   119     TTask iOngoingTask;
   128     MVpnApiWrapperCaller* iCaller;
   120     MVpnApiWrapperCaller* iCaller;