|
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 #include "vpnapi.h" |
|
23 |
|
24 |
|
25 class MVpnApiWrapperCaller |
|
26 { |
|
27 public: |
|
28 virtual void NotifyPolicyImportComplete(TInt aResult) = 0; |
|
29 }; |
|
30 |
|
31 /** |
|
32 * The class definitions for CVpnApiWrapper - |
|
33 * Wrapper class for VPN API calls |
|
34 */ |
|
35 class CVpnApiWrapper : public CActive |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * NewL method starts the standard two phase construction. |
|
40 */ |
|
41 static CVpnApiWrapper* NewL(); |
|
42 |
|
43 /** |
|
44 * Destructor |
|
45 */ |
|
46 ~CVpnApiWrapper(); |
|
47 |
|
48 CArrayFixFlat<TVpnPolicyInfo>* PolicyListL(); |
|
49 |
|
50 /** |
|
51 * Deletes the specified policy. |
|
52 * |
|
53 * @param aPolicyIndex Index of the listbox in the policy view |
|
54 */ |
|
55 void DeletePolicyL(TInt aPolicyIndex); |
|
56 |
|
57 /** |
|
58 * Gets detailed information about the specified policy. |
|
59 * |
|
60 * @param aPolicyIndex Index of the listbox in the policy view |
|
61 * |
|
62 * @param aPolicyDetails [out] Policy information structure |
|
63 */ |
|
64 void GetPolicyDetailsL( |
|
65 TInt aPolicyIndex, TVpnPolicyDetails& aPolicyDetails); |
|
66 |
|
67 /** |
|
68 * Imports a new VPN policy to the policy store. |
|
69 * |
|
70 * @param aImportDir An absolute path to the VPN policy files directory |
|
71 * |
|
72 * @param aCaller |
|
73 */ |
|
74 void ImportPolicyL( |
|
75 const TDesC& aImportDir, MVpnApiWrapperCaller* aCaller); |
|
76 |
|
77 /** |
|
78 * Gets the last update time of the specified policy. |
|
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); |
|
85 |
|
86 protected: // From CActive |
|
87 void DoCancel(); |
|
88 void RunL(); |
|
89 |
|
90 private: |
|
91 /** |
|
92 * Constructor |
|
93 */ |
|
94 CVpnApiWrapper(); |
|
95 |
|
96 /** |
|
97 * Second phase constructor |
|
98 */ |
|
99 void ConstructL(); |
|
100 |
|
101 /** |
|
102 * Builds the list of the installed policies. |
|
103 */ |
|
104 void BuildPolicyListL(); |
|
105 |
|
106 private: |
|
107 |
|
108 enum TTask |
|
109 { |
|
110 ETaskNone = 1, |
|
111 ETaskImportPolicies |
|
112 }; |
|
113 |
|
114 RVpnApi iVpnApi; |
|
115 |
|
116 CArrayFixFlat<TVpnPolicyInfo>* iPolicyList; |
|
117 TFileName iImportDir; |
|
118 |
|
119 TTask iOngoingTask; |
|
120 MVpnApiWrapperCaller* iCaller; |
|
121 }; |
|
122 |
|
123 #endif // __VPNAPIWRAPPER_H__ |