--- a/activityfw/activityfw.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/activityfw.pro Fri Aug 06 13:40:46 2010 +0300
@@ -20,7 +20,8 @@
SUBDIRS += tsutils
-symbian:SUBDIRS += storage
+symbian:SUBDIRS += storage \
+ afactivitylauncher \
SUBDIRS += activityserviceplugin \
orbitintegration/hbactivityplugin \
--- a/activityfw/activityserviceplugin/activityserviceplugin.pri Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/activityserviceplugin/activityserviceplugin.pri Fri Aug 06 13:40:46 2010 +0300
@@ -16,5 +16,3 @@
CONFIG += mobility
MOBILITY = serviceframework
-
-QT += sql
--- a/activityfw/activityserviceplugin/activityserviceplugin.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/activityserviceplugin/activityserviceplugin.pro Fri Aug 06 13:40:46 2010 +0300
@@ -15,37 +15,59 @@
#
TEMPLATE = lib
-TARGET = activityserviceplugin
+TARGET = afservice
CONFIG += plugin
include(activityserviceplugin.pri)
+DEFINES += AFACTIVITIES_LIB
+
INCLUDEPATH += ./inc \
- ../../inc
+ ../inc \
HEADERS += ./inc/afserviceplugin.h \
./inc/afclient.h \
./inc/afmanager.h \
- ./inc/aflauncher.h \
+ ./inc/afactivitystorage_p.h \
+ ./inc/afactivation_p.h \
+ ./inc/afcommandlineparser.h \
+ ./inc/afstorageproxy.h \
+
+HEADERS += ../../homescreensrv_plat/activity_framework_api/afactivities_global.h \
+ ../../homescreensrv_plat/activity_framework_api/afactivitystorage.h \
+ ../../homescreensrv_plat/activity_framework_api/afactivation.h \
SOURCES += ./src/afserviceplugin.cpp \
./src/afclient.cpp \
./src/afmanager.cpp \
./src/aflauncher.cpp \
+ ./src/afactivitystorage.cpp \
+ ./src/afactivitystorage_p.cpp \
+ ./src/afactivation.cpp \
+ ./src/afactivation_p.cpp \
+ ./src/afcommandlineparser.cpp \
+ ./src/afstorageproxy.cpp \
symbian {
INCLUDEPATH += ./s60/inc \
- SOURCES += ./s60/src/applicationlauncher_p.cpp
+ SOURCES += ./s60/src/applicationlauncher_p.cpp \
+ ./s60/src/afstorageproxy_p.cpp \
+ ./s60/src/afserializer.cpp \
- HEADERS += ./s60/inc/applicationlauncher_p.h
+ HEADERS += ./s60/inc/applicationlauncher_p.h \
+ ./s60/inc/afstorageproxy_p.h \
+ ./s60/inc/afserializer.h \
LIBS += -lapparc \
-lapgrfx \
-lcone \
-lafstorageclient \
- -lxqutils
-
+ -lxqutils \
+ -lafstoragecommon.lib \
+ -lestor \
+ -lfbscli \
+
}
win32 {
@@ -62,15 +84,27 @@
TARGET.CAPABILITY = ALL -TCB
TARGET.UID3 = 0x200267B2
- plugin.sources = activityserviceplugin.dll
+ plugin.sources = afservice.dll
plugin.path = $$QT_PLUGINS_BASE_DIR
- xml.sources = ./data/activityserviceplugin.xml
+ xml.sources = ./data/afservice.xml
xml.path = $$RESOURCE_FILES_DIR/activity
DEPLOYMENT += xml
#temporary workaround
- BLD_INF_RULES.prj_exports += "data/activityserviceplugin.xml z:/resource/activity/activityserviceplugin.xml"
+ BLD_INF_RULES.prj_exports += "data/afservice.xml z:/resource/activity/afservice.xml"
+
+ #export xml with old name (remove after next release)
+ BLD_INF_RULES.prj_exports += "data/afservice.xml z:/resource/activity/activityserviceplugin.xml"
+ BLD_INF_RULES.prj_exports += "data/afservice.xml $$QT_PLUGINS_BASE_DIR/activityserviceplugin.xml"
+ # we want to export few classes, use standard .def block instead of the one generated by plugin
+ defBlock = \
+ "$${LITERAL_HASH}ifdef WINSCW" \
+ "DEFFILE ./bwins/$${TARGET}.def" \
+ "$${LITERAL_HASH}elif defined EABI" \
+ "DEFFILE ./eabi/$${TARGET}.def" \
+ "$${LITERAL_HASH}endif"
+ MMP_RULES += defBlock
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/bwins/afserviceu.def Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,37 @@
+EXPORTS
+ qt_plugin_query_verification_data @ 1 NONAME
+ qt_plugin_instance @ 2 NONAME
+ ?tr@AfActivation@@SA?AVQString@@PBD0@Z @ 3 NONAME ; class QString AfActivation::tr(char const *, char const *)
+ ?qt_metacall@AfActivation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4 NONAME ; int AfActivation::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?tr@AfActivityStorage@@SA?AVQString@@PBD0H@Z @ 5 NONAME ; class QString AfActivityStorage::tr(char const *, char const *, int)
+ ?reason@AfActivation@@QBE?AW4ActivationReason@Af@@XZ @ 6 NONAME ; enum Af::ActivationReason AfActivation::reason(void) const
+ ?qt_metacast@AfActivation@@UAEPAXPBD@Z @ 7 NONAME ; void * AfActivation::qt_metacast(char const *)
+ ?tr@AfActivation@@SA?AVQString@@PBD0H@Z @ 8 NONAME ; class QString AfActivation::tr(char const *, char const *, int)
+ ?qt_metacall@AfActivityStorage@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int AfActivityStorage::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ??0AfActivation@@QAE@PAVQObject@@@Z @ 10 NONAME ; AfActivation::AfActivation(class QObject *)
+ ?activated@AfActivation@@IAEXW4ActivationReason@Af@@VQString@@V?$QHash@VQString@@VQVariant@@@@@Z @ 11 NONAME ; void AfActivation::activated(enum Af::ActivationReason, class QString, class QHash<class QString, class QVariant>)
+ ??1AfActivityStorage@@UAE@XZ @ 12 NONAME ; AfActivityStorage::~AfActivityStorage(void)
+ ?staticMetaObject@AfActivityStorage@@2UQMetaObject@@B @ 13 NONAME ; struct QMetaObject const AfActivityStorage::staticMetaObject
+ ?trUtf8@AfActivation@@SA?AVQString@@PBD0H@Z @ 14 NONAME ; class QString AfActivation::trUtf8(char const *, char const *, int)
+ ?activityMetaData@AfActivityStorage@@QBE?AV?$QHash@VQString@@VQVariant@@@@ABVQString@@@Z @ 15 NONAME ; class QHash<class QString, class QVariant> AfActivityStorage::activityMetaData(class QString const &) const
+ ?getStaticMetaObject@AfActivityStorage@@SAABUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const & AfActivityStorage::getStaticMetaObject(void)
+ ??0AfActivityStorage@@QAE@PAVQObject@@@Z @ 17 NONAME ; AfActivityStorage::AfActivityStorage(class QObject *)
+ ?staticMetaObject@AfActivation@@2UQMetaObject@@B @ 18 NONAME ; struct QMetaObject const AfActivation::staticMetaObject
+ ?trUtf8@AfActivation@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString AfActivation::trUtf8(char const *, char const *)
+ ??_EAfActivation@@UAE@I@Z @ 20 NONAME ; AfActivation::~AfActivation(unsigned int)
+ ?allActivities@AfActivityStorage@@QBE?AVQStringList@@XZ @ 21 NONAME ; class QStringList AfActivityStorage::allActivities(void) const
+ ?qt_metacast@AfActivityStorage@@UAEPAXPBD@Z @ 22 NONAME ; void * AfActivityStorage::qt_metacast(char const *)
+ ?activityData@AfActivityStorage@@QBE?AVQVariant@@ABVQString@@@Z @ 23 NONAME ; class QVariant AfActivityStorage::activityData(class QString const &) const
+ ?getStaticMetaObject@AfActivation@@SAABUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const & AfActivation::getStaticMetaObject(void)
+ ?tr@AfActivityStorage@@SA?AVQString@@PBD0@Z @ 25 NONAME ; class QString AfActivityStorage::tr(char const *, char const *)
+ ?name@AfActivation@@QBE?AVQString@@XZ @ 26 NONAME ; class QString AfActivation::name(void) const
+ ?metaObject@AfActivation@@UBEPBUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const * AfActivation::metaObject(void) const
+ ?metaObject@AfActivityStorage@@UBEPBUQMetaObject@@XZ @ 28 NONAME ; struct QMetaObject const * AfActivityStorage::metaObject(void) const
+ ?trUtf8@AfActivityStorage@@SA?AVQString@@PBD0@Z @ 29 NONAME ; class QString AfActivityStorage::trUtf8(char const *, char const *)
+ ?trUtf8@AfActivityStorage@@SA?AVQString@@PBD0H@Z @ 30 NONAME ; class QString AfActivityStorage::trUtf8(char const *, char const *, int)
+ ??_EAfActivityStorage@@UAE@I@Z @ 31 NONAME ; AfActivityStorage::~AfActivityStorage(unsigned int)
+ ?saveActivity@AfActivityStorage@@QAE_NABVQString@@ABVQVariant@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 32 NONAME ; bool AfActivityStorage::saveActivity(class QString const &, class QVariant const &, class QHash<class QString, class QVariant> const &)
+ ?parameters@AfActivation@@QBE?AV?$QHash@VQString@@VQVariant@@@@XZ @ 33 NONAME ; class QHash<class QString, class QVariant> AfActivation::parameters(void) const
+ ??1AfActivation@@UAE@XZ @ 34 NONAME ; AfActivation::~AfActivation(void)
+ ?removeActivity@AfActivityStorage@@QAE_NABVQString@@@Z @ 35 NONAME ; bool AfActivityStorage::removeActivity(class QString const &)
+
--- a/activityfw/activityserviceplugin/data/activityserviceplugin.xml Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<service>
- <name>ActivityService</name>
- <filepath>activityserviceplugin</filepath>
- <description>Activities service</description>
- <interface>
- <name>com.nokia.qt.activities.ActivityClient</name>
- <version>1.0</version>
- <description>Implementation of ActivityClient</description>
- </interface>
- <interface>
- <name>com.nokia.qt.activities.ActivityManager</name>
- <version>1.0</version>
- <description>Implementation of ActivityManager</description>
- </interface>
-</service>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/data/afservice.xml Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service>
+ <name>ActivityService</name>
+ <filepath>afservice</filepath>
+ <description>Activities service</description>
+ <interface>
+ <name>com.nokia.qt.activities.ActivityClient</name>
+ <version>1.0</version>
+ <description>Implementation of ActivityClient</description>
+ </interface>
+ <interface>
+ <name>com.nokia.qt.activities.ActivityManager</name>
+ <version>1.0</version>
+ <description>Implementation of ActivityManager</description>
+ </interface>
+ <interface>
+ <name>com.nokia.qt.activities.Storage</name>
+ <version>1.0</version>
+ <description>Implementation of Storage</description>
+ </interface>
+ <interface>
+ <name>com.nokia.qt.activities.Activation</name>
+ <version>1.0</version>
+ <description>Implementation of Activation</description>
+ </interface>
+</service>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/eabi/afserviceu.def Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,34 @@
+EXPORTS
+ qt_plugin_query_verification_data @ 1 NONAME
+ qt_plugin_instance @ 2 NONAME
+ _ZN12AfActivation11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME
+ _ZN12AfActivation11qt_metacastEPKc @ 4 NONAME
+ _ZN12AfActivation16staticMetaObjectE @ 5 NONAME DATA 16
+ _ZN12AfActivation19getStaticMetaObjectEv @ 6 NONAME
+ _ZN12AfActivation9activatedEN2Af16ActivationReasonE7QString5QHashIS2_8QVariantE @ 7 NONAME
+ _ZN12AfActivationC1EP7QObject @ 8 NONAME
+ _ZN12AfActivationC2EP7QObject @ 9 NONAME
+ _ZN17AfActivityStorage11qt_metacallEN11QMetaObject4CallEiPPv @ 10 NONAME
+ _ZN17AfActivityStorage11qt_metacastEPKc @ 11 NONAME
+ _ZN17AfActivityStorage12saveActivityERK7QStringRK8QVariantRK5QHashIS0_S3_E @ 12 NONAME
+ _ZN17AfActivityStorage14removeActivityERK7QString @ 13 NONAME
+ _ZN17AfActivityStorage16staticMetaObjectE @ 14 NONAME DATA 16
+ _ZN17AfActivityStorage19getStaticMetaObjectEv @ 15 NONAME
+ _ZN17AfActivityStorageC1EP7QObject @ 16 NONAME
+ _ZN17AfActivityStorageC2EP7QObject @ 17 NONAME
+ _ZN17AfActivityStorageD0Ev @ 18 NONAME
+ _ZN17AfActivityStorageD1Ev @ 19 NONAME
+ _ZN17AfActivityStorageD2Ev @ 20 NONAME
+ _ZNK12AfActivation10metaObjectEv @ 21 NONAME
+ _ZNK12AfActivation10parametersEv @ 22 NONAME
+ _ZNK12AfActivation4nameEv @ 23 NONAME
+ _ZNK12AfActivation6reasonEv @ 24 NONAME
+ _ZNK17AfActivityStorage10metaObjectEv @ 25 NONAME
+ _ZNK17AfActivityStorage12activityDataERK7QString @ 26 NONAME
+ _ZNK17AfActivityStorage13allActivitiesEv @ 27 NONAME
+ _ZNK17AfActivityStorage16activityMetaDataERK7QString @ 28 NONAME
+ _ZTI12AfActivation @ 29 NONAME
+ _ZTI17AfActivityStorage @ 30 NONAME
+ _ZTV12AfActivation @ 31 NONAME
+ _ZTV17AfActivityStorage @ 32 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/afactivation_p.h Fri Aug 06 13:40:46 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:
+*
+*/
+#ifndef AFACTIVATION_P_H
+#define AFACTIVATION_P_H
+
+#include "afactivities_global.h"
+
+#include <QObject>
+#include <QString>
+#include <QStringList>
+#include <QVariantHash>
+#include <QSharedPointer>
+
+#include "afstorageproxy.h"
+
+class AfActivationPrivate : public QObject
+{
+ Q_OBJECT
+
+public:
+ AfActivationPrivate(const QSharedPointer<AfStorageProxy> &connection, QObject *parent = 0);
+
+public:
+ QVariantHash parameters() const;
+ Af::ActivationReason reason() const;
+ QString name() const;
+
+signals:
+ void activated(Af::ActivationReason reason, QString name, QVariantHash parameters);
+
+private slots:
+ void handleActivityRequest(const QString &activityId);
+ void bringToForeground();
+
+private:
+ QVariantHash mParameters;
+ Af::ActivationReason mReason;
+ QString mName;
+
+private:
+ QSharedPointer<AfStorageProxy> mConnection;
+
+};
+
+#endif // AFACTIVATION_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/afactivitystorage_p.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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 AFACTIVITYSTORAGE_P_H
+#define AFACTIVITYSTORAGE_P_H
+
+#include <QString>
+#include <QStringList>
+#include <QVariant>
+#include <QSharedPointer>
+
+#include "afstorageproxy.h"
+
+class AfActivityStoragePrivate
+{
+
+public:
+ AfActivityStoragePrivate(const QSharedPointer<AfStorageProxy> &connection);
+
+public:
+ bool saveActivity(const QString &activityId, const QVariant &activityData, const QVariantHash &metadata);
+ bool removeActivity(const QString &activityId);
+
+ QStringList allActivities() const;
+
+ QVariant activityData(const QString &activityId) const;
+ QVariantHash activityMetaData(const QString &activityId) const;
+
+private: // helper methods
+ static int applicationId();
+
+private:
+ QSharedPointer<AfStorageProxy> mConnection;
+
+};
+
+#endif // AFACTIVITYSTORAGE_P_H
--- a/activityfw/activityserviceplugin/inc/afclient.h Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/activityserviceplugin/inc/afclient.h Fri Aug 06 13:40:46 2010 +0300
@@ -20,16 +20,17 @@
#include <QObject>
#include <QVariant>
#include <QString>
+#include <QSharedPointer>
-#include <afstorageclient.h>
+#include "afactivitystorage.h"
+#include "afactivation.h"
class AfClient : public QObject
{
-
Q_OBJECT
public:
- AfClient(const QSharedPointer<AfStorageClient> &serviceProvider,QObject *parent = 0);
+ AfClient(const QSharedPointer<AfActivityStorage> &storage, const QSharedPointer<AfActivation> &activation, QObject *parent = 0);
~AfClient();
public slots:
@@ -41,14 +42,15 @@
QVariantHash parseCommandLine(const QStringList &commandLineParams) const;
private slots:
- void bringToForeground();
+ void handleActivityRequest(Af::ActivationReason reason, const QString &name, const QVariantHash ¶meters);
signals:
void activityRequested(const QString &activityId);
-private:
- QSharedPointer<AfStorageClient> mServiceProvider;
- bool mIsconnected;
+private:
+ QSharedPointer<AfActivityStorage> mStorage;
+ QSharedPointer<AfActivation> mActivation;
+
};
#endif // AFCLIENT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/afcommandlineparser.h Fri Aug 06 13:40:46 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:
+*
+*/
+#ifndef AFCOMMANDLINEPARSER_H
+#define AFCOMMANDLINEPARSER_H
+
+#include "afactivities_global.h"
+#include <QVariant>
+#include <QString>
+#include <QHash>
+#include <QStringList>
+
+class AfCommandLineParser {
+public:
+ static void parseCommandLine(const QStringList &commandLineParams,
+ Af::ActivationReason &reason,
+ QString &name,
+ QVariantHash ¶meters);
+private:
+ static bool isServiceCommand(const QStringList &commandLineParams);
+ static bool isActivityCommand(const QStringList &commandLineParams);
+ static void parseServiceParameters(const QStringList &commandLineParams,
+ Af::ActivationReason &reason,
+ QString &name,
+ QVariantHash ¶meters);
+ static void parseActivityParameters(const QStringList &commandLineParams,
+ Af::ActivationReason &reason,
+ QString &name,
+ QVariantHash ¶meters);
+public: // TODO make privete when deprecated api removed
+ static QVariantHash getActivityParameters(const QStringList &commandLineParams);
+};
+
+#endif // AFCOMMANDLINEPARSER_H
--- a/activityfw/activityserviceplugin/inc/afmanager.h Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/activityserviceplugin/inc/afmanager.h Fri Aug 06 13:40:46 2010 +0300
@@ -23,7 +23,7 @@
#include <QPixmap>
#include <QSize>
-#include <afstorageclient.h>
+#include "afstorageproxy.h"
class AfManager : public QObject
{
@@ -31,7 +31,7 @@
Q_OBJECT
public:
- AfManager(const QSharedPointer<AfStorageClient> &serviceProvider, QObject *parent = 0);
+ AfManager(const QSharedPointer<AfStorageProxy> &serviceProvider, QObject *parent = 0);
~AfManager();
public slots:
@@ -50,7 +50,7 @@
QUrl activityToUri(const QVariantHash& activity) const;
private:
- QSharedPointer<AfStorageClient> mServiceProvider;
+ QSharedPointer<AfStorageProxy> mServiceProvider;
};
#endif // AFMANAGER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/afstorageproxy.h Fri Aug 06 13:40:46 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 AFSTORAGEPROXY_H
+#define AFSTORAGEPROXY_H
+
+#include <QObject>
+#include <QVariant>
+#include <QStringList>
+
+class AfStorageProxyPrivate;
+
+class AfStorageProxy : public QObject
+{
+ Q_OBJECT
+
+public:
+ AfStorageProxy(QObject *parent = 0);
+ virtual ~AfStorageProxy();
+
+public:
+ bool addActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+ bool updateActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+ bool saveActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+ bool removeActivity(int applicationId, const QString &activityId);
+ bool removeApplicationActivities(int applicationId);
+ bool activities(QList<QVariantHash> &list);
+ bool applicationActivities(QStringList &list, int applicationId);
+ bool activityData(QVariant &data, int applicationId, const QString &activityId);
+ 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 notifyDataChange();
+
+signals:
+ void activityRequested(const QString &activityUri);
+ void thumbnailRequested(const QPixmap &thumbnailPixmap, void *userData);
+ void dataChanged();
+
+private:
+ AfStorageProxyPrivate *d_ptr;
+
+ friend class AfStorageProxyPrivate;
+
+};
+
+#endif //AFSTORAGEPROXY_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/s60/inc/afserializer.h Fri Aug 06 13:40:46 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:
+*
+*/
+#ifndef HSSERIALIZER_H
+#define HSSERIALIZER_H
+
+#include <qvariant.h>
+
+/**
+ * Operator serialize VarinatHash to RBuf8
+ */
+RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src);
+
+/**
+ * Operator deserialize RBuf8 to VarinatHash
+ */
+QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src);
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/s60/inc/afstorageproxy_p.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* 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 AFSTORAGEPROXY_P_H
+#define AFSTORAGEPROXY_P_H
+
+#include "afasyncrequestobserver.h"
+
+#include <QVariant>
+#include <QStringList>
+
+class CAfStorageClient;
+class CAfEntry;
+class AfStorageProxy;
+
+class AfStorageProxyPrivate : public MAfAsyncRequestObserver
+{
+public:
+ AfStorageProxyPrivate(AfStorageProxy *q);
+ ~AfStorageProxyPrivate();
+
+public:
+ bool addActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+ bool updateActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+ bool saveActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+ bool removeActivity(int applicationId, const QString &activityId);
+ bool removeApplicationActivities(int applicationId);
+ bool activities(QList<QVariantHash> &list);
+ bool applicationActivities(QStringList &list, int applicationId);
+ bool activityData(QVariant &data, int applicationId, const QString &activityId);
+ 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 notifyDataChange();
+
+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);
+
+private:
+ CAfEntry *createFilterEntry(int applicationId = 0, const QString &activityId = QString());
+ CAfEntry *createSaveEntry(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata);
+ CAfEntry *getEntry(int applicationId, const QString &activityId);
+ QVariantHash extractMetadata(CAfEntry *entry);
+
+private:
+ CAfStorageClient *mClient;
+ AfStorageProxy *q_ptr;
+};
+
+#endif //AFSTORAGEPROXY_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/s60/src/afserializer.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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 <s32mem.h>
+#include "afserializer.h"
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src)
+{
+ QByteArray buffer;
+ QDataStream stream(&buffer, QIODevice::WriteOnly);
+
+ QT_TRYCATCH_LEAVING(stream << src);
+ const int dataLength(buffer.length());
+ const unsigned char *dataPtr(reinterpret_cast<const unsigned char *>(buffer.constData()));
+ if (dst.MaxLength() < dataLength) {
+ dst.ReAllocL(dataLength);
+ }
+ dst.Copy(dataPtr, dataLength);
+ return dst;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src)
+{
+ QByteArray buffer(QByteArray::fromRawData(reinterpret_cast<const char *>(src.Ptr()),
+ src.Length()) );
+
+ QDataStream stream(&buffer, QIODevice::ReadOnly);
+ QT_TRYCATCH_LEAVING(stream >> dst);
+ return dst;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/s60/src/afstorageproxy_p.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,296 @@
+/*
+* 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 "afstorageproxy_p.h"
+
+#include <fbs.h>
+
+#include <QSize>
+#include <QPixmap>
+
+#include <XQConversions>
+
+#include <afstorageglobals.h>
+#include <afstorageclient.h>
+#include <afentry.h>
+
+#include "afstorageproxy.h"
+#include "afserializer.h"
+
+AfStorageProxyPrivate::AfStorageProxyPrivate(AfStorageProxy *q) : mClient(0), q_ptr(q)
+{
+ QT_TRAP_THROWING(mClient = CAfStorageClient::NewL(*this));
+}
+
+AfStorageProxyPrivate::~AfStorageProxyPrivate()
+{
+ delete mClient;
+}
+
+bool AfStorageProxyPrivate::addActivity(int applicationId, const QString &activityId, 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, activityData, metadata);
+ int result = mClient->addActivity(*entry, screenshotHandle);
+ delete entry;
+ delete bitmap;
+
+ return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::updateActivity(int applicationId, const QString &activityId, 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, activityData, metadata);
+ int result = mClient->updateActivity(*entry, screenshotHandle);
+ delete entry;
+ delete bitmap;
+
+ return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::saveActivity(int applicationId, const QString &activityId, 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, activityData, metadata);
+ int result = mClient->saveActivity(*entry, screenshotHandle);
+ delete entry;
+ delete bitmap;
+
+ return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::removeActivity(int applicationId, const QString &activityId)
+{
+ CAfEntry *entry = createFilterEntry(applicationId, activityId);
+ int result = mClient->removeActivity(*entry);
+ delete entry;
+ return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::removeApplicationActivities(int applicationId)
+{
+ CAfEntry *entry = createFilterEntry(applicationId);
+ int result = mClient->removeApplicationActivities(*entry);
+ delete entry;
+ return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::activities(QList<QVariantHash> &list)
+{
+ RPointerArray<CAfEntry> results;
+
+ int result = mClient->activities(results);
+ list.clear();
+ for (int i=0; i < results.Count(); ++i) {
+ list.append(extractMetadata(results[i]));
+ }
+
+ results.ResetAndDestroy();
+ return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::applicationActivities(QStringList &list, int applicationId)
+{
+ RPointerArray<CAfEntry> results;
+
+ CAfEntry *entry = createFilterEntry(applicationId);
+ int result = mClient->applicationActivities(results, *entry);
+ delete entry;
+
+ list.clear();
+ for (int i=0; i < results.Count(); ++i) {
+ list.append(XQConversions::s60DescToQString(results[i]->ActivityId()));
+ }
+
+ results.ResetAndDestroy();
+ return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::activityData(QVariant &data, int applicationId, const QString &activityId)
+{
+ CAfEntry *entry = getEntry(applicationId, activityId);
+
+ if (!entry) {
+ return false;
+ }
+
+ QVariantHash deserializedData;
+ deserializedData << entry->Data(CAfEntry::Private);
+ data = deserializedData[ActivityDataKeyword];
+ delete entry;
+ return true;
+}
+
+bool AfStorageProxyPrivate::activityMetaData(QVariantHash &metadata, int applicationId, const QString &activityId)
+{
+ CAfEntry *entry = getEntry(applicationId, activityId);
+
+ if (entry) {
+ metadata = extractMetadata(entry);
+ delete entry;
+ return true;
+ }
+
+ return false;
+}
+
+bool AfStorageProxyPrivate::waitActivity()
+{
+ return KErrNone == mClient->waitActivity();
+}
+
+bool AfStorageProxyPrivate::launchActivity(int applicationId, const QString &activityUri)
+{
+ CAfEntry *entry = createFilterEntry(applicationId, activityUri);
+ int result = mClient->launchActivity(*entry);
+ delete entry;
+ return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::getThumbnail(const QSize &size, const QString &imagePath, void *userData)
+{
+ HBufC *source = XQConversions::qStringToS60Desc(imagePath);
+ int result = mClient->getThumbnail(TSize(size.width(), size.height()), *source, userData);
+ delete source;
+ return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::notifyDataChange()
+{
+ return KErrNone == mClient->notifyDataChange();
+}
+
+
+void AfStorageProxyPrivate::waitActivityRequestCompleted(int result, const TDesC8 &data)
+{
+ if (KErrCancel != result) {
+ waitActivity();
+ }
+ if (KErrNone == result) {
+ emit q_ptr->activityRequested(XQConversions::s60Desc8ToQString(data));
+ }
+}
+
+void AfStorageProxyPrivate::getThumbnailRequestCompleted(int result, int bitmapHandle, void *userData)
+{
+ if (KErrNone == result) {
+ CFbsBitmap* bitmap = new CFbsBitmap();
+ if (KErrNone == bitmap->Duplicate(bitmapHandle)) {
+ emit q_ptr->thumbnailRequested(QPixmap::fromSymbianCFbsBitmap(bitmap), userData);
+ }
+ delete bitmap;
+ }
+}
+
+void AfStorageProxyPrivate::dataChangeNotificationCompleted(int result)
+{
+ if (KErrCancel != result) {
+ notifyDataChange();
+ }
+ if (KErrNone == result) {
+ emit q_ptr->dataChanged();
+ }
+}
+
+CAfEntry *AfStorageProxyPrivate::createFilterEntry(int applicationId, const QString &activityId)
+{
+ CAfEntry *entry(0);
+ QT_TRAP_THROWING(entry = CAfEntry::NewL(0, applicationId, TPtrC(static_cast<const TUint16*>(activityId.utf16())), KNullDesC(), KNullDesC8(), KNullDesC8()));
+ return entry;
+}
+
+CAfEntry *AfStorageProxyPrivate::createSaveEntry(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata)
+{
+ CAfEntry *entry(0);
+
+ QT_TRAP_THROWING(
+ int flags(0);
+ QVariantHash privData;
+ privData.insert(ActivityDataKeyword, activityData);
+ RBuf8 privateBuff;
+ RBuf8 publicBuff;
+ CleanupClosePushL(privateBuff);
+ CleanupClosePushL(publicBuff);
+ privateBuff << privData;
+ publicBuff << metadata;
+
+ if (metadata.contains(ActivityPersistence) && metadata[ActivityPersistence].toBool()) {
+ flags |= CAfEntry::Persistent;
+ }
+
+ if (metadata.contains(ActivityVisibility) && !metadata[ActivityVisibility].toBool()) {
+ flags |= CAfEntry::Invisible;
+ }
+
+ HBufC *actBuff = XQConversions::qStringToS60Desc(activityId);
+ CleanupStack::PushL(actBuff);
+ entry = CAfEntry::NewL(flags,
+ applicationId,
+ *actBuff,
+ KNullDesC,
+ privateBuff,
+ publicBuff);
+ CleanupStack::PopAndDestroy(actBuff);
+ CleanupStack::PopAndDestroy(&publicBuff);
+ CleanupStack::PopAndDestroy(&privateBuff);
+ );
+ return entry;
+}
+
+CAfEntry *AfStorageProxyPrivate::getEntry(int applicationId, const QString &activityId)
+{
+ CAfEntry *entry = createFilterEntry(applicationId, activityId);
+ CAfEntry *resultEntry(0);
+ int result = mClient->activityData(resultEntry, *entry);
+ delete entry;
+
+ if (KErrNone != result) {
+ delete resultEntry;
+ resultEntry = 0;
+ }
+
+ return resultEntry;
+}
+
+QVariantHash AfStorageProxyPrivate::extractMetadata(CAfEntry *entry)
+{
+ QVariantHash metadata;
+ metadata << entry->Data(CAfEntry::Public);
+ metadata.insert(ActivityApplicationKeyword, entry->ApplicationId());
+ metadata.insert(ActivityActivityKeyword, XQConversions::s60DescToQString(entry->ActivityId()));
+ 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);
+ return metadata;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afactivation.cpp Fri Aug 06 13:40:46 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:
+*
+*/
+
+#include "afactivation.h"
+#include "afactivation_p.h"
+
+#include "afstorageproxy.h"
+
+AfActivation::AfActivation(QObject *parent) : QObject(parent), d_ptr(0)
+{
+ QSharedPointer<AfStorageProxy> connection(new AfStorageProxy());
+ QT_TRAP_THROWING(
+ User::LeaveIfError(connection->waitActivity());
+ )
+
+ d_ptr = new AfActivationPrivate(connection, this);
+ connect(d_ptr, SIGNAL(activated(Af::ActivationReason,QString,QVariantHash)), this, SIGNAL(activated(Af::ActivationReason,QString,QVariantHash)));
+}
+
+QVariantHash AfActivation::parameters() const
+{
+ return d_ptr->parameters();
+}
+
+Af::ActivationReason AfActivation::reason() const
+{
+ return d_ptr->reason();
+}
+
+QString AfActivation::name() const
+{
+ return d_ptr->name();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afactivation_p.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* 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 "afactivation_p.h"
+
+#include <QCoreApplication>
+
+#include "afstorageproxy.h"
+
+#include "aflauncher.h"
+#include "afcommandlineparser.h"
+
+AfActivationPrivate::AfActivationPrivate(const QSharedPointer<AfStorageProxy> &connection, QObject *parent) : QObject(parent), mReason(Af::ActivationReasonNormal), mConnection(connection)
+{
+ AfCommandLineParser::parseCommandLine(qApp->arguments(),
+ mReason,
+ mName,
+ mParameters);
+ connect(mConnection.data(), SIGNAL(activityRequested(QString)), this, SLOT(handleActivityRequest(QString)));
+ connect(mConnection.data(), SIGNAL(activityRequested(QString)), this, SLOT(bringToForeground()));
+}
+
+QVariantHash AfActivationPrivate::parameters() const
+{
+ return mParameters;
+}
+
+Af::ActivationReason AfActivationPrivate::reason() const
+{
+ return mReason;
+}
+
+QString AfActivationPrivate::name() const
+{
+ return mName;
+}
+
+void AfActivationPrivate::handleActivityRequest(const QString &activityUri)
+{
+ mReason = Af::ActivationReasonActivity;
+ mName = QString();
+ mParameters = QVariantHash();
+
+ QUrl uri(activityUri);
+ QVariantHash parameters;
+ QList<QPair<QString, QString> > uriParams = uri.queryItems();
+ for (QList<QPair<QString, QString> >::const_iterator i = uriParams.constBegin(); i != uriParams.constEnd(); ++i) {
+ parameters.insert(i->first, i->second);
+ }
+ if (parameters.contains(Af::KActivityUriNameKey)) {
+ mName = parameters.value(Af::KActivityUriNameKey).toString();
+ parameters.remove(Af::KActivityUriNameKey);
+ }
+ mParameters = parameters;
+
+ emit activated(mReason, mName, mParameters);
+}
+
+void AfActivationPrivate::bringToForeground()
+{
+ if (!mParameters.contains(Af::KActivityUriBackgroundKey)) {
+ // process all update events from widgets to prevent flickering
+ QCoreApplication::processEvents();
+ AfLauncher().bringToForeground(RProcess().SecureId().iId);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afactivitystorage.cpp Fri Aug 06 13:40:46 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:
+*
+*/
+
+#include "afactivitystorage.h"
+#include "afactivitystorage_p.h"
+
+AfActivityStorage::AfActivityStorage(QObject *parent) : QObject(parent), d_ptr(0)
+{
+ QSharedPointer<AfStorageProxy> connection(new AfStorageProxy());
+ d_ptr.reset(new AfActivityStoragePrivate(connection));
+}
+
+AfActivityStorage::~AfActivityStorage()
+{
+}
+
+bool AfActivityStorage::saveActivity(const QString &activityId, const QVariant &activityData, const QVariantHash &metadata)
+{
+ return d_ptr->saveActivity(activityId, activityData, metadata);
+}
+
+bool AfActivityStorage::removeActivity(const QString &activityId)
+{
+ return d_ptr->removeActivity(activityId);
+}
+
+QStringList AfActivityStorage::allActivities() const
+{
+ return d_ptr->allActivities();
+}
+
+QVariant AfActivityStorage::activityData(const QString &activityId) const
+{
+ return d_ptr->activityData(activityId);
+}
+
+QVariantHash AfActivityStorage::activityMetaData(const QString &activityId) const
+{
+ return d_ptr->activityMetaData(activityId);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afactivitystorage_p.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* 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 "afactivitystorage_p.h"
+
+#include <QPixmap>
+
+#include <afstorageglobals.h>
+
+AfActivityStoragePrivate::AfActivityStoragePrivate(const QSharedPointer<AfStorageProxy> &connection) : mConnection(connection)
+{
+}
+
+bool AfActivityStoragePrivate::saveActivity(const QString &activityId, const QVariant &activityData, const QVariantHash &metadata)
+{
+ QVariantHash publicData(metadata);
+
+ QPixmap screenshot(publicData[ActivityScreenshotKeyword].value<QPixmap>());
+ publicData.remove(ActivityScreenshotKeyword);
+
+ publicData.insert(ActivityApplicationKeyword, applicationId());
+ publicData.insert(ActivityActivityKeyword, activityId);
+
+ return mConnection->saveActivity(applicationId(), activityId, activityData, publicData, screenshot);
+}
+
+bool AfActivityStoragePrivate::removeActivity(const QString &activityId)
+{
+ return mConnection->removeActivity(applicationId(), activityId);
+}
+
+QStringList AfActivityStoragePrivate::allActivities() const
+{
+ QStringList activities;
+ mConnection->applicationActivities(activities, applicationId());
+ return activities;
+}
+
+QVariant AfActivityStoragePrivate::activityData(const QString &activityId) const
+{
+ QVariant data;
+ mConnection->activityData(data, applicationId(), activityId);
+ return data;
+}
+
+QVariantHash AfActivityStoragePrivate::activityMetaData(const QString &activityId) const
+{
+ QVariantHash metadata;
+ mConnection->activityMetaData(metadata, applicationId(), activityId);
+ return metadata;
+}
+
+int AfActivityStoragePrivate::applicationId()
+{
+ return RProcess().SecureId().iId;
+}
--- a/activityfw/activityserviceplugin/src/afclient.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/activityserviceplugin/src/afclient.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -16,30 +16,16 @@
*/
#include "afclient.h"
-#include <QCoreApplication>
-#include <QStringList>
-#include <QTimer>
-#include <QUrl>
-#include <QDebug>
-#include <QDir>
+#include "aflauncher.h"
+#include "afcommandlineparser.h"
-#include <afstorageentry.h>
-#include <afstorageglobals.h>
-
-#include "aflauncher.h"
-
-AfClient::AfClient(const QSharedPointer<AfStorageClient> &serviceProvider, QObject *parent)
+AfClient::AfClient(const QSharedPointer<AfActivityStorage> &storage, const QSharedPointer<AfActivation> &activation, QObject *parent)
:
QObject(parent),
- mServiceProvider(serviceProvider),
- mIsconnected(false)
+ mStorage(storage),
+ mActivation(activation)
{
- mIsconnected = ( KErrNone == mServiceProvider->connect());
- if( mIsconnected) {
- mServiceProvider->waitActivity();
- }
- connect(mServiceProvider.data(), SIGNAL(activityRequested(QString)), this, SIGNAL(activityRequested(QString)));
- connect(mServiceProvider.data(), SIGNAL(activityRequested(QString)), this, SLOT(bringToForeground()));
+ connect(mActivation.data(), SIGNAL(activated(Af::ActivationReason,QString,QVariantHash)), this, SLOT(handleActivityRequest(Af::ActivationReason,QString,QVariantHash)));
}
AfClient::~AfClient()
@@ -48,103 +34,44 @@
bool AfClient::addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters)
{
- bool result(mIsconnected);
- if (result) {
- QVariantHash publicData(parameters);
-
- QPixmap screenshot(publicData[ActivityScreenshotKeyword].value<QPixmap>());
- publicData.remove(ActivityScreenshotKeyword);
-
- RProcess process;
- publicData.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
- publicData.insert(ActivityActivityKeyword, activityId);
- AfStorageEntry entry(process.SecureId().iId, activityId, data, publicData);
- result = (KErrNone == mServiceProvider->addActivity(entry, screenshot));
- }
- return result;
+ return mStorage->saveActivity(activityId, data, parameters);
}
bool AfClient::removeActivity(const QString &activityId)
{
- bool result(mIsconnected);
- if (result) {
- RProcess process;
- AfStorageEntry entry(process.SecureId().iId, activityId);
- result = (KErrNone == mServiceProvider->removeActivity(entry));
- }
- return result;
+ return mStorage->removeActivity(activityId);
}
bool AfClient::updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters)
{
- bool result(mIsconnected);
- if (result) {
- QVariantHash publicData(parameters);
- QPixmap screenshot(publicData[ActivityScreenshotKeyword].value<QPixmap>());
- publicData.remove(ActivityScreenshotKeyword);
- RProcess process;
- publicData.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
- publicData.insert(ActivityActivityKeyword, activityId);
- AfStorageEntry entry(process.SecureId().iId, activityId, data, publicData);
- result = (KErrNone == mServiceProvider->updateActivity(entry, screenshot));
- }
- return result;
+ return mStorage->saveActivity(activityId, data, parameters);
}
QList<QVariantHash> AfClient::activities() const
{
- QList<QVariantHash> retVal;
- if (mIsconnected) {
- RProcess process;
- AfStorageEntry entry(process.SecureId().iId);
- QList<AfStorageEntry> activities;
- mServiceProvider->applicationActivities(activities, entry);
-
- QList<AfStorageEntry>::iterator iter(activities.begin());
- for (; activities.end() != iter; iter = activities.erase(iter)) {
- retVal.append((*iter).publicData());
- }
+ QList<QVariantHash> result;
+
+ QStringList activitiesList = mStorage->allActivities();
+ foreach (const QString &activityId, activitiesList) {
+ result.append(mStorage->activityMetaData(activityId));
}
- return retVal;
+ return result;
}
QVariant AfClient::activityData(const QString &activityId) const
{
- QVariant data;
- if (mIsconnected) {
- RProcess process;
- AfStorageEntry entry(static_cast<int>(process.SecureId().iId), activityId), result;
- if (0 == mServiceProvider->activityData(result, entry)) {
- data = result.privateData();
- }
- }
- return data;
+ return mStorage->activityData(activityId);
}
QVariantHash AfClient::parseCommandLine(const QStringList &commandLineParams) const
{
- QVariantHash activityParams;
- int activityMarkerIndex = commandLineParams.indexOf("-activity");
- if (activityMarkerIndex != -1 && commandLineParams.count() - 1 > activityMarkerIndex) {
- QUrl activityUri = QUrl::fromEncoded(commandLineParams.at(activityMarkerIndex+1).toAscii());
- if (activityUri.scheme() == "appto") {
- QList<QPair<QString, QString> > parameters = activityUri.queryItems();
- for (QList<QPair<QString, QString> >::const_iterator i = parameters.constBegin(); i != parameters.constEnd(); ++i) {
- activityParams.insert(i->first, i->second);
- }
-
- if (activityParams.contains("activityname") && !activityParams.value("activityname").toString().isEmpty()) {
- return activityParams;
- }
- }
- }
- return QVariantHash();
+ return AfCommandLineParser::getActivityParameters(commandLineParams);
}
-void AfClient::bringToForeground()
+void AfClient::handleActivityRequest(Af::ActivationReason reason, const QString &name, const QVariantHash ¶meters)
{
- // process all update events from widgets to prevent flickering
- QCoreApplication::processEvents();
- RProcess process;
- AfLauncher().bringToForeground(process.SecureId().iId);
+ Q_UNUSED(parameters);
+ if (Af::ActivationReasonActivity == reason) {
+ emit activityRequested(name);
+ }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afcommandlineparser.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,118 @@
+/*
+* 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 "afcommandlineparser.h"
+
+#include <QUrl>
+
+// Startup arguments for services
+static const char * StartupArgEmbedded = "embedded=yes";
+static const char * StartupArgService = "service=yes";
+static const char * StartupArgInterfaceId = "intf=";
+static const char * StartupArgOperationId = "oper=";
+static const char * StartupArgEmbeddedName = "embedded";
+static const char * StartupArgInterfaceName = "intf";
+static const char * StartupArgOperationName = "oper";
+
+// for activities
+const char KCmdLineMarker[] = "-activity";
+
+void AfCommandLineParser::parseCommandLine(const QStringList &commandLineParams,
+ Af::ActivationReason &reason,
+ QString &name,
+ QVariantHash ¶meters)
+{
+ if (AfCommandLineParser::isServiceCommand(commandLineParams)) {
+ parseServiceParameters(commandLineParams,
+ reason,
+ name,
+ parameters);
+ }
+ else if (AfCommandLineParser::isActivityCommand(commandLineParams)) {
+ parseActivityParameters(commandLineParams,
+ reason,
+ name,
+ parameters);
+ }
+}
+
+bool AfCommandLineParser::isServiceCommand(const QStringList &commandLineParams)
+{
+ return commandLineParams.contains(StartupArgService);
+}
+
+bool AfCommandLineParser::isActivityCommand(const QStringList &commandLineParams)
+{
+ return commandLineParams.contains(KCmdLineMarker);
+}
+
+void AfCommandLineParser::parseServiceParameters(const QStringList &commandLineParams,
+ Af::ActivationReason &reason,
+ QString &name,
+ QVariantHash ¶meters)
+{
+ reason = Af::ActivationReasonService;
+ parameters = QVariantHash();
+ int num = commandLineParams.count();
+ for ( int i = 0; i < num; i++ ) {
+ QString s = commandLineParams[i] ;
+ if (s.startsWith(StartupArgInterfaceId)) {
+ name = s.remove(StartupArgInterfaceId);
+ parameters.insert(StartupArgInterfaceName,name);
+ }
+ else if (s.startsWith(StartupArgOperationId)) {
+ parameters.insert(StartupArgOperationName,s.remove(StartupArgOperationId));
+ }
+ else if (s.startsWith(StartupArgEmbedded)) {
+ parameters.insert(StartupArgEmbeddedName,true);
+ }
+ }
+}
+
+void AfCommandLineParser::parseActivityParameters(const QStringList &commandLineParams,
+ Af::ActivationReason &reason,
+ QString &name,
+ QVariantHash ¶meters)
+{
+ QVariantHash startupActivity = AfCommandLineParser::getActivityParameters(commandLineParams);
+ if (!startupActivity.isEmpty() &&
+ !startupActivity.value(Af::KActivityUriNameKey).toString().isEmpty()) {
+ reason = Af::ActivationReasonActivity;
+ parameters = startupActivity;
+ name = startupActivity.value(Af::KActivityUriNameKey).toString();
+ }
+}
+
+QVariantHash AfCommandLineParser::getActivityParameters(const QStringList &commandLineParams)
+{
+ QVariantHash activityParams;
+ int activityMarkerIndex = commandLineParams.indexOf(KCmdLineMarker);
+ if (activityMarkerIndex != -1 && commandLineParams.count() - 1 > activityMarkerIndex) {
+ QUrl activityUri = QUrl::fromEncoded(commandLineParams.at(activityMarkerIndex+1).toAscii());
+ if (activityUri.scheme() == Af::KActivityScheme) {
+ QList<QPair<QString, QString> > parameters = activityUri.queryItems();
+ for (QList<QPair<QString, QString> >::const_iterator i = parameters.constBegin(); i != parameters.constEnd(); ++i) {
+ activityParams.insert(i->first, i->second);
+ }
+
+ if (activityParams.contains(Af::KActivityUriNameKey) && !activityParams.value(Af::KActivityUriNameKey).toString().isEmpty()) {
+ return activityParams;
+ }
+ }
+ }
+ return QVariantHash();
+}
--- a/activityfw/activityserviceplugin/src/afmanager.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/activityserviceplugin/src/afmanager.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -18,26 +18,23 @@
#include <QStringList>
#include <QUrl>
-#include <afstorageclient.h>
-#include <afstorageentry.h>
#include <afstorageglobals.h>
+#include "afactivities_global.h"
#include "afmanager.h"
#include "aflauncher.h"
-AfManager::AfManager(const QSharedPointer<AfStorageClient> &serviceProvider,
+AfManager::AfManager(const QSharedPointer<AfStorageProxy> &serviceProvider,
QObject *parent)
:
QObject(parent),
mServiceProvider(serviceProvider)
{
- if(0 == mServiceProvider->connect()){
- mServiceProvider->notifyDataChange();
- }
+ mServiceProvider->notifyDataChange();
connect(mServiceProvider.data(),
- SIGNAL(thumbnailRequested(QPixmap, void *)),
+ SIGNAL(thumbnailRequested(QPixmap,void*)),
this,
- SIGNAL(thumbnailReady(QPixmap, void *)));
+ SIGNAL(thumbnailReady(QPixmap,void*)));
connect(mServiceProvider.data(),
SIGNAL(dataChanged()),
this,
@@ -50,20 +47,14 @@
QList<QVariantHash> AfManager::activitiesList()
{
- QList<AfStorageEntry> results;
+ QList<QVariantHash> results;
mServiceProvider->activities(results);
-
- QList<QVariantHash> retVal;
- QList<AfStorageEntry>::iterator iter(results.begin());
- for (; iter != results.end(); iter = results.erase(iter)) {
- retVal.append((*iter).publicData());
- }
- return retVal;
+ return results;
}
void AfManager::launchActivity(const QUrl &uri)
{
- if (uri.scheme() != "appto")
+ if (uri.scheme() != Af::KActivityScheme)
return;
bool conversionOk(false);
@@ -80,9 +71,9 @@
parameters.insert(i->first, i->second);
}
- if (parameters.contains("activityname")) {
- activity.insert(ActivityActivityKeyword, parameters.value("activityname").toString());
- parameters.remove("activityname");
+ if (parameters.contains(Af::KActivityUriNameKey)) {
+ activity.insert(ActivityActivityKeyword, parameters.value(Af::KActivityUriNameKey).toString());
+ parameters.remove(Af::KActivityUriNameKey);
}
activity.insert(ActivityParametersKeyword, parameters);
@@ -115,10 +106,8 @@
{
AfLauncher applicationLauncher;
int applicationId = activity.value(ActivityApplicationKeyword).toInt();
- AfStorageEntry entry(applicationId,
- activity[ActivityActivityKeyword].toString());
if (applicationLauncher.isRunning(applicationId)) {
- mServiceProvider->launchActivity(entry);
+ mServiceProvider->launchActivity(applicationId, activityToUri(activity).toString());
} else {
applicationLauncher.startApplication(applicationId, activityToUri(activity));
}
@@ -127,11 +116,11 @@
QUrl AfManager::activityToUri(const QVariantHash& activity) const
{
QUrl uri;
- uri.setScheme("appto");
+ uri.setScheme(Af::KActivityScheme);
uri.setHost(QString("%1").arg(activity.value(ActivityApplicationKeyword).toUInt(), 8, 16, QChar('0')));
if (activity.contains(ActivityActivityKeyword))
- uri.addQueryItem("activityname", activity.value(ActivityActivityKeyword).toString());
+ uri.addQueryItem(Af::KActivityUriNameKey, activity.value(ActivityActivityKeyword).toString());
QVariantHash parameters = activity.value(ActivityParametersKeyword).toHash();
foreach(const QString &key, parameters.keys()) {
--- a/activityfw/activityserviceplugin/src/afserviceplugin.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/activityserviceplugin/src/afserviceplugin.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -21,8 +21,11 @@
#include <qabstractsecuritysession.h>
#include <qservicecontext.h>
+#include "afstorageproxy.h"
#include "afclient.h"
#include "afmanager.h"
+#include "afactivation.h"
+#include "afactivitystorage.h"
QObject *AfServicePlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session)
{
@@ -30,9 +33,13 @@
Q_UNUSED(session);
if (descriptor.interfaceName() == "com.nokia.qt.activities.ActivityClient") {
- return new AfClient(QSharedPointer<AfStorageClient>(new AfStorageClient()));
+ return new AfClient(QSharedPointer<AfActivityStorage>(new AfActivityStorage()), QSharedPointer<AfActivation>(new AfActivation()));
} else if (descriptor.interfaceName() == "com.nokia.qt.activities.ActivityManager") {
- return new AfManager(QSharedPointer<AfStorageClient>(new AfStorageClient()));
+ return new AfManager(QSharedPointer<AfStorageProxy>(new AfStorageProxy()));
+ } else if (descriptor.interfaceName() == "com.nokia.qt.activities.Storage") {
+ return new AfActivityStorage();
+ } else if (descriptor.interfaceName() == "com.nokia.qt.activities.Activation") {
+ return new AfActivation();
} else {
return NULL;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afstorageproxy.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* 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 "afstorageproxy.h"
+#include "afstorageproxy_p.h"
+
+AfStorageProxy::AfStorageProxy(QObject *parent) : QObject (parent), d_ptr(new AfStorageProxyPrivate(this))
+{
+}
+
+AfStorageProxy::~AfStorageProxy()
+{
+ delete d_ptr;
+}
+
+bool AfStorageProxy::addActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot)
+{
+ return d_ptr->addActivity(applicationId, activityId, activityData, metadata, screenshot);
+}
+
+bool AfStorageProxy::updateActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot)
+{
+ return d_ptr->updateActivity(applicationId, activityId, activityData, metadata, screenshot);
+}
+
+bool AfStorageProxy::saveActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot)
+{
+ return d_ptr->saveActivity(applicationId, activityId, activityData, metadata, screenshot);
+}
+
+bool AfStorageProxy::removeActivity(int applicationId, const QString &activityId)
+{
+ return d_ptr->removeActivity(applicationId, activityId);
+}
+
+bool AfStorageProxy::removeApplicationActivities(int applicationId)
+{
+ return d_ptr->removeApplicationActivities(applicationId);
+}
+
+bool AfStorageProxy::activities(QList<QVariantHash> &list)
+{
+ return d_ptr->activities(list);
+}
+
+bool AfStorageProxy::applicationActivities(QStringList &list, int applicationId)
+{
+ return d_ptr->applicationActivities(list, applicationId);
+}
+
+bool AfStorageProxy::activityData(QVariant &data, int applicationId, const QString &activityId)
+{
+ return d_ptr->activityData(data, applicationId, activityId);
+}
+
+bool AfStorageProxy::activityMetaData(QVariantHash &metadata, int applicationId, const QString &activityId)
+{
+ return d_ptr->activityMetaData(metadata, applicationId, activityId);
+}
+
+bool AfStorageProxy::waitActivity()
+{
+ return d_ptr->waitActivity();
+}
+
+bool AfStorageProxy::launchActivity(int applicationId, const QString &activityUri)
+{
+ return d_ptr->launchActivity(applicationId, activityUri);
+}
+
+bool AfStorageProxy::getThumbnail(const QSize &size, const QString &imagePath, void *userData)
+{
+ return d_ptr->getThumbnail(size, imagePath, userData);
+}
+
+bool AfStorageProxy::notifyDataChange()
+{
+ return d_ptr->notifyDataChange();
+}
--- a/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.qrc Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.qrc Fri Aug 06 13:40:46 2010 +0300
@@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/" >
- <file alias="activityserviceplugin.xml">../../data/activityserviceplugin.xml</file>
+ <file alias="activityserviceplugin.xml">../../data/afservice.xml</file>
</qresource>
</RCC>
--- a/activityfw/activityserviceplugin/symbianinstaller/symbianinstaller.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/activityserviceplugin/symbianinstaller/symbianinstaller.pro Fri Aug 06 13:40:46 2010 +0300
@@ -20,7 +20,7 @@
symbian {
load(data_caging_paths)
- plugin.sources = activityserviceplugin.dll
+ plugin.sources = afservice.dll
plugin.path = $$QT_PLUGINS_BASE_DIR
installer.pkg_postrules += "\"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/activityserviceinstaller.exe\" \
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -28,7 +28,7 @@
if (serviceManager.findInterfaces("ActivityService").isEmpty()) {
// clean old entries
serviceManager.removeService("ActivityService");
- bool servicesAdded = serviceManager.addService(":/activityserviceplugin.xml");
+ bool servicesAdded = serviceManager.addService(":/afservice.xml");
if (!servicesAdded) {
qWarning("addService for ActivityService returned false, error %d", serviceManager.error());
}
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.qrc Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.qrc Fri Aug 06 13:40:46 2010 +0300
@@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/" >
- <file alias="activityserviceplugin.xml">../../activityserviceplugin/data/activityserviceplugin.xml</file>
+ <file alias="afservice.xml">../../activityserviceplugin/data/afservice.xml</file>
</qresource>
</RCC>
\ No newline at end of file
--- a/activityfw/rom/activitymanager_core.iby Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/rom/activitymanager_core.iby Fri Aug 06 13:40:46 2010 +0300
@@ -17,17 +17,19 @@
#ifndef __TSACTMAN_CORE_IBY__
#define __TSACTMAN_CORE_IBY__
-file=ABI_DIR\BUILD_DIR\activityserviceplugin.dll SHARED_LIB_DIR\activityserviceplugin.dll
-data=\epoc32\data\z\resource\qt\plugins\activityserviceplugin.qtplugin resource\qt\plugins\activityserviceplugin.qtplugin
+file=ABI_DIR\BUILD_DIR\afservice.dll SHARED_LIB_DIR\afservice.dll
+data=\epoc32\data\z\resource\qt\plugins\afservice.qtplugin resource\qt\plugins\afservice.qtplugin
file=ABI_DIR\BUILD_DIR\hsactivitydbserver.exe PROGRAMS_DIR\hsactivitydbserver.exe
file=ABI_DIR\BUILD_DIR\afstorageclient.dll SHARED_LIB_DIR\afstorageclient.dll
file=ABI_DIR\BUILD_DIR\tsutils.dll SHARED_LIB_DIR\tsutils.dll
+file=ABI_DIR\BUILD_DIR\afactivitylauncher.dll SHARED_LIB_DIR\afactivitylauncher.dll
file=ABI_DIR\BUILD_DIR\hbactivityplugin.dll SHARED_LIB_DIR\hbactivityplugin.dll
data=\epoc32\data\z\resource\qt\plugins\hbactivityplugin.qtplugin resource\qt\plugins\hbactivityplugin.qtplugin
+data=DATAZ_\resource\activity\afservice.xml resource\activity\afservice.xml
data=DATAZ_\resource\activity\activityserviceplugin.xml resource\activity\activityserviceplugin.xml
// stub sis
--- a/activityfw/sis/activitymanager.pkg Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/sis/activitymanager.pkg Fri Aug 06 13:40:46 2010 +0300
@@ -26,13 +26,14 @@
;Unique Vendor name
:"Nokia"
-"/epoc32/release/armv5/urel/activityserviceplugin.dll"-"!:\sys\bin\activityserviceplugin.dll"
-"/epoc32/data/z/resource/qt/plugins/activityserviceplugin.qtplugin"-"!:\resource\qt\plugins\activityserviceplugin.qtplugin"
+"/epoc32/release/armv5/urel/afservice.dll"-"!:\sys\bin\afservice.dll"
+"/epoc32/data/z/resource/qt/plugins/afservice.qtplugin"-"!:\resource\qt\plugins\afservice.qtplugin"
"/epoc32/release/armv5/urel/hsactivitydbserver.exe" - "!:\sys\bin\hsactivitydbserver.exe"
"/epoc32/release/armv5/urel/afstorageclient.dll" - "!:\sys\bin\afstorageclient.dll"
"/epoc32/release/armv5/urel/tsutils.dll" - "!:\sys\bin\tsutils.dll"
+"/epoc32/release/armv5/urel/afactivitylauncher.dll" - "!:\sys\bin\afactivitylauncher.dll"
"/epoc32/release/armv5/urel/hbactivityplugin.dll" - "!:\sys\bin\hbactivityplugin.dll"
"/epoc32/data/z/resource/qt/plugins/hbactivityplugin.qtplugin"-"!:\resource\qt\plugins\hbactivityplugin.qtplugin"
--- a/activityfw/sis/stubs/activitymanager_stub.pkg Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/sis/stubs/activitymanager_stub.pkg Fri Aug 06 13:40:46 2010 +0300
@@ -32,13 +32,14 @@
;Unique Vendor name
:"Nokia"
-"" - "Z:\sys\bin\activityserviceplugin.dll"
-"" - "Z:\resource\qt\plugins\activityserviceplugin.qtplugin"
+"" - "Z:\sys\bin\afservice.dll"
+"" - "Z:\resource\qt\plugins\afservice.qtplugin"
"" - "Z:\sys\bin\hsactivitydbserver.exe"
"" - "Z:\sys\bin\afstorageclient.dll"
"" - "Z:\sys\bin\tsutils.dll"
+"" - "Z:\sys\bin\afactivitylauncher.dll"
"" - "Z:\sys\bin\hbactivityplugin.dll"
"" - "Z:\resource\qt\plugins\hbactivityplugin.qtplugin"
\ No newline at end of file
Binary file activityfw/sis/stubs/activitymanager_stub.sis has changed
--- a/activityfw/storage/client/client.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/client/client.pro Fri Aug 06 13:40:46 2010 +0300
@@ -14,55 +14,6 @@
# Description:
#
-TEMPLATE = lib
-TARGET = afstorageclient
-
-QT += core \
- sql
-
-HEADERS += inc/afstorageclient.h \
- inc/afstorageentry.h
-
-SOURCES += src/afstorageclient.cpp \
- src/afstorageentry.cpp
-
-DEFINES += ACTIVITY_LIB
-
-symbian{
-TARGET.UID3 = 0xE467C21E
-
-HEADERS += ../s60/inc/afentry.h \
- ../s60/inc/afserializer.h \
- s60/inc/afstorageclient_p.h \
- s60/inc/afstorageclientimp.h \
- s60/inc/afasyncrequest_p.h \
- s60/inc/afthumbnailrequest_p.h
+TEMPLATE = subdirs
-SOURCES += ../s60/src/afentry.cpp \
- ../s60/src/afserializer.cpp \
- s60/src/afstorageclient_p.cpp \
- s60/src/afstorageclientimp.cpp \
- s60/src/afasyncrequest_p.cpp \
- s60/src/afthumbnailrequest_p.cpp
-
-LIBS += -lxqutils \
- -lestor \
- -lfbscli
-
-afstorageclientdll.sources = afstorageclient.dll
-afstorageclientdll.path = $$SHARED_LIB_DIR
-DEPLOYMENT += afstorageclientdll
-
-BLD_INF_RULES.prj_exports += "../inc/afstorageglobals.h /epoc32/include/afstorageglobals.h" \
- "../inc/afcmd.h /epoc32/include/afcmd.h" \
- "inc/afstorageclient.h |../../../inc/afstorageclient.h" \
- "../s60/inc/afentry.h |../../../inc/afentry.h" \
- "inc/afstorageentry.h |../../../inc/afstorageentry.h" \
- "inc/afasyncrequestobserver.h |../../../inc/afasyncrequestobserver.h"
-DEPLOYMENT += api
-TARGET.CAPABILITY = ALL -TCB
-TARGET.EPOCALLOWDLLDATA = 1
-
-TARGET.UID3 = 0x200267B3
-MMP_RULES += EXPORTUNFROZEN
-}
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include \"group/bld.inf\""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/group/bld.inf Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+client.mmp
+
+PRJ_EXPORTS
+
+../inc/afstorageclient.h |../../../inc/afstorageclient.h
+../inc/afasyncrequestobserver.h |../../../inc/afasyncrequestobserver.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/group/client.mmp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* 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 afstorageclient.dll
+TARGETTYPE dll
+UID 0x1000008d 0x200267B3
+
+EPOCALLOWDLLDATA
+
+MW_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE ../inc
+USERINCLUDE ../../inc
+
+SOURCEPATH ../src
+SOURCE afstorageclient.cpp
+SOURCE afstorageclient_p.cpp
+SOURCE afstorageclientimp.cpp
+SOURCE afasyncrequest_p.cpp
+SOURCE afthumbnailrequest_p.cpp
+
+LIBRARY euser.lib
+LIBRARY estor.lib
+LIBRARY fbscli.lib
+STATICLIBRARY afstoragecommon.lib
+
+CAPABILITY ALL -TCB
+EXPORTUNFROZEN
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE_UDEBONLY
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/inc/afasyncrequest_p.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* 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 AFASYNCREQUESTPRIVATE_H
+#define AFASYNCREQUESTPRIVATE_H
+
+#include <e32base.h>
+#include <afcmd.h>
+
+#include "afasyncrequestobserver.h"
+#include "afasyncsession.h"
+
+class CAfAsyncRequestPrivate : public CActive
+
+{
+public:
+ static void NewLD(MAfAsyncRequestObserver &observer,
+ MAfAsyncSession & session,
+ ActivityCmd cmd);
+
+ ~CAfAsyncRequestPrivate();
+
+protected:
+ void DoCancel();
+
+ void RunL();
+
+ TInt RunError(TInt error);
+
+private:
+ CAfAsyncRequestPrivate(MAfAsyncRequestObserver &,
+ MAfAsyncSession &,
+ ActivityCmd);
+ void ConstructL();
+
+private:
+ MAfAsyncRequestObserver &mObserver;
+ MAfAsyncSession &mSession;
+ const ActivityCmd mCmd;
+ TPckgBuf<TInt> mIds[4];
+};
+#endif // AFASYNCREQUESTPRIVATE_H
--- a/activityfw/storage/client/inc/afasyncrequestobserver.h Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/client/inc/afasyncrequestobserver.h Fri Aug 06 13:40:46 2010 +0300
@@ -17,8 +17,8 @@
#ifndef AFASYNCREQUESTOBSERVER_H
#define AFASYNCREQUESTOBSERVER_H
-#include <QString>
-#include <QPixmap>
+
+#include <e32base.h>
class MAfAsyncRequestObserver
{
@@ -26,30 +26,25 @@
/**
* Function inform observer about asynchronous request results
* @param result - request result
- * @param requestType - request type
- * @param data - respons data
+ * @param data - response data
*/
- virtual void asyncRequestCompleated(int result,
- int requestType,
- const QString &data)=0;
+ virtual void waitActivityRequestCompleted(int result,
+ const TDesC8 &data) = 0;
/**
* Function inform observer about asynchronous request results
* @param result - request result
- * @param requestType - request type
* @param pixmap - pixmap respons
*/
- virtual void asyncRequestCompleated(int result,
- int requestType,
- const QPixmap& pixmap,
- void* userData)=0;
+ virtual void getThumbnailRequestCompleted(int result,
+ int bitmapHandle,
+ void* userData) = 0;
/**
* Function inform observer about asynchronous request results
* @param result - request result
- * @param requestType - request type
*/
- virtual void asyncRequestCompleated(int result,
- int requestType)=0;
+ virtual void dataChangeNotificationCompleted(int result) = 0;
+
};
#endif // AFASYNCREQUESTOBSERVER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/inc/afasyncsession.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* 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 AFASYNCSESSION_H
+#define AFASYNCSESSION_H
+#include <e32base.h>
+class MAfAsyncSession
+{
+public:
+ virtual void PushL(CBase* asyncTask) = 0;
+ virtual void Pop(CBase* asyncTask) =0;
+ virtual void executeL(int function) =0;
+ virtual void sendAsync(int function, const TIpcArgs &args, TRequestStatus& status) =0;
+ virtual void getDataL(int id, TDes8& buffer) =0;
+};
+
+#endif //AFASYNCSESSION_H
--- a/activityfw/storage/client/inc/afstorageclient.h Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/client/inc/afstorageclient.h Fri Aug 06 13:40:46 2010 +0300
@@ -17,75 +17,40 @@
#ifndef AFSTORAGECLIENT_H
#define AFSTORAGECLIENT_H
-#include <QObject>
-#include <afasyncrequestobserver.h>
-#ifdef ACTIVITY_LIB
- #define ACTIVITY_EXPORT Q_DECL_EXPORT
-#else
- #define ACTIVITY_EXPORT Q_DECL_IMPORT
-#endif
+#include "afasyncrequestobserver.h"
-class AfStorageClientPrivate;
-class AfStorageEntry;
-
-class ACTIVITY_EXPORT AfStorageClient: public QObject,
- public MAfAsyncRequestObserver
-{
- Q_OBJECT
-public:
- AfStorageClient(QObject* =0);
-
- ~AfStorageClient();
-
- int connect();
+class CAfStorageClientPrivate;
+class CAfEntry;
- int addActivity(const AfStorageEntry &entry, const QPixmap& imageSource = QPixmap());
-
- int updateActivity(const AfStorageEntry &entry, const QPixmap& imageSource = QPixmap());
-
- int removeActivity(const AfStorageEntry &entry);
-
- int removeApplicationActivities(const AfStorageEntry &entry);
-
- int activities(QList<AfStorageEntry> &dst);
-
- int applicationActivities(QList<AfStorageEntry> &dst,
- const AfStorageEntry &entry);
-
- int activityData(AfStorageEntry &dst, const AfStorageEntry &entry);
-
- int waitActivity();
-
- int launchActivity(const AfStorageEntry &entry);
-
- int getThumbnail(QSize size, QString imagePath, void* userDdata);
-
- int notifyDataChange();
+NONSHARABLE_CLASS(CAfStorageClient) : public CBase
+{
+public:
+ IMPORT_C static CAfStorageClient *NewL(MAfAsyncRequestObserver &observer);
+ IMPORT_C static CAfStorageClient *NewLC(MAfAsyncRequestObserver &observer);
+ IMPORT_C virtual ~CAfStorageClient();
private:
- void asyncRequestCompleated(int, int, const QString &);
-
- void asyncRequestCompleated(int, int, const QPixmap&, void*);
-
- void asyncRequestCompleated(int result,
- int requestType);
-
-signals:
- void activityRequested(const QString &activityId);
+ CAfStorageClient();
+ 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);
+ IMPORT_C int activities(RPointerArray<CAfEntry> &dst);
+ IMPORT_C int applicationActivities(RPointerArray<CAfEntry> &dst, const CAfEntry &entry);
+ 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 notifyDataChange();
- void thumbnailRequested(QPixmap thumbnailPixmap, void *userData);
-
- void dataChanged();
+private:
+ CAfStorageClientPrivate *d_ptr;
-private:
- /**
- * Private client implementation.
- * Own.
- */
- AfStorageClientPrivate *d_ptr;
-
- friend class AfStorageClientPrivate;
};
#endif //AFSTORAGECLIENT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/inc/afstorageclient_p.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,60 @@
+/*
+* 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 AFSTORAGECLIENTPRIVATE_H
+#define AFSTORAGECLIENTPRIVATE_H
+
+#include <e32base.h>
+#include "afstorageglobals.h"
+#include "afstorageclientimp.h"
+
+class CAfStorageClientPrivate : public CBase
+{
+
+public:
+ static CAfStorageClientPrivate *NewL(MAfAsyncRequestObserver &observer);
+ static CAfStorageClientPrivate *NewLC(MAfAsyncRequestObserver &observer);
+ virtual ~CAfStorageClientPrivate();
+
+private:
+ CAfStorageClientPrivate(MAfAsyncRequestObserver &observer);
+ void ConstructL();
+
+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);
+ int activities(RPointerArray<CAfEntry> &dst);
+ int applicationActivities(RPointerArray<CAfEntry> &dst, const CAfEntry &entry);
+ int activityData(CAfEntry *&resultEntry, const CAfEntry &templateEntry);
+ int waitActivity();
+ int getThumbnail(const TSize &size, const TDesC &imagePath, void *userData);
+ int notifyDataChange();
+ int launchActivity(const CAfEntry &templateEntry);
+
+private:
+ int execute(int function, const CAfEntry &sourceEntry, TInt imageHandle);
+ int execute(int function, RPointerArray<CAfEntry> &resultsList,const CAfEntry &templateEntry);
+
+private:
+ RAfStorageClientImplementation mImplementation;
+};
+
+#endif // AFSTORAGECLIENTPRIVATE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/inc/afstorageclientimp.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,69 @@
+/*
+* 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 AFSTORAGECLIENTIMPLEMENTATION_H
+#define AFSTORAGECLIENTIMPLEMENTATION_H
+#include <e32base.h>
+#include "afasyncrequestobserver.h"
+#include "afasyncsession.h"
+
+class CAfEntry;
+class CFbsBitmap;
+
+class RAfStorageClientImplementation: protected RSessionBase,
+ public MAfAsyncSession
+{
+public:
+ RAfStorageClientImplementation(MAfAsyncRequestObserver &observer);
+
+ ~RAfStorageClientImplementation();
+
+ void Close();
+
+ void executeL(int function,
+ const CAfEntry &sourceEntry,
+ int userData =0);
+
+ void executeL(int function,
+ RPointerArray<CAfEntry> &resultsList,
+ const CAfEntry& templateEntry);
+
+ void getThumbnailL(TSize size,
+ const TDesC& source,
+ TAny *userData );
+
+ void connectL();
+
+public:
+ void PushL(CBase* asyncTask);
+
+ void Pop(CBase* asyncTask);
+
+ void executeL(int function);
+
+ void sendAsync(int function, const TIpcArgs &args, TRequestStatus& status);
+
+ void getDataL(int id, TDes8& buffer);
+
+private:
+ void startServerL();
+
+private:
+ RPointerArray<CBase> mAsyncTasks;
+ MAfAsyncRequestObserver &mObserver;
+};
+
+#endif //AFSTORAGECLIENTIMPLEMENTATION_H
--- a/activityfw/storage/client/inc/afstorageentry.h Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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 AFSTORAGEENTRY_H
-#define AFSTORAGEENTRY_H
-
-#include <qvariant.h>
-#include <qsharedpointer.h>
-#include <afentry.h>
-
-
-#ifdef ACTIVITY_LIB
- #define ACTIVITY_EXPORT Q_DECL_EXPORT
-#else
- #define ACTIVITY_EXPORT Q_DECL_IMPORT
-#endif
-
-class ACTIVITY_EXPORT AfStorageEntry
-{
-public:
- AfStorageEntry(QSharedPointer<CAfEntry> data = QSharedPointer<CAfEntry>(0));
-
- AfStorageEntry(const AfStorageEntry &templateEntry);
-
- AfStorageEntry(int appId,
- const QString &actId = QString(),
- const QVariant &privateData = QVariant(),
- const QVariantHash& publicData = QVariantHash());
-
- const CAfEntry* data() const;
-
- int flags() const;
-
- int applicationId() const;
-
- QString activityId() const;
-
- QString imageSrc() const;
-
- QVariantHash publicData() const;
-
- QVariant privateData() const;
-
-private:
- QSharedPointer<CAfEntry> mData;
-
-};
-
-#endif //AFSTORAGEENTRY_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/inc/afthumbnailrequest_p.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* 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 AFTHUMBNAILREQUESTPRIVATE_H
+#define AFTHUMBNAILREQUESTPRIVATE_H
+
+#include <e32base.h>
+
+#include "afasyncrequestobserver.h"
+#include "afasyncsession.h"
+
+class CAfThumbnailRequestPrivate : public CActive
+
+{
+public:
+ static void NewLD(MAfAsyncRequestObserver &observer,
+ MAfAsyncSession & session,
+ TSize resolution,
+ const TDesC& source,
+ TAny* userData);
+
+ ~CAfThumbnailRequestPrivate();
+
+protected:
+ void DoCancel();
+
+ void RunL();
+
+ TInt RunError(TInt error);
+
+private:
+ CAfThumbnailRequestPrivate(MAfAsyncRequestObserver &,
+ MAfAsyncSession &,
+ TAny*);
+
+ void ConstructL(TSize resolution, const TDesC& source);
+
+private:
+ MAfAsyncRequestObserver &mObserver;
+ MAfAsyncSession &mSession;
+ TPckgBuf<TInt> mIds[4];
+ RBuf mImgSrc;
+ TAny* mUserData;
+};
+#endif // AFTHUMBNAILREQUESTPRIVATE_H
--- a/activityfw/storage/client/s60/inc/afasyncrequest_p.h Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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 AFASYNCREQUESTPRIVATE_H
-#define AFASYNCREQUESTPRIVATE_H
-#include <e32base.h>
-#include <QVariant>
-#include <QPixmap>
-#include "afasyncrequestobserver.h"
-#include "afstorageclientimp.h"
-#include "afcmd.h"
-
-class CAfAsyncRequestPrivate : public CActive
-
-{
-public:
- static void NewLD(MAfAsyncRequestObserver &observer,
- RAfStorageClientImplementation & session,
- ActivityCmd cmd);
-
- ~CAfAsyncRequestPrivate();
-
-protected:
- void DoCancel();
-
- void RunL();
-
- TInt RunError(TInt error);
-
-private:
- CAfAsyncRequestPrivate(MAfAsyncRequestObserver &,
- RAfStorageClientImplementation &,
- ActivityCmd);
- void ConstructL();
-
-private:
- MAfAsyncRequestObserver &mObserver;
- RAfStorageClientImplementation &mSession;
- const ActivityCmd mCmd;
- TPckgBuf<TInt> mIds[4];
-};
-#endif // AFASYNCREQUESTPRIVATE_H
--- a/activityfw/storage/client/s60/inc/afstorageclient_p.h Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +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 AFSTORAGECLIENTPRIVATE_H
-#define AFSTORAGECLIENTPRIVATE_H
-
-#include <e32base.h>
-#include "afstorageglobals.h"
-#include "afstorageclientimp.h"
-
-class AfStorageEntry;
-class AfAsyncRequestPrivate;
-
-class AfStorageClientPrivate
-{
-public:
- AfStorageClientPrivate(MAfAsyncRequestObserver & observer);
-
- ~AfStorageClientPrivate();
-
- int connect();
-
- int addActivity(const AfStorageEntry &sourceEntry, const QPixmap& sourceImage);
-
- int updateActivity(const AfStorageEntry &sourceEntry, const QPixmap& sourceImage);
-
- int removeActivity(const AfStorageEntry &templateEntry);
-
- int removeApplicationActivities(const AfStorageEntry &templateEntry);
-
- int activities(QList<AfStorageEntry> &dst);
-
- int applicationActivities(QList<AfStorageEntry> &dst,
- const AfStorageEntry &entry);
-
- int activityData(AfStorageEntry &resultEntry, const AfStorageEntry &templateEntry);
-
- int waitActivity();
-
- int getThumbnail(QSize size, QString imagePath , void *userDdata);
-
- int notifyDataChange();
-
- int launchActivity(const AfStorageEntry &templateEntry);
-
- int cancelWaitActivity();
-
- int cancelNotifyDataChange();
-
-private:
- int execute(int function, const AfStorageEntry &sourceEntry, const QPixmap& sourceImage);
- int execute(int function, QList<AfStorageEntry>& resultsList,const AfStorageEntry& templateEntry);
-
-private:
- RAfStorageClientImplementation mImplementation;
-};
-#endif // AFSTORAGECLIENTPRIVATE_H
--- a/activityfw/storage/client/s60/inc/afstorageclientimp.h Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +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 AFSTORAGECLIENTIMPLEMENTATION_H
-#define AFSTORAGECLIENTIMPLEMENTATION_H
-#include <e32base.h>
-#include "afasyncrequestobserver.h"
-
-class CAfEntry;
-class CFbsBitmap;
-
-class RAfStorageClientImplementation: protected RSessionBase
-{
-public:
- RAfStorageClientImplementation(MAfAsyncRequestObserver &observer);
-
- ~RAfStorageClientImplementation();
-
- void Close();
-
- void executeL(int function);
-
- void executeL(int function,
- const CAfEntry &sourceEntry,
- int userData =0);
-
- void executeL(int function,
- RPointerArray<CAfEntry> &resultsList,
- const CAfEntry& templateEntry);
-
- void getThumbnailL(TSize size,
- const TDesC& source,
- TAny *userData );
-
- void connectL();
-
-public:
- void PushL(CBase* asyncTask);
-
- void Pop(CBase* asyncTask);
-
- void sendAsync(int function, const TIpcArgs &args, TRequestStatus& status);
-
- void getDataL(int id, TDes8& buffer);
-
-private:
- void startServerL();
-
-private:
- RPointerArray<CBase> mAsyncTasks;
- MAfAsyncRequestObserver &mObserver;
-};
-
-#endif //AFSTORAGECLIENTIMPLEMENTATION_H
--- a/activityfw/storage/client/s60/inc/afthumbnailrequest_p.h Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +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 AFTHUMBNAILREQUESTPRIVATE_H
-#define AFTHUMBNAILREQUESTPRIVATE_H
-#include <e32base.h>
-#include <QVariant>
-#include <QPixmap>
-#include "afasyncrequestobserver.h"
-#include "afstorageclientimp.h"
-
-class CAfThumbnailRequestPrivate : public CActive
-
-{
-public:
- static void NewLD(MAfAsyncRequestObserver &observer,
- RAfStorageClientImplementation & session,
- TSize resolution,
- const TDesC& source,
- TAny* userData);
-
- ~CAfThumbnailRequestPrivate();
-
-protected:
- void DoCancel();
-
- void RunL();
-
- TInt RunError(TInt error);
-
-private:
- CAfThumbnailRequestPrivate(MAfAsyncRequestObserver &,
- RAfStorageClientImplementation &,
- TAny*);
-
- void ConstructL(TSize resolution, const TDesC& source);
-
-private:
- MAfAsyncRequestObserver &mObserver;
- RAfStorageClientImplementation &mSession;
- TPckgBuf<TInt> mIds[4];
- RBuf mImgSrc;
- TAny* mUserData;
-};
-#endif // AFTHUMBNAILREQUESTPRIVATE_H
--- a/activityfw/storage/client/s60/src/afasyncrequest_p.cpp Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +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 "afasyncrequest_p.h"
-#include "afstorageclient_p.h"
-#include "afstorageclient.h"
-#include "afentry.h"
-#include <fbs.h>
-#include <XQConversions>
-
-// -----------------------------------------------------------------------------
-/**
- * Create and initialize handler for anyc. activity requests
- * @param observer - request completion observer
- * @param session - activity client implementation
- * @param cmd - requested functionality
- */
-void CAfAsyncRequestPrivate::NewLD(MAfAsyncRequestObserver &observer,
- RAfStorageClientImplementation & session,
- ActivityCmd cmd)
-{
- CAfAsyncRequestPrivate* self = new(ELeave)CAfAsyncRequestPrivate(observer, session, cmd);
- CleanupStack::PushL(self);
- self->ConstructL();
- session.PushL(self);
- CleanupStack::Pop(self);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * First phase construction
- * @param observer - request completion observer
- * @param session - activity client implementation
- * @param cmd - requested functionality
- */
-CAfAsyncRequestPrivate::CAfAsyncRequestPrivate(MAfAsyncRequestObserver & observer,
- RAfStorageClientImplementation & session,
- ActivityCmd cmd)
-:
-CActive(EPriorityStandard),
-mObserver(observer),
-mSession(session),
-mCmd(cmd)
-{
- CActiveScheduler::Add(this);
- RProcess process;
- mIds[0] = static_cast<TInt>(process.SecureId().iId);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Second phase construction
- */
-void CAfAsyncRequestPrivate::ConstructL()
-{
- mSession.sendAsync(mCmd,
- TIpcArgs(&mIds[0],&mIds[1], &mIds[2], &mIds[3]),
- iStatus);
- SetActive();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor
- */
-CAfAsyncRequestPrivate::~CAfAsyncRequestPrivate()
-{
- Cancel();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Cancel pending requst
- */
-void CAfAsyncRequestPrivate::DoCancel()
-{
- TRAP_IGNORE(
- switch (mCmd) {
- case WaitActivity: mSession.executeL(CancelWait); break;
- case NotifyChange: mSession.executeL(CancelNotify); break;
- }
- )
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function handle request completion, copy data, forward information and destroy handler
- */
-void CAfAsyncRequestPrivate::RunL()
-{
- User::LeaveIfError(iStatus.Int());
- switch (mCmd) {
- case WaitActivity:
- {
- RBuf8 data;
- CleanupClosePushL(data);
- CAfEntry::ReallocL(data, (mIds[0])());
- mSession.getDataL((mIds[3])(), data);
- mObserver.asyncRequestCompleated(iStatus.Int(), mCmd, XQConversions::s60Desc8ToQString(data));
- CleanupStack::PopAndDestroy(&data);
- break;
- }
- case NotifyChange:
- mObserver.asyncRequestCompleated(iStatus.Int(), mCmd);
- break;
- }
- mSession.Pop(this);
- delete this;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function handle request processing errors
- * @param error - error code
- */
-TInt CAfAsyncRequestPrivate::RunError(TInt error)
-{
- (WaitActivity == mCmd) ? mObserver.asyncRequestCompleated(error, mCmd, QString::null) :
- mObserver.asyncRequestCompleated(error, mCmd);
- mSession.Pop(this);
- delete this;
- return KErrNone;
-}
-
-
--- a/activityfw/storage/client/s60/src/afstorageclient_p.cpp Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +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 <fbs.h>
-#include <s32mem.h>
-
-#include <qvariant.h>
-#include <XQConversions>
-
-#include "afstorageclient_p.h"
-#include "afasyncrequest_p.h"
-#include "afstorageglobals.h"
-#include "afserializer.h"
-#include "afentry.h"
-#include "afstorageentry.h"
-
-
-// -----------------------------------------------------------------------------
-template <class T>
-void RPointerArrayCleanupMethod(TAny *aPtr)
-{
- static_cast< RPointerArray<T>* >(aPtr)->ResetAndDestroy();
-}
-
-// -----------------------------------------------------------------------------
-template <class T>
-void CleanupResetAndDestroyPushL(RPointerArray<T> &array) {
- CleanupStack::PushL(TCleanupItem(&RPointerArrayCleanupMethod<T>, &array));
-}
-// -----------------------------------------------------------------------------
-/**
- * Constructor
- */
-AfStorageClientPrivate::AfStorageClientPrivate(MAfAsyncRequestObserver & observer)
-:
-mImplementation(observer)
-{
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor
- */
-AfStorageClientPrivate::~AfStorageClientPrivate()
-{
- mImplementation.Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::connect
- */
-int AfStorageClientPrivate::connect()
-{
- TRAPD(errNo, mImplementation.connectL());
- return errNo;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::addActivity(const AfStorageEntry &,const QPixmap&)
- */
-int AfStorageClientPrivate::addActivity(const AfStorageEntry &entry,
- const QPixmap& imageSrc)
-{
- return execute(AddActivity, entry, imageSrc);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::updateActivity(const AfStorageEntry &,const QPixmap&)
- */
-int AfStorageClientPrivate::updateActivity(const AfStorageEntry &entry,
- const QPixmap& imageSrc)
-{
- return execute(UpdateActivity, entry, imageSrc);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::removeActivity(const AfStorageEntry &)
- */
-int AfStorageClientPrivate::removeActivity(const AfStorageEntry &entry)
-{
- return execute(RemoveActivity, entry, QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::removeApplicationActivities(const AfStorageEntry &)
- */
-int AfStorageClientPrivate::removeApplicationActivities(const AfStorageEntry &entry)
-{
- return execute(RemoveApplicationActivities, entry, QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::activities(QList<AfStorageEntry> &)
- */
-int AfStorageClientPrivate::activities(QList<AfStorageEntry> &results)
-{
- return execute(Activities, results, AfStorageEntry());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::applicationActivities(QList<AfStorageEntry> &, const AfStorageEntry &)
- */
-int AfStorageClientPrivate::applicationActivities(QList<AfStorageEntry> &results,
- const AfStorageEntry &templateEntry)
-{
- return execute(ApplicationActivities, results, templateEntry);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::activityData(AfStorageEntry &, const AfStorageEntry &)
- */
-int AfStorageClientPrivate::activityData(AfStorageEntry &resultEntry,
- const AfStorageEntry &templateEntry)
-{
-
- QList<AfStorageEntry> results;
- int errNo(execute(ApplicationActivity, results, templateEntry));
- if (0 == errNo) {
- resultEntry = results.first();
- }
- return errNo;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::waitActivity()
- */
-int AfStorageClientPrivate::waitActivity()
-{
- return execute(WaitActivity, AfStorageEntry(), QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::getThumbnail(QSize, QString, void *)
- */
-int AfStorageClientPrivate::getThumbnail(QSize size, QString imagePath, void *userData)
-{
- HBufC *source = XQConversions::qStringToS60Desc(imagePath);
- TRAPD(errNo, mImplementation.getThumbnailL(TSize(size.width(), size.height()), *source, userData);)
- delete source;
- return errNo;
-
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::notifyDataChange()
- */
-int AfStorageClientPrivate::notifyDataChange()
-{
- return execute(NotifyChange, AfStorageEntry(), QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::launchActivity(const AfStorageEntry &)
- */
-int AfStorageClientPrivate::launchActivity(const AfStorageEntry &templateEntry)
-{
- return execute(LaunchActivity, templateEntry, QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::cancelWaitActivity()
- */
-int AfStorageClientPrivate::cancelWaitActivity()
-{
- return execute(CancelWait, AfStorageEntry(), QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::cancelNotifyDataChange()
- */
-int AfStorageClientPrivate::cancelNotifyDataChange()
-{
- return execute(CancelNotify, AfStorageEntry(), QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function execute activity framework functinality and return results
- */
-int AfStorageClientPrivate::execute(int function, const AfStorageEntry &sourceEntry, const QPixmap& sourceImage)
-{
- TRAPD(errNo,
- const CAfEntry *entry(sourceEntry.data());
- int userData(-1);
- CFbsBitmap* bitmap(sourceImage.toSymbianCFbsBitmap());
- if(0 != bitmap) {
- CleanupStack::PushL(bitmap);
- userData = bitmap->Handle();
- }
- switch (function) {
- case AddActivity:
- case UpdateActivity:
- case RemoveActivity:
- case RemoveApplicationActivities:
- case LaunchActivity:
- User::LeaveIfNull(entry);
- mImplementation.executeL(function, *entry, userData);
- break;
-
- case CancelNotify:
- case CancelWait:
- case WaitActivity:
- case NotifyChange:
- mImplementation.executeL(function);
- break;
- }
- if(0 != bitmap) {
- CleanupStack::PopAndDestroy(bitmap);
- }
- )
- return errNo;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function execute activity framework functinality and return results
- */
-int AfStorageClientPrivate::execute(int function, QList<AfStorageEntry>& resultsList,const AfStorageEntry& templateEntry)
-{
- TRAPD(errNo,
- RPointerArray<CAfEntry> results;
- CleanupResetAndDestroyPushL<CAfEntry>(results);
-
- CAfEntry *entry(const_cast<CAfEntry *>(templateEntry.data()));
- if(0 == entry) {
- entry = CAfEntry::NewLC();
- }
- mImplementation.executeL(function, results, *entry);
- if(templateEntry.data() != entry) {
- CleanupStack::PopAndDestroy(entry);
- }
-
- //copy data
- while (results.Count()) {
- resultsList.append(AfStorageEntry(QSharedPointer<CAfEntry>(results[0])));
- results.Remove(0);
- }
- CleanupStack::PopAndDestroy(&results);
- )
- return errNo;
-}
--- a/activityfw/storage/client/s60/src/afstorageclientimp.cpp Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +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 <fbs.h>
-#include <s32mem.h>
-#include "afstorageclientimp.h"
-#include "afstorageglobals.h"
-#include "afglobals.h"
-#include "afentry.h"
-#include "afasyncrequest_p.h"
-#include "afthumbnailrequest_p.h"
-
-// -----------------------------------------------------------------------------
-/**
- * Furst phase constructor
- */
-RAfStorageClientImplementation::RAfStorageClientImplementation(MAfAsyncRequestObserver &observer)
-:
-mObserver(observer)
-{}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor
- */
-RAfStorageClientImplementation::~RAfStorageClientImplementation()
-{
- Close();
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::Close()
-{
- mAsyncTasks.ResetAndDestroy();
- RSessionBase::Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function establish connection to activity server
- */
-void RAfStorageClientImplementation::connectL()
-{
- const int asyncMessageSlots(12);
- const int maxRetry(4);
- TInt retry = maxRetry;
- TInt errNo(KErrNone);
- do {
- errNo = CreateSession(KActivityServerName,
- TVersion(0, 0, 0),
- asyncMessageSlots);
- if (KErrNotFound != errNo && KErrServerTerminated != errNo) {
- retry =0;
- } else {
- TRAP(errNo, startServerL());
- if (KErrNone != errNo && KErrAlreadyExists != errNo) {
- retry =0;
- errNo = CreateSession(KActivityServerName,
- TVersion(0, 0, 0),
- asyncMessageSlots);
- }
- }
- } while (--retry > 0);
- User::LeaveIfError(errNo);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::startServerL()
-{
- RProcess server;
- const TUidType uid(KNullUid, KNullUid, KActivityServerUid);
- User::LeaveIfError(server.Create(KActivityServerName, KNullDesC, uid));
- TRequestStatus stat;
- server.Rendezvous(stat);
- if (stat != KRequestPending) {
- server.Kill(0);
- } else {
- server.Resume();
- }
- User::WaitForRequest(stat);
- int errNo = (EExitPanic == server.ExitType()) ?
- KErrGeneral : stat.Int();
- if (KErrCancel == errNo) {
- errNo = KErrNone;
- }
- server.Close();
- User::LeaveIfError(errNo);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::executeL(int function)
-{
- switch (function) {
- case WaitActivity:
- case NotifyChange:
- CAfAsyncRequestPrivate::NewLD(mObserver, *this, static_cast<ActivityCmd>(function));
- break;
- default:
- User::LeaveIfError(SendReceive(function, TIpcArgs()));
- }
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::executeL(int function,
- const CAfEntry &entry,
- int userData)
-{
- TPckgBuf<TInt> data(userData);
- RBuf8 serializedEntry;
- CleanupClosePushL(serializedEntry);
- serializedEntry.CreateL(entry.Size());
- RDesWriteStream stream(serializedEntry);
- CleanupClosePushL(stream);
- stream << entry;
- CleanupStack::PopAndDestroy(&stream);
- User::LeaveIfError(SendReceive(function, TIpcArgs(&serializedEntry, &data)));
- CleanupStack::PopAndDestroy(&serializedEntry);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::executeL(int function, RPointerArray<CAfEntry> &resultsList, const CAfEntry& templateEntry)
-{
- resultsList.ResetAndDestroy();
- RBuf8 buffer;
- CleanupClosePushL(buffer);
- CAfEntry::ReallocL(buffer, templateEntry.Size());
- RDesWriteStream writer(buffer);
- CleanupClosePushL(writer);
- writer << templateEntry;
- CleanupStack::PopAndDestroy(&writer);
- TPckgBuf<int> length(0), taskId(0);
- User::LeaveIfError(SendReceive(function,
- TIpcArgs(&buffer, &length, &taskId)));
- CAfEntry::ReallocL(buffer, length());
- User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &buffer)));
- resultsList << buffer;
- CleanupStack::PopAndDestroy(&buffer);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::getThumbnailL(TSize size,
- const TDesC& source,
- TAny *userData )
-{
- CAfThumbnailRequestPrivate::NewLD(mObserver, *this, size, source, userData);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::PushL(CBase* asyncTask)
-{
- const TInt offset(mAsyncTasks.Find(asyncTask));
- (KErrNotFound == offset) ? mAsyncTasks.AppendL(asyncTask) : User::Leave(KErrAlreadyExists);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::Pop(CBase* asyncTask)
-{
- const TInt offset(mAsyncTasks.Find(asyncTask));
- if (KErrNotFound != offset) {
- mAsyncTasks.Remove(offset);
- }
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::sendAsync(int function,
- const TIpcArgs& args,
- TRequestStatus& status)
-{
- SendReceive(function, args, status);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::getDataL(int id, TDes8& buffer)
-{
- TPckgBuf<int> requestId(id);
- SendReceive(GetData, TIpcArgs(&requestId, &buffer));
-}
--- a/activityfw/storage/client/s60/src/afthumbnailrequest_p.cpp Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +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 <fbs.h>
-#include <XQConversions>
-
-#include "afthumbnailrequest_p.h"
-#include "afstorageclient_p.h"
-#include "afstorageclient.h"
-#include "afentry.h"
-#include "afcmd.h"
-
-// -----------------------------------------------------------------------------
-/**
- * Create and initialize handler for activity thumbnail request
- * @param observer - request completion observer
- * @param session - activity client implementation
- * @param source - thumbnail source location
- * @param userData - rsponse user data
- */
-void CAfThumbnailRequestPrivate::NewLD(MAfAsyncRequestObserver &observer,
- RAfStorageClientImplementation & session,
- TSize resolution,
- const TDesC& source,
- TAny* userData)
-{
- CAfThumbnailRequestPrivate* self = new(ELeave)CAfThumbnailRequestPrivate(observer, session, userData);
- CleanupStack::PushL(self);
- self->ConstructL(resolution, source);
- session.PushL(self);
- CleanupStack::Pop(self);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Constructor
- * @param observer - request completion observer
- * @param session - activity client implementation
- * @param userData - rsponse user data
- */
-CAfThumbnailRequestPrivate::CAfThumbnailRequestPrivate(MAfAsyncRequestObserver & observer,
- RAfStorageClientImplementation & session,
- TAny* userData)
-:
-CActive(EPriorityStandard),
-mObserver(observer),
-mSession(session),
-mUserData(userData)
-{
- CActiveScheduler::Add(this);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Second phase constructor
- * @param resolution - requested thumbnail resolution
- * @param source - thumbnail source location
- */
-void CAfThumbnailRequestPrivate::ConstructL(TSize resolution, const TDesC& source)
-{
- mIds[0] = resolution.iWidth;
- mIds[1] = resolution.iHeight;
- CAfEntry::CopyL(mImgSrc, source);
- mSession.sendAsync(GetThumbnail,
- TIpcArgs(&mIds[0],&mIds[1], &mImgSrc),
- iStatus);
- SetActive();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destuctor
- */
-CAfThumbnailRequestPrivate::~CAfThumbnailRequestPrivate()
-{
- Cancel();
- mImgSrc.Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Cancel pending requst
- */
-void CAfThumbnailRequestPrivate::DoCancel()
-{
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function handle request completion, copy data, forward information and destroy handler
- */
-void CAfThumbnailRequestPrivate::RunL()
-{
- User::LeaveIfError(iStatus.Int());
- CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
- CleanupStack::PushL(bitmap);
- User::LeaveIfError(bitmap->Duplicate(mIds[0]()));
- mObserver.asyncRequestCompleated(iStatus.Int(),
- GetThumbnail,
- QPixmap::fromSymbianCFbsBitmap(bitmap),
- mUserData);
- CleanupStack::PopAndDestroy(bitmap);
- mSession.Pop(this);
- delete this;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function handle request processing errors
- * @param error - error code
- */
-TInt CAfThumbnailRequestPrivate::RunError(TInt error)
-{
- mObserver.asyncRequestCompleated(error, GetThumbnail, QPixmap(), mUserData);
- mSession.Pop(this);
- delete this;
- return KErrNone;
-}
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/src/afasyncrequest_p.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,139 @@
+/*
+* 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 "afasyncrequest_p.h"
+#include "afstorageclient_p.h"
+#include "afstorageclient.h"
+#include "afentry.h"
+
+#include <fbs.h>
+
+// -----------------------------------------------------------------------------
+/**
+ * Create and initialize handler for anyc. activity requests
+ * @param observer - request completion observer
+ * @param session - activity client implementation
+ * @param cmd - requested functionality
+ */
+void CAfAsyncRequestPrivate::NewLD(MAfAsyncRequestObserver &observer,
+ MAfAsyncSession & session,
+ ActivityCmd cmd)
+{
+ CAfAsyncRequestPrivate* self = new(ELeave)CAfAsyncRequestPrivate(observer, session, cmd);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ session.PushL(self);
+ CleanupStack::Pop(self);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * First phase construction
+ * @param observer - request completion observer
+ * @param session - activity client implementation
+ * @param cmd - requested functionality
+ */
+CAfAsyncRequestPrivate::CAfAsyncRequestPrivate(MAfAsyncRequestObserver & observer,
+ MAfAsyncSession & session,
+ ActivityCmd cmd)
+:
+CActive(EPriorityStandard),
+mObserver(observer),
+mSession(session),
+mCmd(cmd)
+{
+ CActiveScheduler::Add(this);
+ RProcess process;
+ mIds[0] = static_cast<TInt>(process.SecureId().iId);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Second phase construction
+ */
+void CAfAsyncRequestPrivate::ConstructL()
+{
+ mSession.sendAsync(mCmd,
+ TIpcArgs(&mIds[0],&mIds[1], &mIds[2], &mIds[3]),
+ iStatus);
+ SetActive();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Destructor
+ */
+CAfAsyncRequestPrivate::~CAfAsyncRequestPrivate()
+{
+ Cancel();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Cancel pending requst
+ */
+void CAfAsyncRequestPrivate::DoCancel()
+{
+ TRAP_IGNORE(
+ switch (mCmd) {
+ case WaitActivity: mSession.executeL(CancelWait); break;
+ case NotifyChange: mSession.executeL(CancelNotify); break;
+ }
+ )
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function handle request completion, copy data, forward information and destroy handler
+ */
+void CAfAsyncRequestPrivate::RunL()
+{
+ User::LeaveIfError(iStatus.Int());
+ switch (mCmd) {
+ case WaitActivity:
+ {
+ RBuf8 data;
+ CleanupClosePushL(data);
+ CAfEntry::ReallocL(data, (mIds[0])());
+ mSession.getDataL((mIds[3])(), data);
+ mObserver.waitActivityRequestCompleted(iStatus.Int(), data);
+ CleanupStack::PopAndDestroy(&data);
+ break;
+ }
+ case NotifyChange:
+ mObserver.dataChangeNotificationCompleted(iStatus.Int());
+ break;
+ }
+ mSession.Pop(this);
+ delete this;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function handle request processing errors
+ * @param error - error code
+ */
+TInt CAfAsyncRequestPrivate::RunError(TInt error)
+{
+ (WaitActivity == mCmd) ? mObserver.waitActivityRequestCompleted(error, KNullDesC8()) :
+ mObserver.dataChangeNotificationCompleted(error);
+ mSession.Pop(this);
+ delete this;
+ return KErrNone;
+}
+
+
--- a/activityfw/storage/client/src/afstorageclient.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/client/src/afstorageclient.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -15,123 +15,99 @@
*
*/
#include "afstorageclient.h"
+
+#include <e32debug.h>
+
#include "afstorageclient_p.h"
-
#include "afcmd.h"
// -----------------------------------------------------------------------------
/**
- * Constructor
+ * Two-phase constructor. Create and initialize instance
+ * @return entry instance
*/
-AfStorageClient::AfStorageClient(QObject *obj)
-:
-QObject(obj),
-d_ptr(0)
+EXPORT_C CAfStorageClient *CAfStorageClient::NewL(MAfAsyncRequestObserver &observer)
{
- d_ptr = new AfStorageClientPrivate(*this);
+ CAfStorageClient *self = CAfStorageClient::NewLC(observer);
+ CleanupStack::Pop(self);
+ return self;
}
// -----------------------------------------------------------------------------
/**
+ * Two-phase constructor. Create, initialize and push instance into cleanup stack
+ * @return entry instance
+ */
+EXPORT_C CAfStorageClient *CAfStorageClient::NewLC(MAfAsyncRequestObserver &observer)
+{
+ CAfStorageClient *self = new (ELeave) CAfStorageClient();
+ CleanupStack::PushL(self);
+ self->ConstructL(observer);
+ return self;
+}
+
+// -----------------------------------------------------------------------------
+/**
* Destructor
*/
-AfStorageClient::~AfStorageClient()
+EXPORT_C CAfStorageClient::~CAfStorageClient()
{
delete d_ptr;
}
-
+
// -----------------------------------------------------------------------------
/**
- * Establish connection with activity server
- * @return 0 on succees, error code otherwise
+ * Constructor
*/
-int AfStorageClient::connect()
+CAfStorageClient::CAfStorageClient()
{
- return d_ptr->connect();
}
// -----------------------------------------------------------------------------
/**
- * Interface implementation.
- * @see int MAfAsyncRequestObserver::asyncRequestCompleated(int, int, const QString&)
- */
-void AfStorageClient::asyncRequestCompleated(int result,
- int requestType,
- const QString& data)
-{
- switch (requestType) {
- case WaitActivity:
- if (KErrCancel != result) {
- waitActivity();
- }
- if (KErrNone == result) {
- emit activityRequested(data);
- }
-
- break;
- }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int MAfAsyncRequestObserver::asyncRequestCompleated(int, int, QPixmap&, void*)
+ * 2nd phase of construction
*/
-void AfStorageClient::asyncRequestCompleated(int result,
- int requestType,
- const QPixmap& pixmap,
- void* userData)
+void CAfStorageClient::ConstructL(MAfAsyncRequestObserver &observer)
{
- switch (requestType) {
- case GetThumbnail:
- emit thumbnailRequested(0 == result ? pixmap : QPixmap(),
- userData);
- break;
- }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int MAfAsyncRequestObserver::asyncRequestCompleated(int, int)
- */
-void AfStorageClient::asyncRequestCompleated(int result,int requestType)
-{
- switch(requestType) {
- case NotifyChange:
- if (KErrCancel != result) {
- notifyDataChange();
- }
- if (KErrNone == result) {
- emit dataChanged();
- }
- break;
- }
+ d_ptr = CAfStorageClientPrivate::NewL(observer);
}
// -----------------------------------------------------------------------------
/**
* Function add new activity
* @param entry - activity entry data structure
- * @param imageSource - source for activity thumbnail
+ * @param imageHandle - handle for activity thumbnail
* @return 0 on success, error code otherwise
*/
-int AfStorageClient::addActivity(const AfStorageEntry &entry, const QPixmap &imageSource)
+EXPORT_C int CAfStorageClient::addActivity(const CAfEntry &entry, TInt imageHandle)
{
- return d_ptr->addActivity(entry, imageSource);
+ 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 imageSource - source for activity thumbnail
+ * @param imageHandle - handle for activity thumbnail
* @return 0 on success, error code otherwise
*/
-int AfStorageClient::updateActivity(const AfStorageEntry &entry,
- const QPixmap &imageSource)
+EXPORT_C int CAfStorageClient::updateActivity(const CAfEntry &entry, TInt imageHandle)
{
- return d_ptr->updateActivity(entry, imageSource);
+ 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
+ * @return 0 on success, error code otherwise
+ */
+EXPORT_C int CAfStorageClient::saveActivity(const CAfEntry &entry, TInt imageHandle)
+{
+ return d_ptr->saveActivity(entry, imageHandle);
}
// -----------------------------------------------------------------------------
@@ -140,7 +116,7 @@
* @param entry - activity entry template
* @return 0 on success, error code otherwise
*/
-int AfStorageClient::removeActivity(const AfStorageEntry &entry)
+EXPORT_C int CAfStorageClient::removeActivity(const CAfEntry &entry)
{
return d_ptr->removeActivity(entry);
}
@@ -151,7 +127,7 @@
* @param entry - activity entry template
* @return 0 on success, error code otherwise
*/
-int AfStorageClient::removeApplicationActivities(const AfStorageEntry &entry)
+EXPORT_C int CAfStorageClient::removeApplicationActivities(const CAfEntry &entry)
{
return d_ptr->removeApplicationActivities(entry);
}
@@ -162,7 +138,7 @@
* @param dst - list of results
* @return 0 on success, error code otherwise
*/
-int AfStorageClient::activities(QList<AfStorageEntry> &dst)
+EXPORT_C int CAfStorageClient::activities(RPointerArray<CAfEntry> &dst)
{
return d_ptr->activities(dst);
}
@@ -174,8 +150,7 @@
* @param entry - activity template
* @return 0 on success, error code otherwise
*/
-int AfStorageClient::applicationActivities(QList<AfStorageEntry> &dst,
- const AfStorageEntry &entry)
+EXPORT_C int CAfStorageClient::applicationActivities(RPointerArray<CAfEntry> &dst, const CAfEntry &entry)
{
return d_ptr->applicationActivities(dst, entry);
}
@@ -187,7 +162,7 @@
* @param entry - activity template
* @return 0 on success, error code otherwise
*/
-int AfStorageClient::activityData(AfStorageEntry &dst, const AfStorageEntry &entry)
+EXPORT_C int CAfStorageClient::activityData(CAfEntry *&dst, const CAfEntry &entry)
{
return d_ptr->activityData(dst, entry);
}
@@ -197,7 +172,7 @@
* Function subscribe application for notyfication about requested activity changes
* @return 0 on success, error code otherwise
*/
-int AfStorageClient::waitActivity()
+EXPORT_C int CAfStorageClient::waitActivity()
{
return d_ptr->waitActivity();
}
@@ -208,15 +183,15 @@
* @param entry - activity template
* @return 0 on success, error code otherwise
*/
-int AfStorageClient::launchActivity(const AfStorageEntry &entry)
+EXPORT_C int CAfStorageClient::launchActivity(const CAfEntry &entry)
{
return d_ptr->launchActivity(entry);
}
// -----------------------------------------------------------------------------
-int AfStorageClient::getThumbnail(QSize size, QString imagePath, void* userDdata)
+EXPORT_C int CAfStorageClient::getThumbnail(const TSize &size, const TDesC &imagePath, void *userData)
{
- return d_ptr->getThumbnail(size, imagePath, userDdata);
+ return d_ptr->getThumbnail(size, imagePath, userData);
}
// -----------------------------------------------------------------------------
@@ -224,7 +199,7 @@
* Function subscribe launcher for data model changes
* @return 0 on success, error code otherwise
*/
-int AfStorageClient::notifyDataChange()
+EXPORT_C int CAfStorageClient::notifyDataChange()
{
- return d_ptr->notifyDataChange();
+ return d_ptr->notifyDataChange();
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/src/afstorageclient_p.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,250 @@
+/*
+* 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 "afstorageclient_p.h"
+
+#include <fbs.h>
+#include <s32mem.h>
+
+#include "afasyncrequest_p.h"
+#include "afstorageglobals.h"
+#include "afentry.h"
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create and initialize instance
+ * @return entry instance
+ */
+CAfStorageClientPrivate *CAfStorageClientPrivate::NewL(MAfAsyncRequestObserver &observer)
+{
+ CAfStorageClientPrivate *self = CAfStorageClientPrivate::NewLC(observer);
+ CleanupStack::Pop(self);
+ return self;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create, initialize and push instance into cleanup stack
+ * @return entry instance
+ */
+CAfStorageClientPrivate *CAfStorageClientPrivate::NewLC(MAfAsyncRequestObserver &observer)
+{
+ CAfStorageClientPrivate *self = new (ELeave) CAfStorageClientPrivate(observer);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Destructor
+ */
+CAfStorageClientPrivate::~CAfStorageClientPrivate()
+{
+ mImplementation.Close();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Constructor
+ */
+CAfStorageClientPrivate::CAfStorageClientPrivate(MAfAsyncRequestObserver &observer) : mImplementation(observer)
+{
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * 2nd phase of construction
+ */
+void CAfStorageClientPrivate::ConstructL()
+{
+ mImplementation.connectL();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * 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)
+{
+ return execute(SaveActivity, entry, imageHandle);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::removeActivity(const CAfEntry &)
+ */
+int CAfStorageClientPrivate::removeActivity(const CAfEntry &entry)
+{
+ return execute(RemoveActivity, entry, -1);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::removeApplicationActivities(const CAfEntry &)
+ */
+int CAfStorageClientPrivate::removeApplicationActivities(const CAfEntry &entry)
+{
+ return execute(RemoveApplicationActivities, entry, -1);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::activities(RPointerArray<CAfEntry> &)
+ */
+int CAfStorageClientPrivate::activities(RPointerArray<CAfEntry> &results)
+{
+ CAfEntry *entry = CAfEntry::NewL();
+ TInt result = execute(Activities, results, *entry);
+ delete entry;
+ return result;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::applicationActivities(RPointerArray<CAfEntry> &, const CAfEntry &)
+ */
+int CAfStorageClientPrivate::applicationActivities(RPointerArray<CAfEntry> &results, const CAfEntry &templateEntry)
+{
+ return execute(ApplicationActivities, results, templateEntry);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::activityData(CAfEntry &, const CAfEntry &)
+ */
+int CAfStorageClientPrivate::activityData(CAfEntry *&resultEntry, const CAfEntry &templateEntry)
+{
+ RPointerArray<CAfEntry> results;
+ int errNo(execute(ApplicationActivity, results, templateEntry));
+ if (KErrNone == errNo && results.Count() > 0) {
+ resultEntry = results[0];
+ results.Remove(0);
+ }
+ results.ResetAndDestroy();
+ return errNo;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::waitActivity()
+ */
+int CAfStorageClientPrivate::waitActivity()
+{
+ CAfEntry *entry = CAfEntry::NewL();
+ TInt result = execute(WaitActivity, *entry, -1);
+ delete entry;
+ return result;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::getThumbnail(const TSize &size, const TDesC &imagePath, void *userData)
+ */
+int CAfStorageClientPrivate::getThumbnail(const TSize &size, const TDesC &imagePath, void *userData)
+{
+ TRAPD(errNo, mImplementation.getThumbnailL(size, imagePath, userData);)
+ return errNo;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::notifyDataChange()
+ */
+int CAfStorageClientPrivate::notifyDataChange()
+{
+ CAfEntry *entry = CAfEntry::NewL();
+ TInt result = execute(NotifyChange, *entry, -1);
+ delete entry;
+ return result;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::launchActivity(const CAfEntry &)
+ */
+int CAfStorageClientPrivate::launchActivity(const CAfEntry &templateEntry)
+{
+ return execute(LaunchActivity, templateEntry, -1);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function execute activity framework functinality and return results
+ */
+int CAfStorageClientPrivate::execute(int function, const CAfEntry &sourceEntry, TInt imageHandle)
+{
+ TRAPD(errNo,
+ switch (function) {
+ case AddActivity:
+ case UpdateActivity:
+ case SaveActivity:
+ case RemoveActivity:
+ case RemoveApplicationActivities:
+ case LaunchActivity:
+ mImplementation.executeL(function, sourceEntry, imageHandle);
+ break;
+
+ case WaitActivity:
+ case NotifyChange:
+ mImplementation.executeL(function);
+ break;
+ default:
+ User::Leave(KErrArgument);
+ }
+ )
+ return errNo;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function execute activity framework functinality and return results
+ */
+int CAfStorageClientPrivate::execute(int function, RPointerArray<CAfEntry>& resultsList,const CAfEntry& templateEntry)
+{
+ TRAPD(errNo, mImplementation.executeL(function, resultsList, templateEntry);)
+ return errNo;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/src/afstorageclientimp.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,192 @@
+/*
+* 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 "afstorageclientimp.h"
+
+#include <fbs.h>
+#include <s32mem.h>
+
+#include "afstorageglobals.h"
+#include "afglobals.h"
+#include "afentry.h"
+#include "afasyncrequest_p.h"
+#include "afthumbnailrequest_p.h"
+
+// -----------------------------------------------------------------------------
+/**
+ * Furst phase constructor
+ */
+RAfStorageClientImplementation::RAfStorageClientImplementation(MAfAsyncRequestObserver &observer)
+:
+mObserver(observer)
+{}
+
+// -----------------------------------------------------------------------------
+/**
+ * Destructor
+ */
+RAfStorageClientImplementation::~RAfStorageClientImplementation()
+{
+ Close();
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::Close()
+{
+ mAsyncTasks.ResetAndDestroy();
+ RSessionBase::Close();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function establish connection to activity server
+ */
+void RAfStorageClientImplementation::connectL()
+{
+ const int asyncMessageSlots(12);
+ const int maxRetry(4);
+ TInt retry = maxRetry;
+ TInt errNo(KErrNone);
+ do {
+ errNo = CreateSession(KActivityServerName,
+ TVersion(0, 0, 0),
+ asyncMessageSlots);
+ if (KErrNotFound != errNo && KErrServerTerminated != errNo) {
+ retry =0;
+ } else {
+ TRAP(errNo, startServerL());
+ if (KErrNone != errNo && KErrAlreadyExists != errNo) {
+ retry =0;
+ errNo = CreateSession(KActivityServerName,
+ TVersion(0, 0, 0),
+ asyncMessageSlots);
+ }
+ }
+ } while (--retry > 0);
+ User::LeaveIfError(errNo);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::startServerL()
+{
+ RProcess server;
+ const TUidType uid(KNullUid, KNullUid, KActivityServerUid);
+ User::LeaveIfError(server.Create(KActivityServerName, KNullDesC, uid));
+ TRequestStatus stat;
+ server.Rendezvous(stat);
+ if (stat != KRequestPending) {
+ server.Kill(0);
+ } else {
+ server.Resume();
+ }
+ User::WaitForRequest(stat);
+ int errNo = (EExitPanic == server.ExitType()) ?
+ KErrGeneral : stat.Int();
+ if (KErrCancel == errNo) {
+ errNo = KErrNone;
+ }
+ server.Close();
+ User::LeaveIfError(errNo);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::executeL(int function)
+{
+ switch (function) {
+ case WaitActivity:
+ case NotifyChange:
+ CAfAsyncRequestPrivate::NewLD(mObserver, *this, static_cast<ActivityCmd>(function));
+ break;
+ default:
+ User::LeaveIfError(SendReceive(function, TIpcArgs()));
+ }
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::executeL(int function,
+ const CAfEntry &entry,
+ int userData)
+{
+ TPckgBuf<TInt> data(userData);
+ RBuf8 serializedEntry;
+ CleanupClosePushL(serializedEntry);
+ serializedEntry.CreateL(entry.Size());
+ RDesWriteStream stream(serializedEntry);
+ CleanupClosePushL(stream);
+ stream << entry;
+ CleanupStack::PopAndDestroy(&stream);
+ User::LeaveIfError(SendReceive(function, TIpcArgs(&serializedEntry, &data)));
+ CleanupStack::PopAndDestroy(&serializedEntry);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::executeL(int function, RPointerArray<CAfEntry> &resultsList, const CAfEntry& templateEntry)
+{
+ resultsList.ResetAndDestroy();
+ RBuf8 buffer;
+ CleanupClosePushL(buffer);
+ CAfEntry::ReallocL(buffer, templateEntry.Size());
+ RDesWriteStream writer(buffer);
+ CleanupClosePushL(writer);
+ writer << templateEntry;
+ CleanupStack::PopAndDestroy(&writer);
+ TPckgBuf<int> length(0), taskId(0);
+ User::LeaveIfError(SendReceive(function,
+ TIpcArgs(&buffer, &length, &taskId)));
+ CAfEntry::ReallocL(buffer, length());
+ User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &buffer)));
+ resultsList << buffer;
+ CleanupStack::PopAndDestroy(&buffer);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::getThumbnailL(TSize size,
+ const TDesC& source,
+ TAny *userData )
+{
+ CAfThumbnailRequestPrivate::NewLD(mObserver, *this, size, source, userData);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::PushL(CBase* asyncTask)
+{
+ const TInt offset(mAsyncTasks.Find(asyncTask));
+ (KErrNotFound == offset) ? mAsyncTasks.AppendL(asyncTask) : User::Leave(KErrAlreadyExists);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::Pop(CBase* asyncTask)
+{
+ const TInt offset(mAsyncTasks.Find(asyncTask));
+ if (KErrNotFound != offset) {
+ mAsyncTasks.Remove(offset);
+ }
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::sendAsync(int function,
+ const TIpcArgs& args,
+ TRequestStatus& status)
+{
+ SendReceive(function, args, status);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::getDataL(int id, TDes8& buffer)
+{
+ TPckgBuf<int> requestId(id);
+ SendReceive(GetData, TIpcArgs(&requestId, &buffer));
+}
--- a/activityfw/storage/client/src/afstorageentry.cpp Fri Jul 23 14:03:00 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:
-*
-*/
-
-#include <xqconversions.h>
-
-#include "afstorageentry.h"
-#include "afentry.h"
-#include "afserializer.h"
-#include "afstorageglobals.h"
-// -----------------------------------------------------------------------------
-/**
- * Constructor.
- * Initialize object with preallocated symbian specyfic data structure. Function doesn't copy content
- * @param data - pointer to symbian specyfic data structure
- */
-AfStorageEntry::AfStorageEntry(QSharedPointer<CAfEntry> data)
-:
-mData(data)
-{}
-
-// -----------------------------------------------------------------------------
-/**
-* Constructor
-* Initialize object with preallocated data structure. Function doesn't copy content
-* @param data - activity data structure
-*/
-AfStorageEntry::AfStorageEntry(const AfStorageEntry &data)
-:
- mData(data.mData)
-{}
-
-// -----------------------------------------------------------------------------
-/**
- * Constructor
- * Initialize object with data. Function do deep copy of data
- * @param appId - unique application identifier
- * @param actId - activity identifier
- * @param privateData - private part of activity data
- * @param publicData - public part of activity data
- */
-AfStorageEntry::AfStorageEntry(int appId,
- const QString &actId,
- const QVariant &privateData,
- const QVariantHash& publicData)
-:
- mData(0)
-{
- int flags(0);
- QVariantHash privData;
- privData.insert(ActivityDataKeyword, privateData);
- RBuf8 privateBuff, publicBuff;
- CleanupClosePushL(privateBuff);
- CleanupClosePushL(publicBuff);
- privateBuff << privData;
- publicBuff << publicData;
-
- if (publicData.end() != publicData.find(ActivityPersistence) &&
- publicData[ActivityPersistence].toBool()) {
- flags |= CAfEntry::Persistent;
- }
-
- if (publicData.end() != publicData.find(ActivityVisibility) &&
- !publicData[ActivityVisibility].toBool()) {
- flags |= CAfEntry::Invisible;
- }
-
- HBufC *actBuff = XQConversions::qStringToS60Desc(actId);
- CleanupStack::PushL(actBuff);
- mData = QSharedPointer<CAfEntry>(CAfEntry::NewL(flags,
- appId,
- *actBuff,
- KNullDesC,
- privateBuff,
- publicBuff));
- CleanupStack::PopAndDestroy(actBuff);
- CleanupStack::PopAndDestroy(&publicBuff);
- CleanupStack::PopAndDestroy(&privateBuff);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve S60 structure representation
- */
-const CAfEntry* AfStorageEntry::data() const
-{
- return mData.data();
-}
-
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve activity flags
- * @return activity flags
- */
-int AfStorageEntry::flags() const
-{
- return mData->Flags();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve application unique identifier
- * @return application identifier
- */
-int AfStorageEntry::applicationId() const
-{
- return mData->ApplicationId();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve activity identifier. Identyfier is unique for each application
- * @return activity identifier
- */
-QString AfStorageEntry::activityId() const
-{
- return XQConversions::s60DescToQString(mData->ActivityId());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve path to activity thumbanil path
- * @return thumbail loacation path
- */
-QString AfStorageEntry::imageSrc() const
-{
- return XQConversions::s60DescToQString(mData->ImageSrc());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve public part of activity data
- * @return public activity data
- */
-QVariantHash AfStorageEntry::publicData() const
-{
- QVariantHash deserializedData;
- deserializedData << mData->Data(CAfEntry::Public);
- deserializedData.insert(ActivityApplicationKeyword, applicationId());
- deserializedData.insert(ActivityActivityKeyword, activityId());
- deserializedData.insert(ActivityScreenshotKeyword, imageSrc());
- deserializedData.insert(ActivityPersistence, (flags() & CAfEntry::Persistent) ? true : false);
- deserializedData.insert(ActivityVisibility, (flags() & CAfEntry::Invisible) ? false : true);
- return deserializedData;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve private part of activity data
- * @return private activity data
- */
-QVariant AfStorageEntry::privateData() const
-{
- QVariantHash deserializedData;
- deserializedData << mData->Data(CAfEntry::Private);
- return deserializedData[ActivityDataKeyword];
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/src/afthumbnailrequest_p.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,131 @@
+/*
+* 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 <fbs.h>
+
+#include "afthumbnailrequest_p.h"
+#include "afstorageclient_p.h"
+#include "afstorageclient.h"
+#include "afentry.h"
+#include "afcmd.h"
+
+// -----------------------------------------------------------------------------
+/**
+ * Create and initialize handler for activity thumbnail request
+ * @param observer - request completion observer
+ * @param session - activity client implementation
+ * @param source - thumbnail source location
+ * @param userData - rsponse user data
+ */
+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);
+ session.PushL(self);
+ CleanupStack::Pop(self);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Constructor
+ * @param observer - request completion observer
+ * @param session - activity client implementation
+ * @param userData - rsponse user data
+ */
+CAfThumbnailRequestPrivate::CAfThumbnailRequestPrivate(MAfAsyncRequestObserver & observer,
+ MAfAsyncSession & session,
+ TAny* userData)
+:
+CActive(EPriorityStandard),
+mObserver(observer),
+mSession(session),
+mUserData(userData)
+{
+ CActiveScheduler::Add(this);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Second phase constructor
+ * @param resolution - requested thumbnail resolution
+ * @param source - thumbnail source location
+ */
+void CAfThumbnailRequestPrivate::ConstructL(TSize resolution, const TDesC& source)
+{
+ mIds[0] = resolution.iWidth;
+ mIds[1] = resolution.iHeight;
+ CAfEntry::CopyL(mImgSrc, source);
+ mSession.sendAsync(GetThumbnail,
+ TIpcArgs(&mIds[0],&mIds[1], &mImgSrc),
+ iStatus);
+ SetActive();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Destuctor
+ */
+CAfThumbnailRequestPrivate::~CAfThumbnailRequestPrivate()
+{
+ Cancel();
+ mImgSrc.Close();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Cancel pending requst
+ */
+void CAfThumbnailRequestPrivate::DoCancel()
+{
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function handle request completion, copy data, forward information and destroy handler
+ */
+void CAfThumbnailRequestPrivate::RunL()
+{
+ User::LeaveIfError(iStatus.Int());
+ mObserver.getThumbnailRequestCompleted(iStatus.Int(),
+ mIds[0](),
+ mUserData);
+ RBuf8 data;
+ CleanupClosePushL(data);
+ mSession.getDataL((mIds[1])(), data);
+ CleanupStack::PopAndDestroy(&data);
+ mSession.Pop(this);
+ delete this;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function handle request processing errors
+ * @param error - error code
+ */
+TInt CAfThumbnailRequestPrivate::RunError(TInt error)
+{
+ mObserver.getThumbnailRequestCompleted(error, -1, mUserData);
+ mSession.Pop(this);
+ delete this;
+ return KErrNone;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/common.pro Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,19 @@
+#
+# 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\""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/group/bld.inf Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* 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
+common.mmp
+
+PRJ_EXPORTS
+../inc/afcmd.h |../../inc/afcmd.h
+../inc/afglobals.h |../../inc/afglobals.h
+
+// afentry have to be exported also to activityfw, because of dependecies
+// in afstorageentry.h exported from client.
+../inc/afentry.h |../../inc/afentry.h
+../inc/afentry.h |../../../inc/afentry.h
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/group/common.mmp Fri Aug 06 13:40:46 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:
+*
+*/
+TARGET afstoragecommon.lib
+TARGETTYPE LIB
+
+UID 0x20026783
+SECUREID 0x20026783
+
+MW_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE ../inc
+
+SOURCEPATH ../src
+SOURCE afentry.cpp
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE_UDEBONLY
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/inc/afcmd.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* 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 AFCMD_H
+#define AFCMD_H
+
+const TInt KRequestAppIdOffset(0);
+const TInt KRequestActOffset(1);
+const TInt KRequestData(2);
+const TInt KRequestIdOffset(0);
+
+const TInt KResponseDataSizeOffset(0);
+const TInt KResponseIdOffset(3);
+const TInt KResponseDataOffset(1);
+
+
+enum ActivityCmd {
+ AddActivity =0,
+ UpdateActivity,
+ RemoveActivity,
+ RemoveApplicationActivities,
+ Activities,
+ ApplicationActivities,
+ ApplicationActivity,
+ WaitActivity,
+ LaunchActivity,
+ GetThumbnail,
+ GetData,
+ NotifyChange,
+ CancelWait,
+ CancelNotify,
+ SaveActivity
+};
+
+#endif //AFCMD_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/inc/afentry.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* 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 AFENTRYDATA_H
+#define AFENTRYDATA_H
+
+#include <e32base.h>
+#include <s32strm.h>
+class RDbColWriteStream;
+class RDbColReadStream;
+const TInt KAfMask(0x0001);
+
+#ifdef AF_ADD_MASK
+#undef AF_ADD_MASK
+#endif
+#define AF_ADD_MASK(n) (KAfMask << n)
+
+class CAfEntry: public CBase
+{
+public:
+ enum AccessRights {
+ Private =0,
+ Public
+ };
+
+ enum Flags {
+ Invisible = KAfMask,
+ Persistent = 0x40000000,
+ };
+
+public:
+ static CAfEntry* NewL();
+
+ static CAfEntry* NewLC();
+
+ static CAfEntry* NewL(TInt flags,
+ TInt applicationId,
+ const TDesC &activityId,
+ const TDesC &imgSrc,
+ const TDesC8 &privateData,
+ const TDesC8 &publicData);
+
+ static CAfEntry* NewLC(TInt flags,
+ TInt applicationId,
+ const TDesC &activityId,
+ const TDesC &imgSrc,
+ const TDesC8 &privateData,
+ const TDesC8 &publicData);
+
+ static CAfEntry* NewLC(const RMessage2& msg,
+ int offset =0);
+
+ ~CAfEntry();
+
+ TInt Size() const;
+
+ TInt DataSize() const;
+
+ void ExternalizeL(RWriteStream &stream) const;
+
+ void InternalizeL(RReadStream &stream);
+
+ void ExternalizeDataOnlyL(RWriteStream &stream) const;
+
+ void InternalizeDataOnlyL(RReadStream &stream);
+
+ TInt Flags() const;
+
+ TInt ApplicationId() const;
+
+ const TDesC& ActivityId() const;
+
+ const TDesC& ImageSrc() const;
+
+ void SetImageSrcL(const TDesC& src);
+
+ const TDesC8& Data(CAfEntry::AccessRights rights) const;
+
+ void SetDataL(const TDesC8& src, CAfEntry::AccessRights rights);
+
+ static void ReallocL(RBuf8 &dst,TInt length);
+
+ static void ReallocL(RBuf &dst,TInt length);
+
+ static void CopyL(RBuf8 &dst,const TDesC8 &src);
+
+ static void CopyL(RBuf &dst,const TDesC &src);
+
+private:
+ CAfEntry();
+
+ void ConstructL(TInt flags,
+ TInt applicationId,
+ const TDesC &activityId,
+ const TDesC &imgSrc,
+ const TDesC8 &privateData,
+ const TDesC8 &publicData);
+
+ static void InternalizeL(RBuf8 &dst, RReadStream &src);
+
+ static void InternalizeL(RBuf &dst, RReadStream &src);
+
+ static void ExternalizeL(RWriteStream &dst,const TDesC8 & src);
+
+ static void ExternalizeL(RWriteStream &dst,const TDesC& src);
+private:
+ TInt mFlags;
+ TInt mAppId;
+ RBuf mActivityId;
+ RBuf mImgSrc;
+ RBuf8 mPrivateData;
+ RBuf8 mPublicData;
+
+};
+
+RPointerArray<CAfEntry>& operator <<(RPointerArray<CAfEntry>& dst, const TDesC8 &src);
+
+RBuf8& operator << (RBuf8 &dst, const RPointerArray<CAfEntry>& src);
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/inc/afglobals.h Fri Aug 06 13:40:46 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:
+*
+*/
+#ifndef AFGLOBALS_H
+#define AFGLOBALS_H
+
+#include <e32base.h>
+const TUid KActivityServerUid = {0x200267B4};
+_LIT(KActivityServerName, "hsactivitydbserver");
+
+#endif //AFGLOBALS_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/src/afentry.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,461 @@
+/*
+* 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 "afentry.h"
+#include <s32mem.h>
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create and initialize instance
+ * @return entry instance
+ */
+CAfEntry* CAfEntry::NewL()
+{
+ CAfEntry *self = CAfEntry::NewLC();
+ CleanupStack::Pop(self);
+ return self;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create, initialize and push instance into cleanup stack
+ * @return entry instance
+ */
+CAfEntry* CAfEntry::NewLC()
+{
+ CAfEntry *self = new (ELeave)CAfEntry();
+ CleanupStack::PushL(self);
+ return self;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create and initialize instance
+ * @param flags - entry flags
+ * @param applicationId - application unique identifier
+ * @param activityId - activity unique identifier
+ * @param imgSrc - thumbanail source
+ * @param privateData - privated application data
+ * @param publicData - public activity data
+ * @return entry instance
+ */
+CAfEntry* CAfEntry::NewL(TInt flags,
+ TInt applicationId,
+ const TDesC &activityId,
+ const TDesC &imgSrc,
+ const TDesC8 &privateData,
+ const TDesC8 &publicData)
+{
+ CAfEntry* self = CAfEntry::NewLC(flags,
+ applicationId,
+ activityId,
+ imgSrc,
+ privateData,
+ publicData);
+ CleanupStack::Pop(self);
+ return self;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create, initialize and push instance into cleanup stack
+ * @param flags - entry flags
+ * @param applicationId - application unique identifier
+ * @param activityId - activity unique identifier
+ * @param imgSrc - thumbanail source
+ * @param privateData - privated application data
+ * @param publicData - public activity data
+ * @return entry instance
+ */
+CAfEntry* CAfEntry::NewLC(TInt flags,
+ TInt applicationId,
+ const TDesC &activityId,
+ const TDesC &imgSrc,
+ const TDesC8 &privateData,
+ const TDesC8 &publicData)
+{
+ CAfEntry *self = CAfEntry::NewLC();
+ self->ConstructL(flags,
+ applicationId,
+ activityId,
+ imgSrc,
+ privateData,
+ publicData);
+ return self;
+}
+
+// -----------------------------------------------------------------------------
+CAfEntry* CAfEntry::NewLC(const RMessage2& msg, int offset)
+{
+ CAfEntry* self = CAfEntry::NewLC();
+ RBuf8 serializedEntry;
+ CleanupClosePushL(serializedEntry);
+ ReallocL(serializedEntry, msg.GetDesMaxLength(offset));
+ msg.ReadL(offset, serializedEntry);
+ RDesReadStream entryReader(serializedEntry);
+ CleanupClosePushL(entryReader);
+ entryReader >> (*self);
+ CleanupStack::PopAndDestroy(&entryReader);
+ CleanupStack::PopAndDestroy(&serializedEntry);
+ return self;
+}
+// -----------------------------------------------------------------------------
+/**
+ * First phase constructor
+ */
+CAfEntry::CAfEntry()
+{
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Second phase constructor. Initialize instance
+ * @param flags - entry flags
+ * @param applicationId - application unique identifier
+ * @param activityId - activity unique identifier
+ * @param imgSrc - thumbanail source
+ * @param privateData - privated application data
+ * @param publicData - public activity data
+ */
+void CAfEntry::ConstructL(TInt flags,
+ TInt applicationId,
+ const TDesC &activityId,
+ const TDesC &imgSrc,
+ const TDesC8 &privateData,
+ const TDesC8 &publicData)
+{
+ mFlags = flags;
+ mAppId = applicationId;
+ CopyL(mActivityId, activityId);
+ CopyL(mImgSrc, imgSrc);
+ CopyL(mPrivateData, privateData);
+ CopyL(mPublicData, publicData);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Destructor. Release allocated resources
+ */
+CAfEntry::~CAfEntry()
+{
+ mActivityId.Close();
+ mPrivateData.Close();
+ mPublicData.Close();
+ mImgSrc.Close();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide size of serialized entry
+ * @return size of serialized entry instance
+ */
+TInt CAfEntry::Size() const
+{
+ return (sizeof(TInt) * 3) + //flags + appId + actId size info
+ mActivityId.Size() + //actId content size
+ DataSize(); //data size
+
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide size of serialized entry
+ * @return size of serialized entry instance
+ */
+TInt CAfEntry::DataSize() const
+{
+ return (sizeof(TInt) * 3) + //privData size info + pubData size info + imgSrc size info
+ mImgSrc.Size() + //imgSize content size
+ mPrivateData.Size() + //privData content size
+ mPublicData.Size(); //pubData content size
+}
+// -----------------------------------------------------------------------------
+/**
+ * Serialize entry content into output stream.
+ * @param stream - output stream
+ */
+void CAfEntry::ExternalizeL(RWriteStream &stream) const
+{
+ stream.WriteInt32L(mFlags);
+ stream.WriteInt32L(mAppId);
+ ExternalizeL(stream, mActivityId);
+ ExternalizeDataOnlyL(stream);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Deserialize entry content from input stream
+ * @param stream - input stream
+ */
+void CAfEntry::InternalizeL(RReadStream &stream)
+{
+ mFlags = stream.ReadInt32L();
+ mAppId = stream.ReadInt32L();
+ InternalizeL(mActivityId, stream);
+ InternalizeDataOnlyL(stream);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Serialize entry content into output stream.
+ * @param stream - output stream
+ */
+void CAfEntry::ExternalizeDataOnlyL(RWriteStream &stream) const
+{
+ ExternalizeL(stream, mImgSrc);
+ ExternalizeL(stream, mPrivateData);
+ ExternalizeL(stream, mPublicData);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Deserialize entry content from input stream
+ * @param stream - input stream
+ */
+void CAfEntry::InternalizeDataOnlyL(RReadStream &stream)
+{
+
+ InternalizeL(mImgSrc, stream);
+ InternalizeL(mPrivateData, stream);
+ InternalizeL(mPublicData, stream);
+
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity flags
+ * @return activity flags
+ */
+TInt CAfEntry::Flags() const
+{
+ return mFlags;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity identifier.
+ * @return activity identifier
+ */
+TInt CAfEntry::ApplicationId() const
+{
+ return mAppId;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity identifier.
+ * @return activity identifier
+ */
+const TDesC& CAfEntry::ActivityId() const
+{
+ return mActivityId;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity data.
+ * @param rights - type of requested data
+ * @return activity data
+ */
+const TDesC8& CAfEntry::Data(CAfEntry::AccessRights rights) const
+{
+ return Private == rights ? mPrivateData : mPublicData;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity data.
+ * @param rights - type of requested data
+ * @return activity data
+ */
+void CAfEntry::SetDataL(const TDesC8& src, CAfEntry::AccessRights rights)
+{
+ CopyL(Private == rights ? mPrivateData : mPublicData, src);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity thumbail path
+ * @return path to activity thumbnail
+ */
+const TDesC& CAfEntry::ImageSrc() const
+{
+ return mImgSrc;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Set new value of image source
+ */
+void CAfEntry::SetImageSrcL(const TDesC& src)
+{
+ CopyL(mImgSrc, src);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Reallocate blob buffer to requested size
+ * @param dst - destination buffer
+ * @param length - requested length
+ */
+void CAfEntry::ReallocL(RBuf8 &dst,TInt length)
+{
+ if (0 < length) {
+ if (dst.MaxLength() < length) {
+ dst.ReAllocL(length);
+ }
+ } else {
+ dst.Close();
+ }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Reallocate text buffer to requested size
+ * @param dst - destination buffer
+ * @param length - requested length
+ */
+void CAfEntry::ReallocL(RBuf &dst,TInt length)
+{
+ if (0 < length) {
+ if (dst.MaxLength() < length) {
+ dst.ReAllocL(length);
+ }
+ } else {
+ dst.Close();
+ }
+}
+// -----------------------------------------------------------------------------
+/**
+ * Copy blob content from input stream
+ * @param dst - destination buffer
+ * @param src - source buffer
+ */
+void CAfEntry::CopyL(RBuf8 &dst,const TDesC8 &src)
+{
+ ReallocL(dst, src.Length());
+ if(0 < src.Length()) {
+ dst.Copy(src);
+ }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Copy text content from input buffer
+ * @param dst - destination buffer
+ * @param src - source buffer
+ */
+void CAfEntry::CopyL(RBuf &dst,const TDesC &src)
+{
+ ReallocL(dst, src.Length());
+ if(0 < src.Length()) {
+ dst.Copy(src);
+ }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Deserialize blob content from input stream
+ * @param dst - destination buffer
+ * @param src - input stream
+ */
+void CAfEntry::InternalizeL(RBuf8 &dst, RReadStream &src)
+{
+ const TInt length(src.ReadInt32L());
+ ReallocL(dst, length);
+ if (0 < length) {
+ src.ReadL(dst, length);
+ }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Deserialize text content from input stream
+ * @param dst - destination buffer
+ * @param src - input stream
+ */
+void CAfEntry::InternalizeL(RBuf &dst, RReadStream &src)
+{
+ const TInt length(src.ReadInt32L());
+ ReallocL(dst, length);
+ if (0 < length) {
+ src.ReadL(dst, length);
+ }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Serialize blob content into output stream
+ * @param dst - destination stream
+ * @param src - input buffer
+ */
+void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC8 & src)
+{
+ dst.WriteInt32L(src.Length());
+ if (src.Length()) {
+ dst.WriteL(src, src.Length());
+ }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Serialize text content into output stream
+ * @param dst - destination stream
+ * @param src - input buffer
+ */
+void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC& src)
+{
+ dst.WriteInt32L(src.Length());
+ if (src.Length()) {
+ dst.WriteL(src, src.Length());
+ }
+}
+
+// -----------------------------------------------------------------------------
+RPointerArray<CAfEntry>& operator <<(RPointerArray<CAfEntry>& dst, const TDesC8 &src)
+{
+ dst.ResetAndDestroy();
+ RDesReadStream srcStream(src);
+ CleanupClosePushL(srcStream);
+ int numOfItems(srcStream.ReadInt32L());
+ for (int i(0); i < numOfItems; ++i) {
+ CAfEntry *entry = CAfEntry::NewLC();
+ srcStream >> (*entry);
+ dst.AppendL(entry);
+ CleanupStack::Pop(entry);
+ }
+ CleanupStack::PopAndDestroy(&srcStream);
+ return dst;
+}
+
+// -----------------------------------------------------------------------------
+RBuf8& operator <<(RBuf8 &dst, const RPointerArray<CAfEntry>& src)
+{
+ int iter(0),
+ requiredSize(sizeof(int));
+ for(iter =0; iter< src.Count(); ++iter) {
+ requiredSize += src[iter]->Size();
+ }
+ CAfEntry::ReallocL(dst, requiredSize);
+ RDesWriteStream dstStream(dst);
+ CleanupClosePushL(dstStream);
+ dstStream.WriteInt32L(src.Count());
+ for (iter =0; iter < src.Count(); ++iter) {
+ dstStream << *(src[iter]);
+ }
+ CleanupStack::PopAndDestroy(&dstStream);
+ return dst;
+}
--- a/activityfw/storage/inc/afcmd.h Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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 AFCMD_H
-#define AFCMD_H
-
-const TInt KRequestAppIdOffset(0);
-const TInt KRequestActOffset(1);
-const TInt KRequestData(2);
-const TInt KRequestIdOffset(0);
-
-const TInt KResponseDataSizeOffset(0);
-const TInt KResponseIdOffset(3);
-const TInt KResponseDataOffset(1);
-
-
-enum ActivityCmd {
- AddActivity =0,
- UpdateActivity,
- RemoveActivity,
- RemoveApplicationActivities,
- Activities,
- ApplicationActivities,
- ApplicationActivity,
- WaitActivity,
- LaunchActivity,
- GetThumbnail,
- GetData,
- NotifyChange,
- CancelWait,
- CancelNotify
-};
-
-#endif //AFCMD_H
-
--- a/activityfw/storage/inc/afstorageglobals.h Fri Jul 23 14:03:00 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:
-*
-*/
-#ifndef AFSTORAGEGLOBALS_H
-#define AFSTORAGEGLOBALS_H
-#include <qvariant.h>
-#include <afcmd.h>
-/**
- * Enumerate supported functions
- */
-
-const char ActivityApplicationKeyword [] = ":ApplicationId";
-const char ActivityActivityKeyword [] = ":ActivityName";
-const char ActivityParametersKeyword [] = ":ActivityParams";
-const char ActivityPersistence [] = ":ActivityPersistence";
-const char ActivityVisibility [] = ":ActivityVisibility";
-const char ActivityScreenshotKeyword [] = "screenshot";
-const char ActivityDataKeyword [] = ":ActivityData";
-const char ActivityApplicationName[] = ":ApplicationName";
-
-#endif //AFSTORAGEGLOBALS_H
--- a/activityfw/storage/s60/inc/afentry.h Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +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 AFENTRYDATA_H
-#define AFENTRYDATA_H
-
-#include <e32base.h>
-#include <s32strm.h>
-class RDbColWriteStream;
-class RDbColReadStream;
-const TInt KAfMask(0x0001);
-
-#ifdef AF_ADD_MASK
-#undef AF_ADD_MASK
-#endif
-#define AF_ADD_MASK(n) (KAfMask << n)
-
-class CAfEntry: public CBase
-{
-public:
- enum AccessRights {
- Private =0,
- Public
- };
-
- enum Flags {
- Invisible = KAfMask,
- Persistent = 0x40000000,
- };
-
-public:
- static CAfEntry* NewL();
-
- static CAfEntry* NewLC();
-
- static CAfEntry* NewL(TInt flags,
- TInt applicationId,
- const TDesC &activityId,
- const TDesC &imgSrc,
- const TDesC8 &privateData,
- const TDesC8 &publicData);
-
- static CAfEntry* NewLC(TInt flags,
- TInt applicationId,
- const TDesC &activityId,
- const TDesC &imgSrc,
- const TDesC8 &privateData,
- const TDesC8 &publicData);
-
- static CAfEntry* NewLC(const RMessage2& msg,
- int offset =0);
-
- ~CAfEntry();
-
- TInt Size() const;
-
- TInt DataSize() const;
-
- void ExternalizeL(RWriteStream &stream) const;
-
- void InternalizeL(RReadStream &stream);
-
- void ExternalizeDataOnlyL(RWriteStream &stream) const;
-
- void InternalizeDataOnlyL(RReadStream &stream);
-
- TInt Flags() const;
-
- TInt ApplicationId() const;
-
- const TDesC& ActivityId() const;
-
- const TDesC& ImageSrc() const;
-
- void SetImageSrcL(const TDesC& src);
-
- const TDesC8& Data(CAfEntry::AccessRights rights) const;
-
- void SetDataL(const TDesC8& src, CAfEntry::AccessRights rights);
-
- static void ReallocL(RBuf8 &dst,TInt length);
-
- static void ReallocL(RBuf &dst,TInt length);
-
- static void CopyL(RBuf8 &dst,const TDesC8 &src);
-
- static void CopyL(RBuf &dst,const TDesC &src);
-
-private:
- CAfEntry();
-
- void ConstructL(TInt flags,
- TInt applicationId,
- const TDesC &activityId,
- const TDesC &imgSrc,
- const TDesC8 &privateData,
- const TDesC8 &publicData);
-
- static void InternalizeL(RBuf8 &dst, RReadStream &src);
-
- static void InternalizeL(RBuf &dst, RReadStream &src);
-
- static void ExternalizeL(RWriteStream &dst,const TDesC8 & src);
-
- static void ExternalizeL(RWriteStream &dst,const TDesC& src);
-private:
- TInt mFlags;
- TInt mAppId;
- RBuf mActivityId;
- RBuf mImgSrc;
- RBuf8 mPrivateData;
- RBuf8 mPublicData;
-
-};
-
-RPointerArray<CAfEntry>& operator <<(RPointerArray<CAfEntry>& dst, const TDesC8 &src);
-
-RBuf8& operator << (RBuf8 &dst, const RPointerArray<CAfEntry>& src);
-
-#endif
--- a/activityfw/storage/s60/inc/afglobals.h Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 AFGLOBALS_H
-#define AFGLOBALS_H
-
-#include <e32base.h>
-const TUid KActivityServerUid = {0x200267B4};
-_LIT(KActivityServerName, "hsactivitydbserver");
-_LIT(KErr400, "Bad Reqest");
-_LIT(KErr403, "Access denied");
-
-#endif //AFGLOBALS_H
--- a/activityfw/storage/s60/inc/afserializer.h Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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 HSSERIALIZER_H
-#define HSSERIALIZER_H
-
-#include <qvariant.h>
-
-/**
- * Operator serialize VarinatHash to RBuf8
- */
-RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src);
-
-/**
- * Operator deserialize RBuf8 to VarinatHash
- */
-QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src);
-
-#endif
--- a/activityfw/storage/s60/src/afentry.cpp Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,461 +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 "afentry.h"
-#include <s32mem.h>
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create and initialize instance
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewL()
-{
- CAfEntry *self = CAfEntry::NewLC();
- CleanupStack::Pop(self);
- return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create, initialize and push instance into cleanup stack
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewLC()
-{
- CAfEntry *self = new (ELeave)CAfEntry();
- CleanupStack::PushL(self);
- return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create and initialize instance
- * @param flags - entry flags
- * @param applicationId - application unique identifier
- * @param activityId - activity unique identifier
- * @param imgSrc - thumbanail source
- * @param privateData - privated application data
- * @param publicData - public activity data
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewL(TInt flags,
- TInt applicationId,
- const TDesC &activityId,
- const TDesC &imgSrc,
- const TDesC8 &privateData,
- const TDesC8 &publicData)
-{
- CAfEntry* self = CAfEntry::NewLC(flags,
- applicationId,
- activityId,
- imgSrc,
- privateData,
- publicData);
- CleanupStack::Pop(self);
- return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create, initialize and push instance into cleanup stack
- * @param flags - entry flags
- * @param applicationId - application unique identifier
- * @param activityId - activity unique identifier
- * @param imgSrc - thumbanail source
- * @param privateData - privated application data
- * @param publicData - public activity data
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewLC(TInt flags,
- TInt applicationId,
- const TDesC &activityId,
- const TDesC &imgSrc,
- const TDesC8 &privateData,
- const TDesC8 &publicData)
-{
- CAfEntry *self = CAfEntry::NewLC();
- self->ConstructL(flags,
- applicationId,
- activityId,
- imgSrc,
- privateData,
- publicData);
- return self;
-}
-
-// -----------------------------------------------------------------------------
-CAfEntry* CAfEntry::NewLC(const RMessage2& msg, int offset)
-{
- CAfEntry* self = CAfEntry::NewLC();
- RBuf8 serializedEntry;
- CleanupClosePushL(serializedEntry);
- ReallocL(serializedEntry, msg.GetDesMaxLength(offset));
- msg.ReadL(offset, serializedEntry);
- RDesReadStream entryReader(serializedEntry);
- CleanupClosePushL(entryReader);
- entryReader >> (*self);
- CleanupStack::PopAndDestroy(&entryReader);
- CleanupStack::PopAndDestroy(&serializedEntry);
- return self;
-}
-// -----------------------------------------------------------------------------
-/**
- * First phase constructor
- */
-CAfEntry::CAfEntry()
-{
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Second phase constructor. Initialize instance
- * @param flags - entry flags
- * @param applicationId - application unique identifier
- * @param activityId - activity unique identifier
- * @param imgSrc - thumbanail source
- * @param privateData - privated application data
- * @param publicData - public activity data
- */
-void CAfEntry::ConstructL(TInt flags,
- TInt applicationId,
- const TDesC &activityId,
- const TDesC &imgSrc,
- const TDesC8 &privateData,
- const TDesC8 &publicData)
-{
- mFlags = flags;
- mAppId = applicationId;
- CopyL(mActivityId, activityId);
- CopyL(mImgSrc, imgSrc);
- CopyL(mPrivateData, privateData);
- CopyL(mPublicData, publicData);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor. Release allocated resources
- */
-CAfEntry::~CAfEntry()
-{
- mActivityId.Close();
- mPrivateData.Close();
- mPublicData.Close();
- mImgSrc.Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide size of serialized entry
- * @return size of serialized entry instance
- */
-TInt CAfEntry::Size() const
-{
- return (sizeof(TInt) * 3) + //flags + appId + actId size info
- mActivityId.Size() + //actId content size
- DataSize(); //data size
-
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide size of serialized entry
- * @return size of serialized entry instance
- */
-TInt CAfEntry::DataSize() const
-{
- return (sizeof(TInt) * 3) + //privData size info + pubData size info + imgSrc size info
- mImgSrc.Size() + //imgSize content size
- mPrivateData.Size() + //privData content size
- mPublicData.Size(); //pubData content size
-}
-// -----------------------------------------------------------------------------
-/**
- * Serialize entry content into output stream.
- * @param stream - output stream
- */
-void CAfEntry::ExternalizeL(RWriteStream &stream) const
-{
- stream.WriteInt32L(mFlags);
- stream.WriteInt32L(mAppId);
- ExternalizeL(stream, mActivityId);
- ExternalizeDataOnlyL(stream);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize entry content from input stream
- * @param stream - input stream
- */
-void CAfEntry::InternalizeL(RReadStream &stream)
-{
- mFlags = stream.ReadInt32L();
- mAppId = stream.ReadInt32L();
- InternalizeL(mActivityId, stream);
- InternalizeDataOnlyL(stream);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Serialize entry content into output stream.
- * @param stream - output stream
- */
-void CAfEntry::ExternalizeDataOnlyL(RWriteStream &stream) const
-{
- ExternalizeL(stream, mImgSrc);
- ExternalizeL(stream, mPrivateData);
- ExternalizeL(stream, mPublicData);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize entry content from input stream
- * @param stream - input stream
- */
-void CAfEntry::InternalizeDataOnlyL(RReadStream &stream)
-{
-
- InternalizeL(mImgSrc, stream);
- InternalizeL(mPrivateData, stream);
- InternalizeL(mPublicData, stream);
-
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity flags
- * @return activity flags
- */
-TInt CAfEntry::Flags() const
-{
- return mFlags;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity identifier.
- * @return activity identifier
- */
-TInt CAfEntry::ApplicationId() const
-{
- return mAppId;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity identifier.
- * @return activity identifier
- */
-const TDesC& CAfEntry::ActivityId() const
-{
- return mActivityId;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity data.
- * @param rights - type of requested data
- * @return activity data
- */
-const TDesC8& CAfEntry::Data(CAfEntry::AccessRights rights) const
-{
- return Private == rights ? mPrivateData : mPublicData;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity data.
- * @param rights - type of requested data
- * @return activity data
- */
-void CAfEntry::SetDataL(const TDesC8& src, CAfEntry::AccessRights rights)
-{
- CopyL(Private == rights ? mPrivateData : mPublicData, src);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity thumbail path
- * @return path to activity thumbnail
- */
-const TDesC& CAfEntry::ImageSrc() const
-{
- return mImgSrc;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Set new value of image source
- */
-void CAfEntry::SetImageSrcL(const TDesC& src)
-{
- CopyL(mImgSrc, src);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Reallocate blob buffer to requested size
- * @param dst - destination buffer
- * @param length - requested length
- */
-void CAfEntry::ReallocL(RBuf8 &dst,TInt length)
-{
- if (0 < length) {
- if (dst.MaxLength() < length) {
- dst.ReAllocL(length);
- }
- } else {
- dst.Close();
- }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Reallocate text buffer to requested size
- * @param dst - destination buffer
- * @param length - requested length
- */
-void CAfEntry::ReallocL(RBuf &dst,TInt length)
-{
- if (0 < length) {
- if (dst.MaxLength() < length) {
- dst.ReAllocL(length);
- }
- } else {
- dst.Close();
- }
-}
-// -----------------------------------------------------------------------------
-/**
- * Copy blob content from input stream
- * @param dst - destination buffer
- * @param src - source buffer
- */
-void CAfEntry::CopyL(RBuf8 &dst,const TDesC8 &src)
-{
- ReallocL(dst, src.Length());
- if(0 < src.Length()) {
- dst.Copy(src);
- }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Copy text content from input buffer
- * @param dst - destination buffer
- * @param src - source buffer
- */
-void CAfEntry::CopyL(RBuf &dst,const TDesC &src)
-{
- ReallocL(dst, src.Length());
- if(0 < src.Length()) {
- dst.Copy(src);
- }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize blob content from input stream
- * @param dst - destination buffer
- * @param src - input stream
- */
-void CAfEntry::InternalizeL(RBuf8 &dst, RReadStream &src)
-{
- const TInt length(src.ReadInt32L());
- ReallocL(dst, length);
- if (0 < length) {
- src.ReadL(dst, length);
- }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize text content from input stream
- * @param dst - destination buffer
- * @param src - input stream
- */
-void CAfEntry::InternalizeL(RBuf &dst, RReadStream &src)
-{
- const TInt length(src.ReadInt32L());
- ReallocL(dst, length);
- if (0 < length) {
- src.ReadL(dst, length);
- }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Serialize blob content into output stream
- * @param dst - destination stream
- * @param src - input buffer
- */
-void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC8 & src)
-{
- dst.WriteInt32L(src.Length());
- if (src.Length()) {
- dst.WriteL(src, src.Length());
- }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Serialize text content into output stream
- * @param dst - destination stream
- * @param src - input buffer
- */
-void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC& src)
-{
- dst.WriteInt32L(src.Length());
- if (src.Length()) {
- dst.WriteL(src, src.Length());
- }
-}
-
-// -----------------------------------------------------------------------------
-RPointerArray<CAfEntry>& operator <<(RPointerArray<CAfEntry>& dst, const TDesC8 &src)
-{
- dst.ResetAndDestroy();
- RDesReadStream srcStream(src);
- CleanupClosePushL(srcStream);
- int numOfItems(srcStream.ReadInt32L());
- for (int i(0); i < numOfItems; ++i) {
- CAfEntry *entry = CAfEntry::NewLC();
- srcStream >> (*entry);
- dst.AppendL(entry);
- CleanupStack::Pop(entry);
- }
- CleanupStack::PopAndDestroy(&srcStream);
- return dst;
-}
-
-// -----------------------------------------------------------------------------
-RBuf8& operator <<(RBuf8 &dst, const RPointerArray<CAfEntry>& src)
-{
- int iter(0),
- requiredSize(sizeof(int));
- for(iter =0; iter< src.Count(); ++iter) {
- requiredSize += src[iter]->Size();
- }
- CAfEntry::ReallocL(dst, requiredSize);
- RDesWriteStream dstStream(dst);
- CleanupClosePushL(dstStream);
- dstStream.WriteInt32L(src.Count());
- for (iter =0; iter < src.Count(); ++iter) {
- dstStream << *(src[iter]);
- }
- CleanupStack::PopAndDestroy(&dstStream);
- return dst;
-}
--- a/activityfw/storage/s60/src/afserializer.cpp Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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 <s32mem.h>
-#include "afserializer.h"
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src)
-{
- QByteArray buffer;
- QDataStream stream(&buffer, QIODevice::WriteOnly);
-
- QT_TRYCATCH_LEAVING(stream << src);
- const int dataLength(buffer.length());
- const unsigned char *dataPtr(reinterpret_cast<const unsigned char *>(buffer.constData()));
- if (dst.MaxLength() < dataLength) {
- dst.ReAllocL(dataLength);
- }
- dst.Copy(dataPtr, dataLength);
- return dst;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src)
-{
- QByteArray buffer(QByteArray::fromRawData(reinterpret_cast<const char *>(src.Ptr()),
- src.Length()) );
-
- QDataStream stream(&buffer, QIODevice::ReadOnly);
- QT_TRYCATCH_LEAVING(stream >> dst);
- return dst;
-}
--- a/activityfw/storage/server/group/server.mmp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/server/group/server.mmp Fri Aug 06 13:40:46 2010 +0300
@@ -22,7 +22,6 @@
USERINCLUDE ../inc
USERINCLUDE ../../inc
-USERINCLUDE ../../s60/inc
USERINCLUDE ../../../../inc
SOURCEPATH ../src
@@ -36,12 +35,14 @@
SOURCE afstorageasynctask.cpp
SOURCE afobservertask.cpp
SOURCE afthumbnailtask.cpp
-
-SOURCEPATH ../../s60/src
-SOURCE afentry.cpp
+SOURCE afapplicationsmonitor.cpp
+SOURCE afapplicationscollection.cpp
+SOURCE afapplicationsstorage.cpp
+SOURCE afapplicationsengine.cpp
LIBRARY euser.lib
LIBRARY estor.lib
+LIBRARY apgrfx.lib
LIBRARY edbms.lib
LIBRARY efsrv.lib
LIBRARY bafl.lib
@@ -50,6 +51,7 @@
LIBRARY bitmaptransforms.lib
LIBRARY imageconversion.lib
LIBRARY tsutils.lib
+STATICLIBRARY afstoragecommon.lib
CAPABILITY ALL -TCB
EPOCHEAPSIZE 0x100000 0x600000 // 1MB - 6MB
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationscollection.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* 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 AFAPPLICATIONSCOLLECTION_H
+#define AFAPPLICATIONSCOLLECTION_H
+
+#include <e32base.h>
+#include "afapplicationsobserver.h"
+#include "afapplicationsregistry.h"
+
+
+class CAfApplicationsCollection: public CBase,
+ public MAfApplicationsObserver,
+ public MAfApplicationsRegistry
+{
+public:
+ static CAfApplicationsCollection* NewL(RApaLsSession& serviceProvider, MAfApplicationsObserver* observer =0);
+ ~CAfApplicationsCollection();
+ void applicationsChanged();
+ TArray<TUid> removedApplications()const;
+ void setObserver(MAfApplicationsObserver& oserver);
+private:
+ CAfApplicationsCollection(RApaLsSession& serviceProvider, MAfApplicationsObserver* observer);
+ void collectsApplicationsInfoL();
+
+private:
+ RApaLsSession& mServiceProvider;
+ MAfApplicationsObserver* mObserver;
+ RArray<TUid> mDeinstalledApplications;
+};
+
+#endif // AFAPPLICATIONSCOLLECTION_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationsengine.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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 AFAPPLICATIONSENGINE_H
+#define AFAPPLICATIONSENGINE_H
+
+#include <e32base.h>
+#include "afstorage.h"
+
+class RApaLsSession;
+class CAfApplicationsCollection;
+class CAfApplicationsStorage;
+class CAfApplicationsMonitor;
+
+class CAfApplicationsEngine: public CBase
+{
+public:
+ static CAfApplicationsEngine* NewL(RApaLsSession& serviceProvider, CAfStorage& storage);
+ ~CAfApplicationsEngine();
+
+private:
+ CAfApplicationsEngine();
+ void ConstructL(CAfStorage& storage, RApaLsSession& serviceProvider);
+
+private:
+ CAfApplicationsCollection *mCollection;
+ CAfApplicationsMonitor *mMonitor;
+ CAfApplicationsStorage *mStorage;
+};
+
+#endif //AFAPPLICATIONSENGINE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationsmonitor.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* 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 AFAPPLICATIONMONITOR_H
+#define AFAPPLICATIONMONITOR_H
+
+#include <e32base.h>
+#include <apgcli.h>
+
+#include "afapplicationsobserver.h"
+
+class CAfApplicationsMonitor: public CActive
+{
+public:
+ static CAfApplicationsMonitor* NewL(RApaLsSession& serviceProvider,
+ MAfApplicationsObserver& observer);
+ ~CAfApplicationsMonitor();
+private:
+ CAfApplicationsMonitor(RApaLsSession& serviceProvider,
+ MAfApplicationsObserver& observer);
+
+ void RunL();
+ void Subscribe();
+ TInt RunError(TInt error);
+ void DoCancel();
+
+private:
+ RApaLsSession& mServiceProvider;
+ MAfApplicationsObserver &mObserver;
+};
+
+#endif // AFAPPLICATIONMONITOR_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationsobserver.h Fri Aug 06 13:40:46 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 AFAPPLICATIONSOBSERVER_H
+#define AFAPPLICATIONSOBSERVER_H
+
+#include <e32base.h>
+#include <apgcli.h>
+
+class MAfApplicationsObserver
+{
+public:
+ virtual void applicationsChanged()= 0;
+};
+
+#endif // AFAPPLICATIONMONITOR_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationsregistry.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* 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 AFAPPLICATIONSREGISTRY_H
+#define AFAPPLICATIONSREGISTRY_H
+
+class MAfApplicationsRegistry
+{
+public:
+
+ virtual TArray<TUid> removedApplications() const =0;
+ //TODO extend by additional functions if needed
+};
+
+#endif // AFAPPLICATIONSREGISTRY_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationsstorage.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* 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 AFAPPLICATIONSSTORAGE_H
+#define AFAPPLICATIONSSTORAGE_H
+
+#include <e32base.h>
+#include "afstorage.h"
+#include "afapplicationsobserver.h"
+#include "afapplicationsregistry.h"
+
+
+class CAfApplicationsStorage: public CBase,
+ public MAfApplicationsObserver
+{
+public:
+ static CAfApplicationsStorage* NewL(CAfStorage& storage, const MAfApplicationsRegistry& provider);
+ ~CAfApplicationsStorage();
+ void applicationsChanged();
+
+private:
+ CAfApplicationsStorage(CAfStorage& storage, const MAfApplicationsRegistry& provider);
+ void deleteActivityL(TUid appId);
+private:
+ CAfStorage& mStorage;
+ const MAfApplicationsRegistry &mProvider;
+};
+
+#endif // AFAPPLICATIONSSTORAGE_H
--- a/activityfw/storage/server/inc/afserver.h Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/server/inc/afserver.h Fri Aug 06 13:40:46 2010 +0300
@@ -23,6 +23,7 @@
#include <e32std.h>
#include <e32base.h>
#include <f32file.h> // RFs
+#include <apgcli.h>
#include "aftaskstorage.h"
@@ -54,9 +55,11 @@
void RemoveNotValidTasks(const CSession2* session);
private:
+ RApaLsSession mApaSession;
RFs mFsSession;
CAfStorage* mStorage;
RPointerArray<CAfTask> mObservers;
+ CBase* mAppEngine;
};
#endif // AFSERVER_H
--- a/activityfw/storage/server/inc/afstorage.h Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/server/inc/afstorage.h Fri Aug 06 13:40:46 2010 +0300
@@ -35,6 +35,8 @@
void AddActivityL(CAfEntry &entry);
void UpdateActivityL(CAfEntry &entry);
+
+ void SaveActivityL(CAfEntry &entry);
void DeleteActivityL(CAfEntry &entry);
--- a/activityfw/storage/server/inc/afstoragesynctask.h Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/server/inc/afstoragesynctask.h Fri Aug 06 13:40:46 2010 +0300
@@ -44,6 +44,9 @@
static void UpdateActivityL(CAfStorage& dataStorage,
const RMessage2& msg);
+ static void SaveActivityL(CAfStorage& dataStorage,
+ const RMessage2& msg);
+
static void DeleteActivityL(CAfStorage& dataStorage,
const RMessage2& msg);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/src/afapplicationscollection.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,80 @@
+/*
+* 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 <apgupdate.h>
+
+#include "afapplicationscollection.h"
+//------------------------------------------------------------------------------
+CAfApplicationsCollection* CAfApplicationsCollection::NewL(RApaLsSession& serviceProvider,
+ MAfApplicationsObserver* observer)
+{
+ CAfApplicationsCollection *self = new(ELeave) CAfApplicationsCollection(serviceProvider, observer);
+ return self;
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsCollection::CAfApplicationsCollection(RApaLsSession& serviceProvider, MAfApplicationsObserver* observer)
+:
+ mServiceProvider(serviceProvider),
+ mObserver(observer)
+{}
+
+//------------------------------------------------------------------------------
+CAfApplicationsCollection::~CAfApplicationsCollection()
+{
+ mDeinstalledApplications.Close();
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsCollection::applicationsChanged()
+{
+ TRAP_IGNORE(collectsApplicationsInfoL());
+ if (mObserver) {
+ mObserver->applicationsChanged();
+ }
+}
+
+//------------------------------------------------------------------------------
+TArray<TUid> CAfApplicationsCollection::removedApplications()const
+{
+ return mDeinstalledApplications.Array();
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsCollection::setObserver(MAfApplicationsObserver& observer)
+{
+ mObserver = &observer;
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsCollection::collectsApplicationsInfoL()
+{
+ mDeinstalledApplications.Close();
+ RArray< TApaAppUpdateInfo > updatedApps;
+ CleanupClosePushL(updatedApps);
+ TInt errNo = mServiceProvider.UpdatedAppsInfoL(updatedApps);
+ User::LeaveIfError(errNo);
+ for (TInt offset(0); offset < updatedApps.Count(); ++offset) {
+ const TApaAppUpdateInfo::TApaAppAction action(updatedApps[offset].iAction);
+ switch (action) {
+ case TApaAppUpdateInfo::EAppNotPresent:
+ mDeinstalledApplications.AppendL(updatedApps[offset].iAppUid);
+ break;
+ //TODO add implementation for other cases when needed
+ }
+ }
+ CleanupStack::PopAndDestroy(&updatedApps);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/src/afapplicationsengine.cpp Fri Aug 06 13:40:46 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:
+*
+*/
+#include "afapplicationsengine.h"
+#include "afapplicationsstorage.h"
+#include "afapplicationscollection.h"
+#include "afapplicationsmonitor.h"
+
+//------------------------------------------------------------------------------
+CAfApplicationsEngine* CAfApplicationsEngine::NewL(RApaLsSession& serviceProvider,
+ CAfStorage& storage)
+{
+ CAfApplicationsEngine *self = new(ELeave)CAfApplicationsEngine();
+ CleanupStack::PushL(self);
+ self->ConstructL(storage, serviceProvider);
+ CleanupStack::Pop(self);
+ return self;
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsEngine::CAfApplicationsEngine()
+{}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsEngine::ConstructL(CAfStorage& storage,
+ RApaLsSession& serviceProvider)
+{
+ mCollection = CAfApplicationsCollection::NewL(serviceProvider);
+ mMonitor = CAfApplicationsMonitor::NewL(serviceProvider, *mCollection);
+ mStorage = CAfApplicationsStorage::NewL(storage, *mCollection);
+
+ mCollection->setObserver(*mStorage);
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsEngine::~CAfApplicationsEngine()
+{
+ delete mMonitor;
+ delete mStorage;
+ delete mCollection;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/src/afapplicationsmonitor.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,71 @@
+/*
+* 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 "afapplicationsmonitor.h"
+
+//------------------------------------------------------------------------------
+CAfApplicationsMonitor* CAfApplicationsMonitor::NewL(RApaLsSession& serviceProvider,
+ MAfApplicationsObserver& observer)
+{
+ CAfApplicationsMonitor* self = new (ELeave) CAfApplicationsMonitor(serviceProvider, observer);
+ self->Subscribe();
+ return self;
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsMonitor::CAfApplicationsMonitor(RApaLsSession& serviceProvider,
+ MAfApplicationsObserver& observer)
+:
+ CActive(EPriorityLow),
+ mServiceProvider(serviceProvider),
+ mObserver(observer)
+{
+ CActiveScheduler::Add(this);
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsMonitor::~CAfApplicationsMonitor()
+{
+ Cancel();
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsMonitor::RunL()
+{
+ User::LeaveIfError(iStatus.Int());
+ mObserver.applicationsChanged();
+ Subscribe();
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsMonitor::Subscribe()
+{
+ mServiceProvider.SetNotify(EFalse, iStatus);
+ SetActive();
+}
+
+//------------------------------------------------------------------------------
+TInt CAfApplicationsMonitor::RunError(TInt /*error*/)
+{
+ Subscribe();
+ return KErrNone;
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsMonitor::DoCancel()
+{
+ mServiceProvider.CancelNotify();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/src/afapplicationsstorage.cpp Fri Aug 06 13:40:46 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 "afapplicationsstorage.h"
+//------------------------------------------------------------------------------
+CAfApplicationsStorage* CAfApplicationsStorage::NewL(CAfStorage& storage,
+ const MAfApplicationsRegistry& provider)
+{
+ CAfApplicationsStorage *self = new (ELeave)CAfApplicationsStorage(storage, provider);
+ return self;
+
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsStorage::CAfApplicationsStorage(CAfStorage& storage,
+ const MAfApplicationsRegistry& provider)
+:
+ mStorage(storage),
+ mProvider(provider)
+{
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsStorage::~CAfApplicationsStorage()
+{}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsStorage::applicationsChanged()
+{
+ const TArray<TUid> removedApp(mProvider.removedApplications());
+ for (TInt iter(0); iter < removedApp.Count(); ++iter) {
+ TRAP_IGNORE(deleteActivityL(removedApp[iter]));
+ }
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsStorage::deleteActivityL(TUid appId)
+{
+ CAfEntry *entry(CAfEntry::NewLC(0,
+ static_cast<TInt>(appId.iUid),
+ KNullDesC,
+ KNullDesC,
+ KNullDesC8,
+ KNullDesC8));
+ mStorage.DeleteActivitiesL(*entry);
+ CleanupStack::PopAndDestroy(entry);
+}
+
--- a/activityfw/storage/server/src/afbroadcasttask.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/server/src/afbroadcasttask.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -27,11 +27,7 @@
{
const RPointerArray<CAfTask> &tasks(storage.StorageData());
for (TInt iter(tasks.Count() - 1); iter >= 0 ; --iter ) {
- if(EFalse == msg.IsNull()) {
- (tasks[iter])->BroadcastReceivedL(msg);
- }
+ (tasks[iter])->BroadcastReceivedL(msg);
}
- if(EFalse == msg.IsNull()) {
- msg.Complete(KErrNone);
- }
+ msg.Complete(KErrNone);
}
--- a/activityfw/storage/server/src/afdataprovidertask.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/server/src/afdataprovidertask.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -51,8 +51,6 @@
void AfDataProviderTask::ProvideDataL(const RMessage2& msg,
const CAfTask& src)
{
- if (EFalse ==msg.IsNull()) {
- msg.WriteL(KResponseDataOffset, src.Data());
- msg.Complete(KErrNone);
- }
+ msg.WriteL(KResponseDataOffset, src.Data());
+ msg.Complete(KErrNone);
}
--- a/activityfw/storage/server/src/afserver.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/server/src/afserver.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -20,6 +20,7 @@
#include "afsession.h"
#include "afstorage.h"
#include "aftask.h"
+#include "afapplicationsengine.h"
_LIT( KActivityServerName, "hsactivitydbserver" );
_LIT(KObserverAlreadyExists, "Observer task exists");
@@ -41,8 +42,10 @@
*/
CAfServer::~CAfServer()
{
+ delete mAppEngine;
delete mStorage;
mFsSession.Close();
+ mApaSession.Close();
mObservers.ResetAndDestroy();
RFbsSession::Disconnect();
}
@@ -66,10 +69,11 @@
void CAfServer::ConstructL()
{
StartL(KActivityServerName);
+ User::LeaveIfError(mApaSession.Connect());
User::LeaveIfError(mFsSession.Connect());
User::LeaveIfError(RFbsSession::Connect(mFsSession));
mStorage = CAfStorage::NewL(mFsSession);
- mObservers.Array();
+ mAppEngine = CAfApplicationsEngine::NewL(mApaSession, *mStorage);
}
// -----------------------------------------------------------------------------
--- a/activityfw/storage/server/src/afsession.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/server/src/afsession.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -94,6 +94,7 @@
switch (message.Function()) {
case AddActivity:
case UpdateActivity:
+ case SaveActivity:
case RemoveActivity:
case RemoveApplicationActivities:
AfStorageSyncTask::ExecuteL(mTasksStorage, mStorage, message);
--- a/activityfw/storage/server/src/afstorage.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/server/src/afstorage.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -49,6 +49,8 @@
*/
CAfStorage::~CAfStorage()
{
+ mActDb.Close();
+ delete mFileStore;
}
// -----------------------------------------------------------------------------
@@ -113,12 +115,6 @@
EFileRead|EFileWrite);
mFileStore->SetTypeL(mFileStore->Layout()); /* Set file store type*/
mActDb.OpenL(mFileStore,mFileStore->Root());
- CDbTableNames* tables = mActDb.TableNamesL();
- CleanupStack::PushL(tables);
- if (0 == tables->Count()) {
- CreateTableL();
- }
- CleanupStack::PopAndDestroy(tables);
}
// -----------------------------------------------------------------------------
@@ -233,10 +229,6 @@
ExternalizeDataL(view, entry, colSet->ColNo(KDataColumnName));
view.PutL();
- if (KErrNone != errNo) {
- view.Cancel();
- User::Leave(errNo);
- }
CleanupStack::PopAndDestroy(colSet);)
if (KErrNone != errNo) {
@@ -248,6 +240,64 @@
// -----------------------------------------------------------------------------
/**
+ * Save activity
+ * @param entry - activity data
+ */
+void CAfStorage::SaveActivityL(CAfEntry &entry)
+{
+ // @todo check if this can be tidied up
+ //verify if row already exists
+ TInt errNo(KErrNone);
+ RDbView view;
+ CleanupClosePushL(view);
+ TRAP(errNo, GetActivityForUpdateL(view, entry.ApplicationId(), entry.ActivityId()));
+ if (KErrNone == errNo) {
+ // update
+ view.UpdateL();
+ TRAPD(errNo,
+ CDbColSet* colSet = view.ColSetL();
+ CleanupStack::PushL(colSet);
+
+ view.SetColL(colSet->ColNo(KFlagsColumnName), entry.Flags());
+ ExternalizeDataL(view, entry, colSet->ColNo(KDataColumnName));
+
+ view.PutL();
+ CleanupStack::PopAndDestroy(colSet);)
+
+ if (KErrNone != errNo) {
+ view.Cancel();
+ User::Leave(errNo);
+ }
+ } else {
+ // insert
+
+ //write table
+ RDbTable table;
+ CleanupClosePushL(table);
+ User::LeaveIfError(table.Open(mActDb, KActivityTableName, table.EUpdatable));
+ CDbColSet *row = table.ColSetL();
+ CleanupStack::PushL(row);
+
+ table.InsertL();
+ TRAP(errNo,
+ table.SetColL(row->ColNo(KApplicationColumnName), TInt64(entry.ApplicationId()));
+ table.SetColL(row->ColNo(KActivityColumnName), entry.ActivityId());
+ table.SetColL(row->ColNo(KFlagsColumnName), entry.Flags());
+ ExternalizeDataL(table, entry, row->ColNo(KDataColumnName));
+ table.PutL();)
+ if (KErrNone != errNo) {
+ table.Cancel();
+ User::Leave(errNo);
+ }
+ CleanupStack::PopAndDestroy(row);
+ CleanupStack::PopAndDestroy(&table);
+ }
+
+ CleanupStack::PopAndDestroy(&view);
+}
+
+// -----------------------------------------------------------------------------
+/**
* Delete activity
* @param appId - application id
* @param actId - activity id
--- a/activityfw/storage/server/src/afstorageasynctask.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/server/src/afstorageasynctask.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -19,8 +19,6 @@
#include "afstorageasynctask.h"
#include "afcmd.h"
-_LIT(KUnsupportedStorageAsyncTask, "Unsupported async storage task");
-
// -----------------------------------------------------------------------------
/**
* Constructor for performing 1st stage construction
@@ -56,9 +54,7 @@
self->ExecuteL(dataStorage, msg);
taskStorage.PushL(self);
CleanupStack::Pop(self);
- if (EFalse == msg.IsNull()) {
- msg.Complete(KErrNone);
- }
+ msg.Complete(KErrNone);
}
// -----------------------------------------------------------------------------
@@ -100,9 +96,6 @@
case ApplicationActivity:
ApplicationActivityL(dataStorage, msg);
break;
- default:
- //this code shouldn't be called. fatal error: means wrong session implementation
- User::Panic(KUnsupportedStorageAsyncTask, KErrGeneral);
};
}
@@ -166,12 +159,10 @@
*/
void CAfStorageAsyncTask::WriteResponseL(const RMessage2& msg)
{
- if (EFalse == msg.IsNull()) {
- msg.WriteL(1,
- TPckgBuf<TInt>(mExternalizedData.Length()));//write data size
- msg.WriteL(2,
- TPckgBuf<CBase*>(this));//task identyfier
- }
+ msg.WriteL(1,
+ TPckgBuf<TInt>(mExternalizedData.Length()));//write data size
+ msg.WriteL(2,
+ TPckgBuf<CBase*>(this));//task identyfier
}
// -----------------------------------------------------------------------------
--- a/activityfw/storage/server/src/afstoragesynctask.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/server/src/afstoragesynctask.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -41,6 +41,9 @@
case UpdateActivity:
UpdateActivityL(dataStorage, msg);
break;
+ case SaveActivity:
+ SaveActivityL(dataStorage, msg);
+ break;
case RemoveActivity:
DeleteActivityL(dataStorage, msg);
break;
@@ -51,7 +54,10 @@
//this code shouldn't be called. fatal error: means wrong session implementation
User::Panic(KUnsupportedStorageSyncTask, KErrGeneral);
};
- msg.Complete(KErrNone);
+ if(SaveActivity != msg.Function()) {
+ //function SaveActivityL complete message. DON'T DO THIS HERE
+ msg.Complete(KErrNone);
+ }
NotifyChangeL(observers, msg);
}
@@ -80,7 +86,6 @@
entry->SetImageSrcL(thumbnailPath);
dataStorage.AddActivityL(*entry);
CleanupStack::PopAndDestroy(&thumbnailPath);
-
CleanupStack::PopAndDestroy(entry);
}
@@ -102,7 +107,6 @@
DeleteActivityScreenshotL(dataStorage,
entry->ApplicationId(),
entry->ActivityId());
-
dataStorage.ThumbnailPathL(thumbnailPath,
dataStorage.Fs(),
entry->ApplicationId(),
@@ -117,6 +121,38 @@
// -----------------------------------------------------------------------------
/**
+ * Handle saving activiy
+ * @param dataStorage - data storage
+ * @param msg - request message
+ */
+void AfStorageSyncTask::SaveActivityL(CAfStorage& dataStorage, const RMessage2& msg)
+{
+ TPckgBuf<TInt> 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());
+ //all data is retrieved. compleate message to improve response time
+ msg.Complete(KErrNone);
+ TRAP_IGNORE(entry->SetImageSrcL(thumbnailPath);
+ dataStorage.SaveActivityL(*entry);)
+ CleanupStack::PopAndDestroy(&thumbnailPath);
+ CleanupStack::PopAndDestroy(entry);
+}
+
+// -----------------------------------------------------------------------------
+/**
* Handle removing activity.
* @param dataStorage - data storage
* @param msg - request message
--- a/activityfw/storage/storage.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/activityfw/storage/storage.pro Fri Aug 06 13:40:46 2010 +0300
@@ -16,5 +16,8 @@
TEMPLATE = subdirs
-SUBDIRS += client \
- server
+CONFIG += ordered
+
+SUBDIRS += common \
+ client \
+ server \
--- a/common.pri Fri Jul 23 14:03:00 2010 +0300
+++ b/common.pri Fri Aug 06 13:40:46 2010 +0300
@@ -103,9 +103,6 @@
qtplugins.path = $$PLUGIN_SUBDIR
qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin
- message(Remove "contains(MOBILITY, serviceframework)" after the QtSF refactorig is done!)
-
- !contains(MOBILITY, serviceframework):qtplugins.sources += resource/$${TARGET}.manifest
contains(MOBILITY, serviceframework):BLD_INF_RULES.prj_exports += "resource/$${TARGET}.xml z:$$qtplugins.path/$${TARGET}.xml"
for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin z:$$qtplugins.path/$$basename(qtplugin)"
--- a/contentstorage/bwins/camenuu.def Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/bwins/camenuu.def Fri Aug 06 13:40:46 2010 +0300
@@ -23,4 +23,6 @@
?GetEntriesIdsL@CCaStorageProxy@@QAEXPBVCCaInnerQuery@@AAV?$RArray@H@@@Z @ 22 NONAME ; void CCaStorageProxy::GetEntriesIdsL(class CCaInnerQuery const *, class RArray<int> &)
?NewL@CCaSrvMmcHistory@@SAPAV1@XZ @ 23 NONAME ; class CCaSrvMmcHistory * CCaSrvMmcHistory::NewL(void)
?AddLocalizationL@CCaStorageProxy@@QAEXABVCCaLocalizationEntry@@@Z @ 24 NONAME ; void CCaStorageProxy::AddLocalizationL(class CCaLocalizationEntry const &)
+ ?SaveDatabaseL@CCaStorageProxy@@QAEXXZ @ 25 NONAME ; void CCaStorageProxy::SaveDatabaseL(void)
+ ?RestoreDatabaseL@CCaStorageProxy@@QAEXXZ @ 26 NONAME ; void CCaStorageProxy::RestoreDatabaseL(void)
--- a/contentstorage/bwins/cautilsu.def Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/bwins/cautilsu.def Fri Aug 06 13:40:46 2010 +0300
@@ -1,36 +1,36 @@
EXPORTS
?NewLC@CCaInnerNotifierFilter@@SAPAV1@W4TNotifierType@1@@Z @ 1 NONAME ; class CCaInnerNotifierFilter * CCaInnerNotifierFilter::NewLC(enum CCaInnerNotifierFilter::TNotifierType)
- ?ExternalizeL@RCaIdsArray@@QBEXAAVRWriteStream@@@Z @ 2 NONAME ; void RCaIdsArray::ExternalizeL(class RWriteStream &) const
- ?GetAttributes@CCaInnerQuery@@QBEABVRCaEntryAttrArray@@XZ @ 3 NONAME ; class RCaEntryAttrArray const & CCaInnerQuery::GetAttributes(void) const
- ?SetEntryTypeNameL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 4 NONAME ; void CCaInnerEntry::SetEntryTypeNameL(class TDesC16 const &)
- ?SetSort@CCaInnerQuery@@QAEXW4TSortAttribute@1@@Z @ 5 NONAME ; void CCaInnerQuery::SetSort(enum CCaInnerQuery::TSortAttribute)
- ?SetIconId@CCaInnerEntry@@QAEXH@Z @ 6 NONAME ; void CCaInnerEntry::SetIconId(int)
- ?SetUid@CCaInnerEntry@@QAEXJ@Z @ 7 NONAME ; void CCaInnerEntry::SetUid(long)
- ?SetLocalizedStringL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 8 NONAME ; void CCaLocalizationEntry::SetLocalizedStringL(class TDesC16 const &)
- ?GetQmFilename@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 9 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetQmFilename(void) const
- ?GetText@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 10 NONAME ; class RBuf16 const & CCaInnerEntry::GetText(void) const
- ?InternalizeL@RCaEntriesArray@@QAEXAAVRReadStream@@@Z @ 11 NONAME ; void RCaEntriesArray::InternalizeL(class RReadStream &)
- ?SetIdsL@CCaInnerNotifierFilter@@QAEXABV?$RArray@H@@@Z @ 12 NONAME ; void CCaInnerNotifierFilter::SetIdsL(class RArray<int> const &)
- ?GetTextId@CCaLocalizationEntry@@QBEHXZ @ 13 NONAME ; int CCaLocalizationEntry::GetTextId(void) const
- ?GetUid@CCaInnerEntry@@QBEJXZ @ 14 NONAME ; long CCaInnerEntry::GetUid(void) const
- ?SetId@CCaInnerEntry@@QAEXI@Z @ 15 NONAME ; void CCaInnerEntry::SetId(unsigned int)
- ?GetSort@CCaInnerQuery@@QBE?AW4TSortAttribute@1@XZ @ 16 NONAME ; enum CCaInnerQuery::TSortAttribute CCaInnerQuery::GetSort(void) const
- ?SetCount@CCaInnerQuery@@QAEXI@Z @ 17 NONAME ; void CCaInnerQuery::SetCount(unsigned int)
- ?ExternalizeL@CCaInnerNotifierFilter@@QBEXAAVRWriteStream@@@Z @ 18 NONAME ; void CCaInnerNotifierFilter::ExternalizeL(class RWriteStream &) const
- ?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 19 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TDes16 &)
- ?Find@RCaEntryAttrArray@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 20 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TDes16 &)
- ?SetRowId@CCaLocalizationEntry@@QAEXI@Z @ 21 NONAME ; void CCaLocalizationEntry::SetRowId(unsigned int)
- ?GetUid@CCaInnerQuery@@QBEIXZ @ 22 NONAME ; unsigned int CCaInnerQuery::GetUid(void) const
- ?SetFlags@CCaInnerEntry@@QAEXI@Z @ 23 NONAME ; void CCaInnerEntry::SetFlags(unsigned int)
- ?SetAttributeNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 24 NONAME ; void CCaLocalizationEntry::SetAttributeNameL(class TDesC16 const &)
- ?GetCount@CCaInnerQuery@@QBEIXZ @ 25 NONAME ; unsigned int CCaInnerQuery::GetCount(void) const
- ?GetParentId@CCaInnerNotifierFilter@@QBEHXZ @ 26 NONAME ; int CCaInnerNotifierFilter::GetParentId(void) const
- ?SetId@CCaInnerIconDescription@@QAEXH@Z @ 27 NONAME ; void CCaInnerIconDescription::SetId(int)
- ?GetStringId@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 28 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetStringId(void) const
- ?GetFlags@CCaInnerEntry@@QBEIXZ @ 29 NONAME ; unsigned int CCaInnerEntry::GetFlags(void) const
- ?NewL@CCaInnerIconDescription@@SAPAV1@XZ @ 30 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewL(void)
- ?NewL@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 31 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewL(class TDesC16 const &)
- ?Find@RCaEntryAttrArray@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 32 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TPtrC16 &)
+ ?Find@RCaEntryAttrArray@@QBEHABVTDesC16@@AAVTPtrC16@@@Z @ 2 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TPtrC16 &) const
+ ?ExternalizeL@RCaIdsArray@@QBEXAAVRWriteStream@@@Z @ 3 NONAME ; void RCaIdsArray::ExternalizeL(class RWriteStream &) const
+ ?GetAttributes@CCaInnerQuery@@QBEABVRCaEntryAttrArray@@XZ @ 4 NONAME ; class RCaEntryAttrArray const & CCaInnerQuery::GetAttributes(void) const
+ ?SetEntryTypeNameL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 5 NONAME ; void CCaInnerEntry::SetEntryTypeNameL(class TDesC16 const &)
+ ?SetSort@CCaInnerQuery@@QAEXW4TSortAttribute@1@@Z @ 6 NONAME ; void CCaInnerQuery::SetSort(enum CCaInnerQuery::TSortAttribute)
+ ?SetIconId@CCaInnerEntry@@QAEXH@Z @ 7 NONAME ; void CCaInnerEntry::SetIconId(int)
+ ?SetUid@CCaInnerEntry@@QAEXJ@Z @ 8 NONAME ; void CCaInnerEntry::SetUid(long)
+ ?SetLocalizedStringL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 9 NONAME ; void CCaLocalizationEntry::SetLocalizedStringL(class TDesC16 const &)
+ ?GetQmFilename@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 10 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetQmFilename(void) const
+ ?GetText@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 11 NONAME ; class RBuf16 const & CCaInnerEntry::GetText(void) const
+ ?InternalizeL@RCaEntriesArray@@QAEXAAVRReadStream@@@Z @ 12 NONAME ; void RCaEntriesArray::InternalizeL(class RReadStream &)
+ ?SetIdsL@CCaInnerNotifierFilter@@QAEXABV?$RArray@H@@@Z @ 13 NONAME ; void CCaInnerNotifierFilter::SetIdsL(class RArray<int> const &)
+ ?GetTextId@CCaLocalizationEntry@@QBEHXZ @ 14 NONAME ; int CCaLocalizationEntry::GetTextId(void) const
+ ?GetUid@CCaInnerEntry@@QBEJXZ @ 15 NONAME ; long CCaInnerEntry::GetUid(void) const
+ ?SetId@CCaInnerEntry@@QAEXI@Z @ 16 NONAME ; void CCaInnerEntry::SetId(unsigned int)
+ ?GetSort@CCaInnerQuery@@QBE?AW4TSortAttribute@1@XZ @ 17 NONAME ; enum CCaInnerQuery::TSortAttribute CCaInnerQuery::GetSort(void) const
+ ?SetCount@CCaInnerQuery@@QAEXI@Z @ 18 NONAME ; void CCaInnerQuery::SetCount(unsigned int)
+ ?ExternalizeL@CCaInnerNotifierFilter@@QBEXAAVRWriteStream@@@Z @ 19 NONAME ; void CCaInnerNotifierFilter::ExternalizeL(class RWriteStream &) const
+ ?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 20 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TDes16 &)
+ ?GetChildId@CCaInnerQuery@@QBEHXZ @ 21 NONAME ; int CCaInnerQuery::GetChildId(void) const
+ ?SetRowId@CCaLocalizationEntry@@QAEXI@Z @ 22 NONAME ; void CCaLocalizationEntry::SetRowId(unsigned int)
+ ?GetUid@CCaInnerQuery@@QBEIXZ @ 23 NONAME ; unsigned int CCaInnerQuery::GetUid(void) const
+ ?SetFlags@CCaInnerEntry@@QAEXI@Z @ 24 NONAME ; void CCaInnerEntry::SetFlags(unsigned int)
+ ?SetAttributeNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 25 NONAME ; void CCaLocalizationEntry::SetAttributeNameL(class TDesC16 const &)
+ ?GetCount@CCaInnerQuery@@QBEIXZ @ 26 NONAME ; unsigned int CCaInnerQuery::GetCount(void) const
+ ?GetParentId@CCaInnerNotifierFilter@@QBEHXZ @ 27 NONAME ; int CCaInnerNotifierFilter::GetParentId(void) const
+ ?SetId@CCaInnerIconDescription@@QAEXH@Z @ 28 NONAME ; void CCaInnerIconDescription::SetId(int)
+ ?GetStringId@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 29 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetStringId(void) const
+ ?GetFlags@CCaInnerEntry@@QBEIXZ @ 30 NONAME ; unsigned int CCaInnerEntry::GetFlags(void) const
+ ?NewL@CCaInnerIconDescription@@SAPAV1@XZ @ 31 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewL(void)
+ ?NewL@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 32 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewL(class TDesC16 const &)
?SetFileNameL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 33 NONAME ; void CCaInnerIconDescription::SetFileNameL(class TDesC16 const &)
?SetParentId@CCaInnerNotifierFilter@@QAEXH@Z @ 34 NONAME ; void CCaInnerNotifierFilter::SetParentId(int)
?SetFlagsOn@CCaInnerQuery@@QAEXI@Z @ 35 NONAME ; void CCaInnerQuery::SetFlagsOn(unsigned int)
@@ -43,7 +43,7 @@
?GetAttributeName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 42 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetAttributeName(void) const
?GetTUint@MenuUtils@@SAHABVTDesC16@@AAI@Z @ 43 NONAME ; int MenuUtils::GetTUint(class TDesC16 const &, unsigned int &)
?AddAttributeL@CCaInnerQuery@@QAEXABVTDesC16@@0@Z @ 44 NONAME ; void CCaInnerQuery::AddAttributeL(class TDesC16 const &, class TDesC16 const &)
- ?Exist@RCaEntryAttrArray@@QAEHABVTDesC16@@@Z @ 45 NONAME ; int RCaEntryAttrArray::Exist(class TDesC16 const &)
+ ?SetChildId@CCaInnerQuery@@QAEXH@Z @ 45 NONAME ; void CCaInnerQuery::SetChildId(int)
?AddAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@0@Z @ 46 NONAME ; void CCaInnerEntry::AddAttributeL(class TDesC16 const &, class TDesC16 const &)
?GetParentId@CCaInnerQuery@@QBEHXZ @ 47 NONAME ; int CCaInnerQuery::GetParentId(void) const
?SetEntryRole@CCaInnerNotifierFilter@@QAEXW4TEntryRole@@@Z @ 48 NONAME ; void CCaInnerNotifierFilter::SetEntryRole(enum TEntryRole)
@@ -54,51 +54,51 @@
?GetId@CCaInnerEntry@@QBEHXZ @ 53 NONAME ; int CCaInnerEntry::GetId(void) const
?SetDescriptionL@CCaInnerEntry@@QAEXABVTDesC16@@H@Z @ 54 NONAME ; void CCaInnerEntry::SetDescriptionL(class TDesC16 const &, int)
?SetEntryTypeNames@CCaInnerQuery@@QAEXPAVCDesC16ArrayFlat@@@Z @ 55 NONAME ; void CCaInnerQuery::SetEntryTypeNames(class CDesC16ArrayFlat *)
- ?GetNotifierType@CCaInnerNotifierFilter@@QBE?AW4TNotifierType@1@XZ @ 56 NONAME ; enum CCaInnerNotifierFilter::TNotifierType CCaInnerNotifierFilter::GetNotifierType(void) const
- ?SetTextL@CCaInnerEntry@@QAEXABVTDesC16@@H@Z @ 57 NONAME ; void CCaInnerEntry::SetTextL(class TDesC16 const &, int)
- ?ExternalizeL@CCaInnerEntry@@QBEXAAVRWriteStream@@@Z @ 58 NONAME ; void CCaInnerEntry::ExternalizeL(class RWriteStream &) const
- ?SetRole@CCaInnerQuery@@QAEXH@Z @ 59 NONAME ; void CCaInnerQuery::SetRole(int)
- ?NewL@CCaLocalizationEntry@@SAPAV1@XZ @ 60 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewL(void)
- ?InternalizeL@CCaInnerNotifierFilter@@QAEXAAVRReadStream@@@Z @ 61 NONAME ; void CCaInnerNotifierFilter::InternalizeL(class RReadStream &)
- ?InternalizeL@RCaIdsArray@@QAEXAAVRReadStream@@@Z @ 62 NONAME ; void RCaIdsArray::InternalizeL(class RReadStream &)
- ?SetQmFilenameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 63 NONAME ; void CCaLocalizationEntry::SetQmFilenameL(class TDesC16 const &)
- ?MarshalDataLC@RCaIdsArray@@QBEPAVHBufC8@@XZ @ 64 NONAME ; class HBufC8 * RCaIdsArray::MarshalDataLC(void) const
- ?GetEntryTypeNames@CCaInnerQuery@@QBEPBVCDesC16ArrayFlat@@XZ @ 65 NONAME ; class CDesC16ArrayFlat const * CCaInnerQuery::GetEntryTypeNames(void) const
- ?SetValueL@CCaEntryAttribute@@QAEXABVTDesC16@@@Z @ 66 NONAME ; void CCaEntryAttribute::SetValueL(class TDesC16 const &)
- ?SetSkinIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 67 NONAME ; void CCaInnerIconDescription::SetSkinIdL(class TDesC16 const &)
- ?ExternalizeL@CCaInnerQuery@@QBEXAAVRWriteStream@@@Z @ 68 NONAME ; void CCaInnerQuery::ExternalizeL(class RWriteStream &) const
- ?GetLocalizedString@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 69 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetLocalizedString(void) const
- ?InternalizeL@CCaInnerQuery@@QAEXAAVRReadStream@@@Z @ 70 NONAME ; void CCaInnerQuery::InternalizeL(class RReadStream &)
- ?NewLC@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 71 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewLC(class TDesC16 const &)
- ?GetTypeNames@CCaInnerNotifierFilter@@QBEPAVCDesC16ArrayFlat@@XZ @ 72 NONAME ; class CDesC16ArrayFlat * CCaInnerNotifierFilter::GetTypeNames(void) const
- ?NewL@CCaInnerEntry@@SAPAV1@XZ @ 73 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewL(void)
- ?SetRole@CCaInnerEntry@@QAEXI@Z @ 74 NONAME ; void CCaInnerEntry::SetRole(unsigned int)
- ?NewLC@CCaInnerEntry@@SAPAV1@XZ @ 75 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewLC(void)
- ?SetTableNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 76 NONAME ; void CCaLocalizationEntry::SetTableNameL(class TDesC16 const &)
- ?GetAttributes@CCaInnerEntry@@QBEABVRCaEntryAttrArray@@XZ @ 77 NONAME ; class RCaEntryAttrArray const & CCaInnerEntry::GetAttributes(void) const
- ?GetRowId@CCaLocalizationEntry@@QBEHXZ @ 78 NONAME ; int CCaLocalizationEntry::GetRowId(void) const
- ?NewLC@CCaInnerIconDescription@@SAPAV1@XZ @ 79 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewLC(void)
- ?SetIdsL@CCaInnerQuery@@QAEXABV?$RArray@H@@@Z @ 80 NONAME ; void CCaInnerQuery::SetIdsL(class RArray<int> const &)
- ?SetFlagsOff@CCaInnerQuery@@QAEXI@Z @ 81 NONAME ; void CCaInnerQuery::SetFlagsOff(unsigned int)
- ?Icon@CCaInnerEntry@@QBEPBVCCaInnerIconDescription@@XZ @ 82 NONAME ; class CCaInnerIconDescription const * CCaInnerEntry::Icon(void) const
- ?SetApplicationIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 83 NONAME ; void CCaInnerIconDescription::SetApplicationIdL(class TDesC16 const &)
- ?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 84 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TPtrC16 &)
- ?RemoveAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 85 NONAME ; void CCaInnerEntry::RemoveAttributeL(class TDesC16 const &)
- ?GetRole@CCaInnerEntry@@QBEIXZ @ 86 NONAME ; unsigned int CCaInnerEntry::GetRole(void) const
- ?GetIds@CCaInnerQuery@@QBEABV?$RArray@H@@XZ @ 87 NONAME ; class RArray<int> const & CCaInnerQuery::GetIds(void) const
- ?ExternalizeL@RCaEntriesArray@@QBEXAAVRWriteStream@@@Z @ 88 NONAME ; void RCaEntriesArray::ExternalizeL(class RWriteStream &) const
- ?NewL@CCaInnerQuery@@SAPAV1@XZ @ 89 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewL(void)
- ?isLocalized@CCaInnerEntry@@QBEHW4TLocalizedType@1@@Z @ 90 NONAME ; int CCaInnerEntry::isLocalized(enum CCaInnerEntry::TLocalizedType) const
- ?SetUid@CCaInnerQuery@@QAEXI@Z @ 91 NONAME ; void CCaInnerQuery::SetUid(unsigned int)
- ?GetDescription@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 92 NONAME ; class RBuf16 const & CCaInnerEntry::GetDescription(void) const
- ?GetRole@CCaInnerQuery@@QBEHXZ @ 93 NONAME ; int CCaInnerQuery::GetRole(void) const
- ?GetEntryTypeName@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 94 NONAME ; class RBuf16 const & CCaInnerEntry::GetEntryTypeName(void) const
- ?NewLC@CCaInnerQuery@@SAPAV1@XZ @ 95 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewLC(void)
- ?SetParentId@CCaInnerQuery@@QAEXH@Z @ 96 NONAME ; void CCaInnerQuery::SetParentId(int)
- ?GetIds@CCaInnerNotifierFilter@@QBE?AV?$RArray@H@@XZ @ 97 NONAME ; class RArray<int> CCaInnerNotifierFilter::GetIds(void) const
- ?SetStringIdL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 98 NONAME ; void CCaLocalizationEntry::SetStringIdL(class TDesC16 const &)
- ?SetTextId@CCaLocalizationEntry@@QAEXI@Z @ 99 NONAME ; void CCaLocalizationEntry::SetTextId(unsigned int)
- ?RemoveAttribute@RCaEntryAttrArray@@QAEXABVTDesC16@@@Z @ 100 NONAME ; void RCaEntryAttrArray::RemoveAttribute(class TDesC16 const &)
- ?GetChildId@CCaInnerQuery@@QBEHXZ @ 101 NONAME ; int CCaInnerQuery::GetChildId(void) const
- ?SetChildId@CCaInnerQuery@@QAEXH@Z @ 102 NONAME ; void CCaInnerQuery::SetChildId(int)
+ ?Exist@RCaEntryAttrArray@@QBEHABVTDesC16@@@Z @ 56 NONAME ; int RCaEntryAttrArray::Exist(class TDesC16 const &) const
+ ?GetNotifierType@CCaInnerNotifierFilter@@QBE?AW4TNotifierType@1@XZ @ 57 NONAME ; enum CCaInnerNotifierFilter::TNotifierType CCaInnerNotifierFilter::GetNotifierType(void) const
+ ?SetTextL@CCaInnerEntry@@QAEXABVTDesC16@@H@Z @ 58 NONAME ; void CCaInnerEntry::SetTextL(class TDesC16 const &, int)
+ ?ExternalizeL@CCaInnerEntry@@QBEXAAVRWriteStream@@@Z @ 59 NONAME ; void CCaInnerEntry::ExternalizeL(class RWriteStream &) const
+ ?SetRole@CCaInnerQuery@@QAEXH@Z @ 60 NONAME ; void CCaInnerQuery::SetRole(int)
+ ?NewL@CCaLocalizationEntry@@SAPAV1@XZ @ 61 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewL(void)
+ ?InternalizeL@CCaInnerNotifierFilter@@QAEXAAVRReadStream@@@Z @ 62 NONAME ; void CCaInnerNotifierFilter::InternalizeL(class RReadStream &)
+ ?InternalizeL@RCaIdsArray@@QAEXAAVRReadStream@@@Z @ 63 NONAME ; void RCaIdsArray::InternalizeL(class RReadStream &)
+ ?SetQmFilenameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 64 NONAME ; void CCaLocalizationEntry::SetQmFilenameL(class TDesC16 const &)
+ ?MarshalDataLC@RCaIdsArray@@QBEPAVHBufC8@@XZ @ 65 NONAME ; class HBufC8 * RCaIdsArray::MarshalDataLC(void) const
+ ?GetEntryTypeNames@CCaInnerQuery@@QBEPBVCDesC16ArrayFlat@@XZ @ 66 NONAME ; class CDesC16ArrayFlat const * CCaInnerQuery::GetEntryTypeNames(void) const
+ ?SetValueL@CCaEntryAttribute@@QAEXABVTDesC16@@@Z @ 67 NONAME ; void CCaEntryAttribute::SetValueL(class TDesC16 const &)
+ ?SetSkinIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 68 NONAME ; void CCaInnerIconDescription::SetSkinIdL(class TDesC16 const &)
+ ?ExternalizeL@CCaInnerQuery@@QBEXAAVRWriteStream@@@Z @ 69 NONAME ; void CCaInnerQuery::ExternalizeL(class RWriteStream &) const
+ ?GetLocalizedString@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 70 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetLocalizedString(void) const
+ ?InternalizeL@CCaInnerQuery@@QAEXAAVRReadStream@@@Z @ 71 NONAME ; void CCaInnerQuery::InternalizeL(class RReadStream &)
+ ?NewLC@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 72 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewLC(class TDesC16 const &)
+ ?GetTypeNames@CCaInnerNotifierFilter@@QBEPAVCDesC16ArrayFlat@@XZ @ 73 NONAME ; class CDesC16ArrayFlat * CCaInnerNotifierFilter::GetTypeNames(void) const
+ ?NewL@CCaInnerEntry@@SAPAV1@XZ @ 74 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewL(void)
+ ?SetRole@CCaInnerEntry@@QAEXI@Z @ 75 NONAME ; void CCaInnerEntry::SetRole(unsigned int)
+ ?NewLC@CCaInnerEntry@@SAPAV1@XZ @ 76 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewLC(void)
+ ?SetTableNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 77 NONAME ; void CCaLocalizationEntry::SetTableNameL(class TDesC16 const &)
+ ?GetAttributes@CCaInnerEntry@@QBEABVRCaEntryAttrArray@@XZ @ 78 NONAME ; class RCaEntryAttrArray const & CCaInnerEntry::GetAttributes(void) const
+ ?GetRowId@CCaLocalizationEntry@@QBEHXZ @ 79 NONAME ; int CCaLocalizationEntry::GetRowId(void) const
+ ?NewLC@CCaInnerIconDescription@@SAPAV1@XZ @ 80 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewLC(void)
+ ?SetIdsL@CCaInnerQuery@@QAEXABV?$RArray@H@@@Z @ 81 NONAME ; void CCaInnerQuery::SetIdsL(class RArray<int> const &)
+ ?SetFlagsOff@CCaInnerQuery@@QAEXI@Z @ 82 NONAME ; void CCaInnerQuery::SetFlagsOff(unsigned int)
+ ?Icon@CCaInnerEntry@@QBEPBVCCaInnerIconDescription@@XZ @ 83 NONAME ; class CCaInnerIconDescription const * CCaInnerEntry::Icon(void) const
+ ?SetApplicationIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 84 NONAME ; void CCaInnerIconDescription::SetApplicationIdL(class TDesC16 const &)
+ ?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 85 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TPtrC16 &)
+ ?RemoveAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 86 NONAME ; void CCaInnerEntry::RemoveAttributeL(class TDesC16 const &)
+ ?GetRole@CCaInnerEntry@@QBEIXZ @ 87 NONAME ; unsigned int CCaInnerEntry::GetRole(void) const
+ ?GetIds@CCaInnerQuery@@QBEABV?$RArray@H@@XZ @ 88 NONAME ; class RArray<int> const & CCaInnerQuery::GetIds(void) const
+ ?ExternalizeL@RCaEntriesArray@@QBEXAAVRWriteStream@@@Z @ 89 NONAME ; void RCaEntriesArray::ExternalizeL(class RWriteStream &) const
+ ?NewL@CCaInnerQuery@@SAPAV1@XZ @ 90 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewL(void)
+ ?isLocalized@CCaInnerEntry@@QBEHW4TLocalizedType@1@@Z @ 91 NONAME ; int CCaInnerEntry::isLocalized(enum CCaInnerEntry::TLocalizedType) const
+ ?SetUid@CCaInnerQuery@@QAEXI@Z @ 92 NONAME ; void CCaInnerQuery::SetUid(unsigned int)
+ ?GetDescription@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 93 NONAME ; class RBuf16 const & CCaInnerEntry::GetDescription(void) const
+ ?Find@RCaEntryAttrArray@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 94 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TDes16 &) const
+ ?GetRole@CCaInnerQuery@@QBEHXZ @ 95 NONAME ; int CCaInnerQuery::GetRole(void) const
+ ?GetEntryTypeName@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 96 NONAME ; class RBuf16 const & CCaInnerEntry::GetEntryTypeName(void) const
+ ?NewLC@CCaInnerQuery@@SAPAV1@XZ @ 97 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewLC(void)
+ ?SetParentId@CCaInnerQuery@@QAEXH@Z @ 98 NONAME ; void CCaInnerQuery::SetParentId(int)
+ ?GetIds@CCaInnerNotifierFilter@@QBE?AV?$RArray@H@@XZ @ 99 NONAME ; class RArray<int> 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 &)
--- a/contentstorage/caclient/inc/caitemmodel_p.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/inc/caitemmodel_p.h Fri Aug 06 13:40:46 2010 +0300
@@ -63,6 +63,10 @@
void setFlagsOn(const EntryFlags &onFlags);
void setFlagsOff(const EntryFlags &offFlags);
bool notifierExists() const;
+
+ QList<int> getUninstallingEntriesIds(int componentId);
+ void updateProgress(int id, int valueOfProgress);
+
public slots:
--- a/contentstorage/caclient/inc/caitemmodellist.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/inc/caitemmodellist.h Fri Aug 06 13:40:46 2010 +0300
@@ -44,6 +44,7 @@
QSharedPointer<CaEntry> at(int row) const;
void reloadEntries(const CaQuery &query);
void updateEntry(const QSharedPointer<CaEntry> &entry);
+ int updateProgress(int id, int valueOfProgress);
void updateEntries(const CaQuery &query);
int indexOf(const int &id) const;
void insert(int row, int id);
--- a/contentstorage/caclient/s60/inc/cabitmapadapter.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/s60/inc/cabitmapadapter.h Fri Aug 06 13:40:46 2010 +0300
@@ -32,15 +32,6 @@
class CaBitmapAdapter
{
public:
-
- //Static convertion methods between Symbian and Qt objects
-
- /**
- * Make bitmap copy, used to get rid of compression for extended bitmap
- * @param input input bitmap.
- * @return copied bitmap.
- */
- static CFbsBitmap *copyBitmapLC(CFbsBitmap *input);
/**
* Convert from bitmap and mask to qpixmap
--- a/contentstorage/caclient/s60/inc/caobserver.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/s60/inc/caobserver.h Fri Aug 06 13:40:46 2010 +0300
@@ -74,11 +74,6 @@
* @param parent pointer to parent. Defaults to NULL.
*/
CaObserver(QObject *parent = 0);
-
- /**
- * Destructor.
- */
- ~CaObserver();
/**
* Method invoked when entry is changed.
--- a/contentstorage/caclient/s60/src/cabitmapadapter.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/s60/src/cabitmapadapter.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -31,43 +31,11 @@
#include "cadef.h"
#include "cabitmapadapter.h"
-// -----------------------------------------------------------------------------
-// copying compressed bitmap
-//----------------------------------------------------------------------------
-CFbsBitmap *CaBitmapAdapter::copyBitmapLC(CFbsBitmap *input)
-{
- CFbsBitmap *bmp = new(ELeave) CFbsBitmap();
- CleanupStack::PushL(bmp);
- bmp->Create(input->SizeInPixels(), input->DisplayMode());
-
- CFbsBitmapDevice *bitmapDevice = CFbsBitmapDevice::NewL(bmp);
- CleanupStack::PushL(bitmapDevice);
- CFbsBitGc *bmpGc;
- bitmapDevice->CreateContext(bmpGc);
- bmpGc->BitBlt(TPoint(0,0), input);
- delete bmpGc;
- CleanupStack::PopAndDestroy(bitmapDevice);
- return bmp;
-}
-
void CaBitmapAdapter::fromBitmapAndMaskToPixmapL(CFbsBitmap* fbsBitmap,
CFbsBitmap* fbsMask, QPixmap& pixmap)
{
- if (fbsBitmap->Header().iCompression == ENoBitmapCompression) {
- pixmap = pixmap.fromSymbianCFbsBitmap(fbsBitmap);
- QPixmap mask;
- mask = mask.fromSymbianCFbsBitmap(fbsMask);
- pixmap.setAlphaChannel(mask);
- } else { // we need special handling for icons in 9.2 (NGA)
- // let's hope that in future it will be in QT code
- CFbsBitmap *temp(NULL);
- temp = CaBitmapAdapter::copyBitmapLC(fbsBitmap);
- pixmap = pixmap.fromSymbianCFbsBitmap(temp);
- CleanupStack::PopAndDestroy();
- temp = CaBitmapAdapter::copyBitmapLC(fbsMask);
- QPixmap mask;
- mask = mask.fromSymbianCFbsBitmap(temp);
- CleanupStack::PopAndDestroy();
- pixmap.setAlphaChannel(mask);
- }
+ pixmap = pixmap.fromSymbianCFbsBitmap(fbsBitmap);
+ QPixmap mask;
+ mask = mask.fromSymbianCFbsBitmap(fbsMask);
+ pixmap.setAlphaChannel(mask);
}
--- a/contentstorage/caclient/s60/src/camenuiconutility.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/s60/src/camenuiconutility.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -116,8 +116,6 @@
TPtr ptr(fileNameFromApparc->Des());
CaMenuIconMifUtility::GetPixmapByFilenameL(ptr,size,pixmap);
-
- pixmap = pixmap.scaled(size, Qt::KeepAspectRatioByExpanding);
icon = HbIcon(QIcon(pixmap));
} else {
icon = HbIcon(fileName);
@@ -149,7 +147,7 @@
XQConversions::s60DescToQString(KCaTypeCollection) ||
entry.entryTypeName() ==
XQConversions::s60DescToQString(KCaTypeCollectionDownload)) {
- icon = HbIcon("qtg_large_application");
+ icon = HbIcon("qtg_large_applications_user");
} else if (entry.entryTypeName() ==
XQConversions::s60DescToQString(KCaTypeUrl)) {
icon = HbIcon("qtg_large_application");
--- a/contentstorage/caclient/s60/src/caobserver.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/s60/src/caobserver.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -27,12 +27,6 @@
QObject(parent)
{
}
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
-CaObserver::~CaObserver()
-{
-}
//----------------------------------------------------------------------------
//
--- a/contentstorage/caclient/src/caentry.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/src/caentry.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -421,10 +421,8 @@
HbIcon CaEntry::makeIcon(const QSize &size) const
{
CACLIENTTEST_FUNC_ENTRY("CaEntry::makeIcon");
- HbIcon icon;
- if (CaIconCache::cache()->exist(*this,size)) {
- icon = CaIconCache::cache()->icon(*this,size);
- } else {
+ HbIcon icon = CaIconCache::cache()->icon(*this,size);
+ if (icon.isNull()) {
icon = m_d->makeIcon(size);
CaIconCache::cache()->insert(*this, size, icon);
}
--- a/contentstorage/caclient/src/caiconcache.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/src/caiconcache.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -116,10 +116,12 @@
HbIcon CaIconCache::icon(const CaEntry &entry, const QSize &size)
{
CACLIENTTEST_FUNC_ENTRY("CaIconCache::icon");
- HbIcon icon;
- icon = *mCache.object(key(entry,size));
+ HbIcon result;
+ if (HbIcon* tmp = mCache.object(key(entry,size))) {
+ result = *tmp;
+ }
CACLIENTTEST_FUNC_EXIT("CaIconCache::icon");
- return icon;
+ return result;
}
/*!
--- a/contentstorage/caclient/src/caitemmodel.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/src/caitemmodel.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -388,6 +388,16 @@
return m_d->entry(index);
}
+QList<int> CaItemModel::getUninstallingEntriesIds(int componentId)
+{
+ return m_d->getUninstallingEntriesIds(componentId);
+}
+
+void CaItemModel::updateProgress(int id, int valueOfProgress)
+{
+ m_d->updateProgress(id, valueOfProgress);
+}
+
/*!
Constructor
\param query needed to create model
@@ -476,8 +486,8 @@
break;
case CaItemModel::CollectionTitleRole:
if (!pEntry->attribute(COLLECTION_TITLE_NAME).isNull()) {
- variant = QVariant(hbTrId(pEntry->
- attribute(COLLECTION_TITLE_NAME).toUtf8()));
+ variant = QVariant(pEntry->
+ attribute(COLLECTION_TITLE_NAME).toUtf8());
}
else {
variant = QVariant(pEntry->text());
@@ -693,6 +703,24 @@
}
+QList<int> CaItemModelPrivate::getUninstallingEntriesIds(int componentId)
+{
+ CaQuery* query = new CaQuery(mQuery);
+ QString compId(QString().setNum(componentId));
+ query->setAttribute(QString("component_id"), compId);
+ QList<int> ids = mService->getEntryIds(*query);
+ delete query;
+ return ids;
+}
+
+void CaItemModelPrivate::updateProgress(int id, int valueOfProgress)
+{
+ int updateIndex = mEntries.updateProgress(id, valueOfProgress);
+ if (updateIndex >= 0) {
+ emit m_q->dataChanged(
+ index(updateIndex), index(updateIndex));
+ }
+}
/*!
Updates model with fresh entries and resets model
*/
@@ -824,7 +852,7 @@
if (itemsList == oldList) {
// assume that if the order has not changed
// it had to be the secondary lines
- updateModel();
+ emit m_q->dataChanged(index(0), index(m_q->rowCount()-1));
} else {
updateLayout();
}
@@ -1049,3 +1077,4 @@
emit m_q->countChange();
}
}
+
--- a/contentstorage/caclient/src/caitemmodellist.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/src/caitemmodellist.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -17,6 +17,7 @@
#include <QIcon>
+#include "caclient_defines.h"
#include "caitemmodellist.h"
#include "caitemmodel_p.h"
#include "canotifier.h"
@@ -104,6 +105,25 @@
CACLIENTTEST_FUNC_EXIT("CaItemModelList::updateEntry");
}
+int CaItemModelList::updateProgress(int id, int valueOfProgress)
+{
+ if (mEntriesHash.contains(id)) {
+ QSharedPointer<CaEntry> entry = at(indexOf(id));
+ if (valueOfProgress < 0) {
+ //we need to reload this entry from database
+ mEntriesHash.insert(id, mService->getEntry(entry->id()));
+ }
+ else {
+ entry->setFlags(entry->flags() | UsedEntryFlag
+ | UninstallEntryFlag);
+ entry->setAttribute(UNINSTALL_PROGRESS_APPLICATION_ATTRIBUTE_NAME,
+ QString().setNum(valueOfProgress));
+ mEntriesHash.insert(id, entry);
+ }
+ }
+ return indexOf(id);
+}
+
/*!
Updates entries
\param query with sort order
--- a/contentstorage/caclient/src/caqtsfhandlerloader.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/caclient/src/caqtsfhandlerloader.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -54,7 +54,7 @@
*/
void CaQtSfHandlerLoader::registerPlugins() const
{
- const QString pluginPath("hsresources/plugins/commandhandler");
+ const QString pluginPath("/resource/qt/plugins/commandhandler");
const QFileInfoList drives = QDir::drives();
foreach (QFileInfo drive, drives) {
--- a/contentstorage/cahandler/app/app.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/cahandler/app/app.pro Fri Aug 06 13:40:46 2010 +0300
@@ -14,7 +14,7 @@
CONFIG += plugin hb mobility
MOBILITY = serviceframework
-PLUGIN_SUBDIR = /hsresources/plugins/commandhandler
+PLUGIN_SUBDIR = /resource/qt/plugins/commandhandler
include(../../../common.pri)
@@ -49,8 +49,6 @@
-lscrclient \
-lxqutils \
-lcaclient
-
- exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager):LIBS += -lxqsettingsmanager
}
--- a/contentstorage/cahandler/tapp/tapp.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/cahandler/tapp/tapp.pro Fri Aug 06 13:40:46 2010 +0300
@@ -19,7 +19,7 @@
CONFIG += plugin mobility
MOBILITY = serviceframework
-PLUGIN_SUBDIR = /hsresources/plugins/commandhandler
+PLUGIN_SUBDIR = /resource/qt/plugins/commandhandler
include (../../../common.pri)
--- a/contentstorage/cahandler/url/url.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/cahandler/url/url.pro Fri Aug 06 13:40:46 2010 +0300
@@ -14,7 +14,7 @@
CONFIG += plugin hb mobility
MOBILITY = serviceframework
-PLUGIN_SUBDIR = /hsresources/plugins/commandhandler
+PLUGIN_SUBDIR = /resource/qt/plugins/commandhandler
include(../../../common.pri)
@@ -47,8 +47,6 @@
-lefsrv \
-lxqutils \
-lcaclient
-
- exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager):LIBS += -lxqsettingsmanager
}
--- a/contentstorage/casoftwareregistry/casoftwareregistry.pri Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casoftwareregistry/casoftwareregistry.pri Fri Aug 06 13:40:46 2010 +0300
@@ -15,4 +15,5 @@
#
HEADERS += ../../homescreensrv_plat/contentstorage_api/casoftwareregistry.h
+HEADERS += ../../homescreensrv_plat/contentstorage_api/cauninstallnotifier.h
SOURCES += ./src/*.cpp
--- a/contentstorage/casoftwareregistry/casoftwareregistry.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casoftwareregistry/casoftwareregistry.pro Fri Aug 06 13:40:46 2010 +0300
@@ -41,6 +41,7 @@
-lbafl \
-lestor \
-lscrclient \
+ -lsifnotification \
-lxqutils \
-lPlatformEnv \
-lefsrv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/inc/caprogresscanner.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,114 @@
+/*
+ * 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 CAPROGRESSCANER_H
+#define CAPROGRESSCANER_H
+
+#include <e32base.h>
+#include <usif/sif/sifnotification.h>
+#include <usif/usifcommon.h>
+#include <usif/sif/sifcommon.h>
+#include <usif/scr/scr.h>
+#include "cauninstallobserver.h"
+
+using namespace Usif;
+
+
+/**
+ * Uninstall Progress notifier.
+ *
+ * @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CCaProgresScanner ) : public CBase, public MSifOperationsHandler
+ {
+
+public:
+ /**
+ * Creates an instance of CCaProgresScanner.
+ */
+IMPORT_C static CCaProgresScanner* NewL( IUninstallObserver* aObserver );
+
+ /**
+ * Destructor.
+ */
+ virtual ~CCaProgresScanner();
+
+private:
+
+ /**
+ * Constructor.
+ */
+ CCaProgresScanner( IUninstallObserver* aObserver );
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL( );
+
+ void UpdateProgressL( const CSifOperationProgressData& aProgressData );
+ void EndOperationL( TInt aError );
+ void SubscribeL( TUint aKey );
+ void CancelSubscribeL();
+
+public:
+ /**
+ * From MSifOperationsHandler
+ */
+ void StartOperationHandler(
+ TUint aKey,
+ const CSifOperationStartData& aStartData );
+
+ /**
+ * From MSifOperationsHandler
+ */
+ void EndOperationHandler( const CSifOperationEndData& aEndData );
+
+ /**
+ * From MSifOperationsHandler
+ */
+ void ProgressOperationHandler(
+ const CSifOperationProgressData& aProgressData );
+
+private:
+
+ /**
+ * USIF notifier
+ * Own.
+ *
+ * Commented out since USIF notifications do not
+ * work on MCL wk20
+ */
+ CSifOperationsNotifier* iNotifier;
+
+ /**
+ * Reference to Software component registry. Not own.
+ */
+ RSoftwareComponentRegistry iSoftwareRegistry;
+
+ TUint iKey;
+
+ TComponentId iComponentId;
+
+ const IUninstallObserver* iObserver;
+ };
+
+
+#endif /* CAPROGRESSCANER_H */
+
+// End of File
+
+
--- a/contentstorage/casoftwareregistry/s60/inc/casoftwareregistry_p.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casoftwareregistry/s60/inc/casoftwareregistry_p.h Fri Aug 06 13:40:46 2010 +0300
@@ -25,6 +25,7 @@
class QStringList;
class CaSoftwareRegistry;
+class CaUninstallNotifier;
namespace Usif
{
@@ -52,9 +53,10 @@
DetailMap entryDetails(int componentId) const;
QList<DetailMap> retrieveLogEntries() const;
+ CaUninstallNotifier *createUninstallNotifier() const;
+
+private:
QList<DetailMap> retrieveLogEntriesL() const;
-
-private:
DetailMap entryDetailsL(
const Usif::CComponentEntry& entry) const;
void getUninstallDetailsL(int componentId,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/inc/cauninstallnotifier_p.h Fri Aug 06 13:40:46 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: canotifier.h
+ *
+ */
+
+#ifndef CAUNINSTALLNOTIFIER_P_H
+#define CAUNINSTALLNOTIFIER_P_H
+
+#include <QObject>
+#include <QSharedPointer>
+class CaUninstallObserver;
+class CCaProgresScanner;
+class CaUninstallNotifier;
+class CaSoftwareRegistry;
+
+class CaUninstallNotifierPrivate: public QObject
+{
+Q_OBJECT
+
+public:
+
+ explicit CaUninstallNotifierPrivate();
+
+ virtual ~CaUninstallNotifierPrivate();
+
+ void makeConnect();
+
+private:
+ CaUninstallObserver* mUninstallObserver;
+ CCaProgresScanner* mProgressScanner;
+ QSharedPointer<CaSoftwareRegistry> mCaSoftwareRegistry;
+
+ const CaUninstallNotifier *m_q;
+ friend class CaUninstallNotifier;
+
+};
+
+
+#endif // CAUNINSTALLNOTIFIER_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/inc/cauninstallobserver.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,72 @@
+/*
+ * 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 : Content Arsenal client session
+ *
+ */
+
+#ifndef CAUINSTALLOBSERVER_H_
+#define CAUINSTALLOBSERVER_H_
+
+#include <QObject>
+
+/**
+ * IDataObserver
+ *
+ */
+class IUninstallObserver
+{
+public:
+ /**
+ * Method invoked when entry is changed.
+ * @param entryId entry id.
+ * @param changeType change type.
+ */
+ virtual void progressChange(TInt componentId,
+ TInt valueOfProgress) const = 0;
+
+};
+
+
+
+class CaUninstallObserver: public QObject, public IUninstallObserver
+{
+ Q_OBJECT
+public:
+ /**
+ * Constructor.
+ * @param parent pointer to parent. Defaults to NULL.
+ */
+ CaUninstallObserver(QObject *parent = 0);
+
+ /**
+ * Destructor.
+ */
+ ~CaUninstallObserver();
+
+ /**
+ * Method invoked when entry is changed.
+ * @param entryId entry id.
+ * @param changeType change type.
+ */
+ void progressChange(TInt componentId,
+ TInt valueOfProgress) const;
+
+
+signals:
+
+ void signalprogressChange(int componentId, int valueOfProgress) const;
+};
+
+
+#endif /* CAUINSTALLOBSERVER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/src/caprogresscanner.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,165 @@
+/*
+ * 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 <s32mem.h>
+
+#include <usif/scr/scr.h>
+#include <usif/scr/screntries.h>
+
+#include "caprogresscanner.h"
+#include "caarraycleanup.inl"
+
+using namespace Usif;
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CCaProgresScanner* CCaProgresScanner::NewL( IUninstallObserver* aObserver )
+ {
+ CCaProgresScanner* self = new ( ELeave ) CCaProgresScanner( aObserver );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaProgresScanner::~CCaProgresScanner()
+ {
+ delete iNotifier;
+ iSoftwareRegistry.Close();
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaProgresScanner::CCaProgresScanner( IUninstallObserver* aObserver ) :
+ iObserver( aObserver )
+ {
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::ConstructL()
+ {
+ iNotifier = CSifOperationsNotifier::NewL( *this );
+ User::LeaveIfError( iSoftwareRegistry.Connect() );//user leave if error.
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::StartOperationHandler( TUint aKey,
+ const CSifOperationStartData& aStartData )
+ {
+ //TODO: temporary solution. Some error in scr was found
+ if( aStartData.OperationPhase() == EUninstalling
+ || aStartData.OperationPhase() == EInstalling )
+ {
+ TRAP_IGNORE(
+ iComponentId = iSoftwareRegistry.GetComponentIdL(
+ aStartData.GlobalComponentId(),
+ aStartData.SoftwareType() );
+ SubscribeL( aKey ) );
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::EndOperationHandler(
+ const CSifOperationEndData& aEndData )
+ {
+ TRAP_IGNORE( EndOperationL( aEndData.ErrorCode() ) );
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::ProgressOperationHandler(
+ const CSifOperationProgressData& aProgressData )
+ {
+ TRAP_IGNORE( UpdateProgressL( aProgressData ) );
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::UpdateProgressL(
+ const CSifOperationProgressData& aProgressData )
+ {
+ if( aProgressData.Phase() == EUninstalling )
+ {
+ iObserver->progressChange( iComponentId, aProgressData.CurrentProgess() );
+ }
+ else
+ {
+ //TODO: temporary solution. Some error in scr was found
+ //Progress should be remove for different operation
+ iObserver->progressChange( iComponentId, -1 );
+ CancelSubscribeL();
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::EndOperationL( TInt aError )
+ {
+ if( aError == KErrNone )
+ {
+ iObserver->progressChange( iComponentId, 100 );
+ }
+ else
+ {
+ //information for observer that uninstallation was failed
+ iObserver->progressChange( iComponentId, aError );
+ }
+ CancelSubscribeL();
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::CancelSubscribeL()
+ {
+ iNotifier->CancelSubscribeL( iKey );
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::SubscribeL( TUint aKey )
+ {
+ iKey = aKey;
+ iNotifier->SubscribeL( aKey, ETrue );
+ iObserver->progressChange( iComponentId, 0 );
+ }
--- a/contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -26,6 +26,8 @@
#include <xqconversions.h>
#include <driveinfo.h>
+#include "cauninstallnotifier.h"
+#include "cauninstallnotifier_p.h"
#include "casoftwareregistry.h"
#include "casoftwareregistry_p.h"
#include "cadefs.h"
@@ -54,6 +56,7 @@
*/
CaSoftwareRegistryPrivate::~CaSoftwareRegistryPrivate()
{
+
}
/*!
@@ -359,6 +362,14 @@
TRAP_IGNORE(logMap = retrieveLogEntriesL());
return logMap;
}
+/*!
+ Creating uninstall notifier
+ \return CaUninstallNotifier instance
+ */
+CaUninstallNotifier *CaSoftwareRegistryPrivate::createUninstallNotifier() const
+{
+ return CaUninstallNotifier::notifier();
+}
/*!
\param entry Software registry entry providing installation log.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/src/cauninstallnotifier_p.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,50 @@
+/*
+ * 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: canotifier.cpp
+ *
+ */
+
+#include "cauninstallnotifier.h"
+#include "cauninstallnotifier_p.h"
+#include "caprogresscanner.h"
+#include "cauninstallobserver.h"
+#include "casoftwareregistry.h"
+
+/*!
+ Constructor.
+ \param notifierFilter descrbies entries to observe.
+ */
+CaUninstallNotifierPrivate::CaUninstallNotifierPrivate() :
+ mUninstallObserver(NULL), mProgressScanner(NULL),
+ mCaSoftwareRegistry(CaSoftwareRegistry::create()),
+ m_q(NULL)
+{
+ mUninstallObserver = new CaUninstallObserver();
+ TRAP_IGNORE(mProgressScanner = CCaProgresScanner::NewL(mUninstallObserver));
+}
+
+/*!
+ Destructor.
+ */
+CaUninstallNotifierPrivate::~CaUninstallNotifierPrivate()
+{
+ delete mProgressScanner;
+ delete mUninstallObserver;
+}
+
+void CaUninstallNotifierPrivate::makeConnect()
+{
+ connect(mUninstallObserver, SIGNAL(signalprogressChange(int, int)),
+ m_q, SIGNAL(progressChange(int, int)));
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/src/cauninstallobserver.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,45 @@
+/*
+ * 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:
+ *
+ */
+
+#include <QDebug>
+#include "cauninstallobserver.h"
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaUninstallObserver::CaUninstallObserver(QObject *parent) :
+ QObject(parent)
+{
+}
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaUninstallObserver::~CaUninstallObserver()
+{
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaUninstallObserver::progressChange(TInt componentId,
+ TInt valueOfProgress) const
+{
+ qDebug() << "CaClientProxy::groupContentChanged groupId:" << componentId;
+
+ emit signalprogressChange(int(componentId), int(valueOfProgress));
+}
+
--- a/contentstorage/casoftwareregistry/src/casoftwareregistry.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casoftwareregistry/src/casoftwareregistry.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -18,7 +18,7 @@
#include <QString>
#include <QStringList>
-
+#include "cauninstallnotifier.h"
#include "casoftwareregistry.h"
#include "casoftwareregistry_p.h"
@@ -169,6 +169,15 @@
}
/*!
+ Creates uninstall notifier.
+ \retval pointer to created CaUninstallNotifier instance.
+ */
+CaUninstallNotifier *CaSoftwareRegistry::createUninstallNotifier() const
+{
+ return m_d->createUninstallNotifier();
+}
+
+/*!
* \return Component name key in CaSoftwareRegistry::DetailMap.
*/
QString CaSoftwareRegistry::componentNameKey()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/src/cauninstallnotifier.cpp Fri Aug 06 13:40:46 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: canotifier.cpp
+ *
+ */
+
+
+#include <QCoreApplication>
+#include "cauninstallnotifier.h"
+#include "cauninstallnotifier_p.h"
+
+QSharedPointer<CaUninstallNotifier> CaUninstallNotifier::mInstance(0);
+
+/*!
+ Constructor.
+ \param entryPrivate pointer to private implementation.
+ */
+CaUninstallNotifier::CaUninstallNotifier(CaUninstallNotifierPrivate *const notifierPrivate) :
+ QObject(0), m_d(notifierPrivate)
+{
+ m_d->m_q = this;
+ m_d->makeConnect();
+}
+
+/*!
+ Destructor.
+ */
+CaUninstallNotifier::~CaUninstallNotifier()
+{
+ delete m_d;
+}
+
+CaUninstallNotifier* CaUninstallNotifier::notifier()
+{
+ if (!mInstance.data()) {
+ mInstance = QSharedPointer<CaUninstallNotifier>(
+ new CaUninstallNotifier(new CaUninstallNotifierPrivate()));
+ mInstance->setParent(QCoreApplication::instance());
+ }
+ return mInstance.data();
+}
+
+
--- a/contentstorage/casoftwareregistry/stub/inc/casoftwareregistry_p.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casoftwareregistry/stub/inc/casoftwareregistry_p.h Fri Aug 06 13:40:46 2010 +0300
@@ -23,6 +23,7 @@
class QStringList;
class CaSoftwareRegistry;
+class CaUninstallNotifier;
class CaSoftwareRegistryPrivate
{
@@ -43,6 +44,7 @@
DetailMap entryDetails(int componentId) const;
QList<DetailMap> retrieveLogEntries() const;
+ CaUninstallNotifier *createUninstallNotifier() const;
private:
CaSoftwareRegistry *const m_q;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/stub/inc/cauninstallnotifier_p.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,49 @@
+/*
+ * 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: canotifier.h
+ *
+ */
+
+#ifndef CAUNINSTALLNOTIFIER_P_H
+#define CAUNINSTALLNOTIFIER_P_H
+
+#include <QObject>
+#include <QSharedPointer>
+class CaUninstallObserver;
+class CaUninstallNotifier;
+class CaSoftwareRegistry;
+
+class CaUninstallNotifierPrivate: public QObject
+{
+Q_OBJECT
+
+public:
+
+ explicit CaUninstallNotifierPrivate();
+
+ virtual ~CaUninstallNotifierPrivate();
+
+ void makeConnect();
+
+private:
+ CaUninstallObserver* mUninstallObserver;
+ QSharedPointer<CaSoftwareRegistry> mCaSoftwareRegistry;
+
+ const CaUninstallNotifier *m_q;
+ friend class CaUninstallNotifier;
+
+};
+
+
+#endif // CAUNINSTALLNOTIFIER_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/stub/inc/cauninstallobserver.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,42 @@
+/*
+ * 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 : Content Arsenal client session
+ *
+ */
+
+#ifndef CAUINSTALLOBSERVER_H_
+#define CAUINSTALLOBSERVER_H_
+
+#include <QObject>
+
+
+class CaUninstallObserver: public QObject
+{
+ Q_OBJECT
+public:
+ /**
+ * Constructor.
+ * @param parent pointer to parent. Defaults to NULL.
+ */
+ CaUninstallObserver(QObject *parent = 0);
+
+ /**
+ * Destructor.
+ */
+ ~CaUninstallObserver();
+
+};
+
+
+#endif /* CAUINSTALLOBSERVER_H_ */
--- a/contentstorage/casoftwareregistry/stub/src/casoftwareregistry_p.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casoftwareregistry/stub/src/casoftwareregistry_p.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -18,7 +18,8 @@
#include <QMetaType>
#include <QStringList>
-
+#include "cauninstallnotifier.h"
+#include "cauninstallnotifier_p.h"
#include "casoftwareregistry.h"
#include "casoftwareregistry_p.h"
@@ -118,3 +119,12 @@
logList.append(logMap);
return logList;
}
+
+/*!
+ Creating uninstall notifier
+ \return CaUninstallNotifier instance
+ */
+CaUninstallNotifier *CaSoftwareRegistryPrivate::createUninstallNotifier() const
+{
+ return CaUninstallNotifier::notifier();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/stub/src/cauninstallnotifier_p.cpp Fri Aug 06 13:40:46 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: canotifier.cpp
+ *
+ */
+
+#include "cauninstallnotifier.h"
+#include "cauninstallnotifier_p.h"
+#include "cauninstallobserver.h"
+#include "casoftwareregistry.h"
+
+/*!
+ Constructor.
+ \param notifierFilter descrbies entries to observe.
+ */
+CaUninstallNotifierPrivate::CaUninstallNotifierPrivate() :
+ mUninstallObserver(NULL),
+ mCaSoftwareRegistry(CaSoftwareRegistry::create()),
+ m_q(NULL)
+{
+ mUninstallObserver = new CaUninstallObserver();
+}
+
+/*!
+ Destructor.
+ */
+CaUninstallNotifierPrivate::~CaUninstallNotifierPrivate()
+{
+ delete mUninstallObserver;
+}
+
+void CaUninstallNotifierPrivate::makeConnect()
+{
+ connect(mUninstallObserver, SIGNAL(signalprogressChange(int, int)),
+ m_q, SIGNAL(progressChange(int, int)));
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/stub/src/cauninstallobserver.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,34 @@
+/*
+ * 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:
+ *
+ */
+
+#include <QDebug>
+#include "cauninstallobserver.h"
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaUninstallObserver::CaUninstallObserver(QObject *parent) :
+ QObject(parent)
+{
+}
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaUninstallObserver::~CaUninstallObserver()
+{
+}
+
--- a/contentstorage/casrv/calocalizerscanner/inc/calocalizerscannerproxy.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casrv/calocalizerscanner/inc/calocalizerscannerproxy.h Fri Aug 06 13:40:46 2010 +0300
@@ -93,6 +93,10 @@
const TDesC& GetEntryDescription(
const RPointerArray<CCaInnerEntry>& aEntries, TInt aId );
+ const TPtrC GetAttributeName(
+ const RPointerArray<CCaInnerEntry>& aEntries,
+ TInt aId,
+ const TDesC& aAttrName );
private:
/*
--- a/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -137,12 +137,19 @@
localizedName = GetLocalizedNameLC( locals[i] );
if( locals[i]->GetAttributeName().Compare( KColumnEnText) == 0
- && !localizedName->Compare(
- GetEntryText( entries, locals[i]->GetRowId() ) ) == 0
+ && localizedName->Compare(
+ GetEntryText( entries, locals[i]->GetRowId() ) ) != 0
||
locals[i]->GetAttributeName().Compare( KColumnEnDescription) == 0
- && !localizedName->Compare(
- GetEntryDescription( entries, locals[i]->GetRowId() ) ) == 0 )
+ && localizedName->Compare(
+ GetEntryDescription( entries, locals[i]->GetRowId() ) ) != 0
+ ||
+ ( locals[i]->GetAttributeName().Compare( KShortName ) == 0
+ || locals[i]->GetAttributeName().Compare( KTitleName ) == 0 )
+ && localizedName->Compare(
+ GetAttributeName( entries,
+ locals[i]->GetRowId(),
+ locals[i]->GetAttributeName() ) ) != 0 )
// translations different than text
{
locals[i]->SetLocalizedStringL( *localizedName );
@@ -246,3 +253,26 @@
}
return KNullDesC();
}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+const TPtrC CCaLocalizerScannerProxy::GetAttributeName(
+ const RPointerArray<CCaInnerEntry>& aEntries,
+ TInt aId,
+ const TDesC& aAttrName )
+ {
+ TBool notFound( ETrue );
+ TPtrC attrValue;
+ TInt entriesCount = aEntries.Count();
+ for( TInt i=0; i < entriesCount && notFound; i++ )
+ {
+ if( aEntries[i]->GetId() == aId &&
+ aEntries[i]->GetAttributes().Find(aAttrName, attrValue) )
+ {
+ notFound = EFalse;
+ }
+ }
+ return attrValue;
+ }
--- a/contentstorage/casrv/caprogresscanner/data/caprogresscanner.rss Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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: caprogresscanner.rss
-* ECOM DLL UID: 20022F86
-* ECOM interface UID: (KCaSrvPluginInterfaceUid)
-* ECOM Implementation: 20022F87
-*
-*/
-
-#include <ecom/registryinfo.rh>
-#include "casrvpluginuids.hrh"
-
-RESOURCE REGISTRY_INFO theInfo
- {
- // UID for the DLL
- dll_uid = 0x20022F86;
- // Declare array of interface info
- interfaces =
- {
- INTERFACE_INFO
- {
- // UID of interface that is implemented
- interface_uid = KCaSrvPluginInterfaceUid;
- implementations =
- {
- // Info for App Scanner
- IMPLEMENTATION_INFO
- {
- implementation_uid = 0x20022F87;
- version_no = 1;
- display_name = "Progress Scanner";
- default_data = "PROGRESSCANNER";
- opaque_data = "";
- }
- };
- }
- };
- }
-
--- a/contentstorage/casrv/caprogresscanner/group/bld.inf Fri Jul 23 14:03:00 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: bld.inf
-*
-*/
-
-PRJ_PLATFORMS
-// specify the platforms your component needs to be built for here
-// defaults to WINS ARMI ARM4 THUMB so you can ignore this if you just build these
-
-PRJ_EXPORTS
-
-
-PRJ_MMPFILES
-// Specify the .mmp files required for building the important component
-// releasables. Note that you should specify any .mmp files for test
-// programs further down the file.
-caprogresscanner.mmp
-
-PRJ_TESTMMPFILES
--- a/contentstorage/casrv/caprogresscanner/group/caprogresscanner.mmp Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +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: caprogresscanner.mmp
-*
-*/
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET caprogresscanner.dll
-TARGETTYPE PLUGIN
-
-// ECom Dll recognition UID followed by the unique UID for this dll
-UID 0x10009D8D 0x20022F86
-SECUREID 0x20022F86
-CAPABILITY CAP_ECOM_PLUGIN
-
-SOURCEPATH ../src
-SOURCE proxy.cpp
-SOURCE caprogresscanner.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../casrvmgr/inc
-USERINCLUDE ../../../inc
-USERINCLUDE ../../../cautils/inc
-USERINCLUDE ../../../srvinc
-
-
-MW_LAYER_SYSTEMINCLUDE
-
-SOURCEPATH ../data
-START RESOURCE caprogresscanner.rss
- LANG sc
- TARGET caprogresscanner.rsc
-END
-
-LIBRARY euser.lib
-LIBRARY ECom.lib
-LIBRARY camenu.lib
-LIBRARY cautils.lib
-LIBRARY apparc.lib
-LIBRARY apgrfx.lib
-LIBRARY bafl.lib
-LIBRARY efsrv.lib
-LIBRARY platformenv.lib
-
-LIBRARY sifnotification.lib
-LIBRARY scrclient.lib
-LIBRARY sif.lib
--- a/contentstorage/casrv/caprogresscanner/inc/caprogresscanner.h Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +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 CAPROGRESSCANER_H
-#define CAPROGRESSCANER_H
-
-#include <e32base.h>
-#include <usif/sif/sifnotification.h>
-#include <usif/usifcommon.h>
-#include <usif/sif/sifcommon.h>
-#include <usif/scr/scr.h>
-
-#include "casrvplugin.h"
-#include "castorage_global.h"
-
-using namespace Usif;
-
-class CCaStorageProxy;
-class CCaInnerEntry;
-
-/**
- * Uninstall Progress notifier.
- *
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CCaProgresScanner ) : public CCaSrvPlugin,
- public MSifOperationsHandler
- {
-
-public:
- /**
- * Creates an instance of CCaProgresScanner.
- * @param aPLuginParam plugin param consist of storage, storage utils and scr.
- */
-IMPORT_C static CCaProgresScanner* NewL( TPluginParams* aPLuginParam );
-
- /**
- * Destructor.
- */
- virtual ~CCaProgresScanner();
-
-private:
-
- /**
- * Constructor.
- * @param aPLuginParam plugin param consist of storage, storage utils and scr.
- */
- CCaProgresScanner( TPluginParams* aPLuginParam );
-
- /**
- * Symbian 2nd phase constructor.
- */
- void ConstructL( );
-
- void UpdateProgressL( const CSifOperationProgressData& aProgressData );
- void EndOperationL(TInt aError);
- void MarkEntrysForUnistallL(TUint aKey, TComponentId aComponentId);
-
-public:
- /**
- * From MSifOperationsHandler
- */
- void StartOperationHandler(TUint aKey, const CSifOperationStartData& aStartData);
-
- /**
- * From MSifOperationsHandler
- */
- void EndOperationHandler(const CSifOperationEndData& aEndData);
-
- /**
- * From MSifOperationsHandler
- */
- void ProgressOperationHandler(const CSifOperationProgressData& aProgressData);
-
-private:
-
- /**
- * USIF notifier
- * Own.
- *
- * Commented out since USIF notifications do not
- * work on MCL wk20
- */
- CSifOperationsNotifier* iNotifier;
-
- /**
- * Not Own.
- * Reference to the Storage Proxy.
- */
- CCaStorageProxy& iStorageProxy;
-
- /**
- * Reference to Software component registry. Not own.
- */
- RSoftwareComponentRegistry& iSoftwareRegistry;
-
- /**
- * All entries with componentID of uninstalling application
- */
- RPointerArray<CCaInnerEntry> iResultArrayItems;
-
- TUint iKey;
-
- CA_STORAGE_TEST_FRIEND_CLASS (T_casrvProgresScaner)
- };
-
-
-#endif /* CAPROGRESSCANER_H */
-
-// End of File
-
--- a/contentstorage/casrv/caprogresscanner/src/caprogresscanner.cpp Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +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 <s32mem.h>
-
-#include <usif/scr/scr.h>
-#include <usif/scr/screntries.h>
-
-#include "caprogresscanner.h"
-#include "castorageproxy.h"
-#include "cainnerquery.h"
-#include "cainnerentry.h"
-#include "caarraycleanup.inl"
-#include "casrvplugin.h"
-
-using namespace Usif;
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CCaProgresScanner* CCaProgresScanner::NewL(
- TPluginParams* aPluginParam )
- {
- CCaProgresScanner* self = new ( ELeave ) CCaProgresScanner(
- aPluginParam );
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCaProgresScanner::~CCaProgresScanner()
- {
- delete iNotifier;
- iResultArrayItems.ResetAndDestroy();
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCaProgresScanner::CCaProgresScanner( TPluginParams* aPluginParam ) :
- iStorageProxy( *aPluginParam->storageProxy ),
- iSoftwareRegistry( *aPluginParam->softwareRegistry )
- {
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgresScanner::ConstructL()
- {
- iNotifier = CSifOperationsNotifier::NewL( *this );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgresScanner::StartOperationHandler( TUint aKey,
- const CSifOperationStartData& aStartData )
- {
- TInt err( KErrNone );
- TComponentId componentId( 0 );
- iResultArrayItems.ResetAndDestroy();
-
- TRAP(err, componentId = iSoftwareRegistry.GetComponentIdL(
- aStartData.GlobalComponentId(), aStartData.SoftwareType() ));
- if ( !err )
- TRAP(err, MarkEntrysForUnistallL(aKey, componentId));
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgresScanner::EndOperationHandler(
- const CSifOperationEndData& aEndData )
- {
- TInt err = KErrNone;
- TRAP( err, EndOperationL( aEndData.ErrorCode() ) );
- iResultArrayItems.ResetAndDestroy();
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgresScanner::ProgressOperationHandler(
- const CSifOperationProgressData& aProgressData )
- {
- TInt err = KErrNone;
- TRAP( err, UpdateProgressL( aProgressData ) );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgresScanner::UpdateProgressL(
- const CSifOperationProgressData& aProgressData )
- {
- RBuf totalProgressBuf;
- totalProgressBuf.CleanupClosePushL();
- totalProgressBuf.CreateL( sizeof(TComponentId) + 1 );
- totalProgressBuf.AppendNum( aProgressData.CurrentProgess() );
-
- if ( iResultArrayItems.Count() && aProgressData.Phase() == EUninstalling )
- {
- for ( int i = 0; i < iResultArrayItems.Count(); i++ )
- {
- iResultArrayItems[i]->AddAttributeL( KCaAppUninstallProgress,
- totalProgressBuf );
- iStorageProxy.AddL( iResultArrayItems[i], ETrue,
- EItemUninstallProgressChanged );
- }
- }
-
- CleanupStack::PopAndDestroy( &totalProgressBuf );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgresScanner::EndOperationL( TInt aError )
- {
- if ( aError )
- {
- for ( int i = 0; i < iResultArrayItems.Count(); i++ )
- {
- iResultArrayItems[i]->SetFlags( iResultArrayItems[i]->GetFlags()
- & ~EUninstall );
- iStorageProxy.AddL( iResultArrayItems[i] );
- }
- }
- iNotifier->CancelSubscribeL( iKey );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgresScanner::MarkEntrysForUnistallL( TUint aKey,
- TComponentId aComponentId )
- {
- RBuf componentIdBuf;
- componentIdBuf.CleanupClosePushL();
- componentIdBuf.CreateL( sizeof(TComponentId) + 1 );
- componentIdBuf.AppendNum( aComponentId );
-
- // find entry by componentID
- CCaInnerQuery *innerQuery = CCaInnerQuery::NewLC();
- innerQuery->SetRole( CCaInnerQuery::Item );
- innerQuery->AddAttributeL( KCaAttrComponentId, componentIdBuf );
-
- iStorageProxy.GetEntriesL( innerQuery, iResultArrayItems );
-
- if ( iResultArrayItems.Count() )
- {
- for ( int i = 0; i < iResultArrayItems.Count(); i++ )
- {
- iResultArrayItems[i]->SetFlags( iResultArrayItems[i]->GetFlags()
- | EUninstall );
- iStorageProxy.AddL( iResultArrayItems[i] );
- }
- // subscribe for progress notifier
- iKey = aKey;
- iNotifier->SubscribeL( aKey, ETrue );
- }
- CleanupStack::PopAndDestroy( innerQuery );
- CleanupStack::PopAndDestroy( &componentIdBuf );
- }
--- a/contentstorage/casrv/caprogresscanner/src/proxy.cpp Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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: proxy.cpp
- *
- */
-
-#include <e32std.h>
-#include <ecom/implementationproxy.h>
-#include "caprogresscanner.h"
-
-const TUint KCaProgresScannerImplProxyUid = 0x20022F87;
-
-// Provides a key value pair table, this is used to identify
-// the correct construction function for the requested interface.
-const TImplementationProxy ImplementationTable[] =
- {
- IMPLEMENTATION_PROXY_ENTRY(KCaProgresScannerImplProxyUid,
- CCaProgresScanner::NewL)
- };
-
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT (proxy for instantiation)
-
-// Function used to return an instance of the proxy table.
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
- TInt& aTableCount )
- {
- aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
- return ImplementationTable;
- }
-
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
-
--- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h Fri Aug 06 13:40:46 2010 +0300
@@ -48,6 +48,12 @@
virtual ~CCaWidgetDescription();
/**
+ * @return new heap allocated object being a copy of the object.
+ * Ownership is passed to the caller.
+ */
+ CCaWidgetDescription *CloneL();
+
+ /**
* Static method to compare two CCaWidgetDescription objects
* used in Find() method
* @param aFirst first item to compare
@@ -55,7 +61,7 @@
* @return ETrue if widget uri value is the same in both objects,
* otherwise returns EFalse
*/
- static TBool Compare( const CCaWidgetDescription& aFirst,
+ static TBool CompareUri( const CCaWidgetDescription& aFirst,
const CCaWidgetDescription& aSecond );
/**
--- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h Fri Aug 06 13:40:46 2010 +0300
@@ -164,9 +164,9 @@
RFs iFs;
/*
- * Widgets. Own.
+ * DB cache for widgets. Own.
*/
- RWidgetArray iWidgets;
+ RWidgetArray iWidgetDBCache;
/**
* Pointer to a parser object. Own
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -161,7 +161,34 @@
//
// ----------------------------------------------------------------------------
//
-TBool CCaWidgetDescription::Compare(
+CCaWidgetDescription *CCaWidgetDescription::CloneL()
+ {
+ CCaWidgetDescription* clone = CCaWidgetDescription::NewL();
+
+ clone->SetPathL( GetPath() );
+ clone->SetMmcIdL( GetMmcId() );
+ clone->SetStringidTitleL( GetStringIdTitle() );
+ clone->SetLibraryL( GetLibrary() );
+ clone->SetDescriptionL( GetDescription() );
+ clone->SetStringIdDescriptionL( GetStringIdDescription() );
+ clone->SetUriL( GetUri() );
+ clone->SetIconUriL( GetIconUri() );
+ clone->SetPreviewImageNameL( GetPreviewImageName() );
+ clone->SetTitleL( GetTitle() );
+ clone->SetTranslationFileNameL( GetTranslationFileName() );
+ clone->SetLibraryL( GetLibrary() );
+ clone->SetModificationTimeL( GetModificationTime() );
+ clone->SetServiceXmlL( GetServiceXml() );
+ clone->SetManifestFilePathNameL( GetManifestFilePathName() );
+
+ return clone;
+ }
+
+// ----------------------------------------------------------------------------
+//
+// ----------------------------------------------------------------------------
+//
+TBool CCaWidgetDescription::CompareUri(
const CCaWidgetDescription& aFirst,const CCaWidgetDescription& aSecond)
{
TBool result = EFalse;
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -154,12 +154,12 @@
{
if ( ( *fileList )[i].iName.Find( KManifest ) != KErrNotFound )
{
- RBuf fullFilePath;
- CleanupClosePushL( fullFilePath );
- fullFilePath.CreateL( manifestDirectoryPath->Length()
+ RBuf manifestFilePathName;
+ CleanupClosePushL( manifestFilePathName );
+ manifestFilePathName.CreateL( manifestDirectoryPath->Length()
+ ( *fileList )[i].iName.Length() );
- fullFilePath.Append( *manifestDirectoryPath );
- fullFilePath.Append( ( *fileList )[i].iName );
+ manifestFilePathName.Append( *manifestDirectoryPath );
+ manifestFilePathName.Append( ( *fileList )[i].iName );
TPtrC packageUidPtr = manifestDirectoryPath->Mid(
manifestDirectoryPath->Length() - KPackageUidPosition,
@@ -168,37 +168,46 @@
TLex lexer( packageUidPtr );
User::LeaveIfError( lexer.Val( packageUid, EHex ) );
- CCaWidgetDescription* compareWidget = NULL;
+ CCaWidgetDescription* currentWidget = NULL;
for ( TInt j = 0; j < iFetchedWidgets.Count(); j++ )
{
if ( iFetchedWidgets[j]->GetPackageUidL() == packageUid )
{
- compareWidget = iFetchedWidgets[j];
- compareWidget->SetValid( ETrue ); //do not remove from db
+ currentWidget = iFetchedWidgets[j];
+ currentWidget->SetValid( ETrue ); //do not remove from db
break; // once found we dont iterate anymore
}
}
- if ( compareWidget )
+ if ( currentWidget )
{
TTime modificationTime = ( *fileList )[i].iModified;
TInt64 modificationIntTime = modificationTime.Int64();
- TLex lex( compareWidget->GetModificationTime() );
+ TLex lex( currentWidget->GetModificationTime() );
TInt64 uintTimeDB( 0 );
User::LeaveIfError( lex.Val( uintTimeDB ) );
if ( uintTimeDB != modificationIntTime )
{
- TRAP_IGNORE( ParseManifestFileL( fullFilePath,
+ TRAP_IGNORE( ParseManifestFileL( manifestFilePathName,
aDirectoryName, aDrive ) );
}
+ else if ( currentWidget->IsMissing() )
+ {
+ // manifest of missing widget found
+ CCaWidgetDescription* clone = currentWidget->CloneL();
+ CleanupStack::PushL( clone );
+ clone->SetManifestFilePathNameL( manifestFilePathName );
+ iWidgets.AppendL( clone );
+ CleanupStack::Pop( clone );
+ }
}
else
{
- TRAP_IGNORE( ParseManifestFileL( fullFilePath, aDirectoryName,
+ TRAP_IGNORE( ParseManifestFileL( manifestFilePathName, aDirectoryName,
aDrive ) );
}
- CleanupStack::PopAndDestroy( &fullFilePath );
+ CleanupStack::PopAndDestroy( &manifestFilePathName );
}
}
CleanupStack::PopAndDestroy( fileList );
@@ -304,7 +313,7 @@
SetModificationTimeL( aFilePath, widgetDescriptor );
TInt index = iWidgets.Find( widgetDescriptor,
- CCaWidgetDescription::Compare );
+ CCaWidgetDescription::CompareUri );
if ( index != KErrNotFound )
{
delete iWidgets[index];
@@ -340,7 +349,7 @@
SetModificationTimeL( aFilePath, widget );
- TInt index = iWidgets.Find( widget, CCaWidgetDescription::Compare );
+ TInt index = iWidgets.Find( widget, CCaWidgetDescription::CompareUri );
if ( index != KErrNotFound )
{
delete iWidgets[index];
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -91,7 +91,7 @@
CCaWidgetStorageHandler::~CCaWidgetStorageHandler()
{
delete iParser;
- iWidgets.ResetAndDestroy();
+ iWidgetDBCache.ResetAndDestroy();
}
// ----------------------------------------------------------------------------
@@ -101,7 +101,7 @@
void CCaWidgetStorageHandler::SynchronizeL()
{
FetchWidgetsL();
- AddWidgetsL( iParser->WidgetsScanL( iWidgets ) );
+ AddWidgetsL( iParser->WidgetsScanL( iWidgetDBCache ) );
RemoveWidgetsL();
}
@@ -161,25 +161,40 @@
//
void CCaWidgetStorageHandler::AddWidgetsL( const RWidgetArray& aWidgets )
{
- for ( TInt i = 0; i < aWidgets.Count(); i++ )
+ const TInt newWidgetsCount = aWidgets.Count();
+
+ for ( TInt i = 0; i < newWidgetsCount; ++i )
{
- aWidgets[i]->LocalizeTextsL();
- TInt index = iWidgets.Find( aWidgets[i], CCaWidgetDescription::Compare );
- if ( index != KErrNotFound )
+ CCaWidgetDescription *const newWidget = aWidgets[i];
+
+ newWidget->LocalizeTextsL();
+
+ const TInt dbCacheIndex =
+ iWidgetDBCache.Find(
+ newWidget, CCaWidgetDescription::CompareUri );
+
+ if ( dbCacheIndex != KErrNotFound )
{
- iWidgets[index]->SetValid( ETrue );
- if ( !iWidgets[index]->Compare( *aWidgets[i] )
- || iWidgets[index]->IsMissing() )
+ CCaWidgetDescription *const cachedWidget =
+ iWidgetDBCache[dbCacheIndex];
+
+ cachedWidget->SetValid( ETrue );
+
+ const TBool cachedDifferentThanNew =
+ !cachedWidget->Compare( *newWidget );
+
+ if ( cachedDifferentThanNew || cachedWidget->IsMissing() )
{
- aWidgets[i]->SetFlag( EMissing, iWidgets[index]->IsMissing() );
- aWidgets[i]->SetFlag( EUsed, iWidgets[index]->IsUsed() );
- aWidgets[i]->SetFlag( EVisible, iWidgets[index]->IsVisible() );
- UpdateL( aWidgets[i], iWidgets[index]->GetEntryId() );
+ newWidget->SetFlag( EMissing, cachedWidget->IsMissing() );
+ newWidget->SetFlag( EUsed, cachedWidget->IsUsed() );
+ newWidget->SetFlag( EVisible, cachedWidget->IsVisible() );
+
+ UpdateL( newWidget, cachedWidget->GetEntryId() );
}
}
else
{
- AddL( aWidgets[i] );
+ AddL( newWidget );
}
}
HbTextResolverSymbian::Init( _L(""), KLocalizationFilepathZ );
@@ -191,34 +206,36 @@
//
void CCaWidgetStorageHandler::RemoveWidgetsL()
{
- for ( TInt i = 0; i < iWidgets.Count(); i++ )
+ const TInt cacheCount = iWidgetDBCache.Count();
+ for ( TInt i = 0; i < cacheCount; ++i)
{
- if ( !iWidgets[i]->IsValid() )
+ CCaWidgetDescription *const cachedWidget = iWidgetDBCache[i];
+ if ( !cachedWidget->IsValid() )
{
- if ( iWidgets[i]->GetMmcId() != KNullDesC )
+ if ( cachedWidget->GetMmcId() != KNullDesC )
{
RBuf currentMmcId;
currentMmcId.CreateL( KMassStorageIdLength );
currentMmcId.CleanupClosePushL();
WidgetScannerUtils::CurrentMmcId( iFs, currentMmcId );
- if( iWidgets[i]->GetMmcId() == currentMmcId ||
- ( iWidgets[i]->GetMmcId() == KCaMassStorage() &&
+ if( cachedWidget->GetMmcId() == currentMmcId ||
+ ( cachedWidget->GetMmcId() == KCaMassStorage() &&
MassStorageNotInUse() ) )
{
//item was uninstalled so we remove its mmc id
- iWidgets[i]->RemoveMmcId();
- ClearVisibleFlagL( iWidgets[i] );
+ cachedWidget->RemoveMmcId();
+ ClearVisibleFlagL( cachedWidget );
}
else
{
- SetMissingFlagL( iWidgets[i] );
+ SetMissingFlagL( cachedWidget );
}
CleanupStack::PopAndDestroy( ¤tMmcId );
}
else
{
//item was uninstalled so we remove its mmc id
- ClearVisibleFlagL( iWidgets[i] );
+ ClearVisibleFlagL( cachedWidget );
}
}
}
@@ -277,11 +294,11 @@
CleanupResetAndDestroyPushL( entries );
iStorage->GetEntriesL( query, entries );
- iWidgets.ResetAndDestroy();
+ iWidgetDBCache.ResetAndDestroy();
for ( TInt i = 0; i < entries.Count(); i++ )
{
CCaWidgetDescription* widget = CCaWidgetDescription::NewLC( entries[i] );
- iWidgets.AppendL( widget ); //iWidgets takes ownership
+ iWidgetDBCache.AppendL( widget ); //iWidgets takes ownership
CleanupStack::Pop( widget );
}
CleanupStack::PopAndDestroy( &entries );
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/castorage/conf/CI_castoragedb.confml Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<confml:configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.s60.com/xml/confml/2" xmlns:confml="http://www.s60.com/xml/confml/2" xsi:schemaLocation="http://www.s60.com/xml/confml/2 http://www.s60.com/xml/confml/1#//confml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Content storage database settings">
+ <confml:feature ref="CaStorageDbSetting" name="Application Library model">
+ <setting ref="OperatorCollections" name="Operator Collections" maxOccurs="1" minOccurs="0" type="sequence" mapKey="Name" mapValue="Name">
+ <setting ref="Name" name="Collection Name" type="string" required="true">
+ <desc>Name of the Operator Collection.</desc>
+ <xs:maxLength value="32"/>
+ </setting>
+ <confml:setting ref="ShortName" name="Collection Short Name" type="string">
+ <confml:desc>Collection short name. Optional. Name used in Homescreen when shortcut to collection is created.</confml:desc>
+ </confml:setting>
+ <confml:setting ref="TitleName" name="Collection Title Name" type="string">
+ <confml:desc>Collection title name. Optional. Name displayed when user enter to collection (heading).</confml:desc>
+ </confml:setting>
+ <setting name="Collection Group Name" ref="GroupName" type="string">
+ <desc>Group name. Not localized name. Identify collection where application with predefined group name should be added after installation.</desc>
+ </setting>
+ <setting ref="Locked" name="Lock Operator Collection and content" type="boolean">
+ <desc>Lock operator collection and content - user can not delete operator collection, prevent renaming collection and even content. Not possible by user to add new content to defined collection</desc>
+ </setting>
+ <setting ref="Icon" name="Collection Icon" type="file" >
+ <desc>Icon.</desc>
+ <property name="type" value="image/svg" unit="mime"/>
+ <localPath></localPath>
+ <targetPath readOnly="true"/>
+ </setting>
+ <setting ref="IconSkinId" name="Icon Theme ID" type="string">
+ <desc>Icon Theme id. </desc>
+ </setting>
+ </setting>
+ <setting ref="OperatorURLs" name="Operator URLs" minOccurs="0" type="sequence" mapKey="OperatorURLTitle" mapValue="OperatorURLTitle">
+ <setting ref="OperatorURLTitle" name="Operator URL Title" type="string">
+ <desc>Title of the Operator URL</desc>
+ </setting>
+ <setting ref="OperatorURLShortTitle" name="Operator URL Short Title" type="string" required="true">
+ <desc>Short Title of the Operator URL. Optional. Displayed when shortcut to Url is added to Homescreen</desc>
+ </setting>
+ <setting ref="OperatorURL" name="Operator URL" type="string" required="true">
+ <desc>URL</desc>
+ <xs:pattern value="(http(|s)://([\w-]+\.)+[\w-]+(:[0-9]{1,5})?(/[\w- ./?%&=]*)?|)"/>
+ </setting>
+ <setting ref="OperatorURLIcon" name="Operator URL Icon" type="file">
+ <desc>Icon for the Operator URL.</desc>
+ <property name="type" value="image/svg" unit="mime"/>
+ <localPath></localPath>
+ <targetPath readOnly="true"/>
+ </setting>
+ <setting ref="IconSkinId" name="Icon Theme ID" type="string">
+ <desc>Icon Theme id. </desc>
+ </setting>
+ </setting>
+ <setting ref="OperatorCollectionItems" name="Operator Collection content" minOccurs="0" type="sequence" >
+ <setting ref="Type" name="Item type" type="selection">
+ <desc>Type of collection item.</desc>
+ <option name="Application" value="1"/>
+ <option name="Homescreen widget" value="2"/>
+ <option name="URL" value="3"/>
+ </setting>
+ <setting ref="Application" name="Application" type="string" relevant="Type='1'" required="true">
+ <desc>Application item for Operator collection.</desc>
+ <xs:pattern value="^[-+]?[0-9]{10}"/>
+ <!-- option map="DFSFeatures/Application"/>
+ <option map="CIA_PreinstalledContent/PreInstalledJavaRom"/>
+ <option map="CIA_PreinstalledContent/PreInstalledSymbianROM"/>
+ <option map="CIA_PreinstalledContent/PreInstalledSymbianUDA"/>
+ <option map="CIA_PreinstalledContent/PreInstalledJavaUDA"/-->
+ </setting>
+ <setting ref="HomescreenWidget" name="Homescreen widget" type="string" relevant="Type='2'" required="true">
+ <desc>Homescreen widget item for Operator collection</desc>
+ <!-- option map="HomescreenWidgets/Widgets"/>
+ <option map="CIA_PreinstalledWidgetUDA/PreInstalledWidgetUDA" /-->
+ </setting>
+ <setting ref="OperatorURL" name="Operator URL" type="selection" relevant="Type='3'" required="true">
+ <option map="CaStorageDbSetting/OperatorURLs"/>
+ </setting>
+ </setting>
+
+ <confml:setting ref="Collections" mapKey="Name" mapValue="Name" name="Collections" type="sequence">
+ <setting ref="LocalizeNames" name="Use localized collections names" type="boolean">
+ <desc>Enable localization support for collection names</desc>
+ </setting>
+ <confml:setting ref="TranslationFile" name="Translation file" type="string" relevant="LocalizeNames and LocalizeNames='true'" >
+ <confml:desc>Name of translation file used for fetching localized names</confml:desc>
+ </confml:setting>
+ <setting ref="Name" name="Collection Name" type="string" required="true">
+ <desc>Name of collection.</desc>
+ </setting>
+ <confml:setting ref="ShortName" name="Collection Short Name" type="string">
+ <confml:desc>Collection short name. Optional. Name used in Homescreen when shortcut to collection is created.</confml:desc>
+ </confml:setting>
+ <confml:setting ref="TitleName" name="Collection Title Name" type="string">
+ <confml:desc>Collection title name. Optional. Name displayed when user enter to collection (heading).</confml:desc>
+ </confml:setting>
+ <setting ref="GroupName" name="Collection Group Name" type="string">
+ <desc>Group name. Not localized name. Identify collection where application with predefined group name should be added after installation.</desc>
+ </setting>
+ <setting ref="Locked" name="Lock Operator Collection and content" type="boolean">
+ <desc>Lock operator collection and content - user can not delete operator collection, prevent renaming collection and even content. Not possible by user to add new content to defined collection</desc>
+ </setting>
+ <setting ref="Icon" name="Collection Icon" type="file" >
+ <desc>Icon.</desc>
+ <property name="type" value="image/svg" unit="mime"/>
+ <localPath></localPath>
+ <targetPath readOnly="true"/>
+ </setting>
+ <setting ref="IconSkinId" name="Icon Theme ID" type="string">
+ <desc>Icon Theme id. </desc>
+ </setting>
+ </confml:setting>
+
+ <setting ref="URLs" name="URLs" minOccurs="0" type="sequence" mapKey="URLTitle" mapValue="URLTitle">
+ <setting ref="URLTitle" name="URL Title" type="string" required="true">
+ <desc>Title of the Operator URL</desc>
+ </setting>
+ <setting ref="URLShortTitle" name="URL Short Title" type="string" >
+ <desc>Short Title of the Operator URL. Optional. Displayed when shortcut to Url is added to Homescreen</desc>
+ </setting>
+ <setting ref="URL" name="URL" type="string" required="true">
+ <desc>URL</desc>
+ <xs:pattern value="(http(|s)://([\w-]+\.)+[\w-]+(:[0-9]{1,5})?(/[\w- ./?%&=]*)?|)"/>
+ </setting>
+ <setting ref="URLIcon" name="URL Icon" type="file">
+ <desc>Icon for the Operator URL.</desc>
+ <property name="type" value="image/svg" unit="mime"/>
+ <localPath></localPath>
+ <targetPath readOnly="true"/>
+ </setting>
+ <setting ref="IconSkinId" name="Icon Theme ID" type="string">
+ <desc>Icon Theme id. </desc>
+ </setting>
+ </setting>
+
+ <confml:setting ref="Items" name="Collections content" type="sequence" >
+ <setting ref="Type" name="Item type" type="selection">
+ <desc>Type of collection item.</desc>
+ <option name="Application" value="1"/>
+ <option name="Homescreen widget" value="2"/>
+ <option name="URL" value="3"/>
+ </setting>
+ <setting ref="Application" name="Application" type="string" relevant="Type='1'" required="true">
+ <desc>Application item for Operator collection.</desc>
+ <xs:pattern value="^[-+]?[0-9]{10}"/>
+ <!-- option map="DFSFeatures/Application"/>
+ <option map="CIA_PreinstalledContent/PreInstalledJavaRom"/>
+ <option map="CIA_PreinstalledContent/PreInstalledSymbianROM"/>
+ <option map="CIA_PreinstalledContent/PreInstalledSymbianUDA"/>
+ <option map="CIA_PreinstalledContent/PreInstalledJavaUDA"/-->
+ </setting>
+ <setting ref="HomescreenWidget" name="Homescreen widget" type="string" relevant="Type='2'" required="true">
+ <desc>Homescreen widget item for Operator collection</desc>
+ <!-- option map="HomescreenWidgets/Widgets"/>
+ <option map="CIA_PreinstalledWidgetUDA/PreInstalledWidgetUDA" /-->
+ </setting>
+ <setting ref="URL" name="URL" type="selection" relevant="Type='3'" required="true">
+ <option map="CaStorageDbSetting/URLs"/>
+ </setting>
+ <confml:setting ref="ColName" name="Place in collection" type="selection" required="true">
+ <confml:desc>Collection where entry will be added.</confml:desc>
+ <confml:option map="CaStorageDbSetting/Collections"/>
+ </confml:setting>
+ <setting ref="Comments" name="Item comments" type="string">
+ <desc>Intended only for informative purpose for customization.</desc>
+ </setting>
+ </confml:setting>
+ </confml:feature>
+</confml:configuration>
\ No newline at end of file
--- a/contentstorage/castorage/conf/castoragedb.confml Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/castorage/conf/castoragedb.confml Fri Aug 06 13:40:46 2010 +0300
@@ -1,86 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
-<confml:configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:confml="http://www.s60.com/xml/confml/2" xsi:schemaLocation="http://www.s60.com/xml/confml/2 http://www.s60.com/xml/confml/1#//confml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Content storage database settings">
- <confml:feature ref="CaStorageDbSetting" name="Application Library model">
- <confml:setting ref="Collections" mapKey="Name" mapValue="Name" name="Collections" type="sequence">
- <confml:setting ref="Name" name="Name" type="string">
- <confml:desc>Collection name. It is only identifier. Localized name should be used too.</confml:desc>
- </confml:setting>
- <confml:setting ref="ColShortName" name="Collection Short Name" type="string">
- <confml:desc>Collection short name. Optional.</confml:desc>
- </confml:setting>
- <confml:setting ref="ColTitleName" name="Collection Title Name" type="string">
- <confml:desc>Collection title name. Optional.</confml:desc>
- </confml:setting>
- <confml:setting ref="GroupName" name="Collection Group Name" type="string">
- <confml:desc>Group name. Identify collection where application with predefined group name should be added after installation. Should be the same as not localized name.</confml:desc>
- </confml:setting>
- <confml:setting ref="Flags" name="Lock collection and content" type="selection">
- <confml:desc>Lock operator collection and content - user can not delete operator collection, prevent renaming collection and even content. Not possible by user to add new content to locked collection</confml:desc>
- <confml:option name="locked" value='0'/>
- <confml:option name="unlocked" value='4'/>
- </confml:setting>
- <confml:setting ref="LocName" name="Localzied Name" type="string">
- <confml:desc>Localized Collection name. Localized names are taken from contentstorage_*.ts file( for example contentstorage_en_GB.ts ). If text hasn't been found in ts file this one wouldn't be translated. Leave empty field if collection name sholdn't be localized.</confml:desc>
- </confml:setting>
- <confml:setting ref="IconFileName" name="Icon filename" type="string">
- <confml:desc>Collection Icon filename. Optional.</confml:desc>
- </confml:setting>
- <confml:setting ref="IconSkinId" name="Icon skin id" type="string">
- <confml:desc>Collection Icon skin id. Optional.</confml:desc>
- </confml:setting>
- </confml:setting>
- <confml:setting ref="Items" name="Items" type="sequence" >
- <confml:setting ref="Type" name="Entry type" type="selection">
- <confml:desc>Type of entry. Must.</confml:desc>
- <confml:option name="application" value="application"/>
- <confml:option name="url" value="url"/>
- <confml:option name="hs widget" value="widget"/>
- </confml:setting>
- <confml:setting ref="Name" name="Entry name" type="string">
- <confml:desc>Name. In case of applications and homescreen widgets this is only information field( Names are taken from system ).</confml:desc>
- </confml:setting>
- <confml:setting ref="ShortName" name="ShortName" type="string">
- <confml:desc>Item short name. Available for URL. Optional.</confml:desc>
- </confml:setting>
- <confml:setting ref="DestinationUid" name="Uid" type="string" relevant="Type="application"">
- <confml:desc>Application uid. Uid of application in decimal format. Must for application type.</confml:desc>
- <xs:pattern value="^[-+]?[0-9]{9}"/>
- </confml:setting>
- <confml:setting ref="DestinationUrl" name="Url" type="string" relevant="Type="url"">
- <confml:desc>Url. Must for url type.</confml:desc>
- <xs:pattern value="(http(|s)://([\w-]+\.)+[\w-]+(:[0-9]{1,5})?(/[\w- ./?%&=]*)?|)"/>
- </confml:setting>
- <confml:setting ref="DestinationWidgetUri" name="Homescreen widget Uri" type="string" relevant="Type="widget"">
- <confml:desc>HS Widget Uri. Must for hs widget type.</confml:desc>
- </confml:setting>
- <confml:setting ref="IconFileName" name="Icon filename" type="string">
- <confml:desc>Icon filename. Optional.</confml:desc>
- </confml:setting>
- <confml:setting ref="IconSkinId" name="Icon skin Id" type="string">
- <confml:desc>Icon skin id. Optional.</confml:desc>
- </confml:setting>
- <confml:setting ref="Col_Name" name="In collection " type="selection">
- <confml:desc>Collection where entry will be added.</confml:desc>
- <confml:option map="CaStorageDbSetting/Collections"/>
- </confml:setting>
- </confml:setting>
- </confml:feature>
- <confml:data>
- <confml:CaStorageDbSetting>
- <confml:Collections extensionPolicy="replace"><confml:Name>Favorites</confml:Name><confml:GroupName>Favorites</confml:GroupName><confml:ColTitleName>FavoritesT</confml:ColTitleName><confml:Flags>4</confml:Flags><confml:LocName></confml:LocName><confml:IconFileName>qtg_large_applications_user</confml:IconFileName></confml:Collections>
- <confml:Items extensionPolicy="append"><confml:Type>application</confml:Type><confml:Name>calendar</confml:Name><confml:DestinationUid>268458241</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- <confml:Items><confml:Type>application</confml:Type><confml:Name>Camera</confml:Name><confml:DestinationUid>270501242</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- <confml:Items><confml:Type>application</confml:Type><confml:Name>Contacts</confml:Name><confml:DestinationUid>537014009</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- <confml:Items><confml:Type>application</confml:Type><confml:Name>Email</confml:Name><confml:DestinationUid>537023930</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- <confml:Items><confml:Type>application</confml:Type><confml:Name>FM Radio</confml:Name><confml:DestinationUid>270530934</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- <confml:Items><confml:Type>application</confml:Type><confml:Name>Internet</confml:Name><confml:DestinationUid>222242222</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- <confml:Items><confml:Type>application</confml:Type><confml:Name>Maps</confml:Name><confml:DestinationUid>222332222</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- <confml:Items><confml:Type>application</confml:Type><confml:Name>Messaging</confml:Name><confml:DestinationUid>537001593</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- <confml:Items><confml:Type>application</confml:Type><confml:Name>Music</confml:Name><confml:DestinationUid>270564450</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- <confml:Items><confml:Type>application</confml:Type><confml:Name>Photos (camera)</confml:Name><confml:DestinationUid>536913858</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- <confml:Items><confml:Type>application</confml:Type><confml:Name>Settings</confml:Name><confml:DestinationUid>268458220</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- <confml:Items><confml:Type>application</confml:Type><confml:Name>Videos (video camera)</confml:Name><confml:DestinationUid>222111222</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
- </confml:CaStorageDbSetting>
- </confml:data>
+<confml:configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.s60.com/xml/confml/2" xmlns:confml="http://www.s60.com/xml/confml/2" xsi:schemaLocation="http://www.s60.com/xml/confml/2 http://www.s60.com/xml/confml/1#//confml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Content storage database settings">
+ <confml:data>
+ <confml:CaStorageDbSetting>
+
+ <Collections template="true">
+ <LocalizeNames>false</LocalizeNames>
+ <TranslationFile>contentstorage</TranslationFile>
+ <Icon><localPath>dummy</localPath></Icon>
+ </Collections>
+
+ <OperatorCollections template="true">
+ <Icon><localPath>dummy</localPath></Icon>
+ </OperatorCollections>
+
+ <URLs template="true">
+ <URLIcon><localPath>dummy</localPath></URLIcon>
+ </URLs>
+
+ <OperatorURLs template="true">
+ <OperatorURLIcon><localPath>dummy</localPath></OperatorURLIcon>
+ </OperatorURLs>
+
+ <Collections extensionPolicy="append"><LocalizeNames>true</LocalizeNames><TranslationFile>contentstorage</TranslationFile><Name>txt_applib_dblist_essentials</Name>
+ <ShortName/><TitleName>txt_applib_subtitle_essentials</TitleName><GroupName>Favorites</GroupName><Locked>true</Locked>
+ <Icon><localPath>dummy</localPath></Icon><IconSkinId/>
+ </Collections>
+
+ <confml:Items extensionPolicy="append"><confml:Type>1</confml:Type><confml:Application>268458241</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments>Calendar</Comments></confml:Items>
+ <confml:Items><confml:Type>1</confml:Type><confml:Application>270501242</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments>Camera</Comments></confml:Items>
+ <confml:Items><confml:Type>1</confml:Type><confml:Application>537014009</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments>Contacts</Comments></confml:Items>
+ <confml:Items><confml:Type>1</confml:Type><confml:Application>537023930</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments>Email</Comments></confml:Items>
+ <confml:Items><confml:Type>1</confml:Type><confml:Application>270530934</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments>FM Radio</Comments></confml:Items>
+ <confml:Items><confml:Type>1</confml:Type><confml:Application>222242222</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments></Comments></confml:Items>
+ <confml:Items><confml:Type>1</confml:Type><confml:Application>222332222</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments></Comments></confml:Items>
+ <confml:Items><confml:Type>1</confml:Type><confml:Application>537001593</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments>Messaging</Comments></confml:Items>
+ <confml:Items><confml:Type>1</confml:Type><confml:Application>270564450</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments>Music</Comments></confml:Items>
+ <confml:Items><confml:Type>1</confml:Type><confml:Application>536913858</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments>Photos</Comments></confml:Items>
+ <confml:Items><confml:Type>1</confml:Type><confml:Application>268458220</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments>Settings</Comments></confml:Items>
+ <confml:Items><confml:Type>1</confml:Type><confml:Application>222111222</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+ <Comments></Comments></confml:Items>
+ </confml:CaStorageDbSetting>
+ </confml:data>
</confml:configuration>
\ No newline at end of file
--- a/contentstorage/castorage/conf/castoragedb.implml Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/castorage/conf/castoragedb.implml Fri Aug 06 13:40:46 2010 +0300
@@ -40,5 +40,21 @@
</command>
</commandml>
+ <content xmlns="http://www.s60.com/xml/content/2">
+ <output dir="content/private/20022F35/customsvg" flatten="true" >
+ <input>
+ <include files="${CaStorageDbSetting.Collections.Icon.localPath}"/>
+ </input>
+ <input>
+ <include files="${CaStorageDbSetting.URLs.URLIcon.localPath}"/>
+ </input>
+ <input>
+ <include files="${CaStorageDbSetting.OperatorCollections.Icon.localPath}"/>
+ </input>
+ <input>
+ <include files="${CaStorageDbSetting.OperatorURLs.OperatorURLIcon.localPath}"/>
+ </input>
+ </output>
+ </content>
</container>
\ No newline at end of file
--- a/contentstorage/castorage/conf/castoragedb_templates/castoragedb_variant.sql Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/castorage/conf/castoragedb_templates/castoragedb_variant.sql Fri Aug 06 13:40:46 2010 +0300
@@ -1,36 +1,98 @@
SELECT "------------------------------------" AS " ";
SELECT "castoragedb_variant - BEGIN" AS " ";
+{% for col in range(feat_tree.CaStorageDbSetting.OperatorCollections._value|length) -%}
+ {%- set Name = feat_tree.CaStorageDbSetting.OperatorCollections.Name._value[col] or '' -%}
+ {%- set ShortName = feat_tree.CaStorageDbSetting.OperatorCollections.ShortName._value[col] or '' -%}
+ {%- set TitleName = feat_tree.CaStorageDbSetting.OperatorCollections.TitleName._value[col] or '' -%}
+ {%- set GroupName = feat_tree.CaStorageDbSetting.OperatorCollections.GroupName._value[col] or '' -%}
+ {%- set Locked = feat_tree.CaStorageDbSetting.OperatorCollections.Locked._value[col] or false -%}
+ {%- set IconFileName = ( feat_tree.CaStorageDbSetting.OperatorCollections.Icon.localPath._value[col] or '' ) -%}
+ {%- set IconSkinId = feat_tree.CaStorageDbSetting.OperatorCollections.IconSkinId._value[col] or '' -%}
+ {% if IconSkinId == "" and IconFileName != "" and IconFileName != "dummy" -%}
+ {% set IconFileName = "z:\\private\\20022F35\\customsvg\\" + IconFileName %}
+ {% endif %}
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS {% if TitleName -%}, COL_TITLE_NAME{%- endif %} {% if ShortName -%}, COL_SHORT_NAME{%- endif %}, ICON_FILENAME, ICON_SKIN_ID)
+VALUES ( '{{Name}}', '{{GroupName}}', {% if Locked -%} 12 {% else %} 8 {%- endif %} {% if TitleName -%}, "{{TitleName}}"{%- endif %} {% if ShortName -%}, "{{ShortName}}"{%- endif %}, "{{IconFileName}}", "{{IconSkinId}}");
+{% endfor %}
+
+{% for i in range(feat_tree.CaStorageDbSetting.OperatorURLs._value|length) -%}
+ {% set URLTitle = feat_tree.CaStorageDbSetting.OperatorURLs.OperatorURLTitle._value[i] %}
+ {%- set URLShortTitle = feat_tree.CaStorageDbSetting.OperatorURLs.OperatorURLShortTitle._value[i] or '' -%}
+ {%- set URL = feat_tree.CaStorageDbSetting.OperatorURLs.OperatorURL._value[i] or '' -%}
+ {%- set URLIcon = feat_tree.CaStorageDbSetting.OperatorURLs.OperatorURLIcon.localPath._value[i] or '' -%}
+ {%- set IconSkinId = feat_tree.CaStorageDbSetting.OperatorURLs.IconSkinId._value[i] or '' -%}
+ {% if IconSkinId == "" and URLIcon != "" and URLIcon != "dummy" -%}
+ {% set URLIcon = "z:\\private\\20022F35\\customsvg\\" + URLIcon %}
+ {% endif %}
+ INSERT INTO URL ( URL_TITLE {% if URLShortTitle -%}, URL_SHORT_TITLE{%- endif %}, URL_DEST, ICON_FILENAME, ICON_SKIN_ID )
+ VALUES ('{{URLTitle}}' {% if URLShortTitle -%}, "{{URLShortTitle}}"{%- endif %}, "{{URL}}", "{{URLIcon}}", "{{IconSkinId}}" );
+{% endfor %}
+
+{% for index in range(feat_tree.CaStorageDbSetting.OperatorCollectionItems._value|length) -%}
+ {% set Collection = feat_tree.CaStorageDbSetting.OperatorCollections.Name._value[0] %}
+ {%- set Type = feat_tree.CaStorageDbSetting.OperatorCollectionItems.Type._value[index] or '' -%}
+ {%- set Application = feat_tree.CaStorageDbSetting.OperatorCollectionItems.Application._value[index] or '' -%}
+ {%- set OperatorURLTitle = feat_tree.CaStorageDbSetting.OperatorCollectionItems.OperatorURL._value[index] or '' -%}
+ {%- set HomescreenWidget = feat_tree.CaStorageDbSetting.OperatorCollectionItems.HomescreenWidget._value[index] or '' -%}
+{% if Type == "1" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
+ VALUES ("application", '', {{Application}}, '{{Collection}}' );{%- endif %}
+{% if Type == "3" -%}
+ {% for i in range(feat_tree.CaStorageDbSetting.OperatorURLs._value|length) if OperatorURLTitle == feat_tree.CaStorageDbSetting.OperatorURLs.OperatorURLTitle._value[i] -%}
+ INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, COLLECTION_NAME)
+ VALUES ( "url", '{{OperatorURLTitle}}', '{{Collection}}' );
+ {% endfor %}
+{%- endif %}
+{% if Type == "2" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON_FILENAME, ICON_SKIN_ID, URI, COLLECTION_NAME )
+ VALUES ("widget", '', '', '', "{{HomescreenWidget}}", '{{Collection}}' ); {%- endif %}
+{% endfor %}
+
{% for col in range(feat_tree.CaStorageDbSetting.Collections._value|length) -%}
{%- set Name = feat_tree.CaStorageDbSetting.Collections.Name._value[col] or '' -%}
- {%- set ColShortName = feat_tree.CaStorageDbSetting.Collections.ColShortName._value[col] or '' -%}
- {%- set ColTitleName = feat_tree.CaStorageDbSetting.Collections.ColTitleName._value[col] or '' -%}
+ {% set LocalizeNames = feat_tree.CaStorageDbSetting.Collections.LocalizeNames._value[col] or false -%}
+ {%- set ShortName = feat_tree.CaStorageDbSetting.Collections.ShortName._value[col] or '' -%}
+ {%- set TitleName = feat_tree.CaStorageDbSetting.Collections.TitleName._value[col] or '' -%}
{%- set GroupName = feat_tree.CaStorageDbSetting.Collections.GroupName._value[col] or '' -%}
- {%- set Flags = feat_tree.CaStorageDbSetting.Collections.Flags._value[col] or '' -%}
- {%- set LocName = feat_tree.CaStorageDbSetting.Collections.LocName._value[col] or ''-%}
- {%- set IconFileName = feat_tree.CaStorageDbSetting.Collections.IconFileName._value[col] or '' -%}
+ {%- set Locked = feat_tree.CaStorageDbSetting.Collections.Locked._value[col] or false -%}
+ {%- set TranslationFile = feat_tree.CaStorageDbSetting.Collections.TranslationFile._value[col]|string|reverse|replace('_','',1)|reverse+'_' or ''-%}
+ {%- set IconFileName = feat_tree.CaStorageDbSetting.Collections.Icon.localPath._value[col] or '' -%}
{%- set IconSkinId = feat_tree.CaStorageDbSetting.Collections.IconSkinId._value[col] or '' -%}
-INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS {% if ColTitleName -%}, COL_TITLE_NAME{%- endif %}{% if LocName -%}, COL_LOCNAME{%- endif %}{% if ColShortName -%}, COL_SHORT_NAME{%- endif %}{% if IconFileName -%}, ICON_FILENAME{%- endif %}{% if IconSkinId -%}, ICON_SKIN_ID{%- endif %})
-VALUES ( '{{Name}}', '{{GroupName}}', {{Flags}} {% if ColTitleName -%}, "{{ColTitleName}}"{%- endif %}{% if LocName -%}, "{{LocName}}"{%- endif %}{% if ColShortName -%}, "{{ColShortName}}"{%- endif %}{% if IconFileName -%}, "{{IconFileName}}"{%- endif %}{% if IconSkinId -%}, "{{IconSkinId}}"{%- endif %});
+ {% if IconSkinId == "" and IconFileName != "" and IconFileName != "dummy" -%}
+ {% set IconFileName = "z:\\private\\20022F35\\customsvg\\" + IconFileName %}
+ {% endif %}
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS {% if TitleName -%}, COL_TITLE_NAME{%- endif %}{% if LocalizeNames -%}, TRANSLATION_FILE{%- endif %}{% if ShortName -%}, COL_SHORT_NAME{%- endif %}, ICON_FILENAME, ICON_SKIN_ID)
+VALUES ( '{{Name}}', '{{GroupName}}', {% if Locked -%} 12 {% else %} 8 {%- endif %} {% if TitleName -%}, "{{TitleName}}"{%- endif %}{% if LocalizeNames -%}, "{{TranslationFile}}"{%- endif %}{% if ShortName -%}, "{{ShortName}}"{%- endif %}, "{{IconFileName}}", "{{IconSkinId}}");
+{% endfor %}
+{% for i in range(feat_tree.CaStorageDbSetting.URLs._value|length) -%}
+ {% set URLTitle = feat_tree.CaStorageDbSetting.URLs.URLTitle._value[i] %}
+ {%- set URLShortTitle = feat_tree.CaStorageDbSetting.URLs.URLShortTitle._value[i] or '' -%}
+ {%- 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" -%}
+ {% set URLIcon = "z:\\private\\20022F35\\customsvg\\" + URLIcon %}
+ {% endif %}
+ INSERT INTO URL ( URL_TITLE {% if URLShortTitle -%}, URL_SHORT_TITLE{%- endif %}, URL_DEST, ICON_FILENAME, ICON_SKIN_ID )
+ VALUES ( '{{URLTitle}}' {% if URLShortTitle -%}, "{{URLShortTitle}}"{%- endif %}, "{{URL}}", "{{URLIcon}}", "{{IconSkinId}}" );
{% endfor %}
{% for index in range(feat_tree.CaStorageDbSetting.Items._value|length) -%}
{%- set Type = feat_tree.CaStorageDbSetting.Items.Type._value[index] or '' -%}
- {%- set Name = feat_tree.CaStorageDbSetting.Items.Name._value[index] or '' -%}
- {%- set IconFileName = feat_tree.CaStorageDbSetting.Items.IconFileName._value[index] or '' -%}
- {%- set IconSkinId = feat_tree.CaStorageDbSetting.Items.IconSkinId._value[index] or '' -%}
- {%- set ShortName = feat_tree.CaStorageDbSetting.Items.ShortName._value[index] or '' -%}
- {%- set DestinationUid = feat_tree.CaStorageDbSetting.Items.DestinationUid._value[index] or '' -%}
- {%- set DestinationUrl = feat_tree.CaStorageDbSetting.Items.DestinationUrl._value[index] or '' -%}
- {%- set DestinationWidgetUri = feat_tree.CaStorageDbSetting.Items.DestinationWidgetUri._value[index] or '' -%}
- {%- set Collection = feat_tree.CaStorageDbSetting.Items.Col_Name._value[index] or '' -%}
-{% if Type == "application" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("{{Type}}", '{{Name}}', {{DestinationUid}}, '{{Collection}}' );{%- endif %}
-{% if Type == "url" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME {% if ShortName -%}, ITEM_SHORTNAME{%- endif %}, ITEM_DEST, ICON_FILENAME, ICON_SKIN_ID, COLLECTION_NAME)
- VALUES ("{{Type}}", '{{Name}}' {% if ShortName -%}, "{{ShortName}}"{%- endif %}, "{{DestinationUrl}}", "{{IconFileName}}", "{{IconSkinId}}", '{{Collection}}' ); {%- endif %}
-{% if Type == "widget" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON_FILENAME, ICON_SKIN_ID, URI, COLLECTION_NAME )
- VALUES ("{{Type}}", '{{Name}}', "{{IconFileName}}", "{{IconSkinId}}", "{{DestinationWidgetUri}}", '{{Collection}}' ); {%- endif %}
+ {%- set Application = feat_tree.CaStorageDbSetting.Items.Application._value[index] or '' -%}
+ {%- set URLTitle = feat_tree.CaStorageDbSetting.Items.URL._value[index] or '' -%}
+ {%- set HomescreenWidget = feat_tree.CaStorageDbSetting.Items.HomescreenWidget._value[index] or '' -%}
+ {%- set Collection = feat_tree.CaStorageDbSetting.Items.ColName._value[index] or '' -%}
+{% if Type == "1" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
+ VALUES ("application", '', {{Application}}, '{{Collection}}' );{%- endif %}
+{% if Type == "3" -%}
+ {% for i in range(feat_tree.CaStorageDbSetting.URLs._value|length) if URLTitle == feat_tree.CaStorageDbSetting.URLs.URLTitle._value[i] -%}
+ INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, COLLECTION_NAME)
+ VALUES ( "url", '{{URLTitle}}', '{{Collection}}' );
+ {% endfor %}
+{%- endif %}
+{% if Type == "2" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON_FILENAME, ICON_SKIN_ID, URI, COLLECTION_NAME )
+ VALUES ("widget", '{{HomescreenWidget}}', '', '', "{{HomescreenWidget}}", '{{Collection}}' ); {%- endif %}
{% endfor %}
SELECT "castoragedb_variant - END" AS " ";
--- a/contentstorage/castorage/data/castoragedb_create.sql Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/castorage/data/castoragedb_create.sql Fri Aug 06 13:40:46 2010 +0300
@@ -99,6 +99,7 @@
AS SELECT
"" AS "COLLECTION_NAME",
"" AS "COL_LOCNAME",
+ "" AS "TRANSLATION_FILE",
"" AS "COL_SHORT_NAME",
"" AS "COL_TITLE_NAME",
"" AS "COL_APP_GROUP_NAME",
@@ -114,16 +115,21 @@
VALUES ( new.ICON_FILENAME, new.ICON_SKIN_ID);
-- DELETE IF ICON IS NULL OR IF IT IS DUPLICATE
DELETE FROM CA_ICON WHERE ICON_ID = last_insert_rowid() AND
- ( (IC_FILENAME IS NULL AND IC_SKIN_ID IS NULL) OR
- (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND ICON_ID <> last_insert_rowid()) IS NOT NULL OR
- (SELECT ICON_ID FROM CA_ICON WHERE IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
+ ( (IC_FILENAME = "" AND IC_SKIN_ID ="") OR
+ (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
-- INSERT ENTRY
INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_FLAGS, EN_ICON_ID )
- VALUES ( new.COLLECTION_NAME , 2, "collection", new.FLAGS, (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME OR IC_SKIN_ID = new.ICON_SKIN_ID ));
+ VALUES ( new.COLLECTION_NAME , 2, "collection", new.FLAGS, (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND IC_SKIN_ID = new.ICON_SKIN_ID ));
-- LOCALIZATION
INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_QMFILENAME, LT_ROW_ID )
- VALUES ( 'CA_ENTRY', 'EN_TEXT', new.COL_LOCNAME, ( SELECT DB_VALUE FROM CA_DB_PROPERTIES WHERE DB_PROPERTY = "QMfile" ), ( SELECT last_insert_rowid() ) );
- DELETE FROM CA_LOCALIZATION_TEXT WHERE LT_STRING_ID IS NULL AND LOC_TEXT_ID = last_insert_rowid() ;
+ VALUES ( 'CA_ENTRY', 'EN_TEXT', new.COLLECTION_NAME, new.TRANSLATION_FILE, ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ) );
+ DELETE FROM CA_LOCALIZATION_TEXT WHERE LT_QMFILENAME IS NULL AND LOC_TEXT_ID = last_insert_rowid() ;
+ INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_QMFILENAME, LT_ROW_ID )
+ VALUES ( 'CA_ATTRIBUTE', 'short_name', new.COL_SHORT_NAME, new.TRANSLATION_FILE, ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ) );
+ DELETE FROM CA_LOCALIZATION_TEXT WHERE ( LT_QMFILENAME IS NULL OR LT_STRING_ID IS NULL ) AND LOC_TEXT_ID = last_insert_rowid();
+ INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_QMFILENAME, LT_ROW_ID )
+ VALUES ( 'CA_ATTRIBUTE', 'title_name', new.COL_TITLE_NAME, new.TRANSLATION_FILE, ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ) );
+ DELETE FROM CA_LOCALIZATION_TEXT WHERE ( LT_QMFILENAME IS NULL OR LT_STRING_ID IS NULL ) AND LOC_TEXT_ID = last_insert_rowid();
-- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION)
VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "menucollections") ,
@@ -168,21 +174,6 @@
SELECT " CREATE TRIGGER item_to_collection_insert_url" AS " ";
CREATE TRIGGER item_to_collection_insert_url INSTEAD OF INSERT ON ITEM_TO_COLLECTION WHEN new.ITEM_TYPE="url"
BEGIN
- -- INSERT ICON
- INSERT OR IGNORE INTO CA_ICON (IC_FILENAME, IC_SKIN_ID)
- VALUES ( new.ICON_FILENAME, new.ICON_SKIN_ID);
- DELETE FROM CA_ICON WHERE ICON_ID = last_insert_rowid() AND
- ( (IC_FILENAME IS NULL AND IC_SKIN_ID IS NULL) OR
- (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND ICON_ID <> last_insert_rowid()) IS NOT NULL OR
- (SELECT ICON_ID FROM CA_ICON WHERE IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
- -- INSERT ENTRY
- INSERT OR IGNORE INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID )
- VALUES ( new.ITEM_NAME, 1, "url", (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME OR IC_SKIN_ID = new.ICON_SKIN_ID ));
- -- ADD ATTRIBUTES
- INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
- VALUES ( ( SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME ) ,"url",new.ITEM_DEST );
- INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
- VALUES ( ( SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME ) ,"short_name", new.ITEM_SHORTNAME );
-- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION)
VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME) ,
@@ -213,12 +204,11 @@
INSERT OR IGNORE INTO CA_ICON (IC_FILENAME, IC_SKIN_ID)
VALUES ( new.ICON_FILENAME, new.ICON_SKIN_ID);
DELETE FROM CA_ICON WHERE ICON_ID = last_insert_rowid() AND
- ( (IC_FILENAME IS NULL AND IC_SKIN_ID IS NULL) OR
- (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND ICON_ID <> last_insert_rowid()) IS NOT NULL OR
- (SELECT ICON_ID FROM CA_ICON WHERE IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
+ ( (IC_FILENAME = "" AND IC_SKIN_ID = "") OR
+ (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
-- INSERT ENTRY
INSERT OR IGNORE INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID )
- VALUES ( new.ITEM_NAME, 1, "widget", (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME OR IC_SKIN_ID = new.ICON_SKIN_ID ));
+ VALUES ( new.ITEM_NAME, 1, "widget", (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND IC_SKIN_ID = new.ICON_SKIN_ID ));
-- INSERT ATTRIBUTES
INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
VALUES ( ( SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME ) ,"packageuid",new.PACKAGE_UID);
@@ -235,6 +225,39 @@
+-- CREATE VIEW URL
+SELECT "------------------------------------" AS " ";
+SELECT "CREATE VIEW URL" AS " ";
+DROP VIEW IF EXISTS URL;
+CREATE VIEW URL
+ AS SELECT
+ "" AS "URL_TITLE",
+ "" AS "URL_SHORT_TITLE",
+ "" AS "ICON_FILENAME",
+ "" AS "ICON_SKIN_ID",
+ "" AS "URL_DEST";
+
+SELECT " CREATE TRIGGER insert_url" AS " ";
+CREATE TRIGGER insert_url INSTEAD OF INSERT ON URL
+BEGIN
+ -- INSERT ICON
+ INSERT OR IGNORE INTO CA_ICON (IC_FILENAME, IC_SKIN_ID)
+ VALUES ( new.ICON_FILENAME, new.ICON_SKIN_ID);
+ DELETE FROM CA_ICON WHERE ICON_ID = last_insert_rowid() AND
+ ( (IC_FILENAME = "" AND IC_SKIN_ID = "") OR
+ (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
+ -- INSERT ENTRY
+ INSERT OR IGNORE INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID )
+ VALUES ( new.URL_TITLE, 1, "url", (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND IC_SKIN_ID = new.ICON_SKIN_ID ) );
+ -- ADD ATTRIBUTES
+ INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
+ VALUES ( ( SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.URL_TITLE ), "url", new.URL_DEST );
+ INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
+ VALUES ( ( SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.URL_TITLE ) ,"short_name", new.URL_SHORT_TITLE );
+END;
+
+
+
-- insert neccessary items
SELECT "INSERT menucollections ENTRY" AS " ";
INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID )
@@ -245,23 +268,31 @@
SELECT "------------------------------------" AS " ";
SELECT "INSERT Downloaded collection ENTRY" AS " ";
-INSERT INTO CA_ICON (IC_FILENAME)
-VALUES ( "qtg_large_applications_download");
+INSERT INTO CA_ICON (IC_FILENAME, IC_SKIN_ID)
+VALUES ( "qtg_large_applications_download", "" );
INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_FLAGS )
-VALUES ( 'Downloaded', 2, "collection::downloaded", last_insert_rowid() , 8 );
+VALUES ( 'txt_applib_dblist_downloads', 2, "collection::downloaded", ( SELECT MAX(ICON_ID) FROM CA_ICON ) , 8 );
+
+INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
+VALUES ( ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ), "appgroup_name", "Downloaded" );
INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
-VALUES ( last_insert_rowid(), "appgroup_name", " Downloaded" );
+VALUES ( ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ), "title_name", "txt_applib_subtitle_downloads" );
INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_QMFILENAME, LT_ROW_ID )
-VALUES ( 'CA_ENTRY', 'EN_TEXT', "txt_applib_dblist_downloaded",( SELECT DB_VALUE FROM CA_DB_PROPERTIES WHERE DB_PROPERTY = "QMfile" ), ( SELECT last_insert_rowid() ) );
+VALUES ( 'CA_ENTRY', 'EN_TEXT', "txt_applib_dblist_downloads",( SELECT DB_VALUE FROM CA_DB_PROPERTIES WHERE DB_PROPERTY = "QMfile" ), ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ) );
+
+INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_QMFILENAME, LT_ROW_ID )
+VALUES ( 'CA_ATTRIBUTE', 'title_name', "txt_applib_subtitle_downloads",( SELECT DB_VALUE FROM CA_DB_PROPERTIES WHERE DB_PROPERTY = "QMfile" ), ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ) );
INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION)
VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "menucollections") ,
(SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "collection::downloaded"),
1 );
+
+
SELECT "------------------------------------" AS " ";
SELECT "castoragedb_create - END" AS " ";
SELECT "------------------------------------" AS " ";
--- a/contentstorage/castorage/data/castoragedb_variant.sql Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-SELECT "------------------------------------" AS " ";
-SELECT "castoragedb_variant - BEGIN" AS " ";
-
-
--- insert additional items
-
-INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, ICON_FILENAME, FLAGS) VALUES ( 'Favorites', 'Favorites', "qtg_large_applications_user", 4 );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'calendar', 268458241, 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'Camera', 270501242, 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'Contacts', 537014009, 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'Email', 537023930, 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'FM Radio', 270530934, 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'Internet', 222222222, 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'Maps', 222222223, 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'Messaging', 537001593, 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'Music', 270564450, 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'Photos (camera)', 536913858, 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'Settings', 268458220, 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
- VALUES ("application", 'Videos (video camera)', 222222224, 'Favorites' );
-
-
-SELECT "castoragedb_variant - END" AS " ";
-SELECT "------------------------------------" AS " ";
-
--- a/contentstorage/castorage/inc/caconsts.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/castorage/inc/caconsts.h Fri Aug 06 13:40:46 2010 +0300
@@ -19,6 +19,7 @@
#define CACONSTS_H_
_LIT( KDbName, "castorage.db" );
+_LIT( KDbNameBackup, "castorage.backup" );
_LIT( KCDrive, "c:" );
_LIT( KZDrive, "z:" );
_LIT( KDoubleSlash, "\\" );
--- a/contentstorage/castorage/inc/casqlcommands.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/castorage/inc/casqlcommands.h Fri Aug 06 13:40:46 2010 +0300
@@ -74,6 +74,10 @@
EN_TEXT = :LT_STRING WHERE ENTRY_ID = :LT_ROW_ID"); // WHERE ENTRY_ID must be changed if an attribute
_LIT( KSQLLocalizeDescriptionEntry, "UPDATE CA_ENTRY SET \
EN_DESCRIPTION = :LT_STRING WHERE ENTRY_ID = :LT_ROW_ID"); // WHERE ENTRY_ID must be changed if an attribute
+_LIT( KSQLLocalizeShortNameAttribute, "UPDATE CA_ATTRIBUTE SET \
+AT_VALUE = :LT_STRING WHERE AT_ENTRY_ID = :LT_ROW_ID AND AT_NAME = \"short_name\"");
+_LIT( KSQLLocalizeTitleNameAttribute, "UPDATE CA_ATTRIBUTE SET \
+AT_VALUE = :LT_STRING WHERE AT_ENTRY_ID = :LT_ROW_ID AND AT_NAME = \"title_name\"");
_LIT( KSQLUpdatePositionInGroup, "UPDATE CA_GROUP_ENTRY SET \
GE_POSITION = :GE_POSITION WHERE \
@@ -346,6 +350,9 @@
_LIT( KColumnEnUid, "EN_UID" );
_LIT( KColumnEnFlags, "EN_FLAGS" );
+_LIT( KShortName, "short_name");
+_LIT( KTitleName, "title_name");
+
_LIT( KColumnGroupEntryId, "GROUP_ENTRY_ID" );
_LIT( KColumnGEIdGroup, "GE_GROUP_ID" );
_LIT( KColumnGEPosition, "GE_POSITION" );
--- a/contentstorage/castorage/inc/casqlitestorage.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/castorage/inc/casqlitestorage.h Fri Aug 06 13:40:46 2010 +0300
@@ -66,6 +66,18 @@
* Loads data base from rom.
*/
void LoadDataBaseFromRomL();
+
+ //from CCpStorage
+ /**
+ * Saves a copy of database to private.
+ */
+ void SaveDatabaseL();
+
+ //from CCpStorage
+ /**
+ * Restores a copy of database from backup to private.
+ */
+ void RestoreDatabaseL();
/**
* Localizes one entry attribute.
@@ -161,8 +173,9 @@
/**
* Add ifno launch to db.
* @param aEntryId.
+ * @param aRemovable.
*/
- void TouchL( const TInt aEntryId );
+ void TouchL( const TInt aEntryId, TBool aRemovable );
/**
* Get database property from db.
@@ -224,7 +237,7 @@
void ExecuteOrganizeL( const RArray<TInt>& aEntryIds,
TCaOperationParams aParams );
- void ExecuteTouchL( const TInt aEntryId );
+ void ExecuteTouchL( const TInt aEntryId, TBool aRemovable );
void ExecuteDbPropertyL( const TDesC& aProperty, TDes& aPropertyValue );
@@ -270,6 +283,11 @@
* Private path on C-drive.
*/
TFileName iPrivatePathCDrive;
+
+ /**
+ * Private path on C-drive for backup db.
+ */
+ TFileName iPrivatePathCDriveDbBackup;
/**
* RFs session.
--- a/contentstorage/castorage/inc/casqlquerycreator.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/castorage/inc/casqlquerycreator.h Fri Aug 06 13:40:46 2010 +0300
@@ -107,11 +107,13 @@
*
* @param aSqlQuery The list of result queries needed for the touch
* operation.
- * @param aSqlDb The handle to the database needed for the created
+ * @param aSqlDb The handle to the database needed for the created.
+ * @param aRemovable to create query to change used flag only for
+ * removable entries.
* queries' member (RSqlStatement iStatement).
*/
static void CreateTouchQueryL( RPointerArray<CCaSqlQuery>& aSqlQuery,
- RSqlDatabase& aSqlDb );
+ RSqlDatabase& aSqlDb, TBool aRemovable );
/**
* Creates an sql query to organize data within a group.
--- a/contentstorage/castorage/inc/castorage.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/castorage/inc/castorage.h Fri Aug 06 13:40:46 2010 +0300
@@ -113,8 +113,9 @@
* Stores touch data information in storage.
*
* @param aEntryId The entry id for which touch data should be stored.
+ * @param aRemovable if entry is removable then flag is set if necessary.
*/
- virtual void TouchL( const TInt aEntryId ) = 0;
+ virtual void TouchL( const TInt aEntryId, TBool aRemovable ) = 0;
/**
* Get database property from db.
@@ -148,6 +149,17 @@
virtual void CustomSortL( const RArray<TInt>& aEntryIds,
const TInt aGroupId ) = 0;
+
+ /**
+ * Saves a copy of database to private.
+ */
+ virtual void RestoreDatabaseL() = 0;
+
+ /**
+ * Saves a copy of database to private.
+ */
+ virtual void SaveDatabaseL() = 0;
+
/**
* Loads data base from rom.
*/
--- a/contentstorage/castorage/src/casqlitestorage.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/castorage/src/casqlitestorage.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -53,6 +53,9 @@
User::LeaveIfError( CreatePrivateDirPath( iPrivatePathCDrive, KCDrive,
KNullDesC ) );
+ User::LeaveIfError( CreatePrivateDirPath( iPrivatePathCDriveDbBackup, KCDrive,
+ KDbNameBackup ) );
+
if( iSqlDb.Open( iPrivatePathCDriveDb, &KSqlDbConfig ) )
{
@@ -108,6 +111,40 @@
}
// ---------------------------------------------------------------------------
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CCaSqLiteStorage::SaveDatabaseL()
+ {
+ if( ( BaflUtils::FileExists( iRfs, iPrivatePathCDriveDb ) ) )
+ {
+ iSqlDb.Close();
+ User::LeaveIfError( BaflUtils::CopyFile( iRfs,
+ iPrivatePathCDriveDb, iPrivatePathCDriveDbBackup ) );
+ User::LeaveIfError( iSqlDb.Open( iPrivatePathCDriveDb,
+ &KSqlDbConfig ) );
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CCaSqLiteStorage::RestoreDatabaseL()
+ {
+ if( ( BaflUtils::FileExists( iRfs, iPrivatePathCDriveDbBackup ) ) )
+ {
+ iSqlDb.Close();
+ User::LeaveIfError( BaflUtils::CopyFile( iRfs,
+ iPrivatePathCDriveDbBackup, iPrivatePathCDriveDb ) );
+ User::LeaveIfError( iSqlDb.Open( iPrivatePathCDriveDb,
+ &KSqlDbConfig ) );
+ }
+ }
+
+// ---------------------------------------------------------------------------
// CCASqLiteStorage::NewL()
//
// ---------------------------------------------------------------------------
@@ -214,7 +251,7 @@
void CCaSqLiteStorage::LocalizeEntryL( CCaLocalizationEntry& aLocalization )
{
CCaSqlQuery* sqlLocalizeEntryQuery = CCaSqlQuery::NewLC( iSqlDb );
- if( aLocalization.GetAttributeName().Compare( KColumnEnText ) == 0 )
+ if ( aLocalization.GetAttributeName().Compare( KColumnEnText ) == 0 )
{
CaSqlQueryCreator::CreateLocalizationTableQueryL( sqlLocalizeEntryQuery,
KSQLLocalizeTextEntry );
@@ -225,6 +262,16 @@
CaSqlQueryCreator::CreateLocalizationTableQueryL( sqlLocalizeEntryQuery,
KSQLLocalizeDescriptionEntry );
}
+ else if ( aLocalization.GetAttributeName().Compare( KShortName ) == 0 )
+ {
+ CaSqlQueryCreator::CreateLocalizationTableQueryL( sqlLocalizeEntryQuery,
+ KSQLLocalizeShortNameAttribute );
+ }
+ else if ( aLocalization.GetAttributeName().Compare( KTitleName ) == 0 )
+ {
+ CaSqlQueryCreator::CreateLocalizationTableQueryL( sqlLocalizeEntryQuery,
+ KSQLLocalizeTitleNameAttribute );
+ }
sqlLocalizeEntryQuery->PrepareL();
sqlLocalizeEntryQuery->BindValuesForLocalizeL( aLocalization );
sqlLocalizeEntryQuery->ExecuteL( );
@@ -410,10 +457,10 @@
//
// ---------------------------------------------------------------------------
//
-void CCaSqLiteStorage::TouchL( const TInt aEntryId )
+void CCaSqLiteStorage::TouchL( const TInt aEntryId, TBool aRemovable )
{
ExecuteStatementL( KSqlStatementBegin );
- TRAPD( err, ExecuteTouchL( aEntryId ) );
+ TRAPD( err, ExecuteTouchL( aEntryId, aRemovable ) );
if( err )
{
ExecuteStatementL( KSqlStatementRollback );
@@ -483,14 +530,43 @@
void CCaSqLiteStorage::CustomSortL( const RArray<TInt>& aEntryIds,
const TInt aGroupId )
{
+ RArray<TInt> entryIds;
+ CleanupClosePushL( entryIds );
+ for( TInt j=0; j<aEntryIds.Count(); j++ )
+ {
+ entryIds.AppendL(aEntryIds[j]);
+ }
+
+ RArray<TInt> oldIds;
+ CleanupClosePushL( oldIds );
+ CCaInnerQuery* innerQuery = CCaInnerQuery::NewLC();
+ innerQuery->SetParentId( aGroupId );
+
+ GetEntriesIdsL( innerQuery, oldIds );
+
+ if( oldIds.Count() != entryIds.Count() )
+ {
+ for( TInt i=0; i<oldIds.Count(); i++ )
+ {
+ TInt oldId = oldIds[i];
+ if( entryIds.Find( oldId ) == KErrNotFound )
+ {
+ // instert apps with visible set on false on old positions
+ entryIds.InsertL( oldId, i );
+ }
+ }
+ }
+
+ const RArray<TInt> constEntryIds( entryIds );
+
RPointerArray<CCaSqlQuery> sqlQueries;
- CleanupResetAndDestroyPushL( sqlQueries );
+ CleanupResetAndDestroyPushL( sqlQueries );
CaSqlQueryCreator::CreateCustomSortQueryL(
- aEntryIds, sqlQueries, iSqlDb );
+ constEntryIds, sqlQueries, iSqlDb );
ExecuteStatementL( KSqlStatementBegin );
- TRAPD( err, ExecuteCustomSortL( aEntryIds, aGroupId, sqlQueries ) );
+ TRAPD( err, ExecuteCustomSortL( constEntryIds, aGroupId, sqlQueries ) );
if( err )
{
ExecuteStatementL( KSqlStatementRollback );
@@ -499,6 +575,9 @@
ExecuteStatementL( KSqlStatementCommit );
CleanupStack::PopAndDestroy( &sqlQueries );
+ CleanupStack::PopAndDestroy( innerQuery );
+ CleanupStack::PopAndDestroy( &oldIds );
+ CleanupStack::PopAndDestroy( &entryIds );
}
// ---------------------------------------------------------------------------
@@ -748,12 +827,12 @@
//
// ---------------------------------------------------------------------------
//
-void CCaSqLiteStorage::ExecuteTouchL( const TInt aEntryId )
+void CCaSqLiteStorage::ExecuteTouchL( const TInt aEntryId, TBool aRemovable )
{
RPointerArray<CCaSqlQuery> sqlQuery;
CleanupResetAndDestroyPushL( sqlQuery );
- CaSqlQueryCreator::CreateTouchQueryL( sqlQuery, iSqlDb );
+ CaSqlQueryCreator::CreateTouchQueryL( sqlQuery, iSqlDb, aRemovable );
TTime time;
time.UniversalTime();
--- a/contentstorage/castorage/src/casqlquerycreator.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/castorage/src/casqlquerycreator.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -555,7 +555,8 @@
// ---------------------------------------------------------------------------
//
void CaSqlQueryCreator::CreateTouchQueryL(
- RPointerArray<CCaSqlQuery>& aSqlQuery, RSqlDatabase& aSqlDb )
+ RPointerArray<CCaSqlQuery>& aSqlQuery, RSqlDatabase& aSqlDb,
+ TBool aRemovable )
{
DEBUG(("_CA_:CASqlQueryCreator::CreateTouchQueryL"));
@@ -563,11 +564,13 @@
query->SetQueryL( KSQLInsertToLaunch );
aSqlQuery.Append( query );
CleanupStack::Pop( query );
-
- query = CCaSqlQuery::NewLC( aSqlDb );
- query->SetQueryL( KSQLUpdateEntryUsedFlag );
- aSqlQuery.Append( query );
- CleanupStack::Pop( query );
+ if( aRemovable )
+ {
+ query = CCaSqlQuery::NewLC( aSqlDb );
+ query->SetQueryL( KSQLUpdateEntryUsedFlag );
+ aSqlQuery.Append( query );
+ CleanupStack::Pop( query );
+ }
}
// ---------------------------------------------------------------------------
--- a/contentstorage/cautils/inc/caentryattribute.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/cautils/inc/caentryattribute.h Fri Aug 06 13:40:46 2010 +0300
@@ -129,7 +129,7 @@
* @param aAttr Attribute value.
* @return TBool ,ETrue if attribute was found
*/
- IMPORT_C TBool Find( const TDesC& aName, TDes& aAttrVal );
+ IMPORT_C TBool Find( const TDesC& aName, TDes& aAttrVal ) const;
/**
* Find attribute by name.
@@ -138,7 +138,7 @@
* @param aAttr Attribute value.
* @return TBool, ETrue if attribute was found
*/
- IMPORT_C TBool Find( const TDesC& aName, TPtrC& aAttrVal );
+ IMPORT_C TBool Find( const TDesC& aName, TPtrC& aAttrVal ) const;
/*
* Check if attribute exists
@@ -146,7 +146,7 @@
* @param aName Name
* @return ETrue if attribute exists
*/
- IMPORT_C TBool Exist( const TDesC& aName );
+ IMPORT_C TBool Exist( const TDesC& aName ) const;
/**
* Remove attribute
--- a/contentstorage/cautils/src/caentryattribute.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/cautils/src/caentryattribute.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -116,7 +116,7 @@
// RMenuSrvAttrArray::Find
// ---------------------------------------------------------
//
-EXPORT_C TBool RCaEntryAttrArray::Find( const TDesC& aName, TDes& aAttrVal )
+EXPORT_C TBool RCaEntryAttrArray::Find( const TDesC& aName, TDes& aAttrVal ) const
{
for( TInt i = 0; i < Count(); i++ )
{
@@ -133,7 +133,7 @@
// RMenuSrvAttrArray::Find
// ---------------------------------------------------------
//
-EXPORT_C TBool RCaEntryAttrArray::Find( const TDesC& aName, TPtrC& aAttrVal )
+EXPORT_C TBool RCaEntryAttrArray::Find( const TDesC& aName, TPtrC& aAttrVal ) const
{
for( TInt i = 0; i < Count(); i++ )
{
@@ -150,7 +150,7 @@
// RCaEntryAttrArray::Exist
// ---------------------------------------------------------
//
-EXPORT_C TBool RCaEntryAttrArray::Exist( const TDesC& aName )
+EXPORT_C TBool RCaEntryAttrArray::Exist( const TDesC& aName ) const
{
for( TInt i = 0; i < Count(); i++ )
{
--- a/contentstorage/data/backup_registration.xml Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/data/backup_registration.xml Fri Aug 06 13:40:46 2010 +0300
@@ -1,7 +1,7 @@
<?xml version="1.0" standalone="yes"?>
<backup_registration>
<passive_backup>
- <include_directory name = ""/>
- </passive_backup>
+ <include_file name="castorage.backup"/>
+ </passive_backup>
<restore requires_reboot = "yes"/>
-</backup_registration>
+</backup_registration>
\ No newline at end of file
--- a/contentstorage/eabi/camenuu.def Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/eabi/camenuu.def Fri Aug 06 13:40:46 2010 +0300
@@ -25,4 +25,6 @@
_ZTV15CCaStorageProxy @ 24 NONAME
_ZN16CCaSrvMmcHistory4NewLEv @ 25 NONAME
_ZN15CCaStorageProxy16AddLocalizationLERK20CCaLocalizationEntry @ 26 NONAME
+ _ZN15CCaStorageProxy13SaveDatabaseLEv @ 27 NONAME
+ _ZN15CCaStorageProxy16RestoreDatabaseLEv @ 28 NONAME
--- a/contentstorage/eabi/cautilsu.def Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/eabi/cautilsu.def Fri Aug 06 13:40:46 2010 +0300
@@ -16,89 +16,89 @@
_ZN13CCaInnerEntry8SetFlagsEj @ 15 NONAME
_ZN13CCaInnerEntry8SetTextLERK7TDesC16i @ 16 NONAME
_ZN13CCaInnerEntry9SetIconIdEi @ 17 NONAME
- _ZN13CCaInnerQuery10SetFlagsOnEj @ 18 NONAME
- _ZN13CCaInnerQuery11SetFlagsOffEj @ 19 NONAME
- _ZN13CCaInnerQuery11SetParentIdEi @ 20 NONAME
- _ZN13CCaInnerQuery12InternalizeLER11RReadStream @ 21 NONAME
- _ZN13CCaInnerQuery13AddAttributeLERK7TDesC16S2_ @ 22 NONAME
- _ZN13CCaInnerQuery17SetEntryTypeNamesEP16CDesC16ArrayFlat @ 23 NONAME
- _ZN13CCaInnerQuery4NewLEv @ 24 NONAME
- _ZN13CCaInnerQuery5NewLCEv @ 25 NONAME
- _ZN13CCaInnerQuery6SetUidEj @ 26 NONAME
- _ZN13CCaInnerQuery7SetIdsLERK6RArrayIiE @ 27 NONAME
- _ZN13CCaInnerQuery7SetRoleEi @ 28 NONAME
- _ZN13CCaInnerQuery7SetSortENS_14TSortAttributeE @ 29 NONAME
- _ZN13CCaInnerQuery8SetCountEj @ 30 NONAME
- _ZN15RCaEntriesArray12InternalizeLER11RReadStream @ 31 NONAME
- _ZN17CCaEntryAttribute4NewLERK7TDesC16 @ 32 NONAME
- _ZN17CCaEntryAttribute5NewLCERK7TDesC16 @ 33 NONAME
- _ZN17CCaEntryAttribute9SetValueLERK7TDesC16 @ 34 NONAME
- _ZN17RCaEntryAttrArray15RemoveAttributeERK7TDesC16 @ 35 NONAME
- _ZN17RCaEntryAttrArray4FindERK7TDesC16R6TDes16 @ 36 NONAME
- _ZN17RCaEntryAttrArray4FindERK7TDesC16R7TPtrC16 @ 37 NONAME
- _ZN17RCaEntryAttrArray5ExistERK7TDesC16 @ 38 NONAME
- _ZN20CCaLocalizationEntry12SetStringIdLERK7TDesC16 @ 39 NONAME
- _ZN20CCaLocalizationEntry13SetTableNameLERK7TDesC16 @ 40 NONAME
- _ZN20CCaLocalizationEntry14SetQmFilenameLERK7TDesC16 @ 41 NONAME
- _ZN20CCaLocalizationEntry17SetAttributeNameLERK7TDesC16 @ 42 NONAME
- _ZN20CCaLocalizationEntry19SetLocalizedStringLERK7TDesC16 @ 43 NONAME
- _ZN20CCaLocalizationEntry4NewLEv @ 44 NONAME
- _ZN20CCaLocalizationEntry5NewLCEv @ 45 NONAME
- _ZN20CCaLocalizationEntry8SetRowIdEj @ 46 NONAME
- _ZN20CCaLocalizationEntry9SetTextIdEj @ 47 NONAME
- _ZN22CCaInnerNotifierFilter11SetParentIdEi @ 48 NONAME
- _ZN22CCaInnerNotifierFilter12InternalizeLER11RReadStream @ 49 NONAME
- _ZN22CCaInnerNotifierFilter12SetEntryRoleE10TEntryRole @ 50 NONAME
- _ZN22CCaInnerNotifierFilter12SetTypeNamesEP16CDesC16ArrayFlat @ 51 NONAME
- _ZN22CCaInnerNotifierFilter4NewLENS_13TNotifierTypeE @ 52 NONAME
- _ZN22CCaInnerNotifierFilter5NewLCENS_13TNotifierTypeE @ 53 NONAME
- _ZN22CCaInnerNotifierFilter7SetIdsLERK6RArrayIiE @ 54 NONAME
- _ZN23CCaInnerIconDescription10SetSkinIdLERK7TDesC16 @ 55 NONAME
- _ZN23CCaInnerIconDescription12SetFileNameLERK7TDesC16 @ 56 NONAME
- _ZN23CCaInnerIconDescription17SetApplicationIdLERK7TDesC16 @ 57 NONAME
- _ZN23CCaInnerIconDescription4NewLEv @ 58 NONAME
- _ZN23CCaInnerIconDescription5NewLCEv @ 59 NONAME
- _ZN23CCaInnerIconDescription5SetIdEi @ 60 NONAME
- _ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 61 NONAME
- _ZNK11RCaIdsArray12ExternalizeLER12RWriteStream @ 62 NONAME
- _ZNK11RCaIdsArray13MarshalDataLCEv @ 63 NONAME
- _ZNK13CCaInnerEntry11isLocalizedENS_14TLocalizedTypeE @ 64 NONAME
- _ZNK13CCaInnerEntry12ExternalizeLER12RWriteStream @ 65 NONAME
- _ZNK13CCaInnerEntry13GetAttributesEv @ 66 NONAME
- _ZNK13CCaInnerEntry14GetDescriptionEv @ 67 NONAME
- _ZNK13CCaInnerEntry16GetEntryTypeNameEv @ 68 NONAME
- _ZNK13CCaInnerEntry4IconEv @ 69 NONAME
- _ZNK13CCaInnerEntry5GetIdEv @ 70 NONAME
- _ZNK13CCaInnerEntry6GetUidEv @ 71 NONAME
- _ZNK13CCaInnerEntry7GetRoleEv @ 72 NONAME
- _ZNK13CCaInnerEntry7GetTextEv @ 73 NONAME
- _ZNK13CCaInnerEntry8GetFlagsEv @ 74 NONAME
- _ZNK13CCaInnerEntry9GetIconIdEv @ 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
- _ZNK20CCaLocalizationEntry11GetStringIdEv @ 88 NONAME
- _ZNK20CCaLocalizationEntry12GetTableNameEv @ 89 NONAME
- _ZNK20CCaLocalizationEntry13GetQmFilenameEv @ 90 NONAME
- _ZNK20CCaLocalizationEntry16GetAttributeNameEv @ 91 NONAME
- _ZNK20CCaLocalizationEntry18GetLocalizedStringEv @ 92 NONAME
- _ZNK20CCaLocalizationEntry8GetRowIdEv @ 93 NONAME
- _ZNK20CCaLocalizationEntry9GetTextIdEv @ 94 NONAME
- _ZNK22CCaInnerNotifierFilter11GetParentIdEv @ 95 NONAME
- _ZNK22CCaInnerNotifierFilter12ExternalizeLER12RWriteStream @ 96 NONAME
- _ZNK22CCaInnerNotifierFilter12GetEntryRoleEv @ 97 NONAME
- _ZNK22CCaInnerNotifierFilter12GetTypeNamesEv @ 98 NONAME
- _ZNK22CCaInnerNotifierFilter15GetNotifierTypeEv @ 99 NONAME
- _ZNK22CCaInnerNotifierFilter6GetIdsEv @ 100 NONAME
- _ZN13CCaInnerQuery10SetChildIdEi @ 101 NONAME
- _ZNK13CCaInnerQuery10GetChildIdEv @ 102 NONAME
+ _ZN13CCaInnerQuery10SetChildIdEi @ 18 NONAME
+ _ZN13CCaInnerQuery10SetFlagsOnEj @ 19 NONAME
+ _ZN13CCaInnerQuery11SetFlagsOffEj @ 20 NONAME
+ _ZN13CCaInnerQuery11SetParentIdEi @ 21 NONAME
+ _ZN13CCaInnerQuery12InternalizeLER11RReadStream @ 22 NONAME
+ _ZN13CCaInnerQuery13AddAttributeLERK7TDesC16S2_ @ 23 NONAME
+ _ZN13CCaInnerQuery17SetEntryTypeNamesEP16CDesC16ArrayFlat @ 24 NONAME
+ _ZN13CCaInnerQuery4NewLEv @ 25 NONAME
+ _ZN13CCaInnerQuery5NewLCEv @ 26 NONAME
+ _ZN13CCaInnerQuery6SetUidEj @ 27 NONAME
+ _ZN13CCaInnerQuery7SetIdsLERK6RArrayIiE @ 28 NONAME
+ _ZN13CCaInnerQuery7SetRoleEi @ 29 NONAME
+ _ZN13CCaInnerQuery7SetSortENS_14TSortAttributeE @ 30 NONAME
+ _ZN13CCaInnerQuery8SetCountEj @ 31 NONAME
+ _ZN15RCaEntriesArray12InternalizeLER11RReadStream @ 32 NONAME
+ _ZN17CCaEntryAttribute4NewLERK7TDesC16 @ 33 NONAME
+ _ZN17CCaEntryAttribute5NewLCERK7TDesC16 @ 34 NONAME
+ _ZN17CCaEntryAttribute9SetValueLERK7TDesC16 @ 35 NONAME
+ _ZN17RCaEntryAttrArray15RemoveAttributeERK7TDesC16 @ 36 NONAME
+ _ZN20CCaLocalizationEntry12SetStringIdLERK7TDesC16 @ 37 NONAME
+ _ZN20CCaLocalizationEntry13SetTableNameLERK7TDesC16 @ 38 NONAME
+ _ZN20CCaLocalizationEntry14SetQmFilenameLERK7TDesC16 @ 39 NONAME
+ _ZN20CCaLocalizationEntry17SetAttributeNameLERK7TDesC16 @ 40 NONAME
+ _ZN20CCaLocalizationEntry19SetLocalizedStringLERK7TDesC16 @ 41 NONAME
+ _ZN20CCaLocalizationEntry4NewLEv @ 42 NONAME
+ _ZN20CCaLocalizationEntry5NewLCEv @ 43 NONAME
+ _ZN20CCaLocalizationEntry8SetRowIdEj @ 44 NONAME
+ _ZN20CCaLocalizationEntry9SetTextIdEj @ 45 NONAME
+ _ZN22CCaInnerNotifierFilter11SetParentIdEi @ 46 NONAME
+ _ZN22CCaInnerNotifierFilter12InternalizeLER11RReadStream @ 47 NONAME
+ _ZN22CCaInnerNotifierFilter12SetEntryRoleE10TEntryRole @ 48 NONAME
+ _ZN22CCaInnerNotifierFilter12SetTypeNamesEP16CDesC16ArrayFlat @ 49 NONAME
+ _ZN22CCaInnerNotifierFilter4NewLENS_13TNotifierTypeE @ 50 NONAME
+ _ZN22CCaInnerNotifierFilter5NewLCENS_13TNotifierTypeE @ 51 NONAME
+ _ZN22CCaInnerNotifierFilter7SetIdsLERK6RArrayIiE @ 52 NONAME
+ _ZN23CCaInnerIconDescription10SetSkinIdLERK7TDesC16 @ 53 NONAME
+ _ZN23CCaInnerIconDescription12SetFileNameLERK7TDesC16 @ 54 NONAME
+ _ZN23CCaInnerIconDescription17SetApplicationIdLERK7TDesC16 @ 55 NONAME
+ _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
--- a/contentstorage/group/camenu.mmp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/group/camenu.mmp Fri Aug 06 13:40:46 2010 +0300
@@ -12,7 +12,7 @@
* Contributors:
*
* Description:
-* Version : %version: 19.1.10 % << Don't touch! Updated by Synergy at check-out.
+* Version : %version: 19.1.11 % << Don't touch! Updated by Synergy at check-out.
*
*/
@@ -39,6 +39,7 @@
SOURCE casrvengutils.cpp
SOURCE casrvnotifier.cpp
SOURCE castorageproxy.cpp
+SOURCE cabackupnotifier.cpp
USERINCLUDE ../srvinc
--- a/contentstorage/group/group.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/group/group.pro Fri Aug 06 13:40:46 2010 +0300
@@ -19,6 +19,7 @@
#Exporting ibys
BLD_INF_RULES.prj_exports += \
"../castorage/conf/castoragedb.confml APP_LAYER_CONFML(castoragedb.confml)" \
+ "../castorage/conf/CI_castoragedb.confml APP_LAYER_CONFML(CI_castoragedb.confml)" \
"../castorage/conf/castoragedb.implml APP_LAYER_CRML(castoragedb.implml)" \
"../castorage/data/castoragedb_create.sql APP_LAYER_CRML(castoragedb_templates/castoragedb_create.sql)" \
"../castorage/conf/castoragedb_templates/castoragedb_variant.sql APP_LAYER_CRML(castoragedb_templates/castoragedb_variant.sql)" \
@@ -40,7 +41,6 @@
"../casrv/cawidgetscanner/group/cawidgetscanner.mmp" \
"../casrv/carunningappmonitor/group/carunningappmonitor.mmp" \
"../casrv/causifscanner/group/causifscanner.mmp" \
- "../casrv/caprogresscanner/group/caprogresscanner.mmp" \
tests_krakow {
BLD_INF_RULES.prj_mmpfiles += \
--- a/contentstorage/inc/cadef.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/inc/cadef.h Fri Aug 06 13:40:46 2010 +0300
@@ -12,7 +12,7 @@
* Contributors:
*
* Description: Definition of different constants
- * Version : %version: 10.1.25 % << Don't touch! Updated by Synergy at check-out.
+ * Version : %version: 10.1.26 % << Don't touch! Updated by Synergy at check-out.
*
*/
@@ -48,7 +48,7 @@
//Entry flags
enum TEntryFlag
{
- EUsed = 1,
+ EUsed = 1,//Flag is set only for removable applications
EUninstall = 2,
ERemovable = 4,
EVisible = 8,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/srvinc/cabackupnotifier.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,109 @@
+/*
+ * 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 CABACKUPNOTIFIER_H
+#define CABACKUPNOTIFIER_H
+
+#include <e32property.h>
+
+class CCaStorageProxy;
+
+/**
+ * CA Backup notifier.
+ *
+ * @since S60 v5.0
+ */
+
+
+NONSHARABLE_CLASS( CCaBackupNotifier ) : public CActive
+ {
+
+enum TCaBackupState
+ /**
+ The backup / restore state of a device.
+
+ @released
+ @publishedAll
+ */
+ {
+ ECaBackup = 1,
+ ECaRestore = 2
+ };
+
+public:
+
+ /**
+ * Creates an instance of CCaBackupNotifier.
+ * @param aNotifier Reference to notifier interface.
+ * @param aNotificationType Notification type.
+ */
+static CCaBackupNotifier* NewL( CCaStorageProxy* aStorageProxy );
+
+ /**
+ * Destructor.
+ */
+ virtual ~CCaBackupNotifier();
+
+private:
+
+ /**
+ * Symbian 2nd phase constructor.
+ * @param aNotificationType Notification type.
+ */
+ void ConstructL( );
+
+ /**
+ * From CActive.
+ */
+ void DoCancel();
+
+ /**
+ * From CActive.
+ */
+ void RunL();
+
+ /**
+ * From CActive.
+ */
+ TInt RunError( TInt aError );
+
+private:
+
+ CCaBackupNotifier( CCaStorageProxy* aStorageProxy );
+
+ /**
+ * RProperty.
+ * Own.
+ */
+ RProperty iProperty;
+
+ /*
+ * not owned
+ */
+ CCaStorageProxy* iStorageProxy;
+
+ /*
+ * Keeps last state of backup
+ */
+ TInt iLastState;
+
+ };
+
+#endif /* CABACKUPNOTIFIER_H */
+
+// End of File
+
--- a/contentstorage/srvinc/casrv.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/srvinc/casrv.h Fri Aug 06 13:40:46 2010 +0300
@@ -26,6 +26,7 @@
class CCaSrvEngUtils;
class CCaSrvManager;
class CCaStorageProxy;
+class CCaBackupNotifier;
// GLOBAL FUNCTIONS
/**
@@ -124,6 +125,11 @@
* Srv plugin manager. Own.
*/
CCaSrvManager* iSrvManager;
+
+ /*
+ * Srv plugin manager. Own.
+ */
+ CCaBackupNotifier* iBackupNotifier;
};
--- a/contentstorage/srvinc/castorageproxy.h Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/srvinc/castorageproxy.h Fri Aug 06 13:40:46 2010 +0300
@@ -154,6 +154,18 @@
IMPORT_C void CustomSortL( const RArray<TInt>& aEntryIds,
const TInt aGroupId );
+
+ /**
+ * Saves a copy of database to private.
+ */
+ IMPORT_C void SaveDatabaseL();
+
+ /**
+ * Marks db to be restored from backup by next restart
+ */
+ IMPORT_C void RestoreDatabaseL();
+
+
/**
* Loads data base from rom.
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/srvsrc/cabackupnotifier.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,135 @@
+/*
+ * 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 <e32base.h>
+#include <sacls.h>
+#include <connect/sbdefs.h>
+
+#include "cabackupnotifier.h"
+#include "castorageproxy.h"
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaBackupNotifier* CCaBackupNotifier::NewL( CCaStorageProxy* aStorageProxy )
+ {
+ CCaBackupNotifier* self = new ( ELeave ) CCaBackupNotifier( aStorageProxy );
+ CleanupStack::PushL( self );
+ self->ConstructL( );
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaBackupNotifier::~CCaBackupNotifier()
+ {
+ Cancel();
+ iProperty.Close();
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaBackupNotifier::CCaBackupNotifier( CCaStorageProxy* aStorageProxy ) :
+ CActive( EPriorityNormal ),
+ iStorageProxy( aStorageProxy ),
+ iLastState(0)
+ {
+ iProperty.Attach( KUidSystemCategory, KUidBackupRestoreKey );
+ CActiveScheduler::Add( this );
+ iStatus = KRequestPending;
+ iProperty.Subscribe( iStatus );
+ SetActive();
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaBackupNotifier::ConstructL( )
+ {
+
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT (calls another method)
+void CCaBackupNotifier::DoCancel()
+ {
+ iProperty.Cancel();
+ }
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaBackupNotifier::RunL()
+ {
+ TInt backupStateValue = 0;
+ iProperty.Get(backupStateValue);
+ // Resubscribe before dealing with the current notification
+ iProperty.Subscribe(iStatus);
+ SetActive();
+
+ conn::TBURPartType type = static_cast< conn::TBURPartType >
+ ( backupStateValue & conn::KBURPartTypeMask );
+
+ if( type == conn::EBURRestoreFull || type == conn::EBURRestorePartial )
+ {
+ // restore starting
+ iLastState = ECaRestore;
+ }
+ else if( type == conn::EBURBackupFull || type == conn::EBURBackupPartial )
+ {
+ // backup starting
+ iStorageProxy->SaveDatabaseL();
+ iLastState = ECaBackup;
+ }
+ else if( ( type == conn::EBURNormal || type == conn::EBURUnset ) && iLastState == ECaRestore )
+ { // restore ends
+ iStorageProxy->RestoreDatabaseL();
+ }
+ else if( ( type == conn::EBURNormal || type == conn::EBURUnset ) && iLastState == ECaBackup )
+ { // backup ends
+ // do nothing
+ }
+ }
+
+
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT (calls another method)
+TInt CCaBackupNotifier::RunError( TInt /*aError*/)
+ {
+ // No need to do anything
+ return KErrNone;
+ }
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
--- a/contentstorage/srvsrc/casrv.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/srvsrc/casrv.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -18,12 +18,15 @@
#include <sqldb.h>
#include <eikenv.h>
#include <eikappui.h>
+
#include "casrv.h"
#include "casrvdef.h"
#include "casrvsession.h"
#include "casrvengutils.h"
#include "castorageproxy.h"
#include "casrvmanager.h"
+#include "cabackupnotifier.h"
+
// ==================== LOCAL FUNCTIONS ====================
@@ -77,6 +80,7 @@
}
}
}
+
// Let the caller know how it went.
RProcess::Rendezvous( err );
if( !err )
@@ -116,6 +120,7 @@
// Base class would do it for us but that's too late - our sessions
// call the server back (SessionClosed, RemoveContainer, etc.).
Cancel();
+ delete iBackupNotifier;
CSession2* session;
iSessionIter.SetToFirst();
while( ( session = iSessionIter++ ) != NULL )
@@ -169,6 +174,7 @@
iSrvManager = CCaSrvManager::NewL( *iStorageProxy,
&iSoftwareRegistry, iSrvEngUtils );
}
+ iBackupNotifier = CCaBackupNotifier::NewL( iStorageProxy );
}
// ---------------------------------------------------------
--- a/contentstorage/srvsrc/castorageproxy.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/contentstorage/srvsrc/castorageproxy.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -273,7 +273,7 @@
RPointerArray<CCaInnerEntry> resultArray;
CleanupResetAndDestroyPushL( resultArray );
iStorage->GetEntriesL( touchQuery, resultArray );
- iStorage->TouchL( entryId );
+ iStorage->TouchL( entryId, aEntry->GetFlags() & ERemovable );
for( TInt i = 0; i < iHandlerNotifier.Count(); i++ )
{
iHandlerNotifier[i]->EntryTouched( entryId );
@@ -371,13 +371,48 @@
CleanupStack::PopAndDestroy( &parentArray );
}
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
#ifdef COVERAGE_MEASUREMENT
#pragma CTC SKIP
#endif //COVERAGE_MEASUREMENT (calls another method)
+
+EXPORT_C void CCaStorageProxy::SaveDatabaseL()
+ {
+ iStorage->SaveDatabaseL();
+ }
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
+
+
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
//
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT (calls another method)
+
+EXPORT_C void CCaStorageProxy::RestoreDatabaseL()
+ {
+ iStorage->RestoreDatabaseL();
+ }
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT (calls another method)
+
EXPORT_C void CCaStorageProxy::LoadDataBaseFromRomL()
{
iStorage->LoadDataBaseFromRomL();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/activity_framework_api.metaxml Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="2481ff0a026dfee0a990b5a8b3d6fb8a" dataversion="2.0">
+ <name>activity_framework_api</name>
+ <description>Activity Framework API provides ways to store/restore application activity. It also provides means to launch application in predefined activity.</description>
+ <type>c++</type>
+ <collection>activityfw</collection>
+ <libs>
+ <lib name="afservice.lib"/>
+ </libs>
+ <release category="platform" sinceversion="5.2"/>
+ <attributes>
+ <htmldocprovided>no</htmldocprovided>
+ <adaptation>no</adaptation>
+ </attributes>
+</api>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/activity_framework_api.pri Fri Aug 06 13:40:46 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:
+#
+
+PLATFORM_HEADERS += activity_framework_api/afactivities_global.h \
+ activity_framework_api/afactivitystorage.h \
+ activity_framework_api/afactivation.h \
+ activity_framework_api/afstorageglobals.h \
+ activity_framework_api/afactivitylauncher.h \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/afactivation.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* 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 AFACTIVATION_H
+#define AFACTIVATION_H
+
+#include "afactivities_global.h"
+
+#include <QObject>
+#include <QString>
+#include <QStringList>
+#include <QVariant>
+
+class AfActivationPrivate;
+
+class AFACTIVITIES_EXPORT AfActivation : public QObject
+{
+ Q_OBJECT
+
+public:
+ AfActivation(QObject *parent = 0);
+
+signals:
+ void activated(Af::ActivationReason reason, QString name, QVariantHash parameters);
+
+public slots:
+ QVariantHash parameters() const;
+ Af::ActivationReason reason() const;
+ QString name() const;
+
+private:
+ AfActivationPrivate *d_ptr;
+
+};
+
+#endif // AFACTIVATION_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/afactivities_global.h Fri Aug 06 13:40:46 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 AFACTIVITIES_GLOBAL_H
+#define AFACTIVITIES_GLOBAL_H
+
+#include <qglobal.h>
+
+#ifdef AFACTIVITIES_LIB
+ #define AFACTIVITIES_EXPORT Q_DECL_EXPORT
+#else
+ #ifdef AFACTIVITIES_TEST
+ #define AFACTIVITIES_EXPORT
+ #else
+ #define AFACTIVITIES_EXPORT Q_DECL_IMPORT
+ #endif
+#endif
+
+namespace Af {
+ enum ActivationReason {
+ ActivationReasonActivity = 0,
+ ActivationReasonService,
+ ActivationReasonNormal
+ };
+
+ const char KActivityScheme[] = "appto";
+
+ const char KActivityUriNameKey[] = "activityname";
+ const char KActivityUriBackgroundKey[] = "activityinbackground";
+}
+
+#endif // AFACTIVITIES_GLOBAL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/afactivitylauncher.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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 AFACTIVITYLAUNCHER_H
+#define AFACTIVITYLAUNCHER_H
+
+#include <e32base.h>
+
+class RWsSession;
+class RApaLsSession;
+class CAfActivityLauncherPrivate;
+
+class CAfActivityLauncher : public CBase
+{
+
+public:
+ IMPORT_C static CAfActivityLauncher *NewL(RApaLsSession &apaLsSession, RWsSession &wsSession);
+ IMPORT_C static CAfActivityLauncher *NewLC(RApaLsSession &apaLsSession, RWsSession &wsSession);
+ IMPORT_C ~CAfActivityLauncher();
+ IMPORT_C void launchActivityL(const TDesC &uriDesc);
+
+private:
+ CAfActivityLauncher();
+ void ConstructL(RApaLsSession &apaLsSession, RWsSession &wsSession);
+
+private:
+ CAfActivityLauncherPrivate *mImplementation;
+
+};
+
+#endif // AFACTIVITYLAUNCHER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/afactivitystorage.h Fri Aug 06 13:40:46 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 AFACTIVITYSTORAGE_H
+#define AFACTIVITYSTORAGE_H
+
+#include "afactivities_global.h"
+
+#include <QString>
+#include <QStringList>
+#include <QVariant>
+#include <QScopedPointer>
+
+class AfActivityStoragePrivate;
+
+class AFACTIVITIES_EXPORT AfActivityStorage : public QObject
+{
+ Q_OBJECT
+
+public:
+ AfActivityStorage(QObject *parent = 0);
+ virtual ~AfActivityStorage();
+
+public slots:
+ bool saveActivity(const QString &activityId, const QVariant &activityData, const QVariantHash &metadata);
+ bool removeActivity(const QString &activityId);
+
+ QStringList allActivities() const;
+
+ QVariant activityData(const QString &activityId) const;
+ QVariantHash activityMetaData(const QString &activityId) const;
+
+private:
+ QScopedPointer<AfActivityStoragePrivate> d_ptr;
+
+private:
+ Q_DISABLE_COPY(AfActivityStorage)
+
+};
+
+#endif // AFACTIVITYSTORAGE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/afstorageglobals.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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 AFSTORAGEGLOBALS_H
+#define AFSTORAGEGLOBALS_H
+
+/**
+ * Enumerate supported functions
+ */
+
+const char ActivityApplicationKeyword [] = ":ApplicationId";
+const char ActivityActivityKeyword [] = ":ActivityName";
+const char ActivityParametersKeyword [] = ":ActivityParams";
+const char ActivityPersistence [] = ":ActivityPersistence";
+const char ActivityVisibility [] = ":ActivityVisibility";
+const char ActivityScreenshotKeyword [] = "screenshot";
+const char ActivityDataKeyword [] = ":ActivityData";
+const char ActivityApplicationName[] = ":ApplicationName";
+
+#endif //AFSTORAGEGLOBALS_H
--- a/homescreensrv_plat/contentstorage_api/caitemmodel.h Fri Jul 23 14:03:00 2010 +0300
+++ b/homescreensrv_plat/contentstorage_api/caitemmodel.h Fri Aug 06 13:40:46 2010 +0300
@@ -80,13 +80,17 @@
void setFlagsOff(const EntryFlags &offFlags);
QSharedPointer<CaEntry> entry(const QModelIndex &index) const;
- signals:
+ QList<int> getUninstallingEntriesIds(int componentId);
+ void updateProgress(int id, int valueOfProgress);
+
+
+signals:
void scrollTo(int row, QAbstractItemView::ScrollHint hint =
QAbstractItemView::EnsureVisible);
void empty(bool value);
void countChange();
-
+
protected:
// data
--- a/homescreensrv_plat/contentstorage_api/casoftwareregistry.h Fri Jul 23 14:03:00 2010 +0300
+++ b/homescreensrv_plat/contentstorage_api/casoftwareregistry.h Fri Aug 06 13:40:46 2010 +0300
@@ -28,6 +28,7 @@
//FORWARD DECLARATIONS
class QStringList;
class CaSoftwareRegistryPrivate;
+class CaUninstallNotifier;
/**
* Class provides Usif specific services
@@ -57,6 +58,8 @@
DetailMap entryDetails(int componentId) const;
QList<DetailMap> retrieveLogEntries() const;
+
+ CaUninstallNotifier *createUninstallNotifier() const;
static QString componentNameKey();
static QString componentVersionKey();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/contentstorage_api/cauninstallnotifier.h Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,64 @@
+/*
+ * 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: canotifier.h
+ *
+ */
+
+#ifndef CAUINSTALLNOTIFIER_H
+#define CAUINSTALLNOTIFIER_H
+
+#include <QObject>
+#include <QSharedPointer>
+
+#include "caclient_global.h"
+class CaUninstallNotifierPrivate;
+
+class CaUninstallNotifier: public QObject
+{
+Q_OBJECT
+
+public:
+
+ static CaUninstallNotifier* notifier();
+
+private:
+
+ explicit CaUninstallNotifier(CaUninstallNotifierPrivate *const notifierPrivate);
+
+ virtual ~CaUninstallNotifier();
+
+signals:
+
+ /*!
+ A signal emited when the entry is changed.
+ \param entryId entry id.
+ \param changeType the type of the change.
+ */
+ void progressChange(int componentId, int progressValue);
+
+private:
+
+ CaUninstallNotifierPrivate * const m_d;
+
+ static QSharedPointer<CaUninstallNotifier> mInstance;
+
+ Q_DISABLE_COPY(CaUninstallNotifier)
+
+ friend class CaUninstallNotifierPrivate;
+
+ friend class QtSharedPointer::ExternalRefCount<CaUninstallNotifier>;
+};
+
+
+#endif // CAUINSTALLNOTIFIER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/contentstorage_api/contentstorage_api.metaxml Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="d782ad60750b29f0c7a73a8baf35920f" dataversion="2.0">
+ <name>contentstorage_api</name>
+ <description>Content Storage API provides data model for homescreenapp, it provides list of application, widgets, urls as well as collections.</description>
+ <type>c++</type>
+ <collection>contentstorage</collection>
+ <libs>
+ <lib name="caclient.lib"/>
+ </libs>
+ <release category="platform" sinceversion="5.2"/>
+ <attributes>
+ <htmldocprovided>no</htmldocprovided>
+ <adaptation>no</adaptation>
+ </attributes>
+</api>
--- a/homescreensrv_plat/contentstorage_api/contentstorage_api.pri Fri Jul 23 14:03:00 2010 +0300
+++ b/homescreensrv_plat/contentstorage_api/contentstorage_api.pri Fri Aug 06 13:40:46 2010 +0300
@@ -25,4 +25,5 @@
contentstorage_api/caservice.h \
contentstorage_api/caitemmodel.h \
contentstorage_api/camenuiconutility.h \
- contentstorage_api/casoftwareregistry.h
\ No newline at end of file
+ contentstorage_api/casoftwareregistry.h \
+ contentstorage_api/cauninstallnotifier.h
\ No newline at end of file
--- a/homescreensrv_plat/homescreensrv_plat.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/homescreensrv_plat/homescreensrv_plat.pro Fri Aug 06 13:40:46 2010 +0300
@@ -22,6 +22,7 @@
include(menu_sat_interface_api/menu_sat_interface_api.pri)
include(homescreen_information_api/homescreen_information_api.pri)
include(taskswitcher_api/taskswitcher_api.pri)
+include(activity_framework_api/activity_framework_api.pri)
for(filename,PLATFORM_HEADERS){
BLD_INF_RULES.prj_exports *= "$$filename MW_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/taskswitcher_api/taskswitcher_api.metaxml Fri Aug 06 13:40:46 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="086de7c2f2a87e73b0c5674c24698c99" dataversion="2.0">
+ <name>taskswitcher_api</name>
+ <description>Task Switcher API controls appearance of application in task switcher as visibility and screenshot. It provides also keys for monitoring Task Switcher dialog visibility.</description>
+ <type>c++</type>
+ <collection>taskswitcher</collection>
+ <libs>
+ <lib name="tstaskmonitorclient.lib"/>
+ </libs>
+ <release category="platform" sinceversion="5.2"/>
+ <attributes>
+ <htmldocprovided>no</htmldocprovided>
+ <adaptation>no</adaptation>
+ </attributes>
+</api>
--- a/homescreensrv_plat/taskswitcher_api/taskswitcher_api.pri Fri Jul 23 14:03:00 2010 +0300
+++ b/homescreensrv_plat/taskswitcher_api/taskswitcher_api.pri Fri Aug 06 13:40:46 2010 +0300
@@ -15,4 +15,5 @@
#
PLATFORM_HEADERS += taskswitcher_api/tstasksettings.h \
+ taskswitcher_api/tstaskmonitor_global.h \
taskswitcher_api/tspropertydefs.h \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/taskswitcher_api/tstaskmonitor_global.h Fri Aug 06 13:40:46 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:
+*
+*/
+#ifndef TSTASKMONITOR_GLOBAL_H
+#define TSTASKMONITOR_GLOBAL_H
+
+#include <qglobal.h>
+
+#ifdef TSTASKMONITOR_LIB
+ #define TSTASKMONITOR_EXPORT Q_DECL_EXPORT
+#else
+ #ifdef TSTASKMONITOR_TEST
+ #define TSTASKMONITOR_EXPORT
+ #else
+ #define TSTASKMONITOR_EXPORT Q_DECL_IMPORT
+ #endif
+#endif
+
+#endif //TSTASKMONITOR_GLOBAL_H
--- a/hsappkeyhandler/group/hsappkeyplugin.mmp Fri Jul 23 14:03:00 2010 +0300
+++ b/hsappkeyhandler/group/hsappkeyplugin.mmp Fri Aug 06 13:40:46 2010 +0300
@@ -46,5 +46,6 @@
LIBRARY HbCore.lib
LIBRARY apparc.lib
LIBRARY apgrfx.lib
+LIBRARY afactivitylauncher.lib
DEBUGLIBRARY flogger.lib
// End of file
--- a/hsappkeyhandler/src/hsappkeyplugin.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/hsappkeyhandler/src/hsappkeyplugin.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -24,9 +24,12 @@
#include <hb/hbcore/hbdevicedialogsymbian.h>
#include <hb/hbcore/hbsymbianvariant.h>
#include <tspropertydefs.h>
+#include <afactivitylauncher.h>
+#include <homescreendomainpskeys.h>
#include "hsappkeyplugin.h"
-const TUid KHSAppUid = { 0x20022F35 };
+_LIT(KHsActivactionUri, "appto://20022F35?activityname=HsIdleView");
+_LIT(KAppLibActivactionUri, "appto://20022F35?activityname=AppLibMainView");
_LIT(KTsPluginName, "com.nokia.taskswitcher.tsdevicedialogplugin/1.0");
@@ -132,28 +135,22 @@
// ---------------------------------------------------------------------------
//
void CHsAppKeyPlugin::HandleShortPressL()
-{
- RWsSession& ws = iEikEnv->WsSession();
- TApaTaskList appList(ws);
- TApaTask task = appList.FindApp(KHSAppUid);
-
- if (task.Exists()) {
- task.BringToForeground();
- } else {
- RApaLsSession apaLsSession;
- User::LeaveIfError(apaLsSession.Connect());
- CleanupClosePushL(apaLsSession);
-
- TApaAppInfo appInfo;
- apaLsSession.GetAppInfo(appInfo, KHSAppUid );
-
- CApaCommandLine *cmdLine = CApaCommandLine::NewLC();
- cmdLine->SetExecutableNameL(appInfo.iFullName);
- User::LeaveIfError( apaLsSession.StartApp(*cmdLine));
-
- CleanupStack::PopAndDestroy(cmdLine);
- CleanupStack::PopAndDestroy(&apaLsSession);
- }
+{
+ RApaLsSession apaLsSession;
+ CleanupClosePushL(apaLsSession);
+ User::LeaveIfError(apaLsSession.Connect());
+ CAfActivityLauncher *activityEnabler =
+ CAfActivityLauncher::NewLC(apaLsSession,
+ iEikEnv->WsSession());
+ TInt state(0);
+ RProperty::Get(KHsCategoryUid, KHsCategoryStateKey, state);
+ if (state == EHomeScreenIdleState) {
+ activityEnabler->launchActivityL(KAppLibActivactionUri);
+ } else {
+ activityEnabler->launchActivityL(KHsActivactionUri);
+ }
+ CleanupStack::PopAndDestroy(activityEnabler);
+ CleanupStack::PopAndDestroy(&apaLsSession);
delete mDialog;
mDialog =0;
}
--- a/rom/homescreensrv_core.iby Fri Jul 23 14:03:00 2010 +0300
+++ b/rom/homescreensrv_core.iby Fri Aug 06 13:40:46 2010 +0300
@@ -23,16 +23,16 @@
// ---- contentstorage --------------------------------------------
file=ABI_DIR\BUILD_DIR\caapphandlerplugin.dll SHARED_LIB_DIR\caapphandlerplugin.dll
-data=\epoc32\data\z\hsresources\plugins\commandhandler\caapphandlerplugin.qtplugin hsresources\plugins\commandhandler\caapphandlerplugin.qtplugin
-data=\epoc32\data\z\hsresources\plugins\commandhandler\caapphandlerplugin.xml hsresources\plugins\commandhandler\caapphandlerplugin.xml
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\caapphandlerplugin.qtplugin resource\qt\plugins\commandhandler\caapphandlerplugin.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\caapphandlerplugin.xml resource\qt\plugins\commandhandler\caapphandlerplugin.xml
file=ABI_DIR\BUILD_DIR\catapphandlerplugin.dll SHARED_LIB_DIR\catapphandlerplugin.dll
-data=\epoc32\data\z\hsresources\plugins\commandhandler\catapphandlerplugin.qtplugin hsresources\plugins\commandhandler\catapphandlerplugin.qtplugin
-data=\epoc32\data\z\hsresources\plugins\commandhandler\catapphandlerplugin.xml hsresources\plugins\commandhandler\catapphandlerplugin.xml
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\catapphandlerplugin.qtplugin resource\qt\plugins\commandhandler\catapphandlerplugin.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\catapphandlerplugin.xml resource\qt\plugins\commandhandler\catapphandlerplugin.xml
file=ABI_DIR\BUILD_DIR\caurlhandlerplugin.dll SHARED_LIB_DIR\caurlhandlerplugin.dll
-data=\epoc32\data\z\hsresources\plugins\commandhandler\caurlhandlerplugin.qtplugin hsresources\plugins\commandhandler\caurlhandlerplugin.qtplugin
-data=\epoc32\data\z\hsresources\plugins\commandhandler\caurlhandlerplugin.xml hsresources\plugins\commandhandler\caurlhandlerplugin.xml
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\caurlhandlerplugin.qtplugin resource\qt\plugins\commandhandler\caurlhandlerplugin.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\caurlhandlerplugin.xml resource\qt\plugins\commandhandler\caurlhandlerplugin.xml
file=ABI_DIR\BUILD_DIR\caclient.dll SHARED_LIB_DIR\caclient.dll
file=ABI_DIR\BUILD_DIR\cautils.dll SHARED_LIB_DIR\cautils.dll
@@ -49,7 +49,6 @@
ECOM_PLUGIN( calocalizerscanner.dll, calocalizerscanner.rsc )
ECOM_PLUGIN( carunningappmonitor.dll, carunningappmonitor.rsc )
ECOM_PLUGIN( causifscanner.dll, causifscanner.rsc )
-ECOM_PLUGIN( caprogresscanner.dll, caprogresscanner.rsc )
data=ZPRIVATE\20022F90\castorage.db private\20022F90\castorage.db
--- a/tsdevicedialog/tsdevicedialog.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialog.pro Fri Aug 06 13:40:46 2010 +0300
@@ -30,6 +30,8 @@
SUBDIRS += tsdevicedialogplugin/tsrc
SUBDIRS += ../activityfw/activityserviceplugin/tsrc
SUBDIRS += ../activityfw/storage/client/t_afstorageclient
+ SUBDIRS += ../activityfw/storage/server/tsrc
+ SUBDIRS += ../activityfw/afactivitylauncher/tsrc
SUBDIRS += ../hsappkeyhandler/tsrc/t_hsappkeyhandler
SUBDIRS += ../taskswitcher/client/tsrc
SUBDIRS += ../taskswitcher/server/tsrc
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tsactivitymodelitem.h Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsactivitymodelitem.h Fri Aug 06 13:40:46 2010 +0300
@@ -17,9 +17,11 @@
#ifndef TSACTIVITYMODELITEM_H
#define TSACTIVITYMODELITEM_H
-#include "tsmodelitem.h"
+
#include <qvariant.h>
#include <qicon.h>
+
+#include "tsmodelitem.h"
/*!
Implements model item which represents Activity entry
*/
@@ -27,13 +29,14 @@
{
Q_OBJECT
public:
- TsActivityModelItem(QAbstractListModel &model, QObject &service, const QVariantHash &activity);
+ TsActivityModelItem(QAbstractListModel &model,
+ QObject &service,
+ const QVariantHash &activity);
~TsActivityModelItem();
QVariant data(int role) const;
void close();
void open();
static QString applicationKeyword();
- static QString visibilityKeyword();
static QString screenshotKeyword();
private:
@@ -50,7 +53,10 @@
QObject &mService;
const QVariantHash mActivity;
QIcon mIcon;
- bool mRequestPending;
+ mutable bool mRequestPending;
+
+ Q_DISABLE_COPY(TsActivityModelItem)
+
};
#endif // TSACTIVITYMODELITEM_H
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tsdevicedialogcontainer.h Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsdevicedialogcontainer.h Fri Aug 06 13:40:46 2010 +0300
@@ -18,9 +18,7 @@
#define TSDEVICEDIALOGCONTAINER_H
#include <QObject>
-
#include <HbDeviceDialogInterface>
-
#include <qvaluespacepublisher.h>
#include "tsdocumentloader.h"
@@ -29,11 +27,13 @@
class QAbstractListModel;
-class TsDeviceDialogContainer : public QObject, public HbDeviceDialogInterface
+class TsDeviceDialogContainer : public QObject,
+ public HbDeviceDialogInterface
{
Q_OBJECT
public:
- explicit TsDeviceDialogContainer(QAbstractListModel *model, QObject *parent = 0);
+ explicit TsDeviceDialogContainer(QAbstractListModel *model,
+ QObject *parent = 0);
~TsDeviceDialogContainer();
public:
@@ -51,11 +51,13 @@
private slots:
void notifyDialogClosed();
+ void switchViewOnModelChange();
private:
TsDocumentLoader mLoader;
QValueSpacePublisher mVisibilityPublisher;
+ Q_DISABLE_COPY(TsDeviceDialogContainer)
};
#endif // TSDEVICEDIALOGCONTAINER_H
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tsdevicedialogplugin.h Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsdevicedialogplugin.h Fri Aug 06 13:40:46 2010 +0300
@@ -19,7 +19,6 @@
#define TSDEVICEDIALOGPLUGIN_H
#include <hbdevicedialogplugin.h>
-
#include <QObject>
#include <QVariantMap>
#include <QSharedPointer>
@@ -36,15 +35,19 @@
TsDeviceDialogPlugin();
~TsDeviceDialogPlugin();
- bool accessAllowed(const QString &deviceDialogType, const QVariantMap ¶meters, const QVariantMap &securityInfo) const;
- HbDeviceDialogInterface *createDeviceDialog(const QString &deviceDialogType, const QVariantMap ¶meters);
- bool deviceDialogInfo(const QString &deviceDialogType, const QVariantMap ¶meters, DeviceDialogInfo *info) const;
+ bool accessAllowed(const QString &deviceDialogType,
+ const QVariantMap ¶meters,
+ const QVariantMap &securityInfo) const;
+ HbDeviceDialogInterface *createDeviceDialog(const QString &deviceDialogType,
+ const QVariantMap ¶meters);
+ bool deviceDialogInfo(const QString &deviceDialogType,
+ const QVariantMap ¶meters,
+ DeviceDialogInfo *info) const;
QStringList deviceDialogTypes() const;
PluginFlags pluginFlags() const;
int error() const;
private:
- int mError;
TsDocumentLoader mLoader;
QAbstractListModel *mModel;
TsTaskMonitor *mStorage;
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tsdocumentloader.h Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsdocumentloader.h Fri Aug 06 13:40:46 2010 +0300
@@ -24,7 +24,8 @@
{
private:
- virtual QObject *createObject(const QString &type, const QString &name);
+ virtual QObject *createObject(const QString &type,
+ const QString &name);
};
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tsmodel.h Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsmodel.h Fri Aug 06 13:40:46 2010 +0300
@@ -36,13 +36,14 @@
Q_OBJECT
public:
- explicit TsModel(TsTaskMonitor &applicationSrv,
- QObject &activitySrv,
- QObject *parent = 0);
+ 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;
+ QVariant data(const QModelIndex &index,
+ int role = Qt::DisplayRole) const;
int maxRowCount()const;
public slots:
@@ -75,14 +76,11 @@
#endif
/*
- * Icon size in model
- */
- QSize mSize;
-
- /*
* Maximum number of items (only for running apps + activities)
*/
int mMaxItems;
+
+ Q_DISABLE_COPY(TsModel)
};
#endif // TSMODEL_H
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tstasksgriditem.h Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tstasksgriditem.h Fri Aug 06 13:40:46 2010 +0300
@@ -48,6 +48,7 @@
HbFrameItem *mActiveLabelFrame;
HbTextItem *mActiveLabel;
+
};
#endif //TSTASKSGRIDITEM_H
--- a/tsdevicedialog/tsdevicedialogplugin/resource/layout.docml Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/resource/layout.docml Fri Aug 06 13:40:46 2010 +0300
@@ -5,12 +5,22 @@
<string name="alignment" value="AlignVCenter|AlignHCenter" />
<string locid="txt_ts_title_task_switcher" name="plainText" value="Task switcher" />
</widget>
- <widget name="taskgrid" role="HbDialog:contentWidget" type="TsTasksGrid">
- <widget name="item" role="HbAbstractView:prototype" type="TsTasksGridItem"/>
- <bool name="longPressEnabled" value="FALSE"/>
- <bool name="itemRecycling" value="TRUE"/>
- <enums name="horizontalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
- <bool name="swapDimensionsOnOrientationChange" value="FALSE"/>
+ <widget name="gridContainer" role="HbDialog:contentWidget" type="HbWidget">
+ <widget name="taskgrid" type="TsTasksGrid">
+ <widget name="item" role="HbAbstractView:prototype" type="TsTasksGridItem"/>
+ <bool name="longPressEnabled" value="FALSE"/>
+ <bool name="itemRecycling" value="TRUE"/>
+ <enums name="horizontalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
+ <bool name="swapDimensionsOnOrientationChange" value="FALSE"/>
+ </widget>
+ <widget name="noitemslabel" type="HbLabel">
+ <string name="alignment" value="AlignVCenter|AlignHCenter" />
+ <string locid="txt_ts_info_no_recent_applications" name="plainText"/>
+ </widget>
+ <layout type="stacked">
+ <stackitem itemname="noitemslabel"/>
+ <stackitem itemname="taskgrid"/>
+ </layout>
</widget>
<bool name="backgroundFaded" value="TRUE"/>
<string name="dismissPolicy" value="TapOutside"/>
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsactivitymodelitem.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsactivitymodelitem.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -115,15 +115,6 @@
}
/*!
- Return activity visibility status keyword
-*/
-QString TsActivityModelItem::visibilityKeyword()
-{
- static QString visibility("visible");
- return visibility;
-}
-
-/*!
Return activity screenshot keyword
*/
QString TsActivityModelItem::screenshotKeyword()
@@ -139,14 +130,15 @@
QVariant TsActivityModelItem::decorationRole() const
{
if (!mRequestPending) {
- const_cast<TsActivityModelItem *>(this)->mRequestPending = true;
+ 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<TsActivityModelItem *>(this)));
+ QMetaObject::invokeMethod(
+ &mService,
+ "getThumbnail",
+ Q_ARG(QSize, QSize(128, 128)),
+ Q_ARG(QString, screenshot.toString()),
+ Q_ARG(void *, const_cast<TsActivityModelItem *>(this)));
}
}
return QVariant::fromValue<HbIcon>(HbIcon(mIcon));
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogcontainer.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogcontainer.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -11,18 +11,17 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
-#include "tsdevicedialogcontainer.h"
#include <QAbstractListModel>
-
#include <HbDialog>
#include <HbMainWindow>
-
+#include <HbLabel>
#include <tspropertydefs.h>
+#include "tsdevicedialogcontainer.h"
#include "tstasksgrid.h"
#include "tstasksgriditem.h"
@@ -30,48 +29,77 @@
const char KDocmlPath[] = ":/resource/layout.docml";
}
-TsDeviceDialogContainer::TsDeviceDialogContainer(QAbstractListModel *model, QObject *parent) : QObject(parent), mVisibilityPublisher(TsProperty::KTsPath)
+TsDeviceDialogContainer::TsDeviceDialogContainer(QAbstractListModel *model,
+ QObject *parent)
+:
+ QObject(parent),
+ mVisibilityPublisher(TsProperty::KTsPath)
{
bool ok(true);
mLoader.load(KDocmlPath, &ok);
Q_ASSERT(ok);
- HbDialog *dialog = qobject_cast<HbDialog*>(mLoader.findWidget("tsdevicedialog"));
- TsTasksGrid *grid = qobject_cast<TsTasksGrid *>(mLoader.findWidget("taskgrid"));
+ HbDialog *dialog =
+ qobject_cast<HbDialog*>(mLoader.findWidget("tsdevicedialog"));
+ TsTasksGrid *grid =
+ qobject_cast<TsTasksGrid *>(mLoader.findWidget("taskgrid"));
Q_ASSERT(dialog);
Q_ASSERT(grid);
- changeOrientation(dialog->mainWindow()->orientation());
+ grid->setModel(model);
- grid->setModel(model);
+ changeOrientation(dialog->mainWindow()->orientation());
+ switchViewOnModelChange();
// needed because of Qt::QueuedConnection used below
// @todo: check if we actually need queued connections
qRegisterMetaType<QModelIndex>("QModelIndex");
// connect the grid and model
- disconnect(grid, SIGNAL(activated(QModelIndex)), model, SLOT(openApplication(QModelIndex)));
- disconnect(grid, SIGNAL(activated(QModelIndex)), dialog, SLOT(close()));
- disconnect(grid, SIGNAL(deleteButtonClicked(QModelIndex)), model, SLOT(closeApplication(QModelIndex)));
+ connect(grid,
+ SIGNAL(activated(QModelIndex)),
+ model,
+ SLOT(openApplication(QModelIndex)));
+ connect(grid,
+ SIGNAL(activated(QModelIndex)),
+ dialog,
+ SLOT(close()));
+ connect(grid,
+ SIGNAL(deleteButtonClicked(QModelIndex)),
+ model, SLOT(closeApplication(QModelIndex)),
+ Qt::QueuedConnection);
- connect(grid, SIGNAL(activated(QModelIndex)), model, SLOT(openApplication(QModelIndex)));
- connect(grid, SIGNAL(activated(QModelIndex)), dialog, SLOT(close()));
- connect(grid, SIGNAL(deleteButtonClicked(QModelIndex)), model, SLOT(closeApplication(QModelIndex)), Qt::QueuedConnection);
+ connect(dialog->mainWindow(),
+ SIGNAL(orientationChanged(Qt::Orientation)),
+ this,
+ SLOT(changeOrientation(Qt::Orientation)));
+ connect(dialog,
+ SIGNAL(aboutToClose()),
+ this,
+ SIGNAL(deviceDialogClosed()));
- connect(dialog->mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(changeOrientation(Qt::Orientation)));
- connect(dialog, SIGNAL(aboutToClose()), this, SIGNAL(deviceDialogClosed()));
-
- connect(this, SIGNAL(deviceDialogClosed()), this, SLOT(notifyDialogClosed()));
- mVisibilityPublisher.setValue(TsProperty::KVisibilityPath, static_cast<int>(true));
+ // note: connect to more signals when partial model updates are implemented
+ connect(model,
+ SIGNAL(modelReset()),
+ this,
+ SLOT(switchViewOnModelChange()));
+
+ connect(this,
+ SIGNAL(deviceDialogClosed()),
+ this,
+ SLOT(notifyDialogClosed()));
+ mVisibilityPublisher.setValue(TsProperty::KVisibilityPath,
+ static_cast<int>(true));
mVisibilityPublisher.sync();
}
-TsDeviceDialogContainer::~TsDeviceDialogContainer()
-{
+TsDeviceDialogContainer::~TsDeviceDialogContainer()
+{
delete deviceDialogWidget();
}
-bool TsDeviceDialogContainer::setDeviceDialogParameters(const QVariantMap ¶meters)
+bool TsDeviceDialogContainer::setDeviceDialogParameters(
+ const QVariantMap ¶meters)
{
Q_UNUSED(parameters);
return false;
@@ -91,7 +119,8 @@
HbPopup *TsDeviceDialogContainer::deviceDialogWidget() const
{
- HbDialog *widget = qobject_cast<HbDialog*>(mLoader.findWidget("tsdevicedialog"));
+ HbDialog *widget =
+ qobject_cast<HbDialog*>(mLoader.findWidget("tsdevicedialog"));
Q_ASSERT(widget);
return widget;
}
@@ -114,6 +143,25 @@
void TsDeviceDialogContainer::notifyDialogClosed()
{
- mVisibilityPublisher.setValue(TsProperty::KVisibilityPath, static_cast<int>(false));
+ mVisibilityPublisher.setValue(TsProperty::KVisibilityPath,
+ static_cast<int>(false));
mVisibilityPublisher.sync();
}
+
+void TsDeviceDialogContainer::switchViewOnModelChange()
+{
+ TsTasksGrid *grid =
+ qobject_cast<TsTasksGrid *>(mLoader.findWidget("taskgrid"));
+ HbLabel *noItemsLabel =
+ qobject_cast<HbLabel *>(mLoader.findWidget("noitemslabel"));
+ Q_ASSERT(grid);
+ Q_ASSERT(noItemsLabel);
+
+ if (grid->model()->rowCount()) {
+ noItemsLabel->hide();
+ grid->show();
+ } else {
+ noItemsLabel->show();
+ grid->hide();
+ }
+}
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -19,9 +19,7 @@
#include <QCoreApplication>
#include <QLocale>
#include <QtPlugin>
-
#include <qservicemanager.h>
-
#include <hbdevicedialog.h>
#include <HbMainWindow>
@@ -42,12 +40,17 @@
{
const char KTranslationPath[] = "resource/qt/translations";
const char KTsDialogType[] = "com.nokia.taskswitcher.tsdevicedialogplugin/1.0";
+ const char KActivityManaged [] = "com.nokia.qt.activities.ActivityManager";
}
/*!
Constructor.
*/
-TsDeviceDialogPlugin::TsDeviceDialogPlugin() : mError(0), mModel(0), mStorage(0), mTriedToLoadTranslation(false)
+TsDeviceDialogPlugin::TsDeviceDialogPlugin()
+:
+mModel(0),
+mStorage(0),
+mTriedToLoadTranslation(false)
{
}
@@ -58,7 +61,9 @@
/*!
\reimp
*/
-bool TsDeviceDialogPlugin::accessAllowed(const QString &deviceDialogType, const QVariantMap ¶meters, const QVariantMap &securityInfo) const
+bool TsDeviceDialogPlugin::accessAllowed(const QString &deviceDialogType,
+ const QVariantMap ¶meters,
+ const QVariantMap &securityInfo) const
{
Q_UNUSED(deviceDialogType)
Q_UNUSED(parameters)
@@ -72,7 +77,9 @@
/*!
\reimp
*/
-HbDeviceDialogInterface *TsDeviceDialogPlugin::createDeviceDialog(const QString &deviceDialogType, const QVariantMap ¶meters)
+HbDeviceDialogInterface *
+TsDeviceDialogPlugin::createDeviceDialog(const QString &deviceDialogType,
+ const QVariantMap ¶meters)
{
Q_UNUSED(parameters)
HbDeviceDialogInterface *dialogInterface(0);
@@ -82,16 +89,23 @@
mTriedToLoadTranslation = true;
QTranslator *translator = new QTranslator(this);
- QString translationFile = QString("taskswitcher_%1").arg(QLocale::system().name());
+ QString translationFile =
+ QString("taskswitcher_%1").arg(QLocale::system().name());
bool translationLoaded(false);
#ifdef Q_OS_SYMBIAN
- translationLoaded = translator->load(translationFile, QString("z:/") + KTranslationPath);
+ translationLoaded =
+ translator->load(translationFile,
+ QString("z:/") + KTranslationPath);
if (!translationLoaded) {
- translationLoaded = translator->load(translationFile, QString("c:/") + KTranslationPath);
+ translationLoaded =
+ translator->load(translationFile,
+ QString("c:/") + KTranslationPath);
}
#else
- translationLoaded = translator->load(translationFile, QString(KTranslationPath));
+ translationLoaded =
+ translator->load(translationFile,
+ QString(KTranslationPath));
#endif //Q_OS_SYMBIAN
Q_ASSERT(translationLoaded);
@@ -106,8 +120,8 @@
}
QtMobility::QServiceManager serviceManager;
- QObject *activityManager(serviceManager.loadInterface("com.nokia.qt.activities.ActivityManager"));
- if (activityManager) {
+ QObject *activityManager(serviceManager.loadInterface(KActivityManaged));
+ if (0 != activityManager) {
activityManager->setParent(this); //make it autodestructed
} else {
activityManager = this; //activity plugin is not present. provide invalid instance because its not critical functionality.
@@ -124,7 +138,9 @@
/*!
\reimp
*/
-bool TsDeviceDialogPlugin::deviceDialogInfo(const QString &deviceDialogType, const QVariantMap ¶meters, DeviceDialogInfo *info) const
+bool TsDeviceDialogPlugin::deviceDialogInfo(const QString &deviceDialogType,
+ const QVariantMap ¶meters,
+ DeviceDialogInfo *info) const
{
Q_UNUSED(parameters)
Q_UNUSED(deviceDialogType)
@@ -157,7 +173,7 @@
*/
int TsDeviceDialogPlugin::error() const
{
- return mError;
+ return 0;
}
#ifdef COVERAGE_MEASUREMENT
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsdocumentloader.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsdocumentloader.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -27,7 +27,8 @@
TS implementation of document loader. It is creating TS objects used in UI
*/
-QObject *TsDocumentLoader::createObject(const QString &type, const QString &name)
+QObject *TsDocumentLoader::createObject(const QString &type,
+ const QString &name)
{
if (type == TsTasksGrid::staticMetaObject.className()) {
QObject *object = new TsTasksGrid();
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsentrymodelitem.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsentrymodelitem.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -14,12 +14,13 @@
* Description: tsentrymodelitem.cpp
*
*/
-#include "tsentrymodelitem.h"
-#include "tsdataroles.h"
#include <tstask.h>
#include <HbIcon>
+#include "tsentrymodelitem.h"
+#include "tsdataroles.h"
+
/*!
\class TsEntryModelItem
\ingroup group_tsdevicedialogplugin
@@ -55,10 +56,7 @@
case Qt::DisplayRole:
return QVariant(mEntry->name());
case Qt::DecorationRole:
- {
- QPixmap icon = mEntry->screenshot();
- return QVariant::fromValue<HbIcon>(HbIcon(icon));
- }
+ return QVariant::fromValue<HbIcon>(HbIcon(mEntry->screenshot()));
case TsDataRoles::Closable:
return QVariant(mEntry->isClosable());
case TsDataRoles::Active:
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsmodel.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsmodel.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -14,12 +14,6 @@
* Description: tsmodel.cpp
*
*/
-#include "tsmodel.h"
-#include "tsmodelitem.h"
-#include "tsentrymodelitem.h"
-#include "tsactivitymodelitem.h"
-#include "tsdataroles.h"
-
#include <HbIcon>
#include <qvariant.h>
#include <qlist.h>
@@ -33,6 +27,12 @@
const int ItemsLimit = 0x00000001;
#endif
+#include "tsmodel.h"
+#include "tsmodelitem.h"
+#include "tsentrymodelitem.h"
+#include "tsactivitymodelitem.h"
+#include "tsdataroles.h"
+
const int maxItems(10);
/*!
\class TsModel
@@ -45,19 +45,21 @@
\param query used to create model
\param pointer to parent object
*/
-TsModel::TsModel(TsTaskMonitor &applicationSrv, QObject &activitySrv, QObject *parent) :
+TsModel::TsModel(TsTaskMonitor &applicationSrv,
+ QObject &activitySrv,
+ QObject *parent) :
QAbstractListModel(parent),
mEntries(),
mApplicationService(applicationSrv),
mActivityService(activitySrv),
- mSize(240, 240),
mMaxItems(maxItems)
{
#ifdef Q_OS_SYMBIAN
XQSettingsManager *crManager = new XQSettingsManager;
XQCentralRepositorySettingsKey itemsNumberKey(TSDeviceDialogUid, ItemsLimit);
- QVariant itemsNumberVariant = crManager->readItemValue(itemsNumberKey, XQSettingsManager::TypeInt);
+ QVariant itemsNumberVariant =
+ crManager->readItemValue(itemsNumberKey, XQSettingsManager::TypeInt);
if (!itemsNumberVariant.isNull()) {
int number = itemsNumberVariant.toInt();
if (number > 0) {
@@ -67,8 +69,14 @@
iAppArcSession.Connect();
#endif
- connect(&activitySrv, SIGNAL(dataChanged()), this, SLOT(updateModel()));
- connect(&applicationSrv, SIGNAL(taskListChanged()), this, SLOT(updateModel()));
+ connect(&activitySrv,
+ SIGNAL(dataChanged()),
+ this,
+ SLOT(updateModel()));
+ connect(&applicationSrv,
+ SIGNAL(taskListChanged()),
+ this,
+ SLOT(updateModel()));
updateModel();
}
@@ -132,7 +140,8 @@
*/
void TsModel::closeApplication(const QModelIndex &index)
{
- if (!index.isValid() || !entry(index)->data(TsDataRoles::Closable).toBool()) {
+ if (!index.isValid() ||
+ !entry(index)->data(TsDataRoles::Closable).toBool()) {
return;
}
entry(index)->close();
@@ -144,10 +153,9 @@
void TsModel::updateModel()
{
//clear current data
+ beginResetModel();
qDeleteAll(mEntries);
mEntries.clear();
-
- beginResetModel();
getApplications();
getActivities();
endResetModel();
@@ -160,13 +168,9 @@
void TsModel::getApplications()
{
//get running applications
- TsModelItem *entry(0);
QList< QSharedPointer<TsTask> > tasks(mApplicationService.taskList());
foreach (QSharedPointer<TsTask> taskData, tasks) {
- entry = new TsEntryModelItem(taskData);
- if (0 != entry) {
- mEntries.append(entry);
- }
+ mEntries.append(new TsEntryModelItem(taskData));
}
}
@@ -178,16 +182,18 @@
//get activities
TsModelItem *entry(0);
QList<QVariantHash> activities;
- QMetaObject::invokeMethod(&mActivityService, "activitiesList", Q_RETURN_ARG(QList<QVariantHash>, activities));
+ QMetaObject::invokeMethod(&mActivityService,
+ "activitiesList",
+ Q_RETURN_ARG(QList<QVariantHash>,
+ activities));
foreach(QVariantHash activity, activities) {
prepareActivityEntry(activity);
entry = new TsActivityModelItem(*this, mActivityService, activity);
- if (entry) {
- if (maxRowCount() <= mEntries.count()) {
- break;
- }
- mEntries.append(entry);
+ if (maxRowCount() <= mEntries.count()) {
+ delete entry;
+ break;
}
+ mEntries.append(entry);
}
}
--- a/tsdevicedialog/tsdevicedialogplugin/src/tstasksgriditem.cpp Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tstasksgriditem.cpp Fri Aug 06 13:40:46 2010 +0300
@@ -14,8 +14,6 @@
* Description:
*
*/
-#include "tstasksgriditem.h"
-
#include <HbPushButton>
#include <HbAbstractItemView>
#include <HbFrameItem>
@@ -23,6 +21,7 @@
#include <HbIconItem>
#include <HbStyleLoader>
+#include "tstasksgriditem.h"
#include "tsdataroles.h"
/*!
@@ -32,12 +31,21 @@
*/
-TsTasksGridItem::TsTasksGridItem() : HbAbstractViewItem(), mScreenshotLabel(0), mApplicationNameLabel(0), mDeleteButton(0), mActiveLabelFrame(0), mActiveLabel(0)
+TsTasksGridItem::TsTasksGridItem()
+:
+HbAbstractViewItem(),
+mScreenshotLabel(0),
+mApplicationNameLabel(0),
+mDeleteButton(0),
+mActiveLabelFrame(0),
+mActiveLabel(0)
{
// Register the custom docml and css to provide our own style to the list items
- bool widgetmlLoaded = HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.widgetml");
+ bool widgetmlLoaded =
+ HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.widgetml");
Q_ASSERT(widgetmlLoaded);
- bool cssLoaded = HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.css");
+ bool cssLoaded =
+ HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.css");
Q_ASSERT(cssLoaded);
}
Binary file tsdevicedialog/tsdevicedialogplugin/taskswitcher.qm has changed
--- a/tsdevicedialog/tsdevicedialogplugin/taskswitcher.ts Fri Jul 23 14:03:00 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="3.0" language="en_GB" sourcelanguage="en_GB">
-<context>
-<message numerus="no" id="txt_tsw_title_task_switcher">
- <comment>Task switcher popup title text. Application allows user to swap between running and recently used applications and to clear them from the list.</comment>
- <source>Task switcher</source>
- <translation variants="no">Task switcher</translation>
- <extra-loc-layout_id>cell_tport_appsw_pane_t1</extra-loc-layout_id>
- <extra-loc-viewid>tsw_01</extra-loc-viewid>
- <extra-loc-positionid>title</extra-loc-positionid>
- <extra-loc-feature>ts</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-</context>
-</TS>
--- a/tsdevicedialog/tsdevicedialogplugin/tsdevicedialogplugin.pro Fri Jul 23 14:03:00 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/tsdevicedialogplugin.pro Fri Aug 06 13:40:46 2010 +0300
@@ -42,6 +42,7 @@
INCLUDEPATH += . \
./inc \
+ ../../inc \
LIBS += -ltstaskmonitorclient
@@ -58,13 +59,11 @@
LIBS += -lxqsettingsmanager -lapparc -lapgrfx
# ugly hack
- translation.sources = ./*.qm
- translation.path = $$QT_PLUGINS_BASE_DIR/../translations
crml.sources = ./resource/*.qcrml
crml.path = /resource/qt/crml
- DEPLOYMENT += pluginstub translation crml
+ DEPLOYMENT += pluginstub crml
BLD_INF_RULES.prj_exports += \
"$${LITERAL_HASH}include <platform_paths.hrh>" \