1 /* |
|
2 * Copyright (c) 2005-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: CGSPluginInteface implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <gsplugininterface.h> |
|
19 |
|
20 // ============================ MEMBER FUNCTIONS =============================== |
|
21 |
|
22 // ----------------------------------------------------------------------------- |
|
23 // CGSPluginInterface::CGSPluginInterface() |
|
24 // C++ default constructor can NOT contain any code, that |
|
25 // might leave. |
|
26 // ----------------------------------------------------------------------------- |
|
27 // |
|
28 EXPORT_C CGSPluginInterface::CGSPluginInterface() |
|
29 : iOrder( KGSPluginNotIndexed ) |
|
30 { |
|
31 } |
|
32 |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // CGSPluginInterface::~CGSPluginInterface() |
|
36 // Destructor. |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 EXPORT_C CGSPluginInterface::~CGSPluginInterface() |
|
40 { |
|
41 // We don't unload the plugin object here. The loader |
|
42 // has to do this for us. Without this kind of destruction idiom, |
|
43 // the view framework can potentially unload an ECOM plugin dll whilst |
|
44 // there are still child views (Created by the plugin) that are registered |
|
45 // with the view framework. If this occurs, the plugin code segment isn't |
|
46 // loaded anymore and so there is no way to run the subsequent destructor |
|
47 // code => exception. |
|
48 } |
|
49 |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CGSPluginInterface::NewL() |
|
53 // Two-phased constructor. |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 EXPORT_C CGSPluginInterface* CGSPluginInterface::NewL( TUid aImplementationUid, |
|
57 TAny* aInitParams ) |
|
58 { |
|
59 TAny* ptr; |
|
60 TInt32 keyOffset = _FOFF( CGSPluginInterface, iDtor_ID_Key ); |
|
61 ptr = REComSession::CreateImplementationL( aImplementationUid, |
|
62 keyOffset, |
|
63 aInitParams ); |
|
64 |
|
65 CGSPluginInterface* plugin = REINTERPRET_CAST( CGSPluginInterface*, ptr ); |
|
66 |
|
67 return plugin; |
|
68 } |
|
69 |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // CGSPluginInterface::PluginProviderCategory() |
|
73 // |
|
74 // |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 EXPORT_C TInt CGSPluginInterface::PluginProviderCategory() const |
|
78 { |
|
79 return EGSPluginProvider3rdParty; |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CGSPluginInterface::CustomOperationL() |
|
84 // |
|
85 // |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 EXPORT_C TAny* CGSPluginInterface::CustomOperationL( |
|
89 TAny* /*aParam1*/, |
|
90 TAny* /*aParam2*/ ) |
|
91 { |
|
92 return NULL; |
|
93 }; |
|
94 |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // CGSPluginInterface::Visible() |
|
98 // |
|
99 // |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 EXPORT_C TBool CGSPluginInterface::Visible() const |
|
103 { |
|
104 return ETrue; |
|
105 } |
|
106 |
|
107 |
|
108 // ----------------------------------------------------------------------------- |
|
109 // CGSPluginInterface::CreateIconL() |
|
110 // |
|
111 // |
|
112 // ----------------------------------------------------------------------------- |
|
113 // |
|
114 EXPORT_C CGulIcon* CGSPluginInterface::CreateIconL( |
|
115 const TUid aIconType ) |
|
116 { |
|
117 TParse parse; |
|
118 parse.Set( KGSDefaultIconFileName, &KDC_BITMAP_DIR, NULL ); |
|
119 TFileName fileName( parse.FullName() ); |
|
120 CGulIcon* icon = NULL; |
|
121 |
|
122 if( aIconType == KGSIconTypeLbxItem ) |
|
123 { |
|
124 icon = AknsUtils::CreateGulIconL( |
|
125 AknsUtils::SkinInstance(), |
|
126 KAknsIIDQgnPropSetDeviceSub, |
|
127 fileName, |
|
128 EMbmGsfwiconQgn_prop_set_default_sub, |
|
129 EMbmGsfwiconQgn_prop_set_default_sub_mask ); |
|
130 } |
|
131 else if( aIconType == KGSIconTypeTab ) |
|
132 { |
|
133 } |
|
134 else if( aIconType == KGSIconTypeDColumn ) |
|
135 { |
|
136 } |
|
137 else // Unknown type |
|
138 { |
|
139 } |
|
140 return icon; |
|
141 } |
|
142 |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // CGSPluginInterface::GetValue() |
|
146 // |
|
147 // Empty implementation just to minimize plugin implementor work. |
|
148 // ----------------------------------------------------------------------------- |
|
149 // |
|
150 EXPORT_C void CGSPluginInterface::GetValue( const TGSPluginValueKeys aKey, |
|
151 TDes& aValue ) |
|
152 { |
|
153 switch( aKey ) |
|
154 { |
|
155 case EGSPluginKeySettingsItemValueString: |
|
156 |
|
157 _LIT( KStr, "" ); |
|
158 aValue.Append( KStr ); |
|
159 break; |
|
160 |
|
161 default: |
|
162 _LIT( KEmptyStr, "" ); |
|
163 aValue.Append( KEmptyStr ); |
|
164 break; |
|
165 } |
|
166 } |
|
167 |
|
168 |
|
169 // ----------------------------------------------------------------------------- |
|
170 // CGSPluginInterface::HandleSelection() |
|
171 // |
|
172 // Default implementation just to minimize plugin implementor work. |
|
173 // On default activate plugin. |
|
174 // ----------------------------------------------------------------------------- |
|
175 // |
|
176 EXPORT_C void CGSPluginInterface::HandleSelection( |
|
177 const TGSSelectionTypes /*aSelectionType*/ ) |
|
178 { |
|
179 // There is nothing pluginInterface can do if activating view fails. |
|
180 TRAP_IGNORE( AppUi()->ActivateLocalViewL( Id() ) ); |
|
181 |
|
182 } |
|
183 |
|
184 |
|
185 // ----------------------------------------------------------------------------- |
|
186 // CGSPluginInterface::ItemType() |
|
187 // |
|
188 // Default implementation just to minimize plugin implementor work. |
|
189 // Default value EGSItemTypeSingleLarge |
|
190 // ----------------------------------------------------------------------------- |
|
191 // |
|
192 EXPORT_C TGSListboxItemTypes CGSPluginInterface::ItemType() |
|
193 { |
|
194 return EGSItemTypeSingleLarge; |
|
195 } |
|
196 |
|
197 |
|
198 // ----------------------------------------------------------------------------- |
|
199 // CGSPluginInterface::ResetSelectedItemIndex() |
|
200 // |
|
201 // |
|
202 // ----------------------------------------------------------------------------- |
|
203 // |
|
204 EXPORT_C void CGSPluginInterface::ResetSelectedItemIndex() |
|
205 { |
|
206 // Default implementation does nothing. |
|
207 } |
|
208 |
|
209 |
|
210 // ----------------------------------------------------------------------------- |
|
211 // CGSPluginInterface::TGSMenuActivationItems() |
|
212 // |
|
213 // |
|
214 // ----------------------------------------------------------------------------- |
|
215 // |
|
216 EXPORT_C TGSMenuActivationItems CGSPluginInterface::MenuActivationItem() |
|
217 { |
|
218 // This default item will be the one read from the resource file. |
|
219 return EGSMenuActivationItemDefault; |
|
220 } |
|
221 |
|
222 // ----------------------------------------------------------------------------- |
|
223 // CGSPluginInterface::SetOrder() |
|
224 // |
|
225 // |
|
226 // ----------------------------------------------------------------------------- |
|
227 // |
|
228 EXPORT_C void CGSPluginInterface::SetOrder( TInt aOrder ) |
|
229 { |
|
230 iOrder = aOrder; |
|
231 } |
|
232 |
|
233 |
|
234 // ----------------------------------------------------------------------------- |
|
235 // CGSPluginInterface::GetEcomDestructorKey() |
|
236 // |
|
237 // |
|
238 // ----------------------------------------------------------------------------- |
|
239 // |
|
240 EXPORT_C TUid CGSPluginInterface::GetEcomDestructorKey() |
|
241 { |
|
242 return iDtor_ID_Key; |
|
243 } |
|
244 |
|
245 // End of File |
|