equal
deleted
inserted
replaced
33 #include "xnviewdata.h" |
33 #include "xnviewdata.h" |
34 #include "xnviewmanager.h" |
34 #include "xnviewmanager.h" |
35 #include "xnoomsyshandler.h" |
35 #include "xnoomsyshandler.h" |
36 #include "xnpanic.h" |
36 #include "xnpanic.h" |
37 |
37 |
|
38 #include "debug.h" |
|
39 |
38 // Constants |
40 // Constants |
|
41 _LIT8( KLockingStatusLocked, "locked" ); |
39 |
42 |
40 // ============================ LOCAL FUNCTIONS ================================ |
43 // ============================ LOCAL FUNCTIONS ================================ |
41 |
44 |
42 // ============================ MEMBER FUNCTIONS =============================== |
45 // ============================ MEMBER FUNCTIONS =============================== |
43 // ----------------------------------------------------------------------------- |
46 // ----------------------------------------------------------------------------- |
130 { |
133 { |
131 return KErrNoMemory; |
134 return KErrNoMemory; |
132 } |
135 } |
133 |
136 |
134 iFlags.Clear( EIsEmpty ); |
137 iFlags.Clear( EIsEmpty ); |
135 iFlags.Set( EIsRemovable ); |
138 |
136 |
|
137 TInt err( KErrNone ); |
139 TInt err( KErrNone ); |
138 |
140 |
139 TRAP( err, err = iManager.Composer().ComposeWidgetL( *this ) ); |
141 TRAP( err, err = iManager.Composer().ComposeWidgetL( *this ) ); |
140 |
142 |
141 if ( err == KErrNone ) |
143 if ( err == KErrNone ) |
222 // CXnPluginData::LoadPublishers() |
224 // CXnPluginData::LoadPublishers() |
223 // |
225 // |
224 // ----------------------------------------------------------------------------- |
226 // ----------------------------------------------------------------------------- |
225 // |
227 // |
226 TInt CXnPluginData::LoadPublishers( TInt aReason ) |
228 TInt CXnPluginData::LoadPublishers( TInt aReason ) |
227 { |
229 { |
|
230 __PRINTS( "*** CXnPluginData::LoadPublishers" ); |
|
231 |
228 TInt err( KErrNone ); |
232 TInt err( KErrNone ); |
229 |
233 |
230 TRAP( err, |
234 TRAP( err, |
231 for ( TInt i = 0; i < iContentSourceNodes.Count(); i++ ) |
235 for ( TInt i = 0; i < iContentSourceNodes.Count(); i++ ) |
232 { |
236 { |
248 { |
252 { |
249 // Not allowed to remove even it fails |
253 // Not allowed to remove even it fails |
250 return KErrNone; |
254 return KErrNone; |
251 } |
255 } |
252 |
256 |
|
257 __PRINTS( "*** CXnPluginData::LoadPublishers - done" ); |
|
258 |
253 return err; |
259 return err; |
254 } |
260 } |
255 |
261 |
256 // ----------------------------------------------------------------------------- |
262 // ----------------------------------------------------------------------------- |
257 // CXnPluginData::DestroyPublishers |
263 // CXnPluginData::DestroyPublishers |
258 // Remove data plugins associated to the plugin |
264 // Remove data plugins associated to the plugin |
259 // ----------------------------------------------------------------------------- |
265 // ----------------------------------------------------------------------------- |
260 // |
266 // |
261 void CXnPluginData::DestroyPublishers() |
267 void CXnPluginData::DestroyPublishers() |
262 { |
268 { |
|
269 __PRINTS( "*** CXnPluginData::DestroyPublishers" ); |
|
270 |
263 if ( Occupied() ) |
271 if ( Occupied() ) |
264 { |
272 { |
265 // If not all plugins loaded yet |
273 // If not all plugins loaded yet |
266 iLoader->Cancel(); |
274 iLoader->Cancel(); |
267 |
275 |
268 TRAP_IGNORE( DoDestroyPublishersL() ); |
276 TRAP_IGNORE( DoDestroyPublishersL() ); |
269 |
277 |
270 User::Heap().Compress(); |
278 User::Heap().Compress(); |
271 } |
279 } |
|
280 |
|
281 __PRINTS( "*** CXnPluginData::DestroyPublishers - done" ); |
272 } |
282 } |
273 |
283 |
274 // ----------------------------------------------------------------------------- |
284 // ----------------------------------------------------------------------------- |
275 // CXnPluginData::VirginPublishers |
285 // CXnPluginData::VirginPublishers |
276 // |
286 // |
286 // Remove data plugins associated to the plugin |
296 // Remove data plugins associated to the plugin |
287 // ----------------------------------------------------------------------------- |
297 // ----------------------------------------------------------------------------- |
288 // |
298 // |
289 void CXnPluginData::DoDestroyPublishersL() |
299 void CXnPluginData::DoDestroyPublishersL() |
290 { |
300 { |
|
301 __TIME_MARK( time ); |
|
302 |
291 for ( TInt i = 0; i < iContentSourceNodes.Count(); i++ ) |
303 for ( TInt i = 0; i < iContentSourceNodes.Count(); i++ ) |
292 { |
304 { |
293 CXnNodeAppIf& plugin( iContentSourceNodes[i]->AppIfL() ); |
305 CXnNodeAppIf& plugin( iContentSourceNodes[i]->AppIfL() ); |
294 |
306 |
295 // Destruction is synchronous |
307 // Destruction is synchronous |
296 iManager.AppUiAdapter().DestroyPublisher( |
308 iManager.AppUiAdapter().DestroyPublisher( |
297 plugin, EAiFwPluginShutdown ); |
309 plugin, EAiFwPluginShutdown ); |
298 } |
310 } |
|
311 |
|
312 __TIME_ENDMARK( "CXnPluginData::DoDestroyPublishersL, done", time ); |
299 } |
313 } |
300 |
314 |
301 // ----------------------------------------------------------------------------- |
315 // ----------------------------------------------------------------------------- |
302 // CXnPluginData::SetConfigurationIdL() |
316 // CXnPluginData::SetConfigurationIdL() |
303 // ----------------------------------------------------------------------------- |
317 // ----------------------------------------------------------------------------- |
581 Flush(); |
595 Flush(); |
582 |
596 |
583 // Takes ownership |
597 // Takes ownership |
584 iPluginId = id; |
598 iPluginId = id; |
585 |
599 |
586 iFlags.Set( EIsEmpty ); |
600 iFlags.Set( EIsEmpty ); |
587 iFlags.Clear( EIsRemovable ); |
|
588 } |
601 } |
589 |
602 |
590 // ----------------------------------------------------------------------------- |
603 // ----------------------------------------------------------------------------- |
591 // CXnPluginData::SetIsDisplayingPopup() |
604 // CXnPluginData::SetIsDisplayingPopup() |
592 // |
605 // |
617 TBool CXnPluginData::IsDisplayingPopup() const |
630 TBool CXnPluginData::IsDisplayingPopup() const |
618 { |
631 { |
619 return ( iPopupNodes.Count() > 0 ); |
632 return ( iPopupNodes.Count() > 0 ); |
620 } |
633 } |
621 |
634 |
|
635 // ----------------------------------------------------------------------------- |
|
636 // CXnPluginData::PopupNodesL() |
|
637 // ----------------------------------------------------------------------------- |
|
638 // |
|
639 void CXnPluginData::PopupNodesL( RPointerArray< CXnNode >& aList ) const |
|
640 { |
|
641 for ( TInt i = 0; i < iPopupNodes.Count(); i++ ) |
|
642 { |
|
643 aList.AppendL( iPopupNodes[i] ); |
|
644 } |
|
645 } |
|
646 |
622 //------------------------------------------------------------------------------ |
647 //------------------------------------------------------------------------------ |
623 // CXnPluginData::ShowContentRemovedError() |
648 // CXnPluginData::ShowContentRemovedError() |
624 // |
649 // |
625 //------------------------------------------------------------------------------ |
650 //------------------------------------------------------------------------------ |
626 // |
651 // |
655 void CXnPluginData::ShowOutOfMemError() |
680 void CXnPluginData::ShowOutOfMemError() |
656 { |
681 { |
657 TRAP_IGNORE( ViewManager().OomSysHandler().HandlePotentialOomL() ); |
682 TRAP_IGNORE( ViewManager().OomSysHandler().HandlePotentialOomL() ); |
658 } |
683 } |
659 |
684 |
|
685 // ----------------------------------------------------------------------------- |
|
686 // CXnViewData::SetLockingStatus |
|
687 // |
|
688 // ----------------------------------------------------------------------------- |
|
689 // |
|
690 void CXnPluginData::SetLockingStatus( const TDesC8& aStatus ) |
|
691 { |
|
692 if ( aStatus.CompareF( KLockingStatusLocked ) == 0 ) |
|
693 { |
|
694 iFlags.Clear( EIsRemovable ); |
|
695 } |
|
696 else |
|
697 { |
|
698 iFlags.Set( EIsRemovable ); |
|
699 } |
|
700 } |
|
701 |
660 // End of file |
702 // End of file |