19 #define STREAMMAP_H |
19 #define STREAMMAP_H |
20 |
20 |
21 #include <e32base.h> |
21 #include <e32base.h> |
22 #include <e32std.h> //for RFastLock |
22 #include <e32std.h> //for RFastLock |
23 #include <e32hashtab.h> //for RHashMap |
23 #include <e32hashtab.h> //for RHashMap |
|
24 #include <graphics/surfacemanager.h> |
|
25 |
|
26 #include <graphics/updateserverprovider.h> |
24 |
27 |
25 class CSurfaceStream; |
28 class CSurfaceStream; |
26 class TSurfaceId; |
29 class TSurfaceId; |
27 class MSurfaceUpdateServerProvider; |
30 class MSurfaceUpdateServerProvider; |
28 class CExtensionContainer; |
31 class CExtensionContainer; |
29 class RSurfaceManager; |
|
30 |
32 |
31 NONSHARABLE_CLASS(COpenWfcStreamMap): public CBase |
33 NONSHARABLE_CLASS(COpenWfcStreamMap): public CBase |
32 { |
34 { |
33 public: |
35 public: |
34 /** |
36 /** |
35 * Returns a reference to the singleton instance. |
37 * Returns a reference to the singleton instance. |
36 * |
38 * |
37 * @return The pointer to the singleton instance |
39 * @return The pointer to the singleton instance |
38 */ |
40 */ |
39 IMPORT_C static COpenWfcStreamMap& InstanceL(); |
41 IMPORT_C static COpenWfcStreamMap& InstanceL(); |
|
42 /** |
|
43 * Expands the array to accommodate a specified number of key-value pairs. |
|
44 * If the hash map already has enough space for the specified number of elements, no |
|
45 * action is taken. Any elements already in the map are retained. |
|
46 * |
|
47 * @param aExpand The number of key-value pairs for which space should be allocated. |
|
48 * @return KErrNone if the operation completed aInternalVersion. |
|
49 * @return KErrNoMemory if sufficient memory could not be allocated. |
|
50 */ |
|
51 IMPORT_C TInt Reserve(TInt aExpand); |
40 /** |
52 /** |
41 * Look up a specified TSurfaceId key in the associative array and return a pointer to the |
53 * Look up a specified TSurfaceId key in the associative array and return a pointer to the |
42 * corresponding to a native stream. The reference counter of the native stream is incremented by one. |
54 * corresponding to a native stream. The reference counter of the native stream is incremented by one. |
43 * |
55 * |
44 * @param aSurfaceId The TSurfaceId key to look up |
56 * @param aSurfaceId The TSurfaceId key to look up |
94 /** |
106 /** |
95 * Returns a reference to the surface manager. |
107 * Returns a reference to the surface manager. |
96 * |
108 * |
97 * @return A reference to the local SurfaceManager |
109 * @return A reference to the local SurfaceManager |
98 */ |
110 */ |
99 IMPORT_C RSurfaceManager& SurfaceManager(); |
111 RSurfaceManager& SurfaceManager(); |
100 |
112 |
101 /** |
113 /** |
102 * Returns a pointer to the main heap |
114 * Returns a pointer to the main heap |
103 * |
115 * |
104 * @return A pointer to the main heap |
116 * @return A pointer to the main heap |
176 */ |
196 */ |
177 static COpenWfcStreamMap* pInstance; |
197 static COpenWfcStreamMap* pInstance; |
178 /** |
198 /** |
179 * Surface manager |
199 * Surface manager |
180 */ |
200 */ |
181 RSurfaceManager* iSurfaceManager; |
201 RSurfaceManager iSurfaceManager; |
182 |
202 |
183 RHeap *iMainHeap; //< --This points to main thread's heap-- |
203 RHeap *iMainHeap; //< --This points to main thread's heap-- |
184 |
204 |
185 RHashMap<TInt32, CExtensionContainer*> iRegisteredUpdaters; //< Proxy objects for handing surface update notifications. |
205 RHashMap<TInt32, CExtensionContainer*> iRegisteredUpdaters; //< Proxy objects for handing surface update notifications. |
186 |
206 |