1 /* |
|
2 * Copyright (c) 2008-2008 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: Manager class for policy extensions |
|
15 |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CESMRPOLICYEXTENSIONMANAGER_H |
|
21 |
|
22 #define CESMRPOLICYEXTENSIONMANAGER_H |
|
23 |
|
24 |
|
25 |
|
26 #include <e32base.h> |
|
27 |
|
28 #include <barsc.h> // RResourceFile |
|
29 |
|
30 |
|
31 |
|
32 class CCoeEnv; |
|
33 |
|
34 |
|
35 |
|
36 /** |
|
37 |
|
38 * Utility class for holding extension resource info |
|
39 |
|
40 */ |
|
41 |
|
42 NONSHARABLE_CLASS( CESMRExtensionResourceFile ): public CBase |
|
43 |
|
44 { |
|
45 |
|
46 public: |
|
47 |
|
48 static CESMRExtensionResourceFile* NewL( const TDesC& aPath, RFs& aFs ); |
|
49 |
|
50 ~CESMRExtensionResourceFile(); |
|
51 |
|
52 |
|
53 |
|
54 public: // interface |
|
55 |
|
56 TInt ResId() const; |
|
57 |
|
58 RResourceFile& ResFile(); |
|
59 |
|
60 |
|
61 |
|
62 private: // implementation |
|
63 |
|
64 CESMRExtensionResourceFile(RFs& aFs); |
|
65 |
|
66 void ConstructL( const TDesC& aPath ); |
|
67 |
|
68 |
|
69 |
|
70 private: // data |
|
71 |
|
72 RFs& iFsSession; |
|
73 |
|
74 RResourceFile iResFile; |
|
75 |
|
76 TInt iResId; |
|
77 |
|
78 }; |
|
79 |
|
80 |
|
81 |
|
82 /** |
|
83 |
|
84 * Utility class to manage policy extension's information |
|
85 |
|
86 */ |
|
87 |
|
88 NONSHARABLE_CLASS( CESMRPolicyExtensionManager ): public CBase |
|
89 |
|
90 { |
|
91 |
|
92 public: // C'tor and d'tor |
|
93 |
|
94 static CESMRPolicyExtensionManager* NewL( CCoeEnv& aCoeEnv ); |
|
95 |
|
96 ~CESMRPolicyExtensionManager(); |
|
97 |
|
98 |
|
99 |
|
100 public: // Interface |
|
101 |
|
102 /** |
|
103 |
|
104 * Resolves all extension policy files and opens those |
|
105 |
|
106 * files. Reads the id of the policy. |
|
107 |
|
108 */ |
|
109 |
|
110 void ReadResourcesFromExtensionsL(); |
|
111 |
|
112 /** |
|
113 |
|
114 * If resource with aResourceId not found, return NULL. |
|
115 |
|
116 * ReadResourcesFromExtensionsL() should have been called before |
|
117 |
|
118 * this. Otherwise resources are not loaded. |
|
119 |
|
120 */ |
|
121 |
|
122 HBufC8* ReadBufferL( TInt aResourceId ); |
|
123 |
|
124 |
|
125 |
|
126 CESMRExtensionResourceFile* ExtensionResourceFile( TInt aResourceId ); |
|
127 |
|
128 |
|
129 |
|
130 private: // implementation |
|
131 |
|
132 CESMRPolicyExtensionManager( CCoeEnv& aCoeEnv ); |
|
133 |
|
134 void ConstructL(); |
|
135 |
|
136 |
|
137 |
|
138 private: // data |
|
139 |
|
140 // Ref: |
|
141 |
|
142 CCoeEnv& iCoeEnv; |
|
143 |
|
144 // Own: array for the opened resource files |
|
145 |
|
146 RPointerArray<CESMRExtensionResourceFile> iResourceFiles; |
|
147 |
|
148 }; |
|
149 |
|
150 |
|
151 |
|
152 #endif // CESMRPOLICYEXTENSIONMANAGER_H |
|
153 |
|