160 if( !aData.IsDirty() ) |
155 if( !aData.IsDirty() ) |
161 { |
156 { |
162 return; |
157 return; |
163 } |
158 } |
164 |
159 |
165 CMenuItem* item( iEngine->FetchMenuItemL( aData.MenuItem() ) ); |
160 CMenuItem* item = NULL; |
|
161 TRAP_IGNORE ( item = iEngine->FetchMenuItemL( aData.MenuItem() ) ); |
|
162 |
166 CleanupStack::PushL( item ); |
163 CleanupStack::PushL( item ); |
167 |
164 |
168 // One widget item has iDataCount number of elements |
165 // One widget item has iDataCount number of elements |
169 for ( TInt i = 0; i < iDataCount; i++ ) |
166 for ( TInt i = 0; i < iDataCount; i++ ) |
170 { |
167 { |
171 if ( iContentModel[i].type == KAiContentTypeBitmap ) |
168 if ( iContentModel[i].type == KAiContentTypeBitmap ) |
172 { |
169 { |
173 //Publish image |
170 //Publish image |
174 if ( aObserver.CanPublish( *this, i, aIndex ) ) |
171 if ( aObserver.CanPublish( *this, i, aIndex ) ) |
175 { |
172 { |
176 CGulIcon* icon( iEngine->ItemIconL( *item, |
173 CGulIcon* icon( iEngine->ItemIconL( item, |
177 TPtrC16( ( const TText16* ) iContentModel[ i ].cid ) ) ); |
174 TPtrC16( ( const TText16* ) iContentModel[ i ].cid ) ) ); |
178 |
175 |
179 aObserver.PublishPtr( *this, i, icon , aIndex ); |
176 aObserver.PublishPtr( *this, i, icon , aIndex ); |
180 } |
177 } |
181 } |
178 } |
182 else if ( iContentModel[i].type == KAiContentTypeText ) |
179 else if ( iContentModel[i].type == KAiContentTypeText ) |
183 { |
180 { |
184 //Publish text |
181 //Publish text |
185 if ( aObserver.CanPublish( *this, i, aIndex ) ) |
182 if ( aObserver.CanPublish( *this, i, aIndex ) ) |
186 { |
183 { |
187 TPtrC name( iEngine->ItemTextL( *item, |
184 TPtrC name( iEngine->ItemTextL( item, |
188 TPtrC16( ( const TText16* ) iContentModel[ i ].cid ) ) ); |
185 TPtrC16( ( const TText16* ) iContentModel[ i ].cid ) ) ); |
189 |
186 |
190 aObserver.Publish( *this, i, name, aIndex ); |
187 aObserver.Publish( *this, i, name, aIndex ); |
191 } |
188 } |
192 } |
189 } |
200 // |
197 // |
201 // ---------------------------------------------------------------------------- |
198 // ---------------------------------------------------------------------------- |
202 // |
199 // |
203 void CMCSPlugin::Start( TStartReason aReason ) |
200 void CMCSPlugin::Start( TStartReason aReason ) |
204 { |
201 { |
205 if( aReason == EPluginStartup ) |
202 if ( aReason == EPluginStartup ) |
206 { |
203 { |
207 TRAP_IGNORE( iEngine->CreateBkmMenuItemsL() ); |
204 TRAP_IGNORE( iEngine->CreateRuntimeMenuItemsL() ); |
208 } |
205 } |
209 } |
206 } |
210 |
207 |
211 // ---------------------------------------------------------------------------- |
208 // ---------------------------------------------------------------------------- |
212 // CMCSPlugin::Stop |
209 // CMCSPlugin::Stop |
213 // |
210 // |
214 // ---------------------------------------------------------------------------- |
211 // ---------------------------------------------------------------------------- |
215 // |
212 // |
216 void CMCSPlugin::Stop( TStopReason /*aReason*/ ) |
213 void CMCSPlugin::Stop( TStopReason aReason ) |
217 { |
214 { |
|
215 if( aReason == EPluginShutdown ) |
|
216 { |
|
217 TRAP_IGNORE( iEngine->CleanMCSItemsL() ); |
|
218 } |
218 } |
219 } |
219 |
220 |
220 // ---------------------------------------------------------------------------- |
221 // ---------------------------------------------------------------------------- |
221 // CMCSPlugin::Resume |
222 // CMCSPlugin::Resume |
222 // |
223 // |