# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1286141911 -10800 # Node ID e36b2f4799c003ed93d7cf3c92917d634a5f2438 # Parent 0b3699f6c6546878d2b9f3e2971a56d178aca6b6 Revision: 201037 Kit: 201039 diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityfw.pro --- a/activityfw/activityfw.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/activityfw.pro Mon Oct 04 00:38:31 2010 +0300 @@ -28,6 +28,4 @@ SUBDIRS += activityserviceplugin/tsrc \ } -symbian:SUBDIRS += activityserviceplugin/symbianinstaller - symbian:include(rom.pri) \ No newline at end of file diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/activityserviceplugin.pro --- a/activityfw/activityserviceplugin/activityserviceplugin.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/activityserviceplugin/activityserviceplugin.pro Mon Oct 04 00:38:31 2010 +0300 @@ -20,6 +20,9 @@ CONFIG += plugin include(activityserviceplugin.pri) +CONFIG += qtservice +QTSERVICE.DESCRIPTOR = data/afservice.xml + DEFINES += AFACTIVITIES_LIB INCLUDEPATH += ./inc \ @@ -90,7 +93,7 @@ xml.sources = ./data/afservice.xml xml.path = $$RESOURCE_FILES_DIR/activity - DEPLOYMENT += xml + DEPLOYMENT += xml plugin #temporary workaround BLD_INF_RULES.prj_exports += "data/afservice.xml z:/resource/activity/afservice.xml" diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/inc/afmanager.h --- a/activityfw/activityserviceplugin/inc/afmanager.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/activityserviceplugin/inc/afmanager.h Mon Oct 04 00:38:31 2010 +0300 @@ -39,7 +39,7 @@ void launchActivity(const QString &uri); void launchActivity(const QUrl &uri); void launchActivity(int applicationId, const QString &activityId, const QVariantHash& parameters = QVariantHash()); - void getThumbnail(QSize resolution,const QString &thumbnailPath, void *data =0); + void getThumbnail(const QString &thumbnailPath, void *data =0); signals: void thumbnailReady(QPixmap, void *); diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/inc/afstorageproxy.h --- a/activityfw/activityserviceplugin/inc/afstorageproxy.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/activityserviceplugin/inc/afstorageproxy.h Mon Oct 04 00:38:31 2010 +0300 @@ -33,8 +33,6 @@ virtual ~AfStorageProxy(); public: - bool addActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot); - bool updateActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot); bool saveActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot); bool removeActivity(int applicationId, const QString &activityId); bool removeApplicationActivities(int applicationId); @@ -44,7 +42,7 @@ bool activityMetaData(QVariantHash &metadata, int applicationId, const QString &activityId); bool waitActivity(); bool launchActivity(int applicationId, const QString &activityUri); - bool getThumbnail(const QSize &size, const QString &imagePath, void *userData); + bool getThumbnail(const QString &imagePath, void *userData); bool notifyDataChange(); signals: diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/s60/inc/afstorageproxy_p.h --- a/activityfw/activityserviceplugin/s60/inc/afstorageproxy_p.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/activityserviceplugin/s60/inc/afstorageproxy_p.h Mon Oct 04 00:38:31 2010 +0300 @@ -36,8 +36,6 @@ ~AfStorageProxyPrivate(); public: - bool addActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot); - bool updateActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot); bool saveActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot); bool removeActivity(int applicationId, const QString &activityId); bool removeApplicationActivities(int applicationId); @@ -47,7 +45,7 @@ bool activityMetaData(QVariantHash &metadata, int applicationId, const QString &activityId); bool waitActivity(); bool launchActivity(int applicationId, const QString &activityUri); - bool getThumbnail(const QSize &size, const QString &imagePath, void *userData); + bool getThumbnail(const QString &imagePath, void *userData); bool notifyDataChange(); public: // from MAfAsyncRequestObserver @@ -62,6 +60,9 @@ QVariantHash extractMetadata(CAfEntry *entry, bool includePublicData); QString activityDisplayText(CAfEntry *entry); + TTime convertQDateTimeToTTime(const QDateTime ×tamp) const; + QDateTime convertTTimeToQDateTime(const TTime &s60Time) const; + private: CAfStorageClient *mClient; AfStorageProxy *q_ptr; diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/s60/src/afstorageproxy_p.cpp --- a/activityfw/activityserviceplugin/s60/src/afstorageproxy_p.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/activityserviceplugin/s60/src/afstorageproxy_p.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -21,6 +21,7 @@ #include #include +#include #include @@ -45,38 +46,6 @@ mAppArcSession.Close(); } -bool AfStorageProxyPrivate::addActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot) -{ - int screenshotHandle(-1); - CFbsBitmap* bitmap(screenshot.toSymbianCFbsBitmap()); - if (bitmap) { - screenshotHandle = bitmap->Handle(); - } - - CAfEntry *entry = createSaveEntry(applicationId, activityId, customActivityName, activityData, metadata); - int result = mClient->addActivity(*entry, screenshotHandle); - delete entry; - delete bitmap; - - return KErrNone == result; -} - -bool AfStorageProxyPrivate::updateActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot) -{ - int screenshotHandle(-1); - CFbsBitmap* bitmap(screenshot.toSymbianCFbsBitmap()); - if (bitmap) { - screenshotHandle = bitmap->Handle(); - } - - CAfEntry *entry = createSaveEntry(applicationId, activityId, customActivityName, activityData, metadata); - int result = mClient->updateActivity(*entry, screenshotHandle); - delete entry; - delete bitmap; - - return KErrNone == result; -} - bool AfStorageProxyPrivate::saveActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot) { int screenshotHandle(-1); @@ -181,10 +150,10 @@ return KErrNone == result; } -bool AfStorageProxyPrivate::getThumbnail(const QSize &size, const QString &imagePath, void *userData) +bool AfStorageProxyPrivate::getThumbnail(const QString &imagePath, void *userData) { HBufC *source = XQConversions::qStringToS60Desc(imagePath); - int result = mClient->getThumbnail(TSize(size.width(), size.height()), *source, userData); + int result = mClient->getThumbnail(*source, userData); delete source; return KErrNone == result; } @@ -229,7 +198,7 @@ CAfEntry *AfStorageProxyPrivate::createFilterEntry(int applicationId, const QString &activityId) { CAfEntry *entry(0); - QT_TRAP_THROWING(entry = CAfEntry::NewL(0, applicationId, TPtrC(static_cast(activityId.utf16())), KNullDesC(), KNullDesC(), KNullDesC8(), KNullDesC8())); + QT_TRAP_THROWING(entry = CAfEntry::NewL(0, applicationId, TPtrC(static_cast(activityId.utf16())), KNullDesC(), KNullDesC(), KNullDesC8(), KNullDesC8(), TTime())); return entry; } @@ -268,7 +237,8 @@ *customNameBuff, KNullDesC, privateBuff, - publicBuff); + publicBuff, + convertQDateTimeToTTime(metadata[ActivityTimestamp].toDateTime())); CleanupStack::PopAndDestroy(customNameBuff); CleanupStack::PopAndDestroy(actBuff); CleanupStack::PopAndDestroy(&publicBuff); @@ -304,6 +274,7 @@ metadata.insert(ActivityScreenshotKeyword, XQConversions::s60DescToQString(entry->ImageSrc())); metadata.insert(ActivityPersistence, (entry->Flags() & CAfEntry::Persistent) ? true : false); metadata.insert(ActivityVisibility, (entry->Flags() & CAfEntry::Invisible) ? false : true); + metadata.insert(ActivityTimestamp, convertTTimeToQDateTime(entry->Timestamp())); return metadata; } @@ -317,3 +288,23 @@ return XQConversions::s60DescToQString(entry->CustomActivityName()); } } + +// ----------------------------------------------------------------------------- +TTime AfStorageProxyPrivate::convertQDateTimeToTTime(const QDateTime ×tamp) const +{ + return TTime( _L( "19700000:" ) ) + TTimeIntervalSeconds( timestamp.toTime_t() ) + + TTimeIntervalMicroSeconds( timestamp.time().msec() * 1000 ); +} + +// ----------------------------------------------------------------------------- +QDateTime AfStorageProxyPrivate::convertTTimeToQDateTime(const TTime &s60Time) const +{ + TTime posixEpoch(_L("19700000:")); + TTimeIntervalSeconds secondsFrom; + TTimeIntervalMicroSeconds microSecondsFrom; + s60Time.SecondsFrom(posixEpoch, secondsFrom); + microSecondsFrom = s60Time.MicroSecondsFrom(posixEpoch); + QDateTime retVal = QDateTime::fromTime_t(secondsFrom.Int()); + retVal = retVal.addMSecs((microSecondsFrom.Int64() % TInt64(1000000) ) / TInt64(1000)); + return retVal; +} diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/src/afactivitystorage_p.cpp --- a/activityfw/activityserviceplugin/src/afactivitystorage_p.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/activityserviceplugin/src/afactivitystorage_p.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -18,6 +18,7 @@ #include "afactivitystorage_p.h" #include +#include #include @@ -34,6 +35,7 @@ publicData.insert(ActivityApplicationKeyword, applicationId()); publicData.insert(ActivityActivityKeyword, activityId); + publicData.insert(ActivityTimestamp, QDateTime::currentDateTime()); return mConnection->saveActivity(applicationId(), activityId, publicData[ActivityApplicationName].toString(), activityData, publicData, screenshot); } diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/src/afmanager.cpp --- a/activityfw/activityserviceplugin/src/afmanager.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/activityserviceplugin/src/afmanager.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -97,9 +97,9 @@ launchActivity(activity); } -void AfManager::getThumbnail(QSize resolution,const QString &thumbnailPath, void *data) +void AfManager::getThumbnail(const QString &thumbnailPath, void *data) { - mServiceProvider->getThumbnail(resolution, thumbnailPath, data); + mServiceProvider->getThumbnail(thumbnailPath, data); } void AfManager::launchActivity(const QVariantHash& activity) diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/src/afstorageproxy.cpp --- a/activityfw/activityserviceplugin/src/afstorageproxy.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/activityserviceplugin/src/afstorageproxy.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -27,16 +27,6 @@ delete d_ptr; } -bool AfStorageProxy::addActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot) -{ - return d_ptr->addActivity(applicationId, activityId, customActivityName, activityData, metadata, screenshot); -} - -bool AfStorageProxy::updateActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot) -{ - return d_ptr->updateActivity(applicationId, activityId, customActivityName, activityData, metadata, screenshot); -} - bool AfStorageProxy::saveActivity(int applicationId, const QString &activityId, const QString &customActivityName, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot) { return d_ptr->saveActivity(applicationId, activityId, customActivityName, activityData, metadata, screenshot); @@ -82,9 +72,9 @@ return d_ptr->launchActivity(applicationId, activityUri); } -bool AfStorageProxy::getThumbnail(const QSize &size, const QString &imagePath, void *userData) +bool AfStorageProxy::getThumbnail(const QString &imagePath, void *userData) { - return d_ptr->getThumbnail(size, imagePath, userData); + return d_ptr->getThumbnail(imagePath, userData); } bool AfStorageProxy::notifyDataChange() diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.cpp --- a/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.cpp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* 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: -* -*/ - -#include -#include - -QTM_USE_NAMESPACE - -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - - QServiceManager manager; - bool ok = manager.addService(":/activityserviceplugin.xml"); - if (!ok) { - int err = manager.error(); - qFatal("%d ini", err); - } -} diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.pro --- a/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.pro Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -# -# 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: -# - -TEMPLATE = app - -QT = core -#CONFIG += no_icon - -CONFIG += mobility -MOBILITY = serviceframework - -SOURCES += activityserviceinstaller.cpp - -RESOURCES += activityserviceinstaller.qrc - -symbian { - TARGET.CAPABILITY = ALL -TCB -} diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.qrc --- a/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.qrc Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - - ../../data/afservice.xml - - diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/activityserviceplugin/symbianinstaller/symbianinstaller.pro --- a/activityfw/activityserviceplugin/symbianinstaller/symbianinstaller.pro Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -# -# 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: -# - -TEMPLATE = subdirs -SUBDIRS = activityserviceinstaller - -symbian { - load(data_caging_paths) - - plugin.sources = afservice.dll - plugin.path = $$QT_PLUGINS_BASE_DIR - - installer.pkg_postrules += "\"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/activityserviceinstaller.exe\" \ - - \"!:\\sys\\bin\\activityserviceinstaller.exe\",FR,RB,RW" - - DEPLOYMENT += plugin installer -} diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/afactivitylauncher/afactivitylauncher.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/afactivitylauncher/afactivitylauncher.pro Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,20 @@ +# +# 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: +# + +TEMPLATE = subdirs +symbian { + BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include \"group/bld.inf\"" + } diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/afactivitylauncher/bwins/afactivitylauncheru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/afactivitylauncher/bwins/afactivitylauncheru.def Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,7 @@ +EXPORTS + ?NewLC@CAfActivityLauncher@@SAPAV1@AAVRApaLsSession@@AAVRWsSession@@@Z @ 1 NONAME ; class CAfActivityLauncher * CAfActivityLauncher::NewLC(class RApaLsSession &, class RWsSession &) + ?launchActivityL@CAfActivityLauncherPrivate@@QAEXABVTDesC16@@@Z @ 2 NONAME ABSENT ; void CAfActivityLauncherPrivate::launchActivityL(class TDesC16 const &) + ?launchActivityL@CAfActivityLauncher@@QAEXABVTDesC16@@@Z @ 3 NONAME ; void CAfActivityLauncher::launchActivityL(class TDesC16 const &) + ?NewL@CAfActivityLauncher@@SAPAV1@AAVRApaLsSession@@AAVRWsSession@@@Z @ 4 NONAME ; class CAfActivityLauncher * CAfActivityLauncher::NewL(class RApaLsSession &, class RWsSession &) + ??1CAfActivityLauncher@@UAE@XZ @ 5 NONAME ; CAfActivityLauncher::~CAfActivityLauncher(void) + diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/afactivitylauncher/eabi/afactivitylauncheru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/afactivitylauncher/eabi/afactivitylauncheru.def Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,14 @@ +EXPORTS + _ZN19CAfActivityLauncher15launchActivityLERK7TDesC16 @ 1 NONAME + _ZN19CAfActivityLauncher4NewLER13RApaLsSessionR10RWsSession @ 2 NONAME + _ZN19CAfActivityLauncher5NewLCER13RApaLsSessionR10RWsSession @ 3 NONAME + _ZN19CAfActivityLauncherD0Ev @ 4 NONAME + _ZN19CAfActivityLauncherD1Ev @ 5 NONAME + _ZN19CAfActivityLauncherD2Ev @ 6 NONAME + _ZTI19CAfActivityLauncher @ 7 NONAME + _ZTI26CAfActivityLauncherPrivate @ 8 NONAME + _ZTI8CAfEntry @ 9 NONAME + _ZTV19CAfActivityLauncher @ 10 NONAME + _ZTV26CAfActivityLauncherPrivate @ 11 NONAME + _ZTV8CAfEntry @ 12 NONAME + diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/afactivitylauncher/group/afactivitylauncher.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/afactivitylauncher/group/afactivitylauncher.mmp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,47 @@ +/* +* 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: +* +*/ + +TARGET afactivitylauncher.dll +TARGETTYPE dll +UID 0x1000008d 0x20026784 +SECUREID 0x20026784 + +CAPABILITY ALL -TCB + + +EPOCHEAPSIZE 0x100000 0x600000 // 1MB - 6MB + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +SYSTEMINCLUDE ../../inc + +SOURCEPATH ../src +SOURCE afactivitylauncher.cpp +SOURCE afactivitylauncher_p.cpp +SOURCE afapplicationlauncher.cpp + +LIBRARY euser.lib +LIBRARY inetprotutil.lib +LIBRARY apgrfx.lib +LIBRARY cone.lib +LIBRARY apparc.lib +LIBRARY estor.lib +LIBRARY afstorageclient.lib +STATICLIBRARY afstoragecommon.lib + +DEBUGLIBRARY flogger.lib diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/afactivitylauncher/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/afactivitylauncher/group/bld.inf Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,21 @@ +/* +* 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: +* +*/ +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +afactivitylauncher.mmp diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/afactivitylauncher/inc/afactivitylauncher_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/afactivitylauncher/inc/afactivitylauncher_p.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,52 @@ +/* +* 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: +* +*/ +#ifndef AFACTIVITYLAUNCHERPRIVATE_H +#define AFACTIVITYLAUNCHERPRIVATE_H + +#include + +#include +#include "afapplicationlauncher.h" + +class CAfStorageClient; + +class CAfActivityLauncherPrivate : public CBase, public MAfAsyncRequestObserver +{ + +public: + static CAfActivityLauncherPrivate *NewL(RApaLsSession &apaLsSession, RWsSession &wsSession); + ~CAfActivityLauncherPrivate(); + +private: + CAfActivityLauncherPrivate(RApaLsSession &apaLsSession, RWsSession &wsSession); + void ConstructL(); + +public: // from MAfAsyncRequestObserver + virtual void waitActivityRequestCompleted(int result, const TDesC8 &data); + virtual void getThumbnailRequestCompleted(int result, int bitmapHandle, void *userData); + virtual void dataChangeNotificationCompleted(int result); + +public: + void launchActivityL(const TDesC &uriDesc); + +private: + CAfStorageClient *mActivitiesClient; + TAfApplicationLauncher mApplicationLauncher; + +}; + +#endif // AFACTIVITYLAUNCHERPRIVATE_H diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/afactivitylauncher/inc/afapplicationlauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/afactivitylauncher/inc/afapplicationlauncher.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,39 @@ +/* +* 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: +* +*/ +#ifndef AFAPPLICATIONLAUNCHER_H +#define AFAPPLICATIONLAUNCHER_H + +#include +#include +#include + +class TAfApplicationLauncher +{ +public: + TAfApplicationLauncher(RApaLsSession &apaLsSession, RWsSession &wsSession); + +public: + TBool isRunning(TUid applicationId); + void startApplicationL(TUid applicationId, const TDesC &uri); + +private: + RApaLsSession &mApaLsSession; + RWsSession &mWsSession; + +}; + +#endif // AFAPPLICATIONLAUNCHER_H diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/afactivitylauncher/src/afactivitylauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/afactivitylauncher/src/afactivitylauncher.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,66 @@ +/* +* 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: +* +*/ + +#include "afactivitylauncher.h" +#include "afactivitylauncher_p.h" + +// ----------------------------------------------------------------------------- +// Public part of construction, destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CAfActivityLauncher *CAfActivityLauncher::NewL(RApaLsSession &apaLsSession, RWsSession &wsSession) +{ + CAfActivityLauncher *self = CAfActivityLauncher::NewLC(apaLsSession, wsSession); + CleanupStack::Pop(self); + return self; +} + +EXPORT_C CAfActivityLauncher *CAfActivityLauncher::NewLC(RApaLsSession &apaLsSession, RWsSession &wsSession) +{ + CAfActivityLauncher *self = new (ELeave) CAfActivityLauncher(); + CleanupStack::PushL(self); + self->ConstructL(apaLsSession, wsSession); + return self; +} + +EXPORT_C CAfActivityLauncher::~CAfActivityLauncher() +{ + delete mImplementation; +} + +// ----------------------------------------------------------------------------- +// Private part of construction +// ----------------------------------------------------------------------------- +// +CAfActivityLauncher::CAfActivityLauncher() +{ +} + +void CAfActivityLauncher::ConstructL(RApaLsSession &apaLsSession, RWsSession &wsSession) +{ + mImplementation = CAfActivityLauncherPrivate::NewL(apaLsSession, wsSession); +} + +// ----------------------------------------------------------------------------- +// Actual activity launching +// ----------------------------------------------------------------------------- +// + +EXPORT_C void CAfActivityLauncher::launchActivityL(const TDesC &uriDesc) +{ + mImplementation->launchActivityL(uriDesc); +} diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/afactivitylauncher/src/afactivitylauncher_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/afactivitylauncher/src/afactivitylauncher_p.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,100 @@ +/* +* 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: +* +*/ + +#include "afactivitylauncher_p.h" + +#include +#include + +#include +#include + +// ----------------------------------------------------------------------------- +// Public part of construction, destructor +// ----------------------------------------------------------------------------- +// +CAfActivityLauncherPrivate *CAfActivityLauncherPrivate::NewL(RApaLsSession &apaLsSession, RWsSession &wsSession) +{ + CAfActivityLauncherPrivate *self = new (ELeave)CAfActivityLauncherPrivate(apaLsSession, wsSession); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +CAfActivityLauncherPrivate::~CAfActivityLauncherPrivate() +{ + delete mActivitiesClient; +} + +// ----------------------------------------------------------------------------- +// Private part of construction +// ----------------------------------------------------------------------------- +// +CAfActivityLauncherPrivate::CAfActivityLauncherPrivate(RApaLsSession &apaLsSession, RWsSession &wsSession) : mApplicationLauncher(apaLsSession, wsSession) +{ +} + +void CAfActivityLauncherPrivate::ConstructL() +{ + mActivitiesClient = CAfStorageClient::NewL(*this); +} + +// ----------------------------------------------------------------------------- +// Implementation of MAfAsyncRequestObserver interface. We don't need any +// notifications, but we have to pass an instance of this interface to +// CAfStorageClient constructor. +// ----------------------------------------------------------------------------- +// +void CAfActivityLauncherPrivate::waitActivityRequestCompleted(int /*result*/, const TDesC8 &/*data*/) +{ +} + +void CAfActivityLauncherPrivate::getThumbnailRequestCompleted(int /*result*/, int /*bitmapHandle*/, void */*userData*/) +{ +} + +void CAfActivityLauncherPrivate::dataChangeNotificationCompleted(int /*result*/) +{ +} + +// ----------------------------------------------------------------------------- +// Actual activity launching +// ----------------------------------------------------------------------------- +// + +void CAfActivityLauncherPrivate::launchActivityL(const TDesC &uriDesc) +{ + TUriParser16 parser; + parser.Parse(uriDesc); + + if (parser.Extract(EUriScheme).Compare(_L("appto")) == 0) { + TLex16 uidParser(parser.Extract(EUriHost)); + TUint uid; + User::LeaveIfError(uidParser.Val(uid, EHex)); + + if (mApplicationLauncher.isRunning(TUid::Uid(uid))) { + CAfEntry *launchRequest = CAfEntry::NewLC(0, uid, uriDesc, KNullDesC(), KNullDesC(), KNullDesC8(), KNullDesC8(), TTime()); + User::LeaveIfError(mActivitiesClient->launchActivity(*launchRequest)); + CleanupStack::PopAndDestroy(launchRequest); + } else { + mApplicationLauncher.startApplicationL(TUid::Uid(uid), uriDesc); + } + } else { + User::Leave(KErrArgument); + } +} diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/afactivitylauncher/src/afapplicationlauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/afactivitylauncher/src/afapplicationlauncher.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,61 @@ +/* +* 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: +* +*/ +#include "afapplicationlauncher.h" + +#include +#include +#include + +// ----------------------------------------------------------------------------- +// Construction +// ----------------------------------------------------------------------------- +// +TAfApplicationLauncher::TAfApplicationLauncher(RApaLsSession &apaLsSession, RWsSession &wsSession) : mApaLsSession(apaLsSession), mWsSession(wsSession) +{ +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool TAfApplicationLauncher::isRunning(TUid applicationId) +{ + TApaTaskList taskList(mWsSession); + TApaTask task = taskList.FindApp(applicationId); + return task.Exists(); +} + +void TAfApplicationLauncher::startApplicationL(TUid applicationId, const TDesC &uri) +{ + _LIT(KActivityMarker, "-activity "); + RBuf commandLine; + CleanupClosePushL(commandLine); + commandLine.ReAllocL(KActivityMarker().Length() + uri.Length()); + commandLine.Append(KActivityMarker()); + commandLine.Append(uri); + + TApaAppInfo appInfo; + User::LeaveIfError(mApaLsSession.GetAppInfo(appInfo, applicationId)); + + RProcess application; + CleanupClosePushL(application); + User::LeaveIfError(application.Create(appInfo.iFullName, commandLine)); + application.Resume(); + + CleanupStack::PopAndDestroy(&application); + CleanupStack::PopAndDestroy(&commandLine); +} diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/client/bwins/afstorageclientu.def --- a/activityfw/storage/client/bwins/afstorageclientu.def Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/client/bwins/afstorageclientu.def Mon Oct 04 00:38:31 2010 +0300 @@ -1,18 +1,17 @@ EXPORTS ?launchActivity@CAfStorageClient@@QAEHABVCAfEntry@@@Z @ 1 NONAME ; int CAfStorageClient::launchActivity(class CAfEntry const &) - ?updateActivity@CAfStorageClient@@QAEHABVCAfEntry@@H@Z @ 2 NONAME ; int CAfStorageClient::updateActivity(class CAfEntry const &, int) + ?updateActivity@CAfStorageClient@@QAEHABVCAfEntry@@H@Z @ 2 NONAME ABSENT ; int CAfStorageClient::updateActivity(class CAfEntry const &, int) ?saveActivity@CAfStorageClient@@QAEHABVCAfEntry@@H@Z @ 3 NONAME ; int CAfStorageClient::saveActivity(class CAfEntry const &, int) - ?addActivity@CAfStorageClient@@QAEHABVCAfEntry@@H@Z @ 4 NONAME ; int CAfStorageClient::addActivity(class CAfEntry const &, int) + ?addActivity@CAfStorageClient@@QAEHABVCAfEntry@@H@Z @ 4 NONAME ABSENT ; int CAfStorageClient::addActivity(class CAfEntry const &, int) ??1CAfStorageClient@@UAE@XZ @ 5 NONAME ; CAfStorageClient::~CAfStorageClient(void) ?notifyDataChange@CAfStorageClient@@QAEHXZ @ 6 NONAME ; int CAfStorageClient::notifyDataChange(void) ?waitActivity@CAfStorageClient@@QAEHXZ @ 7 NONAME ; int CAfStorageClient::waitActivity(void) ?applicationActivities@CAfStorageClient@@QAEHAAV?$RPointerArray@VCAfEntry@@@@ABVCAfEntry@@@Z @ 8 NONAME ; int CAfStorageClient::applicationActivities(class RPointerArray &, class CAfEntry const &) ?NewL@CAfStorageClient@@SAPAV1@AAVMAfAsyncRequestObserver@@@Z @ 9 NONAME ; class CAfStorageClient * CAfStorageClient::NewL(class MAfAsyncRequestObserver &) - ?NewLC@CAfStorageClient@@SAPAV1@AAVMAfAsyncRequestObserver@@@Z @ 10 NONAME ; class CAfStorageClient * CAfStorageClient::NewLC(class MAfAsyncRequestObserver &) - ?getThumbnail@CAfStorageClient@@QAEHABVTSize@@ABVTDesC16@@PAX@Z @ 11 NONAME ; int CAfStorageClient::getThumbnail(class TSize const &, class TDesC16 const &, void *) - ?removeActivity@CAfStorageClient@@QAEHABVCAfEntry@@@Z @ 12 NONAME ; int CAfStorageClient::removeActivity(class CAfEntry const &) - ?removeApplicationActivities@CAfStorageClient@@QAEHABVCAfEntry@@@Z @ 13 NONAME ; int CAfStorageClient::removeApplicationActivities(class CAfEntry const &) - ?activities@CAfStorageClient@@QAEHAAV?$RPointerArray@VCAfEntry@@@@@Z @ 14 NONAME ABSENT ; int CAfStorageClient::activities(class RPointerArray &) + ?activities@CAfStorageClient@@QAEHAAV?$RPointerArray@VCAfEntry@@@@H@Z @ 10 NONAME ; int CAfStorageClient::activities(class RPointerArray &, int) + ?NewLC@CAfStorageClient@@SAPAV1@AAVMAfAsyncRequestObserver@@@Z @ 11 NONAME ; class CAfStorageClient * CAfStorageClient::NewLC(class MAfAsyncRequestObserver &) + ?getThumbnail@CAfStorageClient@@QAEHABVTDesC16@@PAX@Z @ 12 NONAME ; int CAfStorageClient::getThumbnail(class TDesC16 const &, void *) + ?removeActivity@CAfStorageClient@@QAEHABVCAfEntry@@@Z @ 13 NONAME ; int CAfStorageClient::removeActivity(class CAfEntry const &) + ?removeApplicationActivities@CAfStorageClient@@QAEHABVCAfEntry@@@Z @ 14 NONAME ; int CAfStorageClient::removeApplicationActivities(class CAfEntry const &) ?activityData@CAfStorageClient@@QAEHAAPAVCAfEntry@@ABV2@@Z @ 15 NONAME ; int CAfStorageClient::activityData(class CAfEntry * &, class CAfEntry const &) - ?activities@CAfStorageClient@@QAEHAAV?$RPointerArray@VCAfEntry@@@@H@Z @ 16 NONAME ; int CAfStorageClient::activities(class RPointerArray &, int) diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/client/eabi/afstorageclientu.def --- a/activityfw/storage/client/eabi/afstorageclientu.def Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/client/eabi/afstorageclientu.def Mon Oct 04 00:38:31 2010 +0300 @@ -1,13 +1,13 @@ EXPORTS - _ZN16CAfStorageClient10activitiesER13RPointerArrayI8CAfEntryE @ 1 NONAME ABSENT - _ZN16CAfStorageClient11addActivityERK8CAfEntryi @ 2 NONAME + _ZN16CAfStorageClient10activitiesER13RPointerArrayI8CAfEntryEi @ 1 NONAME + _ZN16CAfStorageClient11addActivityERK8CAfEntryi @ 2 NONAME ABSENT _ZN16CAfStorageClient12activityDataERP8CAfEntryRKS0_ @ 3 NONAME - _ZN16CAfStorageClient12getThumbnailERK5TSizeRK7TDesC16Pv @ 4 NONAME + _ZN16CAfStorageClient12getThumbnailERK7TDesC16Pv @ 4 NONAME _ZN16CAfStorageClient12saveActivityERK8CAfEntryi @ 5 NONAME _ZN16CAfStorageClient12waitActivityEv @ 6 NONAME _ZN16CAfStorageClient14launchActivityERK8CAfEntry @ 7 NONAME _ZN16CAfStorageClient14removeActivityERK8CAfEntry @ 8 NONAME - _ZN16CAfStorageClient14updateActivityERK8CAfEntryi @ 9 NONAME + _ZN16CAfStorageClient14updateActivityERK8CAfEntryi @ 9 NONAME ABSENT _ZN16CAfStorageClient16notifyDataChangeEv @ 10 NONAME _ZN16CAfStorageClient21applicationActivitiesER13RPointerArrayI8CAfEntryERKS1_ @ 11 NONAME _ZN16CAfStorageClient27removeApplicationActivitiesERK8CAfEntry @ 12 NONAME @@ -26,5 +26,4 @@ _ZTV26CAfThumbnailRequestPrivate @ 25 NONAME _ZTV30RAfStorageClientImplementation @ 26 NONAME _ZTV8CAfEntry @ 27 NONAME - _ZN16CAfStorageClient10activitiesER13RPointerArrayI8CAfEntryEi @ 28 NONAME diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/client/inc/afstorageclient.h --- a/activityfw/storage/client/inc/afstorageclient.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/client/inc/afstorageclient.h Mon Oct 04 00:38:31 2010 +0300 @@ -35,8 +35,6 @@ void ConstructL(MAfAsyncRequestObserver &observer); public: - IMPORT_C int addActivity(const CAfEntry &entry, TInt imageHandle); - IMPORT_C int updateActivity(const CAfEntry &entry, TInt imageHandle); IMPORT_C int saveActivity(const CAfEntry &entry, TInt imageHandle); IMPORT_C int removeActivity(const CAfEntry &entry); IMPORT_C int removeApplicationActivities(const CAfEntry &entry); @@ -45,7 +43,7 @@ IMPORT_C int activityData(CAfEntry *&dst, const CAfEntry &entry); IMPORT_C int waitActivity(); IMPORT_C int launchActivity(const CAfEntry &entry); - IMPORT_C int getThumbnail(const TSize &size, const TDesC &imagePath, void *userData); + IMPORT_C int getThumbnail(const TDesC &imagePath, void *userData); IMPORT_C int notifyDataChange(); private: diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/client/inc/afstorageclient_p.h --- a/activityfw/storage/client/inc/afstorageclient_p.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/client/inc/afstorageclient_p.h Mon Oct 04 00:38:31 2010 +0300 @@ -36,8 +36,6 @@ public: int connect(); - int addActivity(const CAfEntry &sourceEntry, TInt imageHandle); - int updateActivity(const CAfEntry &sourceEntry, TInt imageHandle); int saveActivity(const CAfEntry &entry, TInt imageHandle); int removeActivity(const CAfEntry &templateEntry); int removeApplicationActivities(const CAfEntry &templateEntry); @@ -45,7 +43,7 @@ int applicationActivities(RPointerArray &dst, const CAfEntry &entry); int activityData(CAfEntry *&resultEntry, const CAfEntry &templateEntry); int waitActivity(); - int getThumbnail(const TSize &size, const TDesC &imagePath, void *userData); + int getThumbnail(const TDesC &imagePath, void *userData); int notifyDataChange(); int launchActivity(const CAfEntry &templateEntry); diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/client/inc/afstorageclientimp.h --- a/activityfw/storage/client/inc/afstorageclientimp.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/client/inc/afstorageclientimp.h Mon Oct 04 00:38:31 2010 +0300 @@ -42,9 +42,8 @@ const CAfEntry& templateEntry, TInt limit); - void getThumbnailL(TSize size, - const TDesC& source, - TAny *userData ); + void getThumbnailL(const TDesC& source, + TAny *userData ); void connectL(); diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/client/inc/afthumbnailrequest_p.h --- a/activityfw/storage/client/inc/afthumbnailrequest_p.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/client/inc/afthumbnailrequest_p.h Mon Oct 04 00:38:31 2010 +0300 @@ -28,7 +28,6 @@ public: static void NewLD(MAfAsyncRequestObserver &observer, MAfAsyncSession & session, - TSize resolution, const TDesC& source, TAny* userData); @@ -46,7 +45,7 @@ MAfAsyncSession &, TAny*); - void ConstructL(TSize resolution, const TDesC& source); + void ConstructL(const TDesC& source); private: MAfAsyncRequestObserver &mObserver; diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/client/src/afstorageclient.cpp --- a/activityfw/storage/client/src/afstorageclient.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/client/src/afstorageclient.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -74,32 +74,6 @@ // ----------------------------------------------------------------------------- /** - * Function add new activity - * @param entry - activity entry data structure - * @param imageHandle - handle for activity thumbnail - * @return 0 on success, error code otherwise - */ -EXPORT_C int CAfStorageClient::addActivity(const CAfEntry &entry, TInt imageHandle) -{ - RDebug::Print(_L("This method is deprecated, please use CAfStorageClient::saveActivity instead")); - return d_ptr->addActivity(entry, imageHandle); -} - -// ----------------------------------------------------------------------------- -/** - * Function update existing activity - * @param entry - activity entry data structure - * @param imageHandle - handle for activity thumbnail - * @return 0 on success, error code otherwise - */ -EXPORT_C int CAfStorageClient::updateActivity(const CAfEntry &entry, TInt imageHandle) -{ - RDebug::Print(_L("This method is deprecated, please use CAfStorageClient::saveActivity instead")); - return d_ptr->updateActivity(entry, imageHandle); -} - -// ----------------------------------------------------------------------------- -/** * Function save an activity (add new one or update existing one) * @param entry - activity entry data structure * @param imageHandle - handle for activity thumbnail @@ -189,9 +163,9 @@ } // ----------------------------------------------------------------------------- -EXPORT_C int CAfStorageClient::getThumbnail(const TSize &size, const TDesC &imagePath, void *userData) +EXPORT_C int CAfStorageClient::getThumbnail(const TDesC &imagePath, void *userData) { - return d_ptr->getThumbnail(size, imagePath, userData); + return d_ptr->getThumbnail(imagePath, userData); } // ----------------------------------------------------------------------------- diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/client/src/afstorageclient_p.cpp --- a/activityfw/storage/client/src/afstorageclient_p.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/client/src/afstorageclient_p.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -77,26 +77,6 @@ // ----------------------------------------------------------------------------- /** * Function implementation - * @see AfStorageClient::addActivity(const CAfEntry &,const QPixmap&) - */ -int CAfStorageClientPrivate::addActivity(const CAfEntry &entry, TInt imageHandle) -{ - return execute(AddActivity, entry, imageHandle); -} - -// ----------------------------------------------------------------------------- -/** - * Function implementation - * @see AfStorageClient::updateActivity(const CAfEntry &,const QPixmap&) - */ -int CAfStorageClientPrivate::updateActivity(const CAfEntry &entry, TInt imageHandle) -{ - return execute(UpdateActivity, entry, imageHandle); -} - -// ----------------------------------------------------------------------------- -/** - * Function implementation * @see AfStorageClient::saveActivity(const CAfEntry &,const QPixmap&) */ int CAfStorageClientPrivate::saveActivity(const CAfEntry &entry, TInt imageHandle) @@ -180,11 +160,11 @@ // ----------------------------------------------------------------------------- /** * Function implementation - * @see AfStorageClient::getThumbnail(const TSize &size, const TDesC &imagePath, void *userData) + * @see AfStorageClient::getThumbnail(const TDesC &imagePath, void *userData) */ -int CAfStorageClientPrivate::getThumbnail(const TSize &size, const TDesC &imagePath, void *userData) +int CAfStorageClientPrivate::getThumbnail(const TDesC &imagePath, void *userData) { - TRAPD(errNo, mImplementation.getThumbnailL(size, imagePath, userData);) + TRAPD(errNo, mImplementation.getThumbnailL(imagePath, userData);) return errNo; } @@ -219,8 +199,6 @@ { TRAPD(errNo, switch (function) { - case AddActivity: - case UpdateActivity: case SaveActivity: case RemoveActivity: case RemoveApplicationActivities: diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/client/src/afstorageclientimp.cpp --- a/activityfw/storage/client/src/afstorageclientimp.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/client/src/afstorageclientimp.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -153,11 +153,10 @@ } // ----------------------------------------------------------------------------- -void RAfStorageClientImplementation::getThumbnailL(TSize size, - const TDesC& source, +void RAfStorageClientImplementation::getThumbnailL(const TDesC& source, TAny *userData ) { - CAfThumbnailRequestPrivate::NewLD(mObserver, *this, size, source, userData); + CAfThumbnailRequestPrivate::NewLD(mObserver, *this, source, userData); } // ----------------------------------------------------------------------------- diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/client/src/afthumbnailrequest_p.cpp --- a/activityfw/storage/client/src/afthumbnailrequest_p.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/client/src/afthumbnailrequest_p.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -33,13 +33,12 @@ */ void CAfThumbnailRequestPrivate::NewLD(MAfAsyncRequestObserver &observer, MAfAsyncSession & session, - TSize resolution, const TDesC& source, TAny* userData) { CAfThumbnailRequestPrivate* self = new(ELeave)CAfThumbnailRequestPrivate(observer, session, userData); CleanupStack::PushL(self); - self->ConstructL(resolution, source); + self->ConstructL(source); session.PushL(self); CleanupStack::Pop(self); } @@ -66,13 +65,12 @@ // ----------------------------------------------------------------------------- /** * Second phase constructor - * @param resolution - requested thumbnail resolution * @param source - thumbnail source location */ -void CAfThumbnailRequestPrivate::ConstructL(TSize resolution, const TDesC& source) +void CAfThumbnailRequestPrivate::ConstructL(const TDesC& source) { - mIds[0] = resolution.iWidth; - mIds[1] = resolution.iHeight; + mIds[0] = 0; + mIds[1] = 0; CAfEntry::CopyL(mImgSrc, source); mSession.sendAsync(GetThumbnail, TIpcArgs(&mIds[0],&mIds[1], &mImgSrc), diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/common/inc/afcmd.h --- a/activityfw/storage/common/inc/afcmd.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/common/inc/afcmd.h Mon Oct 04 00:38:31 2010 +0300 @@ -28,9 +28,7 @@ enum ActivityCmd { - AddActivity =0, - UpdateActivity, - RemoveActivity, + RemoveActivity=0, RemoveApplicationActivities, Activities, ApplicationActivities, diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/common/inc/afentry.h --- a/activityfw/storage/common/inc/afentry.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/common/inc/afentry.h Mon Oct 04 00:38:31 2010 +0300 @@ -52,7 +52,8 @@ const TDesC &customActivityName, const TDesC &imgSrc, const TDesC8 &privateData, - const TDesC8 &publicData); + const TDesC8 &publicData, + const TTime ×tamp); static CAfEntry* NewLC(TInt flags, TInt applicationId, @@ -60,7 +61,8 @@ const TDesC &customActivityName, const TDesC &imgSrc, const TDesC8 &privateData, - const TDesC8 &publicData); + const TDesC8 &publicData, + const TTime ×tamp); static CAfEntry* NewLC(const RMessage2& msg, int offset =0); @@ -86,6 +88,8 @@ const TDesC& ActivityId() const; const TDesC& CustomActivityName() const; + + TTime Timestamp() const; const TDesC& ImageSrc() const; @@ -112,7 +116,8 @@ const TDesC &customActivityName, const TDesC &imgSrc, const TDesC8 &privateData, - const TDesC8 &publicData); + const TDesC8 &publicData, + const TTime ×tamp); static void InternalizeL(RBuf8 &dst, RReadStream &src); @@ -129,6 +134,7 @@ RBuf mImgSrc; RBuf8 mPrivateData; RBuf8 mPublicData; + TTime mTimestamp; }; diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/common/src/afentry.cpp --- a/activityfw/storage/common/src/afentry.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/common/src/afentry.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -58,7 +58,8 @@ const TDesC &customActivityName, const TDesC &imgSrc, const TDesC8 &privateData, - const TDesC8 &publicData) + const TDesC8 &publicData, + const TTime ×tamp) { CAfEntry* self = CAfEntry::NewLC(flags, applicationId, @@ -66,7 +67,8 @@ customActivityName, imgSrc, privateData, - publicData); + publicData, + timestamp); CleanupStack::Pop(self); return self; } @@ -88,7 +90,8 @@ const TDesC &customActivityName, const TDesC &imgSrc, const TDesC8 &privateData, - const TDesC8 &publicData) + const TDesC8 &publicData, + const TTime ×tamp) { CAfEntry *self = CAfEntry::NewLC(); self->ConstructL(flags, @@ -97,7 +100,8 @@ customActivityName, imgSrc, privateData, - publicData); + publicData, + timestamp); return self; } @@ -140,7 +144,8 @@ const TDesC &customActivityName, const TDesC &imgSrc, const TDesC8 &privateData, - const TDesC8 &publicData) + const TDesC8 &publicData, + const TTime ×tamp) { mFlags = flags; mAppId = applicationId; @@ -149,6 +154,7 @@ CopyL(mImgSrc, imgSrc); CopyL(mPrivateData, privateData); CopyL(mPublicData, publicData); + mTimestamp = timestamp; } // ----------------------------------------------------------------------------- @@ -174,6 +180,7 @@ return (sizeof(TInt) * 4) + //flags + appId + actId size info + customActivityName size info mActivityId.Size() + //actId content size mCustomActivityName.Size() + // customActivityName content size + TPckgBuf().Size() + // timestamp size DataSize(); //data size } @@ -201,6 +208,7 @@ stream.WriteInt32L(mAppId); ExternalizeL(stream, mActivityId); ExternalizeL(stream, mCustomActivityName); + stream.WriteL(TPckgBuf(mTimestamp)); ExternalizeDataOnlyL(stream); } @@ -215,6 +223,9 @@ mAppId = stream.ReadInt32L(); InternalizeL(mActivityId, stream); InternalizeL(mCustomActivityName, stream); + TPckgBuf timestampBuf; + stream.ReadL(timestampBuf); + mTimestamp = timestampBuf(); InternalizeDataOnlyL(stream); } @@ -308,6 +319,16 @@ // ----------------------------------------------------------------------------- /** + * Provide access to activity timestamp + * @return activity timestamp + */ +TTime CAfEntry::Timestamp() const +{ + return mTimestamp; +} + +// ----------------------------------------------------------------------------- +/** * Provide access to activity thumbail path * @return path to activity thumbnail */ diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/group/server.mmp --- a/activityfw/storage/server/group/server.mmp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/group/server.mmp Mon Oct 04 00:38:31 2010 +0300 @@ -49,9 +49,6 @@ LIBRARY bafl.lib LIBRARY fbscli.lib LIBRARY hash.lib -LIBRARY bitmaptransforms.lib -LIBRARY imageconversion.lib -STATICLIBRARY tsimageutils.lib STATICLIBRARY afstoragecommon.lib CAPABILITY ALL -TCB diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/inc/afapplicationsengine.h --- a/activityfw/storage/server/inc/afapplicationsengine.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/inc/afapplicationsengine.h Mon Oct 04 00:38:31 2010 +0300 @@ -19,26 +19,32 @@ #include #include "afstorage.h" +#include "afapplicationsobserver.h" class RApaLsSession; class CAfApplicationsCollection; class CAfApplicationsStorage; class CAfApplicationsMonitor; +class MAfTaskStorage; -class CAfApplicationsEngine: public CBase +class CAfApplicationsEngine: public CBase, public MAfApplicationsObserver { public: - static CAfApplicationsEngine* NewL(RApaLsSession& serviceProvider, CAfStorage& storage); + static CAfApplicationsEngine* NewL(RApaLsSession& serviceProvider, CAfStorage& storage, MAfTaskStorage& taskStorage); ~CAfApplicationsEngine(); private: - CAfApplicationsEngine(); - void ConstructL(CAfStorage& storage, RApaLsSession& serviceProvider); + CAfApplicationsEngine(MAfTaskStorage& taskStorage); + void ConstructL(RApaLsSession& serviceProvider, CAfStorage& storage); + +public: // from MAfApplicationsObserver + virtual void applicationsChanged(); private: CAfApplicationsCollection *mCollection; CAfApplicationsMonitor *mMonitor; CAfApplicationsStorage *mStorage; + MAfTaskStorage& mTaskStorage; }; #endif //AFAPPLICATIONSENGINE_H diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/inc/afapplicationsstorage.h --- a/activityfw/storage/server/inc/afapplicationsstorage.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/inc/afapplicationsstorage.h Mon Oct 04 00:38:31 2010 +0300 @@ -27,16 +27,17 @@ public MAfApplicationsObserver { public: - static CAfApplicationsStorage* NewL(CAfStorage& storage, const MAfApplicationsRegistry& provider); + static CAfApplicationsStorage* NewL(CAfStorage& storage, const MAfApplicationsRegistry& provider, MAfApplicationsObserver &observer); ~CAfApplicationsStorage(); void applicationsChanged(); private: - CAfApplicationsStorage(CAfStorage& storage, const MAfApplicationsRegistry& provider); + CAfApplicationsStorage(CAfStorage& storage, const MAfApplicationsRegistry& provider, MAfApplicationsObserver &observer); void deleteActivityL(TUid appId); private: CAfStorage& mStorage; const MAfApplicationsRegistry &mProvider; + MAfApplicationsObserver &mObserver; }; #endif // AFAPPLICATIONSSTORAGE_H diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/inc/afobservertask.h --- a/activityfw/storage/server/inc/afobservertask.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/inc/afobservertask.h Mon Oct 04 00:38:31 2010 +0300 @@ -35,7 +35,7 @@ const TDesC8& Data() const; - void BroadcastReceivedL(const RMessage2& ); + void BroadcastReceivedL(const RMessage2&, TBool applicationUninstalled = EFalse); private: CAfObserverTask(MAfTaskStorage& globalStorage, diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/inc/afstorage.h --- a/activityfw/storage/server/inc/afstorage.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/inc/afstorage.h Mon Oct 04 00:38:31 2010 +0300 @@ -34,10 +34,6 @@ static CAfStorage* NewL(RFs& aSession); - void AddActivityL(CAfEntry &aEntry); - - void UpdateActivityL(CAfEntry &aEntry); - void SaveActivityL(CAfEntry &aEntry); void DeleteActivityL(CAfEntry &aEntry); diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/inc/afstorageasynctask.h --- a/activityfw/storage/server/inc/afstorageasynctask.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/inc/afstorageasynctask.h Mon Oct 04 00:38:31 2010 +0300 @@ -36,7 +36,7 @@ const TDesC8& Data() const; - void BroadcastReceivedL(const RMessage2 &); + void BroadcastReceivedL(const RMessage2 &, TBool applicationUninstalled = EFalse); private: CAfStorageAsyncTask(); diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/inc/afstoragesynctask.h --- a/activityfw/storage/server/inc/afstoragesynctask.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/inc/afstoragesynctask.h Mon Oct 04 00:38:31 2010 +0300 @@ -38,12 +38,6 @@ const RMessage2& msg); private: - static void AddActivityL(CAfStorage& dataStorage, - const RMessage2& msg); - - static void UpdateActivityL(CAfStorage& dataStorage, - const RMessage2& msg); - static void SaveActivityL(CAfStorage& dataStorage, const RMessage2& msg); diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/inc/aftask.h --- a/activityfw/storage/server/inc/aftask.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/inc/aftask.h Mon Oct 04 00:38:31 2010 +0300 @@ -31,7 +31,7 @@ * Notify instance about incoming broadcast message. * @param msg - broadcast message */ - virtual void BroadcastReceivedL(const RMessage2& msg) =0; + virtual void BroadcastReceivedL(const RMessage2& msg, TBool applicationUninstalled = EFalse) =0; /** * Returns ETrue if task is related with session argument diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/inc/afthumbnailtask.h --- a/activityfw/storage/server/inc/afthumbnailtask.h Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/inc/afthumbnailtask.h Mon Oct 04 00:38:31 2010 +0300 @@ -27,12 +27,10 @@ #include "aftask.h" #include "aftaskstorage.h" -#include "tsgraphicfilescalinghandler.h" class CFbsBitmap; -class CAfThumbnailTask : public CAfTask, - public MImageReadyCallBack +class CAfThumbnailTask : public CAfTask { public: ~CAfThumbnailTask(); @@ -45,18 +43,16 @@ void ConstructL(); - void ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap ); - const TDesC8& Data()const; - void BroadcastReceivedL(const RMessage2& ); + void BroadcastReceivedL(const RMessage2&, TBool applicationUninstalled = EFalse); TBool IsSessionTask(const CSession2* session); private: MAfTaskStorage& mStorage; const RMessage2 mMsg; - CBase* mService; + CFbsBitmap* mBitmap; }; #endif // AFTHUMBNAILTASK_H diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/src/afapplicationsengine.cpp --- a/activityfw/storage/server/src/afapplicationsengine.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/src/afapplicationsengine.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -18,29 +18,34 @@ #include "afapplicationsstorage.h" #include "afapplicationscollection.h" #include "afapplicationsmonitor.h" +#include "aftaskstorage.h" +#include "aftask.h" //------------------------------------------------------------------------------ CAfApplicationsEngine* CAfApplicationsEngine::NewL(RApaLsSession& serviceProvider, - CAfStorage& storage) + CAfStorage& storage, + MAfTaskStorage& taskStorage) { - CAfApplicationsEngine *self = new(ELeave)CAfApplicationsEngine(); + CAfApplicationsEngine *self = new(ELeave)CAfApplicationsEngine(taskStorage); CleanupStack::PushL(self); - self->ConstructL(storage, serviceProvider); + self->ConstructL(serviceProvider, storage); CleanupStack::Pop(self); return self; } //------------------------------------------------------------------------------ -CAfApplicationsEngine::CAfApplicationsEngine() -{} +CAfApplicationsEngine::CAfApplicationsEngine(MAfTaskStorage& taskStorage) : + mTaskStorage(taskStorage) +{ +} //------------------------------------------------------------------------------ -void CAfApplicationsEngine::ConstructL(CAfStorage& storage, - RApaLsSession& serviceProvider) +void CAfApplicationsEngine::ConstructL(RApaLsSession& serviceProvider, + CAfStorage& storage) { mCollection = CAfApplicationsCollection::NewL(serviceProvider); mMonitor = CAfApplicationsMonitor::NewL(serviceProvider, *mCollection); - mStorage = CAfApplicationsStorage::NewL(storage, *mCollection); + mStorage = CAfApplicationsStorage::NewL(storage, *mCollection, *this); mCollection->setObserver(*mStorage); } @@ -52,3 +57,12 @@ delete mStorage; delete mCollection; } + +//------------------------------------------------------------------------------ +void CAfApplicationsEngine::applicationsChanged() +{ + const RPointerArray &table(mTaskStorage.StorageData()); + for (TInt iter(table.Count() - 1); 0 <= iter; --iter) { + table[iter]->BroadcastReceivedL(RMessage2(), ETrue); + } +} diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/src/afapplicationsstorage.cpp --- a/activityfw/storage/server/src/afapplicationsstorage.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/src/afapplicationsstorage.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -17,19 +17,22 @@ #include "afapplicationsstorage.h" //------------------------------------------------------------------------------ CAfApplicationsStorage* CAfApplicationsStorage::NewL(CAfStorage& storage, - const MAfApplicationsRegistry& provider) + const MAfApplicationsRegistry& provider, + MAfApplicationsObserver &observer) { - CAfApplicationsStorage *self = new (ELeave)CAfApplicationsStorage(storage, provider); + CAfApplicationsStorage *self = new (ELeave)CAfApplicationsStorage(storage, provider, observer); return self; } //------------------------------------------------------------------------------ CAfApplicationsStorage::CAfApplicationsStorage(CAfStorage& storage, - const MAfApplicationsRegistry& provider) + const MAfApplicationsRegistry& provider, + MAfApplicationsObserver &observer) : mStorage(storage), - mProvider(provider) + mProvider(provider), + mObserver(observer) { } @@ -44,6 +47,10 @@ for (TInt iter(0); iter < removedApp.Count(); ++iter) { TRAP_IGNORE(deleteActivityL(removedApp[iter])); } + + if ( removedApp.Count() > 0 ) { + mObserver.applicationsChanged(); + } } //------------------------------------------------------------------------------ @@ -55,7 +62,8 @@ KNullDesC, KNullDesC, KNullDesC8, - KNullDesC8)); + KNullDesC8, + TTime())); mStorage.DeleteActivitiesL(*entry); CleanupStack::PopAndDestroy(entry); } diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/src/afobservertask.cpp --- a/activityfw/storage/server/src/afobservertask.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/src/afobservertask.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -79,12 +79,20 @@ * Interface implementation * @see CActivityTask::BroadcastReceivedL(const RMessage2&) */ -void CAfObserverTask::BroadcastReceivedL(const RMessage2& msg) +void CAfObserverTask::BroadcastReceivedL(const RMessage2& msg, TBool applicationUninstalled) { - if(EFalse != mMsg.IsNull()) { + if (!applicationUninstalled && mMsg.IsNull()) { mGlobalStorage.Pop(this);// mLocalStorage.Pop(this); delete this; + } else if(NotifyChange == mMsg.Function() && + (applicationUninstalled || + SaveActivity == msg.Function() || + RemoveActivity == msg.Function() || + RemoveApplicationActivities == msg.Function())){ + mMsg.Complete(KErrNone); + mGlobalStorage.Pop(this); + delete this; } else if (WaitActivity == mMsg.Function() && LaunchActivity == msg.Function()) { @@ -113,15 +121,6 @@ mGlobalStorage.Pop(this); mMsg.Complete(KErrCancel); delete this; - } else if(NotifyChange == mMsg.Function() && - (AddActivity == msg.Function() || - UpdateActivity == msg.Function() || - SaveActivity == msg.Function() || - RemoveActivity == msg.Function() || - RemoveApplicationActivities == msg.Function())){ - mMsg.Complete(KErrNone); - mGlobalStorage.Pop(this); - delete this; } } diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/src/afserver.cpp --- a/activityfw/storage/server/src/afserver.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/src/afserver.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -73,7 +73,7 @@ User::LeaveIfError(mFsSession.Connect()); User::LeaveIfError(RFbsSession::Connect(mFsSession)); mStorage = CAfStorage::NewL(mFsSession); - mAppEngine = CAfApplicationsEngine::NewL(mApaSession, *mStorage); + mAppEngine = CAfApplicationsEngine::NewL(mApaSession, *mStorage, *this); } // ----------------------------------------------------------------------------- diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/src/afsession.cpp --- a/activityfw/storage/server/src/afsession.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/src/afsession.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -92,8 +92,6 @@ void CAfSession::ServiceL(const RMessage2& message) { switch (message.Function()) { - case AddActivity: - case UpdateActivity: case SaveActivity: case RemoveActivity: case RemoveApplicationActivities: diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/src/afstorage.cpp --- a/activityfw/storage/server/src/afstorage.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/src/afstorage.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -242,98 +242,11 @@ // ----------------------------------------------------------------------------- /** - * Register new activity - * @param appId - application id - * @param actId - activity id - * @param flags - activity flags - * @param imgSrc - activity thumbnail source - * @param privateData - activity private data - * @param publicData - activity public data - */ -void CAfStorage::AddActivityL(CAfEntry& entry) - { - //verify if row already exists - TInt errNo(KErrNone); - RDbView view; - CleanupClosePushL(view); - TRAP( errNo, GetActivityForUpdateL(view, entry.ApplicationId(), entry.ActivityId())); - if( KErrNone == errNo ) - { - User::Leave(KErrAlreadyExists); - } - CleanupStack::PopAndDestroy(&view); - - //write table - RDbTable table; - CleanupClosePushL(table); - User::LeaveIfError(table.Open(iActDb, KActivityTableName, table.EUpdatable)); - CDbColSet *row = table.ColSetL(); - CleanupStack::PushL(row); - - TTime time; - time.UniversalTime(); - - table.InsertL(); - TRAP(errNo, - table.SetColL(row->ColNo(KApplicationColumnName), TInt64(entry.ApplicationId())); - table.SetColL(row->ColNo(KActivityColumnName), entry.ActivityId()); - table.SetColL(row->ColNo(KCustomNameColumnName), entry.CustomActivityName()); - table.SetColL(row->ColNo(KFlagsColumnName), entry.Flags()); - table.SetColL(row->ColNo(KTimestampColumnName), time.DateTime()); - ExternalizeDataL(table, entry, row->ColNo(KDataColumnName) ); - - table.PutL();) - if( KErrNone != errNo ) - { - table.Cancel(); - User::Leave(errNo); - } - CleanupStack::PopAndDestroy(row); - CleanupStack::PopAndDestroy(&table); - } - -// ----------------------------------------------------------------------------- -/** - * Update activity - * @param entry - activity data - */ -void CAfStorage::UpdateActivityL(CAfEntry& entry) - { - TTime time; - time.UniversalTime(); - RDbView view; - CleanupClosePushL(view); - GetActivityForUpdateL(view, entry.ApplicationId(), entry.ActivityId()); - view.UpdateL(); - TRAPD(errNo, - CDbColSet* colSet = view.ColSetL(); - CleanupStack::PushL(colSet); - - view.SetColL(colSet->ColNo(KFlagsColumnName), entry.Flags()); - view.SetColL(colSet->ColNo(KTimestampColumnName), time.DateTime()); - view.SetColL(colSet->ColNo(KCustomNameColumnName), entry.CustomActivityName()); - ExternalizeDataL(view, entry, colSet->ColNo(KDataColumnName)); - - view.PutL(); - CleanupStack::PopAndDestroy(colSet);) - - if(KErrNone != errNo) - { - view.Cancel(); - User::Leave(errNo); - } - CleanupStack::PopAndDestroy(&view); - } - -// ----------------------------------------------------------------------------- -/** * Save activity * @param entry - activity data */ void CAfStorage::SaveActivityL(CAfEntry &entry) { - TTime time; - time.UniversalTime(); // @todo check if this can be tidied up //verify if row already exists TInt errNo(KErrNone); @@ -349,7 +262,7 @@ CleanupStack::PushL(colSet); view.SetColL(colSet->ColNo(KFlagsColumnName), entry.Flags()); - view.SetColL(colSet->ColNo(KTimestampColumnName), time.DateTime()); + view.SetColL(colSet->ColNo(KTimestampColumnName), entry.Timestamp()); view.SetColL(colSet->ColNo(KCustomNameColumnName), entry.CustomActivityName()); ExternalizeDataL(view, entry, colSet->ColNo(KDataColumnName)); @@ -365,7 +278,7 @@ else { // insert - + //write table RDbTable table; CleanupClosePushL(table); @@ -379,7 +292,7 @@ table.SetColL(row->ColNo(KActivityColumnName), entry.ActivityId()); table.SetColL(row->ColNo(KCustomNameColumnName), entry.CustomActivityName()); table.SetColL(row->ColNo(KFlagsColumnName), entry.Flags()); - table.SetColL(row->ColNo(KTimestampColumnName), time.DateTime()); + table.SetColL(row->ColNo(KTimestampColumnName), entry.Timestamp()); ExternalizeDataL(table, entry, row->ColNo(KDataColumnName)); table.PutL();) if (KErrNone != errNo) { @@ -586,7 +499,8 @@ applicationOffset(row->ColNo(KApplicationColumnName)), activityOffset(row->ColNo(KActivityColumnName)), customNameOffset(row->ColNo(KCustomNameColumnName)), - dataOffset(row->ColNo(KDataColumnName)); + dataOffset(row->ColNo(KDataColumnName)), + timestampOffset(row->ColNo(KTimestampColumnName)); RBuf activityName; CleanupClosePushL(activityName); @@ -611,7 +525,8 @@ customName, KNullDesC, KNullDesC8, - KNullDesC8); + KNullDesC8, + src.ColTime(timestampOffset)); if( CAfEntry::Public == rights && (entry->Flags() & CAfEntry::Invisible) ) { diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/src/afstorageasynctask.cpp --- a/activityfw/storage/server/src/afstorageasynctask.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/src/afstorageasynctask.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -72,7 +72,7 @@ * Interface implementation * @see CActivityTask::BroadcastReceivedL(const RMessage2 &) */ -void CAfStorageAsyncTask::BroadcastReceivedL(const RMessage2& ) +void CAfStorageAsyncTask::BroadcastReceivedL(const RMessage2&, TBool) { // No implementation required } diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/src/afstoragesynctask.cpp --- a/activityfw/storage/server/src/afstoragesynctask.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/src/afstoragesynctask.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -35,12 +35,6 @@ const RMessage2& msg) { switch (msg.Function()) { - case AddActivity: - AddActivityL(dataStorage, msg); - break; - case UpdateActivity: - UpdateActivityL(dataStorage, msg); - break; case SaveActivity: SaveActivityL(dataStorage, msg); break; @@ -63,64 +57,6 @@ // ----------------------------------------------------------------------------- /** - * Handle adding new activity. - * @param dataStorage - data storage - * @param msg - request message - */ -void AfStorageSyncTask::AddActivityL(CAfStorage& dataStorage, - const RMessage2& msg) -{ - //Read message and bitmap handle - TPckgBuf bitmapHdl(0); - CAfEntry *entry = CAfEntry::NewLC(msg); - msg.ReadL(1, bitmapHdl); - - RBuf thumbnailPath; - CleanupClosePushL(thumbnailPath); - dataStorage.ThumbnailPathL(thumbnailPath, - dataStorage.Fs(), - entry->ApplicationId(), - entry->ActivityId(), - entry->Flags() & CAfEntry::Persistent); - CreateThumbnailL(thumbnailPath, bitmapHdl()); - entry->SetImageSrcL(thumbnailPath); - dataStorage.AddActivityL(*entry); - CleanupStack::PopAndDestroy(&thumbnailPath); - CleanupStack::PopAndDestroy(entry); -} - -// ----------------------------------------------------------------------------- -/** - * Handle updating existing activiy - * @param dataStorage - data storage - * @param msg - request message - */ -void AfStorageSyncTask::UpdateActivityL(CAfStorage& dataStorage, - const RMessage2& msg) -{ - TPckgBuf bitmapHdl(0); - CAfEntry *entry = CAfEntry::NewLC(msg); - msg.ReadL(1, bitmapHdl); - - RBuf thumbnailPath; - CleanupClosePushL(thumbnailPath); - DeleteActivityScreenshotL(dataStorage, - entry->ApplicationId(), - entry->ActivityId()); - dataStorage.ThumbnailPathL(thumbnailPath, - dataStorage.Fs(), - entry->ApplicationId(), - entry->ActivityId(), - entry->Flags() & CAfEntry::Persistent); - CreateThumbnailL(thumbnailPath, bitmapHdl()); - entry->SetImageSrcL(thumbnailPath); - dataStorage.UpdateActivityL(*entry); - CleanupStack::PopAndDestroy(&thumbnailPath); - CleanupStack::PopAndDestroy(entry); -} - -// ----------------------------------------------------------------------------- -/** * Handle saving activiy * @param dataStorage - data storage * @param msg - request message diff -r 0b3699f6c654 -r e36b2f4799c0 activityfw/storage/server/src/afthumbnailtask.cpp --- a/activityfw/storage/server/src/afthumbnailtask.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/activityfw/storage/server/src/afthumbnailtask.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -39,7 +39,7 @@ */ CAfThumbnailTask::~CAfThumbnailTask() { - delete mService; + delete mBitmap; } // ----------------------------------------------------------------------------- @@ -49,12 +49,12 @@ void CAfThumbnailTask::ExecuteLD(MAfTaskStorage& taskStorage, const RMessage2& message) { - CAfThumbnailTask *self = new (ELeave)CAfThumbnailTask(taskStorage, - message); + CAfThumbnailTask *self = new (ELeave)CAfThumbnailTask(taskStorage, message); CleanupStack::PushL(self); self->ConstructL(); taskStorage.PushL(self); CleanupStack::Pop(self); + message.Complete(KErrNone); } // ----------------------------------------------------------------------------- @@ -63,43 +63,20 @@ */ void CAfThumbnailTask::ConstructL() { - TPckgBuf width(0), height(0); RBuf path; CleanupClosePushL(path); - mMsg.ReadL(0, width); - mMsg.ReadL(1, height); path.CreateL(mMsg.GetDesLengthL(2)); mMsg.ReadL(2, path); - CFbsBitmap *bitmap = new (ELeave) CFbsBitmap(); - CleanupStack::PushL(bitmap); - User::LeaveIfError(bitmap->Load(path)); - mService = CTsGraphicFileScalingHandler::NewL(*this, - *bitmap, - TSize(width(), height()), - CTsGraphicFileScalingHandler::EKeepAspectRatioByExpanding); - CleanupStack::PopAndDestroy(bitmap); + mBitmap = new (ELeave) CFbsBitmap; + User::LeaveIfError(mBitmap->Load(path)); + CleanupStack::PopAndDestroy(&path); -} -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CAfThumbnailTask::ImageReadyCallBack(TInt error,const CFbsBitmap *bitmap) -{ - if (EFalse == mMsg.IsNull() && - KErrNone == error) { - mMsg.Write(0, TPckgBuf(const_cast(bitmap)->Handle())); - mMsg.Write(1, TPckgBuf(this)); - mMsg.Complete(error); - } else { - if (EFalse == mMsg.IsNull()) { - mMsg.Complete(error); - } - mStorage.Pop(this); - delete this; - } + + mMsg.Write(0, TPckgBuf(mBitmap->Handle())); + mMsg.Write(1, TPckgBuf(this)); + } // ----------------------------------------------------------------------------- @@ -115,7 +92,7 @@ // // ----------------------------------------------------------------------------- // -void CAfThumbnailTask::BroadcastReceivedL(const RMessage2&) +void CAfThumbnailTask::BroadcastReceivedL(const RMessage2&, TBool) { } diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/bwins/casathandleru.def --- a/contentstorage/bwins/casathandleru.def Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -EXPORTS - ?CheckVisibility@CCaSatHandler@@SAHXZ @ 1 NONAME ; int CCaSatHandler::CheckVisibility(void) - ?GetName@CCaSatHandler@@QAEHAAVTDes16@@@Z @ 2 NONAME ; int CCaSatHandler::GetName(class TDes16 &) - ?LoadIconL@CCaSatHandler@@QAEPAVCAknIcon@@XZ @ 3 NONAME ; class CAknIcon * CCaSatHandler::LoadIconL(void) - ?NewL@CCaSatHandler@@SAPAV1@XZ @ 4 NONAME ; class CCaSatHandler * CCaSatHandler::NewL(void) - diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/bwins/cautilsu.def --- a/contentstorage/bwins/cautilsu.def Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/bwins/cautilsu.def Mon Oct 04 00:38:31 2010 +0300 @@ -99,6 +99,7 @@ ?SetParentId@CCaInnerQuery@@QAEXH@Z @ 98 NONAME ; void CCaInnerQuery::SetParentId(int) ?GetIds@CCaInnerNotifierFilter@@QBE?AV?$RArray@H@@XZ @ 99 NONAME ; class RArray CCaInnerNotifierFilter::GetIds(void) const ?SetStringIdL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 100 NONAME ; void CCaLocalizationEntry::SetStringIdL(class TDesC16 const &) - ?SetTextId@CCaLocalizationEntry@@QAEXI@Z @ 101 NONAME ; void CCaLocalizationEntry::SetTextId(unsigned int) - ?RemoveAttribute@RCaEntryAttrArray@@QAEXABVTDesC16@@@Z @ 102 NONAME ; void RCaEntryAttrArray::RemoveAttribute(class TDesC16 const &) + ?InitTextResolverSymbianL@MenuUtils@@SAXABVTDesC16@@@Z @ 101 NONAME ; void MenuUtils::InitTextResolverSymbianL(class TDesC16 const &) + ?SetTextId@CCaLocalizationEntry@@QAEXI@Z @ 102 NONAME ; void CCaLocalizationEntry::SetTextId(unsigned int) + ?RemoveAttribute@RCaEntryAttrArray@@QAEXABVTDesC16@@@Z @ 103 NONAME ; void RCaEntryAttrArray::RemoveAttribute(class TDesC16 const &) diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/caclient/caclient.pro --- a/contentstorage/caclient/caclient.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/caclient/caclient.pro Mon Oct 04 00:38:31 2010 +0300 @@ -55,8 +55,11 @@ -lscrclient \ -laknicon \ -lapgrfx \ - -lapparc + -lapparc \ + -lSatClient + + include(caclient_s60.pri) } diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/caclient/s60/inc/cabitmapadapter.h --- a/contentstorage/caclient/s60/inc/cabitmapadapter.h Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* - * 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: - * - */ - -#ifndef BITMAPADAPTER_H -#define BITMAPADAPTER_H - -// INCLUDES - -// CLASS DECLARATION -#include - -class CFbsBitmap; - -/** - * CaBitmapAdapter - * - */ -class CaBitmapAdapter -{ -public: - - /** - * Convert from bitmap and mask to qpixmap - * @param input bitmap. - * @param pixmap to prepare. - * @return void. - */ - static void fromBitmapAndMaskToPixmapL(CFbsBitmap* fbsBitmap, CFbsBitmap* fbsMask, QPixmap& pixmap); - -}; - -#endif // BITMAPADAPTER_H diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/caclient/s60/src/cabitmapadapter.cpp --- a/contentstorage/caclient/s60/src/cabitmapadapter.cpp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * 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". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: ?Description - * - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "cadef.h" -#include "cabitmapadapter.h" - -void CaBitmapAdapter::fromBitmapAndMaskToPixmapL(CFbsBitmap* fbsBitmap, - CFbsBitmap* fbsMask, QPixmap& pixmap) -{ - pixmap = pixmap.fromSymbianCFbsBitmap(fbsBitmap); - QPixmap mask; - mask = mask.fromSymbianCFbsBitmap(fbsMask); - pixmap.setAlphaChannel(mask); -} diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/caclient/s60/src/camenuiconutility.cpp --- a/contentstorage/caclient/s60/src/camenuiconutility.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/caclient/s60/src/camenuiconutility.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -28,10 +28,20 @@ // cfbsbitmap #include +#include +#include +#include // MCL + +#include +#include + +#include + + #include +#include "ca2internalCRkeys.h" #include "camenuiconutility.h" -#include "cabitmapadapter.h" #include "caentry.h" #include "caquery.h" #include "caservice.h" @@ -39,6 +49,32 @@ const char appUidAttributeName[] = "application:uid"; +LOCAL_C void getIconFromFile(HbIcon& icon, const QSizeF &size) +{ + if ((icon.iconName().contains(QChar('.')) || + (icon.iconName().contains(QChar('/'))) || + (icon.iconName().contains(QChar('\\'))) ) + && !icon.isNull() && icon.size().isValid()) { + icon.setSize(size); + icon = HbIcon(QIcon(icon.pixmap())); + } +} + +/*! + Convert from bitmap and mask to qpixmap + \param input bitmap. + \param pixmap to prepare. + \retval void. + */ +LOCAL_C void fromBitmapAndMaskToPixmap(CFbsBitmap* fbsBitmap, + CFbsBitmap* fbsMask, QPixmap& pixmap) +{ + pixmap = pixmap.fromSymbianCFbsBitmap(fbsBitmap); + QPixmap mask; + mask = mask.fromSymbianCFbsBitmap(fbsMask); + pixmap.setAlphaChannel(mask); +} + /*! Get icon from entry. \param entry const reference to CaEntry. @@ -50,17 +86,14 @@ QString skinId(entry.iconDescription().skinId()); if (!skinId.isEmpty()) { icon = HbIcon(skinId); + getIconFromFile(icon, size); } if (icon.isNull() || !(icon.size().isValid())) { QString fileName(entry.iconDescription().filename()); if (!fileName.isEmpty()) { icon = HbIcon(fileName); - if (fileName.contains(QChar('.')) - && !icon.isNull() && icon.size().isValid()) { - icon.setSize(size); - icon = HbIcon(QIcon(icon.pixmap())); - } + getIconFromFile(icon, size); } } return icon; @@ -105,7 +138,7 @@ QPixmap pixmap; if ((err == KErrNone) && (iconsCount > 0)) { - CaBitmapAdapter::fromBitmapAndMaskToPixmapL(apaMaskedBitmap, + fromBitmapAndMaskToPixmap(apaMaskedBitmap, apaMaskedBitmap->Mask(), pixmap); pixmap = pixmap.scaled(size.toSize(), @@ -215,18 +248,161 @@ return icon; } + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (Icon can be created only from SIM) +/*! + Get bitmap. + \param aIconEF icon information array + \retval bitmap. + */ +LOCAL_C CFbsBitmap* getSatBitmapL() + { + RSatSession satSession; + CleanupClosePushL(satSession); + RSatService satIcon; + CleanupClosePushL(satIcon); + + satSession.ConnectL(); + satIcon.OpenL(satSession); + + + TInt iconId(KErrNone); + RProperty::Get(KCRUidCa, KCaSatUIIconId, iconId); + + CFbsBitmap* bitmap(NULL); + + if (iconId != KErrNone) { + RIconEf iconEf; + satIcon.GetIconInfoL(TUint8(iconId), iconEf); + CleanupClosePushL(iconEf); + + TInt selectedIconIndex(KErrNotFound); + TSize selectedIconSize(0, 0); + + for (TInt i = 0; i < iconEf.Count(); ++i) { + if ((iconEf[i].IconSize().iHeight * iconEf[i].IconSize().iWidth) + >= (selectedIconSize.iHeight * selectedIconSize.iWidth)) + if (bitmap) { + delete bitmap; + bitmap = NULL; + } + // test and select index of icon which is not too big + bitmap = satIcon.GetIconL( iconEf[ i ] ); + if (bitmap) //!bitmap if iIcon is too big + { + selectedIconSize = iconEf[i].IconSize(); + selectedIconIndex = i; + } + } + if (selectedIconIndex != KErrNotFound) { + if (bitmap) { + delete bitmap; + bitmap = NULL; + } + bitmap = satIcon.GetIconL( iconEf[ selectedIconIndex ] ); + } + CleanupStack::PopAndDestroy(&iconEf); + } + + CleanupStack::PopAndDestroy(&satIcon); + CleanupStack::PopAndDestroy(&satSession); + + return bitmap; +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + + + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (Icon can be created only from SIM) +/*! + Get bitmap. + \param aIconEF icon information array + \retval bitmap. + */ +LOCAL_C CFbsBitmap* getSatMaskL(CFbsBitmap* aBitmap) + { + CFbsBitmap* mask(new (ELeave) CFbsBitmap); + CleanupStack::PushL(mask); + + User::LeaveIfError(mask->Create(aBitmap->SizeInPixels(), EGray256)); + + CFbsBitmapDevice* maskDevice = CFbsBitmapDevice::NewL(mask); + CleanupStack::PushL(maskDevice); + CFbsBitGc* maskGc; + User::LeaveIfError(maskDevice->CreateContext(maskGc)); + CleanupStack::PushL(maskGc); + maskGc->SetBrushStyle(CGraphicsContext::ESolidBrush); + maskGc->SetDrawMode(CGraphicsContext::EDrawModePEN); + maskGc->SetBrushColor(KRgbBlack); + maskGc->Clear(); + maskGc->SetBrushColor(KRgbWhite); + maskGc->DrawRect(TRect(TPoint(), aBitmap->SizeInPixels())); + CleanupStack::PopAndDestroy(maskGc); + CleanupStack::PopAndDestroy(maskDevice); + CleanupStack::Pop(mask); + return mask; +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (Icon can be created only from SIM) +/*! + Get icon from entry. + \param entry const reference to CaEntry. + \retval icon. + */ +LOCAL_C HbIcon getSatIconL() +{ + HbIcon icon; + QPixmap pixmap; + CFbsBitmap* bitmap(NULL); + CFbsBitmap* mask(NULL); + bitmap = getSatBitmapL(); + if(bitmap) + { + mask = getSatMaskL(bitmap); + fromBitmapAndMaskToPixmap(bitmap, mask, pixmap); + icon = HbIcon(QIcon(pixmap)); + } + + + delete mask; + delete bitmap; + return icon; + +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + + /*! Get icon. \param entry const reference to CaEntry. \param sie const reference to icon size. \retval icon. */ -HbIcon CaMenuIconUtility::getEntryIcon(const CaEntry& entry, - const QSizeF &size) +HbIcon CaMenuIconUtility::getEntryIcon(const CaEntry& entry, const QSizeF &size) { HbIcon icon; + icon = getIconFromEntry(entry, size); - + + if ((icon.isNull() || !(icon.size().isValid())) && + entry.attribute(appUidAttributeName).toInt() == KSatUid.iUid) { + TRAP_IGNORE(icon = getSatIconL()); + } + if (icon.isNull() || !(icon.size().isValid())) { QString uidString(entry.attribute(appUidAttributeName)); bool uidOk(false); @@ -239,16 +415,18 @@ TRAP_IGNORE(icon = getIconFromApparcL(uidValue, size)); } } - + if (icon.isNull() || !(icon.size().isValid())) { icon = getDefaultIcon(entry); } - + if (entry.entryTypeName() == XQConversions::s60DescToQString( - KCaTypeWidget)) { + KCaTypeWidget)) { icon.addProportionalBadge(Qt::AlignBottom | Qt::AlignRight, - HbIcon("qtg_small_homescreen"), QSizeF(0.5, 0.5)); + HbIcon("qtg_small_homescreen"), QSizeF(0.5, 0.5)); } return icon; } + + diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/caclient/src/caitemmodel.cpp --- a/contentstorage/caclient/src/caitemmodel.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/caclient/src/caitemmodel.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -477,6 +477,9 @@ case CaItemModel::TextRole: variant = QVariant(pEntry->text()); break; + case CaItemModel::DescriptionRole: + variant = QVariant(pEntry->description()); + break; case CaItemModel::FullTextRole: variant = QVariant(pEntry->text() + QString(" ") + pEntry->description()); break; diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/caclient/stub/src/hswidgetregistryservice.cpp --- a/contentstorage/caclient/stub/src/hswidgetregistryservice.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/caclient/stub/src/hswidgetregistryservice.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -169,10 +169,10 @@ HsWidgetComponentDescriptor widgetDescriptor = componentParser.widgetComponentDescriptor(); widgetDescriptor.library = manifestFilePath + "/" + widgetDescriptor.uri + ".dll"; - if (widgetDescriptor.iconUri.length() > 0 ) { + if (widgetDescriptor.iconUri.length() > 0 && widgetDescriptor.iconUri.contains('.')) { widgetDescriptor.iconUri = manifestFilePath + "/" + widgetDescriptor.iconUri; } - if (widgetDescriptor.previewImage.length() > 0 ) { + if (widgetDescriptor.previewImage.length() > 0 && widgetDescriptor.previewImage.contains('.')) { widgetDescriptor.previewImage = manifestFilePath + "/" + widgetDescriptor.previewImage; } diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/cahandler/app/inc/caapphandler.h --- a/contentstorage/cahandler/app/inc/caapphandler.h Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/cahandler/app/inc/caapphandler.h Mon Oct 04 00:38:31 2010 +0300 @@ -53,8 +53,6 @@ void launchApplicationL(const TUid uid, TInt viewId); - int closeApplication(const EntryFlags &flags, TInt windowGroupId); - int handleRemove(const EntryFlags &flags, const QString &typeName, const QString &componentId); diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/cahandler/app/src/caapphandler.cpp --- a/contentstorage/cahandler/app/src/caapphandler.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/cahandler/app/src/caapphandler.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -47,8 +46,6 @@ static const char caTypePackage[] = "package"; static const char caTypeWidget[] = "widget"; static const char caAttrView[] = "view"; -static const char caCmdClose[] = "close"; -static const char caAttrWindowGroupId[] = "window_group_id"; static const char caAttrComponentId[] = "component_id"; /*! @@ -104,11 +101,6 @@ int uid = uidValue.toInt(); TRAP(result, launchApplicationL(TUid::Uid(uid), viewId)); } - } else if (command == caCmdClose && entry.entryTypeName() == caTypeApp ) { - QString windowGroupId = entry.attribute(caAttrWindowGroupId); - if (!windowGroupId.isNull()) { - result = closeApplication(entry.flags(), windowGroupId.toInt()); - } } else if (command == caCmdRemove) { QString componentId(entry.attribute(caAttrComponentId)); result = handleRemove(entry.flags(), @@ -178,28 +170,6 @@ } } -/*! - * Closes application. - * \param flags an entry flags. - * \param windowGroupId window group id. - * \retval an error code. - */ -int CaAppHandler::closeApplication(const EntryFlags &flags, int windowGroupId) -{ - int result(KErrNone); - if (windowGroupId > 0) { - RWsSession wsSession; - result = wsSession.Connect(); - if (result==KErrNone) { - TWsEvent event; - event.SetTimeNow(); - event.SetType(KAknShutOrHideApp); - wsSession.SendEventToWindowGroup(windowGroupId, event); - } - wsSession.Close(); - } - return result; -} /*! * Uninstall application. diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/camificonengine/src/cambmiconengine.cpp --- a/contentstorage/camificonengine/src/cambmiconengine.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/camificonengine/src/cambmiconengine.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -86,7 +86,7 @@ QPixmap mask; mask = mask.fromSymbianCFbsBitmap(maskBitmap); pixmap.setAlphaChannel(mask); - pixmap = pixmap.scaled(size, Qt::KeepAspectRatioByExpanding); + pixmap = pixmap.scaled(size, Qt::IgnoreAspectRatio); } } diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casoftwareregistry/casoftwareregistry.pro --- a/contentstorage/casoftwareregistry/casoftwareregistry.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casoftwareregistry/casoftwareregistry.pro Mon Oct 04 00:38:31 2010 +0300 @@ -44,7 +44,8 @@ -lsifnotification \ -lxqutils \ -lPlatformEnv \ - -lefsrv + -lefsrv \ + -lcautils include(casoftwareregistry_s60.pri) } diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casoftwareregistry/s60/src/caprogresscanner.cpp --- a/contentstorage/casoftwareregistry/s60/src/caprogresscanner.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casoftwareregistry/s60/src/caprogresscanner.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -83,7 +83,8 @@ iComponentId = iSoftwareRegistry.GetComponentIdL( aStartData.GlobalComponentId(), aStartData.SoftwareType() ); - SubscribeL( aKey ) ); + SubscribeL( aKey ); + ); } } @@ -141,7 +142,7 @@ else { //information for observer that uninstallation was failed - iObserver->progressChange( iComponentId, aError ); + iObserver->progressChange( iComponentId, KErrGeneral ); } CancelSubscribeL(); } diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp --- a/contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -25,6 +25,7 @@ #include #include #include +#include #include "cauninstallnotifier.h" #include "cauninstallnotifier_p.h" @@ -32,6 +33,7 @@ #include "casoftwareregistry_p.h" #include "cadefs.h" #include "caarraycleanup.inl" +#include "cautils.h" using namespace Usif; _LIT(KConfirmMessageKey, "MIDlet-Delete-Confirm"); @@ -231,10 +233,22 @@ if (domainProperty && domainProperty->PropertyType() == CPropertyEntry::ELocalizedProperty) { + const TDesC& domainPropertyValue = static_cast( + domainProperty)->StrValue(); + TInt splitIndex = domainPropertyValue.Locate(','); + RBuf qmFileName; + qmFileName.CleanupClosePushL(); + qmFileName.CreateL(domainPropertyValue.Right( + domainPropertyValue.Length() - splitIndex - 1), + domainPropertyValue.Length() - splitIndex); + qmFileName.Append('_'); + MenuUtils::InitTextResolverSymbianL(qmFileName); + HBufC* translatedProtectionDomain = HbTextResolverSymbian::LoadLC( + domainPropertyValue.Left(splitIndex)); result[CaSoftwareRegistry::componentProtectionDomainKey()] = - XQConversions::s60DescToQString( - static_cast( - domainProperty)->StrValue()); + XQConversions::s60DescToQString(*translatedProtectionDomain); + CleanupStack::PopAndDestroy(translatedProtectionDomain); + CleanupStack::PopAndDestroy(&qmFileName); } CPropertyEntry *midletDescryption = diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/caappscanner/src/casrvappscanner.cpp --- a/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -876,7 +876,26 @@ changed = SetCWRTAppL( aEntry ) || changed; } } + + TApaAppCapabilityBuf appCap; + TInt screenNumber = 0; + + User::LeaveIfError( iApaLsSession.GetAppCapability + ( appCap, info->iUid ) ); + User::LeaveIfError( iApaLsSession.GetDefaultScreenNumber + ( screenNumber, info->iUid ) ); + + const TBool hidden = appCap().iAppIsHidden || screenNumber != 0; + + const TBool visible = aEntry->GetFlags() & EVisible; + + if ( hidden && visible ) + { + changed = ETrue; + aEntry->SetFlags(aEntry->GetFlags() & ~EVisible); + } } + CleanupStack::PopAndDestroy( info ); return changed; } @@ -1259,3 +1278,4 @@ } return updated; } + diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/calocalizerscanner/calocalizerscanner.pro --- a/contentstorage/casrv/calocalizerscanner/calocalizerscanner.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casrv/calocalizerscanner/calocalizerscanner.pro Mon Oct 04 00:38:31 2010 +0300 @@ -50,7 +50,8 @@ -lecom \ -lcautils \ -lcamenu \ - -lefsrv + -lefsrv \ + -lcautils } exportResources(./*.qm, resource/qt/translations) diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp --- a/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -29,6 +29,7 @@ #include "cainnerquery.h" #include "cainnerentry.h" #include "casqlcommands.h" +#include "cautils.h" @@ -174,45 +175,10 @@ { if( iRecentQmFile.Compare( aLocEntry->GetQmFilename() ) ) { - - if( !HbTextResolverSymbian::Init( aLocEntry->GetQmFilename(), KLocalizationFilepathC ) ) - { - if( !HbTextResolverSymbian::Init( aLocEntry->GetQmFilename(), KLocalizationFilepathZ ) ) - { - // this should not be called too often - TChar currentDriveLetter; - TDriveList driveList; - RFs fs; - User::LeaveIfError( fs.Connect() ); - User::LeaveIfError( fs.DriveList( driveList ) ); - - RBuf path; - path.Create( KLocalizationFilepath().Length() + 1 ); - CleanupClosePushL( path ); - - for ( TInt driveNr=EDriveY; driveNr >= EDriveA; driveNr-- ) - { - if ( driveList[driveNr] ) - { - User::LeaveIfError( fs.DriveToChar( driveNr, - currentDriveLetter ) ); - path.Append( currentDriveLetter ); - path.Append( KLocalizationFilepath ); - if( HbTextResolverSymbian::Init( aLocEntry->GetQmFilename(), path ) ) - { - break; - } - } - path.Zero(); - } - CleanupStack::PopAndDestroy( &path ); - fs.Close(); - } - } - + MenuUtils::InitTextResolverSymbianL(aLocEntry->GetQmFilename()); // keeping last qm filename to avoid another initialization iRecentQmFile.Close(); - iRecentQmFile.Create( aLocEntry->GetQmFilename().Length() ); + iRecentQmFile.CreateL( aLocEntry->GetQmFilename().Length() ); iRecentQmFile.Copy( aLocEntry->GetQmFilename() ); } return HbTextResolverSymbian::LoadLC( aLocEntry->GetStringId() ); diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/casatmonitor/src/casatmonitor.cpp --- a/contentstorage/casrv/casatmonitor/src/casatmonitor.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casrv/casatmonitor/src/casatmonitor.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -100,7 +100,7 @@ { RBuf satName; satName.CleanupClosePushL(); - satName.Create( KCenRepBufferSize ); + satName.CreateL( KCenRepBufferSize ); User::LeaveIfError( GetSatName( satName ) ); if( !resultArray.Count() ) diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/causifscanner/inc/causifscanner.h --- a/contentstorage/casrv/causifscanner/inc/causifscanner.h Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casrv/causifscanner/inc/causifscanner.h Mon Oct 04 00:38:31 2010 +0300 @@ -28,7 +28,6 @@ class CCaStorageProxy; class CCaInnerEntry; -class CCaInstallNotifier; class CCaMmcWatcher; class TPluginParams; @@ -70,7 +69,7 @@ * @since S60 v5.0 * @param aUid installed uid. */ - void HandleInstallNotifyL( TInt aUid ); + void HandleInstallNotifyL(); public: // From MMmcWatcherCallback. @@ -163,17 +162,7 @@ /** * Install notifier. Own. */ - CCaInstallNotifier *iSystemInstallNotifier; - - /** - * Uninstall notifier. Own. - */ - CCaInstallNotifier *iUsifUninstallNotifier; - - /** - * Install and uninstall notifier. Own. - */ - CCaInstallNotifier *iJavaInstallNotifier; + CCaInstallNotifier *iInstallNotifier; /** * File session. Own diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/causifscanner/src/causifscanner.cpp --- a/contentstorage/casrv/causifscanner/src/causifscanner.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casrv/causifscanner/src/causifscanner.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -58,14 +58,7 @@ // void CCaUsifScanner::ConstructL() { - iSystemInstallNotifier = CCaInstallNotifier::NewL( *this, - CCaInstallNotifier::ESisInstallNotification ); - - iUsifUninstallNotifier = CCaInstallNotifier::NewL( *this, - CCaInstallNotifier::EUsifUninstallNotification ); - - iJavaInstallNotifier = CCaInstallNotifier::NewL( *this, - CCaInstallNotifier::EJavaInstallNotification ); + iInstallNotifier = CCaInstallNotifier::NewL( *this ); User::LeaveIfError( iFs.Connect() ); iMmcWatcher = CCaMmcWatcher::NewL( iFs, this ); @@ -81,9 +74,7 @@ { delete iMmcWatcher; iFs.Close(); - delete iJavaInstallNotifier; - delete iUsifUninstallNotifier; - delete iSystemInstallNotifier; + delete iInstallNotifier; } // --------------------------------------------------------------------------- @@ -110,7 +101,7 @@ // // --------------------------------------------------------------------------- // -void CCaUsifScanner::HandleInstallNotifyL( TInt /*aUid*/) +void CCaUsifScanner::HandleInstallNotifyL() { UpdateUsifListL(); } @@ -159,7 +150,7 @@ else if( !aEntry->SoftwareType().Compare( KSoftwareTypeWidget ) ) { aCaEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueCWRT ); - } + } if( aEntry->Name().Compare( KNullDesC ) ) { aCaEntry->SetTextL( aEntry->Name() ); @@ -205,32 +196,32 @@ CCaInnerEntry *caEntry = CCaInnerEntry::NewLC(); CreateCaEntryFromEntryL( resultUsifArray[i], caEntry ); // in case we rebuild our db mark as missing - if( !(iSoftwareRegistry.IsComponentPresentL( + if( !(iSoftwareRegistry.IsComponentPresentL( resultUsifArray[i]->ComponentId())) ) { caEntry->SetFlags( caEntry->GetFlags() | EMissing ); } iStorageProxy.AddL( caEntry ); CleanupStack::PopAndDestroy( caEntry ); - } + } // found in the CaStorage, mark is as missing - else if( !(iSoftwareRegistry.IsComponentPresentL( - resultUsifArray[i]->ComponentId() )) ) + else if( !(iSoftwareRegistry.IsComponentPresentL( + resultUsifArray[i]->ComponentId() )) ) { if( !( entries[entryIndex]->GetFlags() & EMissing ) ) { - entries[entryIndex]->SetFlags( + entries[entryIndex]->SetFlags( ( entries[entryIndex]->GetFlags() | EMissing ) ); - iStorageProxy.AddL( + iStorageProxy.AddL( entries[entryIndex], EFalse, EItemDisappeared ); } } // found in the storage remove missing flag as this is Present in scr else if (entries[entryIndex]->GetFlags() & EMissing) { - entries[entryIndex]->SetFlags( + entries[entryIndex]->SetFlags( entries[entryIndex]->GetFlags() & ~EMissing ); - iStorageProxy.AddL( entries[entryIndex]); + iStorageProxy.AddL( entries[entryIndex]); } } diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/cawidgetscanner/group/cawidgetscanner.mmp --- a/contentstorage/casrv/cawidgetscanner/group/cawidgetscanner.mmp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/group/cawidgetscanner.mmp Mon Oct 04 00:38:31 2010 +0300 @@ -35,7 +35,6 @@ SOURCEPATH ../src SOURCE cawidgetscannerplugin.cpp -SOURCE cawidgetscannerinstallnotifier.cpp SOURCE cawidgetscannerparser.cpp SOURCE cawidgetdescription.cpp SOURCE cawidgetstoragehandler.cpp diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerinstallnotifier.h --- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerinstallnotifier.h Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* - * 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". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Sis package installation event listener - * - */ - -#ifndef C_CAWIDGETSCANNERINSTALLNOTIFIER_H -#define C_CAWIDGETSCANNERINSTALLNOTIFIER_H - -#include -#include - -class CCaWidgetScannerPlugin; - -/** - * Central Repository notifier. - * - * @since S60 S60 v5.x - */ -class CCaWidgetScannerInstallNotifier : public CActive - { - /** - * Enum defining the purpouse of the installation event. - */ - enum TInstOp - { - EInstOpNone = 0x00000000, - EInstOpInstall = 0x00000001, - EInstOpUninstall = 0x00000002, - EInstOpRestore = 0x00000004 - }; - - /** - * Enum defining the exit status of the installation event. - */ - enum TInstOpStatus - { - EInstOpStatusNone = 0x00000000, - EInstOpStatusSuccess = 0x00000100, - EInstOpStatusAborted = 0x00000200 - }; - -public: - - /** - * Creates an instance of CCaWidetScannerInstallNotifier implementation. - * @param aCallBack Reference to notifier interface. - * @param aCategory Package uid. - * @param aKey Key for central repository. - */ - static CCaWidgetScannerInstallNotifier* NewL( - CCaWidgetScannerPlugin* aCallback, TUid aCategory, TUint aKey ); - - /** - * Destructor. - */ - virtual ~CCaWidgetScannerInstallNotifier(); - -private: - /** - * Constructor. - * @param aCallBack Reference to notifier interface. - * @param aCategory Package uid. - * @param aKey Key for central repository. - */ - CCaWidgetScannerInstallNotifier( CCaWidgetScannerPlugin* aCallback, - TUid aCategory, TUint aKey ); - - /** - * Symbian 2nd phase constructor. - */ - void ConstructL(); - - /** - * From CActive. - */ - void DoCancel(); - - /** - * From CActive. - */ - void RunL(); - - /** - * From CActive. - */ - TInt RunError( TInt aError ); - -private: - /** - * User side interface to Publish & Subscribe. - * Own. - */ - RProperty iProperty; - - /** - * Interface for notifying changes in SWI. - * Not own. - */ - CCaWidgetScannerPlugin* iCallback; - - /** - * Category uid. - * Own. - */ - TUid iCategory; - - /** - * Key identifier. - * Own. - */ - TUint iKey; - - /** - * flag provides workaround for a problem with missing notifications after install - * - */ - TBool iHackFlag; // TODO find another solution - - }; - -#endif // C_CAWIDGETSCANNERINSTALLNOTIFIER_H -// End of File diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerplugin.h --- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerplugin.h Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerplugin.h Mon Oct 04 00:38:31 2010 +0300 @@ -21,12 +21,13 @@ #include #include #include "cammcwatcher.h" +#include "cainstallnotifier.h" class TPluginParams; -class CCaWidgetScannerInstallNotifier; class CCaWidgetStorageHandler; -class CCaWidgetScannerPlugin : public CCaSrvPlugin, MMmcWatcherCallback +class CCaWidgetScannerPlugin : + public CCaSrvPlugin, MMmcWatcherCallback, MCaInstallListener { public: @@ -48,6 +49,8 @@ */ void SynchronizeL(); + void HandleInstallNotifyL(); + private: //from MWidgetMmcWatcherCallback @@ -78,7 +81,7 @@ /** * Sis installation notifier. Own */ - CCaWidgetScannerInstallNotifier* iInstallNotifier; + CCaInstallNotifier* iInstallNotifier; /** * Content Storage Handler. Own. diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -671,46 +671,45 @@ if( iTranslationFileName.Length() ) { RBuf translationFileName; - translationFileName.Create( iTranslationFileName.Length() + 1 ); CleanupClosePushL( translationFileName ); + translationFileName.CreateL( iTranslationFileName.Length() + 1 ); translationFileName.Copy( iTranslationFileName ); translationFileName.Append( KWidgetScannerUnderline ); - - + if( !HbTextResolverSymbian::Init( translationFileName, KLocalizationFilepathC ) ) - { - if( !HbTextResolverSymbian::Init( translationFileName, KLocalizationFilepathZ ) ) - { - // this should not be called too often - TChar currentDriveLetter; - TDriveList driveList; - RFs fs; - User::LeaveIfError( fs.Connect() ); - User::LeaveIfError( fs.DriveList( driveList ) ); + { + if( !HbTextResolverSymbian::Init( translationFileName, KLocalizationFilepathZ ) ) + { + // this should not be called too often + TChar currentDriveLetter; + TDriveList driveList; + RFs fs; + User::LeaveIfError( fs.Connect() ); + User::LeaveIfError( fs.DriveList( driveList ) ); + + RBuf path; + CleanupClosePushL( path ); + path.CreateL( KLocalizationFilepath().Length() + 1 ); - RBuf path; - path.Create( KLocalizationFilepath().Length() + 1 ); - CleanupClosePushL( path ); - - for( TInt driveNr=EDriveY; driveNr >= EDriveA; driveNr-- ) - { - if( driveList[driveNr] ) - { - User::LeaveIfError( fs.DriveToChar( driveNr, - currentDriveLetter ) ); - path.Append( currentDriveLetter ); - path.Append( KLocalizationFilepath ); - if( HbTextResolverSymbian::Init( translationFileName, path ) ) - { - break; - } - } - path.Zero(); - } - CleanupStack::PopAndDestroy( &path ); - fs.Close(); - } - } + for( TInt driveNr=EDriveY; driveNr >= EDriveA; driveNr-- ) + { + if( driveList[driveNr] ) + { + User::LeaveIfError( fs.DriveToChar( driveNr, + currentDriveLetter ) ); + path.Append( currentDriveLetter ); + path.Append( KLocalizationFilepath ); + if( HbTextResolverSymbian::Init( translationFileName, path ) ) + { + break; + } + } + path.Zero(); + } + CleanupStack::PopAndDestroy( &path ); + fs.Close(); + } + } HBufC* tmp; diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/cawidgetscanner/src/cawidgetscannerinstallnotifier.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerinstallnotifier.cpp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* - * 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". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Sis package installation event listener - * - */ - -#include -#include "cawidgetscannerinstallnotifier.h" -#include "cawidgetscannerplugin.h" - -// ============================ MEMBER FUNCTIONS ============================= - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CCaWidgetScannerInstallNotifier::CCaWidgetScannerInstallNotifier( - CCaWidgetScannerPlugin* aCallback, TUid aCategory, TUint aKey ) : - CActive( EPriorityNormal ) - { - CActiveScheduler::Add( this ); - - iCallback = aCallback; - iCategory = aCategory; - iKey = aKey; - iProperty.Attach( iCategory, iKey ); - SetActive(); - iProperty.Subscribe( iStatus ); - iHackFlag = EFalse; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CCaWidgetScannerInstallNotifier::ConstructL() - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CCaWidgetScannerInstallNotifier* CCaWidgetScannerInstallNotifier::NewL( - CCaWidgetScannerPlugin* aCallback, TUid aCategory, TUint aKey ) - { - CCaWidgetScannerInstallNotifier* self = - new ( ELeave ) CCaWidgetScannerInstallNotifier( aCallback, - aCategory, aKey ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CCaWidgetScannerInstallNotifier::~CCaWidgetScannerInstallNotifier() - { - Cancel(); - iProperty.Close(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaWidgetScannerInstallNotifier::DoCancel() - { - iProperty.Cancel(); - } - -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT (error is ignored) -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CCaWidgetScannerInstallNotifier::RunError( TInt /*aError*/) - { - // No need to do anything - return KErrNone; - } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaWidgetScannerInstallNotifier::RunL() - { - // Re-issue request before notifying - SetActive(); - iProperty.Subscribe( iStatus ); - - TInt status; - User::LeaveIfError( iProperty.Get( KUidSystemCategory, - KSAUidSoftwareInstallKeyValue, status ) ); - - if( iHackFlag ) - { - iHackFlag = EFalse; - iCallback->SynchronizeL(); - } - else if( ( status & EInstOpStatusSuccess ) && ( - ( status & EInstOpInstall ) || - ( status & EInstOpUninstall ) ) ) - { - iHackFlag = ETrue; - } - } -// End of File diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/cawidgetscanner/src/cawidgetscannerplugin.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerplugin.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerplugin.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -1,4 +1,4 @@ -/* + /* * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available @@ -22,7 +22,6 @@ #include "cawidgetscannerplugin.h" #include "cawidgetstoragehandler.h" -#include "cawidgetscannerinstallnotifier.h" // Function used to return an instance of the proxy table. const TImplementationProxy ImplementationTable[] = @@ -34,11 +33,11 @@ #pragma CTC SKIP #endif //COVERAGE_MEASUREMENT (proxy for instantiation) // ---------------------------------------------------------------------------- -// +// // ---------------------------------------------------------------------------- // -EXPORT_C const TImplementationProxy* -ImplementationGroupProxy( TInt& aTableCount ) +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) { aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy); return ImplementationTable; @@ -50,7 +49,7 @@ // ============================ MEMBER FUNCTIONS =============================== // ---------------------------------------------------------------------------- -// +// // ---------------------------------------------------------------------------- // CCaWidgetScannerPlugin::CCaWidgetScannerPlugin() @@ -58,23 +57,23 @@ } // ---------------------------------------------------------------------------- -// +// // ---------------------------------------------------------------------------- // void CCaWidgetScannerPlugin::ConstructL( TPluginParams* aPluginParams ) { User::LeaveIfError( iFs.Connect() ); iMmcWatcher = CCaMmcWatcher::NewL( iFs, this ); - iInstallNotifier = CCaWidgetScannerInstallNotifier::NewL( this, - KUidSystemCategory, KSAUidSoftwareInstallKeyValue ); + iInstallNotifier = CCaInstallNotifier::NewL( *this, + CCaInstallNotifier::ESisInstallNotification ); iStorageHandler = CCaWidgetStorageHandler::NewL( aPluginParams->storageProxy, - *aPluginParams->softwareRegistry, iFs ); + *aPluginParams->softwareRegistry, iFs ); SynchronizeL(); } // ---------------------------------------------------------------------------- -// +// // ---------------------------------------------------------------------------- // CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewL( @@ -86,7 +85,7 @@ } // ---------------------------------------------------------------------------- -// +// // ---------------------------------------------------------------------------- // CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewLC( @@ -99,14 +98,14 @@ } // ---------------------------------------------------------------------------- -// +// // ---------------------------------------------------------------------------- // CCaWidgetScannerPlugin::~CCaWidgetScannerPlugin() { - delete iMmcWatcher; + delete iStorageHandler; delete iInstallNotifier; - delete iStorageHandler; + delete iMmcWatcher; iFs.Close(); } @@ -119,6 +118,15 @@ iStorageHandler->SynchronizeL(); } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCaWidgetScannerPlugin::HandleInstallNotifyL() + { + SynchronizeL(); + } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -353,12 +353,11 @@ { TBool massStorageNotInUse( ETrue ); TInt drive; - if( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ) == - KErrNone ) + if( DriveInfo::GetDefaultDrive( + DriveInfo::EDefaultMassStorage, drive ) == KErrNone ) { - TUint status; - if( DriveInfo::GetDriveStatus( iFs, drive, status ) == KErrNone && - ( status & DriveInfo::EDriveInUse ) ) + TVolumeInfo volumeInfo; + if( iFs.Volume( volumeInfo, drive ) == KErrNotReady ) { massStorageNotInUse = EFalse; } diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/castorage/conf/CI_castoragedb.confml --- a/contentstorage/castorage/conf/CI_castoragedb.confml Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/castorage/conf/CI_castoragedb.confml Mon Oct 04 00:38:31 2010 +0300 @@ -58,7 +58,7 @@ Application item for Operator collection. - + + lambda a: int((int(a,16)+2147483648)%4294967296-2147483648) diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/castorage/conf/castoragedb_templates/castoragedb_variant.sql --- a/contentstorage/castorage/conf/castoragedb_templates/castoragedb_variant.sql Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/castorage/conf/castoragedb_templates/castoragedb_variant.sql Mon Oct 04 00:38:31 2010 +0300 @@ -12,7 +12,10 @@ {%- set Icon = c ~ Icon %} {%- endif %} {%- if loop.last -%} - {{ "z:\\private\\20022F35\\customsvg\\" ~ Icon }} + {%- if Icon == "dummy" %} + {% else -%} + {{ "z:\\private\\20022F35\\customsvg\\" ~ Icon }} + {%- endif -%} {%- endif %} {%- endfor %} {%- endmacro %} @@ -24,7 +27,7 @@ {%- set URL = feat_tree.CaStorageDbSetting[URLs].URL._value[i] or '' -%} {%- set URLIcon = feat_tree.CaStorageDbSetting[URLs].URLIcon.localPath._value[i] or '' -%} {%- set IconSkinId = feat_tree.CaStorageDbSetting[URLs].IconSkinId._value[i] or '' -%} - {%- if IconSkinId == "" and URLIcon != "" and URLIcon != "dummy" -%} + {%- if URLIcon != "" -%} {%- set URLIcon = stripPath(URLIcon) -%} {%- endif %} INSERT INTO URL ( URL_TITLE, URL_SHORT_TITLE, URL_DEST, ICON_FILENAME, ICON_SKIN_ID ) @@ -46,9 +49,18 @@ {%- endif %} {%- set IconFileName = feat_tree.CaStorageDbSetting[Collections].Icon.localPath._value[col] or '' -%} {%- set IconSkinId = feat_tree.CaStorageDbSetting[Collections].IconSkinId._value[col] or '' -%} - {%- if IconSkinId == "" and IconFileName != "" and IconFileName != "dummy" -%} + {%- if IconFileName != "" -%} {%- set IconFileName = stripPath(IconFileName) -%} {%- endif %} + {%- if ShortName == "" -%} + {%- set ShortName = Name -%} + {%- endif %} + {%- if TitleName == "" -%} + {%- set TitleName = Name -%} + {%- endif %} + {%- if GroupName == "" -%} + {%- set GroupName = Name -%} + {%- endif %} INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS, COL_TITLE_NAME {% if LocalizeNames -%}, TRANSLATION_FILE{%- endif %}, COL_SHORT_NAME, ICON_FILENAME, ICON_SKIN_ID) VALUES ( '{{Name}}', '{{GroupName}}', {% if Locked -%} 0 {% else %} 4 {%- endif %}, "{{TitleName}}"{% if LocalizeNames -%}, "{{TranslationFile}}"{%- endif %}, "{{ShortName}}", "{{IconFileName}}", "{{IconSkinId}}"); {% endfor %} @@ -70,7 +82,7 @@ {%- endif %} {% if Type == "1" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) - VALUES ("application", '', {{Application}}, '{{Collection}}' );{%- endif %} + VALUES ("application", '', {{Application|hex2dec}}, '{{Collection}}' );{%- endif %} {% if Type == "2" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, URI, COLLECTION_NAME ) VALUES ("widget", '{{HomescreenWidget}}', "{{HomescreenWidget}}", '{{Collection}}' ); {%- endif %} diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/castorage/data/castorage.db Binary file contentstorage/castorage/data/castorage.db has changed diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/castorage/data/castoragedb_create.sql --- a/contentstorage/castorage/data/castoragedb_create.sql Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/castorage/data/castoragedb_create.sql Mon Oct 04 00:38:31 2010 +0300 @@ -179,6 +179,10 @@ VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME) , (SELECT ENTRY_ID FROM CA_ENTRY WHERE (EN_TEXT = new.ITEM_NAME AND EN_TYPE_NAME = new.ITEM_TYPE )), (SELECT IFNULL(MAX(GE_POSITION)+1, 1) FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME)) ); + -- UPDATE FLAGS IN A COLLECTION TO WHICH THE URL IS INSERTED + UPDATE CA_ENTRY + SET EN_FLAGS=EN_FLAGS|8 + WHERE EN_TEXT=new.COLLECTION_NAME; END; diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/castorage/inc/casqlcommands.h --- a/contentstorage/castorage/inc/casqlcommands.h Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/castorage/inc/casqlcommands.h Mon Oct 04 00:38:31 2010 +0300 @@ -196,7 +196,7 @@ _LIT( KSQLGetListByLaunchDataPart3,") ON ENTRY_ID = LA_ENTRY_ID \ ORDER BY USAGE_DATA"); -_LIT( KSQLGetParentIds,"SELECT GE_GROUP_ID FROM CA_GROUP_ENTRY \ +_LIT( KSQLGetParentIds,"SELECT DISTINCT GE_GROUP_ID FROM CA_GROUP_ENTRY \ WHERE GE_ENTRY_ID IN ( %S )" ); _LIT( KSQLNotINIds," AND GE_GROUP_ID NOT IN( %S )" ); diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/castorage/src/casqlquery.cpp --- a/contentstorage/castorage/src/casqlquery.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/castorage/src/casqlquery.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -314,8 +314,15 @@ void CCaSqlQuery::BindTextL( TInt aParameterIndex, const TDesC& aParameterValue ) { - User::LeaveIfError( iStatement.BindText( aParameterIndex, - aParameterValue ) ); + if( aParameterValue.Length() ) + { + User::LeaveIfError( iStatement.BindText( aParameterIndex, + aParameterValue ) ); + } + else + { + User::LeaveIfError( iStatement.BindNull( aParameterIndex) ); + } } // --------------------------------------------------------------------------- diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/cautils/cautils.pro --- a/contentstorage/cautils/cautils.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/cautils/cautils.pro Mon Oct 04 00:38:31 2010 +0300 @@ -14,6 +14,8 @@ # Description: # +CONFIG += hb + TEMPLATE = lib symbian:{ defFilePath = ./.. @@ -32,7 +34,8 @@ LIBS += -leuser \ -lbafl \ - -lestor + -lestor \ + -lefsrv CONFIG -= stl include(cautils.pri) diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/cautils/inc/cautils.h --- a/contentstorage/cautils/inc/cautils.h Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/cautils/inc/cautils.h Mon Oct 04 00:38:31 2010 +0300 @@ -34,6 +34,11 @@ * @return error code */ IMPORT_C static TInt GetTUint( const TDesC& aStr, TUint& aInt ); + + /** + * Gets TUint from a aStr - HEX or Decimal + */ + IMPORT_C static void InitTextResolverSymbianL( const TDesC& aFilename ); /** * Template method for marshaling data. diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/cautils/src/cautils.cpp --- a/contentstorage/cautils/src/cautils.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/cautils/src/cautils.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -15,7 +15,12 @@ * */ +#include +#include + #include "cautils.h" +#include "cadef.h" + _LIT(KHexPrefix, "0x"); // --------------------------------------------------------- @@ -37,3 +42,46 @@ return TLex( string ).Val( aInt, radix ); } +// --------------------------------------------------------- +// MenuUtils::InitTextResolverSymbian +// --------------------------------------------------------- +// +EXPORT_C void MenuUtils::InitTextResolverSymbianL( const TDesC& aFilename ) + { + if( !HbTextResolverSymbian::Init( aFilename, KLocalizationFilepathC ) ) + { + if( !HbTextResolverSymbian::Init( aFilename, KLocalizationFilepathZ ) ) + { + // this should not be called too often + TChar currentDriveLetter; + TDriveList driveList; + RFs fs; + CleanupClosePushL( fs ); + User::LeaveIfError( fs.Connect() ); + User::LeaveIfError( fs.DriveList( driveList ) ); + + RBuf path; + CleanupClosePushL( path ); + path.CreateL( KLocalizationFilepath().Length() + 1 ); + + for( TInt driveNr=EDriveY; driveNr >= EDriveA; driveNr-- ) + { + if( driveList[driveNr] ) + { + User::LeaveIfError( fs.DriveToChar( driveNr, + currentDriveLetter ) ); + path.Append( currentDriveLetter ); + path.Append( KLocalizationFilepath ); + if( HbTextResolverSymbian::Init( aFilename, path ) ) + { + break; + } + } + path.Zero(); + } + CleanupStack::PopAndDestroy( &path ); + CleanupStack::PopAndDestroy( &fs ); + } + } + } + diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/eabi/casathandleru.def --- a/contentstorage/eabi/casathandleru.def Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -EXPORTS - _ZN13CCaSatHandler15CheckVisibilityEv @ 1 NONAME - _ZN13CCaSatHandler4NewLEv @ 2 NONAME - _ZN13CCaSatHandler7GetNameER6TDes16 @ 3 NONAME - _ZN13CCaSatHandler9LoadIconLEv @ 4 NONAME - diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/eabi/cautilsu.def --- a/contentstorage/eabi/cautilsu.def Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/eabi/cautilsu.def Mon Oct 04 00:38:31 2010 +0300 @@ -57,48 +57,49 @@ _ZN23CCaInnerIconDescription4NewLEv @ 56 NONAME _ZN23CCaInnerIconDescription5NewLCEv @ 57 NONAME _ZN23CCaInnerIconDescription5SetIdEi @ 58 NONAME - _ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 59 NONAME - _ZNK11RCaIdsArray12ExternalizeLER12RWriteStream @ 60 NONAME - _ZNK11RCaIdsArray13MarshalDataLCEv @ 61 NONAME - _ZNK13CCaInnerEntry11isLocalizedENS_14TLocalizedTypeE @ 62 NONAME - _ZNK13CCaInnerEntry12ExternalizeLER12RWriteStream @ 63 NONAME - _ZNK13CCaInnerEntry13GetAttributesEv @ 64 NONAME - _ZNK13CCaInnerEntry14GetDescriptionEv @ 65 NONAME - _ZNK13CCaInnerEntry16GetEntryTypeNameEv @ 66 NONAME - _ZNK13CCaInnerEntry4IconEv @ 67 NONAME - _ZNK13CCaInnerEntry5GetIdEv @ 68 NONAME - _ZNK13CCaInnerEntry6GetUidEv @ 69 NONAME - _ZNK13CCaInnerEntry7GetRoleEv @ 70 NONAME - _ZNK13CCaInnerEntry7GetTextEv @ 71 NONAME - _ZNK13CCaInnerEntry8GetFlagsEv @ 72 NONAME - _ZNK13CCaInnerEntry9GetIconIdEv @ 73 NONAME - _ZNK13CCaInnerQuery10GetChildIdEv @ 74 NONAME - _ZNK13CCaInnerQuery10GetFlagsOnEv @ 75 NONAME - _ZNK13CCaInnerQuery11GetFlagsOffEv @ 76 NONAME - _ZNK13CCaInnerQuery11GetParentIdEv @ 77 NONAME - _ZNK13CCaInnerQuery12ExternalizeLER12RWriteStream @ 78 NONAME - _ZNK13CCaInnerQuery13GetAttributesEv @ 79 NONAME - _ZNK13CCaInnerQuery17GetEntryTypeNamesEv @ 80 NONAME - _ZNK13CCaInnerQuery6GetIdsEv @ 81 NONAME - _ZNK13CCaInnerQuery6GetUidEv @ 82 NONAME - _ZNK13CCaInnerQuery7GetRoleEv @ 83 NONAME - _ZNK13CCaInnerQuery7GetSortEv @ 84 NONAME - _ZNK13CCaInnerQuery8GetCountEv @ 85 NONAME - _ZNK15RCaEntriesArray12ExternalizeLER12RWriteStream @ 86 NONAME - _ZNK17RCaEntryAttrArray4FindERK7TDesC16R6TDes16 @ 87 NONAME - _ZNK17RCaEntryAttrArray4FindERK7TDesC16R7TPtrC16 @ 88 NONAME - _ZNK17RCaEntryAttrArray5ExistERK7TDesC16 @ 89 NONAME - _ZNK20CCaLocalizationEntry11GetStringIdEv @ 90 NONAME - _ZNK20CCaLocalizationEntry12GetTableNameEv @ 91 NONAME - _ZNK20CCaLocalizationEntry13GetQmFilenameEv @ 92 NONAME - _ZNK20CCaLocalizationEntry16GetAttributeNameEv @ 93 NONAME - _ZNK20CCaLocalizationEntry18GetLocalizedStringEv @ 94 NONAME - _ZNK20CCaLocalizationEntry8GetRowIdEv @ 95 NONAME - _ZNK20CCaLocalizationEntry9GetTextIdEv @ 96 NONAME - _ZNK22CCaInnerNotifierFilter11GetParentIdEv @ 97 NONAME - _ZNK22CCaInnerNotifierFilter12ExternalizeLER12RWriteStream @ 98 NONAME - _ZNK22CCaInnerNotifierFilter12GetEntryRoleEv @ 99 NONAME - _ZNK22CCaInnerNotifierFilter12GetTypeNamesEv @ 100 NONAME - _ZNK22CCaInnerNotifierFilter15GetNotifierTypeEv @ 101 NONAME - _ZNK22CCaInnerNotifierFilter6GetIdsEv @ 102 NONAME + _ZN9MenuUtils24InitTextResolverSymbianLERK7TDesC16 @ 59 NONAME + _ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 60 NONAME + _ZNK11RCaIdsArray12ExternalizeLER12RWriteStream @ 61 NONAME + _ZNK11RCaIdsArray13MarshalDataLCEv @ 62 NONAME + _ZNK13CCaInnerEntry11isLocalizedENS_14TLocalizedTypeE @ 63 NONAME + _ZNK13CCaInnerEntry12ExternalizeLER12RWriteStream @ 64 NONAME + _ZNK13CCaInnerEntry13GetAttributesEv @ 65 NONAME + _ZNK13CCaInnerEntry14GetDescriptionEv @ 66 NONAME + _ZNK13CCaInnerEntry16GetEntryTypeNameEv @ 67 NONAME + _ZNK13CCaInnerEntry4IconEv @ 68 NONAME + _ZNK13CCaInnerEntry5GetIdEv @ 69 NONAME + _ZNK13CCaInnerEntry6GetUidEv @ 70 NONAME + _ZNK13CCaInnerEntry7GetRoleEv @ 71 NONAME + _ZNK13CCaInnerEntry7GetTextEv @ 72 NONAME + _ZNK13CCaInnerEntry8GetFlagsEv @ 73 NONAME + _ZNK13CCaInnerEntry9GetIconIdEv @ 74 NONAME + _ZNK13CCaInnerQuery10GetChildIdEv @ 75 NONAME + _ZNK13CCaInnerQuery10GetFlagsOnEv @ 76 NONAME + _ZNK13CCaInnerQuery11GetFlagsOffEv @ 77 NONAME + _ZNK13CCaInnerQuery11GetParentIdEv @ 78 NONAME + _ZNK13CCaInnerQuery12ExternalizeLER12RWriteStream @ 79 NONAME + _ZNK13CCaInnerQuery13GetAttributesEv @ 80 NONAME + _ZNK13CCaInnerQuery17GetEntryTypeNamesEv @ 81 NONAME + _ZNK13CCaInnerQuery6GetIdsEv @ 82 NONAME + _ZNK13CCaInnerQuery6GetUidEv @ 83 NONAME + _ZNK13CCaInnerQuery7GetRoleEv @ 84 NONAME + _ZNK13CCaInnerQuery7GetSortEv @ 85 NONAME + _ZNK13CCaInnerQuery8GetCountEv @ 86 NONAME + _ZNK15RCaEntriesArray12ExternalizeLER12RWriteStream @ 87 NONAME + _ZNK17RCaEntryAttrArray4FindERK7TDesC16R6TDes16 @ 88 NONAME + _ZNK17RCaEntryAttrArray4FindERK7TDesC16R7TPtrC16 @ 89 NONAME + _ZNK17RCaEntryAttrArray5ExistERK7TDesC16 @ 90 NONAME + _ZNK20CCaLocalizationEntry11GetStringIdEv @ 91 NONAME + _ZNK20CCaLocalizationEntry12GetTableNameEv @ 92 NONAME + _ZNK20CCaLocalizationEntry13GetQmFilenameEv @ 93 NONAME + _ZNK20CCaLocalizationEntry16GetAttributeNameEv @ 94 NONAME + _ZNK20CCaLocalizationEntry18GetLocalizedStringEv @ 95 NONAME + _ZNK20CCaLocalizationEntry8GetRowIdEv @ 96 NONAME + _ZNK20CCaLocalizationEntry9GetTextIdEv @ 97 NONAME + _ZNK22CCaInnerNotifierFilter11GetParentIdEv @ 98 NONAME + _ZNK22CCaInnerNotifierFilter12ExternalizeLER12RWriteStream @ 99 NONAME + _ZNK22CCaInnerNotifierFilter12GetEntryRoleEv @ 100 NONAME + _ZNK22CCaInnerNotifierFilter12GetTypeNamesEv @ 101 NONAME + _ZNK22CCaInnerNotifierFilter15GetNotifierTypeEv @ 102 NONAME + _ZNK22CCaInnerNotifierFilter6GetIdsEv @ 103 NONAME diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/extinc/casathandler.h --- a/contentstorage/extinc/casathandler.h Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* - * 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". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: The API supports attributes not present in MCS from SAT Api - * - */ - -#ifndef __CASATHANDLER_H__ -#define __CASATHANDLER_H__ - -#include - -#include -#include -#ifdef SIM_ATK_SERVICE_API_V1 -#include // MCL -#else -#include // 5.0 -#endif - -/** - * SAT Handler. - * @lib mcssathandler.lib - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CCaSatHandler ): public CBase - { -public: - /** - * Two-phased constructor. Leaves on failure. - * @return The constructed object. - */ - IMPORT_C static CCaSatHandler* NewL(); - - /** - * Destructor. - * @since S60 v5.0 - * @capability None. - * @throws None. - * @panic None. - */ - virtual ~CCaSatHandler(); - - IMPORT_C CAknIcon* LoadIconL(); - - IMPORT_C TInt GetName( TDes& aName ); - - IMPORT_C static TBool CheckVisibility(); - -private: - - /** - * Constructor. - */ - CCaSatHandler(); - - /** - * 2nd phase constructor. - */ - void ConstructL(); - - /** - * Gets best icon from aIconEF. - */ - CFbsBitmap* GetBitmapL( const RIconEf& aIconEF ); - -private: - // data - - RSatSession iSatSession; - -#ifdef SIM_ATK_SERVICE_API_V1 - RSatService iSatIcon; -#else - RSatIcon iSatIcon; -#endif - }; - -#endif // __CASATHANDLER_H__ diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/extsrc/casathandler.cpp --- a/contentstorage/extsrc/casathandler.cpp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -/* - * 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". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Used for receive SIM Application name, icon or visibility information. - * - */ - -// INCLUDE FILES - -#include -#include - -#include "ca2internalCRkeys.h" -#include "casathandler.h" - - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CCaSatHandler::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CCaSatHandler* CCaSatHandler::NewL() - { - CCaSatHandler* self = new ( ELeave ) CCaSatHandler(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -CCaSatHandler::~CCaSatHandler() - { - iSatIcon.Close(); - iSatSession.Close(); - } - -// ----------------------------------------------------------------------------- -// LoadIconL -// ----------------------------------------------------------------------------- -EXPORT_C CAknIcon* CCaSatHandler::LoadIconL() - { - TInt iconId( KErrNone ); - User::LeaveIfError( RProperty::Get( KCRUidCa, KCaSatUIIconId, iconId ) ); - CAknIcon* icon = CAknIcon::NewL(); - CleanupStack::PushL( icon ); - if( iconId != KErrNone ) - { - RIconEf iIconEf; - iSatIcon.GetIconInfoL( TUint8( iconId ), iIconEf ); - CleanupClosePushL( iIconEf ); - CFbsBitmap* bitmap = GetBitmapL( iIconEf ); - if( bitmap ) - { - CFbsBitmap* mask( new (ELeave) CFbsBitmap ); - CleanupStack::PushL( mask ); - - icon->SetBitmap( bitmap ); - // create and set mask - User::LeaveIfError( mask->Create( bitmap->SizeInPixels(), - EGray256 ) ); - - CFbsBitmapDevice* maskDevice = CFbsBitmapDevice::NewL( mask ); - CleanupStack::PushL( maskDevice ); - CFbsBitGc* maskGc; - User::LeaveIfError( maskDevice->CreateContext( maskGc ) ); - CleanupStack::PushL( maskGc ); - maskGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); - maskGc->SetDrawMode( CGraphicsContext::EDrawModePEN ); - maskGc->SetBrushColor( KRgbBlack ); - maskGc->Clear(); - maskGc->SetBrushColor( KRgbWhite ); - maskGc->DrawRect( TRect( TPoint(), bitmap->SizeInPixels() ) ); - icon->SetMask( mask ); - - CleanupStack::PopAndDestroy( maskGc ); - CleanupStack::PopAndDestroy( maskDevice ); - CleanupStack::Pop( mask ); - } - CleanupStack::PopAndDestroy( &iIconEf ); // iIconEf - CleanupStack::Pop( icon ); - } - else - { - CleanupStack::PopAndDestroy( icon ); - icon = NULL; - } - return icon; - } - -// --------------------------------------------------------------------------- -// CCaSatHandler::GetName -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CCaSatHandler::GetName( TDes& aName ) - { - return RProperty::Get( KCRUidCa, KCaSatUIName, aName ); - } - -// --------------------------------------------------------------------------- -// CCaSatHandler::GetVisibility -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CCaSatHandler::CheckVisibility() - { - TInt visibility( KErrNone ); - TInt err = RProperty::Get( KCRUidCa, KCaShowSatUI, visibility ); - if( err == KErrNone && visibility ) - return ETrue; - else - return EFalse; - } - -// ----------------------------------------------------------------------------- -// CCaSatHandler::CMcsSatHandler -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCaSatHandler::CCaSatHandler() - { - } - -// ----------------------------------------------------------------------------- -// CCaSatHandler::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CCaSatHandler::ConstructL() - { - iSatSession.ConnectL(); - iSatIcon.OpenL( iSatSession ); - } - -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT (Icon can be created only from SIM) -// --------------------------------------------------------------------------- -// CCaSatHandler::GetVisibility -// --------------------------------------------------------------------------- -// -CFbsBitmap* CCaSatHandler::GetBitmapL( const RIconEf& aIconEF ) - { - TInt selectedIconIndex( KErrNotFound ); - TSize selectedIconSize( 0, 0 ); - CFbsBitmap* bitmap( NULL ); - for( TInt i = 0; i < aIconEF.Count(); ++i ) - { - if( ( aIconEF[i].IconSize().iHeight * aIconEF[i].IconSize().iWidth ) - >= ( selectedIconSize.iHeight * selectedIconSize.iWidth ) ) - if( bitmap ) - { - delete bitmap; - bitmap = NULL; - } - // test and select index of iIcon which is not too big - TRAPD( bitmapErr, bitmap = iSatIcon.GetIconL( aIconEF[ i ] ) ); - if( !bitmapErr && bitmap ) //!iBitmap if iIcon is too big - { - selectedIconSize = aIconEF[i].IconSize(); - selectedIconIndex = i; - } - else if( bitmapErr ) - { - User::Leave( bitmapErr ); - } - } - if( selectedIconIndex != KErrNotFound ) - { - if( bitmap ) - { - delete bitmap; - bitmap = NULL; - } - TRAPD( bitmapErr, bitmap = - iSatIcon.GetIconL( aIconEF[ selectedIconIndex ] ) ); - User::LeaveIfError( bitmapErr ); - return bitmap; - } - else - { - return NULL; - } - } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT - -// End of File diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/group/camenu.mmp --- a/contentstorage/group/camenu.mmp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/group/camenu.mmp Mon Oct 04 00:38:31 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: 19.1.11 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: 19.1.12 % << Don't touch! Updated by Synergy at check-out. * */ @@ -34,7 +34,6 @@ SOURCE casrv.cpp SOURCE casrvmmchistory.cpp SOURCE cainstallnotifier.cpp -SOURCE cainstallstrategy.cpp SOURCE cammcwatcher.cpp SOURCE casrvengutils.cpp SOURCE casrvnotifier.cpp @@ -66,6 +65,7 @@ LIBRARY casrvmanager.lib LIBRARY scrclient.lib +LIBRARY sifnotification.lib // HB LIBRARIES SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/group/casathandler.mmp --- a/contentstorage/group/casathandler.mmp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// To get the MW_LAYER_SYSTEMINCLUDE-definition -#include - -TARGET casathandler.dll -TARGETTYPE dll -UID 0x1000008D 0x2001CB7B -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../extsrc -SOURCE casathandler.cpp - -USERINCLUDE ../extinc -USERINCLUDE ../inc - - -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY aknicon.lib -LIBRARY SatClient.lib -LIBRARY fbscli.lib -LIBRARY bitgdi.lib - - diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/group/group.pro --- a/contentstorage/group/group.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/group/group.pro Mon Oct 04 00:38:31 2010 +0300 @@ -30,8 +30,7 @@ "$${LITERAL_HASH}endif" \ "../data/backup_registration.xml z:/private/20022F90/backup_registration.xml" -BLD_INF_RULES.prj_mmpfiles += "casathandler.mmp" \ - "../castorage/group/castorage.mmp" \ +BLD_INF_RULES.prj_mmpfiles += "../castorage/group/castorage.mmp" \ "../casatinterface/group/MenuInterface.mmp" \ "../casrv/casrvmgr/group/casrvmanager.mmp" \ "camenu.mmp" \ @@ -45,7 +44,6 @@ BLD_INF_RULES.prj_mmpfiles += \ # "$${LITERAL_HASH}include \"../castorage/internal/tsrc/castoragetester/group/bld.inf\" " \ # disabled, needs CONTENT_ARSENAL_STORAGE_UT flag # "$${LITERAL_HASH}include \"../internal/MT_casrv/group/bld.inf\" " \ # disabled, needs CONTENT_ARSENAL_STORAGE_UT flag - "$${LITERAL_HASH}include \"../internal/MT_sathandler/group/bld.inf\" " \ "$${LITERAL_HASH}include \"../internal/MT_handler/group/bld.inf\" " \ # "$${LITERAL_HASH}include \"../casrv/caappscanner/internal/MT_cappscanner/group/bld.inf\" " \ # disabled, needs CONTENT_ARSENAL_STORAGE_UT flag "$${LITERAL_HASH}include \"../casrv/casatmonitor/internal/MT_satmonitor/group/bld.inf\" " \ diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/inc/cadef.h --- a/contentstorage/inc/cadef.h Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/inc/cadef.h Mon Oct 04 00:38:31 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: Definition of different constants - * Version : %version: 10.1.27 % << Don't touch! Updated by Synergy at check-out. + * Version : %version: 10.1.28 % << Don't touch! Updated by Synergy at check-out. * */ @@ -76,7 +76,6 @@ _LIT( KCaTypePackage, "package" ); _LIT( KCaAttrView, "view" ); ///< View. _LIT( KCaAttrUrl, "url" ); -_LIT( KCaAttrWindowGroupId, "window_group_id" ); _LIT( KCaTypeCollectionDownload, "collection::downloaded" ); _LIT( KCaPackageUid,"packageuid"); _LIT( KCaAttrInstallationTime, "installationTime"); @@ -171,7 +170,6 @@ _LIT8( KCaCmdOpen, "open" ); ///< Open item. _LIT8( KCaCmdRemove, "remove" ); ///< Remove item. -_LIT8( KCaCmdClose, "close" ); ///< Close item. //Properties in database diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/srvinc/cainstallnotifier.h --- a/contentstorage/srvinc/cainstallnotifier.h Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/srvinc/cainstallnotifier.h Mon Oct 04 00:38:31 2010 +0300 @@ -18,12 +18,8 @@ #ifndef CAINSTALLNOTIFIER_H #define CAINSTALLNOTIFIER_H -#include #include -#include -#include "castorage_global.h" - -class CNotifierStrategy; +#include /** * Interface for updating after installer events. @@ -39,7 +35,7 @@ * Pure virtual method. * @param aEvent event type. */ - virtual void HandleInstallNotifyL(TInt aEvent) = 0; + virtual void HandleInstallNotifyL() = 0; }; /** @@ -47,7 +43,8 @@ * * @since S60 v5.0 */ -NONSHARABLE_CLASS( CCaInstallNotifier ) : public CActive +NONSHARABLE_CLASS( CCaInstallNotifier ) : public CBase, + public Usif::MSifOperationsHandler { public: @@ -59,8 +56,7 @@ { ENoNotification, ///< No notification. ESisInstallNotification, ///< System installation notification. - EJavaInstallNotification, ///< Java instalation and uninstallation notification. - EUsifUninstallNotification, ///< Usif's uninstalation notification. + EAllTypesNotification, ///< System installation notification. }; /** @@ -69,7 +65,39 @@ * @param aNotificationType Notification type. */ IMPORT_C static CCaInstallNotifier* NewL( MCaInstallListener& aListener, - TNotificationType aNotificationType ); + TNotificationType aNotificationType = EAllTypesNotification ); + + /** + * Called when a new operation is started. The client should use the S + * ubscribeL() method (@see CSifOperationsNotifier) to register for progress + * and end notification for this operation. This function should return + * quickly as this is run as part of an active object request completion + * handler. + + * @param aKey The Start End key of the operation. + * @param aStartData Start operation related information. + */ + void StartOperationHandler( + TUint aKey, const Usif::CSifOperationStartData& aStartData); + + /** + * Called when an operation completes. + * This function should return quickly as this is run as part of an active + * object request completion handler. + + * @param aEndData End operation related information. + */ + void EndOperationHandler(const Usif::CSifOperationEndData& aEndData); + + /** + * Called whenever a progress update is available. + * This function should return quickly as this is run as part of an active + * object request completion handler. + + * @param aProgressData Progress operation related information. + */ + void ProgressOperationHandler( + const Usif::CSifOperationProgressData& aProgressData); /** * Destructor. @@ -90,39 +118,23 @@ */ void ConstructL( TNotificationType aNotificationType ); - /** - * From CActive. - */ - void DoCancel(); - - /** - * From CActive. - */ - void RunL(); - - /** - * From CActive. - */ - TInt RunError( TInt aError ); - private: /** - * RProperty. - * Own. - */ - RProperty iProperty; - - /** * Interface for notifying changes in folder. * Not Own. */ MCaInstallListener& iListener; - /* - * Notification strategy. + /** + * USIF notifier + * Own. */ - CNotifierStrategy* iNotifierStrategy; + Usif::CSifOperationsNotifier* iNotifier; + + TUint iKey; + + TNotificationType iNotificationType; }; diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/srvinc/cainstallstrategy.h --- a/contentstorage/srvinc/cainstallstrategy.h Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* - * 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". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: ?Description - * - */ - -#ifndef CAINSTALLSTRATEGY_H -#define CAINSTALLSTRATEGY_H - -#include "cainstallnotifier.h" -#include -#include - -/** - * Strategy interface. - * - * @since S60 v5.0 - */ -class CNotifierStrategy: public CBase - { -public: - - /** - * Notifies listener with changes in property. - * @param aProperty to read values from. - * @param aListener listener to notify. - */ - virtual void NotifyListenerL( RProperty& aProperty, - MCaInstallListener& aListener ) = 0; - - }; - -/** - * CA Install strategy. - * - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CCaSwiInstallStrategy ): public CNotifierStrategy - { -public: - - /** - * Creates an instance of CCaInstallStrategy. - * @param aProperty property to handle. - */ - static CCaSwiInstallStrategy* NewL( RProperty& aProperty ); - - /** - * Notifies listener with changes in property. - * @param aProperty to read values from. - * @param aListener listener to notify. - */ - void NotifyListenerL( RProperty& aProperty, - MCaInstallListener& aListener ); - -private: - - /** - * Constructor. - * @param aProperty property to handle. - */ - CCaSwiInstallStrategy( RProperty& aProperty ); - - /** - * Symbian 2nd phase constructor. - */ - void ConstructL(); - - }; - -/** - * CA Java install strategy. - * - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CCaJavaInstallStrategy ): public CNotifierStrategy - { -public: - - /** - * Creates an instance of CCaInstallStrategy. - * @param aProperty property to handle. - */ - static CCaJavaInstallStrategy* NewL( RProperty& aProperty ); - - /** - * Notifies listener with changes in property. - * @param aProperty to read values from. - * @param aListener listener to notify. - */ - void NotifyListenerL( RProperty& aProperty, - MCaInstallListener& aListener ); - -private: - - /** - * Constructor. - * @param aProperty property to handle. - */ - CCaJavaInstallStrategy( RProperty& aProperty ); - - /** - * Symbian 2nd phase constructor. - */ - void ConstructL(); - - }; - -/** - * CA Unninstal with USIF strategy. - * - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CCaUsifUninstallStrategy ): public CNotifierStrategy - { -public: - - /** - * Creates an instance of CCaInstallStrategy. - * @param aProperty property to handle. - */ - static CCaUsifUninstallStrategy* NewL( RProperty& aProperty ); - - /** - * Notifies listener with changes in property. - * @param aProperty to read values from. - * @param aListener listener to notify. - */ - void NotifyListenerL( RProperty& aProperty, - MCaInstallListener& aListener ); - -private: - - /** - * Constructor. - * @param aProperty property to handle. - */ - CCaUsifUninstallStrategy( RProperty& aProperty ); - - /** - * Symbian 2nd phase constructor. - */ - void ConstructL(); - -private: - - /** - * Contains uninstallation status of application - * that was started to uninstall. - */ - TInt iUninstallStatus; - - }; - -#endif /* CAINSTALLSTRATEGY_H */ - -// End of File - diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/srvsrc/cainstallnotifier.cpp --- a/contentstorage/srvsrc/cainstallnotifier.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/srvsrc/cainstallnotifier.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -16,7 +16,9 @@ */ #include "cainstallnotifier.h" -#include "cainstallstrategy.h" +#include "cadef.h" + +using namespace Usif; EXPORT_C CCaInstallNotifier* CCaInstallNotifier::NewL( MCaInstallListener& aListener, TNotificationType aNotificationType ) @@ -30,53 +32,53 @@ CCaInstallNotifier::~CCaInstallNotifier() { - Cancel(); - iProperty.Close(); - delete iNotifierStrategy; + delete iNotifier; } CCaInstallNotifier::CCaInstallNotifier( MCaInstallListener& aListener ) : - CActive( EPriorityNormal ), iListener( aListener ) - { - CActiveScheduler::Add( this ); - SetActive(); - } + iListener( aListener ) +{ +} void CCaInstallNotifier::ConstructL( TNotificationType aNotificationType ) - { - switch( aNotificationType ) - { - case ESisInstallNotification: - iNotifierStrategy = CCaSwiInstallStrategy::NewL( iProperty ); - break; - case EUsifUninstallNotification: - iNotifierStrategy = CCaUsifUninstallStrategy::NewL( iProperty ); - break; - case EJavaInstallNotification: - iNotifierStrategy = CCaJavaInstallStrategy::NewL( iProperty ); - break; - default: - User::Leave( KErrNotSupported ); - break; - } - iProperty.Subscribe( iStatus ); - } +{ + iNotifier = CSifOperationsNotifier::NewL( *this ); + iNotificationType = aNotificationType; +} + +void CCaInstallNotifier::EndOperationHandler(const CSifOperationEndData& aEndData) +{ + TRAP_IGNORE + ( + if( aEndData.ErrorCode() == KErrNone ) + { + iListener.HandleInstallNotifyL(); + } + iNotifier->CancelSubscribeL( iKey ); + ) +} -void CCaInstallNotifier::DoCancel() - { - iProperty.Cancel(); - } +void CCaInstallNotifier::ProgressOperationHandler( + const CSifOperationProgressData& /*aProgressData*/) +{ +} -void CCaInstallNotifier::RunL() - { - SetActive(); - iProperty.Subscribe( iStatus ); - iNotifierStrategy->NotifyListenerL( iProperty, iListener ); - } - -TInt CCaInstallNotifier::RunError( TInt /*aError*/) - { - // No need to do anything - return KErrNone; - } - +void CCaInstallNotifier::StartOperationHandler( + TUint aKey, const CSifOperationStartData& aStartData) +{ + TRAP_IGNORE + ( + if( iNotificationType == EAllTypesNotification ) + { + iKey = aKey; + iNotifier->SubscribeL( aKey, ETrue ); + } + else if ( iNotificationType == ESisInstallNotification + && aStartData.SoftwareType().Compare( + KCaAttrAppTypeValueNative ) == KErrNone ) + { + iKey = aKey; + iNotifier->SubscribeL( aKey, ETrue ); + } + ) +} diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/srvsrc/cainstallstrategy.cpp --- a/contentstorage/srvsrc/cainstallstrategy.cpp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -/* - * 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". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: ?Description - * - */ -#include -#include -#include -#include - -#include "cainstallstrategy.h" - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CCaSwiInstallStrategy* CCaSwiInstallStrategy::NewL( RProperty& aProperty ) - { - CCaSwiInstallStrategy* self = new ( ELeave ) CCaSwiInstallStrategy( - aProperty ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaSwiInstallStrategy::NotifyListenerL( - RProperty& aProperty, MCaInstallListener& aListener ) - { - TInt appUid; - User::LeaveIfError( aProperty.Get( KUidSystemCategory, - KUidSwiLatestInstallation, appUid ) ); - if( appUid ) - { - aListener.HandleInstallNotifyL(appUid ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CCaSwiInstallStrategy::CCaSwiInstallStrategy( RProperty& aProperty ) - { - aProperty.Attach( KUidSystemCategory, KUidSwiLatestInstallation ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaSwiInstallStrategy::ConstructL() - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CCaJavaInstallStrategy* CCaJavaInstallStrategy::NewL( RProperty& aProperty ) - { - CCaJavaInstallStrategy* self = - new ( ELeave ) CCaJavaInstallStrategy( aProperty ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaJavaInstallStrategy::NotifyListenerL( - RProperty& aProperty, MCaInstallListener& aListener ) - { -//TODO: temporary sollution until new notification mechanism from usif in wk14 -// TInt state; -// User::LeaveIfError( aProperty.Get( KUidSystemCategory, -// KPSUidJavaLatestInstallationState, state ) ); -// if( ( ( state & ESASwisInstall ) || ( state & ESASwisUninstall ) ) -// && ( state & ESASwisStatusSuccess ) ) -// { - TInt appUid; - User::LeaveIfError( aProperty.Get( KUidSystemCategory, - KPSUidJavaLatestInstallation, appUid ) ); - aListener.HandleInstallNotifyL(appUid ); -// } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CCaJavaInstallStrategy::CCaJavaInstallStrategy( RProperty& aProperty ) - { - aProperty.Attach( KUidSystemCategory, KPSUidJavaLatestInstallationState ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaJavaInstallStrategy::ConstructL() - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CCaUsifUninstallStrategy* CCaUsifUninstallStrategy::NewL( - RProperty& aProperty ) - { - CCaUsifUninstallStrategy* self = - new ( ELeave ) CCaUsifUninstallStrategy( aProperty ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaUsifUninstallStrategy::NotifyListenerL( - RProperty& aProperty, MCaInstallListener& aListener ) - { - TInt status; - // TODO: Temporary solution for incorrect USIF notifications - User::LeaveIfError( aProperty.Get( KUidSystemCategory, - Swi::KUidSoftwareInstallKey, status ) ); - //if( status == ( Swi::ESwisStatusSuccess | Swi::ESwisUninstall ) ) - // notify subscribers on begenning and at the end of uninstallation - if( status == Swi::ESwisUninstall || iUninstallStatus == Swi::ESwisUninstall /*&& !status*/ ) - { - aListener.HandleInstallNotifyL( status ); - } - iUninstallStatus = status; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CCaUsifUninstallStrategy::CCaUsifUninstallStrategy( RProperty& aProperty ) - { - aProperty.Attach( KUidSystemCategory, Swi::KUidSoftwareInstallKey ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaUsifUninstallStrategy::ConstructL() - { - } - diff -r 0b3699f6c654 -r e36b2f4799c0 contentstorage/srvsrc/cammcwatcher.cpp --- a/contentstorage/srvsrc/cammcwatcher.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/contentstorage/srvsrc/cammcwatcher.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -21,10 +21,9 @@ // ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CCaWidgetMmcWatcher::NewL -// Second phase constructor -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // EXPORT_C CCaMmcWatcher* CCaMmcWatcher::NewL( RFs& aFs, MMmcWatcherCallback* aObserver ) @@ -34,10 +33,9 @@ return self; } -// --------------------------------------------------------- -// CCaWidgetMmcWatcher::NewLC -// Second phase constructor -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // EXPORT_C CCaMmcWatcher* CCaMmcWatcher::NewLC( RFs& aFs, MMmcWatcherCallback* aObserver ) @@ -49,20 +47,18 @@ return self; } -// --------------------------------------------------------- -// CCaWidgetMmcWatcher::~CCaWidgetMmcWatcher -// Destructor -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // CCaMmcWatcher::~CCaMmcWatcher() { Cancel(); } -// --------------------------------------------------------- -// CCaWidgetMmcWatcher::CCaWidgetMmcWatcher -// Default constructor -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // CCaMmcWatcher::CCaMmcWatcher( RFs& aFs, MMmcWatcherCallback* aObserver ) @@ -73,20 +69,18 @@ CActiveScheduler::Add(this); } -// --------------------------------------------------------- -// CCaWidgetMmcWatcher::ConstructL -// default Symbian OS constructor -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // void CCaMmcWatcher::ConstructL() { WaitForChangeL(); } -// --------------------------------------------------------- -// CCaWidgetMmcWatcher::WaitForChangeL -// Request notification for disk change -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // void CCaMmcWatcher::WaitForChangeL() { @@ -98,9 +92,9 @@ SetActive(); } -// --------------------------------------------------------- -// CCaWidgetMmcWatcher::DoCancel -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // void CCaMmcWatcher::DoCancel() { @@ -111,7 +105,7 @@ #pragma CTC SKIP #endif //COVERAGE_MEASUREMENT (error is ignored) // --------------------------------------------------------------------------- -// CCaWidgetMmcWatcher::RunError +// // --------------------------------------------------------------------------- // TInt CCaMmcWatcher::RunError( TInt /*aError*/ ) @@ -126,9 +120,9 @@ #ifdef COVERAGE_MEASUREMENT #pragma CTC SKIP #endif //COVERAGE_MEASUREMENT (memory card removal) -// --------------------------------------------------------- -// CCaWidgetMmcWatcher::RunL -// --------------------------------------------------------- +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- // void CCaMmcWatcher::RunL() { diff -r 0b3699f6c654 -r e36b2f4799c0 homescreensrv.pro --- a/homescreensrv.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/homescreensrv.pro Mon Oct 04 00:38:31 2010 +0300 @@ -20,7 +20,6 @@ hswidgetmodel \ contentstorage -symbian:SUBDIRS += utils symbian:SUBDIRS += activityfw symbian:SUBDIRS += taskswitcher symbian:SUBDIRS += hsappkeyhandler diff -r 0b3699f6c654 -r e36b2f4799c0 homescreensrv_plat/activity_framework_api/activity_framework_api.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/activity_framework_api/activity_framework_api.pro Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,24 @@ +# +# 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: +# + +TEMPLATE = subdirs +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + +include(activity_framework_api.pri) + +for(filename,PLATFORM_HEADERS){ + BLD_INF_RULES.prj_exports *= "../$$filename MW_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))" + } diff -r 0b3699f6c654 -r e36b2f4799c0 homescreensrv_plat/activity_framework_api/afstorageglobals.h --- a/homescreensrv_plat/activity_framework_api/afstorageglobals.h Fri Sep 17 08:32:18 2010 +0300 +++ b/homescreensrv_plat/activity_framework_api/afstorageglobals.h Mon Oct 04 00:38:31 2010 +0300 @@ -29,5 +29,6 @@ const char ActivityScreenshotKeyword [] = "screenshot"; const char ActivityDataKeyword [] = ":ActivityData"; const char ActivityApplicationName[] = ":ApplicationName"; +const char ActivityTimestamp[] = ":ActivityTimestamp"; #endif //AFSTORAGEGLOBALS_H diff -r 0b3699f6c654 -r e36b2f4799c0 homescreensrv_plat/contentstorage_api/caitemmodel.h --- a/homescreensrv_plat/contentstorage_api/caitemmodel.h Fri Sep 17 08:32:18 2010 +0300 +++ b/homescreensrv_plat/contentstorage_api/caitemmodel.h Mon Oct 04 00:38:31 2010 +0300 @@ -48,6 +48,7 @@ TypeRole, FlagsRole, TextRole,//contains title represented as QString, + DescriptionRole, // contains item description FullTextRole, //'title description' convinient for operations such as search UninstalRole, //contains progress status as decimal number in QString CollectionTitleRole //contains title represented as QString, diff -r 0b3699f6c654 -r e36b2f4799c0 homescreensrv_plat/contentstorage_api/camenuiconutility.h --- a/homescreensrv_plat/contentstorage_api/camenuiconutility.h Fri Sep 17 08:32:18 2010 +0300 +++ b/homescreensrv_plat/contentstorage_api/camenuiconutility.h Mon Oct 04 00:38:31 2010 +0300 @@ -32,6 +32,11 @@ static HbIcon getEntryIcon(const CaEntry& entry, const QSizeF &size = QSizeF(50,80)); + + + + + }; #endif // __CAMENUICONUTILITY_H__ diff -r 0b3699f6c654 -r e36b2f4799c0 homescreensrv_plat/contentstorage_api/contentstorage_api.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/contentstorage_api/contentstorage_api.pro Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,24 @@ +# +# 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: +# + +TEMPLATE = subdirs +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + +include(contentstorage_api.pri) + +for(filename,PLATFORM_HEADERS){ + BLD_INF_RULES.prj_exports *= "../$$filename MW_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))" + } diff -r 0b3699f6c654 -r e36b2f4799c0 homescreensrv_plat/homescreen_information_api/homescreen_information_api.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/homescreen_information_api/homescreen_information_api.pro Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,32 @@ +# +# 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: +# + +TEMPLATE = subdirs +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + + +PLATFORM_HEADERS += \ + inc/homescreendomainpskeys.h +symbian { + #qcrml export + BLD_INF_RULES.prj_exports += \ + "inc/homescreeninformation.qcrml c:/resource/qt/crml/homescreeninformation.qcrml " +} + + +for(filename,PLATFORM_HEADERS){ + BLD_INF_RULES.prj_exports *= "$$filename MW_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))" + } diff -r 0b3699f6c654 -r e36b2f4799c0 homescreensrv_plat/hswidgetmodel_api/hswidgetmodel_api.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hswidgetmodel_api/hswidgetmodel_api.pro Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,24 @@ +# +# 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: +# + +TEMPLATE = subdirs +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + +include(hswidgetmodel_api.pri) + +for(filename,PLATFORM_HEADERS){ + BLD_INF_RULES.prj_exports *= "../$$filename MW_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))" + } diff -r 0b3699f6c654 -r e36b2f4799c0 homescreensrv_plat/menu_sat_interface_api/menu_sat_interface_api.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/menu_sat_interface_api.pro Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,24 @@ +# +# 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: +# + +TEMPLATE = subdirs +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + +include(menu_sat_interface_api.pri) + +for(filename,PLATFORM_HEADERS){ + BLD_INF_RULES.prj_exports *= "../$$filename MW_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))" + } diff -r 0b3699f6c654 -r e36b2f4799c0 homescreensrv_plat/taskswitcher_api/taskswitcher_api.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/taskswitcher_api/taskswitcher_api.pro Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,24 @@ +# +# 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: +# + +TEMPLATE = subdirs +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + +include(taskswitcher_api.pri) + +for(filename,PLATFORM_HEADERS){ + BLD_INF_RULES.prj_exports *= "../$$filename MW_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))" + } diff -r 0b3699f6c654 -r e36b2f4799c0 package_definition.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_definition.xml Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 0b3699f6c654 -r e36b2f4799c0 package_map.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_map.xml Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,1 @@ + diff -r 0b3699f6c654 -r e36b2f4799c0 rom/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/bld.inf Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,27 @@ +/* +* 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: Build information file +* +*/ + + +#include + +PRJ_EXPORTS + +// iby exports to core +homescreensrv_core.iby CORE_MW_LAYER_IBY_EXPORT_PATH(homescreensrv_core.iby) + +// iby exports to language +homescreensrv_language.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(homescreensrv_language.iby) \ No newline at end of file diff -r 0b3699f6c654 -r e36b2f4799c0 rom/homescreensrv_core.iby --- a/rom/homescreensrv_core.iby Fri Sep 17 08:32:18 2010 +0300 +++ b/rom/homescreensrv_core.iby Mon Oct 04 00:38:31 2010 +0300 @@ -41,7 +41,6 @@ file=ABI_DIR\BUILD_DIR\cautils.dll SHARED_LIB_DIR\cautils.dll file=ABI_DIR\BUILD_DIR\camenu.dll SHARED_LIB_DIR\camenu.dll file=ABI_DIR\BUILD_DIR\camenuserver.exe PROGRAMS_DIR\camenuserver.exe -file=ABI_DIR\BUILD_DIR\casathandler.dll SHARED_LIB_DIR\casathandler.dll file=ABI_DIR\BUILD_DIR\castorage.dll SHARED_LIB_DIR\castorage.dll file=ABI_DIR\BUILD_DIR\MenuInterface.dll SHARED_LIB_DIR\MenuInterface.dll file=ABI_DIR\BUILD_DIR\casrvmanager.dll SHARED_LIB_DIR\casrvmanager.dll @@ -53,6 +52,7 @@ ECOM_PLUGIN( causifscanner.dll, causifscanner.rsc ) data=ZPRIVATE\20022F90\castorage.db private\20022F90\castorage.db +data=ZPRIVATE\20022F90\backup_registration.xml private\20022F90\backup_registration.xml // ---- hswidgetmodel -------------------------------------------- file=ABI_DIR\BUILD_DIR\hswidgetmodel.dll SHARED_LIB_DIR\hswidgetmodel.dll diff -r 0b3699f6c654 -r e36b2f4799c0 sis/homescreensrv.pkg --- a/sis/homescreensrv.pkg Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -; -; 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: -; - -; Language -&EN - -; SIS header: name, uid, version -#{"homescreensrv"},(0x20022F66),1,0,0 - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -; Supports S60 5th Edition -[0x1028315F], 0, 0, 0, {"S60ProductID"} - -; ---- qt -------------------------------------------- - -"/epoc32/data/z/resource/apps/s60main.rsc" - "c:/resource/apps/s60main.rsc" -"/epoc32/release/armv5/urel/QtCore.dll" - "c:/sys/bin/QtCore.dll" -"/epoc32/release/armv5/urel/QtXml.dll" - "c:/sys/bin/QtXml.dll" -"/epoc32/release/armv5/urel/QtGui.dll" - "c:/sys/bin/QtGui.dll" -"/epoc32/release/armv5/urel/QtNetwork.dll" - "c:/sys/bin/QtNetwork.dll" -;"/epoc32/release/armv5/urel/QtScript.dll" - "c:/sys/bin/QtScript.dll" -"/epoc32/release/armv5/urel/QtTest.dll" - "c:/sys/bin/QtTest.dll" -"/epoc32/release/armv5/urel/QtSql.dll" - "c:/sys/bin/QtSql.dll" -"/epoc32/release/armv5/urel/qts60plugin_3_1.dll" - "c:/sys/bin/qts60plugin_3_1.dll" -"/epoc32/release/armv5/urel/qts60plugin_3_2.dll" - "c:/sys/bin/qts60plugin_3_2.dll" -"/epoc32/release/armv5/urel/qts60plugin_5_0.dll" - "c:/sys/bin/qts60plugin_5_0.dll" -"/epoc32/release/armv5/urel/sqlite3.dll" - "c:/sys/bin/sqlite3.dll" -"/epoc32/release/armv5/urel/QtSvg.dll" - "c:/sys/bin/QtSvg.dll" -;"/epoc32/release/armv5/urel/Phonon.dll" - "c:/sys/bin/Phonon.dll" -"/epoc32/release/armv5/urel/qjpeg.dll" - "c:/sys/bin/qjpeg.dll" -"/epoc32/winscw/c/resource/qt/plugins/imageformats/qjpeg.qtplugin" - "c:/resource/qt/plugins/imageformats/qjpeg.qtplugin" -"/epoc32/release/armv5/urel/qgif.dll" - "c:/sys/bin/qgif.dll" -"/epoc32/winscw/c/resource/qt/plugins/imageformats/qgif.qtplugin" - "c:/resource/qt/plugins/imageformats/qgif.qtplugin" -"/epoc32/release/armv5/urel/qmng.dll" - "c:/sys/bin/qmng.dll" -"/epoc32/winscw/c/resource/qt/plugins/imageformats/qmng.qtplugin" - "c:/resource/qt/plugins/imageformats/qmng.qtplugin" -"/epoc32/release/armv5/urel/qtiff.dll" - "c:/sys/bin/qtiff.dll" -"/epoc32/winscw/c/resource/qt/plugins/imageformats/qtiff.qtplugin" - "c:/resource/qt/plugins/imageformats/qtiff.qtplugin" -"/epoc32/release/armv5/urel/qico.dll" - "c:/sys/bin/qico.dll" -"/epoc32/winscw/c/resource/qt/plugins/imageformats/qico.qtplugin" - "c:/resource/qt/plugins/imageformats/qico.qtplugin" -"/epoc32/release/armv5/urel/qsvg.dll" - "c:/sys/bin/qsvg.dll" -"/epoc32/winscw/c/resource/qt/plugins/imageformats/qsvg.qtplugin" - "c:/resource/qt/plugins/imageformats/qsvg.qtplugin" -"/epoc32/release/armv5/urel/qcncodecs.dll" - "c:/sys/bin/qcncodecs.dll" -"/epoc32/winscw/c/resource/qt/plugins/codecs/qcncodecs.qtplugin" - "c:/resource/qt/plugins/codecs/qcncodecs.qtplugin" -"/epoc32/release/armv5/urel/qjpcodecs.dll" - "c:/sys/bin/qjpcodecs.dll" -"/epoc32/winscw/c/resource/qt/plugins/codecs/qjpcodecs.qtplugin" - "c:/resource/qt/plugins/codecs/qjpcodecs.qtplugin" -"/epoc32/release/armv5/urel/qtwcodecs.dll" - "c:/sys/bin/qtwcodecs.dll" -"/epoc32/winscw/c/resource/qt/plugins/codecs/qtwcodecs.qtplugin" - "c:/resource/qt/plugins/codecs/qtwcodecs.qtplugin" -"/epoc32/release/armv5/urel/qkrcodecs.dll" - "c:/sys/bin/qkrcodecs.dll" -"/epoc32/winscw/c/resource/qt/plugins/codecs/qkrcodecs.qtplugin" - "c:/resource/qt/plugins/codecs/qkrcodecs.qtplugin" -"/epoc32/release/armv5/urel/qsvgicon.dll" - "c:/sys/bin/qsvgicon.dll" -"/epoc32/winscw/c/resource/qt/plugins/iconengines/qsvgicon.qtplugin" - "c:/resource/qt/plugins/iconengines/qsvgicon.qtplugin" - -; ---- hb -------------------------------------------- - -"/epoc32/release/armv5/urel/HbCore.dll" - "c:/sys/bin/HbCore.dll" -"/epoc32/release/armv5/urel/HbWidgets.dll" - "c:/sys/bin/HbWidgets.dll" -"/epoc32/release/armv5/urel/HbTools.dll" - "c:/sys/bin/HbTools.dll" -"/epoc32/release/armv5/urel/HbInput.dll" - "c:/sys/bin/HbInput.dll" -"/epoc32/release/armv5/urel/HbFeedback.dll" - "c:/sys/bin/HbFeedback.dll" -"/epoc32/release/armv5/urel/HbFeedbackEffectPlugin.dll" - "c:/sys/bin/HbFeedbackEffectPlugin.dll" -"/epoc32/winscw/c/resource/qt/plugins/hb/feedback/HbFeedbackEffectPlugin.qtplugin" - "c:/resource/qt/plugins/hb/feedback/HbFeedbackEffectPlugin.qtplugin" -"/epoc32/release/armv5/urel/HbDeviceNotificationDialogPlugin.dll" - "!:\sys\bin\HbDeviceNotificationDialogPlugin.dll" -"/epoc32/winscw/c/resource/plugins/devicedialogs/HbDeviceNotificationDialogPlugin.qtplugin" - "!:\resource\plugins\devicedialogs\HbDeviceNotificationDialogPlugin.qtplugin" -"/epoc32/release/armv5/urel/HbIndicatorPopupPlugin.dll" - "!:\sys\bin\HbIndicatorPopupPlugin.dll" -"/epoc32/winscw/c/resource/plugins/devicedialogs/HbIndicatorPopupPlugin.qtplugin" - "!:\resource\plugins\devicedialogs\HbIndicatorPopupPlugin.qtplugin" -"/epoc32/release/armv5/urel/HbDeviceProgressDialogPlugin.dll" - "!:\sys\bin\HbDeviceProgressDialogPlugin.dll" -"/epoc32/winscw/c/resource/plugins/devicedialogs/HbDeviceProgressDialogPlugin.qtplugin" - "!:\resource\plugins\devicedialogs\HbDeviceProgressDialogPlugin.qtplugin" -"/epoc32/release/armv5/urel/HbAutoComplete.dll" - "!:\sys\bin\HbAutoComplete.dll" -"/epoc32/winscw/c/resource/hbinputs/engines/HbAutoComplete.qtplugin" - "!:\resource\hbinputs\engines\HbAutoComplete.qtplugin" -"/epoc32/release/armv5/urel/HbTouchInput.dll" - "!:\sys\bin\HbTouchInput.dll" -"/epoc32/winscw/c/resource/hbinputs/inputmethods/HbTouchInput.qtplugin" - "!:\resource\hbinputs\inputmethods\HbTouchInput.qtplugin" - -;"/epoc32/release/armv5/urel/HbKeymappings_1.dll" - "!:\sys\bin\HbKeymappings_1.dll" -;"/epoc32/winscw/c/resource/hbinputs/keymappings/HbKeymappings_1.qtplugin" - "!:\resource\hbinputs\keymappings\HbKeymappings_1.qtplugin" -;"/epoc32/release/armv5/urel/HbKeymappings_2.dll" - "!:\sys\bin\HbKeymappings_2.dll" -;"/epoc32/winscw/c/resource/hbinputs/keymappings/HbKeymappings_2.qtplugin" - "!:\resource\hbinputs\keymappings\HbKeymappings_2.qtplugin" -;"/epoc32/release/armv5/urel/HbKeymappings_3.dll" - "!:\sys\bin\HbKeymappings_3.dll" -;"/epoc32/winscw/c/resource/hbinputs/keymappings/HbKeymappings_3.qtplugin" - "!:\resource\hbinputs\keymappings\HbKeymappings_3.qtplugin" -;"/epoc32/release/armv5/urel/HbKeymappings_4.dll" - "!:\sys\bin\HbKeymappings_4.dll" -;"/epoc32/winscw/c/resource/hbinputs/keymappings/HbKeymappings_4.qtplugin" - "!:\resource\hbinputs\keymappings\HbKeymappings_4.qtplugin" - -"/epoc32/release/armv5/urel/hbdevicedialogappserver.exe" - "!:\sys\bin\hbdevicedialogappserver.exe" -"/epoc32/data/z/resource/apps/hbdevicedialogappserver.rsc" - "!:\resource\apps\hbdevicedialogappserver.rsc" -"/epoc32/data/z/private/10003a3f/import/apps/hbdevicedialogappserver_reg.rsc" - "!:\private\10003a3f\import\apps\hbdevicedialogappserver_reg.rsc" - -"/epoc32/release/armv5/urel/hbthemeserver.exe" - "!:\sys\bin\hbthemeserver.exe" -"/epoc32/data/z/resource/apps/hbthemeserver.rsc" - "!:\resource\apps\hbthemeserver.rsc" -"/epoc32/data/z/private/10003a3f/import/apps/hbthemeserver_reg.rsc" - "!:\private\10003a3f\import\apps\hbthemeserver_reg.rsc" - -"/epoc32/release/armv5/urel/hbiconpreloader.exe" - "!:\sys\bin\hbiconpreloader.exe" -"/epoc32/data/z/resource/apps/hbiconpreloader.rsc" - "!:\resource\apps\hbiconpreloader.rsc" -"/epoc32/data/z/private/10003a3f/import/apps/hbiconpreloader_reg.rsc" - "!:\private\10003a3f\import\apps\hbiconpreloader_reg.rsc" - - -; ---- db localizations ------------------------------------------ -"/epoc32/data/z/resource/qt/translations/contentstorage.qm" - "c:/resource/qt/translations/contentstorage.qm" - -; ---- contentstorage -------------------------------------------- - -"/epoc32/release/armv5/urel/caclient.dll" - "c:/sys/bin/caclient.dll" -"/epoc32/release/armv5/urel/cautils.dll" - "c:/sys/bin/cautils.dll" -"/epoc32/release/armv5/urel/camenu.dll" - "c:/sys/bin/camenu.dll" - -"/epoc32/release/armv5/urel/casrvmanager.dll" - "c:/sys/bin/casrvmanager.dll" -"/epoc32/release/armv5/urel/casatmonitor.dll" - "c:/sys/bin/casatmonitor.dll" -"/epoc32/data/z/resource/plugins/casatmonitor.rsc"-"c:/resource/plugins/casatmonitor.rsc" -"/epoc32/release/armv5/urel/caappscanner.dll" - "c:/sys/bin/caappscanner.dll" -"/epoc32/data/z/resource/plugins/caappscanner.rsc"-"c:/resource/plugins/caappscanner.rsc" -"/epoc32/release/armv5/urel/cawidgetscanner.dll" - "c:/sys/bin/cawidgetscanner.dll" -"/epoc32/data/z/resource/plugins/cawidgetscanner.rsc"-"c:/resource/plugins/cawidgetscanner.rsc" -"/epoc32/release/armv5/urel/calocalizerscanner.dll" - "c:/sys/bin/calocalizerscanner.dll" -"/epoc32/data/z/resource/plugins/calocalizerscanner.rsc"-"c:/resource/plugins/calocalizerscanner.rsc" -"/epoc32/release/armv5/urel/causifscanner.dll" - "c:/sys/bin/causifscanner.dll" -"/epoc32/data/z/resource/plugins/causifscanner.rsc" - "c:/resource/plugins/causifscanner.rsc" -"/epoc32/release/armv5/urel/camificon.dll" - "c:/sys/bin/camificon.dll" -"/epoc32/data/z/resource/qt/plugins/iconengines/camificon.qtplugin" - "c:/resource/qt/plugins/iconengines/camificon.qtplugin" - -"/epoc32/release/armv5/urel/camenuserver.exe" - "c:/sys/bin/camenuserver.exe" -"/epoc32/release/armv5/urel/caextendedmenu.dll" - "c:/sys/bin/caextendedmenu.dll" -"/epoc32/release/armv5/urel/casathandler.dll" - "c:/sys/bin/casathandler.dll" -"/epoc32/release/armv5/urel/castorage.dll" - "c:/sys/bin/castorage.dll" -"/epoc32/release/armv5/urel/casoftwareregistry.dll" - "c:/sys/bin/casoftwareregistry.dll" -"/epoc32/release/armv5/urel/castockhandlerplugins.dll" - "c:/sys/bin/castockhandlerplugins.dll" -"/epoc32/data/z/private/20022F90/castorage.db" - "c:/private/20022F90/castorage.db" -"/epoc32/data/z/resource/plugins/castockhandlerplugins.rsc"-"c:/resource/plugins/castockhandlerplugins.rsc" - -; ---- hswidgetmodel -------------------------------------------- -"/epoc32/release/armv5/urel/hswidgetmodel.dll" - "c:/sys/bin/hswidgetmodel.dll" - -; ---- screensavermodel -------------------------------------------- -"/epoc32/release/armv5/urel/screensavermodel.dll" - "c:/sys/bin/screensavermodel.dll" diff -r 0b3699f6c654 -r e36b2f4799c0 sis/homescreensrv_sisx.bat --- a/sis/homescreensrv_sisx.bat Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -@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 - -if exist homescreensrv.sisx del homescreensrv.sisx - -makesis homescreensrv.pkg -signsis homescreensrv.sis homescreensrv.sisx rd.cer rd-key.pem - -if exist homescreensrv.sisx ( -echo homescreensrv.sisx creation SUCCEEDED -del homescreensrv.sis -) - -if not exist homescreensrv.sisx ( -echo homescreensrv.sisx creation FAILED -) \ No newline at end of file diff -r 0b3699f6c654 -r e36b2f4799c0 sis/homescreensrv_ut_applib.pkg --- a/sis/homescreensrv_ut_applib.pkg Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -; -; 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: -; - -; Language -&EN - -; SIS header: name, uid, version -#{"hssrv ut applib"},(0xEAEAEA01),1,0,0 - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -; Supports S60 5th Edition -[0x1028315F], 0, 0, 0, {"S60ProductID"} - -;--------------- contentstorage --------------- - - diff -r 0b3699f6c654 -r e36b2f4799c0 sis/homescreensrv_ut_applib_sisx.bat --- a/sis/homescreensrv_ut_applib_sisx.bat Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -@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 - -if exist homescreensrv_ut_applib.sisx del homescreensrv_ut_applib.sisx - -makesis homescreensrv_ut_applib.pkg -signsis homescreensrv_ut_applib.sis homescreensrv_ut_applib.sisx rd.cer rd-key.pem - -if exist homescreensrv_ut_applib.sisx ( -echo homescreensrv_ut_applib.sisx creation SUCCEEDED -del homescreensrv_ut_applib.sis -) - -if not exist homescreensrv_ut_applib.sisx ( -echo homescreensrv_ut_applib.sisx creation FAILED -) \ No newline at end of file diff -r 0b3699f6c654 -r e36b2f4799c0 sis/rd-key.pem --- a/sis/rd-key.pem Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4 -6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh -7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB -gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX -pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB -yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j -KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003 -iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3 -2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+ -9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0 -aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO -TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8 -mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ= ------END RSA PRIVATE KEY----- diff -r 0b3699f6c654 -r e36b2f4799c0 sis/rd.cer --- a/sis/rd.cer Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD -ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z -NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl -cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT -rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa -gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI -f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL -BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud -IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD -ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd -IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE -IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G -CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9 -Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT -7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR ------END CERTIFICATE----- diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/activitytsplugin/activitytsplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/activitytsplugin/activitytsplugin.pro Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,59 @@ +# +# 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: +# + +TEMPLATE = lib +TARGET = activitytsplugin + +CONFIG += plugin + +CONFIG += mobility +MOBILITY = serviceframework + +CONFIG += qtservice +QTSERVICE.DESCRIPTOR = data/activitytsplugin.xml + +INCLUDEPATH += inc \ + ../../../inc \ + +HEADERS += inc/activitytsplugin.h \ + inc/activitytsmodel.h \ + inc/activitytsentry.h \ + +SOURCES += src/activitytsplugin.cpp \ + src/activitytsmodel.cpp \ + src/activitytsentry.cpp \ + +symbian { + load(data_caging_paths) + pluginDep.sources = activitytsplugin.dll + pluginDep.path = $$QT_PLUGINS_BASE_DIR + DEPLOYMENT += pluginDep + + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = ALL -TCB + + LIBS += -lfbscli + LIBS += -lxqsettingsmanager + + # service framework XML deployment/export + xml.sources = ./data/activitytsplugin.xml + xml.path = $$RESOURCE_FILES_DIR/taskswitcher + + DEPLOYMENT += xml + + #temporary workaround + BLD_INF_RULES.prj_exports += "data/activitytsplugin.xml z:/resource/taskswitcher/activitytsplugin.xml" +} diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/activitytsplugin/data/activitytsplugin.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/activitytsplugin/data/activitytsplugin.xml Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,11 @@ + + + activitytsplugin + activitytsplugin + Activity model plugin for Task Switcher + + com.nokia.qt.taskswitcher.dataprovider + 1.0 + + + diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/activitytsplugin/inc/activitytsentry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/activitytsplugin/inc/activitytsentry.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,41 @@ +/* +* 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: +* +*/ + +#ifndef ACTIVITYTSENTRY_H +#define ACTIVITYTSENTRY_H + +#include + +class CFbsBitmap; + +class ActivityTsEntry +{ + +public: + ActivityTsEntry(const QVariantHash &activityData); + ~ActivityTsEntry(); + + void setThumbnail(const CFbsBitmap *bitmap); + QVariantHash data() const; + +private: + QVariantHash mData; + mutable const CFbsBitmap *mBitmap; + +}; + +#endif // ACTIVITYTSENTRY_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/activitytsplugin/inc/activitytsmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/activitytsplugin/inc/activitytsmodel.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,62 @@ +/* +* 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: +* +*/ + +#ifndef ACTIVITYTSMODEL_H +#define ACTIVITYTSMODEL_H + +#include +#include + +#include "activitytsentry.h" + +class ActivityTsModel : public QObject +{ + Q_OBJECT + +public: + ActivityTsModel(QObject *parent = 0); + virtual ~ActivityTsModel(); + +public slots: + QList taskList() const; + QList taskList(int limit) const; + + bool openTask(const QVariant &id); + bool closeTask(const QVariant &id); + +signals: + void dataChanged(); + +private slots: + void getActivities(); + +public slots: + void convertScreenshotToThumbnail(const QPixmap &thumbnail, void *userData); + void thumbnailCreated(const QPixmap &thumbnail, const void *userData); + +signals: + void createThumbnail(const QPixmap &source, int angle, const void *userData); + +private: + QObject *mAfManager; + int mMaxItems; + + QList mData; + +}; + +#endif // ACTIVITYTSMODEL_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/activitytsplugin/inc/activitytsplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/activitytsplugin/inc/activitytsplugin.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,36 @@ +/* +* 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: +* +*/ + +#ifndef ACTIVITYTSPLUGIN_H +#define ACTIVITYTSPLUGIN_H + +#include +#include + +QTM_USE_NAMESPACE + +class ActivityTsPlugin : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session); + +}; + +#endif // ACTIVITYTSPLUGIN_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/activitytsplugin/src/activitytsentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/activitytsplugin/src/activitytsentry.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,66 @@ +/* +* 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: +* +*/ + +#include "activitytsentry.h" + +#include + +#include +#include + +#include "afactivities_global.h" +#include "afstorageglobals.h" + +ActivityTsEntry::ActivityTsEntry(const QVariantHash &activityData) : mBitmap(0) +{ + mData.insert("TaskTimestamp", activityData.value(ActivityTimestamp)); + mData.insert("TaskUpdateTimestamp", QDateTime::currentDateTime()); + mData.insert("TaskIsRunning", false); + mData.insert("TaskCanBeClosed", false); + mData.insert("TaskIsMandatory", 0); + + { + QUrl uri; + uri.setScheme(Af::KActivityScheme); + uri.setHost(QString("%1").arg(activityData.value(ActivityApplicationKeyword).toUInt(), 8, 16, QChar('0'))); + + if (activityData.contains(ActivityActivityKeyword)) + uri.addQueryItem(Af::KActivityUriNameKey, activityData.value(ActivityActivityKeyword).toString()); + mData.insert("Uri", uri); + mData.insert("TaskId", qHash(uri.toString())); + } + + mData.insert("TaskName", activityData.value(ActivityApplicationName)); + mData.insert("TaskScreenshot", -1); +} + +ActivityTsEntry::~ActivityTsEntry() +{ + delete mBitmap; +} + +void ActivityTsEntry::setThumbnail(const CFbsBitmap *bitmap) +{ + mBitmap = bitmap; + mData.insert("TaskScreenshot", mBitmap->Handle()); + mData.insert("TaskUpdateTimestamp", QDateTime::currentDateTime()); +} + +QVariantHash ActivityTsEntry::data() const +{ + return mData; +} diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/activitytsplugin/src/activitytsmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/activitytsplugin/src/activitytsmodel.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,145 @@ +/* +* 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: +* +*/ + +#include "activitytsmodel.h" + +#include + +#include +#include + +#include +#include + +#include "afstorageglobals.h" + +QTM_USE_NAMESPACE + +namespace { + const char KActivityManager[] = "com.nokia.qt.activities.ActivityManager"; + + const int KTsDeviceDialogUid = 0x2002677F; + const int KItemsLimit = 0x00000001; +} + +ActivityTsModel::ActivityTsModel(QObject *parent) : QObject(parent), mAfManager(0) , mMaxItems(10) +{ + { + QServiceManager serviceManager; + mAfManager = serviceManager.loadInterface(KActivityManager); + if (mAfManager) { + mAfManager->setParent(this); + } else { + throw std::runtime_error("Cannot create critical com.nokia.qt.activities.ActivityManager service"); + } + } + + { + XQSettingsManager crManager; + QVariant itemsNumberVariant = crManager.readItemValue(XQCentralRepositorySettingsKey(KTsDeviceDialogUid, KItemsLimit), XQSettingsManager::TypeInt); + if (!itemsNumberVariant.isNull()) { + int number = itemsNumberVariant.toInt(); + if (number > 0) { + mMaxItems = number; + } + } + } + + connect(mAfManager, SIGNAL(dataChanged()), SLOT(getActivities())); + connect(mAfManager, SIGNAL(thumbnailReady(QPixmap,void*)), SLOT(convertScreenshotToThumbnail(QPixmap,void*))); + + getActivities(); +} + +ActivityTsModel::~ActivityTsModel() +{ + qDeleteAll(mData); +} + +QList ActivityTsModel::taskList() const +{ + return taskList(mData.count()); +} + +QList ActivityTsModel::taskList(int limit) const +{ + QList result; + for (int i(0); i < limit && i < mData.count(); ++i) { + result.append(mData[i]->data()); + } + return result; +} + +bool ActivityTsModel::openTask(const QVariant &id) +{ + foreach (const ActivityTsEntry *entry, mData) { + if (entry->data().value("TaskId") == id) { + QMetaObject::invokeMethod(mAfManager, + "launchActivity", + Q_ARG(QUrl, entry->data().value("Uri").toUrl())); + return true; + } + } + return false; +} + +bool ActivityTsModel::closeTask(const QVariant &id) +{ + // it's impossible to "close" activity + Q_UNUSED(id); + return false; +} + +void ActivityTsModel::getActivities() +{ + qDeleteAll(mData); + mData.clear(); + + QList activities; + QMetaObject::invokeMethod(mAfManager, + "activitiesList", + Q_RETURN_ARG(QList, activities), + Q_ARG(int, mMaxItems)); + + foreach (const QVariantHash &activityEntry, activities) { + mData.append(new ActivityTsEntry(activityEntry)); + + QMetaObject::invokeMethod( + mAfManager, + "getThumbnail", + Q_ARG(QString, activityEntry.value(ActivityScreenshotKeyword).toString()), + Q_ARG(void *, mData.last())); + } + + emit dataChanged(); +} + +void ActivityTsModel::convertScreenshotToThumbnail(const QPixmap &thumbnail, void *userData) +{ + emit createThumbnail(thumbnail, 0, userData); +} + +void ActivityTsModel::thumbnailCreated(const QPixmap &thumbnail, const void *userData) +{ + foreach (ActivityTsEntry *activity, mData) { + if (activity == userData) { + activity->setThumbnail(thumbnail.toSymbianCFbsBitmap()); + emit dataChanged(); + break; + } + } +} diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/activitytsplugin/src/activitytsplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/activitytsplugin/src/activitytsplugin.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,38 @@ +/* +* 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: +* +*/ + +#include "activitytsplugin.h" + +#include +#include +#include + +#include "activitytsmodel.h" + +QObject *ActivityTsPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == "com.nokia.qt.taskswitcher.dataprovider") { + return new ActivityTsModel(); + } else { + return NULL; + } +} + +Q_EXPORT_PLUGIN2(activitytsplugin, ActivityTsPlugin) diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/backstepping/group/tsbackstepping.mmp --- a/taskswitcher/backstepping/group/tsbackstepping.mmp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/backstepping/group/tsbackstepping.mmp Mon Oct 04 00:38:31 2010 +0300 @@ -35,13 +35,14 @@ SOURCE tsbacksteppingactivation.cpp SOURCEPATH ../../utils/src -SOURCE tswindowgroupsmonitor.cpp SOURCE tswindowgroupsobserver.cpp SOURCE tsresourcemanager.cpp +SOURCE tsidlist.cpp LIBRARY euser.lib LIBRARY ws32.lib // for RWsSession LIBRARY apgrfx.lib // for TApaTask / TApaTasksList LIBRARY afactivitylauncher.lib +LIBRARY estor.lib DEBUGLIBRARY flogger.lib diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/backstepping/inc/tsbackstepping.h --- a/taskswitcher/backstepping/inc/tsbackstepping.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/backstepping/inc/tsbackstepping.h Mon Oct 04 00:38:31 2010 +0300 @@ -33,22 +33,16 @@ private: CTsBackstepping( MTsWindowGroupsMonitor& ); void ConstructL(); - void HandleWindowGroupChanged( - MTsResourceManager&, - const TArray& ); - void HandleWindowGroupChangedL( - MTsResourceManager&, - const TArray& ); - TInt HomescreenOffsetL( - MTsResourceManager&, - const TArray& )const; - TInt ParentOffsetL( TInt, - const TArray& )const; - inline TBool IsEmbededApp( const RWsSession::TWindowGroupChainInfo& ) const; - TUid GetUidFromWindowGroupL(MTsResourceManager &aResources, TInt aWindowGroupId) const; + void HandleWindowGroupChanged( MTsResourceManager &rsc, + const MTsRunningApplicationStorage& aStorage ); + void HandleWindowGroupChangedL( MTsResourceManager &rsc, + const MTsRunningApplicationStorage& aStorage ); + TInt HomescreenOffsetL( const MTsRunningApplicationStorage& aStorage )const; + void SwitchToIdleStateL( MTsResourceManager& aResources, TBool aIsFirst ); private: CTsBacksteppingFilter *iFilter; + TBool iHsWasFirst; }; diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/backstepping/inc/tsbacksteppingfilter.h --- a/taskswitcher/backstepping/inc/tsbacksteppingfilter.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/backstepping/inc/tsbacksteppingfilter.h Mon Oct 04 00:38:31 2010 +0300 @@ -17,11 +17,8 @@ #ifndef TSBACKSTEPPINGFILTER_H #define TSBACKSTEPPINGFILTER_H - -#include -#include - - +#include +class CTsIdList; NONSHARABLE_CLASS(CTsBacksteppingFilter) : public CBase { public: @@ -34,7 +31,7 @@ void ConstructL(); private: - RArray iBlockedApps; + CTsIdList* iBlockedApps; }; diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/backstepping/src/tsbackstepping.cpp --- a/taskswitcher/backstepping/src/tsbackstepping.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/backstepping/src/tsbackstepping.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -29,12 +29,17 @@ #include "tsbacksteppingfilter.h" +/** + * String to switch hsapplication to IDLE state using activity framework + */ _LIT(KHsActivactionUri, "appto://20022F35?activityname=HsIdleView&activityinbackground=true"); // ----------------------------------------------------------------------------- /** - * CTsBackstepping::NewL - * two phase constructor + * Symbian two-phases constructor. Allocate create and initialize backstepping engine + * Instance is pushed int cleanup stack. + * @param aMonitor - window group changes monitor + * @return address to backstepping engine */ CTsBackstepping* CTsBackstepping::NewL( MTsWindowGroupsMonitor& aMonitor ) { @@ -45,8 +50,9 @@ // ----------------------------------------------------------------------------- /** - * CTsBackstepping::NewLC - * two phase constructor + * Symbian two-phases constructor. Allocate create and initialize backstepping engine + * @param aMonitor - window group changes monitor + * @return address to backstepping engine */ CTsBackstepping* CTsBackstepping::NewLC( MTsWindowGroupsMonitor& aMonitor ) { @@ -58,12 +64,12 @@ // ----------------------------------------------------------------------------- /** - * CTsBackstepping::CTsBackstepping - * constructor + * Constructor. + * @param aMonitor - window group changes monitor */ CTsBackstepping::CTsBackstepping( MTsWindowGroupsMonitor &aMonitor ) : -CTsWindowGroupsObserver( aMonitor ) +CTsWindowGroupsObserver( aMonitor ), iHsWasFirst(ETrue) { } @@ -79,8 +85,9 @@ // ----------------------------------------------------------------------------- /** - * CTsBackstepping::ConstructL - * two phase constructor + * Symbian second-phase constructor. + * Subscribe to window group monitor events (using BaseConstructL) and allocate + * filtering list */ void CTsBackstepping::ConstructL () { @@ -89,48 +96,50 @@ } // ----------------------------------------------------------------------------- -/** - * CTsBackstepping::AnalyseWindowStackL - * Analyzes window stack and move homescreen to proper position +/** + * Analyzes window stack and move homescreen to proper position + * Interface implementation. + * @see MTsWindowGroupsObserver::HandleWindowGroupChanged */ void CTsBackstepping::HandleWindowGroupChanged( - MTsResourceManager &aResource, - const TArray &aWindowGroups ) + MTsResourceManager &aResources, + const MTsRunningApplicationStorage& aStorage ) + { RDebug::Print(_L("[Backstepping] started")); - TRAP_IGNORE( HandleWindowGroupChangedL( aResource, aWindowGroups ) ); + TRAP_IGNORE( HandleWindowGroupChangedL( aResources, aStorage ) ); RDebug::Print(_L("[Backstepping] finished")); } // ----------------------------------------------------------------------------- /** - * CTsBackstepping::AnalyseWindowStackL * Analyzes window stack and move homescreen to proper position + * @see MTsWindowGroupsObserver::HandleWindowGroupChanged from param info */ void CTsBackstepping::HandleWindowGroupChangedL( - MTsResourceManager& aResource, - const TArray& aWindowGroups ) + MTsResourceManager &aResources, + const MTsRunningApplicationStorage& aStorage ) { // calculate the desired position of Homescreen - const TInt currentHsOffset( HomescreenOffsetL( aResource, aWindowGroups ) ); + const TInt currentHsOffset( HomescreenOffsetL( aStorage ) ); TInt optimalOffset(1); TInt targetHsOffset(currentHsOffset); + TBool isFirst(ETrue); for( TInt offset(0); offset < currentHsOffset; ++offset ) { - TUid uid = GetUidFromWindowGroupL( aResource, - aWindowGroups[offset].iId ); - RDebug::Print(_L("[Backstepping] application: %d"), uid.iUid); - - if( TUid::Null() != uid ) + RDebug::Print( _L("[Backstepping] application: %08x"), + aStorage[offset].UidL().iUid ); + if( TUid::Null() != aStorage[offset].UidL() ) { - if( IsEmbededApp( aWindowGroups[offset] ) ) + isFirst = EFalse; + if( aStorage[offset].IsEmbeded()) { - targetHsOffset = ParentOffsetL( offset, aWindowGroups ) + 1; + targetHsOffset = aStorage.ParentIndex(aStorage[offset])+ 1; } - else if (!iFilter->isBlocked(uid)) + else if (!iFilter->isBlocked( aStorage[offset].UidL() )) { if(offset + 1 < currentHsOffset && - GetUidFromWindowGroupL( aResource, aWindowGroups[offset+1].iId) == TUid::Null() ) + aStorage[offset+1].UidL() == TUid::Null() ) { ++optimalOffset; } @@ -143,48 +152,30 @@ ++optimalOffset; } } - - // switch Homescreen to Idle state if Homescreen is not in foreground and is in different state - if( 0 != targetHsOffset) - { - TInt hsState( EHomeScreenIdleState ); - User::LeaveIfError(RProperty::Get( KHsCategoryUid, - KHsCategoryStateKey, - hsState ) ); - if(!(hsState & EHomeScreenWidgetViewActive ) ) - { - RDebug::Print(_L("[Backstepping] about to switch HS activity")); - - CAfActivityLauncher *activityEnabler = - CAfActivityLauncher::NewLC( aResource.ApaSession(), - aResource.WsSession() ); - activityEnabler->launchActivityL( KHsActivactionUri ); - CleanupStack::PopAndDestroy( activityEnabler ); - } - } + SwitchToIdleStateL(aResources, isFirst); // change windows order if necessary if(targetHsOffset != currentHsOffset) { RDebug::Print(_L("[Backstepping] about to change window groups order")); - - const TInt hsWindowGroup( aWindowGroups[currentHsOffset].iId ); - aResource.WsSession().SetWindowGroupOrdinalPosition( hsWindowGroup, - targetHsOffset ); + aResources.WsSession().SetWindowGroupOrdinalPosition( + aStorage[currentHsOffset].WindowGroupId(), + targetHsOffset ); } } // ----------------------------------------------------------------------------- /** - * CTsBackstepping::HomescreenOffsetL + * Find and return current position of hsapplication on window server stack + * @param aStorage - storage with running app info + * @return position of hsapplication on window server stack */ TInt CTsBackstepping::HomescreenOffsetL( - MTsResourceManager& aResource, - const TArray& aWindowGroups ) const + const MTsRunningApplicationStorage& aStorage ) const { TInt offset( KErrNotFound ); - for( TInt iter(0); KErrNotFound == offset && iter < aWindowGroups.Count(); ++iter ) + for( TInt iter(0); KErrNotFound == offset && iter < aStorage.Count(); ++iter ) { - if( KHsCategoryUid == GetUidFromWindowGroupL( aResource, aWindowGroups[iter].iId ) ) + if( KHsCategoryUid == aStorage[iter].UidL() ) { offset = iter; } @@ -194,49 +185,32 @@ } // ----------------------------------------------------------------------------- -/** - * CTsBackstepping::ParentOffsetL +/** + * Change hsapplication state to IDLE if moves to background + * @param aResources - OS resources manager + * @param aIsFrst - flag to inform if hsapplication is in foreground */ -TInt CTsBackstepping::ParentOffsetL( - TInt aOffset, - const TArray& aWindowGroups )const +void CTsBackstepping::SwitchToIdleStateL(MTsResourceManager& aResources, + TBool aIsFirst) { - for( TInt iter(aOffset + 1); iter < aWindowGroups.Count(); ++iter ) + // switch Homescreen to Idle state if Homescreen is not in foreground and is in different state + if( iHsWasFirst && !aIsFirst ) { - if(aWindowGroups[iter].iId == aWindowGroups[aOffset].iParentId) + TInt hsState( EHomeScreenIdleState ); + User::LeaveIfError(RProperty::Get( KHsCategoryUid, + KHsCategoryStateKey, + hsState ) ); + if(!(hsState & EHomeScreenWidgetViewActive ) ) { - return IsEmbededApp( aWindowGroups[iter] ) ? - ParentOffsetL( iter, aWindowGroups ) : iter; + RDebug::Print(_L("[Backstepping] about to switch HS activity")); + CAfActivityLauncher *activityEnabler = + CAfActivityLauncher::NewLC( aResources.ApaSession(), + aResources.WsSession() ); + activityEnabler->launchActivityL( KHsActivactionUri ); + CleanupStack::PopAndDestroy( activityEnabler ); } } - User::Leave( KErrNotFound) ; - return KErrNotFound; - } - -// ----------------------------------------------------------------------------- -/** - * CTsBackstepping::IsEmbededApp - */ -TBool CTsBackstepping::IsEmbededApp( - const RWsSession::TWindowGroupChainInfo &aWindowGroupInfo ) const - { - return 0 < aWindowGroupInfo.iParentId; - } - -// ----------------------------------------------------------------------------- -/** - * CTsBackstepping::GetUidFromWindowGroupL - */ -TUid CTsBackstepping::GetUidFromWindowGroupL( MTsResourceManager &aResource, - TInt aWindowGroupId ) const - { - TUid retVal(TUid::Null()); - CApaWindowGroupName *windowGroupName = - CApaWindowGroupName::NewLC( aResource.WsSession() ); - windowGroupName->ConstructFromWgIdL( aWindowGroupId ); - retVal = windowGroupName->AppUid(); - CleanupStack::PopAndDestroy( windowGroupName ); - return retVal; + iHsWasFirst = aIsFirst; } // end of file diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/backstepping/src/tsbacksteppingfilter.cpp --- a/taskswitcher/backstepping/src/tsbacksteppingfilter.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/backstepping/src/tsbacksteppingfilter.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -15,13 +15,16 @@ * */ #include "tsbacksteppingfilter.h" +#include "tsidlist.h" -const TInt KBlockedApps [] = {0x100058b3/* <-- phoneui.exe */, - 0x2001843A/* <-- javainstaller */}; +const TInt KBlockedApps [] = {0x100058b3/* <-- phoneui */, + 0x2001843A/* <-- javainstaller */, + 0x200267D2/* <-- widgetinstallerapp */}; // ----------------------------------------------------------------------------- /** - * CTsBacksteppingFilter::NewL + * Symbian two-phase constructor. Allocate and initialize list blocked applications + * @return backstepping filtering */ CTsBacksteppingFilter* CTsBacksteppingFilter::NewL() { @@ -34,25 +37,27 @@ // ----------------------------------------------------------------------------- /** - * CTsBacksteppingFilter::~CTsBacksteppingFilter + * Destructor */ CTsBacksteppingFilter::~CTsBacksteppingFilter() { - iBlockedApps.Close(); + delete iBlockedApps; } // ----------------------------------------------------------------------------- /** - * CTsBacksteppingFilter::isBlocked + * Inform if application is blocked for backstepping engine + * @param aApplicationUid - tested application UID + * @return EFalse if application is not blocked for backstepping engine, other value in other cases */ TBool CTsBacksteppingFilter::isBlocked( TUid aApplicationUid ) const { - return KErrNotFound != iBlockedApps.Find( aApplicationUid ); + return iBlockedApps->IsPresent( aApplicationUid.iUid ); } // ----------------------------------------------------------------------------- /** - * CTsBacksteppingFilter::CTsBacksteppingFilter + * Constructor */ CTsBacksteppingFilter::CTsBacksteppingFilter() { @@ -61,13 +66,11 @@ // ----------------------------------------------------------------------------- /** - * CTsBacksteppingFilter::ConstructL + * Symbian second-phase constructor. Initilaize blocked applications list */ void CTsBacksteppingFilter::ConstructL() { - const TInt count(sizeof( KBlockedApps ) / sizeof(TInt)); - for( TInt offset(0);offset < count; ++offset ) - { - iBlockedApps.AppendL(TUid::Uid(KBlockedApps[offset])); - } + const TInt count( sizeof( KBlockedApps ) / sizeof( TInt ) ); + iBlockedApps = CTsIdList::NewL(); + iBlockedApps->AppendL( KBlockedApps, count ); } diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/client/client.pri --- a/taskswitcher/client/client.pri Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/client/client.pri Mon Oct 04 00:38:31 2010 +0300 @@ -36,7 +36,6 @@ $$PWD/s60/inc/tstaskmonitorclient.h \ $$PWD/s60/inc/tstaskmonitorclientimpl.h \ $$PWD/s60/inc/tssession.h \ - $$PWD/../utils/inc/tsentry.h \ $$PWD/../utils/inc/tsentrykey.h \ $$PWD/../utils/inc/tsutils.h \ $$PWD/../utils/inc/tsscreenshotmsg.h \ @@ -52,7 +51,6 @@ SOURCES += $$PWD/s60/src/tstaskmonitorclient.cpp \ $$PWD/s60/src/tstaskmonitorclientimpl.cpp \ $$PWD/s60/src/tssession.cpp \ - $$PWD/../utils/src/tsentry.cpp \ $$PWD/../utils/src/tsentrykey.cpp \ $$PWD/../utils/src/tsscreenshotmsg.cpp \ $$PWD/../utils/src/tsunregscreenshotmsg.cpp \ @@ -68,12 +66,6 @@ -lestor \ -lfbscli \ - # tsimageutils and its dependencies - LIBS += -ltsimageutils.lib \ - -lbitmaptransforms \ - -limageconversion \ - -lefsrv \ - } else { INCLUDEPATH += $$PWD/stub/inc \ diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/client/s60/src/tssession.cpp --- a/taskswitcher/client/s60/src/tssession.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/client/s60/src/tssession.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -42,42 +42,43 @@ } TInt RTsSession::StartServer() -{ - TInt error; - + { RSemaphore semaphore; - error = semaphore.CreateGlobal(KTsServerReadySemaphore, 0); - - if (KErrNone == error || KErrAlreadyExists == error) { + CleanupClosePushL(semaphore); + TInt error = semaphore.OpenGlobal(KTsServerReadySemaphore); + if (KErrNone != error) { RProcess server; + CleanupClosePushL(server); error = server.Create(KRunningAppServerName, KNullDesC, TUidType(KNullUid, KNullUid, KRunningAppServerUid)); - if (KErrNone == error) { + if (KErrNone == error) + { TRequestStatus status; server.Rendezvous(status); - - if (status != KRequestPending) { + if (status != KRequestPending) + { server.Kill(0); User::WaitForRequest(status); - } else { + } + else + { server.Resume(); User::WaitForRequest(status); - - // wait for server - semaphore.Wait(); - } - - if (KErrCancel == status.Int()) { + } + + if(KErrCancel == status.Int()) + { error = KErrNone; - } else { + } + else + { error = (EExitPanic == server.ExitType()) ? KErrGeneral : status.Int(); + } } + CleanupStack::PopAndDestroy(&server); } - server.Close(); + CleanupStack::PopAndDestroy(&semaphore); + return error; } - semaphore.Close(); - - return error; -} HBufC8* RTsSession::TasksContentLC() diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/inc/tstaskmonitorglobals.h --- a/taskswitcher/inc/tstaskmonitorglobals.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/inc/tstaskmonitorglobals.h Mon Oct 04 00:38:31 2010 +0300 @@ -37,6 +37,7 @@ OpenTaskMessage, CloseTaskMessage, WindowGroupToBackgroundMessage, + IgnoreWindowGroups }; enum UpdatePriority { diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/rom/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/rom/bld.inf Mon Oct 04 00:38:31 2010 +0300 @@ -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: Build information file +* +*/ + +#include + +PRJ_EXPORTS + +tstaskmonitor_core.iby CORE_APP_LAYER_IBY_EXPORT_PATH(tstaskmonitor_core.iby) +../sis/stubs/taskmonitor_stub.sis /epoc32/release/winscw/udeb/z/system/install/taskmonitor_stub.sis +../sis/stubs/taskmonitor_stub.sis /epoc32/data/z/system/install/taskmonitor_stub.sis + +../inc/tstaskmonitorglobals.h MW_LAYER_PUBLIC_EXPORT_PATH(tstaskmonitorglobals.rh) + + diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/rom/tstaskmonitor_core.iby --- a/taskswitcher/rom/tstaskmonitor_core.iby Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/rom/tstaskmonitor_core.iby Mon Oct 04 00:38:31 2010 +0300 @@ -22,6 +22,10 @@ data=\epoc32\data\z\resource\apps\hsrunningappmonitor.rsc resource\apps\hsrunningappmonitor.rsc data=ZPRIVATE\10003a3f\import\apps\hsrunningappmonitor_reg.rsc private\10003a3f\import\apps\hsrunningappmonitor_reg.rsc +// activities plugin +file=ABI_DIR\BUILD_DIR\activitytsplugin.dll SHARED_LIB_DIR\activitytsplugin.dll +data=\epoc32\data\z\resource\qt\plugins\activitytsplugin.qtplugin resource\qt\plugins\activitytsplugin.qtplugin +data=\epoc32\data\z\resource\taskswitcher\activitytsplugin.xml resource\taskswitcher\activitytsplugin.xml file=ABI_DIR\BUILD_DIR\tsbackstepping.dll SHARED_LIB_DIR\tsbackstepping.dll diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/screenshotplugin/group/tsscreenshotplugin.mmp --- a/taskswitcher/screenshotplugin/group/tsscreenshotplugin.mmp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/screenshotplugin/group/tsscreenshotplugin.mmp Mon Oct 04 00:38:31 2010 +0300 @@ -33,8 +33,9 @@ SOURCEPATH ../src SOURCE tsscreenshotmain.cpp SOURCE tsscreenshotplugin.cpp -SOURCE tsorientationmonitor.cpp +SOURCE tsscreenshotnotifier.cpp SOURCE ../../utils/src/tsscreenshotmsg.cpp +SOURCE ../../utils/src/tsidlist.cpp RESOURCE tsscreenshotplugin.rss diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/screenshotplugin/inc/tsnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/screenshotplugin/inc/tsnotifier.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,27 @@ +/* +* 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". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef TSNOTIFIER_H +#define TSNOTIFIER_H + +class MTsNotifier + { +public: + virtual void SendMessageL( const TDesC8& aMessage ) =0; + + }; + +#endif //TSNOTIFIER_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/screenshotplugin/inc/tsorientationmonitor.h --- a/taskswitcher/screenshotplugin/inc/tsorientationmonitor.h Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* 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". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef TSORIENTATIONMONITOR_H -#define TSORIENTATIONMONITOR_H -#include -#include -#include "tsorientationobserver.h" - -class CRepository; - -class CTsOrientationMonitor: public CActive, - public MSensrvDataListener - { -public: - static CTsOrientationMonitor* NewL( MTsOrientationObserver& aObserver ); - ~CTsOrientationMonitor(); - -private: - CTsOrientationMonitor( MTsOrientationObserver& aObserver ); - void ConstructL(); - void SubscribeL(); - void StartSensorMonitoringL(); - void StopSensorMonitoring(); - -private://from CActive - void DoCancel(); - void RunL(); - TInt RunError(TInt aError); - -public: - void DataReceived( CSensrvChannel& aChannel, - TInt aCount, - TInt aDataLost ); - - void DataError( CSensrvChannel& aChannel, - TSensrvErrorSeverity aError ); - - void GetDataListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface ); - -private: - MTsOrientationObserver& iObserver; - CRepository* iRepository; - CSensrvChannel* iChannel; - - }; -#endif //TSORIENTATIONMONITOR_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/screenshotplugin/inc/tsorientationobserver.h --- a/taskswitcher/screenshotplugin/inc/tsorientationobserver.h Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* 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". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef TSORIENTATIONOBSERVER_H -#define TSORIENTATIONOBSERVER_H - -class MTsOrientationObserver - { -public: - virtual void OrientationChanged( TInt aAngle ) =0; - }; - -#endif //TSORIENTATIONOBSERVER_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/screenshotplugin/inc/tsscreenshotnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/screenshotplugin/inc/tsscreenshotnotifier.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,52 @@ +/* +* 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". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef TSSCREENSHOTNOTIFIER_H +#define TSSCREENSHOTNOTIFIER_H + +#include "tsnotifier.h" +class CFbsBitmap; + +class CTsScreenshotNotifier: public CActive + { +public: + static CTsScreenshotNotifier* NewL( MTsNotifier& aNotifier, + TInt aId, + CFbsBitmap* aBitmap, + TInt aAngle ); + ~CTsScreenshotNotifier(); + + TInt Handle() const; +private: + CTsScreenshotNotifier( MTsNotifier& aNotifier, + TInt aId, + CFbsBitmap* aBitmap, + TInt aAngle ); + +protected://from CActive + void DoCancel(); + void RunL(); + TInt RunError(TInt aError); + +private: + MTsNotifier& iNotifier; + const TInt iId; + const CFbsBitmap* iBitmap; + const TInt iAngle; + + }; + +#endif //SSCREENSHOTNOTIFIER_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/screenshotplugin/inc/tsscreenshotplugin.h --- a/taskswitcher/screenshotplugin/inc/tsscreenshotplugin.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/screenshotplugin/inc/tsscreenshotplugin.h Mon Oct 04 00:38:31 2010 +0300 @@ -21,13 +21,16 @@ #include #include -#include "tsorientationobserver.h" +#include "tsnotifier.h" class CTsOrientationMonitor; +class CTsScreenshotNotifier; +class CTsIdList; class CTsScreenshotPlugin: public CWsGraphicDrawer, public MWsEventHandler, - public MTsOrientationObserver + public MTsNotifier + { public: static CTsScreenshotPlugin* NewL(); @@ -41,7 +44,6 @@ const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData); - void ConstructL(); void DoHandleEvent(const TWservCrEvent& aEvent); void TakeScreenshot(TInt); void TakeScreenshotL(TInt); @@ -49,14 +51,13 @@ void NotifyWindowGroupToBackgroundL(TInt aWindowGroupId); TInt OrientationToAngle(); -private://from MTsOrientationObserver - void OrientationChanged( TInt aAngle ); - +public: + void SendMessageL( const TDesC8& aMessage ); + private: - RPointerArray iCache; - CTsOrientationMonitor* iMonitor; + CTsIdList* iBlockedList; + RPointerArray iCache; TInt iWindowGroupId; - TInt iAngle; }; #endif //TSSCREENSHOTPLUGIN_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/screenshotplugin/src/tsorientationmonitor.cpp --- a/taskswitcher/screenshotplugin/src/tsorientationmonitor.cpp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* 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". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include -#include -#include -#include - -#include "tsorientationmonitor.h" -const TUid KSensorCenrepUid = {0x2002C384}; -const TUint32 KSensorCenrepKey = 0x1; -//------------------------------------------------------------------------------ -CTsOrientationMonitor* CTsOrientationMonitor::NewL( MTsOrientationObserver& aObserver ) - { - CTsOrientationMonitor* self = new (ELeave) CTsOrientationMonitor(aObserver); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -//------------------------------------------------------------------------------ -CTsOrientationMonitor::CTsOrientationMonitor( MTsOrientationObserver& aObserver ) -: - CActive(EPriorityStandard), - iObserver(aObserver) - { - CActiveScheduler::Add(this); - } - -//------------------------------------------------------------------------------ -void CTsOrientationMonitor::ConstructL() - { - iRepository = CRepository::NewL( KSensorCenrepUid ); - SetActive(); - TRequestStatus* status( &iStatus ); - User::RequestComplete( status, KErrNone ); - } - -//------------------------------------------------------------------------------ -CTsOrientationMonitor::~CTsOrientationMonitor() - { - Cancel(); - delete iChannel; - delete iRepository; - } - -//------------------------------------------------------------------------------ -void CTsOrientationMonitor::SubscribeL() - { - User::LeaveIfError( iRepository->NotifyRequest(KSensorCenrepKey, iStatus) ); - SetActive(); - } - -//------------------------------------------------------------------------------ -void CTsOrientationMonitor::StartSensorMonitoringL() - { - CSensrvChannelFinder *sensrvChannelFinder = CSensrvChannelFinder::NewLC(); - - RSensrvChannelInfoList channelInfoList; - CleanupClosePushL(channelInfoList); - - TSensrvChannelInfo mySearchConditions; - - //Search only Orientation events. - mySearchConditions.iChannelType = KSensrvChannelTypeIdOrientationData; - - sensrvChannelFinder->FindChannelsL(channelInfoList, mySearchConditions); - - if( channelInfoList.Count() ) - { - iChannel = CSensrvChannel::NewL(channelInfoList[0]); - iChannel->OpenChannelL(); - iChannel->StartDataListeningL(this, 1, 1, 0); - } - - CleanupStack::Pop(&channelInfoList); - CleanupStack::PopAndDestroy(sensrvChannelFinder); - } - -//------------------------------------------------------------------------------ -void CTsOrientationMonitor::StopSensorMonitoring() - { - if(0 != iChannel) - { - iChannel->StopDataListening(); - } - delete iChannel; - iChannel = 0; - } - -//------------------------------------------------------------------------------ -void CTsOrientationMonitor::DoCancel() - { - iRepository->NotifyCancel(KSensorCenrepKey); - } - -//------------------------------------------------------------------------------ -void CTsOrientationMonitor::RunL() - { - User::LeaveIfError( iStatus.Int() ); - TInt sensorStatus; - User::LeaveIfError(iRepository->Get(KSensorCenrepKey, sensorStatus)); - (0 != sensorStatus ) ? StartSensorMonitoringL() : StopSensorMonitoring(); - SubscribeL(); - } - -//------------------------------------------------------------------------------ -TInt CTsOrientationMonitor::RunError(TInt aError) - { - if( KErrCancel != aError ) - { - TRAP_IGNORE(SubscribeL()); - } - return KErrNone; - } - -//------------------------------------------------------------------------------ -void CTsOrientationMonitor::DataReceived( CSensrvChannel& aChannel, - TInt aCount, - TInt /*aDataLost*/ ) - { - if (aChannel.GetChannelInfo().iChannelType == KSensrvChannelTypeIdOrientationData) - { - TPckgBuf dataBuf; - for(TInt i = 0; i < aCount; ++i) - { - aChannel.GetData(dataBuf); - iObserver.OrientationChanged( TSensrvOrientationData::EOrientationDisplayRightUp == dataBuf().iDeviceOrientation ? 270 : 0); - } - } - } - -//------------------------------------------------------------------------------ -void CTsOrientationMonitor::DataError( CSensrvChannel& /*aChannel*/, - TSensrvErrorSeverity /*aError*/ ) - { - //No implementation required - } - -//------------------------------------------------------------------------------ -void CTsOrientationMonitor::GetDataListenerInterfaceL( TUid /*aInterfaceUid*/, - TAny*& /*aInterface*/ ) - { - //No implementation required - } diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/screenshotplugin/src/tsscreenshotnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/screenshotplugin/src/tsscreenshotnotifier.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,99 @@ +/* +* 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". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include + +#include "tsscreenshotnotifier.h" +#include "tsscreenshotmsg.h" + +//------------------------------------------------------------------------------ +CTsScreenshotNotifier* CTsScreenshotNotifier::NewL( MTsNotifier& aNotifier, + TInt aId, + CFbsBitmap* aBitmap, + TInt aAngle ) + { + User::LeaveIfNull(aBitmap); + CTsScreenshotNotifier* self = + new(ELeave)CTsScreenshotNotifier( aNotifier, aId, aBitmap, aAngle ); + return self; + } + +//------------------------------------------------------------------------------ +CTsScreenshotNotifier::CTsScreenshotNotifier( MTsNotifier& aNotifier, + TInt aId, + CFbsBitmap* aBitmap, + TInt aAngle ) +: + CActive( EPriorityIdle ), + iNotifier( aNotifier ), + iId( aId ), + iBitmap( aBitmap ), + iAngle( aAngle ) + { + CActiveScheduler::Add(this); + SetActive(); + TRequestStatus *status( &iStatus ); + User::RequestComplete( status, KErrNone ); + } + +//------------------------------------------------------------------------------ +CTsScreenshotNotifier::~CTsScreenshotNotifier() + { + Cancel(); + delete iBitmap; + } + +//------------------------------------------------------------------------------ +TInt CTsScreenshotNotifier::Handle() const + { + return iBitmap->Handle(); + } + +//------------------------------------------------------------------------------ +void CTsScreenshotNotifier::DoCancel() + { + //No implementation required + } + +//------------------------------------------------------------------------------ +void CTsScreenshotNotifier::RunL() + { + RBuf8 message; + CleanupClosePushL(message); + message.CreateL(CTsScreenshotMsg::Size() + sizeof(TInt)); + RDesWriteStream stream(message); + CleanupClosePushL(stream); + stream.WriteInt32L(RegisterScreenshotMessage); + CTsScreenshotMsg * screenshotMsg = + CTsScreenshotMsg::NewLC(iId, + *iBitmap, + Low, + iAngle); + stream << (*screenshotMsg); + CleanupStack::PopAndDestroy(screenshotMsg); + CleanupStack::PopAndDestroy(&stream); + iNotifier.SendMessageL(message); + CleanupStack::PopAndDestroy(&message); + } + +//------------------------------------------------------------------------------ +TInt CTsScreenshotNotifier::RunError(TInt /*aError*/) + { + delete iBitmap; + iBitmap = 0; + return KErrNone; + } diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/screenshotplugin/src/tsscreenshotplugin.cpp --- a/taskswitcher/screenshotplugin/src/tsscreenshotplugin.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/screenshotplugin/src/tsscreenshotplugin.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -23,8 +23,9 @@ #include #include "tsscreenshotplugin.h" -#include "tsorientationmonitor.h" +#include "tsscreenshotnotifier.h" #include "tsscreenshotmsg.h" +#include "tsidlist.h" const TInt KInvalidGroupId(~0); const TUid KHbPsHardwareCoarseOrientationCategoryUid = {0x20022E82}; @@ -57,14 +58,9 @@ TWservCrEvent::EWindowGroupChanged | TWservCrEvent::EDeviceOrientationChanged); iWindowGroupId = KInvalidGroupId; - TRAP_IGNORE( ConstructL() ); + iBlockedList = CTsIdList::NewL(); } -// ----------------------------------------------------------------------------- -void CTsScreenshotPlugin::ConstructL() - { - iMonitor = CTsOrientationMonitor::NewL( *this ); - } // ----------------------------------------------------------------------------- /** @@ -72,7 +68,7 @@ */ CTsScreenshotPlugin::~CTsScreenshotPlugin() { - delete iMonitor; + delete iBlockedList; Env().UnregisterEventHandler(this); iCache.ResetAndDestroy(); } @@ -122,6 +118,13 @@ } CleanupStack::PopAndDestroy( screenshotMsg ); } + else if( IgnoreWindowGroups == function ) + { + CTsIdList* list = CTsIdList::NewLC( msgStream ); + delete iBlockedList; + iBlockedList = list; + CleanupStack::Pop( list ); + } CleanupStack::PopAndDestroy( &msgStream ); } @@ -142,7 +145,10 @@ iWindowGroupId = aEvent.WindowGroupIdentifier(); break; case TWservCrEvent::EDeviceOrientationChanged: - TakeScreenshot( iWindowGroupId ); + if( !iBlockedList->IsPresent( iWindowGroupId ) ) + { + TakeScreenshot( iWindowGroupId ); + } break; } } @@ -182,34 +188,19 @@ CFbsBitmap *bitmap = new (ELeave) CFbsBitmap(); CleanupStack::PushL(bitmap); - User::LeaveIfError(bitmap->Create(screenConfig->SizeInPixels(), screenConfig->DisplayMode())); screenDevice->CopyScreenToBitmapL(bitmap, screenConfig->SizeInPixels()); - //prepare and send message - RBuf8 message; - CleanupClosePushL(message); - message.CreateL(CTsScreenshotMsg::Size() + sizeof(TInt)); - RDesWriteStream stream(message); - CleanupClosePushL(stream); - stream.WriteInt32L(RegisterScreenshotMessage); - - CTsScreenshotMsg * screenshotMsg = - CTsScreenshotMsg::NewLC(aId, - *bitmap, - Low, - OrientationToAngle()); - stream << (*screenshotMsg); - CleanupStack::PopAndDestroy(screenshotMsg); - CleanupStack::PopAndDestroy(&stream); - User::LeaveIfError(SendMessage(message)); - CleanupStack::PopAndDestroy(&message); - iCache.AppendL(bitmap); + CTsScreenshotNotifier* notifier = + CTsScreenshotNotifier::NewL(*this, aId, bitmap, OrientationToAngle()); CleanupStack::Pop(bitmap); + CleanupStack::PushL(notifier); + iCache.AppendL(notifier); + CleanupStack::Pop(notifier); } // ----------------------------------------------------------------------------- @@ -226,7 +217,6 @@ case EDisplayOrientation90CW: retVal = 270;break; case EDisplayOrientation180: retVal = 180;break; case EDisplayOrientation270CW: retVal = 90;break; - case EDisplayOrientationNormal:retVal = iAngle; break; case EDisplayOrientationAuto: { RProperty::Get( KHbPsHardwareCoarseOrientationCategoryUid, @@ -240,9 +230,9 @@ } // ----------------------------------------------------------------------------- -void CTsScreenshotPlugin::OrientationChanged( TInt aAngle ) +void CTsScreenshotPlugin::SendMessageL( const TDesC8& aMessage ) { - iAngle = aAngle; + User::LeaveIfError( SendMessage( aMessage ) ); } // ----------------------------------------------------------------------------- @@ -267,6 +257,6 @@ stream.WriteInt32L(windowGroupId); CleanupStack::PopAndDestroy(&stream); } - User::LeaveIfError(SendMessage(message)); + SendMessageL(message); CleanupStack::PopAndDestroy(&message); } diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsdatalist.h --- a/taskswitcher/server/inc/tsdatalist.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/inc/tsdatalist.h Mon Oct 04 00:38:31 2010 +0300 @@ -27,6 +27,7 @@ #include "tsentry.h" #include "tsdatastorage.h" #include "tsdataobserver.h" +#include "tsenv.h" class CApaWindowGroupName; class CFbsBitmap; @@ -37,35 +38,34 @@ public: static CTsDataList* NewL( MTsResourceManager& aResources, MTsWindowGroupsMonitor& aMonitor, - MTsDataObserver& aObserver ); + MTsDataObserver& aObserver, + TsEnv& aEnv ); ~CTsDataList(); private: CTsDataList( MTsResourceManager& aResources, MTsWindowGroupsMonitor& aMonitor, - MTsDataObserver& aObserver ); + MTsDataObserver& aObserver, + TsEnv& aEnv); void ConstructL(); public: const RTsFswArray& Data() const; - void HandleWindowGroupChanged( MTsResourceManager &, - const TArray & ); + void HandleWindowGroupChanged( MTsResourceManager &aResources, + const MTsRunningApplicationStorage& aStorage ); TBool IsHiddenUid( TUid aUid ); TBool IsSupported(TInt aFunction) const; void HandleDataL(TInt aFunction,RReadStream& aDataStream); private: void CollectAppsL( RTsFswArray& aAppsList, - const TArray &aWgList ); + const MTsRunningApplicationStorage& aStorage ); void AddEntryL( const TTsEntryKey& aKey, - const TUid& aAppUid, - CApaWindowGroupName* aWgName, + const MTsRunningApplication& aRunningApp, RTsFswArray& aNewList ); - HBufC* FindAppNameLC( CApaWindowGroupName* aWindowName, - const TUid& aAppUid, - TInt aWgId ); + HBufC* FindAppNameLC( const MTsRunningApplication& aRunningApp ); TBool CheckIfExists( const CTsEntry& aEntry, const RTsFswArray& aNewList ) const; void RegisterScreenshotL( RReadStream& aDataStream ); @@ -90,6 +90,7 @@ RTsFswArray iVisibleData; RArray iHiddenUids/** list of hidden uids */; CFbsBitmap* iDefaultIcon /** default icon*/; + TsEnv& iEnv; }; #endif //TSDATALIST_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsenv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/server/inc/tsenv.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,36 @@ +/* +* 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: +* +*/ +#ifndef TSENV_H +#define TSENV_H + +#include +#include + +class TsEnv: public QObject +{ + Q_OBJECT +public slots: + void createThumbnail(const QPixmap& source, + int angle =0, + const void* userData =0); + +signals: + void thumbnailCreated(QPixmap thumbnail, const void *userData); + +}; + +#endif //TSENV_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsmodel.h --- a/taskswitcher/server/inc/tsmodel.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/inc/tsmodel.h Mon Oct 04 00:38:31 2010 +0300 @@ -36,6 +36,7 @@ virtual TTsModelItemKey KeyL( TInt aOffset ) const = 0; virtual TBool IsActiveL( TInt aOffset ) const = 0; virtual TBool IsClosableL( TInt aOffset ) const = 0; + virtual TBool IsMandatoryL( TInt aOffset ) const = 0; protected: //operations execution virtual TBool CloseL( TTsModelItemKey aKey ) const = 0; diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsmodelitem.h --- a/taskswitcher/server/inc/tsmodelitem.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/inc/tsmodelitem.h Mon Oct 04 00:38:31 2010 +0300 @@ -35,6 +35,7 @@ TBool IsClosableL() const; TBool CloseL() const; TBool LaunchL() const; + TBool IsMandatoryL() const; public: void ExternalizeL( RWriteStream& aStream ) const; diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsrunningapp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/server/inc/tsrunningapp.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,56 @@ +/* + * 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 : + * + */ +#ifndef TSRUNNINGAPP_H +#define TSRUNNINGAPP_H + +#include + +#include "tswindowgroupsobserver.h" + +class CApaWindowGroupName; + +class CTsRunningApp: public CBase, + public MTsRunningApplication +{ +public: + static CTsRunningApp* NewLC( MTsResourceManager& aResources, + const RWsSession::TWindowGroupChainInfo& aInfo ); + ~CTsRunningApp(); + +private: + CTsRunningApp( MTsResourceManager& aResources, + const RWsSession::TWindowGroupChainInfo& aInfo ); + const CApaWindowGroupName& WindowGroupNameL() const; + +public://from MTsRunningApplication + TUid UidL()const; + const TDesC& CaptionL() const; + TBool IsHiddenL() const; + TBool IsSystemL() const; + TInt WindowGroupId() const; + TInt ParentWindowGroupId() const; + TBool IsEmbeded() const; + + +private: + MTsResourceManager& iResources; + const RWsSession::TWindowGroupChainInfo iWindowGroupInfo; + mutable CApaWindowGroupName* iWindowGroupName; + mutable TPtrC iCaption; +}; + +#endif//TSRUNNINGAPP_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsrunningappmodel.h --- a/taskswitcher/server/inc/tsrunningappmodel.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/inc/tsrunningappmodel.h Mon Oct 04 00:38:31 2010 +0300 @@ -25,6 +25,7 @@ class CTsDataList; class CTsScreenshotProvider; +class TsEnv; NONSHARABLE_CLASS(CTsRunningAppModel) : public CBase, public MTsModel, @@ -34,15 +35,18 @@ public: static CTsRunningAppModel *NewL( MTsResourceManager &aResources, - MTsWindowGroupsMonitor &aMonitor ); + MTsWindowGroupsMonitor &aMonitor, + TsEnv& aEnv ); static CTsRunningAppModel *NewLC( MTsResourceManager &aResources, - MTsWindowGroupsMonitor &aMonitor ); + MTsWindowGroupsMonitor &aMonitor, + TsEnv& aEnv ); ~CTsRunningAppModel(); private: CTsRunningAppModel( MTsResourceManager &aResources ); void ConstructL( MTsResourceManager &aResources, - MTsWindowGroupsMonitor &aMonitor ); + MTsWindowGroupsMonitor &aMonitor, + TsEnv& aEnv); // MHsDataObserver interface implementation public: @@ -65,6 +69,7 @@ virtual TTsModelItemKey KeyL( TInt aOffset ) const; virtual TBool IsActiveL( TInt aOffset ) const; virtual TBool IsClosableL( TInt aOffset ) const; + virtual TBool IsMandatoryL( TInt aOffset ) const; public: virtual TBool CloseL( TTsModelItemKey aKey ) const; diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsrunningappserver.h --- a/taskswitcher/server/inc/tsrunningappserver.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/inc/tsrunningappserver.h Mon Oct 04 00:38:31 2010 +0300 @@ -22,6 +22,7 @@ #include #include #include "tsdataobserver.h" +#include "tsenv.h" class CTsResourceManager; class CTsWindowGroupsMonitor; @@ -54,6 +55,7 @@ const CTsServiceProvider& aServiceProvider); private: + TsEnv iEnv; CTsResourceManager* iResources; CTsWindowGroupsMonitor* iMonitor; CTsSerializedDataProvider* iSerializer; diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsrunningappstorage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/server/inc/tsrunningappstorage.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,54 @@ +/* + * 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 : + * + */ +#ifndef TSREUNNINGAPPSTORAGE_H +#define TSREUNNINGAPPSTORAGE_H + +#include "tswindowgroupsobserver.h" + +class CTsRunningApp; + +class CTsRunningAppStorage: public CBase, + public MTsRunningApplicationStorage +{ +public: + static CTsRunningAppStorage* NewLC(); + ~CTsRunningAppStorage(); + void HandleWindowGroupChanged( + MTsResourceManager &aResources, + const TArray & aWindowGroups ); + void HandleWindowGroupChanged( + MTsResourceManager &aResources, + const TArray& aWindowGroups, + const TArray& aFilteredWindowGroups); +public: + const MTsRunningApplication& operator[] (TInt aOffset) const; + TInt Count() const; + TInt ParentIndex( const MTsRunningApplication& aRunningApp ) const; + TArray BlockedWindowGroups() const; + +private: + TInt ParentIndex( TInt aOffset ) const; + TInt Find(TInt aWindowGroupId, TInt aOffset =0) const; + +private: + CTsRunningAppStorage(); + +private: + RPointerArray iRunningApps; + RArray iBlockedWindowGroups; +}; +#endif//TSREUNNINGAPPSTORAGE_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsscreenshotprovider.h --- a/taskswitcher/server/inc/tsscreenshotprovider.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/inc/tsscreenshotprovider.h Mon Oct 04 00:38:31 2010 +0300 @@ -17,19 +17,33 @@ #ifndef TSSCREENSHOTPROVIDER_H #define TSSCREENSHOTPROVIDER_H #include "tsdatastorage.h" +#include "tswindowgroupsobserver.h" #include -class CTsScreenshotProvider: public CWsGraphic +class CTsScreenshotProvider: public CWsGraphic, + public MTsWindowGroupsObserver { public: - static CTsScreenshotProvider* NewL(MTsDataStorage&); + static CTsScreenshotProvider* NewL(MTsDataStorage&, MTsWindowGroupsMonitor&); + ~CTsScreenshotProvider(); + +public://from MTsWindowGroupsObserver + void HandleWindowGroupChanged( MTsResourceManager &aResources, + const MTsRunningApplicationStorage& aStorage ); + +public://from CWsGraphic + void HandleMessage(const TDesC8&); + private: - CTsScreenshotProvider(MTsDataStorage&); - void HandleMessage(const TDesC8&); + CTsScreenshotProvider(MTsDataStorage&, MTsWindowGroupsMonitor&); void HandleMessageL(const TDesC8&); + void HandleWindowGroupChangedL( MTsResourceManager &aResources, + const MTsRunningApplicationStorage& aStorage ); void OnReplace(); + private: MTsDataStorage& iStorage; + MTsWindowGroupsMonitor& iMonitor; }; #endif //TSSCREENSHOTTASK_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsservice.h --- a/taskswitcher/server/inc/tsservice.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/inc/tsservice.h Mon Oct 04 00:38:31 2010 +0300 @@ -48,6 +48,7 @@ TTsModelItemKey KeyL( TInt aOffset ) const; TBool IsActiveL( TInt aOffset ) const; TBool IsClosableL( TInt aOffset ) const; + TBool IsMandatoryL( TInt aOffset ) const; TBool CloseL( TTsModelItemKey aKey ) const; TBool LaunchL( TTsModelItemKey aKey ) const; diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsservicesproviderconfig.h --- a/taskswitcher/server/inc/tsservicesproviderconfig.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/inc/tsservicesproviderconfig.h Mon Oct 04 00:38:31 2010 +0300 @@ -22,16 +22,17 @@ class CTsServiceProviderConfig: public CBase { public: - static CTsServiceProviderConfig* NewLC(); + static CTsServiceProviderConfig* NewLC(QObject *aEnv); ~CTsServiceProviderConfig(); TInt Count() const; QObject* LoadL(TInt aOffset)const; private: - CTsServiceProviderConfig(); + CTsServiceProviderConfig(QObject* aEnv); void ConstructL(); private: + QObject* iEnv; RPointerArray iServices; }; diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tsstorage.h --- a/taskswitcher/server/inc/tsstorage.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/inc/tsstorage.h Mon Oct 04 00:38:31 2010 +0300 @@ -40,6 +40,7 @@ void ResetModelL(); void PullDataL(const MTsModel& aSrc); void ReorderDataL(); + void TrimDataL(); public://from MTsModelObserver void DataChanged(MTsModel& aModel); @@ -56,6 +57,7 @@ TTsModelItemKey KeyL( TInt aOffset ) const; TBool IsActiveL( TInt aOffset ) const; TBool IsClosableL( TInt aOffset ) const; + TBool IsMandatoryL( TInt aOffset ) const; TBool CloseL( TTsModelItemKey aKey ) const; TBool LaunchL( TTsModelItemKey aKey ) const; TTsModelItem FindL( TTsModelItemKey aKey ) const; diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/inc/tswindowgroupsmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/server/inc/tswindowgroupsmonitor.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,103 @@ +/* + * 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 : + * + */ +#ifndef TSWINDOWGROUPMONITOR_H +#define TSWINDOWGROUPMONITOR_H + +#include "tswindowgroupsobserver.h" + +/** + * Window server monitor implementation. + */ +class CTsWindowGroupsMonitor: public CActive, + public MTsWindowGroupsMonitor + +{ +public: + /** + * Two phase constructor + */ + static CTsWindowGroupsMonitor* NewL(MTsResourceManager &); + + /** + * Destructor + */ + ~CTsWindowGroupsMonitor(); + + /** + * @see MTsWindowGroupsMonitor::SubscribeL + */ + void SubscribeL(MTsWindowGroupsObserver &); + + /** + * @see MTsWindowGroupsMonitor::Cancel + */ + void Cancel(MTsWindowGroupsObserver &); + +protected: + /** + * @see CActive::RunL + */ + void RunL(); + + /** + * @see CActive::DoCancel + */ + void DoCancel(); + + /** + * @see CActive::RunError + */ + TInt RunError(TInt error); + +private: + /** + * First phase constructor + */ + CTsWindowGroupsMonitor(MTsResourceManager &); + + /** + * Second phase constructor + */ + void ConstructL(); + + /** + * Function subscribe for event to window server and activate object + */ + void Subscribe(); + + /** + * Function provide window server event to observers + */ + void ProvideEventL(); + +private: + /** + * Registry of subscribed observers + */ + RPointerArray iObservers; + + /** + * Resources manager + */ + MTsResourceManager &iResources; + + /** + * Monitor window group + */ + RWindowGroup iWg; +}; +#endif//TSWINDOWGROUPMONITOR_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/server.pro --- a/taskswitcher/server/server.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/server.pro Mon Oct 04 00:38:31 2010 +0300 @@ -29,7 +29,8 @@ ../utils/inc \ ../backstepping/inc \ -SOURCES += src/tsdataobservertask.cpp \ +SOURCES += src/tsenv.cpp \ + src/tsdataobservertask.cpp \ src/tsdataprovidertask.cpp \ src/tsrunningappserver.cpp \ src/tsrunningappsession.cpp \ @@ -48,17 +49,22 @@ src/tsservicesproviderconfig.cpp \ src/tsserviceobserver.cpp \ src/tsmodelitemkeymsg.cpp \ + src/tswindowgroupsmonitor.cpp \ + src/tsrunningapp.cpp \ + src/tsrunningappstorage.cpp \ ../utils/src/tsentrykey.cpp \ ../utils/src/tsentrykeygenerator.cpp \ ../utils/src/tsentry.cpp \ ../utils/src/tsscreenshotmsg.cpp \ ../utils/src/tsunregscreenshotmsg.cpp \ ../utils/src/tsvisibilitymsg.cpp \ - ../utils/src/tswindowgroupsmonitor.cpp \ ../utils/src/tswindowgroupsobserver.cpp \ ../utils/src/tsresourcemanager.cpp \ + ../utils/src/tsthumbnailprovider.cpp \ + ../utils/src/tsidlist.cpp \ -HEADERS += inc/tsdataobservertask.h \ +HEADERS += inc/tsenv.h \ + inc/tsdataobservertask.h \ inc/tsdataprovider.h \ inc/tsdataprovidertask.h \ inc/tsrunningappserver.h \ @@ -79,6 +85,9 @@ inc/tsservicesproviderconfig.h \ inc/tsserviceobserver.h \ inc/tsmodelitemkeymsg.h \ + inc/tswindowgroupsmonitor.h \ + inc/tsrunningapp.h \ + inc/tsrunningappstorage.h \ ../utils/inc/tsdataobserver.h \ ../utils/inc/tsentry.h \ ../utils/inc/tsentrykey.h \ @@ -89,6 +98,9 @@ ../utils/inc/tsvisibilitymsg.h \ ../utils/inc/tsresourcemanager.h \ ../utils/inc/tswindowgroupsobserver.h \ + ../utils/inc/tsthumbnailprovider.h \ + ../utils/inc/tsthumbnailobserver.h \ + ../utils/inc/tsidlist.h \ LIBS += -lxqutils \ -ltsbackstepping \ @@ -102,13 +114,6 @@ -lcaclient \ #for getApplicationIcon -lcone -# tsimageutils and its dependencies -LIBS += -ltsimageutils.lib \ - -lbitmaptransforms \ - -limageconversion \ - -lefsrv \ - - symbian { TARGET.UID3 = 0x200267B0 TARGET.CAPABILITY = All -TCB diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/main.cpp --- a/taskswitcher/server/src/main.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/src/main.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -26,35 +26,30 @@ int main(int argc, char *argv[]) { - QApplication app(argc, argv); - - // hide server from TaskSwitcher - CEikonEnv * env = CEikonEnv::Static(); - if(env) { + RSemaphore semaphore; + int errNo( semaphore.CreateGlobal(KTsServerReadySemaphore, 0) ); + if (KErrNone == errNo) { + QApplication app(argc, argv); + // maintain instance of caservice (needed for getting application icons) + QSharedPointer service = CaService::instance(); + TRAP(errNo, + // hide server from TaskSwitcher + CEikonEnv * env = CEikonEnv::Static(); + User::LeaveIfNull( env ); env->RootWin().SetOrdinalPosition(0, ECoeWinPriorityNeverAtFront); - - CApaWindowGroupName *wgName = CApaWindowGroupName::NewLC(env->WsSession()); + CApaWindowGroupName *wgName = CApaWindowGroupName::NewLC(env->WsSession()); wgName->SetHidden(ETrue); // hides us from FSW and protects us from OOM FW etc. - wgName->SetSystem(ETrue); // Allow only application with PowerManagement cap to shut us down - wgName->SetCaptionL(KRunningAppServerName); + wgName->SetSystem(ETrue); // Allow only application with PowerManagement cap to shut us down + wgName->SetCaptionL(KRunningAppServerName); wgName->SetWindowGroupName(env->RootWin()); CleanupStack::PopAndDestroy(wgName); + CServer2* serverObject = CTsRunningAppServer::NewLC(); + semaphore.Signal(); + QT_TRYCATCH_LEAVING(errNo = app.exec()); + User::LeaveIfError(errNo); + CleanupStack::PopAndDestroy(serverObject); + )//TRAP + semaphore.Close(); } - - // maintain instance of caservice (needed for getting application icons) - QSharedPointer service = CaService::instance(); - - CServer2* serverObject = CTsRunningAppServer::NewLC(); - CleanupStack::Pop(serverObject); - - RSemaphore semaphore; - if (KErrNone == semaphore.OpenGlobal(KTsServerReadySemaphore)) { - semaphore.Signal(); - } - semaphore.Close(); - - int result = app.exec(); - - delete serverObject; - return result; + return errNo; } diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tsdatalist.cpp --- a/taskswitcher/server/src/tsdatalist.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/src/tsdatalist.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -49,11 +49,13 @@ */ CTsDataList* CTsDataList::NewL( MTsResourceManager& aResources, MTsWindowGroupsMonitor& aMonitor, - MTsDataObserver& aObserver ) + MTsDataObserver& aObserver, + TsEnv& aEnv ) { CTsDataList* self = new (ELeave) CTsDataList( aResources, aMonitor, - aObserver ); + aObserver, + aEnv); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -66,11 +68,13 @@ */ CTsDataList::CTsDataList(MTsResourceManager& aResources, MTsWindowGroupsMonitor &aMonitor, - MTsDataObserver& aObserver ) + MTsDataObserver& aObserver, + TsEnv& aEnv) : CTsWindowGroupsObserver( aMonitor ), iResources( aResources ), - iObserver( aObserver ) + iObserver( aObserver ), + iEnv( aEnv ) { } @@ -120,13 +124,13 @@ * @see MTsWindowGroupsObserver HandleWindowGroupChanged */ void CTsDataList::HandleWindowGroupChanged( - MTsResourceManager &, - const TArray& aWgList) + MTsResourceManager &/*aResources*/, + const MTsRunningApplicationStorage& aStorage) { TRAP_IGNORE(RDebug::Print(_L("[TaskSwitcher] processing started")); RTsFswArray newAppsList; CleanupResetAndDestroyPushL(newAppsList); - CollectAppsL(newAppsList, aWgList); + CollectAppsL(newAppsList, aStorage); RDebug::Print(_L("[TaskSwitcher] gathered app info")); FitDataToListL(newAppsList); CleanupStack::PopAndDestroy(&newAppsList); @@ -140,39 +144,33 @@ * @param aAppsList array to add to */ void CTsDataList::CollectAppsL(RTsFswArray& aAppsList, - const TArray &aWgList) + const MTsRunningApplicationStorage& aStorage) { - for( TInt i(0); i < aWgList.Count(); ++i ) + for( TInt i(0); i < aStorage.Count(); ++i ) { TTsEntryKey key; - TInt err = TsEntryKeyGeneraror::Generate(key, aWgList[i].iId, aWgList); + TInt err = TsEntryKeyGeneraror::Generate( key, + aStorage[i].WindowGroupId(), + aStorage ); //skip this entry if it is already on list or generate key failed if( err!=KErrNone || FindEntry( aAppsList, key ) >= 0 ) { continue; } - // get window group name - CApaWindowGroupName* windowName = - CApaWindowGroupName::NewLC( iResources.WsSession(), - key.WindowGroupId() ); - TUid appUid = windowName->AppUid(); - - // get screen number (-1=console, 0=main screen, 1=cover ui) + // get screen number (-1=console, 0=main screen, 1=cover ui) TInt appScreen = 0; TInt scrNumErr = iResources.ApaSession().GetDefaultScreenNumber( appScreen, - appUid ); + aStorage[i].UidL() ); - if( appUid.iUid && - !windowName->Hidden() && + if( aStorage[i].UidL().iUid && + !aStorage[i].IsHiddenL() && (appScreen == 0 || appScreen == -1) && scrNumErr == KErrNone ) { - AddEntryL( key, appUid, windowName, aAppsList ); + AddEntryL( key, aStorage[i], aAppsList ); } - - CleanupStack::PopAndDestroy( windowName ); } } @@ -180,33 +178,28 @@ /** * Called from CollectTasksL for each entry in the task list. * @param aKey entry key - * @param aAppUid application uid - * @param aWgName window group name or NULL + * @param aRunningApp running application entry * @param aNewList list to add to */ void CTsDataList::AddEntryL( const TTsEntryKey& aKey, - const TUid& aAppUid, - CApaWindowGroupName* aWgName, + const MTsRunningApplication& aRunningApp, RTsFswArray& aNewList ) { - CTsEntry* entry = CTsEntry::NewLC( aKey, iObserver ); + CTsEntry* entry = CTsEntry::NewLC( aKey, iObserver, &iEnv ); // check if present in old list and if yes then take some of the old data TBool found = ConsiderOldDataL( aKey ); // if not present previously then find out app name // and check if screenshot is already available if( !found ) { - entry->SetAppUid(aAppUid); - HBufC* name = FindAppNameLC( aWgName, aAppUid, aKey.WindowGroupId() ); + entry->SetAppUid(aRunningApp.UidL()); + HBufC* name = FindAppNameLC( aRunningApp ); entry->SetAppNameL(*name); CleanupStack::PopAndDestroy( name ); //transfer ownership to entry - entry->SetAppIcon( GetAppIconL( aAppUid ) ); + entry->SetAppIcon( GetAppIconL( aRunningApp.UidL() ) ); } - if(aWgName) - { - entry->SetCloseableApp( !aWgName->IsSystem() ); - } + entry->SetCloseableApp( !aRunningApp.IsSystemL()); // add to new list, ownership is transferred aNewList.AppendL( entry ); CleanupStack::Pop( entry ); @@ -240,26 +233,24 @@ * @param aWgId window group id * @return application name, ownership transferred to caller */ -HBufC* CTsDataList::FindAppNameLC( CApaWindowGroupName* aWindowName, - const TUid& aAppUid, - TInt aWgId ) +HBufC* CTsDataList::FindAppNameLC( const MTsRunningApplication& aRunningApp ) { //Retrieve the app name TApaAppInfo info; - iResources.ApaSession().GetAppInfo( info, aAppUid ); + iResources.ApaSession().GetAppInfo( info, aRunningApp.UidL() ); TPtrC caption = info.iShortCaption; HBufC* tempName( 0 ); - if (!caption.Length() && aWindowName) // if not set - use thread name instead + if (!caption.Length() ) // if not set - use thread name instead { - if (aWindowName->Caption().Length()) + if( aRunningApp.CaptionL().Length() ) { - tempName = aWindowName->Caption().AllocLC(); + tempName = aRunningApp.CaptionL().AllocLC(); } else { TThreadId threadId; - if(KErrNone == iResources.WsSession().GetWindowGroupClientThreadId( aWgId, threadId ) ) + if(KErrNone == iResources.WsSession().GetWindowGroupClientThreadId( aRunningApp.WindowGroupId(), threadId ) ) { RThread thread; CleanupClosePushL( thread ); diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tsenv.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/server/src/tsenv.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,51 @@ +/* +* 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: +* +*/ +#include "tsenv.h" + +const int thumbnailWidth(128); +const int thumbnailHeight(128); + +void TsEnv::createThumbnail(const QPixmap& source, + int angle, + const void* userData) +{ + try { + QPixmap thumbnailSource; + const Qt::Axis rotationAxis(Qt::ZAxis); + if ( 270 <= angle ) { + thumbnailSource = source.transformed(QTransform().rotate(270.0f, + rotationAxis), + Qt::SmoothTransformation); + } else if( 180 <= angle ) { + thumbnailSource = source.transformed(QTransform().rotate(180.0f, + rotationAxis), + Qt::SmoothTransformation); + } else if( 90 <= angle ) { + thumbnailSource = source.transformed(QTransform().rotate(90.0f, + rotationAxis), + Qt::SmoothTransformation); + } else { + thumbnailSource = source; + } + const QRect expectedRect(0, 0, thumbnailWidth, thumbnailHeight); + const QPixmap thumbanail(thumbnailSource.scaled(expectedRect.size(), + Qt::KeepAspectRatioByExpanding, + Qt::SmoothTransformation)); + emit thumbnailCreated(thumbanail.copy(expectedRect), userData); + } catch (...) { + } +} diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tsmodelitem.cpp --- a/taskswitcher/server/src/tsmodelitem.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/src/tsmodelitem.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -145,6 +145,16 @@ // ----------------------------------------------------------------------------- /** + * @return EFalse if entry is not mandatory, other value in other cases + */ +TBool TTsModelItem::IsMandatoryL() const + { + ValidateL(); + return iModel.IsMandatoryL( iIndex ); + } + +// ----------------------------------------------------------------------------- +/** * Validate item instance */ void TTsModelItem::ValidateL() const diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tsrunningapp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/server/src/tsrunningapp.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,100 @@ +/* + * 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 : + * + */ + +#include +#include "tsrunningapp.h" + +//------------------------------------------------------------------------------ +CTsRunningApp* CTsRunningApp::NewLC( + MTsResourceManager& aResources, + const RWsSession::TWindowGroupChainInfo& aInfo ) + { + CTsRunningApp* self = new(ELeave) CTsRunningApp(aResources, aInfo); + CleanupStack::PushL( self ); + return self; + } + +//------------------------------------------------------------------------------ +CTsRunningApp::~CTsRunningApp() + { + delete iWindowGroupName; + } + +//------------------------------------------------------------------------------ +CTsRunningApp::CTsRunningApp( MTsResourceManager& aResources, + const RWsSession::TWindowGroupChainInfo& aInfo ) +: +iResources(aResources), +iWindowGroupInfo(aInfo) + { + //No implementation required + } + +//------------------------------------------------------------------------------ +const CApaWindowGroupName& CTsRunningApp::WindowGroupNameL() const + { + if( 0 == iWindowGroupName ) + { + iWindowGroupName = CApaWindowGroupName::NewL( iResources.WsSession(), + WindowGroupId() ); + } + return *iWindowGroupName; + } + +//------------------------------------------------------------------------------ +TUid CTsRunningApp::UidL()const + { + return WindowGroupNameL().AppUid(); + } + +//------------------------------------------------------------------------------ +const TDesC& CTsRunningApp::CaptionL() const + { + iCaption.Set(WindowGroupNameL().Caption()); + return iCaption; + + } + +//------------------------------------------------------------------------------ +TInt CTsRunningApp::WindowGroupId() const + { + return iWindowGroupInfo.iId; + } + +//------------------------------------------------------------------------------ +TInt CTsRunningApp::ParentWindowGroupId() const + { + return iWindowGroupInfo.iParentId; + } + +//------------------------------------------------------------------------------ +TBool CTsRunningApp::IsEmbeded() const + { + return 0 < iWindowGroupInfo.iParentId; + } + +//------------------------------------------------------------------------------ +TBool CTsRunningApp::IsHiddenL() const + { + return WindowGroupNameL().Hidden(); + } + +//------------------------------------------------------------------------------ +TBool CTsRunningApp::IsSystemL() const + { + return WindowGroupNameL().IsSystem(); + } diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tsrunningappmodel.cpp --- a/taskswitcher/server/src/tsrunningappmodel.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/src/tsrunningappmodel.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -15,30 +15,34 @@ * */ -#include "tsrunningappmodel.h" - #include #include #include +#include "tsrunningappmodel.h" + +#include "tsrunningappstorage.h" + #include "tsdatalist.h" #include "tsmodelobserver.h" #include "tsscreenshotprovider.h" CTsRunningAppModel *CTsRunningAppModel::NewL( MTsResourceManager& aResources, - MTsWindowGroupsMonitor& aMonitor ) + MTsWindowGroupsMonitor& aMonitor, + TsEnv& aEnv ) { - CTsRunningAppModel *self = CTsRunningAppModel::NewLC( aResources, aMonitor ); + CTsRunningAppModel *self = CTsRunningAppModel::NewLC( aResources, aMonitor, aEnv ); CleanupStack::Pop( self ); return self; } CTsRunningAppModel *CTsRunningAppModel::NewLC( MTsResourceManager& aResources, - MTsWindowGroupsMonitor& aMonitor ) + MTsWindowGroupsMonitor& aMonitor, + TsEnv& aEnv ) { CTsRunningAppModel *self = new (ELeave) CTsRunningAppModel( aResources ); CleanupStack::PushL( self ); - self->ConstructL( aResources, aMonitor ); + self->ConstructL( aResources, aMonitor, aEnv ); return self; } @@ -55,15 +59,19 @@ } void CTsRunningAppModel::ConstructL( MTsResourceManager& aResources, - MTsWindowGroupsMonitor& aMonitor ) + MTsWindowGroupsMonitor& aMonitor, + TsEnv& aEnv) { - iDataList = CTsDataList::NewL( aResources, aMonitor, *this ); - iScreenshotProvider = CTsScreenshotProvider::NewL( *iDataList ); - + iDataList = CTsDataList::NewL( aResources, aMonitor, *this, aEnv ); + iScreenshotProvider = CTsScreenshotProvider::NewL(*iDataList, aMonitor ); + RArray wgList; CleanupClosePushL( wgList ); User::LeaveIfError( aResources.WsSession().WindowGroupList( 0, &wgList ) ); - iDataList->HandleWindowGroupChanged( aResources, wgList.Array() ); + CTsRunningAppStorage* storage = CTsRunningAppStorage::NewLC(); + storage->HandleWindowGroupChanged(aResources, wgList.Array()); + iDataList->HandleWindowGroupChanged( aResources, *storage ); + CleanupStack::PopAndDestroy(storage); CleanupStack::PopAndDestroy( &wgList ); } @@ -148,6 +156,11 @@ return iDataList->Data()[aOffset]->CloseableApp(); } +TBool CTsRunningAppModel::IsMandatoryL( TInt /*aOffset*/ ) const + { + return ETrue; + } + TBool CTsRunningAppModel::CloseL( TTsModelItemKey aKey ) const { TApaTask task( iResources.WsSession() ); diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tsrunningappserver.cpp --- a/taskswitcher/server/src/tsrunningappserver.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/src/tsrunningappserver.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -19,7 +19,7 @@ #include "tsrunningappserver.h" #include "tsrunningappsession.h" #include "tsbacksteppingactivation.h" - +#include "tswindowgroupsmonitor.h" #include "tsmodel.h" #include "tsstorage.h" #include "tsservicesprovider.h" @@ -78,10 +78,10 @@ RPointerArray providers; CleanupClosePushL(providers); - iAppsModel = CTsRunningAppModel::NewL(*iResources, *iMonitor); + iAppsModel = CTsRunningAppModel::NewL(*iResources, *iMonitor, iEnv); providers.AppendL(iAppsModel); - CTsServiceProviderConfig *cfg = CTsServiceProviderConfig::NewLC(); + CTsServiceProviderConfig *cfg = CTsServiceProviderConfig::NewLC(&iEnv); iServiceProvider = CTsServiceProvider::NewL(*cfg); CleanupStack::PopAndDestroy(cfg); addProviders(providers, *iServiceProvider); diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tsrunningappstorage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/server/src/tsrunningappstorage.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,138 @@ +/* + * 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 : + * + */ +#include "tsrunningappstorage.h" +#include "tsrunningapp.h" +//------------------------------------------------------------------------------ +CTsRunningAppStorage* CTsRunningAppStorage::NewLC() + { + CTsRunningAppStorage* self = new(ELeave) CTsRunningAppStorage(); + CleanupStack::PushL( self ); + return self; + } + +//------------------------------------------------------------------------------ +CTsRunningAppStorage::CTsRunningAppStorage() + { + //No implementation required + } + +//------------------------------------------------------------------------------ +CTsRunningAppStorage::~CTsRunningAppStorage() +{ + iRunningApps.ResetAndDestroy(); +} + +//------------------------------------------------------------------------------ +void CTsRunningAppStorage::HandleWindowGroupChanged( + MTsResourceManager &aResources, + const TArray & aWindowGroups ) + { + CTsRunningApp* app(0); + iRunningApps.ResetAndDestroy(); + iBlockedWindowGroups.Reset(); + TRAP_IGNORE( + for( TInt iter(0); iter < aWindowGroups.Count(); ++iter ) + { + app = CTsRunningApp::NewLC(aResources, aWindowGroups[iter]); + iRunningApps.AppendL(app); + CleanupStack::Pop(app); + } + )//TRAP_IGNORE + } + +//------------------------------------------------------------------------------ +void CTsRunningAppStorage::HandleWindowGroupChanged( + MTsResourceManager &aResources, + const TArray& aFull, + const TArray& aFiltered) + { + TInt filtered(0); + HandleWindowGroupChanged(aResources, aFiltered); + for(TInt full(0); full < aFull.Count(); ++full) + { + for(filtered = 0; filtered < aFiltered.Count(); ++filtered) + { + if(aFull[full].iId == aFiltered[ filtered].iId) + { + break; + } + } + if(aFiltered.Count() == filtered) + { + iBlockedWindowGroups.Append(aFull[full].iId); + } + } + } +//------------------------------------------------------------------------------ +const MTsRunningApplication& CTsRunningAppStorage::operator[] (TInt aOffset) const + { + return *iRunningApps[aOffset]; + } + +//------------------------------------------------------------------------------ +TInt CTsRunningAppStorage::Count() const + { + return iRunningApps.Count(); + } + +//------------------------------------------------------------------------------ +TInt CTsRunningAppStorage::ParentIndex( const MTsRunningApplication& aRunningApp ) const + { + const TInt applicationIndex(Find(aRunningApp.WindowGroupId())); + return KErrNotFound == applicationIndex ? + applicationIndex : ParentIndex(applicationIndex); + } + +//------------------------------------------------------------------------------ +TArray CTsRunningAppStorage::BlockedWindowGroups() const + { + return iBlockedWindowGroups.Array(); + } + +//------------------------------------------------------------------------------ +TInt CTsRunningAppStorage::ParentIndex( TInt aOffset ) const + { + TInt retval(aOffset); + if(iRunningApps[aOffset]->IsEmbeded()) + { + const TInt parentIndex( Find(iRunningApps[aOffset]->ParentWindowGroupId(), + aOffset + 1) ); + if( KErrNotFound != parentIndex ) + { + retval = ParentIndex( parentIndex ); + } + } + return retval; + } + +//------------------------------------------------------------------------------ +TInt CTsRunningAppStorage::Find(TInt aWindowGroupId, TInt aOffset) const + { + TInt retVal(KErrNotFound); + for( TInt iter(aOffset); + KErrNotFound == retVal && iter < iRunningApps.Count(); + ++iter ) + { + if( iRunningApps[iter]->WindowGroupId() == aWindowGroupId ) + { + retVal = iter; + } + } + return retVal; + } + + diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tsscreenshotprovider.cpp --- a/taskswitcher/server/src/tsscreenshotprovider.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/src/tsscreenshotprovider.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -19,46 +19,104 @@ #include "tsscreenshotprovider.h" #include "tstaskmonitorglobals.h" #include "tsscreenshotmsg.h" +#include "tsidlist.h" const TUid KPluginUID = {0x200267AE}; +const TInt KSkippedApp [] = {0x20022F35 /* <-- hsapplication */}; // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -CTsScreenshotProvider* CTsScreenshotProvider::NewL( MTsDataStorage& aStorage ) +CTsScreenshotProvider* CTsScreenshotProvider::NewL( MTsDataStorage& aStorage, + MTsWindowGroupsMonitor& aMonitor) { - CTsScreenshotProvider *self = new (ELeave)CTsScreenshotProvider( aStorage ); + CTsScreenshotProvider *self = new (ELeave)CTsScreenshotProvider(aStorage, aMonitor); CleanupStack::PushL( self ); self->BaseConstructL(KPluginUID, KNullDesC8); + aMonitor.SubscribeL(*self); CleanupStack::Pop( self ); return self; } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CTsScreenshotProvider::CTsScreenshotProvider( MTsDataStorage& aStorage ) +CTsScreenshotProvider::CTsScreenshotProvider( MTsDataStorage& aStorage, + MTsWindowGroupsMonitor& aMonitor) : - iStorage(aStorage) + iStorage(aStorage), + iMonitor(aMonitor) { //No implementation required } +CTsScreenshotProvider::~CTsScreenshotProvider() + { + iMonitor.Cancel(*this); + } + // ----------------------------------------------------------------------------- -// +void CTsScreenshotProvider::HandleWindowGroupChanged( + MTsResourceManager &aResources, + const MTsRunningApplicationStorage& aStorage) + { + TRAP_IGNORE(HandleWindowGroupChangedL(aResources, aStorage);) + } + // ----------------------------------------------------------------------------- -// +/** + * Retrieve list of applications that shouldn't be displayed in taskswitcher + * and send it to module responsible for screenshot taking. + * Interface implementation. + * @see MTsWindowGroupsObserver::HandleWindowGroupChangedL + */ +void CTsScreenshotProvider::HandleWindowGroupChangedL( + MTsResourceManager& /*aResources*/, + const MTsRunningApplicationStorage& aStorage) + { + const TInt count(sizeof( KSkippedApp ) / sizeof(TInt)); + CTsIdList* list = CTsIdList::NewLC(); + list->AppendL(aStorage.BlockedWindowGroups());//filtered servers + for( TInt iter(0); iter < aStorage.Count(); ++iter ) + { + if(aStorage[iter].IsHiddenL()) + { + list->AppendL(aStorage[iter].WindowGroupId()); + } + else + { + for(TInt blocked(0); blocked < count; ++blocked) + { + if(aStorage[iter].UidL().iUid == KSkippedApp[blocked]) + { + list->AppendL(aStorage[iter].WindowGroupId()); + } + } + } + } + + RBuf8 message; + CleanupClosePushL(message); + message.CreateL(list->Size() + sizeof(TInt)); + + RDesWriteStream stream; + CleanupClosePushL(stream); + stream.Open(message); + stream.WriteInt32L(IgnoreWindowGroups); + stream << (*list); + CleanupStack::PopAndDestroy(&stream); + + SendMessage(message); + CleanupStack::PopAndDestroy(&message); + CleanupStack::PopAndDestroy(list); + } + +// ----------------------------------------------------------------------------- void CTsScreenshotProvider::HandleMessage( const TDesC8& aMsg ) { TRAP_IGNORE( HandleMessageL( aMsg ) ); } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// void CTsScreenshotProvider::HandleMessageL( const TDesC8& aMsg ) { RDesReadStream msgStream( aMsg ); @@ -78,7 +136,7 @@ //forward stream to storage iStorage.HandleDataL(msgStream.ReadInt32L(), msgStream); - CleanupStack::PopAndDestroy(screenshotMsg); + CleanupStack::PopAndDestroy(screenshotMsg); break; } @@ -93,9 +151,8 @@ break; } - default: User::Leave(KErrNotSupported); + default: User::Leave(KErrNotSupported); } - CleanupStack::PopAndDestroy(&msgStream); } diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tsservice.cpp --- a/taskswitcher/server/src/tsservice.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/src/tsservice.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -144,6 +144,12 @@ } // ----------------------------------------------------------------------------- +TBool CTsService::IsMandatoryL( TInt aOffset ) const + { + return IntValueL(aOffset, "TaskIsMandatory" ); + } + +// ----------------------------------------------------------------------------- TBool CTsService::CloseL( TTsModelItemKey aKey ) const { bool result(false); diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tsservicesproviderconfig.cpp --- a/taskswitcher/server/src/tsservicesproviderconfig.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/src/tsservicesproviderconfig.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -20,16 +20,18 @@ const char ServicesInterface [] = "com.nokia.qt.taskswitcher.dataprovider"; // ----------------------------------------------------------------------------- -CTsServiceProviderConfig* CTsServiceProviderConfig::NewLC() +CTsServiceProviderConfig* CTsServiceProviderConfig::NewLC(QObject* aEnv) { - CTsServiceProviderConfig *self = new (ELeave)CTsServiceProviderConfig(); + CTsServiceProviderConfig *self = new (ELeave)CTsServiceProviderConfig(aEnv); CleanupStack::PushL(self); self->ConstructL(); return self; } // ----------------------------------------------------------------------------- -CTsServiceProviderConfig::CTsServiceProviderConfig() +CTsServiceProviderConfig::CTsServiceProviderConfig(QObject* aEnv) +: + iEnv(aEnv) { //No implementation required } @@ -81,5 +83,15 @@ QTM_NAMESPACE::QServiceManager serviceManager; retVal = serviceManager.loadInterface(*service); ) User::LeaveIfNull( retVal ); + QObject::connect(retVal, + SIGNAL(createThumbnail(QPixmap,int,const void*)), + iEnv, + SLOT(createThumbnail(QPixmap,int,const void*))); + + QObject::connect(iEnv, + SIGNAL(thumbnailCreated(QPixmap, const void*)), + retVal, + SLOT(thumbnailCreated(QPixmap, const void*))); + return retVal; } diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tsstorage.cpp --- a/taskswitcher/server/src/tsstorage.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/server/src/tsstorage.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -17,6 +17,8 @@ #include #include "tsstorage.h" #include "tsmodelitemkeymsg.h" + +const TInt KTsDataLimit(10); // ----------------------------------------------------------------------------- /** * Two phase construction. Create and initialize storage instance. @@ -199,6 +201,16 @@ // ----------------------------------------------------------------------------- /** * Interface implementation + * @see MTsModel::IsMandatoryL(TInt) const + */ +TBool CTsStorage::IsMandatoryL( TInt aOffset ) const + { + return iData[aOffset].IsMandatoryL(); + } + +// ----------------------------------------------------------------------------- +/** + * Interface implementation * @see MTsModel::CloseL(TTsModelItemKey) */ TBool CTsStorage::CloseL( TTsModelItemKey aKey ) const @@ -282,7 +294,8 @@ for( TInt next(prev + 1); next < iData.Count(); ++next ) { const TTsModelItem prevItem(iData[prev]), nextItem(iData[next]); - if( prevItem.TimestampL() < nextItem.TimestampL() ) + if( ( !prevItem.IsMandatoryL() && nextItem.IsMandatoryL() ) || + ( prevItem.TimestampL() < nextItem.TimestampL() && prevItem.IsMandatoryL() == nextItem.IsMandatoryL() ) ) { iData.Remove(prev); iData.InsertL(nextItem, prev); @@ -292,4 +305,16 @@ } } } + TrimDataL(); } + +// ----------------------------------------------------------------------------- +void CTsStorage::TrimDataL() + { + const TInt lastItemOffset(iData.Count() -1); + if(KTsDataLimit <= lastItemOffset && !iData[lastItemOffset].IsMandatoryL()) + { + iData.Remove(lastItemOffset); + TrimDataL(); + } + } diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/server/src/tswindowgroupsmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/server/src/tswindowgroupsmonitor.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,181 @@ +/* + * 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 : + * + */ +#include +#include "tswindowgroupsobserver.h" +#include "tswindowgroupsmonitor.h" +#include "tsrunningappstorage.h" + + +const int KOrdinalPositionNoZOrder(-1); +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CTsWindowGroupsMonitor* CTsWindowGroupsMonitor::NewL(MTsResourceManager &resources) +{ + CTsWindowGroupsMonitor* self = new (ELeave) CTsWindowGroupsMonitor(resources); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CTsWindowGroupsMonitor::CTsWindowGroupsMonitor(MTsResourceManager &resources) +: + CActive(EPriorityStandard), + iResources(resources) +{ + CActiveScheduler::Add(this); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::ConstructL() +{ + + // Initial window group + iWg = RWindowGroup (iResources.WsSession()); + User::LeaveIfError (iWg.Construct ((TUint32)&iWg, EFalse)); + iWg.SetOrdinalPosition (KOrdinalPositionNoZOrder); + iWg.EnableReceiptOfFocus (EFalse); + + // Hide window + CApaWindowGroupName* wn = CApaWindowGroupName::NewLC(iResources.WsSession()); + wn->SetHidden (ETrue); + wn->SetWindowGroupName (iWg); + CleanupStack::PopAndDestroy (wn); + + // Window group change event + User::LeaveIfError (iWg.EnableGroupListChangeEvents()); + Subscribe(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CTsWindowGroupsMonitor::~CTsWindowGroupsMonitor() +{ + CActive::Cancel(); + iWg.Close(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::SubscribeL(MTsWindowGroupsObserver &observer) +{ + const TInt offset(iObservers.Find(&observer)); + KErrNotFound == offset ? iObservers.InsertL(&observer, 0) : + User::Leave(KErrAlreadyExists); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::Cancel(MTsWindowGroupsObserver & observer) +{ + const TInt offset(iObservers.Find(&observer)); + if (KErrNotFound != offset) { + iObservers.Remove(offset); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::RunL() +{ + User::LeaveIfError(iStatus.Int()); + ProvideEventL(); + Subscribe(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::DoCancel() +{ + if (IsActive()) { + iResources.WsSession().EventReadyCancel(); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTsWindowGroupsMonitor::RunError(TInt error) +{ + if (!IsActive() && KErrCancel != error) { + Subscribe(); + } + return KErrNone; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::Subscribe() +{ + iResources.WsSession().EventReady( &iStatus ); + SetActive(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::ProvideEventL() +{ + TWsEvent wsEvent; + iResources.WsSession().GetEvent(wsEvent); + if( EEventWindowGroupListChanged == wsEvent.Type() ) + { + + CTsRunningAppStorage *storage = CTsRunningAppStorage::NewLC(); + + RArray filteredWgInfo, fullWgInfo; + CleanupClosePushL(filteredWgInfo); + CleanupClosePushL(fullWgInfo); + User::LeaveIfError(iResources.WsSession().WindowGroupList(0, &filteredWgInfo)); + User::LeaveIfError(iResources.WsSession().WindowGroupList(&fullWgInfo)); + storage->HandleWindowGroupChanged(iResources, + fullWgInfo.Array(), + filteredWgInfo.Array()); + CleanupStack::PopAndDestroy( &fullWgInfo ); + CleanupStack::PopAndDestroy( &filteredWgInfo ); + + for( TInt iter(0); iter < iObservers.Count(); ++iter ) + { + iObservers[iter]->HandleWindowGroupChanged( iResources, *storage ); + } + CleanupStack::PopAndDestroy( storage ); + + } +} diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/sis/stubs/taskmonitor_stub.pkg --- a/taskswitcher/sis/stubs/taskmonitor_stub.pkg Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/sis/stubs/taskmonitor_stub.pkg Mon Oct 04 00:38:31 2010 +0300 @@ -36,4 +36,8 @@ "" - "Z:\sys\bin\hsrunningappmonitor.exe" "" - "Z:\sys\bin\tsscreenshotplugin.dll" "" - "Z:\resource\plugins\tsscreenshotplugin.rsc" -"" - "Z:\sys\bin\tsbackstepping.dll" \ No newline at end of file +"" - "Z:\sys\bin\tsbackstepping.dll" + +"" - "Z:\sys\bin\activitytsplugin.dll" +"" - "Z:\resource\qt\plugins\activitytsplugin.qtplugin" +"" - "Z:\resource\taskswitcher\activitytsplugin.xml" diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/sis/stubs/taskmonitor_stub.sis Binary file taskswitcher/sis/stubs/taskmonitor_stub.sis has changed diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/sis/taskmonitor.pkg --- a/taskswitcher/sis/taskmonitor.pkg Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/sis/taskmonitor.pkg Mon Oct 04 00:38:31 2010 +0300 @@ -32,3 +32,7 @@ "/epoc32/release/armv5/urel/tsscreenshotplugin.dll"-"!:\sys\bin\tsscreenshotplugin.dll" "/epoc32/data/z/resource/plugins/tsscreenshotplugin.rsc"-"!:\resource\plugins\tsscreenshotplugin.rsc" "/epoc32/release/armv5/urel/tsbackstepping.dll"-"!:\sys\bin\tsbackstepping.dll" + +"/epoc32/release/armv5/urel/activitytsplugin.dll" - "!:\sys\bin\activitytsplugin.dll" +"/epoc32/data/z/resource/qt/plugins/activitytsplugin.qtplugin" - "!:\resource\qt\plugins\activitytsplugin.qtplugin" +"/epoc32/data/z/resource/taskswitcher/activitytsplugin.xml" - "!:\resource\taskswitcher\activitytsplugin.xml" diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/taskswitcher.pro --- a/taskswitcher/taskswitcher.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/taskswitcher.pro Mon Oct 04 00:38:31 2010 +0300 @@ -21,7 +21,8 @@ symbian { SUBDIRS += backstepping \ server \ - screenshotplugin + screenshotplugin \ + activitytsplugin \ BLD_INF_RULES.prj_exports += "inc/tstaskmonitorglobals.h |../inc/tstaskmonitorglobals.h" diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/utils/inc/tsentry.h --- a/taskswitcher/utils/inc/tsentry.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/utils/inc/tsentry.h Mon Oct 04 00:38:31 2010 +0300 @@ -20,14 +20,18 @@ #include #include -#include #include "tsentrykey.h" #include "tstaskmonitorglobals.h" +#include "tsthumbnailobserver.h" class CTsEntry; class CFbsBitmap; +class QObject; class MTsDataObserver; +class TsThumbnailProvider; + + typedef RPointerArray RTsFswArray; @@ -35,11 +39,11 @@ * An entry in the task list. */ NONSHARABLE_CLASS( CTsEntry ) : public CBase, - private MImageReadyCallBack + private MTsThumbnailObserver { public: - static CTsEntry *NewL(const TTsEntryKey &key, MTsDataObserver &observer); - static CTsEntry *NewLC(const TTsEntryKey &key, MTsDataObserver &observer); + static CTsEntry *NewL(const TTsEntryKey &key, MTsDataObserver &observer, QObject* obj); + static CTsEntry *NewLC(const TTsEntryKey &key, MTsDataObserver &observer, QObject* obj); ~CTsEntry(); public: @@ -64,10 +68,10 @@ void RefreshUpdateTimestamp(); private: - CTsEntry(const TTsEntryKey &aKey, MTsDataObserver &observer); - -public: // from MImageReadyCallBack - void ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap); + CTsEntry(const TTsEntryKey &aKey, MTsDataObserver &observer); + void ConstructL(QObject* object); +public: + void thumbnailCreated(const CFbsBitmap& aThumbnail); private: TUid mAppUid; @@ -80,13 +84,10 @@ UpdatePriority mPriority; TTime mTimestamp; TTime mUpdateTimestamp; - -private: - CTsGraphicFileScalingHandler *mImgTool; + TsThumbnailProvider* iProvider; +private: + MTsDataObserver &mObserver; -private: - MTsDataObserver &mObserver; - }; #endif diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/utils/inc/tsentrykeygenerator.h --- a/taskswitcher/utils/inc/tsentrykeygenerator.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/utils/inc/tsentrykeygenerator.h Mon Oct 04 00:38:31 2010 +0300 @@ -24,13 +24,18 @@ #include #include "tsentrykey.h" +#include "tswindowgroupsobserver.h" class TsEntryKeyGeneraror { public: - static TInt Generate(TTsEntryKey& returnKey, TInt windowGroupId, - const TArray& groupChain); + static TInt Generate( TTsEntryKey& aReturnKey, + TInt aWindowGroupId, + const MTsRunningApplicationStorage& aStorage ); + static TInt Generate(TTsEntryKey& returnKey, + TInt windowGroupId, + const TArray& groupChain); }; #endif //TSENTRYKEYGENERATOR_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/utils/inc/tsidlist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/utils/inc/tsidlist.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,46 @@ +/* +* 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: +* +*/ + +#ifndef TSIDLIST_H +#define TSIDLIST_H +#include +#include +NONSHARABLE_CLASS(CTsIdList) : public CBase + { +public: + static CTsIdList* NewLC(); + static CTsIdList* NewL(); + static CTsIdList* NewLC(RReadStream& aStream); + ~CTsIdList(); + TBool IsPresent( TInt aId ) const; + void AppendL(const TInt aArray[], TInt aSize ); + void AppendL(const TArray& aArray); + void AppendL(TInt aId); + void Reset(); + TInt Size() const; + void ExternalizeL(RWriteStream &aStream) const; + void InternalizeL(RReadStream &aStream); + +private: + CTsIdList(); + + +private: + RArray iIds; + + }; +#endif // TSIDLIST_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/utils/inc/tsthumbnailobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/utils/inc/tsthumbnailobserver.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,28 @@ +/* +* 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". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Task list entry +* +*/ + +#ifndef TSTHUMBNAILOBSERVER_H +#define TSTHUMBNAILOBSERVER_H + +class CFbsBitmap; +class MTsThumbnailObserver +{ +public: + virtual void thumbnailCreated(const CFbsBitmap& aThumbnail) =0; + +}; +#endif //TSTHUMBNAILOBSERVER_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/utils/inc/tsthumbnailprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/utils/inc/tsthumbnailprovider.h Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,44 @@ +/* +* 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". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Task list entry +* +*/ + +#ifndef TSTHUMBNAILPROVIDER_H +#define TSTHUMBNAILPROVIDER_H +#include +#include +#include "tsthumbnailobserver.h" + +class TsThumbnailProvider: public QObject +{ + Q_OBJECT + +public: + TsThumbnailProvider(MTsThumbnailObserver& observer, QObject* obj); + void createThumbnail(CFbsBitmap& source, + int angle =0); +signals: + void createThumbnail(QPixmap source, + int angle, + const void* userData); +public slots: + void thumbnailCreated(const QPixmap& thumbnail, + const void *userData); +private: + MTsThumbnailObserver& mObserver; + +}; + +#endif //TSTHUMBNAILPROVIDER_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/utils/inc/tswindowgroupsobserver.h --- a/taskswitcher/utils/inc/tswindowgroupsobserver.h Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/utils/inc/tswindowgroupsobserver.h Mon Oct 04 00:38:31 2010 +0300 @@ -19,6 +19,30 @@ #include "tsresourcemanager.h" +class MTsRunningApplication + { +public: + virtual TUid UidL()const =0; + virtual const TDesC& CaptionL() const =0; + virtual TBool IsHiddenL() const =0; + virtual TBool IsSystemL() const =0; + virtual TInt WindowGroupId() const =0; + virtual TInt ParentWindowGroupId() const =0; + virtual TBool IsEmbeded() const =0; + + + }; + +class MTsRunningApplicationStorage + { +public: + virtual const MTsRunningApplication& operator[] (TInt aOffset) const=0; + virtual TInt Count() const =0; + virtual TInt ParentIndex( const MTsRunningApplication& aRaunningApp ) const =0; + virtual TArray BlockedWindowGroups() const =0; + + }; + /** * Interface declare mathods to notify about window server events */ @@ -26,12 +50,12 @@ { public: /** - * Method notidy about window group changes. - * @param rsc - resource manager - * @param wgs - list of window groups associated with running applications + * Method notify about window group changes. + * @param aResources - resource manager + * @param aStorage - list of running applications */ - virtual void HandleWindowGroupChanged(MTsResourceManager &rsc, - const TArray & wgs) =0; + virtual void HandleWindowGroupChanged(MTsResourceManager &aResources, + const MTsRunningApplicationStorage& aStorage) =0; }; /** @@ -84,90 +108,4 @@ MTsWindowGroupsMonitor & mMonitor; }; -/** - * Window server monitor implementation. - */ -class CTsWindowGroupsMonitor: public CActive, - public MTsWindowGroupsMonitor - -{ -public: - /** - * Two phase constructor - */ - static CTsWindowGroupsMonitor* NewL(MTsResourceManager &); - - /** - * Destructor - */ - ~CTsWindowGroupsMonitor(); - - /** - * @see MTsWindowGroupsMonitor::SubscribeL - */ - void SubscribeL(MTsWindowGroupsObserver &); - - /** - * @see MTsWindowGroupsMonitor::Cancel - */ - void Cancel(MTsWindowGroupsObserver &); - -protected: - /** - * @see CActive::RunL - */ - void RunL(); - - /** - * @see CActive::DoCancel - */ - void DoCancel(); - - /** - * @see CActive::RunError - */ - TInt RunError(TInt error); - -private: - /** - * First phase constructor - */ - CTsWindowGroupsMonitor(MTsResourceManager &); - - /** - * Second phase constructor - */ - void ConstructL(); - - /** - * Function subscribe for event to window server and activate object - */ - void Subscribe(); - - /** - * Function provide window server event to observers - */ - void ProvideEventL(); - - /** - * Function provide window server event to observer - */ - void ProvideEventL(TWsEvent, MTsWindowGroupsObserver &); - -private: - /** - * Registry of subscribed observers - */ - RPointerArray mObservers; - - /** - * Resources manager - */ - MTsResourceManager &mResources; - - /** - * Monitor window group - */ - RWindowGroup mWg; -}; #endif //TSWINDOWGROUPSOBSERVER_H diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/utils/src/tsentry.cpp --- a/taskswitcher/utils/src/tsentry.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/utils/src/tsentry.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -16,18 +16,21 @@ */ #define __E32SVR_H__ + #include #include + #include "tsentry.h" #include "tsdataobserver.h" +#include "tsthumbnailprovider.h" // -------------------------------------------------------------------------- // CTsFswEntry::NewL // -------------------------------------------------------------------------- // -CTsEntry* CTsEntry::NewL(const TTsEntryKey &key, MTsDataObserver &observer) +CTsEntry* CTsEntry::NewL(const TTsEntryKey &key, MTsDataObserver &observer, QObject* obj) { - CTsEntry* self = NewLC(key, observer); + CTsEntry* self = NewLC(key, observer, obj); CleanupStack::Pop(self); return self; } @@ -36,10 +39,11 @@ // CTsFswEntry::NewLC // -------------------------------------------------------------------------- // -CTsEntry* CTsEntry::NewLC(const TTsEntryKey &key, MTsDataObserver &observer) +CTsEntry* CTsEntry::NewLC(const TTsEntryKey &key, MTsDataObserver &observer, QObject* obj) { CTsEntry* self = new (ELeave) CTsEntry(key, observer); CleanupStack::PushL(self); + self->ConstructL(obj); return self; } @@ -52,7 +56,7 @@ delete mAppName; delete mAppIconBitmap; delete mScreenshot; - delete mImgTool; + delete iProvider; } // -------------------------------------------------------------------------- @@ -70,6 +74,15 @@ } // -------------------------------------------------------------------------- +void CTsEntry::ConstructL(QObject* object) +{ + QT_TRYCATCH_LEAVING( + iProvider = new TsThumbnailProvider(*this, object); + ) + +} + +// -------------------------------------------------------------------------- // CTsFswEntry::SetAppUid // -------------------------------------------------------------------------- // @@ -222,11 +235,7 @@ mScreenshot = bitmap; RefreshUpdateTimestamp(); - delete mImgTool; - mImgTool = 0; - - mImgTool = CTsGraphicFileScalingHandler::NewL(*this, *mScreenshot, TSize(128, 128), - CTsGraphicFileScalingHandler::EKeepAspectRatioByExpanding, angle); + iProvider->createThumbnail( *mScreenshot, angle); } // -------------------------------------------------------------------------- @@ -256,17 +265,15 @@ } // -------------------------------------------------------------------------- -// CTsFswEntry::Priority +// CTsFswEntry::thumbnailCreated // -------------------------------------------------------------------------- // -void CTsEntry::ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap) +void CTsEntry::thumbnailCreated(const CFbsBitmap& aThumbnail) { - if (KErrNone == error && 0 != bitmap) { - mScreenshot->Reset(); - mScreenshot->Duplicate(bitmap->Handle()); - RefreshUpdateTimestamp(); - mObserver.DataChanged(); - } + mScreenshot->Reset(); + mScreenshot->Duplicate(aThumbnail.Handle()); + RefreshUpdateTimestamp(); + mObserver.DataChanged(); } // end of file diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/utils/src/tsentrykeygenerator.cpp --- a/taskswitcher/utils/src/tsentrykeygenerator.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/taskswitcher/utils/src/tsentrykeygenerator.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -20,6 +20,32 @@ // // ----------------------------------------------------------------------------- // +TInt TsEntryKeyGeneraror::Generate( TTsEntryKey& aReturnKey, + TInt aWindowGroupId, + const MTsRunningApplicationStorage& aStorage) +{ + for (TInt iter(0); iter < aStorage.Count(); ++iter) { + if (aStorage[iter].WindowGroupId() == aWindowGroupId) { + aReturnKey = TTsEntryKey( aWindowGroupId ); + if (aStorage[iter].WindowGroupId() == aStorage[iter].ParentWindowGroupId()) + { + return KErrBadHandle; + } + else if ( aStorage[iter].IsEmbeded() ) + { + return TsEntryKeyGeneraror::Generate(aReturnKey, aStorage[iter].ParentWindowGroupId(), aStorage); + + } + else + { + return KErrNone; + } + } + } + return KErrNotFound; +} + +// ----------------------------------------------------------------------------- TInt TsEntryKeyGeneraror::Generate(TTsEntryKey& returnKey, TInt windowGroupId, const TArray& groupChain) { @@ -39,4 +65,3 @@ } return KErrNotFound; } - diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/utils/src/tsidlist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/utils/src/tsidlist.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,120 @@ +/* +* 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: +* +*/ +#include "tsidlist.h" + +//------------------------------------------------------------------------------ +CTsIdList* CTsIdList::NewLC() + { + CTsIdList* self = new(ELeave)CTsIdList(); + CleanupStack::PushL( self ); + return self; + } + +//------------------------------------------------------------------------------ +CTsIdList* CTsIdList::NewL() + { + CTsIdList* self = CTsIdList::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +//------------------------------------------------------------------------------ +CTsIdList* CTsIdList::NewLC(RReadStream& aStream) + { + CTsIdList* self = CTsIdList::NewLC(); + aStream >> (*self); + return self; + } + +//------------------------------------------------------------------------------ +CTsIdList::CTsIdList() + { + //No implementation required + } + +//------------------------------------------------------------------------------ +CTsIdList::~CTsIdList() + { + iIds.Reset(); + } + +//------------------------------------------------------------------------------ +TBool CTsIdList::IsPresent( TInt aId ) const + { + return KErrNotFound != iIds.Find(aId); + } + +//------------------------------------------------------------------------------ +void CTsIdList::AppendL(const TInt aArray[], TInt aSize ) + { + for( TInt iter(0); iter < aSize; ++iter ) + { + AppendL( aArray[iter] ); + } + } + +//------------------------------------------------------------------------------ +void CTsIdList::AppendL(const TArray& aArray) + { + for( TInt iter(0); iter < aArray.Count(); ++iter ) + { + AppendL( aArray[iter] ); + } + } + +//------------------------------------------------------------------------------ +void CTsIdList::AppendL(TInt aId) + { + if( !IsPresent( aId ) ) + { + iIds.AppendL( aId ); + } + } + +//------------------------------------------------------------------------------ +void CTsIdList::Reset() + { + iIds.Reset(); + } + +//------------------------------------------------------------------------------ +TInt CTsIdList::Size() const + { + return ( iIds.Count() + 1 ) * sizeof( TInt ); + } + +//------------------------------------------------------------------------------ +void CTsIdList::ExternalizeL(RWriteStream &aStream) const + { + aStream.WriteInt32L(iIds.Count()); + for( TInt iter(0); iter < iIds.Count(); ++iter ) + { + aStream.WriteInt32L(iIds[iter]); + } + } + +//------------------------------------------------------------------------------ +void CTsIdList::InternalizeL(RReadStream &aStream) + { + Reset(); + const TInt count( aStream.ReadInt32L()); + for( TInt iter(0); iter < count; ++iter ) + { + AppendL( aStream.ReadInt32L() ); + } + } + diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/utils/src/tsthumbnailprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/utils/src/tsthumbnailprovider.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,54 @@ +/* +* 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". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Task list entry +* +*/ +#include +#include "tsthumbnailprovider.h" +//------------------------------------------------------------------------------ +TsThumbnailProvider::TsThumbnailProvider(MTsThumbnailObserver& observer, QObject* obj) +: + mObserver(observer) +{ + connect(this, + SIGNAL(createThumbnail(QPixmap,int,const void*)), + obj, + SLOT(createThumbnail(QPixmap,int,const void*))); + + connect(obj, + SIGNAL(thumbnailCreated(QPixmap, const void*)), + this, + SLOT(thumbnailCreated(QPixmap, const void*))); +} +//------------------------------------------------------------------------------ +void TsThumbnailProvider::createThumbnail(CFbsBitmap& source, int angle) +{ + emit createThumbnail(QPixmap::fromSymbianCFbsBitmap(&source), + angle, + this); +} + +//------------------------------------------------------------------------------ +void TsThumbnailProvider::thumbnailCreated(const QPixmap& thumbnail, + const void *userData) +{ + if (this != userData) { + return; + } + CFbsBitmap *bitmap(thumbnail.toSymbianCFbsBitmap()); + if(0 != bitmap) { + mObserver.thumbnailCreated(*bitmap); + } + delete bitmap; +} diff -r 0b3699f6c654 -r e36b2f4799c0 taskswitcher/utils/src/tswindowgroupsmonitor.cpp --- a/taskswitcher/utils/src/tswindowgroupsmonitor.cpp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +0,0 @@ -/* - * 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 : - * - */ -#include "tswindowgroupsobserver.h" -#include - -const int KOrdinalPositionNoZOrder(-1); -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CTsWindowGroupsMonitor* CTsWindowGroupsMonitor::NewL(MTsResourceManager &resources) -{ - CTsWindowGroupsMonitor* self = new (ELeave) CTsWindowGroupsMonitor(resources); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CTsWindowGroupsMonitor::CTsWindowGroupsMonitor(MTsResourceManager &resources) -: - CActive(EPriorityStandard), - mResources(resources) -{ - CActiveScheduler::Add(this); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CTsWindowGroupsMonitor::ConstructL() -{ - - // Initial window group - mWg = RWindowGroup (mResources.WsSession()); - User::LeaveIfError (mWg.Construct ((TUint32)&mWg, EFalse)); - mWg.SetOrdinalPosition (KOrdinalPositionNoZOrder); - mWg.EnableReceiptOfFocus (EFalse); - - // Hide window - CApaWindowGroupName* wn = CApaWindowGroupName::NewLC(mResources.WsSession()); - wn->SetHidden (ETrue); - wn->SetWindowGroupName (mWg); - CleanupStack::PopAndDestroy (wn); - - // Window group change event - User::LeaveIfError (mWg.EnableGroupListChangeEvents()); - Subscribe(); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CTsWindowGroupsMonitor::~CTsWindowGroupsMonitor() -{ - CActive::Cancel(); - mWg.Close(); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CTsWindowGroupsMonitor::SubscribeL(MTsWindowGroupsObserver &observer) -{ - const TInt offset(mObservers.Find(&observer)); - KErrNotFound == offset ? mObservers.InsertL(&observer, 0) : - User::Leave(KErrAlreadyExists); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CTsWindowGroupsMonitor::Cancel(MTsWindowGroupsObserver & observer) -{ - const TInt offset(mObservers.Find(&observer)); - if (KErrNotFound != offset) { - mObservers.Remove(offset); - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CTsWindowGroupsMonitor::RunL() -{ - User::LeaveIfError(iStatus.Int()); - ProvideEventL(); - Subscribe(); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CTsWindowGroupsMonitor::DoCancel() -{ - if (IsActive()) { - mResources.WsSession().EventReadyCancel(); - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CTsWindowGroupsMonitor::RunError(TInt error) -{ - if (!IsActive() && KErrCancel != error) { - Subscribe(); - } - return KErrNone; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CTsWindowGroupsMonitor::Subscribe() -{ - mResources.WsSession().EventReady( &iStatus ); - SetActive(); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CTsWindowGroupsMonitor::ProvideEventL() -{ - TWsEvent wsEvent; - mResources.WsSession().GetEvent(wsEvent); - for (TInt iter(0); iter < mObservers.Count(); ++iter) { - ProvideEventL(wsEvent, *mObservers[iter]); - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CTsWindowGroupsMonitor::ProvideEventL(TWsEvent event, - MTsWindowGroupsObserver &observer) -{ - RArray wgInfo; - CleanupClosePushL(wgInfo); - switch(event.Type()) { - case EEventWindowGroupListChanged: - User::LeaveIfError(mResources.WsSession().WindowGroupList(0, &wgInfo)); - observer.HandleWindowGroupChanged(mResources, wgInfo.Array()); - break; - } - CleanupStack::PopAndDestroy(&wgInfo); -} diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/rom.pri --- a/tsdevicedialog/rom.pri Fri Sep 17 08:32:18 2010 +0300 +++ b/tsdevicedialog/rom.pri Mon Oct 04 00:38:31 2010 +0300 @@ -15,7 +15,7 @@ # BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " -BLD_INF_RULES.prj_exports += "rom/tsapplication_core.iby CORE_APP_LAYER_IBY_EXPORT_PATH(tsapplication_core.iby)" -BLD_INF_RULES.prj_exports += "rom/tsapplication_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(tsapplication_resources.iby)" +BLD_INF_RULES.prj_exports += "rom/tsdevicedialog_core.iby CORE_APP_LAYER_IBY_EXPORT_PATH(tsdevicedialog_core.iby)" +BLD_INF_RULES.prj_exports += "rom/tsdevicedialog_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(tsdevicedialog_resources.iby)" BLD_INF_RULES.prj_exports += "./sis/stubs/taskswitcher_stub.sis /epoc32/release/winscw/udeb/z/system/install/taskswitcher_stub.sis" BLD_INF_RULES.prj_exports += "./sis/stubs/taskswitcher_stub.sis /epoc32/data/z/system/install/taskswitcher_stub.sis" \ No newline at end of file diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/rom/tsapplication_core.iby --- a/tsdevicedialog/rom/tsapplication_core.iby Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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: -* -*/ -#ifndef __TSAPP_CORE_IBY__ -#define __TSAPP_CORE_IBY__ - -file=ABI_DIR\BUILD_DIR\tsdevicedialogplugin.dll SHARED_LIB_DIR\tsdevicedialogplugin.dll -data=\epoc32\data\z\resource\plugins\devicedialogs\tsdevicedialogplugin.qtplugin resource\plugins\devicedialogs\tsdevicedialogplugin.qtplugin - -// stub sis -data=ZSYSTEM/install/taskswitcher_stub.sis system/install/taskswitcher_stub.sis - -// qcrml -data=\epoc32\data\z\resource\qt\crml\tsdevicedialog.qcrml resource\qt\crml\tsdevicedialog.qcrml - -#endif //__TSAPP_CORE_IBY__ diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/rom/tsapplication_resources.iby --- a/tsdevicedialog/rom/tsapplication_resources.iby Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* -* 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: -* -*/ -#ifndef __TSAPP_LANGUAGE_IBY__ -#define __TSAPP_LANGUAGE_IBY__ - -// -------- hsapplication -data=DATAZ_\resource\qt\translations\taskswitcher.qm resource\qt\translations\taskswitcher.qm - -#endif //__TSAPP_LANGUAGE_IBY__ diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/rom/tsdevicedialog_core.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsdevicedialog/rom/tsdevicedialog_core.iby Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,29 @@ +/* +* 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: +* +*/ +#ifndef __TSDEVICEDIALOG_CORE_IBY__ +#define __TSDEVICEDIALOG_CORE_IBY__ + +file=ABI_DIR\BUILD_DIR\tsdevicedialogplugin.dll SHARED_LIB_DIR\tsdevicedialogplugin.dll +data=\epoc32\data\z\resource\plugins\devicedialogs\tsdevicedialogplugin.qtplugin resource\plugins\devicedialogs\tsdevicedialogplugin.qtplugin + +// stub sis +data=ZSYSTEM/install/taskswitcher_stub.sis system/install/taskswitcher_stub.sis + +// qcrml +data=\epoc32\data\z\resource\qt\crml\tsdevicedialog.qcrml resource\qt\crml\tsdevicedialog.qcrml + +#endif //__TSAPP_CORE_IBY__ diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/rom/tsdevicedialog_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsdevicedialog/rom/tsdevicedialog_resources.iby Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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: +* +*/ +#ifndef __TSDEVICEDIALOG_LANGUAGE_IBY__ +#define __TSDEVICEDIALOG_LANGUAGE_IBY__ + +// -------- hsapplication +data=DATAZ_\resource\qt\translations\taskswitcher.qm resource\qt\translations\taskswitcher.qm + +#endif //__TSAPP_LANGUAGE_IBY__ diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialog.pro --- a/tsdevicedialog/tsdevicedialog.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/tsdevicedialog/tsdevicedialog.pro Mon Oct 04 00:38:31 2010 +0300 @@ -18,7 +18,6 @@ coverage { SUBDIRS += ../homescreensrv_plat - SUBDIRS += ../utils SUBDIRS += ../activityfw SUBDIRS += ../hsappkeyhandler SUBDIRS += ../taskswitcher @@ -38,7 +37,6 @@ SUBDIRS += ../taskswitcher/client/tsrc SUBDIRS += ../taskswitcher/server/tsrc SUBDIRS += ../taskswitcher/screenshotplugin/tsrc - SUBDIRS += ../utils/tsimageutils/tsrc SUBDIRS += ../taskswitcher/utils/tsrc SUBDIRS += ../taskswitcher/backstepping/tsrc } diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialogplugin/inc/tsactivitymodelitem.h --- a/tsdevicedialog/tsdevicedialogplugin/inc/tsactivitymodelitem.h Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* 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: tsactivitymodelitem.h -* -*/ - -#ifndef TSACTIVITYMODELITEM_H -#define TSACTIVITYMODELITEM_H - -#include -#include - -#include "tsmodelitem.h" - -class QAbstractListModel; - -/*! - Implements model item which represents Activity entry -*/ -class TsActivityModelItem : public TsModelItem -{ - Q_OBJECT -public: - TsActivityModelItem(QAbstractListModel &model, - QObject &service, - const QVariantHash &activity); - ~TsActivityModelItem(); - QVariant data(int role) const; - void close(); - void open(); - static QString applicationKeyword(); - static QString screenshotKeyword(); - -private: - QVariant decorationRole() const; - QVariant displayRole() const; - QVariant visibilityRole() const; - -private slots: - void thumbnailReady(QPixmap, void *); -signals: - void entryChanged(TsModelItem *); - -private: - QObject &mService; - const QVariantHash mActivity; - QIcon mIcon; - mutable bool mRequestPending; - - Q_DISABLE_COPY(TsActivityModelItem) - -}; - -#endif // TSACTIVITYMODELITEM_H diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialogplugin/inc/tsmodel.h --- a/tsdevicedialog/tsdevicedialogplugin/inc/tsmodel.h Fri Sep 17 08:32:18 2010 +0300 +++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsmodel.h Mon Oct 04 00:38:31 2010 +0300 @@ -34,14 +34,12 @@ public: TsModel(TsTaskMonitor &applicationSrv, - QObject &activitySrv, QObject *parent = 0); ~TsModel(); int rowCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - int maxRowCount()const; // from QAbstractModel virtual bool insertRows(int row, int count, TsModelItem *item, const QModelIndex &parent = QModelIndex()); @@ -58,12 +56,10 @@ void openApplication(const QModelIndex &index); void closeApplication(const QModelIndex &index); void updateApplications(); - void updateActivities(); - void entryChanged(TsModelItem *); + private: TsModelItem *entry(const QModelIndex &index) const; void getApplications(); - void getActivities(bool fullUpdate = true); private: /* @@ -73,17 +69,6 @@ TsTaskMonitor &mApplicationService; - /* - * Activity Service - */ - QObject &mActivityService; - - /* - * Maximum number of items (only for running apps + activities) - */ - int mMaxItems; - int mActivitiesCount; - Q_DISABLE_COPY(TsModel) }; diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialogplugin/inc/tsmodelitem.h --- a/tsdevicedialog/tsdevicedialogplugin/inc/tsmodelitem.h Fri Sep 17 08:32:18 2010 +0300 +++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsmodelitem.h Mon Oct 04 00:38:31 2010 +0300 @@ -17,20 +17,30 @@ #ifndef TSMODELITEM_H #define TSMODELITEM_H -#include #include +#include + +#include "tsmodelitem.h" + +class TsTask; /*! Abstract class which define model item for taskswitcher */ -class TsModelItem: public QObject +class TsModelItem { - Q_OBJECT public: - virtual QVariant data(int role) const =0; - virtual void close() =0; - virtual void open() =0; + TsModelItem(QSharedPointer entry); + ~TsModelItem(); + QVariant data(int role) const; + void close(); + void open(); + +private: + const QSharedPointer mEntry; + Q_DISABLE_COPY(TsModelItem) + }; #endif // TSMODELITEM_H diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialogplugin/resource/layout.docml --- a/tsdevicedialog/tsdevicedialogplugin/resource/layout.docml Fri Sep 17 08:32:18 2010 +0300 +++ b/tsdevicedialog/tsdevicedialogplugin/resource/layout.docml Mon Oct 04 00:38:31 2010 +0300 @@ -12,6 +12,9 @@ + + + @@ -43,20 +46,10 @@ - - - - -
- - - - -
diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialogplugin/src/tsactivitymodelitem.cpp --- a/tsdevicedialog/tsdevicedialogplugin/src/tsactivitymodelitem.cpp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ -/* -* 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: tsactivitymodelitem.cpp -* -*/ -#include "tsactivitymodelitem.h" - -#include - -#include - -#include - -#include "tsdataroles.h" - -/*! - \class TsActivityModelItem - \ingroup group_tsdevicedialogplugin - \brief Item presenting activity in the grid. -*/ - -/*! - Standard C++ constructor - /param model - reference to parent model - /param service - reference to initialized ActivityManager instance - /param entry - Activity data -*/ -TsActivityModelItem::TsActivityModelItem(QAbstractListModel &model, - QObject &service, - const QVariantHash &activity) - : - mService(service), - mActivity(activity), - mIcon(), - mRequestPending(false) -{ - connect(this, - SIGNAL(entryChanged(TsModelItem *)), - &model, - SLOT(entryChanged(TsModelItem *))); - connect(&mService, - SIGNAL(thumbnailReady(QPixmap, void *)), - this, - SLOT(thumbnailReady(QPixmap, void *))); -} - -/*! - Standard C++ destructor - /param service - reference to initialized ActivityManager instance - /param entry - Activity data -*/ -TsActivityModelItem::~TsActivityModelItem() -{ -} - -/*! - Returns the data stored under the given role. - /param role - requested data role - /return data encapulated by QVariant -*/ -QVariant TsActivityModelItem::data(int role) const -{ - switch (role) { - case Qt::DisplayRole: - return displayRole(); - case Qt::DecorationRole: - return decorationRole(); - case TsDataRoles::Closable: - return QVariant(false); - case TsDataRoles::Active: - return QVariant(false); - default: - return QVariant(QVariant::Invalid); - } -} - -/*! - Empty interface implementation -*/ -void TsActivityModelItem::close() -{ - //no implementation required -} - -/*! - Open or move to foreground activity repesented by entry -*/ -void TsActivityModelItem::open() -{ - QVariant application(mActivity.value(ActivityApplicationKeyword)); - QVariant activity(mActivity.value(ActivityActivityKeyword)); - - if (application.isValid() && activity.isValid()) { - QMetaObject::invokeMethod(&mService, - "launchActivity", - Q_ARG(int, application.toInt()), - Q_ARG(QString, activity.toString())); - } -} - -/*! - Return application name keyword -*/ -QString TsActivityModelItem::applicationKeyword() -{ - static QString applicationName(ActivityApplicationName); - return applicationName; -} - -/*! - Return activity screenshot keyword -*/ -QString TsActivityModelItem::screenshotKeyword() -{ - static QString screenshot(ActivityScreenshotKeyword); - return screenshot; -} - -/*! - Returns the data stored under decoration role. - /return data encapulated by QVariant -*/ -QVariant TsActivityModelItem::decorationRole() const -{ - if (!mRequestPending) { - mRequestPending = true; - QVariant screenshot = mActivity.value(screenshotKeyword()); - if (screenshot.isValid()) { - QMetaObject::invokeMethod( - &mService, - "getThumbnail", - Q_ARG(QSize, QSize(128, 128)), - Q_ARG(QString, screenshot.toString()), - Q_ARG(void *, const_cast(this))); - } - } - return QVariant::fromValue(HbIcon(mIcon)); -} - -/*! - Returns the data stored under display role. - /return data encapulated by QVariant -*/ -QVariant TsActivityModelItem::displayRole() const -{ - return mActivity.value(applicationKeyword()); -} - -/*! - Slot retrieve thumbnail form TM, update content and notify observers - /param pixmap - thumbnail content - /ptr - user data provided to request -*/ -void TsActivityModelItem::thumbnailReady(QPixmap pixmap, void *ptr) -{ - if (ptr == this) { - mIcon = pixmap; - emit entryChanged(this); - } -} diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp --- a/tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -48,7 +47,6 @@ { const char KTranslationPath[] = "resource/qt/translations"; const char KTsDialogType[] = "com.nokia.taskswitcher.tsdevicedialogplugin/1.0"; - const char KActivityManaged [] = "com.nokia.qt.activities.ActivityManager"; } /*! @@ -60,11 +58,15 @@ mStorage(0), mTriedToLoadTranslation(false) { + // ensure the visibility property is set to false, so the TaskSwitcher + // in case when hbdevicedialogappserver crashes when TS is visible. + QValueSpacePublisher visibilityPublisher(TsProperty::KTsPath); + visibilityPublisher.setValue(TsProperty::KVisibilityPath, static_cast(false)); + visibilityPublisher.sync(); } TsDeviceDialogPlugin::~TsDeviceDialogPlugin() { - delete mModel; } /*! \reimp @@ -123,16 +125,7 @@ // lazy loading of model if (!mModel) { mStorage = new TsTaskMonitor(this); - - QServiceManager serviceManager; - QObject *activityManager(serviceManager.loadInterface(KActivityManaged)); - if (activityManager) { - activityManager->setParent(this); //make it autodestructed - } else { - activityManager = this; //activity plugin is not present. provide invalid instance because its not critical functionality. - //QMetaObject::invokeMethod is safe to use in such a case. - } - mModel = new TsModel(*mStorage, *activityManager); + mModel = new TsModel(*mStorage, this); } // ensure the dismiss request property is set to false diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialogplugin/src/tsentrymodelitem.cpp --- a/tsdevicedialog/tsdevicedialogplugin/src/tsentrymodelitem.cpp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* 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: tsentrymodelitem.cpp -* -*/ - -#include "tsentrymodelitem.h" - -#include - -#include - -#include "tsdataroles.h" - -/*! - \class TsEntryModelItem - \ingroup group_tsdevicedialogplugin - \brief Item presenting running apps in the grid. -*/ - -/*! - Standard C++ constructor - /param entry - Task Monitor data -*/ -TsEntryModelItem::TsEntryModelItem(QSharedPointer entry) - : - mEntry(entry) -{ - //no implementation required -} - -/*! - Standard C++ destructor -*/ -TsEntryModelItem::~TsEntryModelItem() -{ -} - -/*! - Returns the data stored under the given role. - /param role - requested data role - /return data encapulated by QVariant -*/ -QVariant TsEntryModelItem::data(int role) const -{ - switch (role) { - case Qt::DisplayRole: - return QVariant(mEntry->name()); - case Qt::DecorationRole: - return QVariant::fromValue(HbIcon(mEntry->screenshot())); - case TsDataRoles::Closable: - return QVariant(mEntry->isClosable()); - case TsDataRoles::Active: - return QVariant(mEntry->isActive()); - default: - return QVariant(QVariant::Invalid); - } -} - -/*! - Close running application repesented by entry -*/ -void TsEntryModelItem::close() -{ - mEntry->close(); -} - -/*! - Open or move to foreground application repesented by entry -*/ -void TsEntryModelItem::open() -{ - mEntry->open(); -} - diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialogplugin/src/tsmodel.cpp --- a/tsdevicedialog/tsdevicedialogplugin/src/tsmodel.cpp Fri Sep 17 08:32:18 2010 +0300 +++ b/tsdevicedialog/tsdevicedialogplugin/src/tsmodel.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -23,25 +23,14 @@ #include -#ifdef Q_OS_SYMBIAN -#include -#include - -const int TSDeviceDialogUid = 0x2002677F; -const int ItemsLimit = 0x00000001; -#endif - #include "tsmodelitem.h" -#include "tsentrymodelitem.h" -#include "tsactivitymodelitem.h" #include "tsdataroles.h" #include "tstaskchangeinfo.h" -const int maxItems(10); /*! \class TsModel \ingroup group_tsdevicedialogplugin - \brief Model storing running application and activieties. + \brief Model storing running tasks. */ /*! @@ -49,33 +38,11 @@ \param query used to create model \param pointer to parent object */ -TsModel::TsModel(TsTaskMonitor &applicationSrv, - QObject &activitySrv, - QObject *parent) : +TsModel::TsModel(TsTaskMonitor &applicationSrv, QObject *parent) : QAbstractListModel(parent), mEntries(), - mApplicationService(applicationSrv), - mActivityService(activitySrv), - mMaxItems(maxItems) + mApplicationService(applicationSrv) { - -#ifdef Q_OS_SYMBIAN - XQSettingsManager *crManager = new XQSettingsManager; - XQCentralRepositorySettingsKey itemsNumberKey(TSDeviceDialogUid, ItemsLimit); - QVariant itemsNumberVariant = - crManager->readItemValue(itemsNumberKey, XQSettingsManager::TypeInt); - if (!itemsNumberVariant.isNull()) { - int number = itemsNumberVariant.toInt(); - if (number > 0) { - mMaxItems = number; - } - } -#endif - - connect(&activitySrv, - SIGNAL(dataChanged()), - this, - SLOT(updateActivities())); connect(&applicationSrv, SIGNAL(taskListChanged()), this, @@ -96,8 +63,7 @@ Returns count of rows in model \retval number of rows */ -int TsModel::rowCount( - const QModelIndex &parent) const +int TsModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent); return mEntries.count(); @@ -147,23 +113,12 @@ \param role which data role to return \retval models data */ -QVariant TsModel::data(const QModelIndex &index, - int role) const +QVariant TsModel::data(const QModelIndex &index, int role) const { return index.isValid() ? entry(index)->data(role) : QVariant(); } /*! - Returns maximum anount of data allowed for model - \retval maximum data count -*/ - -int TsModel::maxRowCount()const -{ - return mMaxItems; -} - -/*! Activate one of model entries */ void TsModel::openApplication(const QModelIndex &index) @@ -191,10 +146,9 @@ */ void TsModel::updateApplications() { - QList changes(mApplicationService.changeList()); + QList changes(mApplicationService.changeList()); if (changes.count() == 0) { - //no applications - only activities on list return; } //check 1st item whether we have cancel change - if so reset model @@ -206,59 +160,33 @@ switch (changes[iter].first.changeType()) { case TsTaskChangeInfo::EChangeDelete : removeRows(changes[iter].first.oldOffset(), 1); - //we had max rows before delete - so there is possibility to add - //one activity - if(mEntries.count() + 1 == maxRowCount()) { - beginInsertRows(QModelIndex(), mEntries.count(), mEntries.count()); - getActivities(false); - endInsertRows(); - } break; case TsTaskChangeInfo::EChangeInsert : insertRows(changes[iter].first.newOffset(), 1, - new TsEntryModelItem(changes[iter].second)); - //we have too many items - delete some activities if we can - while(mEntries.count() > maxRowCount() && mActivitiesCount > 0) { - removeRows(mEntries.count()-1, 1); - mActivitiesCount--; - } + new TsModelItem(changes[iter].second)); break; case TsTaskChangeInfo::EChangeMove : moveRows(changes[iter].first.oldOffset(), changes[iter].first.newOffset()); break; case TsTaskChangeInfo::EChangeUpdate : updateRows(changes[iter].first.oldOffset(), - new TsEntryModelItem(changes[iter].second)); + new TsModelItem(changes[iter].second)); break; default: break; } } - - //because delete entries are at end of changelist - iterate backwards - } /*! - Updates model with fresh entries -*/ -void TsModel::updateActivities() -{ - //as for now we need full update when activities change - fullUpdate(); -} - -/*! - reset model using full application and activities lists + reset model */ void TsModel::fullUpdate() { beginResetModel(); qDeleteAll(mEntries); mEntries.clear(); - mActivitiesCount = 0; getApplications(); - getActivities(); endResetModel(); } @@ -269,52 +197,15 @@ void TsModel::getApplications() { //get all running applications and append to entries list - TsModelItem *entry(0); - QList< TsTaskChange> tasks(mApplicationService.changeList(true)); + QList tasks(mApplicationService.changeList(true)); foreach(TsTaskChange taskData, tasks) { if (!taskData.second.isNull()) { - entry = new TsEntryModelItem(taskData.second); - if (entry) { - mEntries.append(entry); - } + mEntries.append(new TsModelItem(taskData.second)); } } } /*! - Read current activities -*/ -void TsModel::getActivities(bool fullUpdate) -{ - //get activities - int maxActivitiesCount = maxRowCount() - mEntries.count() + mActivitiesCount; - if (maxActivitiesCount > 0) { - QList activities; - QMetaObject::invokeMethod(&mActivityService, - "activitiesList", - Q_RETURN_ARG(QList, activities), - Q_ARG(int, maxActivitiesCount)); - int iterPos = fullUpdate ? 0 : mActivitiesCount; - for(int iter(iterPos); iter< activities.count(); iter++) { - mEntries.append(new TsActivityModelItem(*this, mActivityService, activities[iter])); - mActivitiesCount++; - } - } -} - -/*! - Called when some item was changed - \param itemPtr - address of updated item -*/ -void TsModel::entryChanged(TsModelItem *itemPtr) -{ - const int itemIndex = mEntries.indexOf(itemPtr); - if (itemIndex != -1) { - emit dataChanged(index(itemIndex, 0), index(itemIndex, 0)); - } -} - -/*! Returns an entry from model \param index of entry in model \retval pointer to an entry diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialogplugin/src/tsmodelitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsdevicedialog/tsdevicedialogplugin/src/tsmodelitem.cpp Mon Oct 04 00:38:31 2010 +0300 @@ -0,0 +1,84 @@ +/* +* 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: tsmodelitem.cpp +* +*/ + +#include "tsmodelitem.h" + +#include + +#include + +#include "tsdataroles.h" + +/*! + \class TsModelItem + \ingroup group_tsdevicedialogplugin + \brief Item presenting running apps in the grid. +*/ + +/*! + Standard C++ constructor + /param entry - Task Monitor data +*/ +TsModelItem::TsModelItem(QSharedPointer entry) + : mEntry(entry) +{ + //no implementation required +} + +/*! + Standard C++ destructor +*/ +TsModelItem::~TsModelItem() +{ +} + +/*! + Returns the data stored under the given role. + /param role - requested data role + /return data encapulated by QVariant +*/ +QVariant TsModelItem::data(int role) const +{ + switch (role) { + case Qt::DisplayRole: + return QVariant(mEntry->name()); + case Qt::DecorationRole: + return QVariant::fromValue(HbIcon(mEntry->screenshot())); + case TsDataRoles::Closable: + return QVariant(mEntry->isClosable()); + case TsDataRoles::Active: + return QVariant(mEntry->isActive()); + default: + return QVariant(QVariant::Invalid); + } +} + +/*! + Close running application repesented by entry +*/ +void TsModelItem::close() +{ + mEntry->close(); +} + +/*! + Open or move to foreground application repesented by entry +*/ +void TsModelItem::open() +{ + mEntry->open(); +} diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialogplugin/tsdevicedialogplugin.pro --- a/tsdevicedialog/tsdevicedialogplugin/tsdevicedialogplugin.pro Fri Sep 17 08:32:18 2010 +0300 +++ b/tsdevicedialog/tsdevicedialogplugin/tsdevicedialogplugin.pro Mon Oct 04 00:38:31 2010 +0300 @@ -16,7 +16,7 @@ TEMPLATE = lib CONFIG += hb plugin mobility -MOBILITY = serviceframework publishsubscribe +MOBILITY = publishsubscribe include (../common.pri) @@ -24,8 +24,6 @@ inc/tsdevicedialogplugin.h \ inc/tsmodel.h \ inc/tsmodelitem.h \ - inc/tsentrymodelitem.h \ - inc/tsactivitymodelitem.h \ inc/tstasksgrid.h \ inc/tstasksgriditem.h \ inc/tsdocumentloader.h \ @@ -35,8 +33,7 @@ SOURCES += src/tsdevicedialogcontainer.cpp \ src/tsdevicedialogplugin.cpp \ src/tsmodel.cpp \ - src/tsentrymodelitem.cpp \ - src/tsactivitymodelitem.cpp \ + src/tsmodelitem.cpp \ src/tstasksgrid.cpp \ src/tstasksgriditem.cpp \ src/tsdocumentloader.cpp \ @@ -52,6 +49,8 @@ RESOURCES += tsdevicedialogplugin.qrc +DOCML += resource/layout.docml + symbian { TARGET.CAPABILITY = CAP_ECOM_PLUGIN TARGET.UID3 = 0x2002677F @@ -59,8 +58,6 @@ pluginstub.path = /resource/plugins/devicedialogs DEPLOYMENT += pluginstub - LIBS += -lxqsettingsmanager - BLD_INF_RULES.prj_exports += \ "$${LITERAL_HASH}include " \ "conf/tsdevicedialog.confml APP_LAYER_CONFML(tsdevicedialog.confml)" \ diff -r 0b3699f6c654 -r e36b2f4799c0 tsdevicedialog/tsdevicedialogplugin/tsdevicedialogplugin.qrc --- a/tsdevicedialog/tsdevicedialogplugin/tsdevicedialogplugin.qrc Fri Sep 17 08:32:18 2010 +0300 +++ b/tsdevicedialog/tsdevicedialogplugin/tsdevicedialogplugin.qrc Mon Oct 04 00:38:31 2010 +0300 @@ -1,6 +1,6 @@ - resource/layout.docml + resource/layout.docml.bin resource/tstasksgriditem.widgetml resource/tstasksgriditem.css resource/hbdialog.css diff -r 0b3699f6c654 -r e36b2f4799c0 utils/tsimageutils/group/bld.inf --- a/utils/tsimageutils/group/bld.inf Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* 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: -* -*/ -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -../inc/tsgraphicfilescalinghandler.h |../../../inc/tsgraphicfilescalinghandler.h - -PRJ_MMPFILES -tsimageutils.mmp diff -r 0b3699f6c654 -r e36b2f4799c0 utils/tsimageutils/group/tsimageutils.mmp --- a/utils/tsimageutils/group/tsimageutils.mmp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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: -* -*/ -TARGET tsimageutils.lib -TARGETTYPE LIB - -MW_LAYER_SYSTEMINCLUDE - -USERINCLUDE ../inc - -SOURCEPATH ../src -SOURCE tsgraphicfilescalinghandler.cpp - -#ifdef ENABLE_ABIV2_MODE -DEBUGGABLE_UDEBONLY -#endif diff -r 0b3699f6c654 -r e36b2f4799c0 utils/tsimageutils/inc/tsgraphicfilescalinghandler.h --- a/utils/tsimageutils/inc/tsgraphicfilescalinghandler.h Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* - * 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 : - * - */ -#ifndef TSGRAPHICFILESCALINGHANDLER_H -#define TSGRAPHICFILESCALINGHANDLER_H - -#include - -class RFs; -class CImageDecoder; -class CFbsBitmap; -class CBitmapRotator; -class CBitmapScaler; - -/** - * Interface to observer contain - * ImageReadyCallBack function return error code and scaled/resized bitmap. - */ -class MImageReadyCallBack - { -public: - virtual void ImageReadyCallBack( TInt aError, const CFbsBitmap* aBitmap ) = 0; - }; - -/** - * Class to scaling graphic file/s. - */ -class CTsGraphicFileScalingHandler : public CActive - { -public: - /** - * Kind of graphic file scaling. - * EIgnoreAspectRatio - the file is scaled to size, aspect ratio isn't preserving. - * EKeepAspectRatio - the file is scaled to a rectangle as large as possible inside size - * preserving the aspect ratio. - * EKeepAspectRatioByExpanding - the file is scaled to a rectangle as small as possible outside size - * preserving the aspect ratio. - */ - enum TKindOfScaling - { - EIgnoreAspectRatio = 0, - EKeepAspectRatio = 1, - EKeepAspectRatioByExpanding = 2, - }; - -private: - /** - * Active object current operation. - */ - enum TCurrentOperation{ - ENone = 0, - EConvertBitmapFromFile, - ERotate, - EScale - }; - -public: - ~CTsGraphicFileScalingHandler(); - - static CTsGraphicFileScalingHandler* NewL(MImageReadyCallBack &aNotify, - RFs &aFs, - const TDesC &aFileName, - const TDesC8& aMimeType, - const TSize &aNewSize, - TKindOfScaling aKindOfScaling = CTsGraphicFileScalingHandler::EIgnoreAspectRatio, - TInt aRotation = 0); - - static CTsGraphicFileScalingHandler* NewLC(MImageReadyCallBack &aNotify, - RFs &aFs, - const TDesC &aFileName, - const TDesC8& aMimeType, - const TSize &aNewSize, - TKindOfScaling aKindOfScaling = CTsGraphicFileScalingHandler::EIgnoreAspectRatio, - TInt aRotation = 0); - - - static CTsGraphicFileScalingHandler* NewL(MImageReadyCallBack &aNotify, - const CFbsBitmap &aInputFbsBitmap, - const TSize &aNewSize, - TKindOfScaling aKindOfScaling = CTsGraphicFileScalingHandler::EIgnoreAspectRatio, - TInt aRotation = 0); - static CTsGraphicFileScalingHandler* NewLC(MImageReadyCallBack &aNotify, - const CFbsBitmap &aInputFbsBitmap, - const TSize &aNewSize, - TKindOfScaling aKindOfScaling = CTsGraphicFileScalingHandler::EIgnoreAspectRatio, - TInt aRotation = 0); - -protected: - void DoCancel(); - void RunL(); - TInt RunError(TInt); - -private: - void ConstructL( RFs& aFs, const TDesC& aFileName, const TDesC8& aMimeType ); - void ConstructL( const CFbsBitmap& aInputFbsBitmap ); - CTsGraphicFileScalingHandler( MImageReadyCallBack& aNotify, - const TSize& aNewSize, - TKindOfScaling aKindOfScaling = CTsGraphicFileScalingHandler::EIgnoreAspectRatio, - TInt aRotation = 0); - void DecodingOperationL( RFs& aFs, const TDesC& aFileName, const TDesC8& aMimeType ); - - void ScalingOperationL(); - - void RotationOperationL(); - - TInt RotationMode()const; - - TBool IsSupportedRotationMode() const; - - TSize NewSizeToScalingOperation(); - - void FixForDisplayModeNotSupportedByScalingOperation(); - -private: - /** - * Reference to observer implementation - return error code and output bitmap. - */ - MImageReadyCallBack& iNotify; - /** - * Pointer to decoder used by decoding graphic file algorithm. - */ - CImageDecoder* iImageDecoder; - /** - * Pointer to input bitmap - before decoding/scaling operation/s. - */ - CFbsBitmap* iInputBitmap; - /** - * Pointer to output bitmap - returned in mNotify object. - */ - CFbsBitmap* iOutputBitmap; - /** - * Pointer to CBitmapScaler calss used by scaling graphic file algorithm. - */ - CBitmapScaler* iBitmapScaler; - - CBitmapRotator* iBitmapRotator; - /** - * New size of output graphic file. - */ - TSize iNewSize; - /** - * Kind of graphic file scaling described above. - */ - TBool iKindOfScaling; - - const TInt iRotation; - /** - * Active object current operation. - */ - TCurrentOperation iCurrentOperation; - }; - -#endif // TSGRAPHICFILESCALINGHANDLER_H diff -r 0b3699f6c654 -r e36b2f4799c0 utils/tsimageutils/src/tsgraphicfilescalinghandler.cpp --- a/utils/tsimageutils/src/tsgraphicfilescalinghandler.cpp Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,413 +0,0 @@ -/* - * 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 : - * - */ -#include -#include - -#include "tsgraphicfilescalinghandler.h" -// ----------------------------------------------------------------------------- -/** - * Private constructor. - * Parameters - the same meaning as in appropriate NewL/NewLC functions. - */ -CTsGraphicFileScalingHandler::CTsGraphicFileScalingHandler( - MImageReadyCallBack &aNotify, - const TSize &aNewSize, - TKindOfScaling aKindOfScaling, - TInt aRotation ) -: - CActive( EPriorityNormal ), - iNotify( aNotify ), - iNewSize( aNewSize ), - iKindOfScaling( aKindOfScaling ), - iRotation( aRotation ), - iCurrentOperation( ENone ) - { - CActiveScheduler::Add(this); - } - -// ----------------------------------------------------------------------------- -/** -* Destructor. -*/ -CTsGraphicFileScalingHandler::~CTsGraphicFileScalingHandler() - { - Cancel(); - delete iInputBitmap; - delete iOutputBitmap; - delete iImageDecoder; - delete iBitmapScaler; - delete iBitmapRotator; - } - -// ----------------------------------------------------------------------------- -/** - * Constructors for activation graphic file scaling. - * aNotify - reference to observer implementation. - * aFs - reference to file server session. - * aFileName - path to graphic file. - * aMimeType - mime type of graphic file. - * aNewSize - new size of output graphic file. - * aKindOfScaling - kind of graphic file scaling described above. - * aRotation - requested rotation angle - */ -CTsGraphicFileScalingHandler* CTsGraphicFileScalingHandler::NewL( - MImageReadyCallBack &aNotify, - RFs &aFs, - const TDesC &aFileName, - const TDesC8& aMimeType, - const TSize &aNewSize, - TKindOfScaling aKindOfScaling, - TInt aRotation - ) - { - CTsGraphicFileScalingHandler *self = - CTsGraphicFileScalingHandler::NewLC(aNotify, - aFs, - aFileName, - aMimeType, - aNewSize, - aKindOfScaling, - aRotation ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -/** - * Constructors for activation graphic file scaling. - * aNotify - reference to observer implementation. - * aFs - reference to file server session. - * aFileName - path to graphic file. - * aMimeType - mime type of graphic file. - * aNewSize - new size of output graphic file. - * aKindOfScaling - kind of graphic file scaling described above. - * aRotation - requested rotation angle - */ -CTsGraphicFileScalingHandler* CTsGraphicFileScalingHandler::NewLC( - MImageReadyCallBack &aNotify, - RFs &aFs, - const TDesC &aFileName, - const TDesC8& aMimeType, - const TSize &aNewSize, - TKindOfScaling aKindOfScaling, - TInt aRotation ) - { - CTsGraphicFileScalingHandler *self = - new (ELeave) CTsGraphicFileScalingHandler( aNotify, - aNewSize, - aKindOfScaling, - aRotation ); - - CleanupStack::PushL( self ); - self->ConstructL( aFs, aFileName, aMimeType ); - return self; - } - -// ----------------------------------------------------------------------------- -/** - * Functions construct active objest instance and made asynchronous operation/s. - * Parameters - the same meaning as in appropriate NewL/NewLC functions. - */ -void CTsGraphicFileScalingHandler::ConstructL( RFs &aFs, - const TDesC &aFileName, - const TDesC8& aMimeType ) - { - if( 0 == aFileName.Length() - || EFalse == aFs.IsValidName( aFileName ) ) - { - User::Leave( KErrPathNotFound ); - } - - if( 0 == aMimeType.Length() ) - { - User::Leave( KErrBadName ); - } - - if( 0 >= iNewSize.iWidth || 0 >= iNewSize.iHeight ) - { - User::Leave(KErrCorrupt); - } - iInputBitmap = new(ELeave)CFbsBitmap(); - DecodingOperationL( aFs, aFileName, aMimeType ); - SetActive(); - } - -// ----------------------------------------------------------------------------- -/** - * Exported from dll constructors for activation graphic file scaling. - * aNotify - reference to observer implementation. - * aInputFbsBitmap - reference to pattern CFbsBitmap. - * aNewSize - new size of output graphic file. - * aKindOfScaling - kind of graphic file scaling described above. - * aRotation - requested rotation angle - */ -CTsGraphicFileScalingHandler* CTsGraphicFileScalingHandler::NewL( - MImageReadyCallBack &aNotify, - const CFbsBitmap &aInputFbsBitmap, - const TSize &aNewSize, - TKindOfScaling aKindOfScaling, - TInt aRotation) - -{ - CTsGraphicFileScalingHandler *self = - CTsGraphicFileScalingHandler::NewLC( aNotify, - aInputFbsBitmap, - aNewSize, - aKindOfScaling, - aRotation ); - CleanupStack::Pop( self ); - return self; -} - -// ----------------------------------------------------------------------------- -/** - * Exported from dll constructors for activation graphic file scaling. - * aNotify - reference to observer implementation. - * aInputFbsBitmap - reference to pattern CFbsBitmap. - * aNewSize - new size of output graphic file. - * aKindOfScaling - kind of graphic file scaling described above. - * aRotation - requested rotation angle - */ -CTsGraphicFileScalingHandler* CTsGraphicFileScalingHandler::NewLC( - MImageReadyCallBack &aNotify, - const CFbsBitmap &aInputFbsBitmap, - const TSize &aNewSize, - TKindOfScaling aKindOfScaling, - TInt aRotation) - { - CTsGraphicFileScalingHandler *self = - new (ELeave) CTsGraphicFileScalingHandler( - aNotify, - aNewSize, - aKindOfScaling, - aRotation ); - CleanupStack::PushL( self ); - self->ConstructL( aInputFbsBitmap ); - return self; - } - -// ----------------------------------------------------------------------------- -/** - * Functions construct active objest instance and made asynchronous operation/s. - * Parameters - the same meaning as in appropriate NewL/NewLC functions. - */ -void CTsGraphicFileScalingHandler::ConstructL( const CFbsBitmap &aInputFbsBitmap ) - { - if( 0 >= iNewSize.iWidth || 0 >= iNewSize.iHeight) - { - User::Leave( KErrCorrupt ); - } - - iInputBitmap = new(ELeave)CFbsBitmap(); - User::LeaveIfError( iInputBitmap->Duplicate( aInputFbsBitmap.Handle() ) ); - - IsSupportedRotationMode() ? RotationOperationL() : ScalingOperationL(); - SetActive(); - } - -// ----------------------------------------------------------------------------- -/** - * Cancels the wait for completion of an outstanding request. - */ -void CTsGraphicFileScalingHandler::DoCancel() - { - switch(iCurrentOperation) - { - case EConvertBitmapFromFile: - iImageDecoder->Cancel(); - break; - case EScale: - iBitmapScaler->Cancel(); - break; - } - iNotify.ImageReadyCallBack( KErrCancel, 0 ); - } - -// ----------------------------------------------------------------------------- -/** - * Handles an active object’s request completion event. - */ -void CTsGraphicFileScalingHandler::RunL() - { - User::LeaveIfError(iStatus.Int()); - - switch (iCurrentOperation) - { - case EConvertBitmapFromFile: - delete iImageDecoder; - iImageDecoder = 0; - - IsSupportedRotationMode() ? RotationOperationL() : ScalingOperationL(); - SetActive(); - break; - - case ERotate: - delete iBitmapRotator; - iBitmapRotator = 0; - - ScalingOperationL(); - SetActive(); - break; - - case EScale: - iCurrentOperation = ENone; - delete iBitmapScaler; - iBitmapScaler = 0; - delete iInputBitmap; - iInputBitmap = 0; - if (iKindOfScaling == CTsGraphicFileScalingHandler::EKeepAspectRatioByExpanding) - { - User::LeaveIfError(iOutputBitmap->Resize(iNewSize)); - } - iNotify.ImageReadyCallBack(iStatus.Int(), iOutputBitmap); - break; - - } - } - -// ----------------------------------------------------------------------------- -/** - * Action to made before decoding graphic file operation. - * Parameters - the same meaning as in appropriate NewL/NewLC functions. - */ -void CTsGraphicFileScalingHandler::DecodingOperationL( RFs &aFs, - const TDesC &aFileName, - const TDesC8& aMimeType ) - { - // convert *.png to bitmap - iImageDecoder = CImageDecoder::FileNewL( aFs, aFileName, aMimeType ); - const TFrameInfo frameInfo( iImageDecoder->FrameInfo( 0 ) ); - iInputBitmap->Reset(); - User::LeaveIfError( iInputBitmap->Create(frameInfo.iOverallSizeInPixels, - frameInfo.iFrameDisplayMode ) ); - iImageDecoder->Convert( &iStatus, *iInputBitmap, 0 ); - iCurrentOperation = EConvertBitmapFromFile; - } - -// ----------------------------------------------------------------------------- -/** - * Action to made before scaling graphic file operation. - */ -void CTsGraphicFileScalingHandler::ScalingOperationL() - { - iBitmapScaler = CBitmapScaler::NewL(); - iBitmapScaler->SetQualityAlgorithm( CBitmapScaler::EMaximumQuality ); - FixForDisplayModeNotSupportedByScalingOperation(); - iOutputBitmap = new (ELeave)CFbsBitmap(); - User::LeaveIfError(iOutputBitmap->Create( NewSizeToScalingOperation(), - iInputBitmap->DisplayMode() ) ); - iBitmapScaler->Scale( &iStatus, *iInputBitmap, *iOutputBitmap, EFalse ); - iCurrentOperation = EScale; - } - -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- -// -void CTsGraphicFileScalingHandler::RotationOperationL() - { - const CBitmapRotator::TRotationAngle rotation = - static_cast( RotationMode() ); - iBitmapRotator = CBitmapRotator::NewL(); - iBitmapRotator->Rotate( &iStatus, - *iInputBitmap, - rotation ); - iCurrentOperation = ERotate; - } - -// ----------------------------------------------------------------------------- -// -TInt CTsGraphicFileScalingHandler::RotationMode()const - { - const TInt rotation(iRotation%360); - TInt retVal(CBitmapRotator::EMirrorHorizontalAxis); - if( 270 <= rotation ) - { - retVal = CBitmapRotator::ERotation270DegreesClockwise; - } - else if( 180 <= rotation ) - { - retVal = CBitmapRotator::ERotation180DegreesClockwise; - } - else if( 90 <= rotation ) - { - retVal = CBitmapRotator::ERotation90DegreesClockwise; - } - return retVal; - } - -// ----------------------------------------------------------------------------- -TBool CTsGraphicFileScalingHandler::IsSupportedRotationMode() const - { - TBool retVal(EFalse); - switch( RotationMode() ) - { - case CBitmapRotator::ERotation90DegreesClockwise: - case CBitmapRotator::ERotation180DegreesClockwise: - case CBitmapRotator::ERotation270DegreesClockwise: - retVal = ETrue; - break; - } - return retVal; - } -// ----------------------------------------------------------------------------- -/** - * Fix for TDisplayMode == EColor16MAP not supported by scaling operation! - * ! ! ! ADD OTHER NOT SUPPORTED DISPLAY MODES ! ! ! - */ -void CTsGraphicFileScalingHandler::FixForDisplayModeNotSupportedByScalingOperation() - { - if (EColor16MAP == iInputBitmap->DisplayMode()) - { - iInputBitmap->SetDisplayMode(EColor16MA); - } - } - -// ----------------------------------------------------------------------------- -/** - * Algorithm to determine output bitmap (returned in ImageReadyCallBack) size - * after scaling operation. - */ -TSize CTsGraphicFileScalingHandler::NewSizeToScalingOperation() - { - TSize originalSize = iInputBitmap->SizeInPixels(); - float widthFactor = iNewSize.iWidth / (float)originalSize.iWidth; - float heightFactor = iNewSize.iHeight / (float)originalSize.iHeight; - TSize retSize(iNewSize); - - if(CTsGraphicFileScalingHandler::EKeepAspectRatio == iKindOfScaling) - { - retSize = (widthFactor < heightFactor) ? - TSize(iNewSize.iWidth, widthFactor * originalSize.iHeight) : - TSize(heightFactor * originalSize.iWidth, iNewSize.iHeight); - } - else if (CTsGraphicFileScalingHandler::EKeepAspectRatioByExpanding == iKindOfScaling) - { - retSize = (widthFactor < heightFactor) ? - TSize(heightFactor * originalSize.iWidth, iNewSize.iHeight) : - TSize(iNewSize.iWidth, widthFactor * originalSize.iHeight); - } - return retSize; - } -// ----------------------------------------------------------------------------- -/** - * Handles a leave occurring in the request completion event handler RunL(). - */ -TInt CTsGraphicFileScalingHandler::RunError( TInt aError ) - { - iNotify.ImageReadyCallBack( aError, 0 ); - return KErrNone; - } diff -r 0b3699f6c654 -r e36b2f4799c0 utils/tsimageutils/tsimageutils.pro --- a/utils/tsimageutils/tsimageutils.pro Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -# -# 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: -# -TEMPLATE = subdirs - -BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include \"group/bld.inf\"" diff -r 0b3699f6c654 -r e36b2f4799c0 utils/utils.pro --- a/utils/utils.pro Fri Sep 17 08:32:18 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# -# 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: -# - -TEMPLATE = subdirs - -CONFIG += ordered - -SUBDIRS += tsimageutils