|
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 #include <ecom/ecom.h> |
|
17 |
|
18 #include <xml/stringdictionarycollection.h> |
|
19 |
|
20 #include "stringdictionarycollectionimpl.h" |
|
21 |
|
22 using namespace Xml; |
|
23 |
|
24 EXPORT_C RStringDictionaryCollection::RStringDictionaryCollection() |
|
25 /** |
|
26 Default constructor |
|
27 |
|
28 @post This object is properly constructed. |
|
29 |
|
30 */ |
|
31 : iImpl(NULL) |
|
32 { |
|
33 // do nothing; |
|
34 } |
|
35 |
|
36 |
|
37 |
|
38 void RStringDictionaryCollection::CreateImplL() |
|
39 /** |
|
40 Create the implementation object. |
|
41 |
|
42 @pre The object has just been constructed but not opened. |
|
43 @post The object is fully constructed and ready to be used. |
|
44 |
|
45 */ |
|
46 { |
|
47 if (!iImpl) |
|
48 { |
|
49 iImpl = new (ELeave) RStringDictionaryCollectionImpl; |
|
50 } |
|
51 } |
|
52 |
|
53 |
|
54 |
|
55 EXPORT_C void RStringDictionaryCollection::OpenL() |
|
56 /** |
|
57 This method opens this resource incrementing the reference count. |
|
58 It must be the first method called after construction. |
|
59 |
|
60 @post The object is ready to be used. |
|
61 |
|
62 */ |
|
63 { |
|
64 CreateImplL(); |
|
65 iImpl->OpenL(); |
|
66 } |
|
67 |
|
68 |
|
69 EXPORT_C void RStringDictionaryCollection::Close() |
|
70 /** |
|
71 This method cleans up the object before destruction. It releases all resources in |
|
72 accordance to the R Class pattern. |
|
73 |
|
74 @post This object may be allowed to go out of scope. |
|
75 |
|
76 */ |
|
77 { |
|
78 if (iImpl) |
|
79 { |
|
80 if (iImpl->Close() == 0) |
|
81 { |
|
82 delete iImpl; |
|
83 iImpl = NULL; |
|
84 } |
|
85 } |
|
86 } |
|
87 |
|
88 |
|
89 EXPORT_C void RStringDictionaryCollection::OpenDictionaryL(const TDesC8& aDictionaryDescription) |
|
90 /** |
|
91 This method loads the Dictionary. |
|
92 |
|
93 @pre Connect has been called. |
|
94 @post The Dictionary has been loaded. |
|
95 |
|
96 @param aDictionaryDescription The Namepspace MIME type. |
|
97 */ |
|
98 { |
|
99 iImpl->OpenDictionaryL(aDictionaryDescription); |
|
100 } |
|
101 |
|
102 |
|
103 |
|
104 EXPORT_C RStringPool& RStringDictionaryCollection::StringPool() |
|
105 /** |
|
106 This method obtains a handle to the RStringPool |
|
107 |
|
108 @return the RStringPool |
|
109 |
|
110 */ |
|
111 { |
|
112 return iImpl->StringPool(); |
|
113 } |
|
114 |
|
115 |
|
116 EXPORT_C MStringDictionary& RStringDictionaryCollection::CurrentDictionaryL() const |
|
117 /** |
|
118 This method obtains the current string dictionary in use. |
|
119 Also, serves as a way to test if any dictionaries have been loaded as none needs be. |
|
120 |
|
121 @return the current Dictionary in use, if any. |
|
122 @leave KErrXmlMissingStringDictionary if there is no dictionary |
|
123 |
|
124 */ |
|
125 { |
|
126 return iImpl->CurrentDictionaryL(); |
|
127 } |