# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1264500675 -7200 # Node ID ff572005ac2309eeaea59875c12a2ae588009cba # Parent b7904b40483f2225333d64e9add9b97aebe41ad5 Revision: 201001 Kit: 201004 diff -r b7904b40483f -r ff572005ac23 contentcontrolsrv/hscontentinfo/bwins/hscontentinfo.def --- a/contentcontrolsrv/hscontentinfo/bwins/hscontentinfo.def Mon Jan 18 20:32:13 2010 +0200 +++ b/contentcontrolsrv/hscontentinfo/bwins/hscontentinfo.def Tue Jan 26 12:11:15 2010 +0200 @@ -1,45 +1,46 @@ EXPORTS ?MarshalL@CHsContentInfo@@QAEPAVHBufC8@@XZ @ 1 NONAME ; class HBufC8 * CHsContentInfo::MarshalL(void) - ?CanBeAdded@CHsContentInfo@@QBEHXZ @ 2 NONAME ; int CHsContentInfo::CanBeAdded(void) const - ?SetDescriptionL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 3 NONAME ; void CHsContentInfo::SetDescriptionL(class TDesC16 const &) - ?IconPath@CHsContentInfo@@QBEABVTDesC16@@XZ @ 4 NONAME ; class TDesC16 const & CHsContentInfo::IconPath(void) const - ?SetPluginIdL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 5 NONAME ; void CHsContentInfo::SetPluginIdL(class TDesC8 const &) - ?SetTypeL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 6 NONAME ; void CHsContentInfo::SetTypeL(class TDesC8 const &) - ?SetMaxWidgets@CHsContentInfo@@QAEXH@Z @ 7 NONAME ; void CHsContentInfo::SetMaxWidgets(int) - ?Array@CHsContentInfoArray@@QAEAAV?$RPointerArray@VCHsContentInfo@@@@XZ @ 8 NONAME ; class RPointerArray & CHsContentInfoArray::Array(void) - ?ExternalizeL@CHsContentInfo@@QAEXAAVRWriteStream@@@Z @ 9 NONAME ; void CHsContentInfo::ExternalizeL(class RWriteStream &) - ?Size@CHsContentInfo@@QAEHXZ @ 10 NONAME ; int CHsContentInfo::Size(void) - ?SetNameL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 11 NONAME ; void CHsContentInfo::SetNameL(class TDesC16 const &) - ?InternalizeL@CHsContentInfoArray@@QAEXAAVRReadStream@@@Z @ 12 NONAME ; void CHsContentInfoArray::InternalizeL(class RReadStream &) - ?Size@CHsContentInfoArray@@QAEHXZ @ 13 NONAME ; int CHsContentInfoArray::Size(void) - ?PublisherId@CHsContentInfo@@QBEABVTDesC16@@XZ @ 14 NONAME ; class TDesC16 const & CHsContentInfo::PublisherId(void) const - ?SetInstallationTime@CHsContentInfo@@QAEXAAVTTime@@@Z @ 15 NONAME ; void CHsContentInfo::SetInstallationTime(class TTime &) - ?SetPublisherUidL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 16 NONAME ; void CHsContentInfo::SetPublisherUidL(class TDesC8 const &) - ?NewL@CHsContentInfoArray@@SAPAV1@XZ @ 17 NONAME ; class CHsContentInfoArray * CHsContentInfoArray::NewL(void) - ?Name@CHsContentInfo@@QBEABVTDesC16@@XZ @ 18 NONAME ; class TDesC16 const & CHsContentInfo::Name(void) const - ?SetNameL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 19 NONAME ; void CHsContentInfo::SetNameL(class TDesC8 const &) - ?Type@CHsContentInfo@@QBEABVTDesC8@@XZ @ 20 NONAME ; class TDesC8 const & CHsContentInfo::Type(void) const - ?NewLC@CHsContentInfo@@SAPAV1@XZ @ 21 NONAME ; class CHsContentInfo * CHsContentInfo::NewLC(void) - ?InstallationTime@CHsContentInfo@@QBE?AVTTime@@XZ @ 22 NONAME ; class TTime CHsContentInfo::InstallationTime(void) const - ?NewL@CHsContentInfo@@SAPAV1@AAVRReadStream@@@Z @ 23 NONAME ; class CHsContentInfo * CHsContentInfo::NewL(class RReadStream &) - ?CloneL@CHsContentInfo@@QAEPAV1@XZ @ 24 NONAME ; class CHsContentInfo * CHsContentInfo::CloneL(void) - ?SetCanBeAdded@CHsContentInfo@@QAEXH@Z @ 25 NONAME ; void CHsContentInfo::SetCanBeAdded(int) - ?ExternalizeL@CHsContentInfoArray@@QAEXAAVRWriteStream@@@Z @ 26 NONAME ; void CHsContentInfoArray::ExternalizeL(class RWriteStream &) - ?SetUidL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 27 NONAME ; void CHsContentInfo::SetUidL(class TDesC8 const &) - ?MaxWidgets@CHsContentInfo@@QBEHXZ @ 28 NONAME ; int CHsContentInfo::MaxWidgets(void) const - ?Uid@CHsContentInfo@@QBEABVTDesC8@@XZ @ 29 NONAME ; class TDesC8 const & CHsContentInfo::Uid(void) const - ?MarshalL@CHsContentInfoArray@@QAEPAVHBufC8@@XZ @ 30 NONAME ; class HBufC8 * CHsContentInfoArray::MarshalL(void) - ?SetPublisherIdL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 31 NONAME ; void CHsContentInfo::SetPublisherIdL(class TDesC16 const &) - ?InternalizeL@CHsContentInfo@@QAEXAAVRReadStream@@@Z @ 32 NONAME ; void CHsContentInfo::InternalizeL(class RReadStream &) - ?CanBeRemoved@CHsContentInfo@@QBEHXZ @ 33 NONAME ; int CHsContentInfo::CanBeRemoved(void) const - ?SetCanBeRemoved@CHsContentInfo@@QAEXH@Z @ 34 NONAME ; void CHsContentInfo::SetCanBeRemoved(int) - ?SetIconPathL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 35 NONAME ; void CHsContentInfo::SetIconPathL(class TDesC16 const &) - ?Description@CHsContentInfo@@QBEABVTDesC16@@XZ @ 36 NONAME ; class TDesC16 const & CHsContentInfo::Description(void) const - ?NewL@CHsContentInfo@@SAPAV1@XZ @ 37 NONAME ; class CHsContentInfo * CHsContentInfo::NewL(void) - ?PublisherUid@CHsContentInfo@@QBEABVTDesC8@@XZ @ 38 NONAME ; class TDesC8 const & CHsContentInfo::PublisherUid(void) const - ?NameAs8BitLC@CHsContentInfo@@QBEPAVHBufC8@@XZ @ 39 NONAME ; class HBufC8 * CHsContentInfo::NameAs8BitLC(void) const - ?PluginId@CHsContentInfo@@QBEABVTDesC8@@XZ @ 40 NONAME ; class TDesC8 const & CHsContentInfo::PluginId(void) const - ?NewL@CHsContentInfoArray@@SAPAV1@AAVRReadStream@@@Z @ 41 NONAME ; class CHsContentInfoArray * CHsContentInfoArray::NewL(class RReadStream &) - ?IsWrt@CHsContentInfo@@QBEHXZ @ 42 NONAME ; int CHsContentInfo::IsWrt(void) const - ?SetIsWrt@CHsContentInfo@@QAEXH@Z @ 43 NONAME ; void CHsContentInfo::SetIsWrt(int) + ?IsWrt@CHsContentInfo@@QBEHXZ @ 2 NONAME ; int CHsContentInfo::IsWrt(void) const + ?CanBeAdded@CHsContentInfo@@QBEHXZ @ 3 NONAME ; int CHsContentInfo::CanBeAdded(void) const + ?SetDescriptionL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 4 NONAME ; void CHsContentInfo::SetDescriptionL(class TDesC16 const &) + ?IconPath@CHsContentInfo@@QBEABVTDesC16@@XZ @ 5 NONAME ; class TDesC16 const & CHsContentInfo::IconPath(void) const + ?SetPluginIdL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 6 NONAME ; void CHsContentInfo::SetPluginIdL(class TDesC8 const &) + ?SetTypeL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 7 NONAME ; void CHsContentInfo::SetTypeL(class TDesC8 const &) + ?SetMaxWidgets@CHsContentInfo@@QAEXH@Z @ 8 NONAME ; void CHsContentInfo::SetMaxWidgets(int) + ?Array@CHsContentInfoArray@@QAEAAV?$RPointerArray@VCHsContentInfo@@@@XZ @ 9 NONAME ; class RPointerArray & CHsContentInfoArray::Array(void) + ?SetDescriptionL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 10 NONAME ; void CHsContentInfo::SetDescriptionL(class TDesC8 const &) + ?ExternalizeL@CHsContentInfo@@QAEXAAVRWriteStream@@@Z @ 11 NONAME ; void CHsContentInfo::ExternalizeL(class RWriteStream &) + ?Size@CHsContentInfo@@QAEHXZ @ 12 NONAME ; int CHsContentInfo::Size(void) + ?SetNameL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 13 NONAME ; void CHsContentInfo::SetNameL(class TDesC16 const &) + ?InternalizeL@CHsContentInfoArray@@QAEXAAVRReadStream@@@Z @ 14 NONAME ; void CHsContentInfoArray::InternalizeL(class RReadStream &) + ?Size@CHsContentInfoArray@@QAEHXZ @ 15 NONAME ; int CHsContentInfoArray::Size(void) + ?PublisherId@CHsContentInfo@@QBEABVTDesC16@@XZ @ 16 NONAME ; class TDesC16 const & CHsContentInfo::PublisherId(void) const + ?SetInstallationTime@CHsContentInfo@@QAEXAAVTTime@@@Z @ 17 NONAME ; void CHsContentInfo::SetInstallationTime(class TTime &) + ?SetIsWrt@CHsContentInfo@@QAEXH@Z @ 18 NONAME ; void CHsContentInfo::SetIsWrt(int) + ?SetPublisherUidL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 19 NONAME ; void CHsContentInfo::SetPublisherUidL(class TDesC8 const &) + ?NewL@CHsContentInfoArray@@SAPAV1@XZ @ 20 NONAME ; class CHsContentInfoArray * CHsContentInfoArray::NewL(void) + ?SetNameL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 21 NONAME ; void CHsContentInfo::SetNameL(class TDesC8 const &) + ?Name@CHsContentInfo@@QBEABVTDesC16@@XZ @ 22 NONAME ; class TDesC16 const & CHsContentInfo::Name(void) const + ?Type@CHsContentInfo@@QBEABVTDesC8@@XZ @ 23 NONAME ; class TDesC8 const & CHsContentInfo::Type(void) const + ?NewLC@CHsContentInfo@@SAPAV1@XZ @ 24 NONAME ; class CHsContentInfo * CHsContentInfo::NewLC(void) + ?InstallationTime@CHsContentInfo@@QBE?AVTTime@@XZ @ 25 NONAME ; class TTime CHsContentInfo::InstallationTime(void) const + ?NewL@CHsContentInfo@@SAPAV1@AAVRReadStream@@@Z @ 26 NONAME ; class CHsContentInfo * CHsContentInfo::NewL(class RReadStream &) + ?CloneL@CHsContentInfo@@QAEPAV1@XZ @ 27 NONAME ; class CHsContentInfo * CHsContentInfo::CloneL(void) + ?SetCanBeAdded@CHsContentInfo@@QAEXH@Z @ 28 NONAME ; void CHsContentInfo::SetCanBeAdded(int) + ?ExternalizeL@CHsContentInfoArray@@QAEXAAVRWriteStream@@@Z @ 29 NONAME ; void CHsContentInfoArray::ExternalizeL(class RWriteStream &) + ?SetUidL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 30 NONAME ; void CHsContentInfo::SetUidL(class TDesC8 const &) + ?MaxWidgets@CHsContentInfo@@QBEHXZ @ 31 NONAME ; int CHsContentInfo::MaxWidgets(void) const + ?Uid@CHsContentInfo@@QBEABVTDesC8@@XZ @ 32 NONAME ; class TDesC8 const & CHsContentInfo::Uid(void) const + ?MarshalL@CHsContentInfoArray@@QAEPAVHBufC8@@XZ @ 33 NONAME ; class HBufC8 * CHsContentInfoArray::MarshalL(void) + ?SetPublisherIdL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 34 NONAME ; void CHsContentInfo::SetPublisherIdL(class TDesC16 const &) + ?InternalizeL@CHsContentInfo@@QAEXAAVRReadStream@@@Z @ 35 NONAME ; void CHsContentInfo::InternalizeL(class RReadStream &) + ?CanBeRemoved@CHsContentInfo@@QBEHXZ @ 36 NONAME ; int CHsContentInfo::CanBeRemoved(void) const + ?SetCanBeRemoved@CHsContentInfo@@QAEXH@Z @ 37 NONAME ; void CHsContentInfo::SetCanBeRemoved(int) + ?SetIconPathL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 38 NONAME ; void CHsContentInfo::SetIconPathL(class TDesC16 const &) + ?Description@CHsContentInfo@@QBEABVTDesC16@@XZ @ 39 NONAME ; class TDesC16 const & CHsContentInfo::Description(void) const + ?NewL@CHsContentInfo@@SAPAV1@XZ @ 40 NONAME ; class CHsContentInfo * CHsContentInfo::NewL(void) + ?PublisherUid@CHsContentInfo@@QBEABVTDesC8@@XZ @ 41 NONAME ; class TDesC8 const & CHsContentInfo::PublisherUid(void) const + ?NameAs8BitLC@CHsContentInfo@@QBEPAVHBufC8@@XZ @ 42 NONAME ; class HBufC8 * CHsContentInfo::NameAs8BitLC(void) const + ?PluginId@CHsContentInfo@@QBEABVTDesC8@@XZ @ 43 NONAME ; class TDesC8 const & CHsContentInfo::PluginId(void) const + ?NewL@CHsContentInfoArray@@SAPAV1@AAVRReadStream@@@Z @ 44 NONAME ; class CHsContentInfoArray * CHsContentInfoArray::NewL(class RReadStream &) diff -r b7904b40483f -r ff572005ac23 contentcontrolsrv/hscontentinfo/eabi/hscontentinfo.def --- a/contentcontrolsrv/hscontentinfo/eabi/hscontentinfo.def Mon Jan 18 20:32:13 2010 +0200 +++ b/contentcontrolsrv/hscontentinfo/eabi/hscontentinfo.def Tue Jan 26 12:11:15 2010 +0200 @@ -6,42 +6,43 @@ _ZN14CHsContentInfo13SetCanBeAddedEi @ 5 NONAME _ZN14CHsContentInfo13SetMaxWidgetsEi @ 6 NONAME _ZN14CHsContentInfo15SetCanBeRemovedEi @ 7 NONAME - _ZN14CHsContentInfo15SetDescriptionLERK7TDesC16 @ 8 NONAME - _ZN14CHsContentInfo15SetPublisherIdLERK7TDesC16 @ 9 NONAME - _ZN14CHsContentInfo16SetPublisherUidLERK6TDesC8 @ 10 NONAME - _ZN14CHsContentInfo19SetInstallationTimeER5TTime @ 11 NONAME - _ZN14CHsContentInfo4NewLER11RReadStream @ 12 NONAME - _ZN14CHsContentInfo4NewLEv @ 13 NONAME - _ZN14CHsContentInfo4SizeEv @ 14 NONAME - _ZN14CHsContentInfo5NewLCEv @ 15 NONAME - _ZN14CHsContentInfo6CloneLEv @ 16 NONAME - _ZN14CHsContentInfo7SetUidLERK6TDesC8 @ 17 NONAME - _ZN14CHsContentInfo8MarshalLEv @ 18 NONAME - _ZN14CHsContentInfo8SetNameLERK6TDesC8 @ 19 NONAME - _ZN14CHsContentInfo8SetNameLERK7TDesC16 @ 20 NONAME - _ZN14CHsContentInfo8SetTypeLERK6TDesC8 @ 21 NONAME - _ZN19CHsContentInfoArray12ExternalizeLER12RWriteStream @ 22 NONAME - _ZN19CHsContentInfoArray12InternalizeLER11RReadStream @ 23 NONAME - _ZN19CHsContentInfoArray4NewLER11RReadStream @ 24 NONAME - _ZN19CHsContentInfoArray4NewLEv @ 25 NONAME - _ZN19CHsContentInfoArray4SizeEv @ 26 NONAME - _ZN19CHsContentInfoArray5ArrayEv @ 27 NONAME - _ZN19CHsContentInfoArray8MarshalLEv @ 28 NONAME - _ZNK14CHsContentInfo10CanBeAddedEv @ 29 NONAME - _ZNK14CHsContentInfo10MaxWidgetsEv @ 30 NONAME - _ZNK14CHsContentInfo11DescriptionEv @ 31 NONAME - _ZNK14CHsContentInfo11PublisherIdEv @ 32 NONAME - _ZNK14CHsContentInfo12CanBeRemovedEv @ 33 NONAME - _ZNK14CHsContentInfo12NameAs8BitLCEv @ 34 NONAME - _ZNK14CHsContentInfo12PublisherUidEv @ 35 NONAME - _ZNK14CHsContentInfo16InstallationTimeEv @ 36 NONAME - _ZNK14CHsContentInfo3UidEv @ 37 NONAME - _ZNK14CHsContentInfo4NameEv @ 38 NONAME - _ZNK14CHsContentInfo4TypeEv @ 39 NONAME - _ZNK14CHsContentInfo8IconPathEv @ 40 NONAME - _ZNK14CHsContentInfo8PluginIdEv @ 41 NONAME - _ZTI19CHsContentInfoArray @ 42 NONAME - _ZTV19CHsContentInfoArray @ 43 NONAME - _ZN14CHsContentInfo8SetIsWrtEi @ 44 NONAME - _ZNK14CHsContentInfo5IsWrtEv @ 45 NONAME + _ZN14CHsContentInfo15SetDescriptionLERK6TDesC8 @ 8 NONAME + _ZN14CHsContentInfo15SetDescriptionLERK7TDesC16 @ 9 NONAME + _ZN14CHsContentInfo15SetPublisherIdLERK7TDesC16 @ 10 NONAME + _ZN14CHsContentInfo16SetPublisherUidLERK6TDesC8 @ 11 NONAME + _ZN14CHsContentInfo19SetInstallationTimeER5TTime @ 12 NONAME + _ZN14CHsContentInfo4NewLER11RReadStream @ 13 NONAME + _ZN14CHsContentInfo4NewLEv @ 14 NONAME + _ZN14CHsContentInfo4SizeEv @ 15 NONAME + _ZN14CHsContentInfo5NewLCEv @ 16 NONAME + _ZN14CHsContentInfo6CloneLEv @ 17 NONAME + _ZN14CHsContentInfo7SetUidLERK6TDesC8 @ 18 NONAME + _ZN14CHsContentInfo8MarshalLEv @ 19 NONAME + _ZN14CHsContentInfo8SetIsWrtEi @ 20 NONAME + _ZN14CHsContentInfo8SetNameLERK6TDesC8 @ 21 NONAME + _ZN14CHsContentInfo8SetNameLERK7TDesC16 @ 22 NONAME + _ZN14CHsContentInfo8SetTypeLERK6TDesC8 @ 23 NONAME + _ZN19CHsContentInfoArray12ExternalizeLER12RWriteStream @ 24 NONAME + _ZN19CHsContentInfoArray12InternalizeLER11RReadStream @ 25 NONAME + _ZN19CHsContentInfoArray4NewLER11RReadStream @ 26 NONAME + _ZN19CHsContentInfoArray4NewLEv @ 27 NONAME + _ZN19CHsContentInfoArray4SizeEv @ 28 NONAME + _ZN19CHsContentInfoArray5ArrayEv @ 29 NONAME + _ZN19CHsContentInfoArray8MarshalLEv @ 30 NONAME + _ZNK14CHsContentInfo10CanBeAddedEv @ 31 NONAME + _ZNK14CHsContentInfo10MaxWidgetsEv @ 32 NONAME + _ZNK14CHsContentInfo11DescriptionEv @ 33 NONAME + _ZNK14CHsContentInfo11PublisherIdEv @ 34 NONAME + _ZNK14CHsContentInfo12CanBeRemovedEv @ 35 NONAME + _ZNK14CHsContentInfo12NameAs8BitLCEv @ 36 NONAME + _ZNK14CHsContentInfo12PublisherUidEv @ 37 NONAME + _ZNK14CHsContentInfo16InstallationTimeEv @ 38 NONAME + _ZNK14CHsContentInfo3UidEv @ 39 NONAME + _ZNK14CHsContentInfo4NameEv @ 40 NONAME + _ZNK14CHsContentInfo4TypeEv @ 41 NONAME + _ZNK14CHsContentInfo5IsWrtEv @ 42 NONAME + _ZNK14CHsContentInfo8IconPathEv @ 43 NONAME + _ZNK14CHsContentInfo8PluginIdEv @ 44 NONAME + _ZTI19CHsContentInfoArray @ 45 NONAME + _ZTV19CHsContentInfoArray @ 46 NONAME diff -r b7904b40483f -r ff572005ac23 contentcontrolsrv/hscontentinfo/src/hscontentinfo.cpp --- a/contentcontrolsrv/hscontentinfo/src/hscontentinfo.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/contentcontrolsrv/hscontentinfo/src/hscontentinfo.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -376,6 +376,17 @@ return iInstallationTime; } +// --------------------------------------------------------------------------- +// CHsContentInfo::SetDescriptionL +// --------------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetDescriptionL( const TDesC8& aDescription ) + { + delete iDescription; + iDescription = NULL; + iDescription = CnvUtfConverter::ConvertToUnicodeFromUtf8L( aDescription ); + } + // ----------------------------------------------------------------------- // CHsContentInfo::SetDescriptionL() // ----------------------------------------------------------------------- @@ -384,7 +395,6 @@ { delete iDescription; iDescription = NULL; - iDescription = aDescription.AllocL(); } diff -r b7904b40483f -r ff572005ac23 contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/chswiplugin.mmp --- a/contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/chswiplugin.mmp Mon Jan 18 20:32:13 2010 +0200 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/chswiplugin.mmp Tue Jan 26 12:11:15 2010 +0200 @@ -29,6 +29,8 @@ SOURCEPATH ../src SOURCE chswiplugin.cpp +SOURCE chswiusbhandler.cpp +SOURCE chswiusbobserver.cpp SOURCEPATH ../data START RESOURCE chswiplugin.rss @@ -49,6 +51,10 @@ LIBRARY apgrfx.lib LIBRARY apparc.lib +LIBRARY PlatformEnv.lib +LIBRARY efsrv.lib + LIBRARY liwservicehandler.lib //AIW Framework +LIBRARY bafl.lib // CDesC16ArrayFlat //end of file diff -r b7904b40483f -r ff572005ac23 contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswimassmodeobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswimassmodeobserver.h Tue Jan 26 12:11:15 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + +#ifndef CHSWIMASSMODEOBSERVER_H_ +#define CHSWIMASSMODEOBSERVER_H_ + + +/** + * Mass storage mode observer. + */ +class MCHSwiMassModeObserver + { +public: + /** + * Sets Mass Storage Mode + * @param aMode Mass Storage mode + */ + virtual void SetMassStorageMode( TBool aMode ) = 0; + + /** + * Sets Mass Storage Mode + * @returns Mass Storage mode + */ + virtual TBool IsMassStorageMode() = 0; + + /** + * Handles ending of mass storage mode (e.g. unplugging usb cable when in mass storage mode) + */ + virtual void HandleMassStorageModeEndEvent() = 0; + + /* + * Handles successful drive scan, which has been executed asynchronously after either: + * - Explicitly postponed drive scan, or + * - Error recovery from synchronous drive scan. + */ + virtual void HandleSuccessfulAsynchDriveScan() = 0; + }; + +#endif /* CHSWIMASSMODEOBSERVER_H_ */ diff -r b7904b40483f -r ff572005ac23 contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h --- a/contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h Mon Jan 18 20:32:13 2010 +0200 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h Tue Jan 26 12:11:15 2010 +0200 @@ -21,16 +21,21 @@ #include #include +#include "chswimassmodeobserver.h" + class MLiwInterface; class CLiwGenericParamList; +class CCHSwiUsbHandler; +class CCHSwiUsbObserver; + /** * Active Data plugin for SIS installation events. * * @since S60 S60 v3.1 */ class CCHSwiPlugin: public CContentHarvesterPlugin, - MApaAppListServObserver + MApaAppListServObserver, MCHSwiMassModeObserver { public: @@ -53,6 +58,13 @@ void UpdateL(); private: + + // from MCHSwiMassModeObserver + void SetMassStorageMode( TBool aMode ); + TBool IsMassStorageMode(); + void HandleMassStorageModeEndEvent(); + void HandleSuccessfulAsynchDriveScan(); + // from MApaAppListServObserver void HandleAppListEvent( TInt aEvent ); @@ -67,16 +79,23 @@ */ CCHSwiPlugin( MLiwInterface* aInterface ); - - /** - * This function removes publishers from database when - * an applicaion is uninstalled or when the MMC is removed. + /** + * Removes publishers from database when an applicaion + * is uninstalled or when the MMC is removed. */ void UpdateWidgetsL(); - + /** + * Removes widgets. + * @param aWidgets Widgets list. + */ void RemoveWidgetsL( CLiwGenericParamList* aWidgets ); + /** + * Removes single widget. + * @param aType Widget type. + * @param aContentId Widget UID. + */ void RemoveWidgetL( const TDesC& aType, const TDesC& aContentId ); @@ -87,17 +106,42 @@ * An interface to Content Publisher Service */ MLiwInterface* iCPSInterface; - - + /** * AppArc session. * Own. */ RApaLsSession iApaLsSession; - CApaAppListNotifier* iNotifier; ///< Change notifier. Own. + /** + * File session. + */ + RFs iFs; + + /** + * Change notifier. + * Own. + */ + CApaAppListNotifier* iNotifier; + + /** + * Mass storage mode handler. + * Own. + */ + CCHSwiUsbHandler* iUsbHandler; + + /** + * Disk observer for monitoring status of mass drive. + * Own. + */ + CCHSwiUsbObserver* iUsbObserver; + + /** + * Mass storage mode flag. + */ + TBool iMassStorageMode; + }; - }; + #endif // C_CCHSWIPLUGIN_H - diff -r b7904b40483f -r ff572005ac23 contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiusbhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiusbhandler.h Tue Jan 26 12:11:15 2010 +0200 @@ -0,0 +1,163 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + +#ifndef C_CCHSWIUSBHANDLER_H +#define C_CCHSWIUSBHANDLER_H + +// INCLUDES +#include +#include +#include + + + + +// FORWARD DECLARATION +class MCHSwiMassModeObserver; + + +/* + * Inherited CActive, performs a asynchronous checks for mass storage mode + * + * @since 3.1 + */ +class CCHSwiUsbHandler : public CActive + { +public: + /** + * Two-phased constructor. + * @param aPlugin Owning plugin. + * @param aFs File session. + */ + static CCHSwiUsbHandler* NewL( MCHSwiMassModeObserver* aMassModeObserver, + RFs& aFs ); + + /** + * Destructor. + */ + virtual ~CCHSwiUsbHandler(); + + /** + * Performs synchronous drive scan. Checks whether Mass Drive is available. + * If it available: observer's Mass Mode flag is set to EFalse. + * If it is not available: Mass Mode flag is set to ETrue. + * In case of error, the check is postponed to be done again in RunL and Mass + * Mode flag is set to ETrue. + */ + void SynchronousDriveScan(); + + /** + * Performs postponed drive scan. Checks whether Mass Drive is available. + * If it available: observer's Mass Mode flag is set to EFalse. + * If it is not available: Mass Mode flag is set to ETrue. + * In case of error, the check is postponed to be done again in RunL and Mass + * Mode flag is set to ETrue. + */ + void PostponedDriveScan(); + +protected: + + /** + * Handles timer events to start drive scan. + */ + void RunL(); + + /** + * RunL error handling. + * @param aError Error. + */ + TInt RunError( TInt aError ); + + /** + * Cancels notifications. + */ + void DoCancel(); + +private: + + /** + * no copy constructor + */ + CCHSwiUsbHandler( const CCHSwiUsbHandler& ); + + /** + * no assignment + */ + CCHSwiUsbHandler& operator=( const CCHSwiUsbHandler& ); + + /** + * C++ default constructor + */ + CCHSwiUsbHandler( MCHSwiMassModeObserver* aMassModeObserver, RFs& aFs ); + + /** + * Symbian default constructor. + */ + void ConstructL(); + + /** + * Scans drives to check mass storage mode. + */ + TInt ScanDrives( TInt& aDriveFlags ); + + /** + * Handles drive access errors by launching new postponed scan. + */ + void HandleDriveError(); + + /** + * Scans drives and updates Mass Mode flag in the observer. + * @param aFlagsValid indicates whether current iDriveFlags are valid + * (they become invalid in case of an error). + */ + TInt ScanDrivesAndUpdateFlag( TBool aFlagsValid ); + + /** + * Updates mass mode flag in observer. + */ + TInt UpdateMassModeFlag(); + +private: + /** + * Error from last drive scan. + */ + TInt iLastDriveScanError; + + /** + * Observer. + */ + MCHSwiMassModeObserver* iMassModeObserver; + + /** + * File session. Not owned. + */ + RFs iFs; + + /** + * Drive flags obtained in last drive scan. Every bit indicates presence + * of given drive. This member is used for drive access optimalization - + * if flags are valid (i.e. no error occured) + */ + TInt iDriveFlags; + + /** + * Timer for postponed drive scan. + */ + RTimer iTimer; + }; + +#endif // #ifndef C_CCHSWIUSBHANDLER_H diff -r b7904b40483f -r ff572005ac23 contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiusbobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiusbobserver.h Tue Jan 26 12:11:15 2010 +0200 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + +#ifndef C_CCHSWIUSBOBSERVER_H +#define C_CCHSWIUSBOBSERVER_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATION +class CCHSwiUsbHandler; + +/* + * Observes RFs for RawDiskWrite events (these are also triggered when + * (un)mounting drive; RFs does not provide better, more specific + * notifications for mount and dismount). + * + * After receiving notification, calls + * CCHSwiUsbHandler::PostponedDriveScan() and does not subscribe to + * further notifcations. It is up to the plugin to call + * CCHSwiUsbObserver::Start() after a successful drive scan. + * + * @since 3.1 + */ +class CCHSwiUsbObserver : public CActive + { +public: + /** + * Two-phased constructor. + * @param aFs File session. + */ + static CCHSwiUsbObserver* NewL( CCHSwiUsbHandler* aHandler, RFs& aFs ); + + /** + * Destructor. + */ + virtual ~CCHSwiUsbObserver(); + + /** + * Active object start. + */ + void Start(); + +protected: + + /** + * Handle RFs notifications. + */ + void RunL(); + + /** + * RunL error handling. + * @param aError Error. + */ + TInt RunError( TInt aError ); + + /** + * Cancels notifications. + */ + void DoCancel(); + +private: + + /** + * no copy constructor + */ + CCHSwiUsbObserver( const CCHSwiUsbObserver& ); + + /** + * no assignment + */ + CCHSwiUsbObserver& operator=( const CCHSwiUsbObserver& ); + + /** + * C++ default constructor + */ + CCHSwiUsbObserver( CCHSwiUsbHandler* aHandler, RFs& aFs ); + + /** + * Symbian default constructor. + */ + void ConstructL(); + +private: + + /** + * File Session. + */ + RFs iFs; + + /** + * Usb handler to perform postponed checks for mass storage mode. + */ + CCHSwiUsbHandler* iUsbHandler; + }; + +#endif // #ifndef C_CCHSWIUSBOBSERVER_H diff -r b7904b40483f -r ff572005ac23 contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiplugin.cpp --- a/contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiplugin.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiplugin.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -21,13 +21,18 @@ #include #include -#include +#include + #include "cpglobals.h" +#include "chswiusbhandler.h" +#include "chswiusbobserver.h" _LIT( KHsWidgetPublisher, "hswidgetpublisher"); _LIT( KHsPublisher, "ai3templatedwidget" ); _LIT8( KWidgetUid, "widget_uid"); +const TInt KWidgetArrayGran = 8; + // Map the interface UIDs to implementation factory functions // ============================= LOCAL FUNCTIONS =============================== @@ -69,6 +74,12 @@ { iNotifier = CApaAppListNotifier::NewL( this, CActive::EPriorityStandard ); User::LeaveIfError( iApaLsSession.Connect() ); + User::LeaveIfError( iFs.Connect() ); + + iUsbHandler = CCHSwiUsbHandler::NewL( this, iFs ); + + iUsbObserver = CCHSwiUsbObserver::NewL( iUsbHandler, iFs ); + iUsbObserver->Start(); } // ---------------------------------------------------------------------------- @@ -92,8 +103,11 @@ // CCHSwiPlugin::~CCHSwiPlugin() { + delete iNotifier; + delete iUsbHandler; + delete iUsbObserver; iApaLsSession.Close(); - delete iNotifier; + iFs.Close(); } // ---------------------------------------------------------------------------- @@ -117,28 +131,48 @@ } // ---------------------------------------------------------------------------- +// CCHSwiPlugin::HandleMassStorageModeEndEvent +// (refer to MCHSwiMassModeObserver declaration). +// ---------------------------------------------------------------------------- +// +void CCHSwiPlugin::HandleMassStorageModeEndEvent() + { + TRAP_IGNORE( UpdateWidgetsL() ); + } + +// ---------------------------------------------------------------------------- +// CCHSwiPlugin::HandleSuccessfulAsynchDriveScan +// (refer to MCHSwiMassModeObserver declaration). +// ---------------------------------------------------------------------------- +// +void CCHSwiPlugin::HandleSuccessfulAsynchDriveScan() + { + iUsbObserver->Start(); + } + +// ---------------------------------------------------------------------------- // CCHSwiPlugin::UpdateWidgetsL // MMC watcher callback. // ---------------------------------------------------------------------------- // void CCHSwiPlugin::UpdateWidgetsL() { - CLiwGenericParamList* inparam = CLiwGenericParamList::NewLC( ); - CLiwGenericParamList* outparam = CLiwGenericParamList::NewLC( ); - inparam->AppendL( TLiwGenericParam( KType, TLiwVariant( KPublisher ) ) ); - CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); - - filter->InsertL( KPublisherId, TLiwVariant( KHsWidgetPublisher )); - filter->InsertL( KContentType, TLiwVariant( KHsPublisher )); - inparam->AppendL( TLiwGenericParam( KFilter, TLiwVariant( filter ) ) ); - - iCPSInterface->ExecuteCmdL( KGetList, *inparam, *outparam ); - - RemoveWidgetsL( outparam ); - - CleanupStack::PopAndDestroy( filter ); - CleanupStack::PopAndDestroy( outparam ); - CleanupStack::PopAndDestroy( inparam ); + CLiwGenericParamList* inparam = CLiwGenericParamList::NewLC( ); + CLiwGenericParamList* outparam = CLiwGenericParamList::NewLC( ); + inparam->AppendL( TLiwGenericParam( KType, TLiwVariant( KPublisher ) ) ); + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + + filter->InsertL( KPublisherId, TLiwVariant( KHsWidgetPublisher )); + filter->InsertL( KContentType, TLiwVariant( KHsPublisher )); + inparam->AppendL( TLiwGenericParam( KFilter, TLiwVariant( filter ) ) ); + + iCPSInterface->ExecuteCmdL( KGetList, *inparam, *outparam ); + + RemoveWidgetsL( outparam ); + + CleanupStack::PopAndDestroy( filter ); + CleanupStack::PopAndDestroy( outparam ); + CleanupStack::PopAndDestroy( inparam ); } // ---------------------------------------------------------------------------- @@ -149,14 +183,19 @@ void CCHSwiPlugin::RemoveWidgetsL( CLiwGenericParamList* aWidgets ) { TInt pos ( 0 ); - aWidgets->FindFirst( pos, KResults ); - if( pos != KErrNotFound ) + aWidgets->FindFirst( pos, KResults ); + + if ( pos != KErrNotFound ) { + CDesC16ArrayFlat* notFoundWidgets = new (ELeave) CDesC16ArrayFlat( KWidgetArrayGran ); + CleanupStack::PushL( notFoundWidgets ); + TLiwVariant variant = (*aWidgets)[pos].Value(); variant.PushL(); CLiwIterable* iterable = variant.AsIterable(); iterable->Reset(); - if( iterable->NextL( variant ) ) + + while ( iterable->NextL( variant ) ) { CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); variant.Get( *map ); @@ -173,8 +212,7 @@ { if( map->FindL( KContentId, variant ) ) { - RemoveWidgetL( KPublisher, variant.AsDes() ); - RemoveWidgetL( KCpData, variant.AsDes() ); + notFoundWidgets->AppendL( variant.AsDes() ); } } } @@ -182,8 +220,26 @@ } CleanupStack::PopAndDestroy( map ); } - CleanupStack::PopAndDestroy(&variant); + + if ( notFoundWidgets->Count() > 0 ) + { + iUsbHandler->SynchronousDriveScan(); + + if ( !IsMassStorageMode() ) + { + for ( TInt i = 0; i < notFoundWidgets->Count(); i++ ) + { + RemoveWidgetL( KPublisher, (*notFoundWidgets)[i] ); + RemoveWidgetL( KCpData, (*notFoundWidgets)[i] ); + } + } + } + + CleanupStack::PopAndDestroy( &variant ); + CleanupStack::PopAndDestroy( notFoundWidgets ); } + + } // ---------------------------------------------------------------------------- @@ -211,4 +267,24 @@ CleanupStack::PopAndDestroy( inparam ); } +// ---------------------------------------------------------------------------- +// CCHSwiPlugin::SetMassStorageMode +// Sets Mass Storage mode. +// ---------------------------------------------------------------------------- +// +void CCHSwiPlugin::SetMassStorageMode( TBool aMode ) + { + iMassStorageMode = aMode; + } + +// ---------------------------------------------------------------------------- +// CCHSwiPlugin::IsMassStorageMode +// Gets Mass Storage mode. +// ---------------------------------------------------------------------------- +// +TBool CCHSwiPlugin::IsMassStorageMode() + { + return iMassStorageMode; + } + // End of File diff -r b7904b40483f -r ff572005ac23 contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiusbhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiusbhandler.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -0,0 +1,307 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Software Installer plug-in usb handler +* +*/ + + +// INCLUDE FILES + +#include "chswiusbhandler.h" +#include "chswiplugin.h" +#include "chswimassmodeobserver.h" +#include + +// CONSTANTS +const TInt KCallBackDelay = 5000000; + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::NewL() +// two-phase constructor +// ---------------------------------------------------------------------------- +// +CCHSwiUsbHandler* CCHSwiUsbHandler::NewL( + MCHSwiMassModeObserver* aMassModeObserver, + RFs& aFs ) + { + CCHSwiUsbHandler* self = + new(ELeave) CCHSwiUsbHandler( aMassModeObserver, aFs ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::CCHSwiUsbHandler() +// C++ default constructor +// ---------------------------------------------------------------------------- +// +CCHSwiUsbHandler::CCHSwiUsbHandler( MCHSwiMassModeObserver* aMassModeObserver, + RFs& aFs ) + : CActive( CActive::EPriorityUserInput ), + iLastDriveScanError( KErrNone ), + iMassModeObserver( aMassModeObserver ), + iFs( aFs ), + iDriveFlags( 0 ) + { + CActiveScheduler::Add( this ); + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::ConstructL() +// Symbian default constructor +// ---------------------------------------------------------------------------- +// +void CCHSwiUsbHandler::ConstructL() + { + User::LeaveIfError( iTimer.CreateLocal() ); + + iLastDriveScanError = ScanDrivesAndUpdateFlag( EFalse ); + + if ( iLastDriveScanError != KErrNone ) + { + HandleDriveError(); + } + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::~CCHSwiUsbHandler() +// destructor +// ---------------------------------------------------------------------------- +// +CCHSwiUsbHandler::~CCHSwiUsbHandler() + { + Cancel(); + iTimer.Close(); + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::SynchronousDriveScan() +// Performs synchronous drive scan. Checks whether Mass Drive is available +// and updates the flag in observer. +// ---------------------------------------------------------------------------- +// +void CCHSwiUsbHandler::SynchronousDriveScan() + { + iLastDriveScanError = ScanDrivesAndUpdateFlag( iLastDriveScanError == KErrNone ); + + if ( iLastDriveScanError != KErrNone ) + { + HandleDriveError(); + } + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::PostponedDriveScan() +// Starts postponed drive scan. +// ---------------------------------------------------------------------------- +// +void CCHSwiUsbHandler::PostponedDriveScan() + { + Cancel(); + iTimer.After( iStatus, KCallBackDelay ); + SetActive(); + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::RunL() +// Handles postponed drive scan. +// Executed either after call to PostponedDriveScan or in case of drive reading +// errors in SynchronousDriveScan or ConstructL. +// ---------------------------------------------------------------------------- +// +void CCHSwiUsbHandler::RunL() + { + TBool massModeBeforeScan = iMassModeObserver->IsMassStorageMode(); + TInt errorBeforeScan = iLastDriveScanError; + + SynchronousDriveScan(); + + if ( iLastDriveScanError == KErrNone ) + { + iMassModeObserver->HandleSuccessfulAsynchDriveScan(); + + // CCHSwiUsbObserver can't detect app uninstall when app had been installed on removable + // memory card, the memory card was removed during mass mode, and then mass + // mode was deactivated. + // Additionaly, we need to update widgets when recovering from error. + if ( !iMassModeObserver->IsMassStorageMode() && + ( massModeBeforeScan || errorBeforeScan != KErrNone ) ) + { + iMassModeObserver->HandleMassStorageModeEndEvent(); + } + } + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::HandleDriveError() +// Handles drive access errors by launching new postponed scan. +// ---------------------------------------------------------------------------- +void CCHSwiUsbHandler::HandleDriveError() + { + Cancel(); + iMassModeObserver->SetMassStorageMode( ETrue ); + + iTimer.After( iStatus, KCallBackDelay ); + SetActive(); + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::ScanDrivesAndUpdateFlag() +// Scans drives and updates Mass Mode flag in the observer. +// ---------------------------------------------------------------------------- +TInt CCHSwiUsbHandler::ScanDrivesAndUpdateFlag( TBool aFlagsValid ) + { + TInt error( KErrNone ); + + if( aFlagsValid ) + { + // iDriveFlags is valid, we can use deltaDriveFlags to avoid + // unnecessary calls to DriveInfo::GetDriveStatus + TInt driveFlags = 0; + TInt deltaDriveFlags = 0; + + error = ScanDrives( driveFlags ); + + if ( error == KErrNone ) + { + deltaDriveFlags = iDriveFlags ^ driveFlags; + iDriveFlags = driveFlags; + } + + if ( deltaDriveFlags ) + { + error = UpdateMassModeFlag(); + } + } + else + { + error = ScanDrives( iDriveFlags ); + + if ( error == KErrNone ) + { + error = UpdateMassModeFlag(); + } + } + + return error; + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::UpdateMassModeFlag() +// Updates Mass Mode flag in the observer. +// ---------------------------------------------------------------------------- +TInt CCHSwiUsbHandler::UpdateMassModeFlag() + { + TInt flags = iDriveFlags; + TBool massMemoryPresent = EFalse; + + for( TInt DriveNo = EDriveA + 1 ; DriveNo <= EDriveY; DriveNo++ ) + { + flags = flags >> 1; + if( flags & 01 ) + { + TUint status( 0 ); + TInt error = DriveInfo::GetDriveStatus( iFs, DriveNo, status ); + + if( error != KErrNone ) + { + return error; + } + + if( ( status & DriveInfo::EDriveExternallyMountable ) + && ( status & DriveInfo::EDriveInternal ) ) + { + // Internal Memory + massMemoryPresent = ETrue; + break; + } + } + } + + iMassModeObserver->SetMassStorageMode( !massMemoryPresent ); + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::RunError() +// Ignore errors from RunL. +// ---------------------------------------------------------------------------- +// +TInt CCHSwiUsbHandler::RunError( TInt /* aError */ ) + { + return KErrNone; // indicates error was handled + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::DoCancel() +// Cancel the MMC event handler +// ---------------------------------------------------------------------------- +void CCHSwiUsbHandler::DoCancel() + { + iTimer.Cancel(); + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbHandler::ScanDrives( TInt& aDriveFlags ) +// Scans drives and records a bit flag for those that exist and are +// suitable for installing widgets to. +// ---------------------------------------------------------------------------- +// +TInt CCHSwiUsbHandler::ScanDrives( TInt& aDriveFlags ) + { + // List all drives in the system + TDriveList driveList; + TInt error = iFs.DriveList( driveList ); + + if ( KErrNone == error ) + { + for ( TInt driveNumber = EDriveY; + driveNumber >= EDriveA; + driveNumber-- ) + { + // The drives that will be filtered out are the same ones that + // WidgetInstaller filters out in CWidgetUIHandler::SelectDriveL() + if ( (EDriveD == driveNumber) + || !driveList[driveNumber] ) + { + // EDriveD is a temporary drive usually a RAM disk + continue; + } + + TVolumeInfo volInfo; + if ( iFs.Volume( volInfo, driveNumber ) != KErrNone ) + { + // volume is not usable (e.g. no media card inserted) + continue; + } + if ( (volInfo.iDrive.iType == EMediaNotPresent) || + (volInfo.iDrive.iType == EMediaRom) || + (volInfo.iDrive.iType == EMediaRemote) || + (volInfo.iDrive.iDriveAtt & KDriveAttRom) || + (volInfo.iDrive.iDriveAtt & KDriveAttSubsted) ) + { + // not a suitable widget install drive + continue; + } + + // found a usable drive + aDriveFlags |= (1 << driveNumber); + } + } + + return error; + } + diff -r b7904b40483f -r ff572005ac23 contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiusbobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiusbobserver.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + +// INCLUDE FILES + +#include "chswiusbobserver.h" +#include "chswiusbhandler.h" + +// ---------------------------------------------------------------------------- +// CCHSwiUsbObserver::NewL() +// two-phase constructor +// ---------------------------------------------------------------------------- +// +CCHSwiUsbObserver* CCHSwiUsbObserver::NewL( CCHSwiUsbHandler* aHandler, RFs& aFs ) + { + CCHSwiUsbObserver* self = + new(ELeave) CCHSwiUsbObserver( aHandler, aFs ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbObserver::CCHSwiUsbObserver() +// C++ default constructor +// ---------------------------------------------------------------------------- +// +CCHSwiUsbObserver::CCHSwiUsbObserver( CCHSwiUsbHandler* aHandler, RFs& aFs ) + : CActive( CActive::EPriorityUserInput ), + iFs( aFs ), + iUsbHandler( aHandler ) + { + CActiveScheduler::Add( this ); + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbObserver::ConstructL() +// Symbian default constructor +// ---------------------------------------------------------------------------- +// +void CCHSwiUsbObserver::ConstructL() + { + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbObserver::~CCHSwiUsbObserver() +// destructor +// ---------------------------------------------------------------------------- +// +CCHSwiUsbObserver::~CCHSwiUsbObserver() + { + Cancel(); + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbObserver::DoCancel() +// +// ---------------------------------------------------------------------------- +// +void CCHSwiUsbObserver::DoCancel() + { + iFs.NotifyChangeCancel( iStatus ); + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbObserver::Start() +// Start monitoring. +// ---------------------------------------------------------------------------- +// +void CCHSwiUsbObserver::Start() + { + Cancel(); + iFs.NotifyChange( ENotifyDisk, iStatus ); + SetActive(); + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbObserver::RunL() +// Handle notifications of MMC events. +// ---------------------------------------------------------------------------- +// +void CCHSwiUsbObserver::RunL() + { + iUsbHandler->PostponedDriveScan(); + } + +// ---------------------------------------------------------------------------- +// CCHSwiUsbObserver::RunError() +// +// ---------------------------------------------------------------------------- +// +TInt CCHSwiUsbObserver::RunError( TInt /*aError*/) + { + return KErrNone; + } + diff -r b7904b40483f -r ff572005ac23 homescreenpluginsrv/hspsmanager/src/hspsclientrequesthandler.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsclientrequesthandler.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsclientrequesthandler.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -628,7 +628,7 @@ CleanupStack::PushL( pluginIter ); ChspsDomNode* pluginNode = pluginIter->First(); TBool steppingtoConfNode(EFalse); - while(pluginNode && !steppingtoConfNode) + while( pluginNode && !steppingtoConfNode ) { const TDesC8& pluginNodeName = pluginNode->Name(); @@ -643,10 +643,16 @@ } CleanupStack::PopAndDestroy( pluginIter ); - // Copy the plugin configuration to the main document. - ChspsDomNode* rootCopy = pluginNode->CloneL( node->StringPool()); - rootCopy->SetParent( node ); - node->AddChildL( rootCopy ); + if ( pluginNode ) + { + // Copy the plugin configuration to the main document. + ChspsDomNode* rootCopy = pluginNode->CloneL( node->StringPool()); + if ( rootCopy ) + { + rootCopy->SetParent( node ); + node->AddChildL( rootCopy ); + } + } } // !pluginOdt else CleanupStack::PopAndDestroy( pluginOdt ); diff -r b7904b40483f -r ff572005ac23 homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -3557,7 +3557,8 @@ odt->SetProviderNameL( aOdt.ProviderName() ); odt->SetThemeFullNameL( aOdt.ThemeFullName() ); odt->SetThemeShortNameL( aOdt.ThemeShortName() ); - odt->SetThemeVersionL( aOdt.ThemeVersion() ); + odt->SetThemeVersionL( aOdt.ThemeVersion() ); + odt->SetDescriptionL( aOdt.Description() ); odt->SetFlags( aOdt.Flags() ); odt->SetMultiInstance( aOdt.MultiInstance() ); User::LeaveIfError( iDefinitionRepository.GetOdtL( *odt ) ); @@ -3623,6 +3624,7 @@ odt->SetThemeFullNameL( header->ThemeFullName() ); odt->SetThemeShortNameL( header->ThemeShortName() ); odt->SetThemeVersionL( header->ThemeVersion() ); + odt->SetDescriptionL( header->Description() ); odt->SetFlags( header->Flags() ); odt->SetMultiInstance( header->MultiInstance() ); User::LeaveIfError( iDefinitionRepository.GetOdtL( *odt ) ); @@ -3704,16 +3706,18 @@ return err; } - ChspsDomNode* pluginNode = NULL; - ChspsDomNode* configNode = NULL; - for(TInt i = 0; i < aPluginIds.Count() && err == KErrNone; i++ ) + for( TInt i = 0; i < aPluginIds.Count() && err == KErrNone; i++ ) { - pluginNode = - hspsServerUtil::FindPluginNodeL( aOdt, aPluginIds[i] ); + ChspsDomNode* configNode = NULL; + ChspsDomNode* pluginNode = + hspsServerUtil::FindPluginNodeL( aOdt, aPluginIds[i] ); TInt index = 0; - configNode = - hspsServerUtil::FindChildNodeByTagL( KConfigurationElement, *pluginNode, index ); + if ( pluginNode ) + { + configNode = + hspsServerUtil::FindChildNodeByTagL( KConfigurationElement, *pluginNode, index ); + } if( configNode ) { diff -r b7904b40483f -r ff572005ac23 homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -583,42 +583,41 @@ targetFile = targetParser.DriveAndPath(); targetFile.Append( sourceParser.NameAndExt() ); } - - // Make target folder - TInt error = aFs.MkDirAll( aTargetPath ); - if( error == KErrAlreadyExists ) - { - // lets ignore error if directory already exists - error = KErrNone; - } - if( !error ) + + TInt error = KErrNone; + + if ( hspsServerUtil::ResourceCopyIsRelevantL( + aSourceFile, + targetFile, + aFs ) + ) { - // Default to 'copying was not neccessary' - error = KErrAlreadyExists; + // Make target folder + error = aFs.MkDirAll( aTargetPath ); + if( error == KErrAlreadyExists ) + { + // lets ignore error if directory already exists + error = KErrNone; + } - // Check whether the resource needs to be copied - if ( hspsServerUtil::ResourceCopyIsRelevantL( - aSourceFile, - targetFile, - aFs ) - ) + if( !error ) { // Slowish operation error = aFilemanager.Copy( aSourceFile, aTargetPath ); - if( !error ) - { - // Clear readonly file attribs that might be inherited from the source file - aFilemanager.Attribs( - aTargetPath, - 0, - KEntryAttReadOnly, - TTime( 0 ) ); // TTime(0) = preserve original time stamp. - } + } - } // copy op - } + if( !error ) + { + // Clear readonly file attribs that might be inherited from the source file + aFilemanager.Attribs( + aTargetPath, + 0, + KEntryAttReadOnly, + TTime( 0 ) ); // TTime(0) = preserve original time stamp. + } + } return error; } @@ -639,18 +638,11 @@ } // Collect data from files. - - TEntry sourceEntry; - TInt entryError = aFs.Entry( aSource, sourceEntry ); - if( entryError != KErrNone ) - { - // Problem. Do not copy. - return EFalse; - } TEntry targetEntry; - entryError = aFs.Entry( aTarget, targetEntry ); - if( entryError == KErrNotFound ) + TInt entryError = aFs.Entry( aTarget, targetEntry ); + if( entryError == KErrNotFound || + entryError == KErrPathNotFound ) { // Target does not exist. Copy needed. return ETrue; @@ -661,6 +653,14 @@ return EFalse; } + TEntry sourceEntry; + entryError = aFs.Entry( aSource, sourceEntry ); + if( entryError != KErrNone ) + { + // Problem. Do not copy. + return EFalse; + } + TParse sourceParser; sourceParser.Set( aSource, NULL, NULL ); @@ -686,25 +686,21 @@ targetDriveNumber = tmpDriveNumber; } } - - const TInt KTargetExists = BaflUtils::FileExists( aFs, aTarget ); - - // Target exists + size and time stamp identical? - if( KTargetExists && - sourceEntry.iSize == targetEntry.iSize && + + // Size and time stamp identical? + if( sourceEntry.iSize == targetEntry.iSize && sourceEntry.iModified == targetEntry.iModified ) { return EFalse; } // Check required disk space. - TInt requiredDiskSpace = 0; - - if( KTargetExists && sourceEntry.iSize > targetEntry.iSize ) + TInt requiredDiskSpace = 0; + if( sourceEntry.iSize > targetEntry.iSize ) { requiredDiskSpace = sourceEntry.iSize - targetEntry.iSize; } - else if( !KTargetExists ) + else { requiredDiskSpace = sourceEntry.iSize; } @@ -1720,8 +1716,8 @@ { ChspsResource& resource = aODT.ResourceL( resourceIndex ); if ( resource.ConfigurationUid() == aConfUid && - resource.FileName().FindF( KSourcesFolder ) > 0 && - resource.Language() == aActiveLanguage ) + resource.Language() == aActiveLanguage && + resource.FileName().FindF( KSourcesFolder ) > 0 ) { aWidgetResources.Append( &resource ); } diff -r b7904b40483f -r ff572005ac23 homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -895,7 +895,8 @@ odt->SetProviderNameL( header->ProviderName() ); odt->SetThemeFullNameL( header->ThemeFullName() ); odt->SetThemeShortNameL( header->ThemeShortName() ); - odt->SetThemeVersionL( header->ThemeVersion() ); + odt->SetThemeVersionL( header->ThemeVersion() ); + odt->SetDescriptionL( header->Description() ); odt->SetFlags( header->Flags() ); odt->SetMultiInstance( header->MultiInstance() ); @@ -1514,6 +1515,7 @@ odt->SetThemeFullNameL( header->ThemeFullName() ); odt->SetThemeShortNameL( header->ThemeShortName() ); odt->SetThemeVersionL( header->ThemeVersion() ); + odt->SetDescriptionL( header->Description() ); odt->SetFlags( header->Flags() ); odt->SetMultiInstance( header->MultiInstance() ); User::LeaveIfError( iDefinitionRepository->GetOdtL( *odt ) ); @@ -2218,7 +2220,8 @@ if ( localized ) { // Set header's name from the ODT - header->SetThemeFullNameL( odt->ThemeFullName() ); + header->SetThemeFullNameL( odt->ThemeFullName() ); + header->SetDescriptionL( odt->Description() ); } CleanupStack::PopAndDestroy( odt ); diff -r b7904b40483f -r ff572005ac23 homescreenpluginsrv/hspsodt/src/hspsodt.cpp --- a/homescreenpluginsrv/hspsodt/src/hspsodt.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreenpluginsrv/hspsodt/src/hspsodt.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -450,12 +450,15 @@ TInt count = aStream.ReadInt32L(); for (TInt i=0;iInternalizeL(aStream); - iResourceList->AppendL( resource ); - CleanupStack::Pop( resource ); // now owned by array - resource = NULL; + ChspsResource* resource = ChspsResource::NewL(); + CleanupStack::PushL(resource); + resource->InternalizeL(aStream); + if ( iResourceList ) + { + iResourceList->AppendL( resource ); + } + CleanupStack::Pop( resource ); // now owned by array + resource = NULL; } } @@ -722,6 +725,10 @@ { clone->SetPackageVersionL( *iPackageVersion ); } + if( iDescription ) + { + clone->SetDescriptionL( *iDescription ); + } clone->SetOdtLanguage( iLanguage ); clone->SetFlags( iFlags ); diff -r b7904b40483f -r ff572005ac23 homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.h --- a/homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.h Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.h Tue Jan 26 12:11:15 2010 +0200 @@ -35,6 +35,28 @@ */ class MAiContentObserver { +public: // New Enumeration + /** + * CSS Primitive value type + */ + enum TValueType + { + EValueUnknown = 0, + EValueNumber, + EValuePercentage, + EValuePx, + EValueDimension, + EValueString, + EValueIdent, + EValueAttr, + EValueCounter, + EValueRect, + EValueRgbColor, + EValueRgbaColor, + EValueFunction, + EValueUnitValue + }; + public: // New functions /** @@ -250,8 +272,52 @@ * @param aPublsiherInfo Publisher which requires subscription * @return ETrue if subsription is needed, EFalse otherwise */ - virtual TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const = 0; - + virtual TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const = 0; + + /** + * Invoked by the plug-in to change the property value of a specific content. + * value type must be string. + * @param aPlugin - Plug-in property extension interface implementation. + * @param aElementId - id of content selector, MUST correspond + * single content supported by plug-in. The framework + * utilizes the id to find in the plugin xml defintion. + * @param aPropertyName - property name. + * @param aPropertyValue - property value. + * @return - Possible return values: + * - KErrNone - if content reference found. + * - KErrNotFound - if content reference is not found in current + * plugin definition. + * - KErrNotSupported - if content selector is not supported by + * current plugin definition. + */ + virtual TInt SetProperty( MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue ) = 0; + + /** + * Invoked by the plug-in to change the property value of a specific content. + * + * @param aPlugin - Plug-in property extension interface implementation. + * @param aElementId - id of content selector, MUST correspond + * single content supported by plug-in. The framework + * utilizes the id to find in the plugin xml defintion. + * @param aPropertyName - property name. + * @param aPropertyValue - property value. + * @param aValueType - value type. + * @return - Possible return values: + * - KErrNone - if content reference found. + * - KErrNotFound - if content reference is not found in current + * plugin definition. + * - KErrNotSupported - if content selector is not supported by + * current plugin definition. + */ + virtual TInt SetProperty( MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + MAiContentObserver::TValueType aValueType) = 0; + protected: /** * Protected destructor prevents deletion through this interface. diff -r b7904b40483f -r ff572005ac23 homescreensrv_plat/hs_content_control_api/inc/hscontentinfo.h --- a/homescreensrv_plat/hs_content_control_api/inc/hscontentinfo.h Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreensrv_plat/hs_content_control_api/inc/hscontentinfo.h Tue Jan 26 12:11:15 2010 +0200 @@ -253,6 +253,14 @@ IMPORT_C void SetDescriptionL( const TDesC& aDescription ); /** + * Sets this widget's description + * + * @since S60 5.0 + * @param aDescription Description + */ + IMPORT_C void SetDescriptionL( const TDesC8& aDescription ); + + /** * Gets this widget's description * * @since S60 5.0 @@ -394,11 +402,11 @@ * WRT Widget publisher uid, Owned */ HBufC8* iPublisherUid; - - /** - * Flag to indicate whether this is a WRT widget - */ - TBool iIsWrt; + + /** + * Flag to indicate whether this is a WRT widget + */ + TBool iIsWrt; }; #endif // HSCONTENTINFO_H diff -r b7904b40483f -r ff572005ac23 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahtelkeyhandler.h --- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahtelkeyhandler.h Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahtelkeyhandler.h Tue Jan 26 12:11:15 2010 +0200 @@ -52,6 +52,11 @@ void ConstructL(); + /** + * Helper method for AIW attach. + */ + void AttachServiceHandlerL(); + private: CAiwServiceHandler* iServiceHandler; diff -r b7904b40483f -r ff572005ac23 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahtelkeyhandler.cpp --- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahtelkeyhandler.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahtelkeyhandler.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -19,6 +19,7 @@ #include // AIW #include //include\oem #include +#include #include "ahtelkeyhandler.h" #include "ahproperties.hrh" @@ -30,24 +31,6 @@ // --------------------------------------------------------------------------- void CAHTelKeyHandler::ConstructL() { - iServiceHandler = CAiwServiceHandler::NewL( ); - TAiwServiceCommands serviceCommand = KAiwCmdCall; - - //service command used as criteria item ID - _LIT8( KStar, "*" ); - CAiwCriteriaItem* criteria = CAiwCriteriaItem::NewLC( serviceCommand, - serviceCommand, KStar ); - - RCriteriaArray interest; - CleanupClosePushL( interest ); - // We are using a base service. - TUid base( KNullUid); - base.iUid = KAiwClassBase; - criteria->SetServiceClass( base ); - User::LeaveIfError( interest.Append( criteria ) ); - iServiceHandler->AttachL( interest ); - CleanupStack::PopAndDestroy( &interest ); - CleanupStack::PopAndDestroy( criteria ); } // --------------------------------------------------------------------------- @@ -80,6 +63,32 @@ } // --------------------------------------------------------------------------- +// Helper method for AIW attach +// --------------------------------------------------------------------------- +void CAHTelKeyHandler::AttachServiceHandlerL() + { + iServiceHandler = CAiwServiceHandler::NewL(); + + RCriteriaArray interest; + CleanupResetAndDestroy::PushL( interest ); + + TAiwServiceCommands serviceCommand = KAiwCmdCall; + _LIT8( KStar, "*" ); + // Service command used as criteria item ID + CAiwCriteriaItem* criteria = CAiwCriteriaItem::NewLC( serviceCommand, + serviceCommand, KStar ); + + // We are using a base service. + TUid base = { KAiwClassBase }; + criteria->SetServiceClass( base ); + interest.AppendL( criteria ); + CleanupStack::Pop( criteria ); + + iServiceHandler->AttachL( interest ); + CleanupStack::PopAndDestroy( &interest ); + } + +// --------------------------------------------------------------------------- // Executes provided action // --------------------------------------------------------------------------- // @@ -98,11 +107,14 @@ dialData->SetPhoneNumberL( number ); dialData->SetWindowGroup( AIWDialData::KAiwGoToIdle ); // Attach the interest to the AIW framework. - + if ( !iServiceHandler ) + { + AttachServiceHandlerL(); + } // Set parameters for the AIW call CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC( ); CAiwGenericParamList& paramListOut = - iServiceHandler->OutParamListL( ); + iServiceHandler->OutParamListL( ); dialData->FillInParamListL( *paramList ); iServiceHandler->ExecuteServiceCmdL( KAiwCmdCall, *paramList, diff -r b7904b40483f -r ff572005ac23 homescreensrv_plat/sapi_homescreenplugin/src/hspsliwutilities.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/src/hspsliwutilities.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/src/hspsliwutilities.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -683,12 +683,15 @@ ChspsDomAttribute* attr = static_cast( attrList.FindByName( KAttrId )); - const TDesC8& value = attr->Value(); - if( value.Compare( aNodeIdentifier ) == 0 ) - { - found = ETrue; - targetNode = node; - } + if ( attr ) + { + const TDesC8& value = attr->Value(); + if( value.Compare( aNodeIdentifier ) == 0 ) + { + found = ETrue; + targetNode = node; + } + } } node = iter->NextL(); } diff -r b7904b40483f -r ff572005ac23 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/updatetests.cmd --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/updatetests.cmd Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/updatetests.cmd Tue Jan 26 12:11:15 2010 +0200 @@ -1,3 +1,18 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem @echo off rem rem For testing/debugging in emulator after the SISX package has been installed diff -r b7904b40483f -r ff572005ac23 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_6.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_6.h Mon Jan 18 20:32:13 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_6.h Tue Jan 26 12:11:15 2010 +0200 @@ -1,21 +1,21 @@ /* -* ============================================================================== -* Name : mt_hsps_requestnotify_6.h -* Part of : HSPS / SAPI module testing -* Description : Test case RequestNotify(6) test data -* Version : %version: e003sa35#2 % +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". * -* Copyright © 2008 Nokia. All rights reserved. -* This material, including documentation and any related computer -* programs, is protected by copyright controlled by Nokia. All -* rights are reserved. Copying, including reproducing, storing, -* adapting or translating, any or all of this material requires the -* prior written consent of Nokia. This material also contains -* confidential information which may not be disclosed to others -* without the prior written consent of Nokia. -* ============================================================================== +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Test case RequestNotify(6) test data +* */ + #ifndef C_MT_HSPS_REQUESTNOTIFY_6_H #define C_MT_HSPS_REQUESTNOTIFY_6_H diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/devicestatus/inc/aimulticontentobserver.h --- a/idlefw/plugins/devicestatus/inc/aimulticontentobserver.h Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aimulticontentobserver.h Tue Jan 26 12:11:15 2010 +0200 @@ -64,6 +64,17 @@ TAny* Extension( TUid aUid ); TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; + TInt SetProperty( MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue ); + + TInt SetProperty( MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + MAiContentObserver::TValueType aValueType); + private: CAiMultiContentObserver(); void ConstructL(); diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/devicestatus/src/aimulticontentobserver.cpp --- a/idlefw/plugins/devicestatus/src/aimulticontentobserver.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aimulticontentobserver.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -224,6 +224,23 @@ return ETrue; } +TInt CAiMultiContentObserver::SetProperty( MAiPropertyExtension& /*aPlugin*/, + const TDesC8& /*aElementId*/, + const TDesC8& /*aPropertyName*/, + const TDesC8& /*aPropertyValue*/ ) + { + return KErrNotSupported; + } + +TInt CAiMultiContentObserver::SetProperty( MAiPropertyExtension& /*aPlugin*/, + const TDesC8& /*aElementId*/, + const TDesC8& /*aPropertyName*/, + const TDesC8& /*aPropertyValue*/, + MAiContentObserver::TValueType /*aValueType*/) + { + return KErrNotSupported; + } + CAiMultiContentObserver::CAiMultiContentObserver() { } diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/mcsplugin/group/bld.inf --- a/idlefw/plugins/mcsplugin/group/bld.inf Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/mcsplugin/group/bld.inf Tue Jan 26 12:11:15 2010 +0200 @@ -22,6 +22,8 @@ PRJ_PLATFORMS DEFAULT +// Help exports +#include "../help/group/bld.inf" PRJ_EXPORTS ../loc/mcspluginsettings.loc MW_LAYER_LOC_EXPORT_PATH(mcspluginsettings.loc) diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/mcsplugin/help/data/xhtml.zip Binary file idlefw/plugins/mcsplugin/help/data/xhtml.zip has changed diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/mcsplugin/help/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/help/group/bld.inf Tue Jan 26 12:11:15 2010 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - Initial contribution +* +* Contributors: +* +* +* Description: +* Export help related files. +* +*/ + +#include +PRJ_EXPORTS +:zip ../data/xhtml.zip /epoc32/data/z/resource/ overwrite +:zip ../data/xhtml.zip /epoc32/winscw/c/resource/ overwrite + +../inc/ai.hlp.hrh MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/ai.hlp.hrh) +../rom/mcspluginhelps_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(mcspluginhelps_variant.iby) \ No newline at end of file diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/mcsplugin/help/inc/ai.hlp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/help/inc/ai.hlp.hrh Tue Jan 26 12:11:15 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// +// ai.hlp.hrh generated by CSXHelp Utilities. +// + +#ifndef __AI_HLP_HRH__ +#define __AI_HLP_HRH__ + +_LIT(KSET_HLP_HOME_SCREEN_SHORTCUTS, "SET_HLP_HOME_SCREEN_SHORTCUTS"); // + +#endif \ No newline at end of file diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/mcsplugin/help/rom/mcspluginhelps_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/help/rom/mcspluginhelps_variant.iby Tue Jan 26 12:11:15 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __MCSPLUGINHELPS_VARIANT_IBY__ +#define __MCSPLUGINHELPS_VARIANT_IBY__ + +#if defined(FF_S60_HELPS_IN_USE) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x20022FDC\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x20022FDC\contents.zip) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x20022FDC\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x20022FDC\index.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x20022FDC\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x20022FDC\keywords.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x20022FDC\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x20022FDC\meta.xml) +#endif + +#endif \ No newline at end of file diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp --- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -26,6 +26,8 @@ #include #include #include + +#include #include // For CActiveFavouritesDbNotifier @@ -36,10 +38,8 @@ #include "mcspluginsettingsmodel.h" #include "mcspluginsettingsbkmlist.h" #include "mcspluginsettings.hrh" +#include "mcspluginuids.hrh" -const TUid KUidAI = { 0x102750FB }; // Active Standby Shortcuts help uid - -_LIT(KSET_HLP_HOME_SCREEN_SHORTCUTS, "SET_HLP_HOME_SCREEN_SHORTCUTS"); _LIT( KMyMenuData, "matrixmenudata" ); // ======== MEMBER FUNCTIONS ======== @@ -410,12 +410,13 @@ // TCoeHelpContext CMCSPluginSettingsContainer::GetHelpContext() const { + TUid uid = TUid::Uid( AI_UID_ECOM_DLL_SETTINGS_MCSPLUGIN ); TCoeContextName helpString; helpString.Copy( KSET_HLP_HOME_SCREEN_SHORTCUTS ); // set UID and topic of Help to display - return TCoeHelpContext( KUidAI, helpString ); + return TCoeHelpContext( uid, helpString ); } // --------------------------------------------------------------------------- diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/sapidataplugin/src/sapidataobserver.cpp --- a/idlefw/plugins/sapidataplugin/src/sapidataobserver.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/sapidataplugin/src/sapidataobserver.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -156,7 +156,7 @@ operation = variant.AsDes().AllocLC(); } variant.Reset(); - if( operation->Des() != KOperationExecute ) + if( operation && ( operation->Des() != KOperationExecute ) ) { // Nothing to update for execute action HBufC* publisher = NULL; diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/wrtdataplugin/group/bld.inf --- a/idlefw/plugins/wrtdataplugin/group/bld.inf Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/group/bld.inf Tue Jan 26 12:11:15 2010 +0200 @@ -29,8 +29,6 @@ PRJ_MMPFILES wrtdataplugin.mmp -//#include "../internal/testpublisher/group/bld.inf" -//#include "../internal/templatedwidget/group/bld.inf" // End of File. diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/wrtdataplugin/group/wrtdataplugin.mmp --- a/idlefw/plugins/wrtdataplugin/group/wrtdataplugin.mmp Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/group/wrtdataplugin.mmp Tue Jan 26 12:11:15 2010 +0200 @@ -40,9 +40,9 @@ LIBRARY euser.lib -LIBRARY bafl.lib +LIBRARY bafl.lib LIBRARY efsrv.lib -LIBRARY liwservicehandler.lib +LIBRARY liwservicehandler.lib LIBRARY ecom.lib LIBRARY aiutils.lib LIBRARY cone.lib @@ -50,6 +50,8 @@ LIBRARY fbscli.lib LIBRARY egul.lib LIBRARY aknskins.lib +LIBRARY estor.lib +LIBRARY apgrfx.lib // End of File SOURCEPATH ../src diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/wrtdataplugin/inc/wrtdata.h --- a/idlefw/plugins/wrtdataplugin/inc/wrtdata.h Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdata.h Tue Jan 26 12:11:15 2010 +0200 @@ -25,11 +25,13 @@ #include "wrtdatapluginconst.h" #include "aicontentpublisher.h" +// FORWARD DECLARATIONS class MLiwInterface; class CLiwServiceHandler; class CWrtDataObserver; class CWrtDataPlugin; +// CLASS DECLARATION /** * @ingroup group_wrtdataplugin * @@ -39,258 +41,272 @@ */ class CWrtData : public CBase { + public: + + /** + * Part of the two phased construction + * + * @param aPlugin refrence of the plugin + * @return none + */ + static CWrtData* NewL(CWrtDataPlugin* aPlugin); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CWrtData(); + + public : + + /** + * Configures the subscriber and data to subscribe. + * + * @param aConfigurations Information about the subscriber + * and the data to subscribe. + * @return void + */ + void ConfigureL(RAiSettingsItemArray& aConfigurations); + + /** + * Checks is this menu item is supported by the publisher + * + * @param aMenuItem menu item name. + * @return boolean (ETrue/EFalse) + */ + TBool HasMenuItem(const TDesC16& aMenuItem ); - /** - * Part of the two phased construction - * - * @param aPlugin refrence of the plugin - * @return none - */ - static CWrtData* NewL(CWrtDataPlugin* aPlugin); - - /** - * Destructor - * - * @param none - * @return none - */ - ~CWrtData(); - + /** + * Register to CPS for all (add/delete/update/execute) action + * + * @param none + * @return void + */ + void RegisterL(); + + /** + * Update the publisher status + * + * @param None + * @return void + */ + void UpdatePublisherStatusL(); + + /** + * Publish updated data for all the items in the widget + * + * @param aObserver to publish data + * @return void + */ + void PublishDefaultImageL( MAiContentObserver* aObserver ); + + /** + * Publish the updated data + * + * @param aObserver to publish data + * @param aDataMap data map + * @return void + */ + void PublishL( MAiContentObserver* aObserver, CLiwDefaultMap* aDataMap ); + + /** + * Called by the observer to refresh the changed content + * + * @param aContentId content Id. + * @param aOperation operation (add/delete/update/execute). + * @param aDataMap data map. + * @return void + */ + void RefreshL( TDesC& aContentId, TDesC& aOperation, CLiwDefaultMap* aDataMap ); + + /** + * Tigger for execution of a action for a specific content id. + * + * @param aObjectId object Id. + * @param aTrigger name of the trigger. + * @return void + */ + void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger); + + /** + * Is the pugin is active to publish the data. + * + * @param None + * @return boolean (ETrue/EFalse). + */ + TBool IsPluginActive(); + + /** + * Activate the publisher + * + * @param None + * @return void + */ + void ActivateL(); + + /** + * Resume the publisher + * + * @param None + * @return void + */ + void ResumeL(); + + /** + * Suspend the publisher + * + * @param None + * @return void + */ + void SuspendL(); + + /** + * Deactivate the publisher + * + * @param None + * @return void + */ + void DeActivateL(); + + /** + * InActiveL + * + * @param None + * @return void + */ + void InActiveL(); + + /** + * OnLineL + * + * @param None + * @return void + */ + void OnLineL(); + + /** + * OffLineL + * + * @param None + * @return void + */ + void OffLineL(); + private : - /** - * Constructor - * - * @param none - * @return none - */ - CWrtData(); - - - /** - * Part of the two phased construction - * - * @param aPlugin reference of the plugin - * @return void - */ - void ConstructL(CWrtDataPlugin* aPlugin); - - /** - * Change the publisher status - * - * @param aStatus new status of the publisher - * @return void - */ - void ChangePublisherStatusL(const TDesC& aStatus); - - /** - * Gets the menu item from the publisher - * - * @param none - * @return void - */ - void GetMenuItemsL(); - - public : - - /** - * Configures the subscriber and data to subscribe. - * - * @param aConfigurations Information about the subscriber - * and the data to subscribe. - * @return void - */ - void ConfigureL(RAiSettingsItemArray& aConfigurations); - - /** - * Publish updated data for all the items in the widget - * - * @param aObserver to publish data - * @return void - */ - void PublishAllL( MAiContentObserver* aObserver ); - - /** - * Execute the command to get the data from CPS - * - * @param aInFilter input filter for the command - * @param aOutDataMap output data map - * @param aRegistry type of registry (publisher/cp_data) - * @return void - */ - void ExecuteCommandL(CLiwDefaultMap* aInFilter, - CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry ); - - /** - * Checks is this menu item is supported by the publisher - * - * @param aMenuItem menu item name. - * @return boolean (ETrue/EFalse) - */ - TBool HasMenuItem(const TDesC16& aMenuItem ); - - /** - * Publish the updated data - * - * @param aObserver to publish data - * @return void - */ - void PublishL( MAiContentObserver* aObserver ); - - /** - * Tigger for execution of a action for a specific content id. - * - * @param aObjectId object Id. - * @param aTrigger name of the trigger. - * @return void - */ - void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger); - - /** - * Register to CPS for all (add/delete/update/execute) action - * - * @param none - * @return void - */ - void RegisterL(); - - /** - * Called by the observer to refresh the changed content - * - * @param aPublisher publisher. - * @param aContentType content type. - * @param aContentId content Id. - * @param aOperation operation (add/delete/update/execute). - * @return void - */ - void RefreshL( TDesC& aPublisher, TDesC& aContentType, - TDesC& aContentId, TDesC& aOperation ); - - /** - * Createts the filter map - * - * @return filter map - */ - CLiwDefaultMap* CreateFilterLC( ); - - /** - * Is the pugin is active to publish the data. - * - * @param None - * @return boolean (ETrue/EFalse). - */ - TBool IsPluginActive(); - - /** - * Resume the publisher - * - * @param None - * @return void - */ - void ResumeL(); - - /** - * Suspend the publisher - * - * @param None - * @return void - */ - void SuspendL(); - - /** - * Activate the publisher - * - * @param None - * @return void - */ - void ActivateL(); - - /** - * Deactivate the publisher - * - * @param None - * @return void - */ - void DeActivateL(); - - /** - * OnLineL - * - * @param None - * @return void - */ - void OnLineL(); - - /** - * OffLineL - * - * @param None - * @return void - */ - void OffLineL(); - - /** - * InActiveL - * - * @param None - * @return void - */ - void InActiveL(); - - /** - * Update the publisher status - * - * @param None - * @return void - */ - void UpdatePublisherStatusL(); - - /** - * Resolves skin item id and Mif id from pattern - * skin( () - * mif( ) - * - * @param aPath skin pattern / mif pattern value - * @param aItemId skin item id - * @param aMifId mif id - * @param aMaskId mask id - * @param aFilename mif file name - * @return boolean (ETrue/EFalse) - */ - TBool ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, - TInt& aMifId, TInt& aMaskId, TDes& aFilename ); + /** + * Default Constructor + * + */ + CWrtData(); + + /** + * Part of the two phased construction + * + * @param aPlugin reference of the plugin + * @return void + */ + void ConstructL(CWrtDataPlugin* aPlugin); + + /** + * Createts the filter map + * + * @return filter map + */ + CLiwDefaultMap* CreateFilterLC( ); + + /** + * Execute the command to get the data from CPS + * + * @param aInFilter input filter for the command + * @param aOutDataMap output data map + * @param aRegistry type of registry (publisher/cp_data) + * @return void + */ + void ExecuteCommandL(CLiwDefaultMap* aInFilter, + CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry ); + + + /** + * Change the publisher status + * + * @param aStatus new status of the publisher + * @return void + */ + void ChangePublisherStatusL(const TDesC& aStatus); + + /** + * Gets the menu item from the publisher + * + * @param none + * @return void + */ + void GetMenuItemsL(); + + /** + * Gets the widgent name and uid + * + * @param aName - widget name + * @param aAppUID - widget uid + * @return void + */ + void GetWidgetNameAndUidL(TDes& aName, TDes& aAppUID ); + + /** + * Resolves the Uid from the string + * + * @param aUidDes - uid in string + * @param aUid - uid + * @return ETure/EFalse + */ + TBool ResolveUid(const TDesC& aUidDes, TUid& aUid ); + + /** + * Creates icon from the uid + * + * @param aHandle - icon handle + * @param aMaskHandle - mask handle + * @param aAppUid - application uid + * @return ETure/EFalse + */ + void CreateIconFromUidL(TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid ); private : + + // Subscriber interface + // own + MLiwInterface* iInterface; + + // Data Observer to CPS + // Own + CWrtDataObserver* iObserver; + + // Service handler + // Own + CLiwServiceHandler* iServiceHandler; - // Subscriber interface - // own - MLiwInterface* iInterface; - - // Data Observer to CPS - // Own - CWrtDataObserver* iObserver; - - // Service handler - // Own - CLiwServiceHandler* iServiceHandler; - - // Command name in configuration Array - HBufC8* iCommandName; - - // Reference of the wrt data plugin - // Not owned - CWrtDataPlugin* iPlugin; - - // Menu item names - // Own - RPointerArray iMenuItems; - - // Trigger names for the menu items - // Own - RPointerArray iMenuTriggers; - - HBufC* iContentId; + // Command name in configuration Array + HBufC8* iCommandName; + + // Reference of the wrt data plugin + // Not owned + CWrtDataPlugin* iPlugin; + + // Menu item names + // Own + RPointerArray iMenuItems; + + // Trigger names for the menu items + // Own + RPointerArray iMenuTriggers; + + // Widgets content id. + // Own + HBufC* iContentId; + }; #endif /*WRTDATA_H*/ diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/wrtdataplugin/inc/wrtdataobserver.h --- a/idlefw/plugins/wrtdataplugin/inc/wrtdataobserver.h Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdataobserver.h Tue Jan 26 12:11:15 2010 +0200 @@ -22,8 +22,10 @@ // INCLUDE FILES #include +// FORWARD DECLARATIONS class CWrtData; +// CLASS DECLARATION /** * @ingroup group_wrtdataplugin * @@ -33,91 +35,91 @@ */ class CWrtDataObserver : public CBase, public MLiwNotifyCallback { -public: + public: - /** - * Part of the two phased constuction - * - * @param aInterface reference of the interface - * @param aData reference of the wrt data object - * @return none - */ - static CWrtDataObserver* NewL( MLiwInterface* aInterface, CWrtData* aData ); + /** + * Part of the two phased constuction + * + * @param aInterface reference of the interface + * @param aData reference of the wrt data object + * @return none + */ + static CWrtDataObserver* NewL( MLiwInterface* aInterface, CWrtData* aData ); - /** - * Destructor - * - * @param none - * @return none - */ - ~CWrtDataObserver(); + /** + * Destructor + * + * @param none + * @return none + */ + ~CWrtDataObserver(); -private : - - /** - * Constructor - * - * @param none - * @return none - */ - CWrtDataObserver(); + private : - /** - * Part of the two phased construction - * - * @param aInterface reference of the interface - * @param aData reference of the wrt data object - * @return void - */ - void ConstructL( MLiwInterface* aInterface, CWrtData* aData ); + /** + * Constructor + * + * @param none + * @return none + */ + CWrtDataObserver(); + + /** + * Part of the two phased construction + * + * @param aInterface reference of the interface + * @param aData reference of the wrt data object + * @return void + */ + void ConstructL( MLiwInterface* aInterface, CWrtData* aData ); -public: //from MLiwNotifyCallbackc + public: //from MLiwNotifyCallbackc - /** - * Handles notifications caused by an asynchronous Execute*CmdL call - * or an event. - * - * @param aCmdId The service command associated to the event. - * @param aEventId occurred event, see LiwCommon.hrh. - * @param aEventParamList Event parameters, if any, as defined per - * each event. - * @param aInParamList Input parameters, if any, given in the - * related HandleCommmandL. - * @return Error code for the call back. - */ - virtual TInt HandleNotifyL( - TInt aCmdId, - TInt /*aEventId*/, - CLiwGenericParamList& aEventParamList, - const CLiwGenericParamList& /*aInParamList*/); + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * + * @param aCmdId The service command associated to the event. + * @param aEventId occurred event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the call back. + */ + virtual TInt HandleNotifyL( + TInt aCmdId, + TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/); -public: + public: - /** - * Registers to CPS for add, delete , update and execute notifications - * @aFilter - filter for input parameter list - * @return void. - */ - void RegisterL( CLiwDefaultMap* aFilter ); - - /** - * Cancel all the registered notifications. - * @return void. - */ - void ReleaseL(); + /** + * Registers to CPS for add, delete , update and execute notifications + * @aFilter - filter for input parameter list + * @return void. + */ + void RegisterL( CLiwDefaultMap* aFilter ); + + /** + * Cancel all the registered notifications. + * @return void. + */ + void ReleaseL(); + + private: + + // Reference of + // Not owned + MLiwInterface* iInterface; -private: + // Reference of the wrt data + // Not owned + CWrtData* iData; - // Reference of - // Not owned - MLiwInterface* iInterface; - - // Reference of the wrt data - // Not owned - CWrtData* iData; - - // Call back error code - TInt iError; + // Call back error code + TInt iError; }; diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/wrtdataplugin/inc/wrtdataplugin.h --- a/idlefw/plugins/wrtdataplugin/inc/wrtdataplugin.h Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdataplugin.h Tue Jan 26 12:11:15 2010 +0200 @@ -24,18 +24,17 @@ #include #include +// FORWARD DECLARATIONS class MAiContentObserver; class MAiContentItemIterator; class MAiPSPropertyObserver; class CWrtData; class CDesC16Array; class CGulIcon; +class CLiwDefaultMap; -enum TContentItem - { - EImage1, - EText1 - }; + +// CLASS DECLARATION /** * @ingroup group_wrtdataplugin * @@ -48,356 +47,395 @@ public MAiEventHandlerExtension { - -public : - /** - * Plugin's network state. - */ - enum TPluginNetworkStatus - { - EUnknown, - EOffline, - EOnline - }; - - /** - * Plugin's state. - */ - enum TPluginStates - { - ENone, - EResume, - ESuspend, - EInActive, - }; -public: + + public : + /** + * Plugin's network state. + */ + enum TPluginNetworkStatus + { + EUnknown, + EOffline, + EOnline + }; + + /** + * Plugin's state. + */ + enum TPluginStates + { + ENone, + EResume, + ESuspend, + EInActive, + }; + + /** + * Content Items + */ + enum TContentItem + { + EDefaultImage, + EDefaultText, + EImage1 + }; - /** - * Part of the two phased constuction - * - * @param none - * @return none - */ - static CWrtDataPlugin* NewL(); - - /** - * Destructor - * - * @param none - * @return none - */ - ~CWrtDataPlugin(); - -private: - - /** - * Constructor - * - * @param none - * @return none - */ - CWrtDataPlugin(); - - /** - * Publishes widget's texts and images - * - * @param void - * @return void - */ - void PublishL(); - - /** - * Part of the two phased construction - * - * @param void - * @return void - */ - void ConstructL(); - - /** - * Resume the plug-in. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void DoResumeL(TAiTransitionReason aReason); - -public: // from base class CAiContentPublisher + public: - /** - * From CAiContentPublisher - * The method is called by the framework to request the plug-in free all - * memory and CPU resources and close all its open files, e.g. the plug-in - * should unload its engines due backup operation. The method transits the - * plug-in to "Idle" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Stop( TAiTransitionReason aReason ); - - /** - * From CAiContentPublisher - * The method is called by the framework to instruct plug-in that it is - * allowed to consume CPU resources, e.g plug-in is able to run timers, - * perform asynchronous operations, etc. The method transits the plug-in - * to "Alive" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Resume( TAiTransitionReason aReason ); - - /** - * From CAiContentPublisher - * The method is called by the framework to instruct plug-in that it is - * not allowed to consume CPU resources, e.g plug-in MUST stop each - * timers, cancel outstanding asynchronous operations, etc. The method - * transits the plug-in to "Suspendend" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Suspend( TAiTransitionReason aReason ); - - /** - * From CAiContentPublisher - * Adds the content observer / subscriber to plug-in. The plug-in MUST - * maintain a registry of subscribers and send notification to all them - * whenever the plug-in changes state or new content available. - * - * @param aObserver content observer to register. - * @return void - */ - void SubscribeL( MAiContentObserver& aObserver ); - - /** - * From CAiContentPublisher - * Configures the plug-in. - * Plug-ins take ownership of the settings array, so it must either - * store it in a member or free it. Framework has put the array in cleanup - * stack so the plugin shouldn't do that. - * If this leaves, the plug-in will be destroyed by AI FW. - * Plug-in must support LaunchByValue-event even if normal shortcuts don't - * work. The only allowed serious enough leave is KErrNotFound from CenRep. - * - * @param aSettings setting items defined in the UI definition. - * @return void - */ - void ConfigureL( RAiSettingsItemArray& aSettings ); - - /** - * From CAiContentPublisher - * Returns interface extension. In Series 60 3.1 only event & property - * extensions are supported. See MAiEventExtension & MAiPropertyExtension - * interfaces. - * - * @param aUid - UID of the extension interface to access. - * @return the extension interface. Actual type depends on the passed aUid - * argument. - */ - TAny* Extension( TUid aUid ); - -// from base class MAiPropertyExtension - - /** - * From MAiPropertyExtension. - * Read property of publisher plug-in. - * - * @param aProperty - identification of property. - * @return pointer to property value. - */ - TAny* GetPropertyL( TInt aProperty ); + /** + * Part of the two phased constuction + * + * @param none + * @return none + */ + static CWrtDataPlugin* NewL(); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CWrtDataPlugin(); - /** - * From MAiPropertyExtension. - * Write property value. - * - * @param aProperty - identification of property. - * @param aValue - contains pointer to property value. - */ - void SetPropertyL( TInt aProperty, TAny* aValue ); - - // from base class MAiEventHandlerExtension - - /** - * From MAiEventHandlerExtension - * Invoked by the framework when plug-in must handle an event. - * @param aEvent - unique identifier of event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where is mapped by the framework to unique - * identifier supplied in aEvent, are provided to - * plug-in as-is in the descriptor. - * @since S60 3.2 - */ - void HandleEvent(TInt aEvent, const TDesC& aParam); + public: // from base class CAiContentPublisher + + /** + * From CAiContentPublisher + * The method is called by the framework to request the plug-in free all + * memory and CPU resources and close all its open files, e.g. the plug-in + * should unload its engines due backup operation. The method transits the + * plug-in to "Idle" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Stop( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * The method is called by the framework to instruct plug-in that it is + * allowed to consume CPU resources, e.g plug-in is able to run timers, + * perform asynchronous operations, etc. The method transits the plug-in + * to "Alive" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Resume( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * The method is called by the framework to instruct plug-in that it is + * not allowed to consume CPU resources, e.g plug-in MUST stop each + * timers, cancel outstanding asynchronous operations, etc. The method + * transits the plug-in to "Suspendend" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Suspend( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * Adds the content observer / subscriber to plug-in. The plug-in MUST + * maintain a registry of subscribers and send notification to all them + * whenever the plug-in changes state or new content available. + * + * @param aObserver content observer to register. + * @return void + */ + void SubscribeL( MAiContentObserver& aObserver ); + + /** + * From CAiContentPublisher + * Configures the plug-in. + * Plug-ins take ownership of the settings array, so it must either + * store it in a member or free it. Framework has put the array in cleanup + * stack so the plugin shouldn't do that. + * If this leaves, the plug-in will be destroyed by AI FW. + * Plug-in must support LaunchByValue-event even if normal shortcuts don't + * work. The only allowed serious enough leave is KErrNotFound from CenRep. + * + * @param aSettings setting items defined in the UI definition. + * @return void + */ + void ConfigureL( RAiSettingsItemArray& aSettings ); + + /** + * From CAiContentPublisher + * Returns interface extension. In Series 60 3.1 only event & property + * extensions are supported. See MAiEventExtension & MAiPropertyExtension + * interfaces. + * + * @param aUid - UID of the extension interface to access. + * @return the extension interface. Actual type depends on the passed aUid + * argument. + */ + TAny* Extension( TUid aUid ); + + // from base class MAiPropertyExtension + + /** + * From MAiPropertyExtension. + * Read property of publisher plug-in. + * + * @param aProperty - identification of property. + * @return pointer to property value. + */ + TAny* GetPropertyL( TInt aProperty ); - /** - * From MAiEventHandlerExtension - * Invoked by the framework when plug-in must handle an event. - * - * @param aEventName - name of the event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where mapping to unique identifier supplied by event - * is failed by the frame work then the and - * are provided to plug-in as-is in the descriptor. - */ - void HandleEvent(const TDesC& aEventName, const TDesC& aParam); - - /** - * Invoked by the framework for querying if plugin has menu item - * - * @param aMenuItem menu item name. - * @return ETrue if plugin has specific menu item, EFalse otherwise - */ - TBool HasMenuItem(const TDesC16& aMenuItem); - -public : - - /** - * Gets the id of a content - * - * @param aObjectId image or text id - * @return id of the content - */ - TInt GetIdL(TDesC16& aObjectId); - - /** - * Gets the type of a specific content - * - * @param aObjectId image or text id - * @param aType type - * @return void - */ - void GetTypeL( TDesC16& aObjectId, TDes16& aType ); - - /** - * RefereshL a specific image of text in the widget - * - * @param aOperation operation performed - * @return void - */ - void RefreshL(TDesC16& aOperation ); + /** + * From MAiPropertyExtension. + * Write property value. + * + * @param aProperty - identification of property. + * @param aValue - contains pointer to property value. + */ + void SetPropertyL( TInt aProperty, TAny* aValue ); + + // from base class MAiEventHandlerExtension + + /** + * From MAiEventHandlerExtension + * Invoked by the framework when plug-in must handle an event. + * @param aEvent - unique identifier of event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where is mapped by the framework to unique + * identifier supplied in aEvent, are provided to + * plug-in as-is in the descriptor. + * @since S60 3.2 + */ + void HandleEvent(TInt aEvent, const TDesC& aParam); + + /** + * From MAiEventHandlerExtension + * Invoked by the framework when plug-in must handle an event. + * + * @param aEventName - name of the event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where mapping to unique identifier supplied by event + * is failed by the frame work then the and + * are provided to plug-in as-is in the descriptor. + */ + void HandleEvent(const TDesC& aEventName, const TDesC& aParam); + + /** + * Invoked by the framework for querying if plugin has menu item + * + * @param aMenuItem menu item name. + * @return ETrue if plugin has specific menu item, EFalse otherwise + */ + TBool HasMenuItem(const TDesC16& aMenuItem); + + public : // New functions - /** - * Is plugin active to publish the data - * - * @param void - * @return boolean (ETrue/EFalse) - */ - TBool IsActive(); + /** + * Gets the id of a content + * + * @param aObjectId image or text id + * @return id of the content + */ + TInt GetIdL(TDesC16& aObjectId); + + /** + * Gets the type of a specific content + * + * @param aObjectId image or text id + * @param aType type + * @return void + */ + void GetTypeL( TDesC16& aObjectId, TDes16& aType ); + + /** + * RefereshL a specific image of text in the widget + * + * @param aOperation operation performed + * @param aDataMap data map + * @return void + */ + void RefreshL(TDesC16& aOperation, CLiwDefaultMap* aDataMap ); + + /** + * Is plugin active to publish the data + * + * @param void + * @return boolean (ETrue/EFalse) + */ + TBool IsActive(); + + /** + * Publish a specific text of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aContentValue content value + * @return void + */ + void PublishTextL(MAiContentObserver* aObserver, + TInt aContentId, const TDesC16& aContentValue); - /** - * Publish a specific text of the widget - * - * @param aObserver observer - * @param aContentId content model id - * @param aContentValue content value - * @return void - */ - /*void PublishTextL(MAiContentObserver* aObserver, - TInt& aContentId, TDesC16& aContentValue);*/ + /** + * Publish a specific image of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aHandle image handle + * @param aMaskHandle handle of the mask image + * @return void + */ + void PublishImageL(MAiContentObserver* aObserver, + TContentItem aContentId, TInt aHandle, TInt aMaskHandle); + + /** + * Publish a specific image of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aPath image path / skin id pattern / mif id Pattern + * @return void + */ + void PublishImageL(MAiContentObserver* aObserver, + TContentItem aContentId, const TDesC16& aPath ); + + /** + * Cleans a data from the widget + * + * @param aObserver observer + * @param aContentId content model id + * @return void + */ + void Clean(MAiContentObserver* aObserver, + TInt aContentId ); + + /** + * Shows the loading icon animation + * + * @param aObserver observer + * @return void + */ + void ShowLoadingIcon(MAiContentObserver* aObserver); - /** - * Publish a specific image of the widget - * - * @param aObserver observer - * @param aContentId content model id - * @param aHandle image handle - * @param aMaskHandle handle of the mask image - * @return void - */ - void PublishImageL(MAiContentObserver* aObserver, - TContentItem aContentId, TInt aHandle, TInt aMaskHandle); + /** + * Hides the loading icon animation + * + * @param aObserver observer + * @return void + */ + void HideLoadingIcon(MAiContentObserver* aObserver); - /** - * Publish a specific image of the widget - * - * @param aObserver observer - * @param aContentId content model id - * @param aPath image path / skin id pattern / mif id Pattern - * @return void - */ - void PublishImageL(MAiContentObserver* aObserver, - TContentItem aContentId, TDesC16& aPath ); + /** + * CWrtData getter + * @return Pointer to CWrtData + */ + inline CWrtData* Data() const + { + return iData; + } + + /* + * Plugin's network status getter + * @return Pointer to Harvester status observer + */ + inline TPluginNetworkStatus NetworkStatus() const + { + return iNetworkStatus; + } - /** - * Cleans a data from the widget - * - * @param aObserver observer - * @param aContentId content model id - * @return void - */ - void Clean(MAiContentObserver* aObserver, - TInt aContentId ); - - /** - * CWrtData getter - * @return Pointer to CWrtData - */ - inline CWrtData* Data() const - { - return iData; - } + private: + + /** + * Constructor + * + * @param none + * @return none + */ + CWrtDataPlugin(); + + /** + * Part of the two phased construction + * + * @param void + * @return void + */ + void ConstructL(); + + /** + * Publishes widget's texts and images + * + * @param void + * @return void + */ + void PublishL(); - /* - * Plugin's network status getter - * @return Pointer to Harvester status observer - */ - inline TPluginNetworkStatus NetworkStatus() const - { - return iNetworkStatus; - } - -private: // data - - // Iterator for plugin content - // Own - MAiContentItemIterator* iContent; - - // Array of content observers - // Own - RPointerArray iObservers; + /** + * Resume the plug-in. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void DoResumeL(TAiTransitionReason aReason); + + /** + * Resolves skin item id and Mif id from pattern + * skin( () + * mif( ) + * + * @param aPath skin pattern / mif pattern value + * @param aItemId skin item id + * @param aMifId mif id + * @param aMaskId mask id + * @param aFilename mif file name + * @return boolean (ETrue/EFalse) + */ + TBool ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, + TInt& aMifId, TInt& aMaskId, TDes& aFilename ); + + private: // data + + // Iterator for plugin content + // Own + MAiContentItemIterator* iContent; - // Information about the content publisher (this plug-in) - TAiPublisherInfo iInfo; - - // Number of data in the content model. - TInt iDataCount; - - // Dynamic content model - // Own - TAiContentItem* iContentModel; - - // Reference array for Published text - // Own - RPointerArray iDataArray; - - // Service API Data Subscriber. - // Own - CWrtData* iData; + // Array of content observers + // Own + RPointerArray iObservers; + + // Information about the content publisher (this plug-in) + TAiPublisherInfo iInfo; + + // Number of data in the content model. + TInt iDataCount; + + // Dynamic content model + // Own + TAiContentItem* iContentModel; + + // Reference array for Published text + // Own + RPointerArray iDataArray; + + // Service API Data Subscriber. + // Own + CWrtData* iData; + + // References array for published images + // Own + RArray iIconArray; + + // Plugin's network status + TPluginNetworkStatus iNetworkStatus; + + // Is Homescreen foreground. + TBool iHSForeGround; + + // Is KeyLockON. + TBool iKeyLockOn; - // References array for published images - // Own - RArray iIconArray; - - // File Server - // Reference - RFs iRfs; - - // Plugin's network status - TPluginNetworkStatus iNetworkStatus; - - // Is Homescreen foreground. - TBool iHSForeGround; - - // Is KeyLockON. - TBool iKeyLockOn; - - // Plugin state - TPluginStates iPluginState; + // Plugin state + TPluginStates iPluginState; }; #endif // WRTDATAPLUGIN_H diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/wrtdataplugin/inc/wrtdatapluginconst.h --- a/idlefw/plugins/wrtdataplugin/inc/wrtdatapluginconst.h Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdatapluginconst.h Tue Jan 26 12:11:15 2010 +0200 @@ -34,6 +34,7 @@ */ _LIT(KText ,"text"); _LIT(KImage, "image"); +_LIT(KAnimation, "animation"); _LIT(KPlugin, "plugin"); _LIT(KNewsTicker ,"newsticker"); @@ -79,6 +80,7 @@ _LIT( KOnLine, "online"); _LIT( KOffLine, "offline"); _LIT( KInActive, "inactive"); + // reserved extension for retrieving mask handle _LIT8( KImageMask, "image1_mask"); @@ -90,6 +92,29 @@ _LIT( KTemplateWidget,"ai3templatedwidget"); _LIT( KWRTPublisher, "wrt_publisher"); _LIT8(KImage1, "image1"); +_LIT8( KWidgetInfo, "widget_info"); +_LIT8( KWidgetName, "widget_name"); +_LIT8( KWidgetIcon, "widget_icon"); + +_LIT( KHexPrefix, "0x" ); +_LIT( KUid, "uid" ); +_LIT8(KElement, "loading"); +_LIT8(KDisplay, "display"); +_LIT8(KShow, "block"); +_LIT8(KHide, "none"); + +#ifdef __WINS__ +_LIT( KDrive, "C:" ); +#else +_LIT( KDrive, "Z:" ); +#endif + +#ifdef WRT_PREDEFINED_IMAGE +_LIT(KImgFolder, "200286dd\\"); +_LIT(KJPEG, ".jpg"); +_LIT(KPNG, ".png"); +#endif + const TUint KLeftParenthesis = '('; @@ -116,5 +141,11 @@ */ const TInt KAiPluginNameMaxLength = 255; +/** + * Maximum length for the application uid string + * uid(0x123456578) + * + */ +const TInt KWRTAppUidLenth = 16; #endif /* WRTDATAPLUGINCONST_H */ diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/wrtdataplugin/src/wrtdata.cpp --- a/idlefw/plugins/wrtdataplugin/src/wrtdata.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdata.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -16,15 +16,20 @@ * */ + +// INCLUDE FILES #include #include #include - +#include +#include +#include #include "wrtdata.h" #include "wrtdatapluginconst.h" #include "wrtdataobserver.h" #include "wrtdataplugin.h" + // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -99,7 +104,7 @@ } // --------------------------------------------------------------------------- -// ConfigureL +// CWrtData::ConfigureL // --------------------------------------------------------------------------- // void CWrtData::ConfigureL(RAiSettingsItemArray& aConfigurations ) @@ -191,7 +196,439 @@ } // --------------------------------------------------------------------------- -// GetMenuItemsL +// CWrtData::HasMenuItem +// --------------------------------------------------------------------------- +// +TBool CWrtData::HasMenuItem(const TDesC16& aMenuItem ) + { + TBool found = EFalse; + for (TInt i = 0; i < iMenuItems.Count(); i++ ) + { + if( aMenuItem == iMenuItems[i] ) + { + found = ETrue; + break; + } + } + return found; + } + +// --------------------------------------------------------------------------- +// CWrtData::RegisterL +// --------------------------------------------------------------------------- +// +void CWrtData::RegisterL() + { + CLiwDefaultMap* filter = CreateFilterLC(); + filter->InsertL( KOperation, TLiwVariant( KAddUpdateDelete ) ); + iObserver->RegisterL(filter); + CleanupStack::PopAndDestroy( filter ); + } + +// --------------------------------------------------------------------------- +// CWrtData::UpdatePublisherStatusL +// --------------------------------------------------------------------------- +// +void CWrtData::UpdatePublisherStatusL() + { + // Resent the plugin status to publisher + ActivateL(); + if ( iPlugin->IsActive() ) + { + ResumeL(); + } + else + { + SuspendL(); + } + // forward the network status if it uses. + if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOnline ) + { + OnLineL(); + } + else if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOffline ) + { + OffLineL(); + } + } + +// --------------------------------------------------------------------------- +// CWrtData::PublishDefaultImageL +// --------------------------------------------------------------------------- +// +void CWrtData::PublishDefaultImageL( MAiContentObserver* aObserver ) + { + TBuf appUidStr; + TBuf appName; + GetWidgetNameAndUidL( appName, appUidStr ); + + TUid appUid; + if ( ResolveUid (appUidStr, appUid ) ) + { +#ifdef WRT_PREDEFINED_IMAGE + RFs rfs; + User::LeaveIfError( rfs.Connect() ); + + TFileName privatePath; + rfs.PrivatePath(privatePath); + privatePath.Insert(0,KDrive); + privatePath.Append( KImgFolder ); + + appUidStr.Copy( appUid.Name()); + appUidStr.Delete(0,1); + appUidStr.Delete( appUidStr.Length() -1, 1); + privatePath.Append (appUidStr ); + privatePath.Append ( KJPEG ); + if ( BaflUtils::FileExists(rfs,privatePath) ) + { + // Publish predefined jpeg image + iPlugin->PublishImageL( aObserver, CWrtDataPlugin::EImage1,privatePath); + } + else + { + privatePath.Delete( privatePath.Length() - 4 , 4); + privatePath.Append( KPNG ); + if ( BaflUtils::FileExists(rfs,privatePath) ) + { + // Publish predefined image + iPlugin->PublishImageL( aObserver, CWrtDataPlugin::EImage1,privatePath); + } + else + { +#endif + TInt handle = KErrNotFound; + TInt mask = KErrNotFound; + CreateIconFromUidL( handle, mask, appUid ); + // Publish widget apparc image + iPlugin->PublishImageL( aObserver, CWrtDataPlugin::EDefaultImage,handle,mask); + if ( appName.Length() > 0) + { + // Publish Widget Name + iPlugin->PublishTextL( aObserver, CWrtDataPlugin::EDefaultText, appName); + } +#ifdef WRT_PREDEFINED_IMAGE + } + } + rfs.Close(); +#endif + } + + // Show loading animation + iPlugin->ShowLoadingIcon(aObserver); + } + +// --------------------------------------------------------------------------- +// CWrtData::PublishL +// --------------------------------------------------------------------------- +// +void CWrtData::PublishL( MAiContentObserver* aObserver, CLiwDefaultMap* aDataMap ) + { + TLiwVariant variant; + iPlugin->HideLoadingIcon(aObserver); + if ( aDataMap->FindL( KImage1, variant ) ) + { + TInt handle = KErrBadHandle; + TUint uintHandle = 0; + TPtrC16 valPtr; + if ( variant.Get( uintHandle ) ) + { + handle = uintHandle; + } + else if ( !variant.Get( handle ) ) + { + handle = KErrBadHandle; + } + // read as a image handle + if( handle == KErrBadHandle ) + { + // no handle, so read as image path + variant.Get( valPtr ); + iPlugin->PublishImageL(aObserver, CWrtDataPlugin::EImage1, valPtr ); + } + else + { + TInt maskHandle = KErrBadHandle; + //Look for image mask + if ( aDataMap->FindL( KImageMask, variant ) ) + { + variant.Get( maskHandle ); + } + iPlugin->PublishImageL(aObserver, CWrtDataPlugin::EImage1, handle, maskHandle ); + } + } + variant.Reset(); + } + +// --------------------------------------------------------------------------- +// CWrtData::RefreshL +// --------------------------------------------------------------------------- +// +void CWrtData::RefreshL( TDesC& aContentId, TDesC& aOperation, + CLiwDefaultMap* aDataMap ) + { + if ( aContentId == iContentId ) + { + iPlugin->RefreshL( aOperation, aDataMap); + } + } + +// --------------------------------------------------------------------------- +// CWrtData::ExecuteActionL +// --------------------------------------------------------------------------- +// +void CWrtData::ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger ) + { + HBufC8* triggerName = HBufC8::NewLC( KWRTContentNameMaxLength ); + + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + CLiwDefaultMap* filter = NULL; + + triggerName->Des().Copy(aTrigger); + if ( aObjectId == KPubData ) + { + // this trigger belongs to publisher registery. + // in such case it is assumed that all the items in the widgets + // belongs to same publisher, type and id. + TLiwGenericParam cptype( KType, TLiwVariant( KPubData ) ); + inParamList->AppendL( cptype ); + cptype.Reset(); + // use the first item configuration to create the filter + filter = CreateFilterLC(); + } + else + { + if ( aObjectId == KMenuItem16 ) + { + TInt pos = KErrNotFound; + for (TInt i = 0; i < iMenuItems.Count(); i++) + { + if ( aTrigger == iMenuItems[i] ) + { + pos = i; + break; + } + } + if( pos == KErrNotFound ) + { + // No such menu items + CleanupStack::PopAndDestroy( triggerName ); + return; + } + triggerName->Des().Copy( iMenuTriggers[pos]->Des() ); + filter = CreateFilterLC(); + } + else + { + //Create filter criteria for requested entries in form of LIW map: + filter = CreateFilterLC(); + } + //append type to inparam list + TLiwGenericParam cptype( KType, TLiwVariant( KCpData ) ); + inParamList->AppendL( cptype ); + cptype.Reset(); + } + + filter->InsertL( KActionTrigger, TLiwVariant( triggerName->Des() ) ); + //append filter to input param + TLiwGenericParam item( KFilter, TLiwVariant( filter ) ); + inParamList->AppendL( item ); + iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList ); + + CleanupStack::PopAndDestroy( filter ); + CleanupStack::PopAndDestroy( triggerName ); + item.Reset(); + + inParamList->Reset(); + outParamList->Reset(); + + } + +// --------------------------------------------------------------------------- +// CWrtData::IsPluginActive +// --------------------------------------------------------------------------- +// +TBool CWrtData::IsPluginActive() + { + return iPlugin->IsActive(); + } + +// --------------------------------------------------------------------------- +// CWrtData::ActivateL +// --------------------------------------------------------------------------- +// +void CWrtData::ActivateL() + { + ChangePublisherStatusL( KActive ); + } + +// --------------------------------------------------------------------------- +// CWrtData::ResumeL +// --------------------------------------------------------------------------- +// +void CWrtData::ResumeL() + { + ChangePublisherStatusL( KResume ); + } + +// --------------------------------------------------------------------------- +// CWrtData::SuspendL +// --------------------------------------------------------------------------- +// +void CWrtData::SuspendL() + { + ChangePublisherStatusL( KSuspend ); + } + +// --------------------------------------------------------------------------- +// CWrtData::DeActivateL +// --------------------------------------------------------------------------- +// +void CWrtData::DeActivateL() + { + ChangePublisherStatusL( KDeActive ); + } + +// --------------------------------------------------------------------------- +// CWrtData::InActiveL +// --------------------------------------------------------------------------- +// +void CWrtData::InActiveL() + { + ChangePublisherStatusL( KInActive ); + } + +// --------------------------------------------------------------------------- +// CWrtData::OnLineL +// --------------------------------------------------------------------------- +// +void CWrtData::OnLineL() + { + ChangePublisherStatusL( KOnLine ); + } + +// --------------------------------------------------------------------------- +// CWrtData::offLineL +// --------------------------------------------------------------------------- +// +void CWrtData::OffLineL() + { + ChangePublisherStatusL( KOffLine ); + } + +// --------------------------------------------------------------------------- +// CWrtData::CreateFilterL +// --------------------------------------------------------------------------- +// +CLiwDefaultMap* CWrtData::CreateFilterLC() + { + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + filter->InsertL( KPublisherId, TLiwVariant( KWRTPublisher )); + filter->InsertL( KContentType, TLiwVariant( KTemplateWidget )); + filter->InsertL( KContentId, TLiwVariant( iContentId )); + return filter; + } + +// --------------------------------------------------------------------------- +// CWrtData::ExecuteCommandL +// --------------------------------------------------------------------------- +// +void CWrtData::ExecuteCommandL(CLiwDefaultMap* aInFilter, CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry ) + { + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + + TLiwGenericParam type( KType, TLiwVariant( aRegistry ) ); + inParamList->AppendL( type ); + + //append filter to input param + TLiwGenericParam item( KFilter, TLiwVariant( aInFilter )); + inParamList->AppendL( item ); + + // execute service.It is assumed that iInterface is already initiatedd + if(iInterface) + { + iInterface->ExecuteCmdL( *iCommandName, *inParamList, *outParamList); + } + else + { + User::Leave( KErrNotSupported ); + } + type.Reset(); + item.Reset(); + inParamList->Reset(); + + //extracts data map + TInt pos = 0; + outParamList->FindFirst( pos, KResults ); + if( pos != KErrNotFound ) + // results present + { + //extract iterator on results list + TLiwVariant variant = (*outParamList)[pos].Value(); + CLiwIterable* iterable = variant.AsIterable(); + iterable->Reset(); + + //get next result + if( iterable->NextL( variant ) ) + { + //extract content map + CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); + variant.Get( *map ); + if( map->FindL( KDataMap, variant) ) + { + variant.Get( *aOutDataMap ); + } + CleanupStack::PopAndDestroy( map ); + } + iterable->Reset(); + variant.Reset(); + } + outParamList->Reset(); + } + +// --------------------------------------------------------------------------- +// CWrtData::PublisherStatusL +// --------------------------------------------------------------------------- +// +void CWrtData::ChangePublisherStatusL(const TDesC& aStatus) + { + if( iContentId == NULL ) + { + return; + } + HBufC8* triggerName = HBufC8::NewLC(KWRTContentNameMaxLength); + triggerName->Des().Copy(aStatus); + + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + + TLiwGenericParam type( KType, TLiwVariant( KPubData ) ); + inParamList->AppendL( type ); + + CLiwDefaultMap* filter = CreateFilterLC(); + filter->InsertL(KActionTrigger, TLiwVariant(triggerName->Des()) ); + + TLiwGenericParam item( KFilter, TLiwVariant( filter )); + inParamList->AppendL( item ); + + if(iInterface) + { + iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList); + } + else + { + User::Leave( KErrNotSupported ); + } + CleanupStack::PopAndDestroy( filter ); + + inParamList->Reset(); + outParamList->Reset(); + CleanupStack::PopAndDestroy( triggerName ); + } + +// --------------------------------------------------------------------------- +// CWrtData::GetMenuItemsL // --------------------------------------------------------------------------- // void CWrtData::GetMenuItemsL() @@ -241,463 +678,120 @@ } // --------------------------------------------------------------------------- -// CreateFilterL -// --------------------------------------------------------------------------- -// -CLiwDefaultMap* CWrtData::CreateFilterLC() - { - CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); - filter->InsertL( KPublisherId, TLiwVariant( KWRTPublisher )); - filter->InsertL( KContentType, TLiwVariant( KTemplateWidget )); - filter->InsertL( KContentId, TLiwVariant( iContentId )); - return filter; - } - -// --------------------------------------------------------------------------- -// HasMenuItem -// --------------------------------------------------------------------------- -// -TBool CWrtData::HasMenuItem(const TDesC16& aMenuItem ) - { - TBool found = EFalse; - for (TInt i = 0; i < iMenuItems.Count(); i++ ) - { - if( aMenuItem == iMenuItems[i] ) - { - found = ETrue; - break; - } - } - return found; - } - -// --------------------------------------------------------------------------- -// PublishAllL -// --------------------------------------------------------------------------- -// -void CWrtData::PublishAllL( MAiContentObserver* aObserver ) - { - PublishL( aObserver ); - } - -// --------------------------------------------------------------------------- -// PublishL -// --------------------------------------------------------------------------- -// -void CWrtData::PublishL( MAiContentObserver* aObserver ) - { - CLiwDefaultMap *outDataMap = CLiwDefaultMap::NewLC(); - //Create filter criteria for requested entries in form of LIW map: - CLiwDefaultMap* filter = CreateFilterLC(); - ExecuteCommandL( filter, outDataMap, KCpData ); - CleanupStack::PopAndDestroy( filter ); - TLiwVariant variant; - if ( outDataMap->FindL( KImage1, variant ) ) - { - TInt handle = KErrBadHandle; - TUint uintHandle = 0; - TPtrC16 valPtr; - if ( variant.Get( uintHandle ) ) - { - handle = uintHandle; - } - else if ( !variant.Get( handle ) ) - { - handle = KErrBadHandle; - } - // read as a image handle - if( handle == KErrBadHandle ) - { - // no handle, so read as image path - variant.Get( valPtr ); - iPlugin->PublishImageL(aObserver, EImage1, valPtr ); - } - else - { - TInt maskHandle = KErrBadHandle; - //Look for image mask - if ( outDataMap->FindL( KImageMask, variant ) ) - { - variant.Get( maskHandle ); - } - iPlugin->PublishImageL(aObserver, EImage1, handle, maskHandle ); - } - } - - variant.Reset(); - CleanupStack::PopAndDestroy( outDataMap ); - } - -// --------------------------------------------------------------------------- -// ExecuteCommandL +// CWrtData::GetWidgetNameAndUidL // --------------------------------------------------------------------------- // -void CWrtData::ExecuteCommandL(CLiwDefaultMap* aInFilter, CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry ) - { - CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); - CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); - - TLiwGenericParam type( KType, TLiwVariant( aRegistry ) ); - inParamList->AppendL( type ); - - //append filter to input param - TLiwGenericParam item( KFilter, TLiwVariant( aInFilter )); - inParamList->AppendL( item ); - - // execute service.It is assumed that iInterface is already initiatedd - if(iInterface) - { - iInterface->ExecuteCmdL( *iCommandName, *inParamList, *outParamList); - } - else - { - User::Leave( KErrNotSupported ); - } - type.Reset(); - item.Reset(); - inParamList->Reset(); - - //extracts data map - TInt pos = 0; - outParamList->FindFirst( pos, KResults ); - if( pos != KErrNotFound ) - // results present - { - //extract iterator on results list - TLiwVariant variant = (*outParamList)[pos].Value(); - CLiwIterable* iterable = variant.AsIterable(); - iterable->Reset(); - - //get next result - if( iterable->NextL( variant ) ) - { - //extract content map - CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); - variant.Get( *map ); - if( map->FindL( KDataMap, variant) ) - { - variant.Get( *aOutDataMap ); - } - CleanupStack::PopAndDestroy( map ); - } - iterable->Reset(); - variant.Reset(); - } - outParamList->Reset(); - } - -// --------------------------------------------------------------------------- -// ExecuteActionL -// --------------------------------------------------------------------------- -// -void CWrtData::ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger ) - { - HBufC8* triggerName = HBufC8::NewLC( KWRTContentNameMaxLength ); +void CWrtData::GetWidgetNameAndUidL(TDes& aName, TDes& aAppUID ) + { + CLiwDefaultMap *outDataMap = CLiwDefaultMap::NewLC(); + //Create filter criteria for requested entries in form of LIW map: + CLiwDefaultMap* filter = CreateFilterLC(); + ExecuteCommandL( filter, outDataMap, KPubData ); + CleanupStack::PopAndDestroy( filter ); - CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); - CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); - CLiwDefaultMap* filter = NULL; - - triggerName->Des().Copy(aTrigger); - if ( aObjectId == KPubData ) - { - // this trigger belongs to publisher registery. - // in such case it is assumed that all the items in the widgets - // belongs to same publisher, type and id. - TLiwGenericParam cptype( KType, TLiwVariant( KPubData ) ); - inParamList->AppendL( cptype ); - cptype.Reset(); - // use the first item configuration to create the filter - filter = CreateFilterLC(); - } - else - { - if ( aObjectId == KMenuItem16 ) - { - TInt pos = KErrNotFound; - for (TInt i = 0; i < iMenuItems.Count(); i++) - { - if ( aTrigger == iMenuItems[i] ) - { - pos = i; - break; - } - } - if( pos == KErrNotFound ) - { - // No such menu items - CleanupStack::PopAndDestroy( triggerName ); - return; - } - triggerName->Des().Copy( iMenuTriggers[pos]->Des() ); - filter = CreateFilterLC(); - } - else - { - //Create filter criteria for requested entries in form of LIW map: - filter = CreateFilterLC(); - } - //append type to inparam list - TLiwGenericParam cptype( KType, TLiwVariant( KCpData ) ); - inParamList->AppendL( cptype ); - cptype.Reset(); - } - - filter->InsertL( KActionTrigger, TLiwVariant( triggerName->Des() ) ); - //append filter to input param - TLiwGenericParam item( KFilter, TLiwVariant( filter ) ); - inParamList->AppendL( item ); - iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList ); - - CleanupStack::PopAndDestroy( filter ); - CleanupStack::PopAndDestroy( triggerName ); - item.Reset(); - - inParamList->Reset(); - outParamList->Reset(); - - } - -// --------------------------------------------------------------------------- -// RegisterL -// --------------------------------------------------------------------------- -// -void CWrtData::RegisterL() - { - CLiwDefaultMap* filter = CreateFilterLC(); - filter->InsertL( KOperation, TLiwVariant( KAddUpdateDelete ) ); - iObserver->RegisterL(filter); - CleanupStack::PopAndDestroy( filter ); + TLiwVariant variant; + if ( outDataMap->FindL(KWidgetInfo, variant) ) + { + CLiwDefaultMap* widgetInfoMap = CLiwDefaultMap::NewLC(); + variant.Get( *widgetInfoMap ); + variant.Reset(); + if ( widgetInfoMap->FindL( KWidgetName, variant ) ) + { + aName.Copy(variant.AsDes()); + variant.Reset(); + if ( widgetInfoMap->FindL( KWidgetIcon, variant ) ) + { + aAppUID.Copy(variant.AsDes()); + } + } + CleanupStack::PopAndDestroy( widgetInfoMap ); + } + variant.Reset(); + CleanupStack::PopAndDestroy( outDataMap ); } // --------------------------------------------------------------------------- -// RefreshL -// --------------------------------------------------------------------------- -// -void CWrtData::RefreshL( TDesC& aPublisher, TDesC& aContentType, - TDesC& aContentId, TDesC& aOperation ) - { - if ( aPublisher == KWRTPublisher() && aContentType == KTemplateWidget() - && aContentId == iContentId ) - { - iPlugin->RefreshL( aOperation); - } - } - -// --------------------------------------------------------------------------- -// IsPluginActive -// --------------------------------------------------------------------------- -// -TBool CWrtData::IsPluginActive() - { - return iPlugin->IsActive(); - } - -// --------------------------------------------------------------------------- -// PublisherStatusL +// CWrtData::ResolveUid // --------------------------------------------------------------------------- // -void CWrtData::ChangePublisherStatusL(const TDesC& aStatus) +TBool CWrtData::ResolveUid(const TDesC& aUidDes, TUid& aUid ) { - if( iContentId == NULL ) - { - return; - } - HBufC8* triggerName = HBufC8::NewLC(KWRTContentNameMaxLength); - triggerName->Des().Copy(aStatus); - - CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); - CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); - - TLiwGenericParam type( KType, TLiwVariant( KPubData ) ); - inParamList->AppendL( type ); - - CLiwDefaultMap* filter = CreateFilterLC(); - filter->InsertL(KActionTrigger, TLiwVariant(triggerName->Des()) ); - - TLiwGenericParam item( KFilter, TLiwVariant( filter )); - inParamList->AppendL( item ); - - if(iInterface) - { - iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList); - } - else - { - User::Leave( KErrNotSupported ); - } - CleanupStack::PopAndDestroy( filter ); - - inParamList->Reset(); - outParamList->Reset(); - CleanupStack::PopAndDestroy( triggerName ); - } + // Syntax: uid(0x12345678) + TInt error = KErrNotFound; + TInt pos = aUidDes.FindF( KUid ); + if( pos == 0 ) + { + // Skip skin token + pos += KUid().Length(); + + // Initialize lexer + TLex lex( aUidDes.Mid( pos ) ); -// --------------------------------------------------------------------------- -// ResumeL -// --------------------------------------------------------------------------- -// -void CWrtData::ResumeL() - { - ChangePublisherStatusL( KResume ); - } - -// --------------------------------------------------------------------------- -// SuspendL -// --------------------------------------------------------------------------- -// -void CWrtData::SuspendL() - { - ChangePublisherStatusL( KSuspend ); - } - -// --------------------------------------------------------------------------- -// ActivateL -// --------------------------------------------------------------------------- -// -void CWrtData::ActivateL() - { - ChangePublisherStatusL( KActive ); - } - -// --------------------------------------------------------------------------- -// DeActivateL -// --------------------------------------------------------------------------- -// -void CWrtData::DeActivateL() - { - ChangePublisherStatusL( KDeActive ); - } - -// --------------------------------------------------------------------------- -// OnLineL -// --------------------------------------------------------------------------- -// -void CWrtData::OnLineL() - { - ChangePublisherStatusL( KOnLine ); + // Check left parenthesis + if ( lex.Get() == KLeftParenthesis ) + { + lex.SkipSpaceAndMark(); + lex.SkipCharacters(); + + TPtrC mtoken = lex.MarkedToken(); + pos = mtoken.FindF( KHexPrefix ); + if ( pos == 0 ) + { + TLex lex( mtoken.Mid( KHexPrefix().Length() ) ); + TUint id = 0; + error = lex.Val( id, EHex ); + aUid = TUid::Uid( (TInt)id ); + } + else + { + TInt id( 0 ); + error = lex.Val( id ); + aUid.iUid = id; + } + } + } + return (error == KErrNone ); } // --------------------------------------------------------------------------- -// offLineL -// --------------------------------------------------------------------------- -// -void CWrtData::OffLineL() - { - ChangePublisherStatusL( KOffLine ); - } - -// --------------------------------------------------------------------------- -// InActiveL -// --------------------------------------------------------------------------- -// -void CWrtData::InActiveL() - { - ChangePublisherStatusL( KInActive ); - } - -// --------------------------------------------------------------------------- -// UpdatePublisherStatusL -// --------------------------------------------------------------------------- -// -void CWrtData::UpdatePublisherStatusL() - { - // Resent the plugin status to publisher - ActivateL(); - if ( iPlugin->IsActive() ) - { - ResumeL(); - } - else - { - SuspendL(); - } - // forward the network status if it uses. - if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOnline ) - { - OnLineL(); - } - else if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOffline ) - { - OffLineL(); - } - } - -// --------------------------------------------------------------------------- -// ResolveSkinItemId +// CWrtData::CreateIconFromUidL // --------------------------------------------------------------------------- // -TBool CWrtData::ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, - TInt& abitmapId, TInt& aMaskId, TDes& aFilename ) - { - // Syntax: skin( ):mif(filename bimapId maskId) - TInt error = KErrNotFound; - TInt pos = aPath.FindF( KSkin ); - if( pos != KErrNotFound ) - { - // Skip skin token - pos += KSkin().Length(); - - // Initialize lexer - TLex lex( aPath.Mid( pos ) ); - lex.SkipSpace(); - - // Check left parenthesis - if (lex.Get() == KLeftParenthesis ) - { - //lex.SkipSpace(); - - TInt majorId( 0 ); - TInt minorId( 0 ); - - // Resolve major id - error = lex.Val( majorId ); - - // Resolve minor id - lex.SkipSpace(); - error |= lex.Val( minorId ); - - // initilize skin item id object - aItemId.Set( majorId, minorId ); - } - } +void CWrtData::CreateIconFromUidL(TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid ) + { + RApaLsSession lsSession; + User::LeaveIfError( lsSession.Connect() ); + CleanupClosePushL( lsSession ); // lsSession (1) + + CArrayFixFlat* sizeArray = new(ELeave) CArrayFixFlat( 5 ); + CleanupStack::PushL( sizeArray ); + if ( KErrNone == lsSession.GetAppIconSizes(aAppUid, *sizeArray) ) + { + if ( sizeArray->Count() ) + { + // There are other icon sizes + TInt idx = 0; + TInt size( sizeArray->At(idx).iWidth * sizeArray->At(idx).iHeight ); + for ( TInt i = 1; i < sizeArray->Count(); i++ ) + { + if ( ( sizeArray->At(i).iWidth * sizeArray->At(i).iHeight ) > size ) + { + idx = i; + size = sizeArray->At(idx).iWidth * sizeArray->At(idx).iHeight; + } + } - if( (error == KErrNone && aPath.FindF( KColon ) != KErrNotFound ) - || ( error == KErrNotFound ) ) - { - error = KErrNotFound; - pos = aPath.FindF( KMif ); - if ( pos != KErrNotFound ) - { - pos += KMif().Length(); - // Initialize lexer - TLex lex( aPath.Mid( pos ) ); - lex.SkipSpace(); - - // Check left parenthesis - if (lex.Get() == KLeftParenthesis ) - { - lex.SkipSpaceAndMark(); - lex.SkipCharacters(); - // Resolve MifFile name - aFilename.Copy(lex.MarkedToken()); - if( aFilename.Length()!= 0) - { - // Resolve bitmap id - lex.SkipSpace(); - error = lex.Val( abitmapId ); - - // Resolve mask id - // dont return error if it is not found, that is ok - lex.SkipSpace(); - lex.Val( aMaskId ); - } - else - { - error = KErrNotFound; - } - } - } - } - return (error == KErrNone ); - } + CApaMaskedBitmap* appBitMap = CApaMaskedBitmap::NewLC(); + if ( KErrNone == lsSession.GetAppIcon( aAppUid, sizeArray->At(idx), + *appBitMap ) ) + { + aHandle = appBitMap->Handle(); + aMaskHandle = appBitMap->Mask()->Handle(); + } + CleanupStack::PopAndDestroy( appBitMap ); + } + } + CleanupStack::PopAndDestroy( sizeArray ); + CleanupStack::PopAndDestroy( &lsSession ); + } + diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/wrtdataplugin/src/wrtdataobserver.cpp --- a/idlefw/plugins/wrtdataplugin/src/wrtdataobserver.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdataobserver.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -16,12 +16,40 @@ * */ + +// INCLUDE FILES #include #include #include +#include #include "wrtdata.h" #include "wrtdataobserver.h" #include "wrtdatapluginconst.h" + +// --------------------------------------------------------------------------- +// Factory method construction +// --------------------------------------------------------------------------- +// +CWrtDataObserver * CWrtDataObserver::NewL( MLiwInterface* aInterface, CWrtData* aData ) + { + CWrtDataObserver * self = new (ELeave) CWrtDataObserver(); + CleanupStack::PushL( self ); + self->ConstructL( aInterface, aData ); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// 2n phase constructor +// --------------------------------------------------------------------------- +// +void CWrtDataObserver::ConstructL( MLiwInterface* aInterface, CWrtData* aData ) + { + iData = aData; + iInterface = aInterface; + } + // --------------------------------------------------------------------------- // Constructor // --------------------------------------------------------------------------- @@ -43,82 +71,7 @@ } // --------------------------------------------------------------------------- -// Register for notifications -// --------------------------------------------------------------------------- -// -void CWrtDataObserver::RegisterL( CLiwDefaultMap* aFilter ) - { - CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL(); - CleanupStack::PushL( inParamList ); - CLiwGenericParamList* outParamList = CLiwGenericParamList::NewL(); - CleanupStack::PushL( outParamList ); - - // Fill in input list for RequestNotification command - inParamList->AppendL(TLiwGenericParam(KType,TLiwVariant(KCpData_PubData))); - inParamList->AppendL(TLiwGenericParam(KFilter ,TLiwVariant(aFilter))); - - iError = KErrNone; - TRAP( iError, iInterface->ExecuteCmdL( - KRequestNotification, - *inParamList, - *outParamList, - 0, - this ) ); - - CleanupStack::PopAndDestroy( outParamList ); - CleanupStack::PopAndDestroy( inParamList ); - } - -// --------------------------------------------------------------------------- -// Sing off to notification -// --------------------------------------------------------------------------- -// -void CWrtDataObserver ::ReleaseL() - { - if( iInterface ) - { - CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL(); - CleanupStack::PushL( inParamList ); - CLiwGenericParamList* outParamList = CLiwGenericParamList::NewL(); - CleanupStack::PushL( outParamList ); - - TInt err(KErrNone); - TRAP(err, iInterface->ExecuteCmdL( - KRequestNotification, - *inParamList, - *outParamList, - KLiwOptCancel, - this )); - - CleanupStack::PopAndDestroy( outParamList ); - CleanupStack::PopAndDestroy( inParamList ); - } - } - -// --------------------------------------------------------------------------- -// Factory method construction -// --------------------------------------------------------------------------- -// -CWrtDataObserver * CWrtDataObserver::NewL( MLiwInterface* aInterface, CWrtData* aData ) - { - CWrtDataObserver * self = new (ELeave) CWrtDataObserver(); - CleanupStack::PushL( self ); - self->ConstructL( aInterface, aData ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// 2n phase constructor -// --------------------------------------------------------------------------- -// -void CWrtDataObserver::ConstructL( MLiwInterface* aInterface, CWrtData* aData ) - { - iData = aData; - iInterface = aInterface; - } - -// --------------------------------------------------------------------------- +// CWrtDataObserver::HandleNotifyL // Handles Published content notification // --------------------------------------------------------------------------- // @@ -150,71 +103,54 @@ CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); variant.Get( *map ); - TBool found; - found = map->FindL( KOperation, variant ); - if (found) + if (map->FindL( KOperation, variant )) { operation = variant.AsDes().AllocLC(); - } - variant.Reset(); - if( operation->Des() != KOperationExecute ) - { - // Nothing to update for execute action - HBufC16* publisher = NULL; - HBufC16* contentType = NULL; - HBufC16* contentId = NULL; - found = map->FindL( KFLAG, variant ); - if ( found) - { - // notification from publisher registry - if ( operation->Des() != KOperationDelete ) - { - iData->UpdatePublisherStatusL(); - } - } - // ignore update if plugin is in suspend mode - else if ( iData->IsPluginActive() ) - { - // notification from content registry - found = map->FindL( KPublisherId, variant ); - if (found) - { - publisher = variant.AsDes().AllocLC(); - } - variant.Reset(); - found = map->FindL( KContentType, variant ); - if (found) - { - contentType = variant.AsDes().AllocLC(); - } - variant.Reset(); - found = map->FindL( KContentId, variant ); - if (found) - { - contentId = variant.AsDes().AllocLC(); - } - variant.Reset(); - iData->RefreshL( *publisher, *contentType, *contentId, *operation ); - - if ( contentId ) - { - CleanupStack::PopAndDestroy( contentId ); - } - if ( contentType ) - { - CleanupStack::PopAndDestroy( contentType ); - } - if ( publisher ) - { - CleanupStack::PopAndDestroy( publisher ); - } - } - variant.Reset(); - } - if ( operation ) - { - CleanupStack::PopAndDestroy( operation ); - } + variant.Reset(); + if( operation->Des() != KOperationExecute ) + { + // Nothing to update for execute action + if ( map->FindL( KFLAG, variant )) + { + // notification from publisher registry + if ( operation->Des() != KOperationDelete ) + { + iData->UpdatePublisherStatusL(); + } + } + // ignore update if plugin is in suspend mode + else if ( iData->IsPluginActive() ) + { + HBufC16* contentId = NULL; + CLiwDefaultMap* dataMap = NULL; + // Get the data Map if available + if ( map->FindL( KDataMap, variant)) + { + TPtrC8 data = variant.AsData(); + RDesReadStream datastrm ( data ); + dataMap = CLiwDefaultMap::NewLC(datastrm); + } + // Get the content Id + if ( map->FindL( KContentId, variant )) + { + contentId = variant.AsDes().AllocLC(); + // Refresh only if contentId is retrieved + iData->RefreshL( *contentId, *operation, dataMap ); + CleanupStack::PopAndDestroy( contentId ); + } + + if ( dataMap ) + { + CleanupStack::PopAndDestroy( dataMap ); + } + } + variant.Reset(); + } + if ( operation ) + { + CleanupStack::PopAndDestroy( operation ); + } + } CleanupStack::PopAndDestroy( map ); } CleanupStack::PopAndDestroy( listOfMaps ); @@ -222,3 +158,57 @@ return aErrorCode; } +// --------------------------------------------------------------------------- +// CWrtDataObserver::RegisterL +// Register for notifications +// --------------------------------------------------------------------------- +// +void CWrtDataObserver::RegisterL( CLiwDefaultMap* aFilter ) + { + CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( inParamList ); + CLiwGenericParamList* outParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( outParamList ); + + // Fill in input list for RequestNotification command + inParamList->AppendL(TLiwGenericParam(KType,TLiwVariant(KCpData_PubData))); + inParamList->AppendL(TLiwGenericParam(KFilter ,TLiwVariant(aFilter))); + + iError = KErrNone; + TRAP( iError, iInterface->ExecuteCmdL( + KRequestNotification, + *inParamList, + *outParamList, + 0, + this ) ); + + CleanupStack::PopAndDestroy( outParamList ); + CleanupStack::PopAndDestroy( inParamList ); + } + +// --------------------------------------------------------------------------- +// CWrtDataObserver ::ReleaseL +// Sing off to notification +// --------------------------------------------------------------------------- +// +void CWrtDataObserver ::ReleaseL() + { + if( iInterface ) + { + CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( inParamList ); + CLiwGenericParamList* outParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( outParamList ); + + TInt err(KErrNone); + TRAP(err, iInterface->ExecuteCmdL( + KRequestNotification, + *inParamList, + *outParamList, + KLiwOptCancel, + this )); + + CleanupStack::PopAndDestroy( outParamList ); + CleanupStack::PopAndDestroy( inParamList ); + } + } diff -r b7904b40483f -r ff572005ac23 idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp --- a/idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -16,6 +16,9 @@ * */ + + +// INCLUDE FILES #include #include #include @@ -125,291 +128,6 @@ } // --------------------------------------------------------------------------- -// Publishes widget's texts and images -// --------------------------------------------------------------------------- -// -void CWrtDataPlugin::PublishL() - { - User::LeaveIfError( iRfs.Connect() ); - - TInt observers( iObservers.Count() ); - TInt transactionId = reinterpret_cast( this ); - - for ( int i = 0; i < observers; i++ ) - { - MAiContentObserver* observer = iObservers[i]; - - if ( observer->StartTransaction( transactionId ) == KErrNone ) - {// Publish all the data - iData->PublishAllL(observer); - observer->Commit( transactionId ); - } - - // Release memory of the published text - iDataArray.ResetAndDestroy(); - // Release memory of the published icons - iIconArray.Reset(); - } - iRfs.Close(); - } - -// --------------------------------------------------------------------------- -// Publish a specific text of the widget -// --------------------------------------------------------------------------- -// -/* -void CWrtDataPlugin::PublishTextL(MAiContentObserver* aObserver, - TInt& aContentId, TDesC16& aContentValue) - { - if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) - { - if( aContentValue.Length() > 0 ) - { - HBufC* contentText = HBufC::NewLC(aContentValue.Size()); - TPtr16 cDes = contentText->Des(); - cDes.Copy(aContentValue); - aObserver->Publish( *this, aContentId, cDes, aContentId ); - iDataArray.AppendL( contentText ); - CleanupStack::Pop( contentText ); - } - else - { - aObserver->Clean( *this, aContentId, aContentId ); - } - } - }*/ - -// --------------------------------------------------------------------------- -// Publish a specific image of the widget -// --------------------------------------------------------------------------- -// -void CWrtDataPlugin::PublishImageL(MAiContentObserver* aObserver, - TContentItem aContentId, TDesC16& aPath ) - { - TInt err = KErrNone; - TAknsItemID iconId; - iconId.iMajor=0; - iconId.iMinor=0; - TInt bitmapId(0); - TInt maskId(0); - TFileName fileName; - CGulIcon* icon = NULL; - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) - { - TBool inSkin = iData->ResolveSkinIdAndMifId( aPath, iconId, bitmapId, maskId, fileName ); - if ( inSkin ) - { - // Load from skin - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - if ( iconId.iMajor != 0 && iconId.iMajor!=0 ) - { - // Create icon with fall back - TRAP_IGNORE(AknsUtils::CreateIconL( - skin, - iconId, - bitmap, - mask, - fileName, /* backup filename */ - bitmapId, /* backup bit map id */ - maskId)); /* backup mask id */ - } - else if( bitmapId !=0 ) - { - if ( maskId!=0 ) - { - // Create icon from Mif filename , bitmap id and mask id - TRAP_IGNORE(icon = AknsUtils::CreateGulIconL( - skin, - iconId, - fileName, - bitmapId, - maskId) ); - } - else - { - TRAP_IGNORE(AknsUtils::CreateIconL( - skin, - iconId, - bitmap, - fileName, /* backup filename */ - bitmapId)); /* backup bit map id */ - } - } - - if ( icon == NULL && bitmap != NULL ) - { - icon = CGulIcon::NewL( bitmap, mask ); - } - - if ( icon != NULL ) // Syntax correct but icon not found - { - aObserver->PublishPtr( *this, aContentId, icon , aContentId ); - iIconArray.Append(icon); - } - else - { - err = KErrNotFound; - aObserver->Clean( *this, aContentId, aContentId ); - } - } - else // Interpret as File path - { - RFile* iconFile = new (ELeave) RFile(); - err = iconFile->Open( iRfs, aPath, EFileShareReadersOnly | EFileRead ); - if( err == KErrNone ) - { - aObserver->Publish( *this, aContentId, *iconFile, aContentId ); - } - else - { - aObserver->Clean( *this, aContentId, aContentId ); - } - iconFile->Close(); - delete iconFile; - iconFile = NULL; - } - } - } - -// --------------------------------------------------------------------------- -// Publish a image of the widget -// --------------------------------------------------------------------------- -// -void CWrtDataPlugin::PublishImageL(MAiContentObserver* aObserver, - TContentItem aContentId, TInt aHandle, TInt aMaskHandle ) - { - if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) - { - if( aHandle != KErrBadHandle ) - { - CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); - if( KErrNone == bitmap->Duplicate( aHandle) ) - { - // Take the ownership - CGulIcon* icon = CGulIcon::NewL(bitmap); - if( aMaskHandle != KErrBadHandle ) - { - CFbsBitmap* mask = new (ELeave) CFbsBitmap(); - if (KErrNone == mask->Duplicate( aMaskHandle) ) - { - icon->SetMask( mask ); - } - } - aObserver->PublishPtr( *this, aContentId, icon , aContentId ); - iIconArray.Append(icon); - } - else - { - delete bitmap; - bitmap = NULL; - aObserver->Clean( *this, aContentId, aContentId ); - } - } - } - } - -// --------------------------------------------------------------------------- -// Gets the id of a content -// --------------------------------------------------------------------------- -// -TInt CWrtDataPlugin::GetIdL( TDesC16& aObjectId) - { - TInt id = KErrNotFound; - HBufC16* objectId = HBufC16::NewLC( KAiContentIdMaxLength ); - for( TInt i = 0;i< iDataCount; i++ ) - { - objectId->Des().Copy((TUint16*)iContentModel[i].cid); - if( aObjectId == objectId->Des() ) - { - id = iContentModel[i].id; - break; - } - } - CleanupStack::PopAndDestroy( objectId ); - return id; - } - - -// --------------------------------------------------------------------------- -// Gets type of a content -// --------------------------------------------------------------------------- -// -void CWrtDataPlugin::GetTypeL(TDesC16& aObjectId, TDes16& aType ) - { - HBufC16* objectId = HBufC16::NewLC( KAiContentIdMaxLength ); - for( TInt i = 0;i< iDataCount; i++ ) - { - objectId->Des().Copy((TUint16*)iContentModel[i].cid); - if( aObjectId == objectId->Des() ) - { - if( iContentModel[i].type == KAiContentTypeText) - { - aType.Copy( KText ); - } - else if( iContentModel[i].type == KAiContentTypeBitmap) - { - aType.Copy( KImage ); - } - break; - } - } - CleanupStack::PopAndDestroy( objectId ); - } - -// --------------------------------------------------------------------------- -//Refresh a specific image of text in the widget -// --------------------------------------------------------------------------- -// -void CWrtDataPlugin::RefreshL(TDesC16& aOperation) - { - User::LeaveIfError( iRfs.Connect() ); - TInt observers( iObservers.Count() ); - TInt transactionId = reinterpret_cast( this ); - - for ( TInt obsIndex = 0; obsIndex < observers; obsIndex++ ) - { - MAiContentObserver* observer = iObservers[obsIndex]; - - if ( observer->StartTransaction( transactionId ) == KErrNone ) - { - if( aOperation != KOperationDelete) - { - iData->PublishL( observer ); - } - else - { - Clean( observer , EImage1 ) ; - } - - observer->Commit( transactionId ); - } - - // Relese memory of the published text - iDataArray.ResetAndDestroy(); - // Release memory of the published icons - iIconArray.Reset(); - } - - iRfs.Close(); - } - -// --------------------------------------------------------------------------- -// Cleans a data from the widget -// --------------------------------------------------------------------------- -// -void CWrtDataPlugin::Clean(MAiContentObserver* aObserver, - TInt aContentId ) - { - if ( aObserver->CanPublish( *this, aContentId, aContentId ) ) - { - aObserver->Clean( *this, aContentId, aContentId ); - } - - } -// --------------------------------------------------------------------------- // From class CAiContentPublisher // Plug-in is requested to unload its engines due backup operation // --------------------------------------------------------------------------- @@ -440,19 +158,19 @@ void CWrtDataPlugin::Suspend( TAiTransitionReason aReason ) { switch( aReason ) - { - case EAiKeylockDisabled: + { + case EAiKeylockDisabled: case EAiKeylockEnabled: - { - // handled in resume - break; - } + { + // handled in resume + break; + } default : - { - iPluginState = ESuspend; - TRAP_IGNORE ( iData->SuspendL() ); - } - } + { + iPluginState = ESuspend; + TRAP_IGNORE ( iData->SuspendL() ); + } + } } // --------------------------------------------------------------------------- @@ -514,12 +232,13 @@ { MAiPluginContentItem& contentItem = (contentItemsArr[i])->AiPluginContentItem(); iContentModel[i].id = i; - /*if( contentItem.Type() == KText() || contentItem.Type() == KNewsTicker() ) + if( contentItem.Type() == KText() ) { // text iContentModel[i].type = KAiContentTypeText; - }*/ - if( contentItem.Type() == KImage() ) + } + if( contentItem.Type() == KImage() || + contentItem.Type() == KAnimation() ) { // image iContentModel[i].type = KAiContentTypeBitmap; @@ -566,17 +285,17 @@ TAny* CWrtDataPlugin::Extension( TUid aUid ) { if ( aUid == KExtensionUidProperty ) - { + { return static_cast( this ); - } + } else if (aUid == KExtensionUidEventHandler) - { + { return static_cast( this ); - } + } else - { + { return NULL; - } + } } // --------------------------------------------------------------------------- @@ -617,18 +336,18 @@ { switch ( aProperty ) { - case EAiPublisherInfo: - { - if( aValue ) - { - const TAiPublisherInfo* info = static_cast( aValue ); - iInfo.iName.Copy( info->iName ); - iInfo.iNamespace.Copy( info->iNamespace ); - } - break; - } - default: - break; + case EAiPublisherInfo: + { + if( aValue ) + { + const TAiPublisherInfo* info = static_cast( aValue ); + iInfo.iName.Copy( info->iName ); + iInfo.iNamespace.Copy( info->iNamespace ); + } + break; + } + default: + break; } } @@ -638,9 +357,9 @@ // --------------------------------------------------------------------------- // void CWrtDataPlugin::HandleEvent( TInt /*aEvent*/, const TDesC& /*aParam*/ ) - { + { // This is not as there is no event id to retrieve in this dynamic plugin. - } + } // --------------------------------------------------------------------------- // From class MAiEventHandlerExtension. @@ -659,102 +378,92 @@ // --------------------------------------------------------------------------- // TBool CWrtDataPlugin::HasMenuItem( const TDesC16& aMenuItem ) - { - return iData->HasMenuItem ( aMenuItem ); - } + { + return iData->HasMenuItem ( aMenuItem ); + } // --------------------------------------------------------------------------- -// From class CAiContentPublisher -// framework instructs plug-in that it is allowed to consume CPU resources +// Gets the id of a content +// --------------------------------------------------------------------------- +// +TInt CWrtDataPlugin::GetIdL( TDesC16& aObjectId) + { + TInt id = KErrNotFound; + HBufC16* objectId = HBufC16::NewLC( KAiContentIdMaxLength ); + for( TInt i = 0;i< iDataCount; i++ ) + { + objectId->Des().Copy((TUint16*)iContentModel[i].cid); + if( aObjectId == objectId->Des() ) + { + id = iContentModel[i].id; + break; + } + } + CleanupStack::PopAndDestroy( objectId ); + return id; + } + + +// --------------------------------------------------------------------------- +// Gets type of a content // --------------------------------------------------------------------------- // -void CWrtDataPlugin::DoResumeL( TAiTransitionReason aReason ) +void CWrtDataPlugin::GetTypeL(TDesC16& aObjectId, TDes16& aType ) + { + HBufC16* objectId = HBufC16::NewLC( KAiContentIdMaxLength ); + for( TInt i = 0;i< iDataCount; i++ ) + { + objectId->Des().Copy((TUint16*)iContentModel[i].cid); + if( aObjectId == objectId->Des() ) + { + if( iContentModel[i].type == KAiContentTypeText) + { + aType.Copy( KText ); + } + else if( iContentModel[i].type == KAiContentTypeBitmap) + { + aType.Copy( KImage ); + } + break; + } + } + CleanupStack::PopAndDestroy( objectId ); + } + +// --------------------------------------------------------------------------- +//Refresh a specific image of text in the widget +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::RefreshL( TDesC16& aOperation, CLiwDefaultMap* aDataMap ) { - //update in startup phase and idle is on foreground. - switch ( aReason ) - { - case EAiIdleOnLine: - { - iNetworkStatus = EOnline; - iData->OnLineL(); - break; - } - case EAiIdleOffLine: - { - iNetworkStatus = EOffline; - iData->OffLineL(); - break; - } - case EAiIdlePageSwitch: - { - if ( iPluginState == EResume ) - { - iData->SuspendL(); - } - iPluginState = EInActive; - iData->InActiveL(); - } - break; - case EAiSystemStartup: - case EAiIdleForeground: - { - iHSForeGround = ETrue; - } - case EAiBacklightOn: - { - if ( iPluginState == ESuspend && !iKeyLockOn ) - { - iPluginState = EResume; - iData->ResumeL(); - } - break; - } - case EAiKeylockDisabled: - { - iKeyLockOn = EFalse; - // Key lock events considered only if HS is in foreground - if ( iHSForeGround && iPluginState == ESuspend ) - { - iPluginState = EResume; - iData->ResumeL(); - } - break; - } - case EAiKeylockEnabled: - { - iKeyLockOn = ETrue; - // Key lock events considered only if HS is in foreground - if ( iHSForeGround && iPluginState == EResume ) - { - iPluginState = ESuspend ; - iData->SuspendL(); - } - break; - } - case EAiScreenLayoutChanged: - { - // ignore events - break; - } - case EAiGeneralThemeChanged: - { - // ignore event - break; - } - case EAiIdleBackground: - { - iHSForeGround = EFalse; - } - default : - { - if ( iPluginState == EResume ) - { - iPluginState = ESuspend; - iData->SuspendL(); - } - break; - } - } + TInt observers( iObservers.Count() ); + TInt transactionId = reinterpret_cast( this ); + + for ( TInt obsIndex = 0; obsIndex < observers; obsIndex++ ) + { + MAiContentObserver* observer = iObservers[obsIndex]; + + if ( observer->StartTransaction( transactionId ) == KErrNone ) + { + if( ( aOperation == KOperationUpdate + || aOperation == KOperationAdd ) + && aDataMap ) + { + iData->PublishL( observer, aDataMap ); + } + else if ( aOperation == KOperationDelete ) + { + Clean( observer , EImage1 ) ; + } + + observer->Commit( transactionId ); + } + + // Relese memory of the published text + iDataArray.ResetAndDestroy(); + // Release memory of the published icons + iIconArray.Reset(); + } } // --------------------------------------------------------------------------- @@ -765,3 +474,395 @@ { return (iPluginState == EResume ); } + +// --------------------------------------------------------------------------- +// Publish a specific text of the widget +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::PublishTextL(MAiContentObserver* aObserver, + TInt aContentId, const TDesC16& aContentValue) + { + if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) + { + if( aContentValue.Length() > 0 ) + { + HBufC* contentText = HBufC::NewLC(aContentValue.Size()); + TPtr16 cDes = contentText->Des(); + cDes.Copy(aContentValue); + aObserver->Publish( *this, aContentId, cDes, aContentId ); + iDataArray.AppendL( contentText ); + CleanupStack::Pop( contentText ); + } + else + { + aObserver->Clean( *this, aContentId, aContentId ); + } + } + } + +// --------------------------------------------------------------------------- +// Publish a specific image of the widget +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::PublishImageL(MAiContentObserver* aObserver, + TContentItem aContentId, const TDesC16& aPath ) + { + TInt err = KErrNone; + TAknsItemID iconId; + iconId.iMajor=0; + iconId.iMinor=0; + TInt bitmapId(0); + TInt maskId(0); + TFileName fileName; + CGulIcon* icon = NULL; + CFbsBitmap* bitmap = NULL; + CFbsBitmap* mask = NULL; + + if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) + { + TBool inSkin = ResolveSkinIdAndMifId( aPath, iconId, bitmapId, maskId, fileName ); + if ( inSkin ) + { + // Load from skin + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + if ( iconId.iMajor != 0 && iconId.iMajor!=0 ) + { + // Create icon with fall back + TRAP_IGNORE(AknsUtils::CreateIconL( + skin, + iconId, + bitmap, + mask, + fileName, /* backup filename */ + bitmapId, /* backup bit map id */ + maskId)); /* backup mask id */ + } + else if( bitmapId !=0 ) + { + if ( maskId!=0 ) + { + // Create icon from Mif filename , bitmap id and mask id + TRAP_IGNORE(icon = AknsUtils::CreateGulIconL( + skin, + iconId, + fileName, + bitmapId, + maskId) ); + } + else + { + TRAP_IGNORE(AknsUtils::CreateIconL( + skin, + iconId, + bitmap, + fileName, /* backup filename */ + bitmapId)); /* backup bit map id */ + } + } + + if ( icon == NULL && bitmap != NULL ) + { + icon = CGulIcon::NewL( bitmap, mask ); + } + + if ( icon != NULL ) // Syntax correct but icon not found + { + aObserver->PublishPtr( *this, aContentId, icon , aContentId ); + iIconArray.Append(icon); + } + else + { + err = KErrNotFound; + aObserver->Clean( *this, aContentId, aContentId ); + } + } + else // Interpret as File path + { + RFs rfs; + User::LeaveIfError( rfs.Connect() ); + RFile* iconFile = new (ELeave) RFile(); + err = iconFile->Open( rfs, aPath, EFileShareReadersOnly | EFileRead ); + if( err == KErrNone ) + { + aObserver->Publish( *this, aContentId, *iconFile, aContentId ); + } + else + { + aObserver->Clean( *this, aContentId, aContentId ); + } + iconFile->Close(); + delete iconFile; + iconFile = NULL; + rfs.Close(); + } + } + } + +// --------------------------------------------------------------------------- +// Publish a image of the widget +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::PublishImageL(MAiContentObserver* aObserver, + TContentItem aContentId, TInt aHandle, TInt aMaskHandle ) + { + if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) + { + if( aHandle != KErrBadHandle ) + { + CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); + if( KErrNone == bitmap->Duplicate( aHandle) ) + { + // Take the ownership + CGulIcon* icon = CGulIcon::NewL(bitmap); + if( aMaskHandle != KErrBadHandle ) + { + CFbsBitmap* mask = new (ELeave) CFbsBitmap(); + if (KErrNone == mask->Duplicate( aMaskHandle) ) + { + icon->SetMask( mask ); + } + } + aObserver->PublishPtr( *this, aContentId, icon , aContentId ); + iIconArray.Append(icon); + } + else + { + delete bitmap; + bitmap = NULL; + aObserver->Clean( *this, aContentId, aContentId ); + } + } + } + } + +// --------------------------------------------------------------------------- +// Cleans a data from the widget +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::Clean(MAiContentObserver* aObserver, + TInt aContentId ) + { + if ( aObserver->CanPublish( *this, aContentId, aContentId ) ) + { + aObserver->Clean( *this, aContentId, aContentId ); + } + + } + +// --------------------------------------------------------------------------- +// Show the loading icong animation +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::ShowLoadingIcon(MAiContentObserver* aObserver) + { + aObserver->SetProperty( *this, KElement , KDisplay , KShow ); + } + +// --------------------------------------------------------------------------- +// Hides the loading icon animation +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::HideLoadingIcon(MAiContentObserver* aObserver) + { + aObserver->SetProperty( *this, KElement , KDisplay , KHide ); + } + +// --------------------------------------------------------------------------- +// Publishes widget's texts and images +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::PublishL() + { + TInt observers( iObservers.Count() ); + TInt transactionId = reinterpret_cast( this ); + + for ( int i = 0; i < observers; i++ ) + { + MAiContentObserver* observer = iObservers[i]; + + if ( observer->StartTransaction( transactionId ) == KErrNone ) + {// Publish default data + iData->PublishDefaultImageL(observer); + observer->Commit( transactionId ); + } + + // Release memory of the published text + iDataArray.ResetAndDestroy(); + // Release memory of the published icons + iIconArray.Reset(); + } + + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// framework instructs plug-in that it is allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::DoResumeL( TAiTransitionReason aReason ) + { + //update in startup phase and idle is on foreground. + switch ( aReason ) + { + case EAiIdleOnLine: + { + iNetworkStatus = EOnline; + iData->OnLineL(); + break; + } + case EAiIdleOffLine: + { + iNetworkStatus = EOffline; + iData->OffLineL(); + break; + } + case EAiIdlePageSwitch: + { + if ( iPluginState == EResume ) + { + iData->SuspendL(); + } + iPluginState = EInActive; + iData->InActiveL(); + } + break; + case EAiSystemStartup: + case EAiIdleForeground: + { + iHSForeGround = ETrue; + } + case EAiBacklightOn: + { + if ( iPluginState == ESuspend && !iKeyLockOn ) + { + iPluginState = EResume; + iData->ResumeL(); + } + break; + } + case EAiKeylockDisabled: + { + iKeyLockOn = EFalse; + // Key lock events considered only if HS is in foreground + if ( iHSForeGround && iPluginState == ESuspend ) + { + iPluginState = EResume; + iData->ResumeL(); + } + break; + } + case EAiKeylockEnabled: + { + iKeyLockOn = ETrue; + // Key lock events considered only if HS is in foreground + if ( iHSForeGround && iPluginState == EResume ) + { + iPluginState = ESuspend ; + iData->SuspendL(); + } + break; + } + case EAiScreenLayoutChanged: + { + // ignore events + break; + } + case EAiGeneralThemeChanged: + { + // ignore event + break; + } + case EAiIdleBackground: + { + iHSForeGround = EFalse; + } + default : + { + if ( iPluginState == EResume ) + { + iPluginState = ESuspend; + iData->SuspendL(); + } + break; + } + } + } + +// --------------------------------------------------------------------------- +// ResolveSkinItemId +// --------------------------------------------------------------------------- +// +TBool CWrtDataPlugin::ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, + TInt& abitmapId, TInt& aMaskId, TDes& aFilename ) + { + // Syntax: skin( ):mif(filename bimapId maskId) + TInt error = KErrNotFound; + TInt pos = aPath.FindF( KSkin ); + if( pos != KErrNotFound ) + { + // Skip skin token + pos += KSkin().Length(); + + // Initialize lexer + TLex lex( aPath.Mid( pos ) ); + lex.SkipSpace(); + + // Check left parenthesis + if (lex.Get() == KLeftParenthesis ) + { + //lex.SkipSpace(); + + TInt majorId( 0 ); + TInt minorId( 0 ); + + // Resolve major id + error = lex.Val( majorId ); + + // Resolve minor id + lex.SkipSpace(); + error |= lex.Val( minorId ); + + // initilize skin item id object + aItemId.Set( majorId, minorId ); + } + } + + if( (error == KErrNone && aPath.FindF( KColon ) != KErrNotFound ) + || ( error == KErrNotFound ) ) + { + error = KErrNotFound; + pos = aPath.FindF( KMif ); + if ( pos != KErrNotFound ) + { + pos += KMif().Length(); + // Initialize lexer + TLex lex( aPath.Mid( pos ) ); + lex.SkipSpace(); + + // Check left parenthesis + if (lex.Get() == KLeftParenthesis ) + { + lex.SkipSpaceAndMark(); + lex.SkipCharacters(); + // Resolve MifFile name + aFilename.Copy(lex.MarkedToken()); + if( aFilename.Length()!= 0) + { + // Resolve bitmap id + lex.SkipSpace(); + error = lex.Val( abitmapId ); + + // Resolve mask id + // dont return error if it is not found, that is ok + lex.SkipSpace(); + lex.Val( aMaskId ); + } + else + { + error = KErrNotFound; + } + } + } + } + return (error == KErrNone ); + } diff -r b7904b40483f -r ff572005ac23 inc/aisystemuids.hrh --- a/inc/aisystemuids.hrh Mon Jan 18 20:32:13 2010 +0200 +++ b/inc/aisystemuids.hrh Tue Jan 26 12:11:15 2010 +0200 @@ -146,6 +146,9 @@ #define AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY 0x20022FD3 #define AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY_IMPLEMENTATION 0x20022FD3 +#define AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY 0x200286E2 +#define AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY_IMPLEMENTATION 0x200286E2 + #endif // AISYSTEMUIDS_HRH diff -r b7904b40483f -r ff572005ac23 xcfw/src/xcfwengine.cpp --- a/xcfw/src/xcfwengine.cpp Mon Jan 18 20:32:13 2010 +0200 +++ b/xcfw/src/xcfwengine.cpp Tue Jan 26 12:11:15 2010 +0200 @@ -1383,8 +1383,12 @@ } } } - //Store DTD name to tree, so it is available at save. - iTree->SetDTDNameL( iDTD->Des() ); + + if ( iDTD ) + { + //Store DTD name to tree, so it is available at save. + iTree->SetDTDNameL( iDTD->Des() ); + } } // End of File