|
1 /* |
|
2 * Copyright (c) 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: Hsps configuration message |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "hspsconfiguration.h" |
|
20 #include "pluginmap.h" |
|
21 #include "objectmap.h" |
|
22 #include "itemmap.h" |
|
23 #include "plugininfo.h" |
|
24 |
|
25 namespace hspswrapper{ |
|
26 |
|
27 |
|
28 // --------------------------------------------------------------------------- |
|
29 // --------------------------------------------------------------------------- |
|
30 // |
|
31 CHspsConfiguration::CHspsConfiguration() |
|
32 { |
|
33 } |
|
34 |
|
35 |
|
36 // --------------------------------------------------------------------------- |
|
37 // --------------------------------------------------------------------------- |
|
38 // |
|
39 void CHspsConfiguration::ConstructL() |
|
40 { |
|
41 iPluginInfo = CPluginInfo::NewL(); |
|
42 } |
|
43 |
|
44 |
|
45 // --------------------------------------------------------------------------- |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 EXPORT_C CHspsConfiguration* CHspsConfiguration::NewL() |
|
49 { |
|
50 CHspsConfiguration* self = CHspsConfiguration::NewLC(); |
|
51 CleanupStack::Pop( self ); |
|
52 return self; |
|
53 } |
|
54 |
|
55 |
|
56 // --------------------------------------------------------------------------- |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 EXPORT_C CHspsConfiguration* CHspsConfiguration::NewLC() |
|
60 { |
|
61 CHspsConfiguration* self = new( ELeave ) CHspsConfiguration; |
|
62 CleanupStack::PushL( self ); |
|
63 self->ConstructL(); |
|
64 return self; |
|
65 } |
|
66 |
|
67 |
|
68 // --------------------------------------------------------------------------- |
|
69 // --------------------------------------------------------------------------- |
|
70 // |
|
71 EXPORT_C CHspsConfiguration::~CHspsConfiguration() |
|
72 { |
|
73 delete iId; |
|
74 delete iPluginInfo; |
|
75 iPlugins.ResetAndDestroy(); |
|
76 iSettings.ResetAndDestroy(); |
|
77 iResources.ResetAndDestroy(); |
|
78 } |
|
79 |
|
80 // --------------------------------------------------------------------------- |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 EXPORT_C CHspsConfiguration& CHspsConfiguration::SetConfIdL(const TDesC8& aId) |
|
84 { |
|
85 delete iId; |
|
86 iId = NULL; |
|
87 iId = aId.AllocL(); |
|
88 return *this; |
|
89 } |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // --------------------------------------------------------------------------- |
|
93 // |
|
94 EXPORT_C const TDesC8& CHspsConfiguration::ConfId()const |
|
95 { |
|
96 if(iId) |
|
97 { |
|
98 return *iId; |
|
99 } |
|
100 else |
|
101 { |
|
102 return KNullDesC8; |
|
103 } |
|
104 } |
|
105 |
|
106 // --------------------------------------------------------------------------- |
|
107 // --------------------------------------------------------------------------- |
|
108 // |
|
109 EXPORT_C CPluginInfo& CHspsConfiguration::PluginInfo() |
|
110 { |
|
111 return *iPluginInfo; |
|
112 } |
|
113 |
|
114 // --------------------------------------------------------------------------- |
|
115 // --------------------------------------------------------------------------- |
|
116 // |
|
117 EXPORT_C CHspsConfiguration& CHspsConfiguration::AddPluginMapL(CPluginMap* aPluginMap) |
|
118 { |
|
119 iPlugins.AppendL(aPluginMap); |
|
120 return *this; |
|
121 } |
|
122 |
|
123 // --------------------------------------------------------------------------- |
|
124 // --------------------------------------------------------------------------- |
|
125 // |
|
126 EXPORT_C RPointerArray<CPluginMap>& CHspsConfiguration::PluginMaps() |
|
127 { |
|
128 return iPlugins; |
|
129 } |
|
130 |
|
131 // --------------------------------------------------------------------------- |
|
132 // --------------------------------------------------------------------------- |
|
133 // |
|
134 EXPORT_C CHspsConfiguration& CHspsConfiguration::AddItemMapL(CItemMap* aItemMap) |
|
135 { |
|
136 iSettings.AppendL(aItemMap); |
|
137 return *this; |
|
138 } |
|
139 |
|
140 // --------------------------------------------------------------------------- |
|
141 // --------------------------------------------------------------------------- |
|
142 // |
|
143 EXPORT_C RPointerArray<CItemMap>& CHspsConfiguration::Settings() |
|
144 { |
|
145 return iSettings; |
|
146 } |
|
147 |
|
148 // --------------------------------------------------------------------------- |
|
149 // --------------------------------------------------------------------------- |
|
150 // |
|
151 EXPORT_C CHspsConfiguration& CHspsConfiguration::AddObjectMapL(CObjectMap* aObjectMap) |
|
152 { |
|
153 iResources.AppendL(aObjectMap); |
|
154 return *this; |
|
155 } |
|
156 |
|
157 // --------------------------------------------------------------------------- |
|
158 // --------------------------------------------------------------------------- |
|
159 // |
|
160 EXPORT_C RPointerArray<CObjectMap>& CHspsConfiguration::Resources() |
|
161 { |
|
162 return iResources; |
|
163 } |
|
164 |
|
165 } // namespace end |
|
166 |