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