|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __STRINGDICTIONARYCOLLECTIONIMPL_H__ |
|
17 #define __STRINGDICTIONARYCOLLECTIONIMPL_H__ |
|
18 |
|
19 #include <stringpool.h> |
|
20 |
|
21 namespace Xml |
|
22 { |
|
23 |
|
24 class MStringDictionary; |
|
25 |
|
26 class RStringDictionaryCollectionImpl |
|
27 /** |
|
28 The RStringDictionaryCollectionImpl class hides the implementation of the |
|
29 RStringDictionaryCollection. |
|
30 |
|
31 It is responsible for maintaining the list of string dictionary plugins |
|
32 required by the framework. |
|
33 |
|
34 @internalTechnology |
|
35 @released |
|
36 */ |
|
37 { |
|
38 public: |
|
39 void OpenL(); |
|
40 TInt Close(); |
|
41 |
|
42 RStringDictionaryCollectionImpl(); |
|
43 |
|
44 void OpenDictionaryL(const TDesC8& aDictionaryDescription); |
|
45 |
|
46 RStringPool& StringPool(); |
|
47 |
|
48 MStringDictionary& CurrentDictionaryL() const; |
|
49 |
|
50 private: |
|
51 |
|
52 RStringDictionaryCollectionImpl(const RStringDictionaryCollectionImpl& aOriginal); |
|
53 RStringDictionaryCollectionImpl& operator=(const RStringDictionaryCollectionImpl& aRhs); |
|
54 |
|
55 TBool LocateDictionary(const RString& aNsUri, MStringDictionary*& aStringDictionary); |
|
56 MStringDictionary* ConstructDictionaryL(const TDesC8& aDictionaryUri, |
|
57 RStringPool& aStringPool); |
|
58 |
|
59 private: |
|
60 |
|
61 struct TDtorMapping |
|
62 { |
|
63 TUid iDtorKey; |
|
64 MStringDictionary* iStringDictionary; |
|
65 }; |
|
66 |
|
67 RPointerArray<TDtorMapping> iDtorKeyAndDictionaryList; |
|
68 |
|
69 static void DestroyMapping(TAny* aPtr); |
|
70 |
|
71 |
|
72 /** |
|
73 The reference count for this collection. |
|
74 */ |
|
75 TInt iRefCount; |
|
76 |
|
77 /** |
|
78 The StringPool for the Collection. |
|
79 */ |
|
80 RStringPool iStringPool; |
|
81 |
|
82 /** |
|
83 The current Dictionary in use. |
|
84 We do not own this; for quick access only. |
|
85 */ |
|
86 MStringDictionary* iStringDictionary; |
|
87 |
|
88 }; |
|
89 |
|
90 } |
|
91 |
|
92 #endif //__STRINGDICTIONARYCOLLECTIONIMPL_H__ |