15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 // System includes |
18 // System includes |
19 #include <bautils.h> |
19 #include <bautils.h> |
20 #include <e32std.h> |
|
21 #include <e32property.h> |
20 #include <e32property.h> |
22 #include <coemain.h> |
|
23 #include <avkon.rsg> |
|
24 #include <ecom/ecom.h> |
21 #include <ecom/ecom.h> |
25 #include <ecom/implementationproxy.h> |
22 #include <ecom/implementationproxy.h> |
26 #include <data_caging_path_literals.hrh> |
|
27 #include <centralrepository.h> |
23 #include <centralrepository.h> |
28 #include <activeidle2domainpskeys.h> |
24 #include <activeidle2domainpskeys.h> |
29 #include <aipspropertyobserver.h> |
25 #include <aipspropertyobserver.h> |
30 #include <eikstart.h> |
26 #include <eikstart.h> |
31 #include <AknLayout2ScalableDef.h> |
|
32 #include <avkondomainpskeys.h> |
27 #include <avkondomainpskeys.h> |
33 #include <AknDlgShut.h> |
28 #include <AknDlgShut.h> |
34 |
29 |
35 // User includes |
30 // User includes |
|
31 #include <aifwstatehandler.h> |
|
32 #include <hscontentpublisher.h> |
|
33 #include <hspublisherinfo.h> |
36 #include "nativeuicontroller.h" |
34 #include "nativeuicontroller.h" |
37 #include "ainativeui.hrh" |
35 #include "ainativeui.hrh" |
38 #include "application.h" |
36 #include "application.h" |
39 #include "appui.h" |
37 #include "appui.h" |
40 #include "aiutility.h" |
38 #include "aiutility.h" |
41 #include "aistrparser.h" |
39 #include "aistrparser.h" |
42 #include "aidevicestatuscontentmodel.h" |
40 #include "aidevicestatuscontentmodel.h" |
43 #include "aipropertyextension.h" |
|
44 #include "aistatuspanel.h" |
41 #include "aistatuspanel.h" |
45 #include "ainativerenderer.h" |
42 #include "ainativerenderer.h" |
46 #include "aititlepanerenderer.h" |
43 #include "aititlepanerenderer.h" |
47 #include "ainavipanerenderer.h" |
44 #include "ainavipanerenderer.h" |
48 #include "aidialogrenderer.h" |
45 #include "aidialogrenderer.h" |
49 #include "aisoftkeyrenderer.h" |
46 #include "aisoftkeyrenderer.h" |
50 #include "ainotifierrenderer.h" |
47 #include "ainotifierrenderer.h" |
51 #include "aitoolbarrenderer.h" |
|
52 #include "ainativeuiplugins.h" |
48 #include "ainativeuiplugins.h" |
53 #include "activeidle2domaincrkeys.h" |
49 #include "activeidle2domaincrkeys.h" |
54 #include "aistatuspanetouchui.h" |
50 #include "aistatuspanetouchui.h" |
55 #include "ainativeuistrings.h" // string literals |
51 #include "ainativeuistrings.h" // string literals |
56 #include "aistrcnv.h" |
52 #include "aistrcnv.h" |
57 #include <aiscutplugindomaincrkeys.h> |
|
58 |
53 |
59 using namespace AiNativeUiController; |
54 using namespace AiNativeUiController; |
60 |
55 |
61 // Constants |
56 // Constants |
62 _LIT( KResourceDrive, "Z:" ); |
57 _LIT( KResourceDrive, "Z:" ); |
73 const TImplementationProxy KImplementationTable[] = |
68 const TImplementationProxy KImplementationTable[] = |
74 { |
69 { |
75 IMPLEMENTATION_PROXY_ENTRY(KImplementationUidNativeUiController, CNativeUiController::NewL) |
70 IMPLEMENTATION_PROXY_ENTRY(KImplementationUidNativeUiController, CNativeUiController::NewL) |
76 }; |
71 }; |
77 |
72 |
78 |
73 // ======== LOCAL FUNCTIONS ======== |
|
74 // ---------------------------------------------------------------------------- |
|
75 // IsDeviceStatus() |
|
76 // |
|
77 // ---------------------------------------------------------------------------- |
|
78 // |
|
79 TBool IsDeviceStatus( const THsPublisherInfo& aInfo ) |
|
80 { |
|
81 return ( aInfo.Name() == KDeviceStatusPluginName && |
|
82 aInfo.Uid() == KDeviceStatusPluginUid ); |
|
83 } |
|
84 |
|
85 // ======== MEMBER FUNCTIONS ======== |
79 // ---------------------------------------------------------------------------- |
86 // ---------------------------------------------------------------------------- |
80 // CNativeUiController::NewL() |
87 // CNativeUiController::NewL() |
|
88 // |
81 // ---------------------------------------------------------------------------- |
89 // ---------------------------------------------------------------------------- |
82 // |
90 // |
83 CNativeUiController* CNativeUiController::NewL() |
91 CNativeUiController* CNativeUiController::NewL() |
84 { |
92 { |
85 CNativeUiController* self = new (ELeave) CNativeUiController; |
93 CNativeUiController* self = new (ELeave) CNativeUiController; |
173 } |
184 } |
174 } |
185 } |
175 |
186 |
176 // ---------------------------------------------------------------------------- |
187 // ---------------------------------------------------------------------------- |
177 // CNativeUiController::CNativeUiController() |
188 // CNativeUiController::CNativeUiController() |
|
189 // |
178 // ---------------------------------------------------------------------------- |
190 // ---------------------------------------------------------------------------- |
179 // |
191 // |
180 CNativeUiController::CNativeUiController() |
192 CNativeUiController::CNativeUiController() |
181 : iResourceOffset( KErrNotFound ) |
193 : iResourceOffset( KErrNotFound ) |
182 { |
194 { |
183 } |
195 } |
184 |
196 |
185 // ---------------------------------------------------------------------------- |
197 // ---------------------------------------------------------------------------- |
|
198 // CNativeUiController::SetAppUi() |
|
199 // |
|
200 // ---------------------------------------------------------------------------- |
|
201 // |
|
202 void CNativeUiController::SetAppUi( CAppUi* aAppUi ) |
|
203 { |
|
204 iAppUi = aAppUi; |
|
205 } |
|
206 |
|
207 // ---------------------------------------------------------------------------- |
186 // CNativeUiController::AddRendererL() |
208 // CNativeUiController::AddRendererL() |
|
209 // |
187 // ---------------------------------------------------------------------------- |
210 // ---------------------------------------------------------------------------- |
188 // |
211 // |
189 void CNativeUiController::AddRendererL( CAiNativeRenderer* aRenderer ) |
212 void CNativeUiController::AddRendererL( CAiNativeRenderer* aRenderer ) |
190 { |
213 { |
191 User::LeaveIfError( iRenderers.Append( aRenderer ) ); |
214 User::LeaveIfError( iRenderers.Append( aRenderer ) ); |
192 } |
215 } |
193 |
216 |
194 // ---------------------------------------------------------------------------- |
217 // ---------------------------------------------------------------------------- |
195 // CNativeUiController::RemoveRenderer() |
218 // CNativeUiController::RemoveRenderer() |
|
219 // |
196 // ---------------------------------------------------------------------------- |
220 // ---------------------------------------------------------------------------- |
197 // |
221 // |
198 TBool CNativeUiController::RemoveRenderer( CAiNativeRenderer *aRenderer, |
222 TBool CNativeUiController::RemoveRenderer( CAiNativeRenderer *aRenderer, |
199 TBool aDelete ) |
223 TBool aDelete ) |
200 { |
224 { |
214 |
238 |
215 return EFalse; |
239 return EFalse; |
216 } |
240 } |
217 |
241 |
218 // ---------------------------------------------------------------------------- |
242 // ---------------------------------------------------------------------------- |
219 // CNativeUiController::ExitTimerCallBack() |
|
220 // ---------------------------------------------------------------------------- |
|
221 // |
|
222 void CNativeUiController::DeleteToolbarRenderer() |
|
223 { |
|
224 if ( iToolbarRenderer ) |
|
225 { |
|
226 RemoveRenderer( iToolbarRenderer ); |
|
227 delete iToolbarRenderer; |
|
228 iToolbarRenderer = NULL; |
|
229 } |
|
230 } |
|
231 |
|
232 // ---------------------------------------------------------------------------- |
|
233 // CNativeUiController::RecreateToolbarRendererL() |
|
234 // ---------------------------------------------------------------------------- |
|
235 // |
|
236 TBool CNativeUiController::RecreateToolbarRendererL() |
|
237 { |
|
238 TBool created( EFalse ); |
|
239 // Remove the old renderer... |
|
240 DeleteToolbarRenderer(); |
|
241 |
|
242 CAknToolbar* toolbar( iAvkonAppUi->CurrentFixedToolbar() ); |
|
243 // ...and create the new if there is an existing toolbar that |
|
244 // we can use |
|
245 if ( toolbar ) |
|
246 { |
|
247 iToolbarRenderer = CAiToolbarRenderer::NewL( *iFwEventHandler, *toolbar); |
|
248 AddRendererL( iToolbarRenderer ); |
|
249 created = ETrue; |
|
250 } |
|
251 |
|
252 return created; |
|
253 } |
|
254 |
|
255 |
|
256 // ---------------------------------------------------------------------------- |
|
257 // CNativeUiController::DoPublish() |
243 // CNativeUiController::DoPublish() |
|
244 // |
258 // ---------------------------------------------------------------------------- |
245 // ---------------------------------------------------------------------------- |
259 // |
246 // |
260 template<class T> |
247 template<class T> |
261 TInt CNativeUiController::DoPublish( MAiPropertyExtension& aPlugin, |
248 TInt CNativeUiController::DoPublish( CHsContentPublisher& aPlugin, |
262 TInt aContent, T& aData, TInt aIndex ) |
249 TInt aContent, T& aData, TInt aIndex ) |
263 { |
250 { |
264 const TAiPublisherInfo* info( NULL ); |
251 const THsPublisherInfo& info( aPlugin.PublisherInfo() ); |
265 |
252 |
266 TRAP_IGNORE( info = aPlugin.PublisherInfoL() ); |
253 if ( !IsDeviceStatus( info ) && info.Namespace() != KNativeUiNamespace ) |
267 |
|
268 if ( !info || info->iNamespace != KNativeUiNamespace ) |
|
269 { |
254 { |
270 return KErrNotSupported; |
255 return KErrNotSupported; |
271 } |
256 } |
272 |
257 |
273 const TInt count( iRenderers.Count() ); |
258 const TInt count( iRenderers.Count() ); |
450 { |
439 { |
451 AddRendererL( CAiSoftKeyRenderer::NewLC() ); |
440 AddRendererL( CAiSoftKeyRenderer::NewLC() ); |
452 CleanupStack::Pop();//CAiSoftKeyRenderer |
441 CleanupStack::Pop();//CAiSoftKeyRenderer |
453 |
442 |
454 // Toolbar shown only when we are not the main ui controller |
443 // Toolbar shown only when we are not the main ui controller |
455 DeleteToolbarRenderer(); |
444 //DeleteToolbarRenderer(); |
456 |
445 |
457 TRAP_IGNORE( |
446 THsPublisherInfo deviceStatus( KDeviceStatusPluginUid, |
458 iAppUi->StartL(); ) |
447 KDeviceStatusPluginName, KNativeUiNamespace ); |
|
448 |
|
449 iPlugins.Append( deviceStatus ); |
|
450 |
|
451 iFwStateHandler->LoadPlugin( deviceStatus, EAiFwSystemStartup ); |
|
452 |
|
453 THsPublisherInfo profile( KProfilePluginUid, |
|
454 KProfilePluginName, KNativeUiNamespace ); |
|
455 |
|
456 iPlugins.Append( profile ); |
|
457 |
|
458 iFwStateHandler->LoadPlugin( profile, EAiFwSystemStartup ); |
|
459 |
|
460 TRAP_IGNORE( iAppUi->StartL() ); |
459 } |
461 } |
460 |
462 |
461 // We need to load the resource file here if we are not main controller. |
463 // We need to load the resource file here if we are not main controller. |
462 // If we are the main controller the loading is done in appui |
464 // If we are the main controller the loading is done in appui |
463 // Also the toolbar renderer is loaded here. |
465 // Also the toolbar renderer is loaded here. |
501 |
503 |
502 iUiLoaded = ETrue; |
504 iUiLoaded = ETrue; |
503 } |
505 } |
504 |
506 |
505 // ---------------------------------------------------------------------------- |
507 // ---------------------------------------------------------------------------- |
506 // CNativeUiController::GetPluginsL() |
|
507 // ---------------------------------------------------------------------------- |
|
508 // |
|
509 void CNativeUiController::GetPluginsL( RAiPublisherInfoArray& aPlugins ) |
|
510 { |
|
511 iPlugins.Reset(); |
|
512 |
|
513 if( iRunningAsMain ) |
|
514 { |
|
515 TAiPublisherInfo shortcutPublisherInfo; |
|
516 shortcutPublisherInfo.iUid = KShortcutPluginUid; |
|
517 shortcutPublisherInfo.iName.Copy( KShortcutPluginName ); |
|
518 shortcutPublisherInfo.iNamespace.Copy( KNativeUiNamespace ); |
|
519 |
|
520 User::LeaveIfError( iPlugins.Append( shortcutPublisherInfo ) ); |
|
521 |
|
522 TAiPublisherInfo deviceStatusPublisherInfo; |
|
523 deviceStatusPublisherInfo.iUid = KDeviceStatusPluginUid; |
|
524 deviceStatusPublisherInfo.iName.Copy( KDeviceStatusPluginName ); |
|
525 deviceStatusPublisherInfo.iNamespace.Copy( KNativeUiNamespace ); |
|
526 |
|
527 User::LeaveIfError( iPlugins.Append( deviceStatusPublisherInfo ) ); |
|
528 |
|
529 TAiPublisherInfo profilePublisherInfo; |
|
530 profilePublisherInfo.iUid = KProfilePluginUid; |
|
531 profilePublisherInfo.iName.Copy( KProfilePluginName ); |
|
532 profilePublisherInfo.iNamespace.Copy( KNativeUiNamespace ); |
|
533 |
|
534 User::LeaveIfError( iPlugins.Append( profilePublisherInfo ) ); |
|
535 |
|
536 // Copy iPlugins to aPlugins |
|
537 aPlugins.ReserveL( aPlugins.Count() + iPlugins.Count() ); |
|
538 |
|
539 for( TInt i = 0; i < iPlugins.Count(); ++i ) |
|
540 { |
|
541 aPlugins.Append( iPlugins[i] ); |
|
542 } |
|
543 } |
|
544 } |
|
545 |
|
546 // ---------------------------------------------------------------------------- |
|
547 // CNativeUiController::GetSettingsL() |
508 // CNativeUiController::GetSettingsL() |
548 // ---------------------------------------------------------------------------- |
509 // |
549 // |
510 // ---------------------------------------------------------------------------- |
550 void CNativeUiController::GetSettingsL( const TAiPublisherInfo& aPubInfo, |
511 // |
|
512 void CNativeUiController::GetSettingsL( const THsPublisherInfo& aPublisherInfo, |
551 RAiSettingsItemArray& aSettings ) |
513 RAiSettingsItemArray& aSettings ) |
552 { |
514 { |
553 if ( aPubInfo.iNamespace != KNativeUiNamespace ) |
515 if ( aPublisherInfo.Namespace() != KNativeUiNamespace ) |
554 { |
516 { |
555 return; |
517 return; |
556 } |
518 } |
557 |
519 |
558 if( iRunningAsMain && aPubInfo.iUid == KShortcutPluginUid ) |
520 if( iRunningAsMain && aPublisherInfo.Uid() == KShortcutPluginUid ) |
559 { |
521 { |
560 RProperty::Set( KPSUidAiInformation, KActiveIdleExtHS_PluginConfChange, 0 ); |
522 RProperty::Set( KPSUidAiInformation, KActiveIdleExtHS_PluginConfChange, 0 ); |
561 |
523 |
562 MAiPluginSettings* settings = AiUtility::CreatePluginSettingsL(); |
524 MAiPluginSettings* settings = AiUtility::CreatePluginSettingsL(); |
563 CleanupDeletePushL( settings ); |
525 CleanupDeletePushL( settings ); |
564 |
526 |
565 MAiPluginSettingsItem& item = settings->AiPluginSettingsItem(); |
527 MAiPluginSettingsItem& item = settings->AiPluginSettingsItem(); |
566 item.SetPublisherId( aPubInfo.iUid ); |
528 item.SetPublisherId( aPublisherInfo.Uid() ); |
567 |
529 |
568 HBufC* appBuf; |
530 HBufC* appBuf; |
569 appBuf = HBufC::NewLC( RProperty::KMaxPropertySize ); |
531 appBuf = HBufC::NewLC( RProperty::KMaxPropertySize ); |
570 TPtr appPtr = appBuf->Des(); |
532 TPtr appPtr = appBuf->Des(); |
571 RProperty::Get( KPSUidAiInformation, KActiveIdleExtHS_LSKLocked, appPtr ); |
533 RProperty::Get( KPSUidAiInformation, KActiveIdleExtHS_LSKLocked, appPtr ); |
617 CleanupStack::PopAndDestroy( app2Buf ); |
579 CleanupStack::PopAndDestroy( app2Buf ); |
618 app2Buf = NULL; |
580 app2Buf = NULL; |
619 |
581 |
620 // In case there are settings in the cenrep the settings |
582 // In case there are settings in the cenrep the settings |
621 // here are overwritten by them |
583 // here are overwritten by them |
622 GetSettingsFromCRL( aPubInfo, aSettings ); |
584 GetSettingsFromCRL( aPublisherInfo, aSettings ); |
623 CleanupStack::Pop( settings ); |
585 CleanupStack::Pop( settings ); |
624 } |
586 } |
625 } |
587 } |
626 |
588 |
627 // ---------------------------------------------------------------------------- |
589 // ---------------------------------------------------------------------------- |
628 // CNativeUiController::GetSettingsFromCRL() |
590 // CNativeUiController::GetSettingsFromCRL() |
629 // ---------------------------------------------------------------------------- |
591 // |
630 // |
592 // ---------------------------------------------------------------------------- |
631 void CNativeUiController::GetSettingsFromCRL( const TAiPublisherInfo& aPubInfo, |
593 // |
632 RAiSettingsItemArray &aPluginSettings ) |
594 void CNativeUiController::GetSettingsFromCRL( |
633 { |
595 const THsPublisherInfo& aPublisherInfo, |
634 if ( aPubInfo.iNamespace != KNativeUiNamespace ) |
596 RAiSettingsItemArray &aPluginSettings ) |
|
597 { |
|
598 if ( aPublisherInfo.Namespace() != KNativeUiNamespace ) |
635 { |
599 { |
636 return; |
600 return; |
637 } |
601 } |
638 |
602 |
639 /* |
603 /* |
705 { |
669 { |
706 MAiPluginSettings *setting = aPluginSettings[j]; |
670 MAiPluginSettings *setting = aPluginSettings[j]; |
707 MAiPluginSettingsItem& item = setting->AiPluginSettingsItem(); |
671 MAiPluginSettingsItem& item = setting->AiPluginSettingsItem(); |
708 |
672 |
709 // Existing setting found => replace it |
673 // Existing setting found => replace it |
710 if ( item.Key() == settingId && item.PublisherId() == aPubInfo.iUid ) |
674 if ( item.Key() == settingId && item.PublisherId() == aPublisherInfo.Uid() ) |
711 { |
675 { |
712 item.SetValueL( settingValuePtr, EFalse ); |
676 item.SetValueL( settingValuePtr, EFalse ); |
713 settingFound = ETrue; |
677 settingFound = ETrue; |
714 break; |
678 break; |
715 } |
679 } |
716 } |
680 } |
717 // Existing setting not found => append new one ONLY if we |
681 // Existing setting not found => append new one ONLY if we |
718 // are dealing with the icon overrides |
682 // are dealing with the icon overrides |
|
683 /* NOTE ai_shortcut_command_api has been removed! |
719 if ( !settingFound && ( settingId & KScutFlagBitIconOverride ) ) |
684 if ( !settingFound && ( settingId & KScutFlagBitIconOverride ) ) |
720 { |
685 { |
721 MAiPluginSettings* settings = AiUtility::CreatePluginSettingsL(); |
686 MAiPluginSettings* settings = AiUtility::CreatePluginSettingsL(); |
722 CleanupDeletePushL( settings ); |
687 CleanupDeletePushL( settings ); |
723 MAiPluginSettingsItem& item = settings->AiPluginSettingsItem(); |
688 MAiPluginSettingsItem& item = settings->AiPluginSettingsItem(); |
724 |
689 |
725 item.SetPublisherId( aPubInfo.iUid ); |
690 item.SetPublisherId( aPublisherInfo.Uid() ); |
726 item.SetKey( settingId ); |
691 item.SetKey( settingId ); |
727 item.SetValueL( settingValuePtr, EFalse ); |
692 item.SetValueL( settingValuePtr, EFalse ); |
728 aPluginSettings.Append( settings ); |
693 aPluginSettings.Append( settings ); |
729 |
694 |
730 CleanupStack::Pop( settings ); |
695 CleanupStack::Pop( settings ); |
731 } |
696 } |
|
697 */ |
732 } |
698 } |
733 } |
699 } |
734 } |
700 } |
735 // name of the plugin not found => no more settings |
701 // name of the plugin not found => no more settings |
736 else if (err != KErrNone ) |
702 else if (err != KErrNone ) |
763 } |
730 } |
764 } |
731 } |
765 |
732 |
766 // ---------------------------------------------------------------------------- |
733 // ---------------------------------------------------------------------------- |
767 // CNativeUiController::GetContentObserver() |
734 // CNativeUiController::GetContentObserver() |
|
735 // |
768 // ---------------------------------------------------------------------------- |
736 // ---------------------------------------------------------------------------- |
769 // |
737 // |
770 MAiContentObserver& CNativeUiController::GetContentObserver() |
738 MAiContentObserver& CNativeUiController::GetContentObserver() |
771 { |
739 { |
772 return *this; |
740 return *this; |
773 } |
741 } |
774 |
742 |
775 // ---------------------------------------------------------------------------- |
743 // ---------------------------------------------------------------------------- |
776 // CNativeUiController::SetEventHandler() |
744 // CNativeUiController::SetEventHandler() |
|
745 // |
777 // ---------------------------------------------------------------------------- |
746 // ---------------------------------------------------------------------------- |
778 // |
747 // |
779 void CNativeUiController::SetEventHandler( MAiFwEventHandler& aEventHandler ) |
748 void CNativeUiController::SetEventHandler( MAiFwEventHandler& aEventHandler ) |
780 { |
749 { |
781 iFwEventHandler = &aEventHandler; |
750 iFwEventHandler = &aEventHandler; |
782 } |
751 } |
783 |
752 |
784 // ---------------------------------------------------------------------------- |
753 // ---------------------------------------------------------------------------- |
|
754 // CNativeUiController::SetStateHandler() |
|
755 // |
|
756 // ---------------------------------------------------------------------------- |
|
757 // |
|
758 void CNativeUiController::SetStateHandler( MAiFwStateHandler& aStateHandler ) |
|
759 { |
|
760 iFwStateHandler = &aStateHandler; |
|
761 } |
|
762 |
|
763 // ---------------------------------------------------------------------------- |
785 // CNativeUiController::FwEventHandler() |
764 // CNativeUiController::FwEventHandler() |
|
765 // |
786 // ---------------------------------------------------------------------------- |
766 // ---------------------------------------------------------------------------- |
787 // |
767 // |
788 MAiFwEventHandler* CNativeUiController::FwEventHandler() |
768 MAiFwEventHandler* CNativeUiController::FwEventHandler() |
789 { |
769 { |
790 return iFwEventHandler; |
770 return iFwEventHandler; |
791 } |
771 } |
792 |
772 |
793 // ---------------------------------------------------------------------------- |
773 // ---------------------------------------------------------------------------- |
794 // CNativeUiController::RemovePluginFromUI() |
|
795 // ---------------------------------------------------------------------------- |
|
796 // |
|
797 void CNativeUiController::RemovePluginFromUI( |
|
798 MAiPropertyExtension& /*aPlugin*/ ) |
|
799 { |
|
800 } |
|
801 |
|
802 // ---------------------------------------------------------------------------- |
|
803 // CNativeUiController::MainInterface() |
774 // CNativeUiController::MainInterface() |
|
775 // |
804 // ---------------------------------------------------------------------------- |
776 // ---------------------------------------------------------------------------- |
805 // |
777 // |
806 MAiMainUiController* CNativeUiController::MainInterface() |
778 MAiMainUiController* CNativeUiController::MainInterface() |
807 { |
779 { |
808 return this; |
780 return this; |
809 } |
781 } |
810 |
782 |
811 // ---------------------------------------------------------------------------- |
783 // ---------------------------------------------------------------------------- |
812 // CNativeUiController::SecondaryInterface() |
784 // CNativeUiController::SecondaryInterface() |
|
785 // |
813 // ---------------------------------------------------------------------------- |
786 // ---------------------------------------------------------------------------- |
814 // |
787 // |
815 MAiSecondaryUiController* CNativeUiController::SecondaryInterface() |
788 MAiSecondaryUiController* CNativeUiController::SecondaryInterface() |
816 { |
789 { |
817 return this; |
790 return this; |
818 } |
791 } |
819 |
792 |
820 // ---------------------------------------------------------------------------- |
793 // ---------------------------------------------------------------------------- |
821 // CNativeUiController::RunApplicationL() |
794 // CNativeUiController::RunApplicationL() |
|
795 // |
822 // ---------------------------------------------------------------------------- |
796 // ---------------------------------------------------------------------------- |
823 // |
797 // |
824 void CNativeUiController::RunApplicationL() |
798 void CNativeUiController::RunApplicationL() |
825 { |
799 { |
826 VariateToMainUiController(); |
800 VariateToMainUiController(); |
829 EikStart::RunApplication( &CNativeUiController::NewApplication ) ); |
803 EikStart::RunApplication( &CNativeUiController::NewApplication ) ); |
830 } |
804 } |
831 |
805 |
832 // ---------------------------------------------------------------------------- |
806 // ---------------------------------------------------------------------------- |
833 // CNativeUiController::CoeEnv() |
807 // CNativeUiController::CoeEnv() |
|
808 // |
834 // ---------------------------------------------------------------------------- |
809 // ---------------------------------------------------------------------------- |
835 // |
810 // |
836 CCoeEnv& CNativeUiController::CoeEnv() |
811 CCoeEnv& CNativeUiController::CoeEnv() |
837 { |
812 { |
838 return *CCoeEnv::Static(); |
813 return *CCoeEnv::Static(); |
839 } |
814 } |
840 |
815 |
841 // ---------------------------------------------------------------------------- |
816 // ---------------------------------------------------------------------------- |
842 // CNativeUiController::SetUiFrameworkObserver() |
|
843 // ---------------------------------------------------------------------------- |
|
844 // |
|
845 void CNativeUiController::SetUiFrameworkObserver( |
|
846 MAiUiFrameworkObserver& aObserver ) |
|
847 { |
|
848 iUiFrameworkObserver = &aObserver; |
|
849 } |
|
850 |
|
851 // ---------------------------------------------------------------------------- |
|
852 // CNativeUiController::IsMenuOpen() |
817 // CNativeUiController::IsMenuOpen() |
|
818 // |
853 // ---------------------------------------------------------------------------- |
819 // ---------------------------------------------------------------------------- |
854 // |
820 // |
855 TBool CNativeUiController::IsMenuOpen() |
821 TBool CNativeUiController::IsMenuOpen() |
856 { |
822 { |
857 return CoeEnv().AppUi()->IsDisplayingMenuOrDialog(); |
823 return iAppUi->IsDisplayingMenuOrDialog(); |
858 } |
824 } |
859 |
825 |
860 // ---------------------------------------------------------------------------- |
826 // ---------------------------------------------------------------------------- |
861 // CNativeUiController::SetCoeEnv() |
827 // CNativeUiController::SetCoeEnv() |
|
828 // |
862 // ---------------------------------------------------------------------------- |
829 // ---------------------------------------------------------------------------- |
863 // |
830 // |
864 void CNativeUiController::SetCoeEnv( CCoeEnv& aCoeEnv ) |
831 void CNativeUiController::SetCoeEnv( CCoeEnv& aCoeEnv ) |
865 { |
832 { |
866 iCoeEnv = &aCoeEnv; |
833 iCoeEnv = &aCoeEnv; |
867 } |
834 } |
868 |
835 |
869 // ---------------------------------------------------------------------------- |
836 // ---------------------------------------------------------------------------- |
870 // CNativeUiController::UiFrameworkObserver() |
|
871 // ---------------------------------------------------------------------------- |
|
872 // |
|
873 MAiUiFrameworkObserver* CNativeUiController::UiFrameworkObserver() |
|
874 { |
|
875 return iUiFrameworkObserver; |
|
876 } |
|
877 |
|
878 // ---------------------------------------------------------------------------- |
|
879 // CNativeUiController::HandleResourceChange() |
|
880 // ---------------------------------------------------------------------------- |
|
881 // |
|
882 void CNativeUiController::HandleResourceChange( TInt /*aType*/ ) |
|
883 { |
|
884 } |
|
885 |
|
886 // ---------------------------------------------------------------------------- |
|
887 // CNativeUiController::HandleForegroundEvent() |
|
888 // ---------------------------------------------------------------------------- |
|
889 // |
|
890 void CNativeUiController::HandleForegroundEvent( TBool /*aForeground*/ ) |
|
891 { |
|
892 } |
|
893 |
|
894 // ---------------------------------------------------------------------------- |
|
895 // CNativeUiController::StartTransaction() |
837 // CNativeUiController::StartTransaction() |
|
838 // |
896 // ---------------------------------------------------------------------------- |
839 // ---------------------------------------------------------------------------- |
897 // |
840 // |
898 TInt CNativeUiController::StartTransaction( TInt /*aTxId*/ ) |
841 TInt CNativeUiController::StartTransaction( TInt /*aTxId*/ ) |
899 { |
842 { |
900 return KErrNone; |
843 return KErrNone; |
901 } |
844 } |
902 |
845 |
903 // ---------------------------------------------------------------------------- |
846 // ---------------------------------------------------------------------------- |
904 // CNativeUiController::Commit() |
847 // CNativeUiController::Commit() |
|
848 // |
905 // ---------------------------------------------------------------------------- |
849 // ---------------------------------------------------------------------------- |
906 // |
850 // |
907 TInt CNativeUiController::Commit( TInt /*aTxId*/ ) |
851 TInt CNativeUiController::Commit( TInt /*aTxId*/ ) |
908 { |
852 { |
909 TInt result( KErrNone ); |
853 TInt result( KErrNone ); |
917 return result; |
861 return result; |
918 } |
862 } |
919 |
863 |
920 // ---------------------------------------------------------------------------- |
864 // ---------------------------------------------------------------------------- |
921 // CNativeUiController::CancelTransaction() |
865 // CNativeUiController::CancelTransaction() |
|
866 // |
922 // ---------------------------------------------------------------------------- |
867 // ---------------------------------------------------------------------------- |
923 // |
868 // |
924 TInt CNativeUiController::CancelTransaction( TInt /*aTxId*/ ) |
869 TInt CNativeUiController::CancelTransaction( TInt /*aTxId*/ ) |
925 { |
870 { |
926 return KErrNone; |
871 return KErrNone; |
927 } |
872 } |
928 |
873 |
929 // ---------------------------------------------------------------------------- |
874 // ---------------------------------------------------------------------------- |
930 // CNativeUiController::CanPublish() |
875 // CNativeUiController::CanPublish() |
931 // ---------------------------------------------------------------------------- |
876 // |
932 // |
877 // ---------------------------------------------------------------------------- |
933 TBool CNativeUiController::CanPublish( MAiPropertyExtension& aPlugin, |
878 // |
|
879 TBool CNativeUiController::CanPublish( CHsContentPublisher& aPlugin, |
934 TInt /*aContent*/, TInt /*aIndex*/ ) |
880 TInt /*aContent*/, TInt /*aIndex*/ ) |
935 { |
881 { |
936 const TAiPublisherInfo* info( NULL ); |
882 const THsPublisherInfo& info( aPlugin.PublisherInfo() ); |
937 |
883 |
938 TRAP_IGNORE( info = aPlugin.PublisherInfoL() ); |
884 if ( IsDeviceStatus( info ) ) |
939 |
885 { |
940 if ( !info || info->iNamespace != KNativeUiNamespace ) |
886 return ETrue; |
|
887 } |
|
888 |
|
889 if ( info.Namespace() != KNativeUiNamespace ) |
941 { |
890 { |
942 return EFalse; |
891 return EFalse; |
943 } |
892 } |
944 |
893 |
945 for( TInt i = 0; i < iPlugins.Count(); i++ ) |
894 for( TInt i = 0; i < iPlugins.Count(); i++ ) |
946 { |
895 { |
947 if ( iPlugins[i] == *info ) |
896 if ( iPlugins[i] == info ) |
948 { |
897 { |
949 return ETrue; |
898 return ETrue; |
950 } |
899 } |
951 } |
900 } |
952 |
901 |
953 return EFalse; |
902 return EFalse; |
954 } |
903 } |
955 |
904 |
956 // ---------------------------------------------------------------------------- |
905 // ---------------------------------------------------------------------------- |
957 // CNativeUiController::Publish() |
906 // CNativeUiController::Publish() |
958 // ---------------------------------------------------------------------------- |
907 // |
959 // |
908 // ---------------------------------------------------------------------------- |
960 TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, |
909 // |
|
910 TInt CNativeUiController::Publish( CHsContentPublisher& aPlugin, |
961 TInt aContent, TInt aResource, TInt aIndex ) |
911 TInt aContent, TInt aResource, TInt aIndex ) |
962 { |
912 { |
963 TInt err = DoPublish( aPlugin, aContent, aResource, aIndex ); |
913 TInt err = DoPublish( aPlugin, aContent, aResource, aIndex ); |
964 return err; |
914 return err; |
965 } |
915 } |
966 |
916 |
967 // ---------------------------------------------------------------------------- |
917 // ---------------------------------------------------------------------------- |
968 // CNativeUiController::Publish() |
918 // CNativeUiController::Publish() |
969 // ---------------------------------------------------------------------------- |
919 // |
970 // |
920 // ---------------------------------------------------------------------------- |
971 TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, |
921 // |
|
922 TInt CNativeUiController::Publish( CHsContentPublisher& aPlugin, |
972 TInt aContent, const TDesC16& aText, TInt aIndex ) |
923 TInt aContent, const TDesC16& aText, TInt aIndex ) |
973 { |
924 { |
974 TInt err = DoPublish( aPlugin, aContent, aText, aIndex ); |
925 TInt err = DoPublish( aPlugin, aContent, aText, aIndex ); |
975 return err; |
926 return err; |
976 } |
927 } |
977 |
928 |
978 // ---------------------------------------------------------------------------- |
929 // ---------------------------------------------------------------------------- |
979 // CNativeUiController::Publish() |
930 // CNativeUiController::Publish() |
980 // ---------------------------------------------------------------------------- |
931 // |
981 // |
932 // ---------------------------------------------------------------------------- |
982 TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, |
933 // |
|
934 TInt CNativeUiController::Publish( CHsContentPublisher& aPlugin, |
983 TInt aContent, const TDesC8& aBuf, TInt aIndex ) |
935 TInt aContent, const TDesC8& aBuf, TInt aIndex ) |
984 { |
936 { |
985 TInt err = DoPublish( aPlugin, aContent, aBuf, aIndex ); |
937 TInt err = DoPublish( aPlugin, aContent, aBuf, aIndex ); |
986 return err; |
938 return err; |
987 } |
939 } |
988 |
940 |
989 // ---------------------------------------------------------------------------- |
941 // ---------------------------------------------------------------------------- |
990 // CNativeUiController::Publish() |
942 // CNativeUiController::Publish() |
991 // ---------------------------------------------------------------------------- |
943 // |
992 // |
944 // ---------------------------------------------------------------------------- |
993 TInt CNativeUiController::Publish( MAiPropertyExtension& aPlugin, |
945 // |
|
946 TInt CNativeUiController::Publish( CHsContentPublisher& aPlugin, |
994 TInt aContent, RFile& aFile, TInt aIndex ) |
947 TInt aContent, RFile& aFile, TInt aIndex ) |
995 { |
948 { |
996 TInt err = DoPublish( aPlugin, aContent, aFile, aIndex ); |
949 TInt err = DoPublish( aPlugin, aContent, aFile, aIndex ); |
997 return err; |
950 return err; |
998 } |
951 } |
999 |
952 |
1000 // ---------------------------------------------------------------------------- |
953 // ---------------------------------------------------------------------------- |
1001 // CNativeUiController::Clean() |
954 // CNativeUiController::Clean() |
1002 // ---------------------------------------------------------------------------- |
955 // |
1003 // |
956 // ---------------------------------------------------------------------------- |
1004 TInt CNativeUiController::Clean( MAiPropertyExtension& aPlugin, |
957 // |
|
958 TInt CNativeUiController::Clean( CHsContentPublisher& aPlugin, |
1005 TInt aContent, TInt /*aIndex*/ ) |
959 TInt aContent, TInt /*aIndex*/ ) |
1006 { |
960 { |
1007 const TInt count( iRenderers.Count() ); |
961 const TInt count( iRenderers.Count() ); |
1008 |
962 |
1009 for( TInt i( 0 ); i < count; i++ ) |
963 for( TInt i( 0 ); i < count; i++ ) |
1014 return KErrNone; |
968 return KErrNone; |
1015 } |
969 } |
1016 |
970 |
1017 // ---------------------------------------------------------------------------- |
971 // ---------------------------------------------------------------------------- |
1018 // CNativeUiController::Extension() |
972 // CNativeUiController::Extension() |
|
973 // |
1019 // ---------------------------------------------------------------------------- |
974 // ---------------------------------------------------------------------------- |
1020 // |
975 // |
1021 TAny* CNativeUiController::Extension( TUid /*aUid*/ ) |
976 TAny* CNativeUiController::Extension( TUid /*aUid*/ ) |
1022 { |
977 { |
1023 return NULL; |
978 return NULL; |
1024 } |
979 } |
1025 |
980 |
1026 // ---------------------------------------------------------------------------- |
981 // ---------------------------------------------------------------------------- |
1027 // CNativeUiController::RequiresSubscription() |
982 // CNativeUiController::RequiresSubscription() |
|
983 // |
1028 // ---------------------------------------------------------------------------- |
984 // ---------------------------------------------------------------------------- |
1029 // |
985 // |
1030 TBool CNativeUiController::RequiresSubscription( |
986 TBool CNativeUiController::RequiresSubscription( |
1031 const TAiPublisherInfo& aPublisherInfo ) const |
987 const THsPublisherInfo& aPublisherInfo ) const |
1032 { |
988 { |
1033 if ( aPublisherInfo.iNamespace == KNativeUiNamespace ) |
989 if ( IsDeviceStatus( aPublisherInfo ) || |
|
990 aPublisherInfo.Namespace() == KNativeUiNamespace ) |
1034 { |
991 { |
1035 // Targeted to this content renderer |
992 // Targeted to this content renderer |
1036 return ETrue; |
993 return ETrue; |
1037 } |
994 } |
1038 |
995 |
1041 |
998 |
1042 // ---------------------------------------------------------------------------- |
999 // ---------------------------------------------------------------------------- |
1043 // CNativeUiController::SetProperty() |
1000 // CNativeUiController::SetProperty() |
1044 // ---------------------------------------------------------------------------- |
1001 // ---------------------------------------------------------------------------- |
1045 // |
1002 // |
1046 TInt CNativeUiController::SetProperty( MAiPropertyExtension& /*aPlugin*/, |
1003 TInt CNativeUiController::SetProperty( CHsContentPublisher& /*aPlugin*/, |
1047 const TDesC8& /*aElementId*/, |
1004 const TDesC8& /*aElementId*/, |
1048 const TDesC8& /*aPropertyName*/, |
1005 const TDesC8& /*aPropertyName*/, |
1049 const TDesC8& /*aPropertyValue*/ ) |
1006 const TDesC8& /*aPropertyValue*/ ) |
1050 { |
1007 { |
1051 |
|
1052 return KErrNotSupported; |
1008 return KErrNotSupported; |
1053 } |
1009 } |
1054 |
1010 |
1055 // ---------------------------------------------------------------------------- |
1011 // ---------------------------------------------------------------------------- |
1056 // CNativeUiController::SetProperty() |
1012 // CNativeUiController::SetProperty() |
1057 // ---------------------------------------------------------------------------- |
1013 // ---------------------------------------------------------------------------- |
1058 // |
1014 // |
1059 TInt CNativeUiController::SetProperty(MAiPropertyExtension& /*aPlugin*/, |
1015 TInt CNativeUiController::SetProperty(CHsContentPublisher& /*aPlugin*/, |
1060 const TDesC8& /*aElementId*/, |
1016 const TDesC8& /*aElementId*/, |
1061 const TDesC8& /*aPropertyName*/, |
1017 const TDesC8& /*aPropertyName*/, |
1062 const TDesC8& /*aPropertyValue*/, |
1018 const TDesC8& /*aPropertyValue*/, |
1063 MAiContentObserver::TValueType /*aValueType*/) |
1019 MAiContentObserver::TValueType /*aValueType*/) |
1064 { |
1020 { |
1065 return KErrNotSupported; |
1021 return KErrNotSupported; |
1066 } |
1022 } |
1067 |
1023 |
1068 // ---------------------------------------------------------------------------- |
1024 // ---------------------------------------------------------------------------- |
1069 // CNativeUiController::NewApplication() |
1025 // CNativeUiController::NewApplication() |
|
1026 // |
1070 // ---------------------------------------------------------------------------- |
1027 // ---------------------------------------------------------------------------- |
1071 // |
1028 // |
1072 CApaApplication* CNativeUiController::NewApplication() |
1029 CApaApplication* CNativeUiController::NewApplication() |
1073 { |
1030 { |
1074 CNativeUiController* self = |
1031 CNativeUiController* self = |