# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1271420169 -10800 # Node ID 8e5041d13c844ada7ad3875f20707f7da3ae1b2f # Parent f62f87b200ec740c28103301b54bbdf5cc368b0e Revision: 201011 Kit: 201015 diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/activitydatabase.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/activitydatabase.pro Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,20 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +SUBDIRS += hsactivitydbclient \ + hsactivitydbserver diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/bwins/hsactivitydbclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/bwins/hsactivitydbclientu.def Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,25 @@ +EXPORTS + ?launchActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 1 NONAME ; int HsActivityDbClient::launchActivity(class QHash const &) + ?connect@HsActivityDbClient@@QAEHXZ @ 2 NONAME ; int HsActivityDbClient::connect(void) + ?asyncRequestCompleated@HsActivityDbClient@@UAEXHHABVQString@@@Z @ 3 NONAME ; void HsActivityDbClient::asyncRequestCompleated(int, int, class QString const &) + ?trUtf8@HsActivityDbClient@@SA?AVQString@@PBD0@Z @ 4 NONAME ; class QString HsActivityDbClient::trUtf8(char const *, char const *) + ?applicationActivities@HsActivityDbClient@@UAEHAAV?$QList@V?$QHash@VQString@@VQVariant@@@@@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 5 NONAME ; int HsActivityDbClient::applicationActivities(class QList > &, class QHash const &) + ?qt_metacast@HsActivityDbClient@@UAEPAXPBD@Z @ 6 NONAME ; void * HsActivityDbClient::qt_metacast(char const *) + ?qt_metacall@HsActivityDbClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 7 NONAME ; int HsActivityDbClient::qt_metacall(enum QMetaObject::Call, int, void * *) + ?waitActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 8 NONAME ; int HsActivityDbClient::waitActivity(class QHash const &) + ?activities@HsActivityDbClient@@UAEHAAV?$QList@V?$QHash@VQString@@VQVariant@@@@@@@Z @ 9 NONAME ; int HsActivityDbClient::activities(class QList > &) + ?trUtf8@HsActivityDbClient@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString HsActivityDbClient::trUtf8(char const *, char const *, int) + ??0HsActivityDbClient@@QAE@PAVQObject@@@Z @ 11 NONAME ; HsActivityDbClient::HsActivityDbClient(class QObject *) + ?tr@HsActivityDbClient@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString HsActivityDbClient::tr(char const *, char const *) + ?getStaticMetaObject@HsActivityDbClient@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & HsActivityDbClient::getStaticMetaObject(void) + ??_EHsActivityDbClient@@UAE@I@Z @ 14 NONAME ; HsActivityDbClient::~HsActivityDbClient(unsigned int) + ?metaObject@HsActivityDbClient@@UBEPBUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const * HsActivityDbClient::metaObject(void) const + ?removeApplicationActivities@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 16 NONAME ; int HsActivityDbClient::removeApplicationActivities(class QHash const &) + ?tr@HsActivityDbClient@@SA?AVQString@@PBD0H@Z @ 17 NONAME ; class QString HsActivityDbClient::tr(char const *, char const *, int) + ?addActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 18 NONAME ; int HsActivityDbClient::addActivity(class QHash const &) + ?staticMetaObject@HsActivityDbClient@@2UQMetaObject@@B @ 19 NONAME ; struct QMetaObject const HsActivityDbClient::staticMetaObject + ??1HsActivityDbClient@@UAE@XZ @ 20 NONAME ; HsActivityDbClient::~HsActivityDbClient(void) + ?activityRequested@HsActivityDbClient@@IAEXABVQString@@@Z @ 21 NONAME ; void HsActivityDbClient::activityRequested(class QString const &) + ?updateActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 22 NONAME ; int HsActivityDbClient::updateActivity(class QHash const &) + ?removeActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 23 NONAME ; int HsActivityDbClient::removeActivity(class QHash const &) + diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/eabi/hsactivitydbclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/eabi/hsactivitydbclientu.def Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,34 @@ +EXPORTS + _ZN18HsActivityDbClient10activitiesER5QListI5QHashI7QString8QVariantEE @ 1 NONAME + _ZN18HsActivityDbClient11addActivityERK5QHashI7QString8QVariantE @ 2 NONAME + _ZN18HsActivityDbClient11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME + _ZN18HsActivityDbClient11qt_metacastEPKc @ 4 NONAME + _ZN18HsActivityDbClient12waitActivityERK5QHashI7QString8QVariantE @ 5 NONAME + _ZN18HsActivityDbClient14launchActivityERK5QHashI7QString8QVariantE @ 6 NONAME + _ZN18HsActivityDbClient14removeActivityERK5QHashI7QString8QVariantE @ 7 NONAME + _ZN18HsActivityDbClient14updateActivityERK5QHashI7QString8QVariantE @ 8 NONAME + _ZN18HsActivityDbClient16staticMetaObjectE @ 9 NONAME DATA 16 + _ZN18HsActivityDbClient17activityRequestedERK7QString @ 10 NONAME + _ZN18HsActivityDbClient19getStaticMetaObjectEv @ 11 NONAME + _ZN18HsActivityDbClient21applicationActivitiesER5QListI5QHashI7QString8QVariantEERKS4_ @ 12 NONAME + _ZN18HsActivityDbClient22asyncRequestCompleatedEiiRK7QString @ 13 NONAME + _ZN18HsActivityDbClient27removeApplicationActivitiesERK5QHashI7QString8QVariantE @ 14 NONAME + _ZN18HsActivityDbClient7connectEv @ 15 NONAME + _ZN18HsActivityDbClientC1EP7QObject @ 16 NONAME + _ZN18HsActivityDbClientC2EP7QObject @ 17 NONAME + _ZN18HsActivityDbClientD0Ev @ 18 NONAME + _ZN18HsActivityDbClientD1Ev @ 19 NONAME + _ZN18HsActivityDbClientD2Ev @ 20 NONAME + _ZNK18HsActivityDbClient10metaObjectEv @ 21 NONAME + _ZTI18HsActivityDbClient @ 22 NONAME + _ZTV18HsActivityDbClient @ 23 NONAME + _ZThn12_N18HsActivityDbClient22asyncRequestCompleatedEiiRK7QString @ 24 NONAME + _ZThn8_N18HsActivityDbClient10activitiesER5QListI5QHashI7QString8QVariantEE @ 25 NONAME + _ZThn8_N18HsActivityDbClient11addActivityERK5QHashI7QString8QVariantE @ 26 NONAME + _ZThn8_N18HsActivityDbClient12waitActivityERK5QHashI7QString8QVariantE @ 27 NONAME + _ZThn8_N18HsActivityDbClient14launchActivityERK5QHashI7QString8QVariantE @ 28 NONAME + _ZThn8_N18HsActivityDbClient14removeActivityERK5QHashI7QString8QVariantE @ 29 NONAME + _ZThn8_N18HsActivityDbClient14updateActivityERK5QHashI7QString8QVariantE @ 30 NONAME + _ZThn8_N18HsActivityDbClient21applicationActivitiesER5QListI5QHashI7QString8QVariantEERKS4_ @ 31 NONAME + _ZThn8_N18HsActivityDbClient27removeApplicationActivitiesERK5QHashI7QString8QVariantE @ 32 NONAME + diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbclient/hsactivitydbclient.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbclient/hsactivitydbclient.pro Fri Apr 16 15:16:09 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: +# + +TEMPLATE = lib +TARGET = hsactivitydbclient + +QT += core \ + sql + +QT -= gui + +HEADERS += inc/hsactivitydbclient.h + +SOURCES += src/hsactivitydbclient.cpp + +DEFINES += ACTIVITY_LIB + +symbian{ +TARGET.UID3 = 0xE467C21E + +HEADERS += ../s60/inc/hsserializer.h \ + s60/inc/hsactivitydbclient_p.h \ + s60/inc/hsactivitydbasyncrequest_p.h + +SOURCES += ../s60/src/hsserializer.cpp \ + s60/src/hsactivitydbclient_p.cpp \ + s60/src/hsactivitydbasyncrequest_p.cpp + + +hsactivitydbclientdll.sources = hsactivitydbclient.dll +hsactivitydbclientdll.path = $$SHARED_LIB_DIR +DEPLOYMENT += hsactivitydbclientdll + +BLD_INF_RULES.prj_exports += "../inc/hsactivitydbclientinterface.h /epoc32/include/hsactivitydbclientinterface.h" \ + "inc/hsactivitydbclient.h /epoc32/include/hsactivitydbclient.h" \ + "inc/hsactivitydbasyncrequestobserver.h /epoc32/include/hsactivitydbasyncrequestobserver.h" +DEPLOYMENT += api +TARGET.CAPABILITY = ALL -TCB +TARGET.EPOCALLOWDLLDATA = 1 +MMP_RULES += EXPORTUNFROZEN +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbasyncrequestobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbasyncrequestobserver.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,34 @@ +/* +* 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 HSACTIVITYDBASYNCREQUESTOBSERVER_H +#define HSACTIVITYDBASYNCREQUESTOBSERVER_H +#include +class HsActivityDbAsyncRequestObserver +{ +public: + /** + * Function inform observer about asynchronous request results + * @param result - request result + * @param requestType - request type + * @param data - respons data + */ + virtual void asyncRequestCompleated(int result, + int requestType, + const QString& data)=0; +}; +#endif // HSACTIVITYDBASYNCREQUESTOBSERVER_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbclient.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,125 @@ +/* +* 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 HSACTIVITYDBCLIENT_H +#define HSACTIVITYDBCLIENT_H +#include +#include +#include "hsactivitydbclientinterface.h" + +#ifdef ACTIVITY_LIB + #define ACTIVITY_EXPORT Q_DECL_EXPORT +#else + #define ACTIVITY_EXPORT Q_DECL_IMPORT +#endif + +class HsActivityDbClientPrivate; + +/** + * Class implemets HsActivityDbClientInterface and is responsible for activity data management. + */ +class ACTIVITY_EXPORT HsActivityDbClient: public QObject, + public HsActivityDbClientInterface, + public HsActivityDbAsyncRequestObserver +{ +Q_OBJECT +public: + /** + * Constructor + */ + HsActivityDbClient(QObject* =0); + + /** + * Destructor + */ + ~HsActivityDbClient(); + + /** + * Establish connection with activity server + * @return 0 on succees, error code otherwise + */ + int connect(); + + /** + * Interface implementation. + * @see int HsActivityDbAsyncRequestObserver::asyncRequestCompleated(int, int, const QString&) + */ + void asyncRequestCompleated(int, int, const QString&); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::saveActivity(const QVariantHash&) + */ + int addActivity(const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash&) + */ + int updateActivity(const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::deleteActivity(const QVariantHash &) + */ + int removeActivity(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::deleteApplicationActivities(const QVariantHash &) + */ + int removeApplicationActivities(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::activities(QList&) + */ + int activities(QList &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::applicationActivities(QList &, const QVariantHash &) + */ + int applicationActivities(QList &, + const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &) + */ + int waitActivity(const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &) + */ + int launchActivity(const QVariantHash &); +signals: + /** + * Function notify about runtime activity change + * @param activityId - requested activity name + */ + void activityRequested(const QString& activityId); +private: + /** + * Private client implementation. + * Own. + */ + HsActivityDbClientPrivate* d_ptr; +}; + +#endif //HSACTIVITYDBCLIENT_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbasyncrequest_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbasyncrequest_p.h Fri Apr 16 15:16:09 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: +* +*/ +#ifndef HSACTIVITYDBASYNCREQUESTPRIVATE_H +#define HSACTIVITYDBASYNCREQUESTPRIVATE_H +#include +#include +#include + +class HsActivityDbClientPrivate; + +/** + * Class is responsible for async. request handling + */ +class HsActivityDbAsyncRequestPrivate : public CActive + +{ +public: + /** + * First step constructor + */ + static HsActivityDbAsyncRequestPrivate* + NewL(HsActivityDbAsyncRequestObserver &, HsActivityDbClientPrivate &); + + /** + * First step constructor + */ + static HsActivityDbAsyncRequestPrivate* + NewLC(HsActivityDbAsyncRequestObserver &, HsActivityDbClientPrivate &); + + /** + * Destructor + */ + ~HsActivityDbAsyncRequestPrivate(); + + /** + * Function create subscription to current ativity changes + * @param condition - activity filetering rules + */ + void waitActivity(const QVariantHash& condition); +protected: + /** + * Interface implementation. + * @see void CActive::DoCancel() + */ + void DoCancel(); + + /** + * Interface implementation. + * @see void CActive::DoCancel() + */ + void RunL(); +private: + /** + * Constructor + */ + HsActivityDbAsyncRequestPrivate(HsActivityDbAsyncRequestObserver &, + HsActivityDbClientPrivate &); +private: + HsActivityDbAsyncRequestObserver& mObserver; + HsActivityDbClientPrivate& mSession; + int mRequestType; + RBuf8 mDataBuf; + TPckgBuf mDataSize; +}; +#endif // HSACTIVITYDBCLIENTPRIVATE_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,178 @@ +/* +* 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 HSACTIVITYDBCLIENTPRIVATE_H +#define HSACTIVITYDBCLIENTPRIVATE_H +#include "hsactivitydbclientinterface.h" +#include +#include + +class HsActivityDbAsyncRequestPrivate; +/** + * Class implemets HsActivityDbClientInterface and is responsible for + * activity data management on S60 enviroment. + */ +class HsActivityDbClientPrivate : protected RSessionBase, + public HsActivityDbClientInterface +{ +public: + /** + * Constructor + */ + HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver&); + + /** + * Destructor + */ + ~HsActivityDbClientPrivate(); + + /** + * Function establish connection to activity server + * @return 0 on succees, error code otherwise + */ + int connect(); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::addActivity(const QVariantHash &) + */ + int addActivity(const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash &) + */ + int updateActivity(const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::removeActivity(const QVariantHash &) + */ + int removeActivity(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::removeApplicationActivities(const QVariantHash &) + */ + int removeApplicationActivities(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::requestedActivityName(QString &, const QVariantHash &); + */ + int requestedActivityName(QString &, const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::activities(QList &); + */ + int activities(QList &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::applicationActivities(QList &, const QVariantHash &) + */ + int applicationActivities(QList&, const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &) + */ + int waitActivity(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &) + */ + int launchActivity(const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::cancelWaitActivity() + */ + int cancelWaitActivity(); + +public: + /** + * Function get cached data from server + * @param dst - destination, preallocated buffer + */ + void getData(RBuf8 & dst); + + /** + * Function initialize aync request + * @param func - requested function + * @param data - request data + * @param status - request status + */ + void sendDataAsync(int func,const TIpcArgs & data, TRequestStatus& status); + +private: + /** + * Function start activity server process. + * Function can leave on failure. + */ + void startServerL(); + + /** + * Function establish connection to activity server. + * Function can leave on failure + */ + void connectL(); + + /** + * Function execute remote call request. + * @param function - remote function identyfier + * @param activity - remote function parameters + */ + void execSimpleRequestL( int function, const QVariantHash &activity); + + /** + * Function retrieve current activity name for application. + * Function can leave on failure + * @param result - activity name + * @param activity - request filtering rules + */ + void requestedActivityNameL(QString& result, + const QVariantHash &activity); + + /** + * Function retrieve all stored activity + * Function can leave on failure + * @param result - list of activity + */ + void activitiesL(QList& result); + + /** + * Function retrieve all stored activity + * Function can leave on failure + * @param result - list of activity + * @param cond - request conditions + */ + void applicationActivitiesL(QList& result, + const QVariantHash & cond); + + void waitActivityL(const QVariantHash &activity); +private: + /** + * Async request handler + * Own + */ + HsActivityDbAsyncRequestPrivate* mAsyncDataHandler; + +}; +#endif // HSACTIVITYDBCLIENTPRIVATE_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbasyncrequest_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbasyncrequest_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,119 @@ +/* +* 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 "hsactivitydbasyncrequest_p.h" +#include "hsactivitydbclient_p.h" +#include "hsserializer.h" +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityDbAsyncRequestPrivate* + HsActivityDbAsyncRequestPrivate::NewL(HsActivityDbAsyncRequestObserver& observer, + HsActivityDbClientPrivate& session) +{ + HsActivityDbAsyncRequestPrivate* self = + HsActivityDbAsyncRequestPrivate::NewLC(observer, session); + CleanupStack::Pop(self); + return self; +} +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityDbAsyncRequestPrivate* + HsActivityDbAsyncRequestPrivate::NewLC(HsActivityDbAsyncRequestObserver& observer, + HsActivityDbClientPrivate& session) +{ + HsActivityDbAsyncRequestPrivate* self = + new (ELeave)HsActivityDbAsyncRequestPrivate(observer, session); + CleanupStack::PushL(self); + self->mDataBuf.CreateL(64); + return self; +} +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityDbAsyncRequestPrivate::HsActivityDbAsyncRequestPrivate(HsActivityDbAsyncRequestObserver &observer, + HsActivityDbClientPrivate &session) +: + CActive(EPriorityStandard), + mObserver(observer), + mSession(session), + mRequestType(-1), + mDataSize() +{ + CActiveScheduler::Add(this); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityDbAsyncRequestPrivate::~HsActivityDbAsyncRequestPrivate() +{ + mDataBuf.Close(); + Cancel(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbAsyncRequestPrivate::DoCancel() +{ + if(IsActive()) { + mSession.cancelWaitActivity(); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbAsyncRequestPrivate::RunL() +{ + RBuf8 buff; + CleanupClosePushL(buff); + QString data; + int requestResult(iStatus.Int()); + if(KErrNone == requestResult) { + if(0 < mDataSize()) { + buff.CreateL(mDataSize()); + } + mSession.getData(buff); + data = QString::fromAscii(reinterpret_cast(buff.Ptr()), + buff.Length()); + buff.Close(); + } + mObserver.asyncRequestCompleated(requestResult, mRequestType, data); + CleanupStack::PopAndDestroy(&buff); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbAsyncRequestPrivate::waitActivity(const QVariantHash& condition) +{ + mRequestType = WaitActivity; + iStatus = KRequestPending; + SetActive(); + mDataBuf << condition; + mSession.sendDataAsync(mRequestType, TIpcArgs(&mDataBuf, &mDataSize), iStatus); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbclient_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbclient_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,301 @@ +/* +* 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 "hsactivitydbclient_p.h" +#include "hsactivitydbasyncrequest_p.h" +#include "hsactivityglobals.h" +#include "hsserializer.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityDbClientPrivate::HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver& observer) +{ + mAsyncDataHandler = HsActivityDbAsyncRequestPrivate::NewL(observer, *this); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityDbClientPrivate::~HsActivityDbClientPrivate() +{ + delete mAsyncDataHandler; + Close(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::connect() +{ + TRAPD(errNo, connectL()); + return errNo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::addActivity(const QVariantHash &activity) +{ + TRAPD( errNo, execSimpleRequestL(AddActivity, activity);) + return errNo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::updateActivity(const QVariantHash &activity) +{ + TRAPD( errNo, execSimpleRequestL(UpdateActivity, activity);) + return errNo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::removeActivity(const QVariantHash &activity) +{ + TRAPD( errNo, execSimpleRequestL(RemoveActivity, activity);) + return errNo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::removeApplicationActivities(const QVariantHash &activity) +{ + TRAPD( errNo, execSimpleRequestL(RemoveApplicationActivities, activity);) + return errNo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::activities(QList& result) +{ + TRAPD(errNo, activitiesL(result)); + return errNo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::applicationActivities(QList& result, + const QVariantHash & condition) +{ + TRAPD(errNo, applicationActivitiesL(result, condition)); + return errNo; +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::waitActivity(const QVariantHash &activity) +{ + TRAPD( errNo, waitActivityL(activity);) + return errNo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::launchActivity(const QVariantHash &activity) +{ + TRAPD( errNo, execSimpleRequestL(LaunchActivity, activity);) + return errNo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::cancelWaitActivity() +{ + return SendReceive(CancelWait, TIpcArgs()); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbClientPrivate::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 HsActivityDbClientPrivate::connectL() +{ + const int asyncMessageSlots(4); + 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; + } + } + } while(--retry > 0); + User::LeaveIfError(errNo); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbClientPrivate::execSimpleRequestL(int function, const QVariantHash &activity) +{ + RBuf8 data; + CleanupClosePushL(data); + data.CreateL(256); + data << activity; + User::LeaveIfError(SendReceive(function, TIpcArgs(&data))); + CleanupStack::PopAndDestroy(&data); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbClientPrivate::requestedActivityNameL(QString& result, + const QVariantHash &activity) +{ + RBuf8 data; + TPckgBuf sizeBuf; + CleanupClosePushL(data); + data.CreateL(256); + data << activity; + User::LeaveIfError(SendReceive(RequestedActivityName, TIpcArgs(&data,&sizeBuf))); + if(sizeBuf() > data.MaxSize()) { + data.ReAlloc(sizeBuf()); + } + User::LeaveIfError(SendReceive(GetData, TIpcArgs(&data))); + result = QString::fromAscii(reinterpret_cast(data.Ptr()), + data.Length()); + CleanupStack::PopAndDestroy(&data); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbClientPrivate::activitiesL(QList& result) +{ + RBuf8 data; + TPckgBuf sizeBuf; + CleanupClosePushL(data); + data.CreateL(256); + User::LeaveIfError(SendReceive(Activities, TIpcArgs(&data, &sizeBuf))); + if(sizeBuf() > data.MaxSize()) { + data.ReAlloc(sizeBuf()); + } + User::LeaveIfError(SendReceive(GetData, TIpcArgs(&data))); + result << data; + CleanupStack::PopAndDestroy(&data); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbClientPrivate::applicationActivitiesL(QList& result, + const QVariantHash & condition) +{ + RBuf8 data; + TPckgBuf sizeBuf; + CleanupClosePushL(data); + data.CreateL(256); + data << condition; + User::LeaveIfError(SendReceive(ApplicationActivities, TIpcArgs(&data, &sizeBuf))); + if(sizeBuf() > data.MaxSize()) { + data.ReAlloc(sizeBuf()); + } + User::LeaveIfError(SendReceive(GetData, TIpcArgs(&data))); + result << data; + CleanupStack::PopAndDestroy(&data); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbClientPrivate::waitActivityL(const QVariantHash &activity) +{ + if(mAsyncDataHandler->IsActive()) { + User::Leave(KErrServerBusy); + } else { + mAsyncDataHandler->waitActivity(activity); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbClientPrivate::getData(RBuf8& data) +{ + SendReceive(GetData, TIpcArgs(&data)); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbClientPrivate::sendDataAsync(int func, + const TIpcArgs &data, + TRequestStatus& status) +{ + SendReceive(func, data, status); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbclient/src/hsactivitydbclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbclient/src/hsactivitydbclient.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "hsactivitydbclient.h" +#include "hsactivitydbclient_p.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityDbClient::HsActivityDbClient(QObject* obj) +: + QObject(obj), + d_ptr(0) +{ + d_ptr = new HsActivityDbClientPrivate(*this); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityDbClient::~HsActivityDbClient() +{ + delete d_ptr; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClient::connect() +{ + return d_ptr->connect(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityDbClient::asyncRequestCompleated(int result, + int requestType, + const QString& data) +{ + switch(requestType){ + case WaitActivity: + if( KErrNone == result ) { + emit activityRequested(data); + } + break; + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClient::addActivity(const QVariantHash &activity) +{ + return d_ptr->addActivity(activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClient::updateActivity(const QVariantHash &activity) +{ + return d_ptr->updateActivity(activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClient::removeActivity(const QVariantHash &activity) +{ + return d_ptr->removeActivity(activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClient::removeApplicationActivities(const QVariantHash &activity) +{ + return d_ptr->removeApplicationActivities(activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClient::activities(QList& result) +{ + return d_ptr->activities(result); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClient::applicationActivities(QList & result, + const QVariantHash & conditions) +{ + return d_ptr->applicationActivities(result, conditions); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClient::waitActivity(const QVariantHash &activity) +{ + return d_ptr->waitActivity(activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClient::launchActivity(const QVariantHash &activity) +{ + return d_ptr->launchActivity(activity); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/hsactivitydbserver.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/hsactivitydbserver.pro Fri Apr 16 15:16:09 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: +# + +TEMPLATE = app +TARGET = hsactivitydbserver + +QT += core \ + gui \ + sql + +HEADERS += ../inc/hsactivitydbclientinterface.h \ + inc/hsactivity.h \ + inc/hsactivityserver.h \ + inc/hsactivitystorage.h \ + inc/hsactivitystorage_p.h + +SOURCES += src/hsactivityserver.cpp \ + src/hsactivitystorage.cpp \ + src/hsactivitystorage_p.cpp + +symbian{ +TARGET.UID3 = 0x200267B4 +HEADERS += ../s60/inc/hsactivityglobals.h \ + ../s60/inc/hsserializer.h \ + s60/inc/hsactivityserver_p.h \ + s60/inc/hsactivitysession_p.h + + +SOURCES += s60/src/main.cpp \ + ../s60/src/hsserializer.cpp \ + s60/src/hsactivityserver_p.cpp \ + s60/src/hsactivitysession_p.cpp + +TARGET.CAPABILITY = ALL -TCB +} + diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/inc/hsactivity.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivity.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,72 @@ +/* +* 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 HSACTIVITY_H +#define HSACTIVITY_H + + +const char ActivityOrganization [] = "nokia"; + +const char ActivityApplication [] = "hsactivitydbserver"; + +const char ActivityStorageDriver [] = "QSQLITE"; + +const char ActivityStorageName [] = "ActivitySQLClient"; + +const char ActivityStorageProperty [] = "activitydatabase"; + +const char ActivityDefaultStorage [] = "activitydatabase.db"; + +const char ActivityTableKeyword [] = ":Table"; +const char ActivityDataKeyword [] = ":Data"; + + + +const char ActivityCreateQuery [] = "CREATE TABLE Activities(" \ + "ApplicationId INTEGER NOT NULL," \ + "ActivityName TEXT NOT NULL," \ + "Data BLOB NOT NULL," \ + "PRIMARY KEY ( ApplicationId, ActivityName ) )"; + +const char ActivityDropQuery [] = "DROP TABLE :Table"; + +const char ActivitySelectActivityQuery [] = "SELECT ApplicationId FROM Activities WHERE " \ + "ApplicationId = :ApplicationId AND " \ + "ActivityName = :ActivityName"; + +const char ActivityUpdateActivityQuery [] = "UPDATE Activities SET Data = :Data WHERE " \ + "ApplicationId = :ApplicationId AND " \ + "ActivityName = :ActivityName"; + +const char ActivityInsertActivityQuery [] = "INSERT INTO Activities( ApplicationId, ActivityName, Data ) VALUES " \ + "( :ApplicationId, :ActivityName, :Data )"; + +const char ActivitySelectActiveQuery [] = "SELECT ActivityName FROM Activities WHERE " \ + "ApplicationId = :ApplicationId"; + +const char ActivityActivitiesQuery [] = "SELECT Data FROM Activities"; + +const char ActivityApplicationActivitiesQuery [] = "SELECT Data FROM Activities " \ + "WHERE ApplicationId = :ApplicationId"; + +const char ActivityDeleteActivityQuery [] = "DELETE FROM Activities WHERE " \ + "ApplicationId = :ApplicationId AND " \ + "ActivityName = :ActivityName"; + +const char ActivityDeleteApplicationActivitiesQuery [] = "DELETE FROM Activities WHERE " \ + "ApplicationId = :ApplicationId"; + +#endif //HSACTIVITY_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/inc/hsactivityserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivityserver.h Fri Apr 16 15:16:09 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 HSACTIVITYSERVER_H +#define HSACTIVITYSERVER_H + +#include "hsactivitydbclientinterface.h" + +class HsActivityServerPrivate; + +/** + * Class implemets server functionality to store and retrieve activity + */ +class HsActivityServer +{ +public: + /** + * Constructor + * @param storage - reference to initialized activity storage + */ + HsActivityServer(HsActivityDbClientInterface& storage); + + /** + * Destructor + */ + ~HsActivityServer(); + + /** + * Function establish server and initialize listening proces + * @return true on succees, false otherwise + */ + bool start(); +private: + /** + * Private server implementation + */ + HsActivityServerPrivate* d_ptr; +}; + +#endif //HSACTIVITYSERVER_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/inc/hsactivitystorage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivitystorage.h Fri Apr 16 15:16:09 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: +* +*/ +#ifndef HSACTIVITYSTORAGE_H +#define HSACTIVITYSTORAGE_H +#include "hsactivitydbclientinterface.h" +class HsActivityStoragePrivate; + +/** + * Class implements HsActivityDbClientInterface and storage functionality + */ +class HsActivityStorage: public HsActivityDbClientInterface +{ +public: + /** + * Constructor + */ + HsActivityStorage(); + + /** + * Destructor + */ + ~HsActivityStorage(); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::addActivity(const QVariantHash&) + */ + int addActivity(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash&) + */ + int updateActivity(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::removeActivity(const QVariantHash &) + */ + int removeActivity(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::removeApplicationActivities(const QVariantHash &) + */ + int removeApplicationActivities(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::activities(QList &) + */ + int activities(QList& result); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::applicationActivities(QList &, const QVariantHash &) + */ + int applicationActivities(QList& result, + const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &) + */ + int waitActivity(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &) + */ + int launchActivity(const QVariantHash &activity); +private: + /** + * Private storage implementation + * Own. + */ + HsActivityStoragePrivate* d_ptr; +}; +#endif //HSACTIVITYSTORAGE_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/inc/hsactivitystorage_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivitystorage_p.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,152 @@ +/* +* 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 HSACTIVITYSTORAGEPRIVATE_H +#define HSACTIVITYSTORAGEPRIVATE_H +#include "hsactivitydbclientinterface.h" +#include + +/** + * Class implements HsActivityDbClientInterface and storage functionality using + * database subsystem + */ +class HsActivityStoragePrivate: public HsActivityDbClientInterface +{ +public: + /** + * Constructor + */ + HsActivityStoragePrivate(); + + /** + * Destructor + */ + ~HsActivityStoragePrivate(); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::addActivity(const QVariantHash&) + */ + int addActivity(const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash&) + */ + int updateActivity(const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::removeActivity(const QVariantHash &) + */ + int removeActivity(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::removeApplicationActivities(const QVariantHash &) + */ + int removeApplicationActivities(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::requestedActivityName( QString &, const QVariantHash &) + */ + int requestedActivityName(QString& result, + const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::activities(QList &) + */ + int activities(QList &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::applicationActivities(QList &, const QVariantHash &) + */ + int applicationActivities(QList &, const QVariantHash &); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &) + */ + int waitActivity(const QVariantHash &activity); + + /** + * Interface implementation. + * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &) + */ + int launchActivity(const QVariantHash &activity); +private: + /** + * Function check database structure + * @return true if structure is valid, false otherwise + */ + bool checkTables(); + + /** + * Function create database structure + */ + void recreateTables(); + + /** + * Function return last SQL query error code + * @param querty - executed sql query + * @return SQL query error code + */ + int getSqlErrorCode(const QSqlQuery& query); + + /** + * Function exeute SQL query + * @param query - SQL + * @return true on succees, false otherwise + */ + bool exec(QSqlQuery& query); + + /** + * Function exeute SQL query + * @param query - SQL query that has to be executed + * @return true on succees, false otherwise + */ + bool exec(const QString &query, const QVariantHash& params); + + /** + * Funciton bind provided filtering rules with prepared SQL query + * @param query - SQL query + * @param activity - filtering rules + * @param additionalData - additional filetering rules + */ + void bind( QSqlQuery& query, + const QVariantHash &activity, + const QVariantHash &additionalData = QVariantHash()); + + /** + * Funciton get records that match conditions + * @param result - output destination + * @param query - SQL query sting + * @param conditions - query conditions + */ + int activities(QList &results, + const QString &query, + const QVariantHash &conditions); + +private: + /** + * Connectioin to SQL engine + */ + QSqlDatabase mConn; +}; +#endif //HSACTIVITYSTORAGEPRIVATE_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/s60/inc/hsactivityserver_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/s60/inc/hsactivityserver_p.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,77 @@ +/* +* 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 HSACTIVITYSERVERPRIVATE_H +#define HSACTIVITYSERVERPRIVATE_H + +#include +#include "hsactivitydbclientinterface.h" + +/** + * Class implemets server functionality for S60 enviroment + */ +class HsActivityServerPrivate : public CServer2 +{ +public: + /** + * Constructor + */ + HsActivityServerPrivate(HsActivityDbClientInterface& storage); + + /** + * Destructor + */ + ~HsActivityServerPrivate(); + + /** + * Function establish server and initialize listening proces + * @return true on succees, false otherwise + */ + bool start(); + + /** + * Function look for active application session and complete pending message + */ + void notifyL(int applicationId, const QString& activityName); + + /** + * Cancel notification + */ + void cancelNotify(int applicationId); + + /** + * Function add item to pending messages + */ + void waitNotification(int applicationId, const RMessage2& msg); +private: + /** + * Function create new client session to handle its request + * @param version - client implementation version + * @param message - request message + */ + CSession2* NewSessionL(const TVersion& version,const RMessage2& message)const; + +private: + /** + * Reference to initialized storage client + */ + HsActivityDbClientInterface& mStorage; + + QHash mPendingMessage; +}; + +#endif //HSACTIVITYSERVERPRIVATE_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/s60/inc/hsactivitysession_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/s60/inc/hsactivitysession_p.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,155 @@ +/* +* 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 ACTIVITYSESSIONPRIVATE_H +#define ACTIVITYSESSIONPRIVATE_H +#include +#include "hsactivitydbclientinterface.h" +/** + * Class impolements client session for S60 enviroment. + * Class is responsible for request handling and data translations + */ +class HsActivitySessionPrivate: public CSession2 +{ +public: + /** + * Constructor + * @param storage - reference to initialized activity storage + */ + HsActivitySessionPrivate(HsActivityDbClientInterface& storage); + + /** + * Destructor + */ + ~HsActivitySessionPrivate(); + + /** + * Implements interface + * @see void CSession2::ServiceL(const RMessage2&) + */ + void ServiceL(const RMessage2& message); + + /** + * Implements interface + * @see void CSession2::ServiceError(const RMessage2 &, TInt) + */ + void ServiceError(const RMessage2 &message, TInt error); + + void LaunchActivityL(const RMessage2 &message, const QString &name ); + + void CancelNotify(RMessage2& message); +private: + /** + * Function handle data translation and forward request to storage client + * Function can leave on failure. + * @param message - request message + */ + void HandleAddActivityL(const RMessage2& message); + + /** + * Function handle data translation and forward request to storage client + * Function can leave on failure. + * @param message - request message + */ + void HandleUpdateActivityL(const RMessage2& message); + + /** + * Function handle data translation and forward request to storage client + * Function can leave on failure. + * @param message - request message + */ + void HandleRemoveActivityL(const RMessage2& message); + + /** + * Function handle data translation and forward request to storage client + * Function can leave on failure. + * @param message - request message + */ + void HandleRemoveApplicationActivitiesL(const RMessage2& message); + + /** + * Function handle data translation and forward request to storage client + * Function can leave on failure. + * @param message - request message + */ + void HandleActivitiesL(const RMessage2& message); + + /** + * Function handle data translation and forward request to storage client + * Function can leave on failure. + * @param message - request message + */ + void HandleApplicationActivitiesL(const RMessage2& message); + + /** + * Function handle data translation and forward request to server + * Function can leave on failure. + * @param message - request message + */ + void HandleLaunchActivityL(const RMessage2& message); + + /** + * Function handle data translation and forward request to server + * Function can leave on failure. + * @param message - request message + */ + void HandleWaitActivityL(const RMessage2& message); + + /** + * Function cancels subscribtion + * @param message - request message + */ + void HandleCancelWaitActivity(const RMessage2& message); + + /** + * Function handle data translation and forward request to storage client + * Function can leave on failure. + * @param message - request message + */ + void HandleGetDataL(const RMessage2& message); + + void LaunchActivityL(); + + void WaitActivityL(const RMessage2& message); + + void CancelNotify(); + + + /** + * Function deserialize data for request message + * Function can leave on failure. + */ + void ReadDataL(const RMessage2& src); + + /** + * Function handle data translation and forward request to storage client + * Function can leave on failure. + * @param message - request message + */ + void LeaveIfNotZero(int errNo); +private: + /** + * Reference to storage client + */ + HsActivityDbClientInterface& mStorage; + RBuf8 mData; + QVariantHash mActivity; + QList mResult; + QString mName; + int mAppId; +}; +#endif // ACTIVITYSESSIONPRIVATE_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/s60/src/hsactivityserver_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/s60/src/hsactivityserver_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,97 @@ +/* +* 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: Application entry point +* +*/ +#include "hsactivityserver_p.h" +#include "hsactivitysession_p.h" +#include "hsactivityglobals.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityServerPrivate::HsActivityServerPrivate(HsActivityDbClientInterface& storage) +: + CServer2( EPriorityNormal, ESharableSessions), + mStorage(storage) +{ +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityServerPrivate::~HsActivityServerPrivate() +{ +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool HsActivityServerPrivate::start() +{ + return ( KErrNone == Start(KActivityServerName) ); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityServerPrivate::notifyL(int applicationId, + const QString& activityName) +{ + if(mPendingMessage.end() != mPendingMessage.find(applicationId)) { + static_cast(mPendingMessage.find(applicationId).value().Session()) + ->LaunchActivityL(mPendingMessage.find(applicationId).value(), activityName ); + mPendingMessage.erase(mPendingMessage.find(applicationId)); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityServerPrivate::waitNotification(int applicationId, + const RMessage2& msg) +{ + if(mPendingMessage.find(applicationId) != mPendingMessage.end()) { + msg.Kill(EBadMessageNumber); + } + mPendingMessage.insert(applicationId,msg); +} +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityServerPrivate::cancelNotify(int applicationId) + { + if(mPendingMessage.end() != mPendingMessage.find(applicationId)) + { + static_cast(mPendingMessage.find(applicationId).value().Session()) + ->CancelNotify(mPendingMessage.find(applicationId).value()); + mPendingMessage.erase(mPendingMessage.find(applicationId)); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CSession2* HsActivityServerPrivate::NewSessionL(const TVersion&, + const RMessage2&)const +{ + return new (ELeave) HsActivitySessionPrivate(mStorage); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/s60/src/hsactivitysession_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/s60/src/hsactivitysession_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,286 @@ +/* +* 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: Application entry point +* +*/ +#include "hsactivityserver_p.h" +#include "hsactivitysession_p.h" +#include "hsactivityglobals.h" +#include "hsserializer.h" +#include + +const char ActivityPrimaryKeyFormat [] = "%1:%2"; +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivitySessionPrivate::HsActivitySessionPrivate(HsActivityDbClientInterface& storage) +: mStorage(storage), mAppId(KErrNotFound) +{ +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivitySessionPrivate::~HsActivitySessionPrivate() +{ + CancelNotify(); + mData.Close(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::ServiceL(const RMessage2& message) +{ + mActivity.clear(); + mResult.clear(); + mName.clear(); + + int errNo(KErrNone); + switch(message.Function()) { + case AddActivity: HandleAddActivityL(message); break; + case UpdateActivity: HandleUpdateActivityL(message); break; + case RemoveActivity: HandleRemoveActivityL(message); break; + case RemoveApplicationActivities: HandleRemoveApplicationActivitiesL(message); break; + case Activities: HandleActivitiesL(message);break; + case ApplicationActivities: HandleApplicationActivitiesL(message);break; + case LaunchActivity: HandleLaunchActivityL(message);break; + case WaitActivity: HandleWaitActivityL(message);return; //!!!!! This message shouldn't be compleated !!!!! + case GetData: HandleGetDataL(message); break; + case CancelWait: HandleCancelWaitActivity(message); break; + default: + message.Panic(KErr400, CServer2::EBadMessageNumber); + } + message.Complete(KErrNone); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::ServiceError(const RMessage2 &message, TInt error) +{ + message.Complete(error); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::HandleAddActivityL(const RMessage2& message) +{ + ReadDataL(message); + LeaveIfNotZero(mStorage.addActivity(mActivity)); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::HandleUpdateActivityL(const RMessage2& message) +{ + ReadDataL(message); + LeaveIfNotZero(mStorage.updateActivity(mActivity)); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::HandleRemoveActivityL(const RMessage2& message) +{ + ReadDataL(message); + LeaveIfNotZero(mStorage.removeActivity(mActivity)); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::HandleRemoveApplicationActivitiesL(const RMessage2& message) +{ + ReadDataL(message); + LeaveIfNotZero(mStorage.removeApplicationActivities(mActivity)); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::HandleActivitiesL(const RMessage2& message) +{ + int errNo(KErrNone); + QT_TRYCATCH_LEAVING(errNo = mStorage.activities(mResult)); + LeaveIfNotZero(errNo); + mData << mResult; + TPckgC dataSize(mData.Size()); + message.WriteL(1, dataSize); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::HandleApplicationActivitiesL(const RMessage2& message) +{ + int errNo(KErrNone); + ReadDataL(message); + QT_TRYCATCH_LEAVING(errNo = mStorage.applicationActivities(mResult, mActivity)); + LeaveIfNotZero(errNo); + mData << mResult; + TPckgC dataSize(mData.Size()); + message.WriteL(1, dataSize); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::HandleLaunchActivityL(const RMessage2& message) +{ + ReadDataL(message); + LaunchActivityL(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::HandleWaitActivityL(const RMessage2& message) +{ + ReadDataL(message); + WaitActivityL(message); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::HandleCancelWaitActivity(const RMessage2& /*message*/) + { + CancelNotify(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::HandleGetDataL(const RMessage2& message) +{ + message.WriteL(0, mData); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::LaunchActivityL() +{ + CServer2* const server(const_cast(Server())); + if(mActivity.end() == mActivity.find(ActivityApplicationKeyword) || + mActivity.end() == mActivity.find(ActivityActivityKeyword)) { + User::Leave(KErrCorrupt); + } + static_cast + (server)->notifyL(mActivity.find(ActivityApplicationKeyword).value().toInt(), + mActivity.find(ActivityActivityKeyword).value().toString()); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::LaunchActivityL(const RMessage2 &message, + const QString &name ) +{ + if (mData.MaxSize() < name.toAscii().length()){ + mData.ReAlloc( name.toAscii().length()); + } + mData.Copy(reinterpret_cast(name.toAscii().data()), + name.toAscii().length()); + TPckgC dataSize(mData.Size()); + message.WriteL(1, dataSize); + message.Complete(KErrNone); +} +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::WaitActivityL(const RMessage2& msg) +{ + CServer2* const server(const_cast(Server())); + if(mActivity.end() == mActivity.find(ActivityApplicationKeyword)) { + User::Leave(KErrCorrupt); + } + mAppId = mActivity.find(ActivityApplicationKeyword).value().toInt(); + static_cast + (server)->waitNotification(mAppId, msg); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::CancelNotify() + { + if ( mAppId != KErrNotFound ) + { + CServer2* const server(const_cast(Server())); + static_cast(server)->cancelNotify(mAppId); + mAppId = KErrNotFound; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::CancelNotify(RMessage2& message) + { + message.Complete(KErrCancel); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::ReadDataL(const RMessage2& src) +{ + int srcLength = src.GetDesLength(0); + User::LeaveIfError(srcLength); + RBuf8 buffer; + CleanupClosePushL(buffer); + buffer.CreateL(srcLength); + src.ReadL( 0, buffer, 0); + if (buffer.Length() != srcLength) { + User::Leave(KErrCorrupt); + } + mActivity << buffer; + CleanupStack::PopAndDestroy(&buffer); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivitySessionPrivate::LeaveIfNotZero(int errNo) +{ + if (KErrNone != errNo) { + User::LeaveIfError(errNo); + User::Leave(KErrGeneral); + } +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/s60/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/s60/src/main.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,85 @@ +/* +* 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: Application entry point +* +*/ + +#include +#include +#include +#include +#include + +#include +#include + +#include "hsactivityserver.h" +#include "hsactivitystorage.h" + +class HsActivityMainAppUi : public QS60MainAppUi + { +public: + TBool FrameworkCallsRendezvous() const { + return EFalse; + } + }; + +class HsActivityMainDocument : public QS60MainDocument + { +public: + HsActivityMainDocument(CEikApplication &mainApplication):QS60MainDocument(mainApplication){} + + CEikAppUi *CreateAppUiL() { + return (static_cast (new(ELeave)HsActivityMainAppUi)); + } + }; + +class HsActivityApplication : public QS60MainApplication + { +protected: + CApaDocument *CreateDocumentL() { + return new (ELeave) HsActivityMainDocument(*this); + } + }; + +CApaApplication *newHsActivityApplication() +{ + return new HsActivityApplication; +} + +int main(int argc, char *argv[]) +{ + QApplication app(newHsActivityApplication, argc, argv); + HsActivityStorage storage; + HsActivityServer server(storage); + int retVal(KErrGeneral); + if( server.start() ){ + CEikonEnv * env = CEikonEnv::Static(); + if ( env ) { + CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(env->WsSession()); + wgName->SetHidden(ETrue); // hides us from FSW and protects us from OOM FW etc. + wgName->SetSystem(ETrue); // Allow only application with PowerManagement cap to shut us down + RWindowGroup &rootWindowGroup = env->RootWin(); + wgName->SetWindowGroupName(rootWindowGroup); + rootWindowGroup.SetOrdinalPosition(-1, ECoeWinPriorityNormal); //move to background. + CleanupStack::PopAndDestroy(); + } + RProcess::Rendezvous(KErrNone); + retVal = app.exec(); + }else + RProcess::Rendezvous(retVal); + return retVal; +} + + diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/src/hsactivityserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/hsactivityserver.cpp Fri Apr 16 15:16:09 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: Application entry point +* +*/ +#include "hsactivityserver.h" +#include "hsactivityserver_p.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityServer::HsActivityServer(HsActivityDbClientInterface& storage) +: + d_ptr(new HsActivityServerPrivate(storage)) +{ +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityServer::~HsActivityServer() +{ + delete d_ptr; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool HsActivityServer::start() +{ + return d_ptr->start(); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/src/hsactivitystorage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/hsactivitystorage.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,110 @@ +/* +* 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: Application entry point +* +*/ +#include "hsactivitystorage.h" +#include "hsactivitystorage_p.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityStorage::HsActivityStorage() +: +d_ptr(new HsActivityStoragePrivate()) +{ +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityStorage::~HsActivityStorage() +{ + delete d_ptr; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStorage::addActivity(const QVariantHash& activity) +{ + return d_ptr->addActivity(activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStorage::updateActivity(const QVariantHash& activity) +{ + return d_ptr->updateActivity(activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStorage::removeActivity(const QVariantHash& activity) +{ + return d_ptr->removeActivity(activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStorage::removeApplicationActivities(const QVariantHash& activity) +{ + return d_ptr->removeApplicationActivities(activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStorage::activities(QList& result) +{ + return d_ptr->activities(result); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStorage::applicationActivities(QList& result, + const QVariantHash &activity) +{ + return d_ptr->applicationActivities(result, activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStorage::waitActivity(const QVariantHash &activity) +{ + return d_ptr->waitActivity(activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStorage::launchActivity(const QVariantHash &activity) +{ + return d_ptr->launchActivity(activity); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/src/hsactivitystorage_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/hsactivitystorage_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,345 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include +#include +#include "hsactivitystorage_p.h" +#include "hsactivity.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityStoragePrivate::HsActivityStoragePrivate() +{ + // determine database localization + QSettings settings(ActivityOrganization, ActivityApplication); + settings.setValue(ActivityStorageProperty, ActivityDefaultStorage); + if (!settings.contains(ActivityStorageProperty)) { + settings.setValue(ActivityStorageProperty, ActivityDefaultStorage); + } + QString databaseFile = settings.value(ActivityStorageProperty).toString(); + + if (QSqlDatabase::contains(ActivityStorageName)) { + mConn = QSqlDatabase::database(ActivityStorageName); + } else { + mConn = QSqlDatabase::addDatabase(ActivityStorageDriver, ActivityStorageName); + mConn.setDatabaseName(databaseFile); + if (!mConn.open()) { + qWarning(qPrintable(mConn.lastError().text())); + return; + } + } + if (!checkTables()) { + recreateTables(); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HsActivityStoragePrivate::~HsActivityStoragePrivate() +{ + mConn.close(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStoragePrivate::addActivity(const QVariantHash &activity) +{ + // stream whole entry to bytearray + QByteArray streamedData; + QDataStream stream(&streamedData, QIODevice::WriteOnly); + stream << activity; + + //insert data + QSqlQuery query(mConn); + query.prepare(ActivitySelectActivityQuery); + bind(query, activity); + exec(query); + if(query.next()) { + return KErrGeneral; + } + query.prepare(ActivityInsertActivityQuery); + QVariantHash additionalData; + additionalData.insert(ActivityDataKeyword, streamedData); + bind(query, activity, additionalData); + exec(query); + return 0>=query.numRowsAffected() ? KErrGeneral : getSqlErrorCode(query); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStoragePrivate::updateActivity(const QVariantHash &activity) +{ + // stream whole entry to bytearray + QByteArray streamedData; + QDataStream stream(&streamedData, QIODevice::WriteOnly); + stream << activity; + + // update + QSqlQuery query(mConn); + query.prepare(ActivityUpdateActivityQuery); + QVariantHash additionalData; + additionalData.insert(ActivityDataKeyword, streamedData); + bind(query, activity, additionalData); + exec(query); + return 0>=query.numRowsAffected() ? KErrGeneral : getSqlErrorCode(query); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStoragePrivate::removeActivity(const QVariantHash &activity) +{ + return exec(ActivityDeleteActivityQuery, activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStoragePrivate::removeApplicationActivities(const QVariantHash &activity) +{ + return exec(ActivityDeleteApplicationActivitiesQuery, activity); +} +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStoragePrivate::requestedActivityName(QString& result, + const QVariantHash &activity) +{ + QSqlQuery query(mConn); + query.prepare(ActivitySelectActiveQuery); + bind(query, activity); + int retVal(KErrNone); + if (exec(query) && query.next()) { + result = query.value(0).toString(); + } else { + retVal = KErrNotFound; + } + return retVal; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStoragePrivate::activities(QList& result) +{ + return activities(result, ActivityActivitiesQuery, QVariantHash()); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStoragePrivate::applicationActivities(QList & result, + const QVariantHash & condition) +{ + return activities(result, ActivityApplicationActivitiesQuery, condition); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStoragePrivate::waitActivity(const QVariantHash &) +{ + return KErrNotSupported; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStoragePrivate::launchActivity(const QVariantHash &) +{ + return KErrNotSupported; +} +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool HsActivityStoragePrivate::checkTables() +{ + return (QStringList("Activities") == mConn.tables()); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityStoragePrivate::recreateTables() +{ + //start sql transaction + if (!mConn.transaction()) { + qErrnoWarning(qPrintable(mConn.lastError().text())); + return; + } + + // drop any existing tables + QSqlQuery query(mConn); + foreach (const QString &tableName, mConn.tables()) { + query.prepare(ActivityDropQuery); + query.bindValue(ActivityTableKeyword, tableName); + exec(query); + } + + // create new table + query.prepare(ActivityCreateQuery); + exec(query); + + //finish sql transaction + if (!mConn.commit()) { + qErrnoWarning(qPrintable(mConn.lastError().text())); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStoragePrivate::getSqlErrorCode(const QSqlQuery& query) +{ + const QSqlError err(query.lastError()); + const QString errStr(err.text()); + + if (QSqlError ::NoError == err.type()) { + return 0; + } else { + qErrnoWarning(qPrintable(errStr)); + return err.number(); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool HsActivityStoragePrivate::exec(QSqlQuery& query) +{ + const bool retVal = query.exec(); + qErrnoWarning(qPrintable(query.lastQuery())); + if (!retVal) { + getSqlErrorCode(query); + } + return retVal; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool HsActivityStoragePrivate::exec(const QString &queryStr, const QVariantHash& params) +{ + QSqlQuery query(mConn); + query.prepare(queryStr); + bind(query, params); + query.exec(); + return getSqlErrorCode(query); + +} +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HsActivityStoragePrivate::bind( QSqlQuery& query, + const QVariantHash &activity, + const QVariantHash &additionalData) +{ + const QChar tag(' '); + QString queryString( query.lastQuery() ); + QVariantHash::const_iterator iter; + int offset(0); + QStringList tokens; + + //explode SQL query to tokens + do { + offset = queryString.indexOf(tag, 0); + if (0 < offset) { + tokens << queryString.left(offset++); + queryString = queryString.right(queryString.length() - offset); + } else { + if (0 < queryString.length()) { + tokens << queryString; + } + break; + } + } while (true); + + //current Sql driver doesnt support proper query formating. + //reuest filtering data has to be binded in right order. + QStringList::iterator token = tokens.begin(); + //iterate all tokens + for (; token != tokens.end(); token = tokens.erase(token)) { + //iterate all provided data and chcek if it match pattern + for ( iter = activity.constBegin(); + iter != activity.constEnd(); + ++iter ) { + if( (*token).contains(iter.key()) ){ + query.bindValue(iter.key(), iter.value()); + break; + } + } + for (iter = additionalData.constBegin(); + iter != additionalData.constEnd(); + ++iter) { + if ((*token).contains(iter.key())) { + query.bindValue(iter.key(), iter.value()); + break; + } + } + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityStoragePrivate::activities(QList &results, + const QString &queryStr, + const QVariantHash &conditions) +{ + results.clear(); + + QSqlQuery query(mConn); + query.prepare(queryStr); + bind(query, conditions); + if (exec(query)) { + QVariantHash activityEntry; + while (query.next()) { + activityEntry.clear(); + QByteArray data(query.value(0).toByteArray()); + QDataStream stream(&data, QIODevice::ReadOnly); + stream >> activityEntry; + results.append(activityEntry); + } + } + return getSqlErrorCode(query); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/hsactivitydbserver/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/main.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,35 @@ +/* +* 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: Application entry point +* +*/ +#include +#include + +#include "hsactivityserver.h" +#include "hsactivitystorage.h" + + + +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + HsActivityStorage storage; + HsActivityServer server(storage); + int retVal(KErrGeneral); + if( server.start() ){ + retVal = app.exec(); + } + return retVal; +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/inc/hsactivitydbclientinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/inc/hsactivitydbclientinterface.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,104 @@ +/* +* 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 HSACTIVITYDBCLIENTINTERFACE_H +#define HSACTIVITYDBCLIENTINTERFACE_H +#include + +/** + * Enumerate supported functions + */ +enum ClientFunctions +{ + AddActivity =0, + UpdateActivity, + RemoveActivity, + RemoveApplicationActivities, + RequestedActivityName, + Activities, + ApplicationActivities, + WaitActivity, + LaunchActivity, + GetData, + CancelWait +}; + +const char ActivityApplicationKeyword [] = ":ApplicationId"; +const char ActivityActivityKeyword [] = ":ActivityName"; + +class HsActivityDbClientInterface +{ +public: + + /** + * Function save provided avtivity in activity storage + * @param activity - activity to store + * @return 0 on succees, error code otherwise + */ + virtual int addActivity(const QVariantHash &activity) =0; + + /** + * Function update exiting activity + * @param activity - filtering rules + * @return 0 on succees, error code otherwise + */ + virtual int updateActivity(const QVariantHash &activity) =0; + + /** + * Function delete activity + * @param activity - filtering rules + * @return 0 on succees, error code otherwise + */ + virtual int removeActivity(const QVariantHash &activity) =0; + + /** + * Function delete activity for application + * @param activity - filtering rules + * @return 0 on succees, error code otherwise + */ + virtual int removeApplicationActivities(const QVariantHash &activity) =0; + + /** + * Function return list of all activity + * @param result - destination list + * @return 0 on succees, error code otherwise + */ + virtual int activities(QList& result) =0; + + /** + * Function return list of all activity + * @param result - destination list, + * @param activity - filtering rules + * @return 0 on succees, error code otherwise + */ + virtual int applicationActivities(QList& result, + const QVariantHash &activity) =0; + + /** + * Function subscribe to activity + * @param activity - filtering rules + * @return 0 on succees, error code otherwise + */ + virtual int waitActivity(const QVariantHash &activity)=0; + + /** + * Function launch application activity + * @param activity - filtering rules + * @return 0 on succees, error code otherwise + */ + virtual int launchActivity(const QVariantHash &activity)=0; +}; +#endif //HSACTIVITYDBCLIENTINTERFACE_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/s60/inc/hsactivityglobals.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/s60/inc/hsactivityglobals.h Fri Apr 16 15:16:09 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: +* +*/ +#ifndef ACTIVITYSYMBIAN_H +#define ACTIVITYSYMBIAN_H + +#include +const TUid KActivityServerUid = {0x200267B4}; +_LIT( KActivityServerName, "hsactivitydbserver" ); +_LIT( KErr400, "Bad Reqest" ); +_LIT( KErr403, "Access denied" ); + +#endif diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/s60/inc/hsserializer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/s60/inc/hsserializer.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,40 @@ +/* +* 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 + +/** + * Operator serialize VarinatHash to RBuf8 + */ +RBuf8& operator <<(RBuf8& dst, const QVariantHash& src); + +/** + * Operator deserialize RBuf8 to VarinatHash + */ +QVariantHash& operator <<(QVariantHash& dst, const TDesC8& src); + +/** + * Operator serialize QList to RBuf8 + */ +RBuf8& operator <<(RBuf8& dst, const QList& src); + +/** + * Operator deserialize RBuf8 to QList + */ +QList& operator <<(QList& dst, const TDesC8& src); +#endif diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitydatabase/s60/src/hsserializer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/s60/src/hsserializer.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,82 @@ +/* +* 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 "hsserializer.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(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(src.Ptr()), + src.Length()) ); + + QDataStream stream(&buffer, QIODevice::ReadOnly); + QT_TRYCATCH_LEAVING(stream >> dst); + return dst; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +RBuf8& operator <<(RBuf8& dst, const QList& src) +{ + QByteArray buffer; + QDataStream stream(&buffer, QIODevice::WriteOnly); + + QT_TRYCATCH_LEAVING(stream << src); + + if( dst.MaxLength() < buffer.length() ) { + dst.ReAllocL(buffer.length()); + } + dst.Copy(reinterpret_cast(buffer.data()), buffer.length()); + return dst; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +QList& operator <<(QList& dst, const TDesC8& src) +{ + QByteArray buffer(QByteArray::fromRawData(reinterpret_cast(src.Ptr()), + src.Length())); + + QDataStream stream(&buffer, QIODevice::ReadOnly); + QT_TRYCATCH_LEAVING(stream >> dst); + return dst; +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityfw.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityfw.pro Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,32 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +CONFIG += ordered + +symbian:SUBDIRS += activitydatabase + +SUBDIRS += activityserviceplugin \ + activitylauncher \ + orbitintegration/hbactivityplugin + + + +tests:SUBDIRS += activityserviceplugin/unittests +symbian:SUBDIRS += activityserviceplugin/symbianinstaller + +symbian:include(rom.pri) \ No newline at end of file diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitylauncher/activitylauncher.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitylauncher/activitylauncher.pro Fri Apr 16 15:16:09 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: +# + +TEMPLATE = app + +TARGET = activitylauncher + +CONFIG += hb console mobility +MOBILITY = serviceframework + +SOURCES = main.cpp \ + activitylauncherview.cpp \ + +HEADERS = activitylauncherview.h \ + +symbian { + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB +} \ No newline at end of file diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitylauncher/activitylauncherview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitylauncher/activitylauncherview.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,107 @@ +/* +* 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 "activitylauncherview.h" + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +QTM_USE_NAMESPACE + +ActivityLauncherView::ActivityLauncherView(QGraphicsItem *parent) : HbView(parent), mModel(NULL), mActivityManager(NULL) +{ + QServiceManager serviceManager; + mActivityManager = serviceManager.loadInterface("com.nokia.qt.activities.ActivityManager"); + + if (!mActivityManager) { + qFatal("Cannot initialize critical com.nokia.qt.activities.ActivityManager service"); + } + + // create UI + setTitle(tr("Activity launcher")); + QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical); + QGraphicsLinearLayout* statusLayout = new QGraphicsLinearLayout(Qt::Horizontal); + mStatusLabel = new HbLabel(this); + mStatusLabel->setAlignment(Qt::AlignLeft); + statusLayout->setMaximumHeight(15); + + HbLabel* statusHeader = new HbLabel("Status: "); + statusHeader->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); + statusLayout->addItem(statusHeader); + statusLayout->addItem(mStatusLabel); + + HbGridView* activities = new HbGridView(); + connect(activities, SIGNAL(activated(QModelIndex)), this, SLOT(itemPressed(QModelIndex))); + activities->setRowCount(1); + activities->setColumnCount(1); + + activities->setScrollDirections(Qt::Horizontal); + + mModel = new QStandardItemModel(this); + activities->setModel(mModel); + + layout->addItem(statusLayout); + layout->addItem(activities); + + setLayout(layout); + qApp->installEventFilter(this); + getActivitiesList(); +} + +ActivityLauncherView::~ActivityLauncherView() +{ + delete mActivityManager; +} + +void ActivityLauncherView::getActivitiesList() +{ + mStatusLabel->setPlainText("Fetching activities"); + mCurrentActivities.clear(); + QMetaObject::invokeMethod(mActivityManager, "activitiesList", Q_RETURN_ARG(QList, mCurrentActivities)); + mModel->clear(); + + foreach(const QVariantHash& activityEntry, mCurrentActivities) { + QStandardItem* newItem = new QStandardItem(QIcon(activityEntry.value("screenshot").value()), QString("%1").arg(activityEntry.value(ActivityActivityKeyword).toInt())); + mModel->invisibleRootItem()->appendRow(newItem); + } + mStatusLabel->setPlainText(QString("Ready (%1 activities)").arg(mCurrentActivities.count())); +} + +bool ActivityLauncherView::eventFilter(QObject* obj, QEvent* event) +{ + if (event->type() == QEvent::ApplicationActivate) { + getActivitiesList(); + } + return QObject::eventFilter(obj, event); +} + +void ActivityLauncherView::itemPressed(const QModelIndex& index) +{ + QVariantHash activity = mCurrentActivities.at(index.row()); + int applicationId = activity.value(ActivityApplicationKeyword).toInt(); + QString activityName = activity.value(ActivityActivityKeyword).toString(); + QMetaObject::invokeMethod(mActivityManager, "launchActivity", Q_ARG(int, applicationId), Q_ARG(QString, activityName)); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitylauncher/activitylauncherview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitylauncher/activitylauncherview.h Fri Apr 16 15:16:09 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: +* +*/ +#ifndef ACTIVITYLAUNCHERVIEW_H +#define ACTIVITYLAUNCHERVIEW_H + +#include +#include + +class HbLabel; +class QStandardItemModel; + +class ActivityLauncherView : public HbView +{ + Q_OBJECT + +public: + ActivityLauncherView(QGraphicsItem *parent = 0); + ~ActivityLauncherView(); + +private slots: + void itemPressed(const QModelIndex& index); + +protected: + bool eventFilter(QObject* obj, QEvent* event); + +private: + void getActivitiesList(); + +private: + QStandardItemModel* mModel; + QList mCurrentActivities; + HbLabel* mStatusLabel; + + QObject* mActivityManager; +}; + +#endif // ACTIVITYLAUNCHERVIEW_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activitylauncher/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitylauncher/main.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include + +#include +#include + +#include "activitylauncherview.h" + +int main(int argc, char *argv[]) +{ + HbApplication app(argc, argv); + + HbMainWindow mainWindow; + ActivityLauncherView mainView; + mainWindow.addView(&mainView); + mainWindow.show(); + + return app.exec(); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activityclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activityclient.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,57 @@ +/* +* 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 "activityclient.h" +#include "activityclient_p.h" + +ActivityClient::ActivityClient(QObject *parent) : QObject(parent), d_ptr(new ActivityClientPrivate(this)) +{ +} + +ActivityClient::~ActivityClient() +{ +} + +bool ActivityClient::addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) +{ + return d_ptr->addActivity(activityId, data, parameters); +} + +bool ActivityClient::removeActivity(const QString &activityId) +{ + return d_ptr->removeActivity(activityId); +} + +bool ActivityClient::updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) +{ + return d_ptr->updateActivity(activityId, data, parameters); +} + +QList ActivityClient::activities() const +{ + return d_ptr->activities(); +} + +QVariant ActivityClient::activityData(const QString &activityId) const +{ + return d_ptr->activityData(activityId); +} + +bool ActivityClient::waitActivity() +{ + return d_ptr->waitActivity(); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activityclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activityclient.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef ACTIVITYCLIENT_H +#define ACTIVITYCLIENT_H + +#include +#include +#include + +class ActivityClientPrivate; + +class ActivityClient : public QObject +{ + +Q_OBJECT + +public: + ActivityClient(QObject *parent = 0); + ~ActivityClient(); + +public slots: + bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters); + bool removeActivity(const QString &activityId); + bool updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters); + QList activities() const; + QVariant activityData(const QString &activityId) const; + bool waitActivity(); + +signals: + void activityRequested(const QString &activityId); + +private: + ActivityClientPrivate *d_ptr; + friend class ActivityClientPrivate; + +}; + +#endif // ACTIVITYCLIENT_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activityclient_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activityclient_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "activityclient_p.h" +#include "activityclient.h" +#include "activitydatastorage.h" +#include + +#include +#include + +ActivityClientPrivate::ActivityClientPrivate(ActivityClient *q) : QObject(q) +{ + mDataStorage = new ActivityDataStorage(); + mServerClient = new HsActivityDbClient(); + mServerClient->connect(); + connect(mServerClient, SIGNAL(activityRequested(QString)), q, SIGNAL(activityRequested(QString))); +} + +ActivityClientPrivate::~ActivityClientPrivate() +{ + delete mServerClient; + delete mDataStorage; +} + +bool ActivityClientPrivate::addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) +{ + QVariantHash activity(parameters); + mDataStorage->addActivity(activityId, data); + RProcess process; + + activity.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); + activity.insert(ActivityActivityKeyword, activityId); + mServerClient->addActivity(activity); + + // @todo make those operations atomic + // @todo return real result + return true; +} + +bool ActivityClientPrivate::removeActivity(const QString &activityId) +{ + QVariantHash activity; + RProcess process; + activity.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); + activity.insert(ActivityActivityKeyword, activityId); + mDataStorage->removeActivity(activityId); + mServerClient->removeActivity(activity); + // @todo make those operations atomic + // @todo return real result + return true; +} + +bool ActivityClientPrivate::updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) +{ + QVariantHash activity(parameters); + RProcess process; + activity.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); + activity.insert(ActivityActivityKeyword, activityId); + mDataStorage->updateActivity(activityId, data); + mServerClient->updateActivity(activity); + // @todo make those operations atomic + // @todo return real result + return true; +} + +QList ActivityClientPrivate::activities() const +{ + QVariantHash activity; + RProcess process; + activity.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); + + QList activities; + + mServerClient->applicationActivities(activities, activity); + return activities; +} + +QVariant ActivityClientPrivate::activityData(const QString &activityId) const +{ + return mDataStorage->activityData(activityId); +} + +bool ActivityClientPrivate::waitActivity() +{ + RProcess process; + QVariantHash activity; + activity.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); + return !mServerClient->waitActivity(activity); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activityclient_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activityclient_p.h Fri Apr 16 15:16:09 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 ACTIVITYCLIENT_P_H +#define ACTIVITYCLIENT_P_H + +#include +#include +#include +#include + +class ActivityClient; +class ActivityDataStorage; +class ActivityServerClient; +class HsActivityDbClient; + +class ActivityClientPrivate : public QObject +{ + +Q_OBJECT + +public: + ActivityClientPrivate(ActivityClient *q); + ~ActivityClientPrivate(); + +public: + bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters); + bool removeActivity(const QString &activityId); + bool updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters); + QList activities() const; + QVariant activityData(const QString &activityId) const; + bool waitActivity(); + + +private: + ActivityClient* q_ptr; + ActivityDataStorage* mDataStorage; + HsActivityDbClient* mServerClient; +}; + +#endif // ACTIVITYCLIENT_P_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activitydatastorage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activitydatastorage.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,171 @@ +/* +* 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 "activitydatastorage.h" + +#include +#include +#include +#include + +const char KConnectionName[] = "ActivityDataStorage"; + +ActivityDataStorage::ActivityDataStorage() +{ + QSqlDatabase database; + if (QSqlDatabase::contains(KConnectionName)) { + database = QSqlDatabase::database(KConnectionName); + } else { + database = QSqlDatabase::addDatabase("QSQLITE", KConnectionName); + database.setDatabaseName("activitydatastorage.db"); + if (!database.open()) { + qFatal(qPrintable(database.lastError().text())); + } + } + + if (!checkTables()) { + recreateTables(); + } +} + +ActivityDataStorage::~ActivityDataStorage() +{ + QSqlDatabase::database(KConnectionName).close(); +} + +bool ActivityDataStorage::addActivity(const QString &activityId, const QVariant &data) +{ + QSqlDatabase database = QSqlDatabase::database(KConnectionName); + + QByteArray streamedData; + { + QDataStream stream(&streamedData, QIODevice::WriteOnly); + stream << data; + } + + // insert data + QSqlQuery query(database); + if (!query.prepare("INSERT INTO Activities(Name, Data) VALUES(:Name, :Data)")) { + qCritical(qPrintable(query.lastError().text())); + return false; + } + query.bindValue(":Name", activityId); + query.bindValue(":Data", streamedData); + if (!query.exec()) { + qCritical(qPrintable(query.lastError().text())); + return false; + } + + return true; +} + +bool ActivityDataStorage::removeActivity(const QString &activityId) +{ + QString sqlCommand = QString("DELETE FROM Activities WHERE Name = '%1'").arg(activityId); + QSqlQuery query(QSqlDatabase::database(KConnectionName)); + if (!query.exec(sqlCommand)) { + qCritical(qPrintable(query.lastError().text())); + return false; + } + return query.numRowsAffected() > 0; +} + +bool ActivityDataStorage::updateActivity(const QString &activityId, const QVariant &data) +{ + QSqlDatabase database = QSqlDatabase::database(KConnectionName); + + QByteArray streamedData; + { + QDataStream stream(&streamedData, QIODevice::WriteOnly); + stream << data; + } + + // update data + QSqlQuery query(database); + if (!query.prepare("UPDATE Activities SET Data = :Data WHERE Name = :Name")) { + qCritical(qPrintable(query.lastError().text())); + return false; + } + query.bindValue(":Data", streamedData); + query.bindValue(":Name", activityId); + if (!query.exec()) { + qCritical(qPrintable(query.lastError().text())); + return false; + } + + return query.numRowsAffected() > 0; +} + +QVariant ActivityDataStorage::activityData(const QString &activityId) const +{ + QSqlDatabase database = QSqlDatabase::database(KConnectionName); + QSqlQuery query(database); + if (!query.exec(QString("SELECT Data FROM Activities WHERE Name = '%1'").arg(activityId))) { + qCritical(qPrintable(query.lastError().text())); + return QVariant(); + } + + QVariant result; + if (query.next()) { + QByteArray data(query.value(0).toByteArray()); + QDataStream stream(&data, QIODevice::ReadOnly); + stream >> result; + } + return result; +} + +bool ActivityDataStorage::checkTables() +{ + QStringList expectedTables("Activities"); + QStringList actualTables = QSqlDatabase::database(KConnectionName).tables(); + return (expectedTables == actualTables); +} + +void ActivityDataStorage::recreateTables() +{ + QSqlDatabase database = QSqlDatabase::database(KConnectionName); + + if (!database.transaction()) { + qFatal(qPrintable(database.lastError().text())); + } + + // drop any existing tables + { + QSqlQuery dropQuery(database); + foreach(const QString &tableName, database.tables()) { + if (!dropQuery.exec(QString("DROP TABLE %1").arg(tableName))) { + qFatal(qPrintable(dropQuery.lastError().text())); + } + } + } + + // create new table + { + QSqlQuery createQuery(database); + QString statement( + "CREATE TABLE Activities(" + "Name TEXT NOT NULL PRIMARY KEY UNIQUE," + "Data BLOB NOT NULL)"); + + if (!createQuery.exec(statement)) { + qFatal(qPrintable(createQuery.lastError().text())); + } + } + + if (!database.commit()) { + qFatal(qPrintable(database.lastError().text())); + } +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activitydatastorage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activitydatastorage.h Fri Apr 16 15:16:09 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 ACTIVITYDATASTORAGE_H +#define ACTIVITYDATASTORAGE_H + +#include +#include + +class ActivityDataStorage +{ + +public: + ActivityDataStorage(); + ~ActivityDataStorage(); + +public: + bool addActivity(const QString &activityId, const QVariant &data); + bool removeActivity(const QString &activityId); + bool updateActivity(const QString &activityId, const QVariant &data); + QVariant activityData(const QString &activityId) const; + +private: + bool checkTables(); + void recreateTables(); + +}; + +#endif // ACTIVITYDATASTORAGE_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activitymanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activitymanager.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "activitymanager.h" +#include "activitymanager_p.h" + +ActivityManager::ActivityManager(QObject *parent) : QObject(parent), d_ptr(new ActivityManagerPrivate(this)) +{ +} + +ActivityManager::~ActivityManager() +{ +} + +QList ActivityManager::activitiesList() +{ + return d_ptr->activitiesList(); +} + +void ActivityManager::launchActivity(const QString &uri) +{ + d_ptr->launchActivity(uri); +} + +void ActivityManager::launchActivity(int applicationId, const QString &activityId) +{ + d_ptr->launchActivity(applicationId, activityId); +} + +void ActivityManager::removeActivity(int applicationId, const QString &activityId) +{ + d_ptr->removeActivity(applicationId, activityId); +} + +void ActivityManager::removeApplicationActivities(int applicationId) +{ + d_ptr->removeApplicationActivities(applicationId); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activitymanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activitymanager.h Fri Apr 16 15:16:09 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 ACTIVITYMANAGER_H +#define ACTIVITYMANAGER_H + +#include +#include +#include + +class ActivityManagerPrivate; + +class ActivityManager : public QObject +{ + +Q_OBJECT + +public: + ActivityManager(QObject *parent = 0); + ~ActivityManager(); + +public slots: + QList activitiesList(); + void launchActivity(const QString &uri); + void launchActivity(int applicationId, const QString &activityId); + void removeActivity(int applicationId, const QString &activityId); + void removeApplicationActivities(int applicationId); + +private: + ActivityManagerPrivate *d_ptr; + + friend class ActivityManagerPrivate; + +}; + +#endif // ACTIVITYMANAGER_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activitymanager_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activitymanager_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,83 @@ +/* +* 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 "activitymanager_p.h" +#include "activitymanager.h" +#include + +#include +#include + +ActivityManagerPrivate::ActivityManagerPrivate(ActivityManager *q) : QObject(q), q_ptr(q) +{ + mServerClient = new HsActivityDbClient(); + mServerClient->connect(); +} + +ActivityManagerPrivate::~ActivityManagerPrivate() +{ + delete mServerClient; +} + +QList ActivityManagerPrivate::activitiesList() +{ + QList retVal; + mServerClient->activities(retVal); + return retVal; +} + +void ActivityManagerPrivate::launchActivity(const QString &uri) +{ + // @todo use the same parser as in HbApplicationPrivate (if possible) + QRegExp uriMatcher("^appto://(.+)\\?activityname=(.+)$"); + if (uriMatcher.indexIn(uri) != -1) { + QStringList list = uriMatcher.capturedTexts(); + Q_ASSERT(list.count() == 3); + launchActivity(list.at(1).toInt(), list.at(2)); + } else { + qWarning("Activity URI parsing error"); + } +} + +void ActivityManagerPrivate::launchActivity(int applicationId, const QString &activityId) +{ + + ApplicationLauncher applicationLauncher; + if(applicationLauncher.isRunning(applicationId)) { + QVariantHash activity; + activity.insert(ActivityApplicationKeyword, applicationId); + activity.insert(ActivityActivityKeyword, activityId); + mServerClient->launchActivity(activity); + applicationLauncher.bringToForeground(applicationId); + } else { + applicationLauncher.startApplication(applicationId, activityId); + } +} + +void ActivityManagerPrivate::removeActivity(int applicationId, const QString &activityId) +{ + QVariantHash activity; + activity.insert(ActivityApplicationKeyword, applicationId); + activity.insert(ActivityActivityKeyword, activityId); + mServerClient->removeActivity(activity); +} + +void ActivityManagerPrivate::removeApplicationActivities(int applicationId) +{ + QVariantHash activity; + activity.insert(ActivityApplicationKeyword, applicationId); + mServerClient->removeApplicationActivities(activity); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activitymanager_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activitymanager_p.h Fri Apr 16 15:16:09 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: +* +*/ +#ifndef ACTIVITYMANAGER_P_H +#define ACTIVITYMANAGER_P_H + +#include +#include +#include +#include "applicationlauncher.h" + +class ActivityManager; +class HsActivityDbClient; + +class ActivityManagerPrivate : public QObject +{ + +Q_OBJECT + +public: + ActivityManagerPrivate(ActivityManager *q); + ~ActivityManagerPrivate(); + +public slots: + QList activitiesList(); + void launchActivity(const QString &uri); + void launchActivity(int applicationId, const QString &activityId); + void removeActivity(int applicationId, const QString &activityId); + void removeApplicationActivities(int applicationId); + +private: + ActivityManager *q_ptr; + HsActivityDbClient *mServerClient; + + +}; + +#endif // ACTIVITYMANAGER_P_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activityserviceplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activityserviceplugin.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "activityserviceplugin.h" + +#include +#include +#include + +#include "activityclient.h" +#include "activitymanager.h" + +QObject* ActivityServicePlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == "com.nokia.qt.activities.ActivityClient") { + return new ActivityClient(); + } else if (descriptor.interfaceName() == "com.nokia.qt.activities.ActivityManager") { + return new ActivityManager(); + } else { + return NULL; + } +} + +Q_EXPORT_PLUGIN2(activityserviceplugin, ActivityServicePlugin) diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activityserviceplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activityserviceplugin.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,35 @@ +/* +* 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 ACTIVITYSERVICEPLUGIN_H +#define ACTIVITYSERVICEPLUGIN_H + +#include +#include + +QTM_USE_NAMESPACE + +class ActivityServicePlugin : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject* createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session); + +}; + +#endif //ACTIVITYSERVICEPLUGIN_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activityserviceplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activityserviceplugin.pri Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,20 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +CONFIG += mobility +MOBILITY = serviceframework + +QT += sql diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activityserviceplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activityserviceplugin.pro Fri Apr 16 15:16:09 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: +# + +TEMPLATE = lib +TARGET = activityserviceplugin + +CONFIG += plugin +include(activityserviceplugin.pri) + +HEADERS += activityserviceplugin.h \ + activitydatastorage.h \ + activityclient.h \ + activityclient_p.h \ + activitymanager.h \ + activitymanager_p.h \ + applicationlauncher.h \ + +SOURCES += activityserviceplugin.cpp \ + activitydatastorage.cpp \ + activityclient.cpp \ + activityclient_p.cpp \ + activitymanager.cpp \ + activitymanager_p.cpp \ + applicationlauncher.cpp \ + +symbian { + INCLUDEPATH += ./s60/ + SOURCES += ./s60/applicationlauncher_p.cpp + + HEADERS += ./s60/applicationlauncher_p.h + + LIBS += -lhsactivitydbclient \ + -lxqutils \ + +} + +win32 { + INCLUDEPATH += ./win/ + SOURCES += ./win/applicationlauncher_p.cpp + + HEADERS += ./win/applicationlauncher_p.h +} + +symbian { + load(data_caging_paths) + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = ALL -TCB + + plugin.sources = activityserviceplugin.dll + plugin.path = $$QT_PLUGINS_BASE_DIR +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/activityserviceplugin.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/activityserviceplugin.xml Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,16 @@ + + + ActivityService + activityserviceplugin + Activities service + + com.nokia.qt.activities.ActivityClient + 1.0 + Implementation of ActivityClient + + + com.nokia.qt.activities.ActivityManager + 1.0 + Implementation of ActivityManager + + diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/applicationlauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/applicationlauncher.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,43 @@ +/* +* 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 "applicationlauncher.h" +#include "applicationlauncher_p.h" + +ApplicationLauncher::ApplicationLauncher() : d_ptr(new ApplicationLauncherPrivate()) +{ +} + +ApplicationLauncher::~ApplicationLauncher() +{ + delete d_ptr; +} + +bool ApplicationLauncher::isRunning(int applicationId) +{ + return d_ptr->isRunning(applicationId); +} + +void ApplicationLauncher::startApplication(int applicationId, const QString &activityId) +{ + d_ptr->startApplication(applicationId, activityId); +} + +void ApplicationLauncher::bringToForeground(int applicationId) +{ + d_ptr->bringToForeground(applicationId); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/applicationlauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/applicationlauncher.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef APPLICATIONLAUNCHER_H +#define APPLICATIONLAUNCHER_H + +class ApplicationLauncherPrivate; + +#include + +class ApplicationLauncher +{ + +public: + ApplicationLauncher(); + ~ApplicationLauncher(); + +public: + bool isRunning(int applicationId); + void startApplication(int applicationId, const QString &activityId); + void bringToForeground(int applicationId); + +private: + ApplicationLauncherPrivate *d_ptr; + +}; + +#endif // APPLICATIONLAUNCHER_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/s60/activitydatabase_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/s60/activitydatabase_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,102 @@ +/* +* 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 "activitydatabase_p.h" + +#include +#include +#include +#include +#include + + + +ActivityDatabasePrivate::ActivityDatabasePrivate() +{ + mClient.connect(); +} + +ActivityDatabasePrivate::~ActivityDatabasePrivate() +{ +} + +void ActivityDatabasePrivate::saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata) +{ + QVariantHash request(activityMetadata); + request.insert(ActivityApplicationKeyword,applicationName); + request.insert(ActivityActivityKeyword,activityName); + mClient.saveActivity(request); + +} + +void ActivityDatabasePrivate::deleteActivity(const QString &applicationName, const QString &activityName) +{ + QVariantHash request; + request.insert(ActivityApplicationKeyword,applicationName); + request.insert(ActivityActivityKeyword,activityName); + mClient.deleteActivity(request); +} + +void ActivityDatabasePrivate::deleteApplicationActivities(const QString &applicationName) +{ + QVariantHash request; + request.insert(ActivityApplicationKeyword,applicationName); + mClient.deleteApplicationActivities(request); +} + +QList ActivityDatabasePrivate::allActivitiesList() +{ + QList retVal; + mClient.activities(retVal); + return retVal; +} + +QList ActivityDatabasePrivate::applicationActivitiesList(const QString & applicationName) +{ + QList result; + QVariantHash request; + request.insert(ActivityApplicationKeyword,applicationName); + mClient.applicationActivities(result, request); + return result; +} + + +QString ActivityDatabasePrivate::requestedActivityName(const QString &applicationName) +{ + QString result; + QVariantHash request; + request.insert(ActivityApplicationKeyword,applicationName); + mClient.requestedActivityName(result, request); + return result; +} + +void ActivityDatabasePrivate::setActivityRequestFlag(const QString &applicationName, const QString &activityName) +{ + QVariantHash request; + request.insert(ActivityApplicationKeyword,applicationName); + request.insert(ActivityActivityKeyword,activityName); + mClient.setActivityRequestFlag(request); +} + +void ActivityDatabasePrivate::clearActivityRequestFlag(const QString &applicationName, const QString &activityName) +{ + QVariantHash request; + request.insert(ActivityApplicationKeyword,applicationName); + request.insert(ActivityActivityKeyword,activityName); + mClient.clearActivityRequestFlag(request); +} + diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/s60/activitydatabase_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/s60/activitydatabase_p.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,43 @@ +/* +* 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 ACTIVITYDATABASE_P_H +#define ACTIVITYDATABASE_P_H + +#include +#include +#include +class ActivityDatabasePrivate { + +public: + ActivityDatabasePrivate(); + ~ActivityDatabasePrivate(); + +public: + void saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata); + void deleteActivity(const QString &applicationName, const QString &activityName); + void deleteApplicationActivities(const QString &applicationName); + QList allActivitiesList(); + QList applicationActivitiesList(const QString &applicationName); + QString requestedActivityName(const QString &applicationName); + void setActivityRequestFlag(const QString &applicationName, const QString &activityName); + void clearActivityRequestFlag(const QString &applicationName, const QString &activityName); + +private: + HsActivityDbClient mClient; +}; + +#endif // ACTIVITYDATABASE_P_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/s60/activityserverclient_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/s60/activityserverclient_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,57 @@ +/* +* 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 "activityserverclient_p.h" + +ActivityServerClientPrivate::ActivityServerClientPrivate() +{ +} + +bool ActivityServerClientPrivate::addActivity(const QString &activityId, const QVariantHash ¶meters) +{ + return true; +} + +bool ActivityServerClientPrivate::removeActivity(const QString &activityId) +{ + return true; +} + +bool ActivityServerClientPrivate::updateActivity(const QString &activityId, const QVariantHash ¶meters) +{ + return true; +} + +QList ActivityServerClientPrivate::applicationActivities() +{ + return QList(); +} + +bool ActivityServerClientPrivate::removeActivity(int applicationId, const QString &activityId) +{ + return true; +} + +bool ActivityServerClientPrivate::removeApplicationActivities(int applicationId) +{ + return true; +} + +QList ActivityServerClientPrivate::activities() +{ + return QList(); +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/s60/activityserverclient_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/s60/activityserverclient_p.h Fri Apr 16 15:16:09 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 ACTIVITYSERVERCLIENT_P_H +#define ACTIVITYSERVERCLIENT_P_H + +#include +#include + +class ActivityServerClient; + +class ActivityServerClientPrivate +{ + +public: + ActivityServerClientPrivate(); + +public: // API used by ActivityClient + bool addActivity(const QString &activityId, const QVariantHash ¶meters); + bool removeActivity(const QString &activityId); + bool updateActivity(const QString &activityId, const QVariantHash ¶meters); + QList applicationActivities(); + +public: // API used by ActivityManager + bool removeActivity(int applicationId, const QString &activityId); + bool removeApplicationActivities(int applicationId); + QList activities(); + +public: + ActivityServerClient* q_ptr; + +}; + +#endif // ACTIVITYSERVERCLIENT_P_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/s60/applicationlauncher_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/s60/applicationlauncher_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,73 @@ +/* +* 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 "applicationlauncher_p.h" + +#include +#include +#include +#include + +#include + +bool ApplicationLauncherPrivate::isRunning(int applicationId) +{ + TApaTaskList taskList(CEikonEnv::Static()->WsSession()); + TApaTask task = taskList.FindApp(TUid::Uid(applicationId)); + return task.Exists(); +} + +void ApplicationLauncherPrivate::startApplication(int applicationId, const QString &activityId) +{ + QString actId = "\""+activityId+"\""; + QString uri = QString("-activity appto://%1?activityname=%2").arg(uint(applicationId), 8, 16, QChar('0')).arg(actId); + + QT_TRAP_THROWING( + { + HBufC* uriAsDescriptor = XQConversions::qStringToS60Desc(uri); + CleanupStack::PushL(uriAsDescriptor); + + RApaLsSession apaLsSession; + User::LeaveIfError(apaLsSession.Connect()); + CleanupClosePushL(apaLsSession); + + TApaAppInfo appInfo; + TInt retVal = apaLsSession.GetAppInfo(appInfo, TUid::Uid(applicationId)); + + if(retVal == KErrNone) { + RProcess application; + User::LeaveIfError(application.Create(appInfo.iFullName, *uriAsDescriptor)); + application.Resume(); + } else { + // @todo + } + + CleanupStack::PopAndDestroy(&apaLsSession); + CleanupStack::PopAndDestroy(uriAsDescriptor); + } + ); +} + +void ApplicationLauncherPrivate::bringToForeground(int applicationId) +{ + TApaTaskList taskList(CEikonEnv::Static()->WsSession()); + TApaTask task = taskList.FindApp(TUid::Uid(applicationId)); + if (task.Exists()) { + task.BringToForeground(); + } else { + qCritical("Cannot bring to forward task %08x", applicationId); + } +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/s60/applicationlauncher_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/s60/applicationlauncher_p.h Fri Apr 16 15:16:09 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 APPLICATIONLAUNCHER_P_H +#define APPLICATIONLAUNCHER_P_H + +#include + +class ApplicationLauncherPrivate +{ + +public: + bool isRunning(int applicationId); + void startApplication(int applicationId, const QString &activityId); + void bringToForeground(int applicationId); + +}; + +#endif // APPLICATIONLAUNCHER_P_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +QTM_USE_NAMESPACE + +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + + QServiceManager manager; + bool ok = manager.addService(":/activityserviceplugin.xml"); + if ( !ok ) + { + int err = manager.error(); + qFatal("%d ini", err); + } +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.pro Fri Apr 16 15:16:09 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: +# + +TEMPLATE = app + +QT = core +#CONFIG += no_icon + +CONFIG += mobility +MOBILITY = serviceframework + +SOURCES += activityserviceinstaller.cpp + +RESOURCES += activityserviceinstaller.qrc + +symbian { + TARGET.CAPABILITY = ALL -TCB +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.qrc Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,5 @@ + + + ../../activityserviceplugin.xml + + diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/symbianinstaller/symbianinstaller.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/symbianinstaller/symbianinstaller.pro Fri Apr 16 15:16:09 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: +# + +TEMPLATE = subdirs +SUBDIRS = activityserviceinstaller + +symbian { + load(data_caging_paths) + + plugin.sources = activityserviceplugin.dll + plugin.path = $$QT_PLUGINS_BASE_DIR + + installer.pkg_postrules += "\"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/activityserviceinstaller.exe\" \ + - \"!:\sys\bin\activityserviceinstaller.exe\",FR,RB,RW" + + DEPLOYMENT += plugin installer +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/win/activitydatabase_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/win/activitydatabase_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,249 @@ +/* +* 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 "activitydatabase_p.h" + +#include +#include +#include +#include +#include + +#include + +const char KConnectionName[] = "ActivityDatabase"; + +ActivityDatabasePrivate::ActivityDatabasePrivate() +{ + // determine database localization + QSettings settings("nokia", "activities"); + if (!settings.contains("activitydatabase")) { + settings.setValue("activitydatabase", "C:\\activitydatabase.db"); + } + QString databaseFile = settings.value("activitydatabase").toString(); + + QSqlDatabase database; + if (QSqlDatabase::contains(KConnectionName)) { + database = QSqlDatabase::database(KConnectionName); + } else { + database = QSqlDatabase::addDatabase("QSQLITE", KConnectionName); + database.setDatabaseName(databaseFile); + if (!database.open()) { + qFatal(qPrintable(database.lastError().text())); + } + } + + if (!checkTables()) { + recreateTables(); + } +} + +ActivityDatabasePrivate::~ActivityDatabasePrivate() +{ + QSqlDatabase::database(KConnectionName).close(); +} + +void ActivityDatabasePrivate::saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata) +{ + if (applicationName.isEmpty() || activityName.isEmpty() || activityMetadata.value("screenshot").isNull()) { + qWarning("Activity entry is invalid, aborting save"); + return; + } + + QVariantHash activityData(activityMetadata); + activityData.insert(ActivityApplicationKeyword, applicationName); + activityData.insert(ActivityActivityKeyword, activityName); + + // stream whole entry to bytearray + QByteArray streamedData; + { + QDataStream stream(&streamedData, QIODevice::WriteOnly); + stream << activityData; + } + + QSqlDatabase database = QSqlDatabase::database(KConnectionName); + + if (!database.transaction()) { + qFatal(qPrintable(database.lastError().text())); + } + + // update or insert data + { + QSqlQuery query(database); + if (!query.exec(QString("SELECT ApplicationName FROM Activities WHERE ApplicationName = '%1' AND ActivityName = '%2'").arg(applicationName).arg(activityName))) { + qFatal(qPrintable(query.lastError().text())); + } + + if (query.next()) { + if (!query.prepare("UPDATE Activities SET Data = :Data WHERE ApplicationName = :ApplicationName AND ActivityName = :ActivityName")) { + qFatal(qPrintable(query.lastError().text())); + } + query.bindValue(":Data", streamedData); + query.bindValue(":ApplicationName", applicationName); + query.bindValue(":ActivityName", activityName); + if (!query.exec()) { + qFatal(qPrintable(query.lastError().text())); + } + } else { + if (!query.prepare("INSERT INTO Activities(ApplicationName, ActivityName, Data) VALUES(:ApplicationName, :ActivityName, :Data)")) { + qFatal(qPrintable(query.lastError().text())); + } + query.bindValue(":ApplicationName", applicationName); + query.bindValue(":ActivityName", activityName); + query.bindValue(":Data", streamedData); + if (!query.exec()) { + qFatal(qPrintable(query.lastError().text())); + } + } + } + + if (!database.commit()) { + qFatal(qPrintable(database.lastError().text())); + } +} + +void ActivityDatabasePrivate::deleteActivity(const QString &applicationName, const QString &activityName) +{ + QString sqlCommand = QString("DELETE FROM Activities WHERE ApplicationName = '%1' AND ActivityName = '%2'").arg(applicationName).arg(activityName); + QSqlQuery query(QSqlDatabase::database(KConnectionName)); + if (!query.exec(sqlCommand)) { + qFatal(qPrintable(query.lastError().text())); + } +} + +void ActivityDatabasePrivate::deleteApplicationActivities(const QString &applicationName) +{ + QString sqlCommand = QString("DELETE FROM Activities WHERE ApplicationName = '%1'").arg(applicationName); + QSqlQuery query(QSqlDatabase::database(KConnectionName)); + if (!query.exec(sqlCommand)) { + qFatal(qPrintable(query.lastError().text())); + } +} + +QList ActivityDatabasePrivate::allActivitiesList() +{ + return activitiesList("SELECT Data FROM Activities"); +} + +QList ActivityDatabasePrivate::applicationActivitiesList(const QString &applicationName) +{ + return activitiesList(QString("SELECT Data FROM Activities WHERE ApplicationName = '%1'").arg(applicationName)); +} + +QList ActivityDatabasePrivate::activitiesList(const QString& sqlCommand) +{ + QSqlQuery query(QSqlDatabase::database(KConnectionName)); + if (!query.exec(sqlCommand)) { + qFatal(qPrintable(query.lastError().text())); + } + + QList result; + while (query.next()) { + QVariantHash activityEntry; + { + QByteArray data(query.value(0).toByteArray()); + QDataStream stream(&data, QIODevice::ReadOnly); + stream >> activityEntry; + } + result.append(activityEntry); + } + return result; +} + +QString ActivityDatabasePrivate::requestedActivityName(const QString &applicationName) +{ + QSqlQuery query(QSqlDatabase::database(KConnectionName)); + if (!query.exec(QString("SELECT ActivityName FROM Activities WHERE ApplicationName = '%1' AND RequestFlag").arg(applicationName))) { + qFatal(qPrintable(query.lastError().text())); + } + + QString result; + if (query.next()) { + result = query.value(0).toString(); + } + return result; +} + +void ActivityDatabasePrivate::setActivityRequestFlag(const QString &applicationName, const QString &activityName) +{ + QSqlQuery query(QSqlDatabase::database(KConnectionName)); + + // clear old requests for given application + if (!query.exec(QString("UPDATE Activities SET RequestFlag=0 WHERE ApplicationName = '%1'").arg(applicationName))) { + qFatal(qPrintable(query.lastError().text())); + } + + // set new request + if (!query.exec(QString("UPDATE Activities SET RequestFlag=1 WHERE ApplicationName = '%1' AND ActivityName = '%2'").arg(applicationName).arg(activityName))) { + qFatal(qPrintable(query.lastError().text())); + } +} + +void ActivityDatabasePrivate::clearActivityRequestFlag(const QString &applicationName, const QString &activityName) +{ + QSqlQuery query(QSqlDatabase::database(KConnectionName)); + + // just clear the given request + if (!query.exec(QString("UPDATE Activities SET RequestFlag=0 WHERE ApplicationName = '%1' AND ActivityName = '%2'").arg(applicationName).arg(activityName))) { + qFatal(qPrintable(query.lastError().text())); + } +} + +bool ActivityDatabasePrivate::checkTables() +{ + QStringList expectedTables("Activities"); + QStringList actualTables = QSqlDatabase::database(KConnectionName).tables(); + return (expectedTables == actualTables); +} + +void ActivityDatabasePrivate::recreateTables() +{ + QSqlDatabase database = QSqlDatabase::database(KConnectionName); + + if (!database.transaction()) { + qFatal(qPrintable(database.lastError().text())); + } + + // drop any existing tables + { + QSqlQuery dropQuery(database); + foreach(const QString &tableName, database.tables()) { + if (!dropQuery.exec(QString("DROP TABLE %1").arg(tableName))) { + qFatal(qPrintable(dropQuery.lastError().text())); + } + } + } + + // create new table + { + QSqlQuery createQuery(database); + QString statement( + "CREATE TABLE Activities(" + "ApplicationName TEXT NOT NULL," + "ActivityName TEXT NOT NULL," + "RequestFlag BOOL NOT NULL DEFAULT FALSE," + "Data BLOB NOT NULL," + "PRIMARY KEY(ActivityName, ApplicationName))"); + + if (!createQuery.exec(statement)) { + qFatal(qPrintable(createQuery.lastError().text())); + } + } + + if (!database.commit()) { + qFatal(qPrintable(database.lastError().text())); + } +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/win/activitydatabase_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/win/activitydatabase_p.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,48 @@ +/* +* 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 ACTIVITYDATABASE_P_H +#define ACTIVITYDATABASE_P_H + +#include +#include + +class ActivityDatabasePrivate { + +public: + ActivityDatabasePrivate(); + ~ActivityDatabasePrivate(); + +public: + void saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata); + void deleteActivity(const QString &applicationName, const QString &activityName); + void deleteApplicationActivities(const QString &applicationName); + QList allActivitiesList(); + QList applicationActivitiesList(const QString &applicationName); + QString requestedActivityName(const QString &applicationName); + void setActivityRequestFlag(const QString &applicationName, const QString &activityName); + void clearActivityRequestFlag(const QString &applicationName, const QString &activityName); + +private: + QList activitiesList(const QString& sqlCommand); + +private: + bool checkTables(); + void recreateTables(); + +}; + +#endif // ACTIVITYDATABASE_P_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/win/applicationlauncher_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/win/applicationlauncher_p.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,34 @@ +/* +* 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 "applicationlauncher_p.h" +#include + +bool ApplicationLauncherPrivate::isRunning(int applicationId) +{ + // @todo + return true; +} + +void ApplicationLauncherPrivate::startApplication(int applicationId, const QString &activityId) +{ + // @todo +} + +void ApplicationLauncherPrivate::bringToForeground(int applicationId) +{ + // @todo +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/activityserviceplugin/win/applicationlauncher_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activityserviceplugin/win/applicationlauncher_p.h Fri Apr 16 15:16:09 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 APPLICATIONLAUNCHER_P_H +#define APPLICATIONLAUNCHER_P_H + +#include + +class ApplicationLauncherPrivate +{ + +public: + bool isRunning(int applicationId); + void startApplication(int applicationId, const QString &activityId); + void bringToForeground(int applicationId); + +}; + +#endif // APPLICATIONLAUNCHER_P_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,112 @@ +/* +* 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 "hbactivityplugininterface.h" +#include "hbactivityplugin.h" + +#include + +QTM_USE_NAMESPACE + +HbActivityPlugin::HbActivityPlugin(QObject *parent) : HbActivityPluginInterface(parent), mActivityClient(0) +{ + QServiceManager serviceManager; + + if (serviceManager.findInterfaces("ActivityService").isEmpty()) { + // clean old entries + serviceManager.removeService("ActivityService"); + bool servicesAdded = serviceManager.addService(":/activityserviceplugin.xml"); + if (!servicesAdded) { + qWarning("addService for ActivityService returned false, error %d", serviceManager.error()); + } + } + + mActivityClient = serviceManager.loadInterface("com.nokia.qt.activities.ActivityClient"); + if (!mActivityClient) { + qWarning("Cannot initialize critical com.nokia.qt.activities.ActivityClient service."); + } + + connect(mActivityClient, SIGNAL(activityRequested(QString)), this, SIGNAL(activityRequested(QString))); +} + +HbActivityPlugin::~HbActivityPlugin() +{ + delete mActivityClient; +} + +bool HbActivityPlugin::addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) +{ + bool retVal(false); + QMetaObject::invokeMethod(mActivityClient, + "addActivity", + Q_RETURN_ARG(bool, retVal), + Q_ARG(QString, activityId), + Q_ARG(QVariant, data), + Q_ARG(QVariantHash, parameters)); + return retVal; +} + +bool HbActivityPlugin::removeActivity(const QString &activityId) +{ + bool retVal(false); + QMetaObject::invokeMethod(mActivityClient, + "removeActivity", + Q_RETURN_ARG(bool, retVal), + Q_ARG(QString, activityId)); + return retVal; +} + +bool HbActivityPlugin::updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) +{ + bool retVal(false); + QMetaObject::invokeMethod(mActivityClient, + "updateActivity", + Q_RETURN_ARG(bool, retVal), + Q_ARG(QString, activityId), + Q_ARG(QVariant, data), + Q_ARG(QVariantHash, parameters)); + return retVal; +} +QList HbActivityPlugin::activities() +{ + QList data; + QMetaObject::invokeMethod(mActivityClient, + "activities", + Q_RETURN_ARG(QList, data)); + return data; +} + +QVariant HbActivityPlugin::activityData(const QString &activityId) +{ + QVariant data; + QMetaObject::invokeMethod(mActivityClient, + "activityData", + Q_RETURN_ARG(QVariant, data), + Q_ARG(QString, activityId)); + return data; +} + +bool HbActivityPlugin::waitActivity() +{ + bool retVal(false); + QMetaObject::invokeMethod(mActivityClient, + "waitActivity", + Q_RETURN_ARG(bool, retVal)); + return retVal; +} + +Q_EXPORT_PLUGIN2(hbactivityplugin, HbActivityPlugin) diff -r f62f87b200ec -r 8e5041d13c84 activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.h Fri Apr 16 15:16:09 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 HBACTIVITYPLUGIN_H +#define HBACTIVITYPLUGIN_H + +#include "hbactivityplugininterface.h" + +class HbActivityPlugin : public HbActivityPluginInterface +{ + Q_OBJECT + Q_INTERFACES(HbActivityPluginInterface) + +public: + HbActivityPlugin(QObject *parent = 0); + ~HbActivityPlugin(); + +public: + virtual bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters); + virtual bool removeActivity(const QString &activityId); + virtual bool updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters); + virtual QList activities(); + virtual QVariant activityData(const QString &activityId); + virtual bool waitActivity(); + +private: + QObject *mActivityClient; + +}; + +#endif //HBACTIVITYPLUGIN_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.pro Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,40 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +TARGET = hbactivityplugin + +CONFIG += plugin + +CONFIG += mobility +MOBILITY = serviceframework + +HEADERS += hbactivityplugininterface.h \ + hbactivityplugin.h \ + +SOURCES += hbactivityplugin.cpp \ + +RESOURCES += hbactivityplugin.qrc + +symbian { + load(data_caging_paths) + pluginDep.sources = hbactivityplugin.dll + pluginDep.path = $$QT_PLUGINS_BASE_DIR + DEPLOYMENT += pluginDep + + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = ALL -TCB +} diff -r f62f87b200ec -r 8e5041d13c84 activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.qrc Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,5 @@ + + + ../../activityserviceplugin/activityserviceplugin.xml + + \ No newline at end of file diff -r f62f87b200ec -r 8e5041d13c84 activityfw/orbitintegration/hbactivityplugin/hbactivityplugininterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugininterface.h Fri Apr 16 15:16:09 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 HBACTIVITYPLUGININTERFACE_H +#define HBACTIVITYPLUGININTERFACE_H + +#include +#include +#include +#include +#include +#include + +class HbActivityPluginInterface : public QObject +{ + Q_OBJECT + +public: + HbActivityPluginInterface(QObject *parent = 0) : QObject(parent) {} + +public: + virtual bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) = 0; + virtual bool removeActivity(const QString &activityId) = 0; + virtual bool updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) = 0; + virtual QList activities() = 0; + virtual QVariant activityData(const QString &activityId) = 0; + virtual bool waitActivity() = 0; + +signals: + void activityRequested(const QString &activityId); + +}; + +Q_DECLARE_INTERFACE(HbActivityPluginInterface, "HbActivityPluginInterface/1.0") + +#endif // HBACTIVITYPLUGININTERFACE_H diff -r f62f87b200ec -r 8e5041d13c84 activityfw/rom.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/rom.pri Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,20 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " +BLD_INF_RULES.prj_exports += "rom/activitymanager_core.iby CORE_APP_LAYER_IBY_EXPORT_PATH(activitymanager_core.iby)" +BLD_INF_RULES.prj_exports += "./sis/stubs/activitymanager_stub.sis /epoc32/release/winscw/udeb/z/system/install/activitymanager_stub.sis" +BLD_INF_RULES.prj_exports += "./sis/stubs/activitymanager_stub.sis /epoc32/data/z/system/install/activitymanager_stub.sis" \ No newline at end of file diff -r f62f87b200ec -r 8e5041d13c84 activityfw/rom/activitymanager_core.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/rom/activitymanager_core.iby Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __TSACTMAN_CORE_IBY__ +#define __TSACTMAN_CORE_IBY__ + +//file=ABI_DIR\BUILD_DIR\activityserviceinstaller.exe PROGRAMS_DIR\activityserviceinstaller.exe +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\activitylauncher.exe PROGRAMS_DIR\activitylauncher.exe +data=ZPRIVATE\10003a3f\import\apps\activitylauncher_reg.rsc private\10003a3f\import\apps\activitylauncher_reg.rsc +data=\epoc32\data\z\resource\apps\activitylauncher.rsc resource\apps\activitylauncher.rsc + +file=ABI_DIR\BUILD_DIR\hsactivitydbserver.exe PROGRAMS_DIR\hsactivitydbserver.exe +data=ZPRIVATE\10003a3f\import\apps\hsactivitydbserver_reg.rsc private\10003a3f\import\apps\hsactivitydbserver_reg.rsc +data=\epoc32\data\z\resource\apps\hsactivitydbserver.rsc resource\apps\hsactivitydbserver.rsc + +file=ABI_DIR\BUILD_DIR\hsactivitydbclient.dll SHARED_LIB_DIR\hsactivitydbclient.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 + + +// stub sis +data=ZSYSTEM/install/activitymanager_stub.sis system/install/activitymanager_stub.sis + +#endif //__TSACTMAN_CORE_IBY__ diff -r f62f87b200ec -r 8e5041d13c84 activityfw/sis/activitymanager.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/sis/activitymanager.pkg Fri Apr 16 15:16:09 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: +; + +;Language - standard language definitions +&EN + +; standard SIS file header +#{"activitymanager"},(0x200267B4),1,0,0,TYPE=SA, RU + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + + +;"/epoc32/release/armv5/urel/activityserviceinstaller.exe" - "!:\sys\bin\activityserviceinstaller.exe" +"/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/activitylauncher.exe" - "!:\sys\bin\activitylauncher.exe" +"/epoc32/data/z/resource/apps/activitylauncher.rsc" - "!:\resource\apps\activitylauncher.rsc" +"/epoc32/data/z/private/10003a3f/import/apps/activitylauncher_reg.rsc" - "!:\private\10003a3f\import\apps\activitylauncher_reg.rsc" + +"/epoc32/release/armv5/urel/hsactivitydbserver.exe" - "!:\sys\bin\hsactivitydbserver.exe" +"/epoc32/data/z/resource/apps/hsactivitydbserver.rsc" - "!:\resource\apps\hsactivitydbserver.rsc" +"/epoc32/data/z/private/10003a3f/import/apps/hsactivitydbserver_reg.rsc" - "!:\private\10003a3f\import\apps\hsactivitydbserver_reg.rsc" + +"/epoc32/release/armv5/urel/hsactivitydbclient.dll" - "!:\sys\bin\hsactivitydbclient.dll" + +"/epoc32/release/armv5/urel/hbactivityplugin.dll" - "!:\sys\bin\hbactivityplugin.dll" +"/epoc32/data/z/resource/qt/plugins/hbactivityplugin.qtplugin"-"!:\resource\qt\plugins\hbactivityplugin.qtplugin" diff -r f62f87b200ec -r 8e5041d13c84 activityfw/sis/edit_pkg.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/sis/edit_pkg.pl Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,224 @@ +# +# 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: +# +#Options: +# -version -adds Qt version (4,6,0) intp pkg files +# -target -replaces $(PLATFORM)/$(TARGET) into armv5/urel +# -test -creates script for test app +# default -version + +use strict; +use File::Find; +my $base = `cd`; +$base =~ s/\\\w+\s+$//; #move one dir upper +my $modulebase = `cd`; +$modulebase =~s/(\s+)$//; #remove linefeed from end +print $base;; +my $qtversion = "\, 4\, 6\, 0\,"; +my $target = "armv5\/urel"; + +my $qtversionchnage = 0; +my $qtversionarg = "-version"; +my $targetchnage = 0; +my $targetarg = "-target"; +my $module = 0; +my $modulearg = "-test"; +my $delmodule = 0; +my $delmodulearg = "-delmodule"; +my $moduledir = "testsis"; +my $modulepath = $base."\\".$moduledir; +my $ccert = $modulebase."\\"."cert.cer"; +my $ckey = $modulebase."\\"."key.pem"; +my $modulebatpath = $modulebase."\\".$moduledir."\\createmodulesis.bat"; + +checkCmdLine(); + +if ( $qtversionchnage == 1 || $targetchnage == 1 ) + { + find( \&edits, $base ); + } +if ( $module == 1 ) + { + system "mkdir $moduledir"; + if ( not ( open (FWM, ">$modulebatpath") ) ) + { + print "\n***Error: Couldn't open $modulebatpath file to write\n"; + return; + } + binmode FWM; + print FWM "del /S/Q *.SIS\r\n"; + print FWM "del /S/Q *.SISX\r\n"; + close FWM; + find( \&moduleSis, $base ); + } +if ( $delmodule == 1 ) + { + find( \&delModuleSis, $base ); + } + +sub edits() + { + my $file=$_; + my $winpath=$File::Find::name; + $winpath=~s/\//\\/g; + if( -f $file && $file=~/(_template\.pkg)$/i ) + { + print "$winpath "; + system "attrib -R $winpath"; + if ( not ( open (FR, $winpath) ) ) + { + print "Error: Couldn't open $winpath file to read\n"; + return; + } + binmode FR; + my $buf=""; + my $length = 0; + $length = -s $winpath; + read( FR, $buf, $length ); + close FR; + if ( $qtversionchnage == 1 ) + { + $buf =~s/\,\s*\,\s*\,\s*\,\s*\{\"Qt\"\}/$qtversion \{\"Qt\"\}/si; + } + if ( $targetchnage == 1 ) + { + $buf =~s/\$\(PLATFORM\)\/\$\(TARGET\)/$target/si; + } + + if ( not ( open (FW, ">$winpath") ) ) + { + print "\n***Error: Couldn't open $winpath file to write\n"; + return; + } + binmode FW; + print FW $buf; + close FW; + + print "\r\n"; + } + } + +sub checkCmdLine() + { + my $numArgs = $#ARGV + 1; + if ( $numArgs == 0 ) + { + $qtversionchnage = 1; + } + else + { + foreach my $argnum ( 0 .. $#ARGV ) + { + my $argName = lc $ARGV[$argnum]; + if ( $argName eq $qtversionarg ) + { + $qtversionchnage = 1; + } + elsif ( $argName eq $targetarg ) + { + $targetchnage = 1; + } + elsif ( $argName eq $modulearg ) + { + $module = 1; + } + elsif ( $argName eq $delmodulearg ) + { + $delmodule = 1; + } + else + { + die "\n***Error: Bad arguments\n"; + } + } + } + } + +sub moduleSis() + { + my $file=$_; + my $winpath=$File::Find::name; + $winpath=~s/\//\\/g; + + + if( -f $file && $file=~/(.*test.*_template\.pkg)$/i ) + { + print "$winpath "; + system "attrib -R $winpath"; + if ( not ( open (FR, $winpath) ) ) + { + print "Error: Couldn't open $winpath file to read\n"; + return; + } + binmode FR; + my $buf=""; + my $length = 0; + $length = -s $winpath; + read( FR, $buf, $length ); + close FR; + $buf =~s/\,\s*\,\s*\,\s*\,\s*\{\"Qt\"\}/$qtversion \{\"Qt\"\}/si; + $buf =~s/\$\(PLATFORM\)\/\$\(TARGET\)/$target/si; + + if ( not ( open (FW, ">$winpath") ) ) + { + print "Error: Couldn't open $winpath file to write\n"; + return; + } + binmode FW; + print FW $buf; + close FW; + print "\r\n"; + + my $pkgname = sisName( $winpath ); + + if ( not ( open (FWM2, ">>$modulebatpath") ) ) + { + print "Error: Couldn't open $modulebatpath file to append\n"; + return; + } + binmode FWM2; + print FWM2 "makesis $winpath $pkgname\.SIS\r\n"; + print FWM2 "signsis $pkgname\.SIS $pkgname\.SISX $ccert $ckey\r\n"; + close FWM2; + } + } + +sub sisName() + { + my $path = shift; + my $name = ""; + if ( $path =~ /\\(\w+)\.pkg/i ) + { + $name = $1; + } + return $name; + } + +sub delModuleSis() + { + my $file=$_; + my $winpath=$File::Find::name; + $winpath=~s/\//\\/g; + + + if( -f $file && $file=~/(_template\.pkg)$/i && ( $file=~/^(t_)/i || $file=~/test/i ) ) + { + print "Deleting: "; + print "$winpath "; + system "attrib -R $winpath"; + system "del /S/Q $winpath"; + print "\r\n"; + } + } \ No newline at end of file diff -r f62f87b200ec -r 8e5041d13c84 activityfw/sis/stubs/activitymanager_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/sis/stubs/activitymanager_stub.pkg Fri Apr 16 15:16:09 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: +; +; ------------------------------------------------------------------------------ +; Taskswitcher stub SIS package file. +; Used to enable Taskswitcher to be updated from ROM with a SIS package. +; When you add new files into this stub, please remember to update +; SIS stub with "makesis -s" command. +; ------------------------------------------------------------------------------ +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"activitymanager"},(0x200267B4),1,0,0,TYPE=SA + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +;"" - "Z:\sys\bin\activityserviceinstaller.exe" +"" - "Z:\sys\bin\activityserviceplugin.dll" +"" - "Z:\resource\qt\plugins\activityserviceplugin.qtplugin" + +"" - "Z:\sys\bin\activitylauncher.exe" +"" - "Z:\resource\apps\activitylauncher.rsc" +"" - "Z:\private\10003a3f\import\apps\activitylauncher_reg.rsc" + +"" - "Z:\sys\bin\hsactivitydbserver.exe" +"" - "Z:\resource\apps\hsactivitydbserver.rsc" +"" - "Z:\private\10003a3f\import\apps\hsactivitydbserver_reg.rsc" + +"" - "Z:\sys\bin\hsactivitydbclient.dll" + +"" - "Z:\sys\bin\hbactivityplugin.dll" +"" - "Z:\resource\qt\plugins\hbactivityplugin.qtplugin" \ No newline at end of file diff -r f62f87b200ec -r 8e5041d13c84 activityfw/sis/stubs/activitymanager_stub.sis Binary file activityfw/sis/stubs/activitymanager_stub.sis has changed diff -r f62f87b200ec -r 8e5041d13c84 activityfw/sis/stubs/createstubs.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/sis/stubs/createstubs.bat Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,17 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +for %%f in (*.pkg) do makesis -s %%f diff -r f62f87b200ec -r 8e5041d13c84 common.pri --- a/common.pri Fri Mar 19 09:35:23 2010 +0200 +++ b/common.pri Fri Apr 16 15:16:09 2010 +0300 @@ -86,6 +86,36 @@ $$PWD/homescreensrv_plat/homescreen_information_api/inc } +plugin: !isEmpty(PLUGIN_SUBDIR): DESTDIR = $$OUTPUT_DIR/$$PLUGIN_SUBDIR + +win32: plugin { # copy manifiers + manifest.path = $$DESTDIR + manifest.files = ./resource/*.manifest ./resource/*.xml + manifest.CONFIG += no_build + + INSTALLS += manifest + PRE_TARGETDEPS += install_manifest + +} + +symbian: plugin { # copy qtstub and manifest + + pluginstub.sources = $${TARGET}.dll + pluginstub.path = $$PLUGIN_SUBDIR + + DEPLOYMENT += pluginstub + + 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)" +} + defineTest(exportResources) { symbian { for(subdirs, 1) { diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/bwins/caextendedmenuu.def --- a/contentstorage/bwins/caextendedmenuu.def Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/bwins/caextendedmenuu.def Fri Apr 16 15:16:09 2010 +0300 @@ -1,12 +1,3 @@ EXPORTS - ??0CCaHandler@@IAE@XZ @ 1 NONAME ; CCaHandler::CCaHandler(void) - ??1CCaHandler@@UAE@XZ @ 2 NONAME ; CCaHandler::~CCaHandler(void) - ??1CCaHandlerEngine@@UAE@XZ @ 3 NONAME ; CCaHandlerEngine::~CCaHandlerEngine(void) - ?BaseConstructL@CCaHandler@@IAEXXZ @ 4 NONAME ; void CCaHandler::BaseConstructL(void) - ?GetItemIcon@CaMenuIconUtility@@SAPAVCAknIcon@@ABVCCaInnerEntry@@@Z @ 5 NONAME ; class CAknIcon * CaMenuIconUtility::GetItemIcon(class CCaInnerEntry const &) - ?HandleCommandL@CCaHandler@@UAEXAAVCCaInnerEntry@@ABVTDesC8@@@Z @ 6 NONAME ; void CCaHandler::HandleCommandL(class CCaInnerEntry &, class TDesC8 const &) - ?HandleCommandL@CCaHandlerEngine@@QAEXAAVCCaInnerEntry@@ABVTDesC8@@@Z @ 7 NONAME ; void CCaHandlerEngine::HandleCommandL(class CCaInnerEntry &, class TDesC8 const &) - ?NewL@CCaHandlerEngine@@SAPAV1@XZ @ 8 NONAME ; class CCaHandlerEngine * CCaHandlerEngine::NewL(void) - ?NewLC@CCaHandlerEngine@@SAPAV1@XZ @ 9 NONAME ; class CCaHandlerEngine * CCaHandlerEngine::NewLC(void) - ?SupportsType@CCaHandler@@UAEHABVTDesC16@@@Z @ 10 NONAME ; int CCaHandler::SupportsType(class TDesC16 const &) + ?GetItemIcon@CaMenuIconUtility@@SAPAVCAknIcon@@ABVCCaInnerEntry@@@Z @ 1 NONAME ; class CAknIcon * CaMenuIconUtility::GetItemIcon(class CCaInnerEntry const &) diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/bwins/cautilsu.def --- a/contentstorage/bwins/cautilsu.def Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/bwins/cautilsu.def Fri Apr 16 15:16:09 2010 +0300 @@ -1,89 +1,91 @@ EXPORTS - ?AddAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@0@Z @ 1 NONAME ; void CCaInnerEntry::AddAttributeL(class TDesC16 const &, class TDesC16 const &) - ?Exist@RCaEntryAttrArray@@QAEHABVTDesC16@@@Z @ 2 NONAME ; int RCaEntryAttrArray::Exist(class TDesC16 const &) - ?ExternalizeL@CCaInnerEntry@@QBEXAAVRWriteStream@@@Z @ 3 NONAME ; void CCaInnerEntry::ExternalizeL(class RWriteStream &) const - ?ExternalizeL@CCaInnerNotifierFilter@@QBEXAAVRWriteStream@@@Z @ 4 NONAME ; void CCaInnerNotifierFilter::ExternalizeL(class RWriteStream &) const - ?ExternalizeL@CCaInnerQuery@@QBEXAAVRWriteStream@@@Z @ 5 NONAME ; void CCaInnerQuery::ExternalizeL(class RWriteStream &) const - ?ExternalizeL@RCaEntriesArray@@QBEXAAVRWriteStream@@@Z @ 6 NONAME ; void RCaEntriesArray::ExternalizeL(class RWriteStream &) const - ?ExternalizeL@RCaIdsArray@@QBEXAAVRWriteStream@@@Z @ 7 NONAME ; void RCaIdsArray::ExternalizeL(class RWriteStream &) const - ?Find@RCaEntryAttrArray@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 8 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TDes16 &) - ?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 9 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TDes16 &) - ?GetAttributeName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 10 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetAttributeName(void) const - ?GetAttributes@CCaInnerEntry@@QBEABVRCaEntryAttrArray@@XZ @ 11 NONAME ; class RCaEntryAttrArray const & CCaInnerEntry::GetAttributes(void) const - ?GetCount@CCaInnerQuery@@QBEIXZ @ 12 NONAME ; unsigned int CCaInnerQuery::GetCount(void) const - ?GetDescription@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 13 NONAME ; class RBuf16 const & CCaInnerEntry::GetDescription(void) const - ?GetEntryRole@CCaInnerNotifierFilter@@QBE?AW4TEntryRole@@XZ @ 14 NONAME ; enum TEntryRole CCaInnerNotifierFilter::GetEntryRole(void) const - ?GetEntryTypeName@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 15 NONAME ; class RBuf16 const & CCaInnerEntry::GetEntryTypeName(void) const - ?GetEntryTypeNames@CCaInnerQuery@@QBEPBVCDesC16ArrayFlat@@XZ @ 16 NONAME ; class CDesC16ArrayFlat const * CCaInnerQuery::GetEntryTypeNames(void) const - ?GetFlags@CCaInnerEntry@@QBEIXZ @ 17 NONAME ; unsigned int CCaInnerEntry::GetFlags(void) const - ?GetFlagsOff@CCaInnerQuery@@QBEIXZ @ 18 NONAME ; unsigned int CCaInnerQuery::GetFlagsOff(void) const - ?GetFlagsOn@CCaInnerQuery@@QBEIXZ @ 19 NONAME ; unsigned int CCaInnerQuery::GetFlagsOn(void) const - ?GetIcon@CCaInnerEntry@@QBEABUTIconAttributes@1@XZ @ 20 NONAME ; struct CCaInnerEntry::TIconAttributes const & CCaInnerEntry::GetIcon(void) const - ?GetIconId@CCaInnerEntry@@QBEHXZ @ 21 NONAME ; int CCaInnerEntry::GetIconId(void) const - ?GetId@CCaInnerEntry@@QBEHXZ @ 22 NONAME ; int CCaInnerEntry::GetId(void) const - ?GetIds@CCaInnerNotifierFilter@@QBE?AV?$RArray@H@@XZ @ 23 NONAME ; class RArray CCaInnerNotifierFilter::GetIds(void) const - ?GetIds@CCaInnerQuery@@QBEABV?$RArray@H@@XZ @ 24 NONAME ; class RArray const & CCaInnerQuery::GetIds(void) const - ?GetLocalizedString@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 25 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetLocalizedString(void) const - ?GetNotifierType@CCaInnerNotifierFilter@@QBE?AW4TNotifierType@1@XZ @ 26 NONAME ; enum CCaInnerNotifierFilter::TNotifierType CCaInnerNotifierFilter::GetNotifierType(void) const - ?GetParentId@CCaInnerNotifierFilter@@QBEHXZ @ 27 NONAME ; int CCaInnerNotifierFilter::GetParentId(void) const - ?GetParentId@CCaInnerQuery@@QBEHXZ @ 28 NONAME ; int CCaInnerQuery::GetParentId(void) const - ?GetRole@CCaInnerEntry@@QBEIXZ @ 29 NONAME ; unsigned int CCaInnerEntry::GetRole(void) const - ?GetRole@CCaInnerQuery@@QBEHXZ @ 30 NONAME ; int CCaInnerQuery::GetRole(void) const - ?GetRowId@CCaLocalizationEntry@@QBEHXZ @ 31 NONAME ; int CCaLocalizationEntry::GetRowId(void) const - ?GetSort@CCaInnerQuery@@QBE?AW4TSortAttribute@1@XZ @ 32 NONAME ; enum CCaInnerQuery::TSortAttribute CCaInnerQuery::GetSort(void) const - ?GetStringId@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 33 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetStringId(void) const - ?GetTUint@MenuUtils@@SAHABVTDesC16@@AAI@Z @ 34 NONAME ; int MenuUtils::GetTUint(class TDesC16 const &, unsigned int &) - ?GetTableName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 35 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetTableName(void) const - ?GetText@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 36 NONAME ; class RBuf16 const & CCaInnerEntry::GetText(void) const - ?GetTextId@CCaLocalizationEntry@@QBEHXZ @ 37 NONAME ; int CCaLocalizationEntry::GetTextId(void) const - ?GetTypeNames@CCaInnerNotifierFilter@@QBEPAVCDesC16ArrayFlat@@XZ @ 38 NONAME ; class CDesC16ArrayFlat * CCaInnerNotifierFilter::GetTypeNames(void) const - ?GetUid@CCaInnerEntry@@QBEJXZ @ 39 NONAME ; long CCaInnerEntry::GetUid(void) const - ?GetUid@CCaInnerQuery@@QBEIXZ @ 40 NONAME ; unsigned int CCaInnerQuery::GetUid(void) const - ?InternalizeL@CCaInnerEntry@@QAEXAAVRReadStream@@@Z @ 41 NONAME ; void CCaInnerEntry::InternalizeL(class RReadStream &) - ?InternalizeL@CCaInnerNotifierFilter@@QAEXAAVRReadStream@@@Z @ 42 NONAME ; void CCaInnerNotifierFilter::InternalizeL(class RReadStream &) - ?InternalizeL@CCaInnerQuery@@QAEXAAVRReadStream@@@Z @ 43 NONAME ; void CCaInnerQuery::InternalizeL(class RReadStream &) - ?InternalizeL@RCaEntriesArray@@QAEXAAVRReadStream@@@Z @ 44 NONAME ; void RCaEntriesArray::InternalizeL(class RReadStream &) - ?InternalizeL@RCaIdsArray@@QAEXAAVRReadStream@@@Z @ 45 NONAME ; void RCaIdsArray::InternalizeL(class RReadStream &) - ?MarshalDataLC@RCaIdsArray@@QBEPAVHBufC8@@XZ @ 46 NONAME ; class HBufC8 * RCaIdsArray::MarshalDataLC(void) const - ?NewL@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 47 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewL(class TDesC16 const &) - ?NewL@CCaInnerEntry@@SAPAV1@XZ @ 48 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewL(void) - ?NewL@CCaInnerNotifierFilter@@SAPAV1@W4TNotifierType@1@@Z @ 49 NONAME ; class CCaInnerNotifierFilter * CCaInnerNotifierFilter::NewL(enum CCaInnerNotifierFilter::TNotifierType) - ?NewL@CCaInnerQuery@@SAPAV1@XZ @ 50 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewL(void) - ?NewL@CCaLocalizationEntry@@SAPAV1@XZ @ 51 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewL(void) - ?NewLC@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 52 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewLC(class TDesC16 const &) - ?NewLC@CCaInnerEntry@@SAPAV1@XZ @ 53 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewLC(void) - ?NewLC@CCaInnerNotifierFilter@@SAPAV1@W4TNotifierType@1@@Z @ 54 NONAME ; class CCaInnerNotifierFilter * CCaInnerNotifierFilter::NewLC(enum CCaInnerNotifierFilter::TNotifierType) - ?NewLC@CCaInnerQuery@@SAPAV1@XZ @ 55 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewLC(void) - ?NewLC@CCaLocalizationEntry@@SAPAV1@XZ @ 56 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewLC(void) - ?RemoveAttribute@RCaEntryAttrArray@@QAEXABVTDesC16@@@Z @ 57 NONAME ; void RCaEntryAttrArray::RemoveAttribute(class TDesC16 const &) - ?RemoveAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 58 NONAME ; void CCaInnerEntry::RemoveAttributeL(class TDesC16 const &) - ?SetAttributeNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 59 NONAME ; void CCaLocalizationEntry::SetAttributeNameL(class TDesC16 const &) - ?SetCount@CCaInnerQuery@@QAEXI@Z @ 60 NONAME ; void CCaInnerQuery::SetCount(unsigned int) - ?SetDescriptionL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 61 NONAME ; void CCaInnerEntry::SetDescriptionL(class TDesC16 const &) - ?SetEntryRole@CCaInnerNotifierFilter@@QAEXW4TEntryRole@@@Z @ 62 NONAME ; void CCaInnerNotifierFilter::SetEntryRole(enum TEntryRole) - ?SetEntryTypeNameL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 63 NONAME ; void CCaInnerEntry::SetEntryTypeNameL(class TDesC16 const &) - ?SetEntryTypeNames@CCaInnerQuery@@QAEXPAVCDesC16ArrayFlat@@@Z @ 64 NONAME ; void CCaInnerQuery::SetEntryTypeNames(class CDesC16ArrayFlat *) - ?SetFlags@CCaInnerEntry@@QAEXI@Z @ 65 NONAME ; void CCaInnerEntry::SetFlags(unsigned int) - ?SetFlagsOff@CCaInnerQuery@@QAEXI@Z @ 66 NONAME ; void CCaInnerQuery::SetFlagsOff(unsigned int) - ?SetFlagsOn@CCaInnerQuery@@QAEXI@Z @ 67 NONAME ; void CCaInnerQuery::SetFlagsOn(unsigned int) - ?SetIconDataL@CCaInnerEntry@@QAEXHHHHABVTDesC16@@@Z @ 68 NONAME ; void CCaInnerEntry::SetIconDataL(int, int, int, int, class TDesC16 const &) - ?SetIconId@CCaInnerEntry@@QAEXH@Z @ 69 NONAME ; void CCaInnerEntry::SetIconId(int) - ?SetId@CCaInnerEntry@@QAEXI@Z @ 70 NONAME ; void CCaInnerEntry::SetId(unsigned int) - ?SetIdsL@CCaInnerNotifierFilter@@QAEXABV?$RArray@H@@@Z @ 71 NONAME ; void CCaInnerNotifierFilter::SetIdsL(class RArray const &) + ?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 &) + ?GetText@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 9 NONAME ; class RBuf16 const & CCaInnerEntry::GetText(void) const + ?InternalizeL@RCaEntriesArray@@QAEXAAVRReadStream@@@Z @ 10 NONAME ; void RCaEntriesArray::InternalizeL(class RReadStream &) + ?SetIdsL@CCaInnerNotifierFilter@@QAEXABV?$RArray@H@@@Z @ 11 NONAME ; void CCaInnerNotifierFilter::SetIdsL(class RArray const &) + ?GetTextId@CCaLocalizationEntry@@QBEHXZ @ 12 NONAME ; int CCaLocalizationEntry::GetTextId(void) const + ?GetUid@CCaInnerEntry@@QBEJXZ @ 13 NONAME ; long CCaInnerEntry::GetUid(void) const + ?SetId@CCaInnerEntry@@QAEXI@Z @ 14 NONAME ; void CCaInnerEntry::SetId(unsigned int) + ?GetSort@CCaInnerQuery@@QBE?AW4TSortAttribute@1@XZ @ 15 NONAME ; enum CCaInnerQuery::TSortAttribute CCaInnerQuery::GetSort(void) const + ?SetCount@CCaInnerQuery@@QAEXI@Z @ 16 NONAME ; void CCaInnerQuery::SetCount(unsigned int) + ?ExternalizeL@CCaInnerNotifierFilter@@QBEXAAVRWriteStream@@@Z @ 17 NONAME ; void CCaInnerNotifierFilter::ExternalizeL(class RWriteStream &) const + ?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 18 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TDes16 &) + ?Find@RCaEntryAttrArray@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 19 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TDes16 &) + ?SetRowId@CCaLocalizationEntry@@QAEXI@Z @ 20 NONAME ; void CCaLocalizationEntry::SetRowId(unsigned int) + ?GetUid@CCaInnerQuery@@QBEIXZ @ 21 NONAME ; unsigned int CCaInnerQuery::GetUid(void) const + ?SetFlags@CCaInnerEntry@@QAEXI@Z @ 22 NONAME ; void CCaInnerEntry::SetFlags(unsigned int) + ?SetAttributeNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 23 NONAME ; void CCaLocalizationEntry::SetAttributeNameL(class TDesC16 const &) + ?GetCount@CCaInnerQuery@@QBEIXZ @ 24 NONAME ; unsigned int CCaInnerQuery::GetCount(void) const + ?GetParentId@CCaInnerNotifierFilter@@QBEHXZ @ 25 NONAME ; int CCaInnerNotifierFilter::GetParentId(void) const + ?GetStringId@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 26 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetStringId(void) const + ?GetFlags@CCaInnerEntry@@QBEIXZ @ 27 NONAME ; unsigned int CCaInnerEntry::GetFlags(void) const + ?NewL@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 28 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewL(class TDesC16 const &) + ?SetParentId@CCaInnerNotifierFilter@@QAEXH@Z @ 29 NONAME ; void CCaInnerNotifierFilter::SetParentId(int) + ?SetFlagsOn@CCaInnerQuery@@QAEXI@Z @ 30 NONAME ; void CCaInnerQuery::SetFlagsOn(unsigned int) + ?SetTypeNames@CCaInnerNotifierFilter@@QAEXPAVCDesC16ArrayFlat@@@Z @ 31 NONAME ; void CCaInnerNotifierFilter::SetTypeNames(class CDesC16ArrayFlat *) + ?NewLC@CCaLocalizationEntry@@SAPAV1@XZ @ 32 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewLC(void) + ?NewL@CCaInnerNotifierFilter@@SAPAV1@W4TNotifierType@1@@Z @ 33 NONAME ; class CCaInnerNotifierFilter * CCaInnerNotifierFilter::NewL(enum CCaInnerNotifierFilter::TNotifierType) + ?GetTableName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 34 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetTableName(void) const + ?GetFlagsOff@CCaInnerQuery@@QBEIXZ @ 35 NONAME ; unsigned int CCaInnerQuery::GetFlagsOff(void) const + ?InternalizeL@CCaInnerEntry@@QAEXAAVRReadStream@@@Z @ 36 NONAME ; void CCaInnerEntry::InternalizeL(class RReadStream &) + ?GetAttributeName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 37 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetAttributeName(void) const + ?GetTUint@MenuUtils@@SAHABVTDesC16@@AAI@Z @ 38 NONAME ; int MenuUtils::GetTUint(class TDesC16 const &, unsigned int &) + ?AddAttributeL@CCaInnerQuery@@QAEXABVTDesC16@@0@Z @ 39 NONAME ; void CCaInnerQuery::AddAttributeL(class TDesC16 const &, class TDesC16 const &) + ?Exist@RCaEntryAttrArray@@QAEHABVTDesC16@@@Z @ 40 NONAME ; int RCaEntryAttrArray::Exist(class TDesC16 const &) + ?AddAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@0@Z @ 41 NONAME ; void CCaInnerEntry::AddAttributeL(class TDesC16 const &, class TDesC16 const &) + ?GetParentId@CCaInnerQuery@@QBEHXZ @ 42 NONAME ; int CCaInnerQuery::GetParentId(void) const + ?SetDescriptionL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 43 NONAME ; void CCaInnerEntry::SetDescriptionL(class TDesC16 const &) + ?SetEntryRole@CCaInnerNotifierFilter@@QAEXW4TEntryRole@@@Z @ 44 NONAME ; void CCaInnerNotifierFilter::SetEntryRole(enum TEntryRole) + ?GetFlagsOn@CCaInnerQuery@@QBEIXZ @ 45 NONAME ; unsigned int CCaInnerQuery::GetFlagsOn(void) const + ?GetIconId@CCaInnerEntry@@QBEHXZ @ 46 NONAME ; int CCaInnerEntry::GetIconId(void) const + ?SetIconDataL@CCaInnerEntry@@QAEXABVTDesC16@@00@Z @ 47 NONAME ; void CCaInnerEntry::SetIconDataL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &) + ?GetEntryRole@CCaInnerNotifierFilter@@QBE?AW4TEntryRole@@XZ @ 48 NONAME ; enum TEntryRole CCaInnerNotifierFilter::GetEntryRole(void) const + ?GetId@CCaInnerEntry@@QBEHXZ @ 49 NONAME ; int CCaInnerEntry::GetId(void) const + ?SetEntryTypeNames@CCaInnerQuery@@QAEXPAVCDesC16ArrayFlat@@@Z @ 50 NONAME ; void CCaInnerQuery::SetEntryTypeNames(class CDesC16ArrayFlat *) + ?GetNotifierType@CCaInnerNotifierFilter@@QBE?AW4TNotifierType@1@XZ @ 51 NONAME ; enum CCaInnerNotifierFilter::TNotifierType CCaInnerNotifierFilter::GetNotifierType(void) const + ?ExternalizeL@CCaInnerEntry@@QBEXAAVRWriteStream@@@Z @ 52 NONAME ; void CCaInnerEntry::ExternalizeL(class RWriteStream &) const + ?SetRole@CCaInnerQuery@@QAEXH@Z @ 53 NONAME ; void CCaInnerQuery::SetRole(int) + ?GetIcon@CCaInnerEntry@@QBEABUTIconAttributes@1@XZ @ 54 NONAME ; struct CCaInnerEntry::TIconAttributes const & CCaInnerEntry::GetIcon(void) const + ?NewL@CCaLocalizationEntry@@SAPAV1@XZ @ 55 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewL(void) + ?InternalizeL@CCaInnerNotifierFilter@@QAEXAAVRReadStream@@@Z @ 56 NONAME ; void CCaInnerNotifierFilter::InternalizeL(class RReadStream &) + ?InternalizeL@RCaIdsArray@@QAEXAAVRReadStream@@@Z @ 57 NONAME ; void RCaIdsArray::InternalizeL(class RReadStream &) + ?MarshalDataLC@RCaIdsArray@@QBEPAVHBufC8@@XZ @ 58 NONAME ; class HBufC8 * RCaIdsArray::MarshalDataLC(void) const + ?GetEntryTypeNames@CCaInnerQuery@@QBEPBVCDesC16ArrayFlat@@XZ @ 59 NONAME ; class CDesC16ArrayFlat const * CCaInnerQuery::GetEntryTypeNames(void) const + ?SetValueL@CCaEntryAttribute@@QAEXABVTDesC16@@@Z @ 60 NONAME ; void CCaEntryAttribute::SetValueL(class TDesC16 const &) + ?ExternalizeL@CCaInnerQuery@@QBEXAAVRWriteStream@@@Z @ 61 NONAME ; void CCaInnerQuery::ExternalizeL(class RWriteStream &) const + ?GetLocalizedString@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 62 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetLocalizedString(void) const + ?InternalizeL@CCaInnerQuery@@QAEXAAVRReadStream@@@Z @ 63 NONAME ; void CCaInnerQuery::InternalizeL(class RReadStream &) + ?NewLC@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 64 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewLC(class TDesC16 const &) + ?GetTypeNames@CCaInnerNotifierFilter@@QBEPAVCDesC16ArrayFlat@@XZ @ 65 NONAME ; class CDesC16ArrayFlat * CCaInnerNotifierFilter::GetTypeNames(void) const + ?NewL@CCaInnerEntry@@SAPAV1@XZ @ 66 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewL(void) + ?SetRole@CCaInnerEntry@@QAEXI@Z @ 67 NONAME ; void CCaInnerEntry::SetRole(unsigned int) + ?NewLC@CCaInnerEntry@@SAPAV1@XZ @ 68 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewLC(void) + ?SetTableNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 69 NONAME ; void CCaLocalizationEntry::SetTableNameL(class TDesC16 const &) + ?GetAttributes@CCaInnerEntry@@QBEABVRCaEntryAttrArray@@XZ @ 70 NONAME ; class RCaEntryAttrArray const & CCaInnerEntry::GetAttributes(void) const + ?GetRowId@CCaLocalizationEntry@@QBEHXZ @ 71 NONAME ; int CCaLocalizationEntry::GetRowId(void) const ?SetIdsL@CCaInnerQuery@@QAEXABV?$RArray@H@@@Z @ 72 NONAME ; void CCaInnerQuery::SetIdsL(class RArray const &) - ?SetLocalizedStringL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 73 NONAME ; void CCaLocalizationEntry::SetLocalizedStringL(class TDesC16 const &) - ?SetParentId@CCaInnerNotifierFilter@@QAEXH@Z @ 74 NONAME ; void CCaInnerNotifierFilter::SetParentId(int) - ?SetParentId@CCaInnerQuery@@QAEXH@Z @ 75 NONAME ; void CCaInnerQuery::SetParentId(int) - ?SetRole@CCaInnerEntry@@QAEXI@Z @ 76 NONAME ; void CCaInnerEntry::SetRole(unsigned int) - ?SetRole@CCaInnerQuery@@QAEXH@Z @ 77 NONAME ; void CCaInnerQuery::SetRole(int) - ?SetRowId@CCaLocalizationEntry@@QAEXI@Z @ 78 NONAME ; void CCaLocalizationEntry::SetRowId(unsigned int) - ?SetSort@CCaInnerQuery@@QAEXW4TSortAttribute@1@@Z @ 79 NONAME ; void CCaInnerQuery::SetSort(enum CCaInnerQuery::TSortAttribute) - ?SetStringIdL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 80 NONAME ; void CCaLocalizationEntry::SetStringIdL(class TDesC16 const &) - ?SetTableNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 81 NONAME ; void CCaLocalizationEntry::SetTableNameL(class TDesC16 const &) - ?SetTextId@CCaLocalizationEntry@@QAEXI@Z @ 82 NONAME ; void CCaLocalizationEntry::SetTextId(unsigned int) - ?SetTextL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 83 NONAME ; void CCaInnerEntry::SetTextL(class TDesC16 const &) - ?SetTypeNames@CCaInnerNotifierFilter@@QAEXPAVCDesC16ArrayFlat@@@Z @ 84 NONAME ; void CCaInnerNotifierFilter::SetTypeNames(class CDesC16ArrayFlat *) - ?SetUid@CCaInnerEntry@@QAEXJ@Z @ 85 NONAME ; void CCaInnerEntry::SetUid(long) - ?SetUid@CCaInnerQuery@@QAEXI@Z @ 86 NONAME ; void CCaInnerQuery::SetUid(unsigned int) - ?SetValueL@CCaEntryAttribute@@QAEXABVTDesC16@@@Z @ 87 NONAME ; void CCaEntryAttribute::SetValueL(class TDesC16 const &) + ?SetFlagsOff@CCaInnerQuery@@QAEXI@Z @ 73 NONAME ; void CCaInnerQuery::SetFlagsOff(unsigned int) + ?RemoveAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 74 NONAME ; void CCaInnerEntry::RemoveAttributeL(class TDesC16 const &) + ?GetRole@CCaInnerEntry@@QBEIXZ @ 75 NONAME ; unsigned int CCaInnerEntry::GetRole(void) const + ?GetIds@CCaInnerQuery@@QBEABV?$RArray@H@@XZ @ 76 NONAME ; class RArray const & CCaInnerQuery::GetIds(void) const + ?ExternalizeL@RCaEntriesArray@@QBEXAAVRWriteStream@@@Z @ 77 NONAME ; void RCaEntriesArray::ExternalizeL(class RWriteStream &) const + ?NewL@CCaInnerQuery@@SAPAV1@XZ @ 78 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewL(void) + ?SetUid@CCaInnerQuery@@QAEXI@Z @ 79 NONAME ; void CCaInnerQuery::SetUid(unsigned int) + ?GetDescription@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 80 NONAME ; class RBuf16 const & CCaInnerEntry::GetDescription(void) const + ?GetRole@CCaInnerQuery@@QBEHXZ @ 81 NONAME ; int CCaInnerQuery::GetRole(void) const + ?GetEntryTypeName@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 82 NONAME ; class RBuf16 const & CCaInnerEntry::GetEntryTypeName(void) const + ?NewLC@CCaInnerQuery@@SAPAV1@XZ @ 83 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewLC(void) + ?SetTextL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 84 NONAME ; void CCaInnerEntry::SetTextL(class TDesC16 const &) + ?SetParentId@CCaInnerQuery@@QAEXH@Z @ 85 NONAME ; void CCaInnerQuery::SetParentId(int) + ?GetIds@CCaInnerNotifierFilter@@QBE?AV?$RArray@H@@XZ @ 86 NONAME ; class RArray CCaInnerNotifierFilter::GetIds(void) const + ?SetStringIdL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 87 NONAME ; void CCaLocalizationEntry::SetStringIdL(class TDesC16 const &) + ?SetTextId@CCaLocalizationEntry@@QAEXI@Z @ 88 NONAME ; void CCaLocalizationEntry::SetTextId(unsigned int) + ?RemoveAttribute@RCaEntryAttrArray@@QAEXABVTDesC16@@@Z @ 89 NONAME ; void RCaEntryAttrArray::RemoveAttribute(class TDesC16 const &) diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/caclient.pro --- a/contentstorage/caclient/caclient.pro Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/caclient.pro Fri Apr 16 15:16:09 2010 +0300 @@ -15,9 +15,13 @@ # TEMPLATE = lib -CONFIG += hb +CONFIG += hb mobility HB = hbcore +MOBILITY = serviceframework +# temporary solution to solve problems with SF in MW dependency +qtAddLibrary(QtServiceFramework) + DEFINES += CACLIENT_LIB include(../../common.pri) @@ -47,8 +51,10 @@ -laknicon \ -lcharconv \ -lfbscli \ - -lbitgdi + -lbitgdi \ + -lxqutils include(caclient_s60.pri) +include(cahandler.pri) } win32: { diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/cahandler.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/cahandler.pri Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,41 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +INCLUDEPATH += ../cahandler/inc \ + ../cahandler/app/inc \ + ../cahandler/url/inc \ + ../cahandler/tapp/inc + +HEADERS += ../cahandler/inc/*.h \ + ../cahandler/app/inc/*.h \ + ../cahandler/url/inc/*.h \ + ../cahandler/tapp/inc/catapphandler.h + +SOURCES += ../cahandler/app/src/*.cpp \ + ../cahandler/url/src/*.cpp \ + ../cahandler/tapp/src/catapphandler.cpp + +LIBS += -lswinstcli \ + -lapgrfx \ + -lws32 \ + -lapparc \ + -lsisregistryclient \ + -leikcore \ + -lcone \ + -lefsrv \ + -lxqservice + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/inc/caclient_defines.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/inc/caclient_defines.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,22 @@ +/* + * 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: caclient_defines.h + * + */ + +const char APPLICATION_UID_ATTRIBUTE_NAME[] = "application:uid"; +const char APPLICATION_ENTRY_TYPE_NAME[] = "application"; +const char WIDGET_ENTRY_TYPE_NAME[] = "widget"; +const char URL_ENTRY_TYPE_NAME[] = "url"; +const char TEMPLATED_APPLICATION_ENTRY_TYPE_NAME[] = "templatedApplication"; \ No newline at end of file diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/inc/caicondescription_p.h --- a/contentstorage/caclient/inc/caicondescription_p.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/inc/caicondescription_p.h Fri Apr 16 15:16:09 2010 +0300 @@ -37,16 +37,11 @@ QString filename() const; void setFileName(const QString &fileName); - int bitmapId() const; - void setBitmapId(int bitmapId); + QString skinId() const; + void setSkinId(const QString &skinId); - int maskId() const; - void setMaskId(int maskId); - - int skinMajorId() const; - void setSkinMajorId(int id); - int skinMinorId() const; - void setSkinMinorId(int id); + QString applicationId() const; + void setApplicationId(const QString &applicationId); private: @@ -68,22 +63,12 @@ /*! * */ - int mBitmapId; - - /*! - * - */ - int mMaskId; + QString mSkinId; /*! * */ - int mSkinMajorId; - - /*! - * - */ - int mSkinMinorId; + QString mApplicationId; }; diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/inc/caitemmodellist.h --- a/contentstorage/caclient/inc/caitemmodellist.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/inc/caitemmodellist.h Fri Apr 16 15:16:09 2010 +0300 @@ -49,6 +49,7 @@ void insert(int row, int id); void remove(int id); const int &operator[](int row) const; + QList orderedIdList(); private: diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/inc/caquery_p.h --- a/contentstorage/caclient/inc/caquery_p.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/inc/caquery_p.h Fri Apr 16 15:16:09 2010 +0300 @@ -57,6 +57,11 @@ unsigned int count() const; void setCount(unsigned int count); + QMap attributes() const; + QString attribute(const QString &name) const; + void setAttribute(const QString &name, const QString &value); + void removeAttribute(const QString &name); + void clear(); private: @@ -81,6 +86,8 @@ Qt::SortOrder mSortOrder; unsigned int mCount; + + QMap mAttributes; }; #endif //CAQUERY_PRIVATE_H diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/installs_win32.pri --- a/contentstorage/caclient/installs_win32.pri Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/installs_win32.pri Fri Apr 16 15:16:09 2010 +0300 @@ -16,7 +16,7 @@ # take path from common.pri cadb.path = $$DESTDIR -cadb.files = ./../castorage/data/castoragedb +cadb.files = ./../castorage/data/castorage.db cadb.CONFIG += no_build INSTALLS += cadb diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/s60/inc/caclientproxy.h --- a/contentstorage/caclient/s60/inc/caclientproxy.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/s60/inc/caclientproxy.h Fri Apr 16 15:16:09 2010 +0300 @@ -19,14 +19,16 @@ #define CACLIENTPROXY_H #include +#include // INCLUDES #include "cadef.h" #include "caclientsession.h" #include "canotifier.h" +#include "cahandlerproxy.h" //FORWARD DECLARATIONS -class CCaHandlerEngine; + class CaClientNotifierProxy; class CaEntry; class CaQuery; @@ -215,13 +217,6 @@ void getEntryIdsL(const CaQuery &query, QList &sourceIdList); - /** - * Method for fetching entries. Symbian specific. - * @param entry entry - * @param command command. - */ - void executeCommandL(const CaEntry &entry, - const QString &command); /** * Touch. @@ -240,9 +235,8 @@ // Own. RCaClientSession mSession; - // Engine handler. - // Own. - CCaHandlerEngine *mHandler; + // Command handler. + QSharedPointer mCommandHandler; // Mutex to serialize access to mSessions. QMutex mMutex; diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/s60/inc/cahandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/s60/inc/cahandler.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#ifndef CA_HANDLER_H +#define CA_HANDLER_H + +#include +#include +#include + +class CaEntry; +class QString; + +class CaHandler: public QObject +{ + Q_OBJECT + +public: + virtual int execute(const CaEntry &entry, + const QString &commandName) = 0; +}; + +#endif diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/s60/inc/cahandlerloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/s60/inc/cahandlerloader.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,34 @@ +/* + * 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 CA_HANDLER_LOADER_H +#define CA_HANDLER_LOADER_H + +#include + +class QString; +class CaHandler; + +class CaHandlerLoader +{ +public: + virtual ~CaHandlerLoader(); + virtual CaHandler *loadHandler(const QString &entryTypeName, + const QString &commandName) = 0; +}; + +#endif diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/s60/inc/cahandlerproxy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/s60/inc/cahandlerproxy.h Fri Apr 16 15:16:09 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: + * + */ + +#ifndef CA_HANDLER_PROXY_H +#define CA_HANDLER_PROXY_H + +#include +#include +#include +#include +#include + +#include "cahandlerloader.h" +class CaEntry; + +class CaHandlerProxy +{ +public: + + ~CaHandlerProxy(); + + explicit CaHandlerProxy(CaHandlerLoader *loader); + + TInt execute(const CaEntry &entry, const QString &commandName); + +private: + CaHandler *getHandler(const CaEntry &entry, + const QString &commandName); + + typedef QMap > ImplementationMap; + typedef ImplementationMap::iterator ImplementationMapIterator; + + QSharedPointer mLoader; + ImplementationMap mImplementationMap; +}; + +#endif diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/s60/inc/caobjectadapter.h --- a/contentstorage/caclient/s60/inc/caobjectadapter.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/s60/inc/caobjectadapter.h Fri Apr 16 15:16:09 2010 +0300 @@ -38,6 +38,7 @@ class HbIcon; class CFbsBitmap; + /** * CaObjectAdapter * @@ -75,22 +76,6 @@ CCaInnerQuery &toQuery); /** - * Wraps a QString internal buffer into TPtrC object. - * The returned object is valid until QString internal buffer changes - * or the object is destroyed. - * @param string QString. - * @return descriptor. - */ - static const TPtrC convertToDescriptor(const QString &string); - - /** - * Converts descriptor to QString. - * @param des descriptor. - * @return QString. - */ - static QString convertToString(const TDesC &des); - - /** * Converts inner entry table to QList of pointers to entries. * @param fromEntriesArray an array containing inner entries * for conversion. @@ -156,21 +141,6 @@ CCaInnerNotifierFilter &to); /** - * @return uid attribute name - */ - static const QString &applicationUidAttributeName(); - - /** - * @return attribute type name - */ - static const QString &applicationEntryName(); - - /** - * @return widget type name - */ - static const QString &widgetEntryName(); - - /** * Set entry id. * @param entry entry. * @param id entry id. diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/s60/inc/caqtsfhandlerloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/s60/inc/caqtsfhandlerloader.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,35 @@ +/* + * 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 CA_QT_SF_HANDLER_LOADER_H +#define CA_QT_SF_HANDLER_LOADER_H + +#include +#include +#include + +#include "cahandlerloader.h" + +class CaQtSfHandlerLoader: + public CaHandlerLoader +{ +public: + CaHandler *loadHandler(const QString &entryTypeName, + const QString &commandName); +}; + +#endif diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/s60/src/caclientproxy.cpp --- a/contentstorage/caclient/s60/src/caclientproxy.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/s60/src/caclientproxy.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -27,19 +27,19 @@ #include "caobjectadapter.h" #include "caentriesarray.h" #include "caidsarray.h" -#include "cahandlerengine.h" #include "caarraycleanup.inl" #include "caentry.h" #include "caquery.h" #include "cadefs.h" - +#include "cahandlerproxy.h" +#include "caqtsfhandlerloader.h" //---------------------------------------------------------------------------- // //---------------------------------------------------------------------------- CaClientProxy::CaClientProxy(): - mHandler(NULL) + mCommandHandler(new CaHandlerProxy(new CaQtSfHandlerLoader())) { } @@ -49,7 +49,7 @@ CaClientProxy::~CaClientProxy() { mSession.Close(); - delete mHandler; + } //---------------------------------------------------------------------------- @@ -172,7 +172,7 @@ ErrorCode CaClientProxy::executeCommand(const CaEntry &entry, const QString &command) { - TRAPD(error, executeCommandL(entry, command)); + TInt error = mCommandHandler->execute(entry, command); USE_QDEBUG_IF(error) << "CaClientProxy::executeCommand - Error (" << error << ")"; @@ -329,27 +329,6 @@ CleanupStack::PopAndDestroy(innerQuery); } -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- -void CaClientProxy::executeCommandL(const CaEntry &entry, - const QString &command) -{ - CCaInnerEntry *innerEntry = CCaInnerEntry::NewLC(); - CaObjectAdapter::convertL(entry, *innerEntry); - - TPtrC16 commandPtr16( - reinterpret_cast(command.utf16())); - HBufC8 *convertedCommand = CnvUtfConverter::ConvertFromUnicodeToUtf7L( - commandPtr16, false); - CleanupStack::PushL(convertedCommand); - if (!mHandler) { - mHandler = CCaHandlerEngine::NewL(); - } - mHandler->HandleCommandL(*innerEntry, convertedCommand->Des()); - CleanupStack::PopAndDestroy(convertedCommand); - CleanupStack::PopAndDestroy(innerEntry); -} //---------------------------------------------------------------------------- // diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/s60/src/cahandlerloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/s60/src/cahandlerloader.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include "cahandlerloader.h" + +/*! + \class CaHandlerLoader + \ingroup + \brief Interface for class of objects providing command handlers. + + \sa CaHandlerLoader +*/ + +/*! + Destructor. +*/ +CaHandlerLoader::~CaHandlerLoader() +{ +} + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/s60/src/cahandlerproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/s60/src/cahandlerproxy.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include "cahandler.h" +#include "cahandlerproxy.h" +#include "cahandlerloader.h" + +/*! + \class CaHandlerProxy + \ingroup + \brief Forwards execute request to an implemenation provided by specific handler loader. + + \sa CaHandlerLoader +*/ + +/*! + Destructor. +*/ +CaHandlerProxy::~CaHandlerProxy() +{ +} + + +/*! + Constructs handler proxy. + \param loader Provides handler implementations. It has to be pointer to a valid object. +*/ +CaHandlerProxy::CaHandlerProxy(CaHandlerLoader *loader): + mLoader(loader) +{ + Q_ASSERT(!mLoader.isNull()); +} + +/*! + Forwards execute request to an appropriate handler if found otherwise ignores the request. + \param entry Subject for the requested command. + \param commandName Name of the command to be executed. + \return KErrNone (i.e. 0) on succes, error code otherwise. + \sa e32err.h for KErrNone definition. +*/ +TInt CaHandlerProxy::execute(const CaEntry &entry, const QString &commandName) +{ + CaHandler *const handler = getHandler(entry, commandName); + + TInt result = KErrNotFound; + + if (handler != NULL) { + result = handler->execute(entry, commandName); + } + + return result; +} + +/*! + Looks for handler implementation in local cache or if not found, request it from + handler loader. + \param entry The entry being a subject for the requested command. + \param commandName Name of the command to be executed. + \return Pointer to a handler instance if available, NULL otherwise. +*/ +CaHandler *CaHandlerProxy::getHandler(const CaEntry &entry, + const QString &commandName) +{ + CaHandler *implementation(0); + + const QString entryTypeName(entry.entryTypeName()); + + const ImplementationMapIterator it( + mImplementationMap.find(entryTypeName)); + + if (it != mImplementationMap.end()) { + implementation = it->data(); + } else { + implementation = mLoader->loadHandler(entryTypeName, commandName); + mImplementationMap[entryTypeName] = QSharedPointer(implementation); + } + + return implementation; +} diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/s60/src/caobjectadapter.cpp --- a/contentstorage/caclient/s60/src/caobjectadapter.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/s60/src/caobjectadapter.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -26,6 +26,7 @@ #include #include #include +#include #include "cadef.h" #include "caobjectadapter.h" @@ -36,6 +37,7 @@ #include "camenuiconutility.h" #include "canotifierfilter.h" #include "cainnernotifierfilter.h" +#include "caclient_defines.h" static QImage::Format TDisplayMode2Format(TDisplayMode mode) { @@ -81,28 +83,34 @@ TDisplayMode displayMode = aBitmap->DisplayMode(); // QImage format must match to bitmap format - QImage image(data, size.iWidth, size.iHeight, TDisplayMode2Format(displayMode)); + QImage image(data, size.iWidth, size.iHeight, TDisplayMode2Format( + displayMode)); aBitmap->EndDataAccess(); - // No data copying happens because image format matches native OpenVG format. + // No data copying happens because + // image format matches native OpenVG format. // So QPixmap actually points to CFbsBitmap data. return QPixmap::fromImage(image); } -// ----------------------------------------------------------------------------- +// --------------------------------------------------------------------------- // -// ----------------------------------------------------------------------------- +// --------------------------------------------------------------------------- void CaObjectAdapter::convertL(const CaEntry &fromEntry, CCaInnerEntry &toEntry) { toEntry.SetId(fromEntry.id()); - toEntry.SetTextL(convertToDescriptor(fromEntry.text())); + toEntry.SetTextL( + XQConversions::qStringToS60Desc(fromEntry.text())->Des()); - toEntry.SetDescriptionL(convertToDescriptor(fromEntry.description())); + toEntry.SetDescriptionL( + XQConversions::qStringToS60Desc(fromEntry.description())->Des()); + toEntry.SetDescriptionL( + XQConversions::qStringToS60Desc(fromEntry.description())->Des()); toEntry.SetEntryTypeNameL( - convertToDescriptor(fromEntry.entryTypeName())); + XQConversions::qStringToS60Desc(fromEntry.entryTypeName())->Des()); toEntry.SetFlags(static_cast(fromEntry.flags())); @@ -112,22 +120,24 @@ fromEntry.iconDescription(); toEntry.SetIconDataL( - static_cast(fromIconDescription.bitmapId()), - static_cast(fromIconDescription.maskId()), - static_cast(fromIconDescription.skinMajorId()), - static_cast(fromIconDescription.skinMinorId()), - convertToDescriptor(fromIconDescription.filename())); + XQConversions::qStringToS60Desc( + fromIconDescription.filename())->Des(), + XQConversions::qStringToS60Desc( + fromIconDescription.skinId())->Des(), + XQConversions::qStringToS60Desc( + fromIconDescription.applicationId())->Des()); const QMap attributesMap = fromEntry.attributes(); foreach(QString key, attributesMap.keys()) { - if (key == applicationUidAttributeName()) { + if (key == APPLICATION_UID_ATTRIBUTE_NAME) { const TInt32 uid = attributesMap.value(key).toInt(); toEntry.SetUid(uid); } else { toEntry.AddAttributeL( - convertToDescriptor(key), - convertToDescriptor(attributesMap.value(key))); + XQConversions::qStringToS60Desc(key)->Des(), + XQConversions::qStringToS60Desc( + attributesMap.value(key))->Des()); } } } @@ -155,7 +165,7 @@ CleanupStack::PushL(sourceList); foreach(const QString str, list) { - sourceList->AppendL(convertToDescriptor(str)); + sourceList->AppendL(XQConversions::qStringToS60Desc(str)->Des()); } toQuery.SetEntryTypeNames(sourceList); @@ -167,20 +177,31 @@ Qt::SortOrder sortOrder; fromQuery.getSort(sortAttr, sortOrder); toQuery.SetSort(CaObjectAdapter::getSortCode(sortAttr, sortOrder)); + + const QMap attributesMap = fromQuery.attributes(); + + foreach(QString key, attributesMap.keys()) { + toQuery.AddAttributeL( + XQConversions::qStringToS60Desc(key)->Des(), + XQConversions::qStringToS60Desc( + attributesMap.value(key))->Des()); + } } //---------------------------------------------------------------------------- // //---------------------------------------------------------------------------- -void CaObjectAdapter::convert(const CCaInnerEntry &fromEntry, - CaEntry &toEntry) +void CaObjectAdapter::convert( + const CCaInnerEntry &fromEntry, CaEntry &toEntry) { toEntry.setId(fromEntry.GetId()); - toEntry.setText(convertToString(fromEntry.GetText())); + toEntry.setText(XQConversions::s60DescToQString(fromEntry.GetText())); - toEntry.setDescription(convertToString(fromEntry.GetDescription())); - toEntry.setEntryTypeName(convertToString(fromEntry.GetEntryTypeName())); + toEntry.setDescription( + XQConversions::s60DescToQString(fromEntry.GetDescription())); + toEntry.setEntryTypeName( + XQConversions::s60DescToQString(fromEntry.GetEntryTypeName())); toEntry.setFlags(static_cast(fromEntry.GetFlags())); @@ -189,50 +210,34 @@ CaIconDescription iconDescription; iconDescription.setId(icon.iId); - iconDescription.setBitmapId(icon.iBitmapId); - iconDescription.setMaskId(icon.iMaskId); - iconDescription.setSkinMajorId(icon.iSkinMajorId); - iconDescription.setSkinMinorId(icon.iSkinMinorId); - iconDescription.setFilename(convertToString(icon.iFileName)); + iconDescription.setFilename( + XQConversions::s60DescToQString(icon.iFileName)); + iconDescription.setSkinId( + XQConversions::s60DescToQString(icon.iSkinId)); + iconDescription.setApplicationId( + XQConversions::s60DescToQString(icon.iApplicationId)); toEntry.setIconDescription(iconDescription); const RCaEntryAttrArray &attributesArray = fromEntry.GetAttributes(); - if (toEntry.entryTypeName() == applicationEntryName() - || toEntry.entryTypeName() == widgetEntryName()) { - toEntry.setAttribute(applicationUidAttributeName(), - QString::number(fromEntry.GetUid())); + if (toEntry.entryTypeName() == APPLICATION_ENTRY_TYPE_NAME + || toEntry.entryTypeName() == WIDGET_ENTRY_TYPE_NAME) { + toEntry.setAttribute(APPLICATION_UID_ATTRIBUTE_NAME, + QString::number(fromEntry.GetUid())); } const int attributesArrayCount = attributesArray.Count(); for (int i = 0; i < attributesArrayCount; ++i) { const CCaEntryAttribute *const attribute = attributesArray[i]; - toEntry.setAttribute(convertToString(attribute->Name()), - convertToString(attribute->Value())); + toEntry.setAttribute( + XQConversions::s60DescToQString(attribute->Name()), + XQConversions::s60DescToQString(attribute->Value())); } } //---------------------------------------------------------------------------- -// !!! Warning: returns wrapper to internal QString representation which may -// get invalid before returned TPtrC object gets out of scope -//---------------------------------------------------------------------------- -const TPtrC CaObjectAdapter::convertToDescriptor(const QString &string) -{ - const TPtrC result(reinterpret_cast(string.utf16())); - return result; -} - -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- -QString CaObjectAdapter::convertToString(const TDesC &des) -{ - return QString::fromUtf16(des.Ptr(), des.Length()); -} - -//---------------------------------------------------------------------------- // //---------------------------------------------------------------------------- void CaObjectAdapter::convertL(const CaNotifierFilter ¬ifierFilter, @@ -265,13 +270,12 @@ const QStringList stringList = notifierFilter.getTypeNames(); foreach(QString str, stringList) { - typeNames->AppendL(convertToDescriptor(str)); + typeNames->AppendL(XQConversions::qStringToS60Desc(str)->Des()); } source.SetTypeNames(typeNames); CleanupStack::Pop(typeNames); - } //---------------------------------------------------------------------------- // @@ -353,32 +357,6 @@ return error; } -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- -const QString &CaObjectAdapter::applicationUidAttributeName() -{ - const static QString name("application:uid"); - return name; -} - -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- -const QString &CaObjectAdapter::applicationEntryName() -{ - const static QString name("application"); - return name; -} - -//---------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -const QString &CaObjectAdapter::widgetEntryName() -{ - const static QString name("widget"); - return name; -} // ----------------------------------------------------------------------------- // copying compressed bitmap @@ -405,14 +383,33 @@ HbIcon CaObjectAdapter::makeIconL(const CaEntry &entry, const QSize &size) { HbIcon icon; - CCaInnerEntry *innerEntry = CCaInnerEntry::NewLC(); - CaObjectAdapter::convertL(entry, *innerEntry); - QString filename(entry.iconDescription().filename()); - if (!filename.isEmpty()) { - icon = HbIcon(filename); + QString skinId(entry.iconDescription().skinId()); + if (!skinId.isEmpty()) { + icon = HbIcon(skinId); } + if (icon.isNull() || !(icon.size().isValid())) { + QString filename(entry.iconDescription().filename()); + if (!filename.isEmpty()) { + + // TODO: + // work-around for HbIcon::size() method locking files if returns + // default size, error id: ou1cimx1#279208 Case: mcl06HsDo07 - + // "Cannot delete file" when trying to uninstall sisx file + + if (entry.entryTypeName() == XQConversions::s60DescToQString(KCaTypeWidget)) { + icon = QIcon(filename); + qWarning("Widget icon created by QIcon, as work-around for HbIcon::size"); + } else { + icon = HbIcon(filename); + } + } + } + //try to load symbian icon from multi-bitmap (mbm, mbg) if (icon.isNull() || !(icon.size().isValid())) { + CCaInnerEntry *innerEntry = CCaInnerEntry::NewLC(); + CaObjectAdapter::convertL(entry, *innerEntry); + CAknIcon *aknIcon = CaMenuIconUtility::GetItemIcon(*innerEntry); QPixmap pixmap; if (aknIcon) { @@ -420,13 +417,13 @@ //need to disable compression to properly convert the bitmap AknIconUtils::DisableCompression(aknIcon->Bitmap()); - AknIconUtils::SetSize(aknIcon->Bitmap(), TSize(size.width(), - size.height()), EAspectRatioPreservedAndUnusedSpaceRemoved); + AknIconUtils::SetSize( + aknIcon->Bitmap(), TSize(size.width(), size.height()), + EAspectRatioPreservedAndUnusedSpaceRemoved); if (aknIcon->Bitmap()->Header().iCompression == ENoBitmapCompression) { pixmap = fromSymbianCFbsBitmap(aknIcon->Bitmap()); - QPixmap mask = fromSymbianCFbsBitmap( - aknIcon->Mask()); + QPixmap mask = fromSymbianCFbsBitmap(aknIcon->Mask()); 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 @@ -443,8 +440,8 @@ CleanupStack::PopAndDestroy(aknIcon); icon = HbIcon(QIcon(pixmap)); } + CleanupStack::PopAndDestroy(innerEntry); } - CleanupStack::PopAndDestroy(innerEntry); return icon; } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/s60/src/caqtsfhandlerloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/s60/src/caqtsfhandlerloader.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include +#include +#include +#include + +#include "cahandler.h" +#include "caqtsfhandlerloader.h" +#include "caclient_defines.h" +#include "caapphandler.h" +#include "caurlhandler.h" +#include "catapphandler.h" +#include "cas60handleradapter.h" + +QTM_USE_NAMESPACE + +/*! + \class CaQtSfHandlerLoader + \ingroup + \brief Loads handlers implementation + + The purpose of the class is to find Qt SF plugins implementing command handlers. + Temporarily because of issues with Qt SF this is replaced by immediate object + creation. + \sa CaHandlerLoader +*/ + +/*! + Loads handler implementations appropriate for the requested entry type name and command. + + The caller takes ownership of the returned pointer. + + \param entryTypeName Entry type name. + \param commandName Name of the command to be handled. + \return A pointer to handler serving the entry type and command if found, NULL otherwise. +*/ +CaHandler *CaQtSfHandlerLoader::loadHandler(const QString &entryTypeName, + const QString &commandName) +{ + Q_UNUSED(commandName); + + CaHandler *implementation(0); + + if (entryTypeName == APPLICATION_ENTRY_TYPE_NAME + || entryTypeName == WIDGET_ENTRY_TYPE_NAME) { + implementation = new CaS60HandlerAdapter; + } else if (entryTypeName == URL_ENTRY_TYPE_NAME) { + implementation = new CaS60HandlerAdapter; + } else if (entryTypeName == TEMPLATED_APPLICATION_ENTRY_TYPE_NAME) { + implementation = new CaTappHandler; + } + + return implementation; +} + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/src/caicondescription.cpp --- a/contentstorage/caclient/src/caicondescription.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/src/caicondescription.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -127,76 +127,41 @@ m_d->setFileName(filename); } -/*! - Returns bitmap id. - \retval bitmap id. - */ -int CaIconDescription::bitmapId() const -{ - return m_d->bitmapId(); -} /*! - Sets bitmap id - \param bitmap id + Returns skin id. + \retval skin id. */ -void CaIconDescription::setBitmapId(int id) +QString CaIconDescription::skinId() const { - m_d->setBitmapId(id); -} - -/*! - Returns icon mask id - \retval icon mask id - */ -int CaIconDescription::maskId() const -{ - return m_d->maskId(); + return m_d->skinId(); } /*! - Sets icon mask id - \param icon mask id + Sets skin id + \param skin id */ -void CaIconDescription::setMaskId(int id) +void CaIconDescription::setSkinId(const QString &skinId) { - m_d->setMaskId(id); -} - -/*! - Returns skin major id - \retval skin major id - */ -int CaIconDescription::skinMajorId() const -{ - return m_d->skinMajorId(); + m_d->setSkinId(skinId); } /*! - Sets skin major id - \param skin major id + Returns icon application id. + \retval icon application id. */ -void CaIconDescription::setSkinMajorId(int id) +QString CaIconDescription::applicationId() const { - m_d->setSkinMajorId(id); + return m_d->applicationId(); } /*! - Returns skin minor id - \retval skin minor id + Sets icon application id. + \param QString with icon application id. */ -int CaIconDescription::skinMinorId() const +void CaIconDescription::setApplicationId(const QString &applicationId) { - return m_d->skinMinorId(); -} - -/*! - Sets skin minor id - \param skin minor id - */ -void CaIconDescription::setSkinMinorId(int id) -{ - m_d->setSkinMinorId(id); + m_d->setApplicationId(applicationId); } /*! @@ -214,8 +179,8 @@ */ CaIconDescriptionPrivate::CaIconDescriptionPrivate( CaIconDescription *iconDescriptionPublic) : - m_q(iconDescriptionPublic), mBitmapId(0), mMaskId(0), mSkinMajorId(0), - mSkinMinorId(0) + m_q(iconDescriptionPublic), mId(0), mFilename(), mSkinId(), + mApplicationId(0) { } @@ -257,73 +222,38 @@ Returns bitmap id. \retval bitmap id. */ -int CaIconDescriptionPrivate::bitmapId() const +QString CaIconDescriptionPrivate::skinId() const { - return mBitmapId; -} - -/*! - Sets bitmap id. - \param bitmap id. - */ -void CaIconDescriptionPrivate::setBitmapId(int bitmapId) -{ - mBitmapId = bitmapId; + return mSkinId; } /*! - Returns icon mask id. - \retval icon mask id. + Sets skin id. + \param skinId skin id. */ -int CaIconDescriptionPrivate::maskId() const +void CaIconDescriptionPrivate::setSkinId(const QString &skinId) { - return mMaskId; -} - -/*! - Sets icon mask id. - \param maskId icon mask id. - */ -void CaIconDescriptionPrivate::setMaskId(int maskId) -{ - mMaskId = maskId; + mSkinId = skinId; } /*! - Returns skin major id. - \retval skin major id. + Returns icon application id. + \retval icon application id. */ -int CaIconDescriptionPrivate::skinMajorId() const +QString CaIconDescriptionPrivate::applicationId() const { - return mSkinMajorId; + return mApplicationId; } /*! - Sets skin major id. - \param id skin major id. + Sets icon application id. + \param applicationId icon application id. */ -void CaIconDescriptionPrivate::setSkinMajorId(int id) +void CaIconDescriptionPrivate::setApplicationId(const QString &applicationId) { - mSkinMajorId = id; + mApplicationId = applicationId; } -/*! - Returns skin minor id. - \retval skin minor id. - */ -int CaIconDescriptionPrivate::skinMinorId() const -{ - return mSkinMinorId; -} - -/*! - Sets skin minor id. - \param skin minor id. - */ -void CaIconDescriptionPrivate::setSkinMinorId(int id) -{ - mSkinMinorId = id; -} /*! Sets icon id. diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/src/caitemmodel.cpp --- a/contentstorage/caclient/src/caitemmodel.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/src/caitemmodel.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -706,17 +706,19 @@ mEntries.updateEntry(id); QList ids = mService->getEntryIds(mQuery); - if (mEntries.indexOf(id) >= 0 && ids.indexOf(id) - == mEntries.indexOf(id)) { + if (mEntries.indexOf(id) >= 0 + && ids.indexOf(id) == mEntries.indexOf(id)) { emit m_q->dataChanged(index(mEntries.indexOf(id)), index( mEntries.indexOf(id))); + } else if (ids.indexOf(id) < 0){ + removeItem(id); + } else if (mEntries.indexOf(id) < 0){ + addItem(id); + } else if (mParentEntry && id == mParentEntry->id()) { + updateParentEntry(); + m_q->reset(); } else { - if (mParentEntry && id == mParentEntry->id()) { - updateParentEntry(); - m_q->reset(); - } else { - updateLayout(); - } + updateModel(); } CACLIENTTEST_FUNC_EXIT("CaItemModelPrivate::updateItemData"); } @@ -751,11 +753,25 @@ int entriesCount = mEntries.count(); if (entriesCount) { int lastRow = itemsList.indexOf(mEntries[entriesCount - 1]); - if (itemsList.count() == entriesCount && lastRow == (entriesCount - - 1)) { + if (itemsList.count() == entriesCount) { //count is same and last item is in same position //so we update whole model - updateModel(); + bool orderChanged(false); + while (entriesCount) { + if (itemsList.indexOf(mEntries[entriesCount - 1]) + != (entriesCount - 1)) { + orderChanged = true; + break; + } + entriesCount--; + } + if (orderChanged) { + updateLayout(); + } + else { + updateModel(); + } + } else if ((itemsList.count() - entriesCount) == 1 && lastRow == entriesCount) { //just one item added - collection @@ -773,15 +789,15 @@ i++; } } else { - //some items were inserted or reordered, - //so we update layout and emit signal with row number + //some items were inserted + //so we update model and emit signal with row number //of first moved/added item //signal is needed to scroll a view to proper position after //some items were added - updateLayout(); + updateModel(); emit m_q->scrollTo(lastRow + 1, QAbstractItemView::PositionAtTop); - } + } } else { updateModel(); } @@ -815,9 +831,8 @@ mEntries.remove(id); m_q->endRemoveRows(); } else { - updateLayout(); + updateModel(); } - CACLIENTTEST_FUNC_EXIT("CaItemModelPrivate::removeItem"); } @@ -843,13 +858,45 @@ /*! Layout update + NOTE: this method should be called only if the entries get rearranged + and do not change their contents! */ void CaItemModelPrivate::updateLayout() { CACLIENTTEST_FUNC_ENTRY("CaItemModelPrivate::updateLayout"); m_q->layoutAboutToBeChanged(); + + // get the ID list from before the update + QList oldOrderedIdList = mEntries.orderedIdList(); + + // do the update, the entries should only get rearranged mEntries.updateEntries(mQuery); - updateParentEntry(); + + // get the new ID list after the entries got rearranged + QList newOrderedIdList = mEntries.orderedIdList(); + // this list will contain the new position indices + QList newPositionsList; + int entry; + foreach (entry, oldOrderedIdList) { + newPositionsList << newOrderedIdList.indexOf(entry); + } + + // now check which items in the previous persistent index list changed + // their positions, make new indices for them and store in the new + // persistent index list + QModelIndexList oldPersistentIndexList = m_q->persistentIndexList(); + QModelIndexList newPersistentIndexList; + QModelIndex index; + foreach (index, oldPersistentIndexList) { + newPersistentIndexList << + m_q->createIndex( + newPositionsList.at(index.row()), + 0, + index.internalPointer()); + } + + m_q->changePersistentIndexList(oldPersistentIndexList, newPersistentIndexList); + m_q->layoutChanged(); CACLIENTTEST_FUNC_EXIT("CaItemModelPrivate::updateLayout"); } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/src/caitemmodellist.cpp --- a/contentstorage/caclient/src/caitemmodellist.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/src/caitemmodellist.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -170,3 +170,12 @@ { return mOrderedList[row]; } + +/*! + Returns on ordered list of entry IDs + \retval Copy of the internal ID list + */ +QList CaItemModelList::orderedIdList() +{ + return mOrderedList; +} diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/src/caquery.cpp --- a/contentstorage/caclient/src/caquery.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/src/caquery.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -232,6 +232,44 @@ } /*! + Returns query attributes. + \retval map of attributes indexed by their names. + */ +QMap CaQuery::attributes() const +{ + return m_d->attributes(); +} + +/*! + Returns an attribute + \param name name of an attribute + \retval value of attribute + */ +QString CaQuery::attribute(const QString &name) const +{ + return m_d->attribute(name); +} + +/*! + Sets attribute. + \param name name of an attribute. + \param value value of an attribute. + */ +void CaQuery::setAttribute(const QString &name, const QString &value) +{ + m_d->setAttribute(name, value); +} + +/*! + Removes attribute. + \param name name of an attribute. + */ +void CaQuery::removeAttribute(const QString &name) +{ + m_d->removeAttribute(name); +} + +/*! Clears query (restores the initial state). */ void CaQuery::clear() @@ -247,7 +285,7 @@ m_q(queryPublic), mEntryRoles(ItemEntryRole | GroupEntryRole), mParentId(0), mEntryTypeNames(), mFlagsOn(), mFlagsOff(), mSortAttribute(DefaultSortAttribute), - mSortOrder(Qt::AscendingOrder), mCount(0) + mSortOrder(Qt::AscendingOrder), mCount(0), mAttributes() { } @@ -269,6 +307,7 @@ mSortAttribute = queryPrivate.mSortAttribute; mSortOrder = queryPrivate.mSortOrder; mCount = queryPrivate.mCount; + mAttributes = queryPrivate.mAttributes; return *this; } @@ -422,6 +461,42 @@ } /*! + \retval map of attributes indexed by their names + */ +QMap CaQueryPrivate::attributes() const +{ + return mAttributes; +} + +/*! + \param name name of an attribute + \retval value of attribute + */ +QString CaQueryPrivate::attribute(const QString &name) const +{ + return mAttributes.value(name); +} + +/*! + Sets attribute. + \param name name of an attribute. + \param value value of an attribute. + */ +void CaQueryPrivate::setAttribute(const QString &name, const QString &value) +{ + mAttributes.insert(name, value); +} + +/*! + Removes an attribute. + \param name name of an attribute. + */ +void CaQueryPrivate::removeAttribute(const QString &name) +{ + mAttributes.remove(name); +} + +/*! Clears query (restores the initial state). */ void CaQueryPrivate::clear() diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/src/caservice.cpp --- a/contentstorage/caclient/src/caservice.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/src/caservice.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -830,14 +830,13 @@ bool CaService::executeCommand(int entryId, const QString &command) const { bool result = false; - + CaEntry *const temporaryEntry = getEntry(entryId); - + if (temporaryEntry != NULL) { result = executeCommand(*temporaryEntry, command); delete temporaryEntry; } - return result; } @@ -935,7 +934,7 @@ \param servicePublic pointer to public service */ CaServicePrivate::CaServicePrivate(CaService *servicePublic) : - m_q(servicePublic), mProxy(new CaClientProxy()) + m_q(servicePublic), mProxy(new CaClientProxy) { const ErrorCode connectionResult = mProxy->connect(); diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/stub/src/caclientproxy.cpp --- a/contentstorage/caclient/stub/src/caclientproxy.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/stub/src/caclientproxy.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -36,7 +36,7 @@ const char *DATABASE_CONNECTION_NAME = "CaService"; const char *DATABASE_TYPE = "QSQLITE"; -const char *DATABASE_NAME = "castoragedb"; +const char *DATABASE_NAME = "castorage.db"; static QSqlDatabase dbConnection() { @@ -498,7 +498,7 @@ QSqlQuery query(db); query.prepare( "SELECT ENTRY_ID, EN_TEXT, EN_DESCRIPTION, EN_TYPE_NAME, EN_FLAGS, EN_ROLE, EN_UID, \ - ICON_ID, IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID, IC_FILENAME \ + ICON_ID, IC_FILENAME, IC_SKIN_ID, IC_APP_ID \ FROM CA_ENTRY LEFT JOIN CA_ICON ON EN_ICON_ID = ICON_ID WHERE ENTRY_ID = ?"); query.addBindValue(i); @@ -522,16 +522,13 @@ CaIconDescription icon; CaObjectAdapter::setId(icon, query.value(query.record().indexOf("ICON_ID")).toInt()); - icon.setBitmapId(query.value(query.record().indexOf( - "IC_BITMAP_ID")).toInt()); - icon.setMaskId(query.value(query.record().indexOf( - "IC_MASK_ID")).toInt()); - icon.setSkinMajorId(query.value(query.record().indexOf( - "IC_SKINMAJOR_ID")).toInt()); - icon.setSkinMinorId(query.value(query.record().indexOf( - "IC_SKINMINOR_ID")).toInt()); + icon.setFilename(query.value(query.record().indexOf( "IC_FILENAME")).toString()); + icon.setSkinId(query.value(query.record().indexOf( + "IC_SKIN_ID")).toString()); + icon.setApplicationId(query.value(query.record().indexOf( + "IC_APP_ID")).toString()); entry->setIconDescription(icon); // attributes @@ -608,7 +605,6 @@ whereStatement.append(" AND ").append(QString().setNum( query.entryRoles())) .append(" | EN_ROLE == ").append( QString().setNum(query.entryRoles())); - //TODO: by uid??? if (query.entryTypeNames().count()) { whereStatement.append(" AND EN_TYPE_NAME IN ("); @@ -620,11 +616,48 @@ whereStatement.append(") "); } + QString whereAttributes; + if (query.attributes().count()) { + QMap attributes = query.attributes(); + QMapIterator atrIt(attributes); + int j = 1; + while (atrIt.hasNext()) { + atrIt.next(); + + // at1.AT_NAME = 'Attribute_Name_1' AND at1.AT_VALUE = 'Attribute_VALUE_1' + whereAttributes.append(" AND ").append( + " at").append(QString().setNum(j)).append(".AT_NAME = \'").append( + atrIt.key()).append("\' ").append( + " AND ").append( + " at").append(QString().setNum(j)).append(".AT_VALUE = \'").append( + atrIt.value()).append("\' "); + + j++; + } + whereStatement.append(whereAttributes); + + } + + whereStatement.append(" GROUP BY ENTRY_ID "); + + QString leftJoins; + if (query.attributes().count()) { + for (int j=1; j<=query.attributes().count(); j++) { + // LEFT JOIN CA_ATTRIBUTE as at1 ON ENTRY_ID = at1.AT_ENTRY_ID + leftJoins.append( + " LEFT JOIN CA_ATTRIBUTE as at").append(QString().setNum(j)).append( + " ON ENTRY_ID = at").append(QString().setNum(j)).append(" .AT_ENTRY_ID "); + } + } + QSqlQuery sqlquery(db); if (query.parentId() == 0) { // sort - QString queryString("SELECT ENTRY_ID from CA_ENTRY where 1=1 "); + QString queryString("SELECT ENTRY_ID from CA_ENTRY "); + queryString.append(leftJoins); + queryString.append(" where 1=1 "); queryString.append(whereStatement); + modifyQueryForSortOrder(queryString, query, false); if (query.count() > 0) queryString.append(" LIMIT ").append(query.count()); @@ -639,11 +672,13 @@ } } } else { - QString - queryString( - "SELECT ENTRY_ID FROM CA_ENTRY \ - LEFT JOIN CA_GROUP_ENTRY ON GE_ENTRY_ID = ENTRY_ID WHERE GE_GROUP_ID = ? "); - queryString.append(whereStatement); + + QString queryString("SELECT ENTRY_ID FROM CA_ENTRY "); + QString queryString2(" LEFT JOIN CA_GROUP_ENTRY ON GE_ENTRY_ID = ENTRY_ID WHERE GE_GROUP_ID = ? "); + queryString2.append(whereStatement); + queryString.append(leftJoins); + queryString.append(queryString2); + modifyQueryForSortOrder(queryString, query, true); if (query.count() > 0) queryString.append(" LIMIT ").append(query.count()); @@ -755,9 +790,9 @@ return error; } -/*! - //TODO: - */ +//---------------------------------------------------------------------------- +// +//---------------------------------------------------------------------------- void CaClientProxy::modifyQueryForSortOrder(QString &queryString, const CaQuery &query, bool parent) const { @@ -805,28 +840,24 @@ } -/*! - //TODO: - */ +//---------------------------------------------------------------------------- +// +//---------------------------------------------------------------------------- bool CaClientProxy::setIconInDb(CaEntry *entryClone) const { //set icon information into db QSqlQuery query(dbConnection()); query.prepare( - "SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = :IC_FILENAME \ - AND IC_BITMAP_ID = :IC_BITMAP_ID \ - AND IC_MASK_ID = :IC_MASK_ID \ - AND IC_SKINMAJOR_ID = :IC_SKINMAJOR_ID \ - AND IC_SKINMINOR_ID = :IC_SKINMINOR_ID"); + "SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = :IC_FILENAME" + " AND IC_SKIN_ID = :IC_SKIN_ID" + " AND IC_APP_ID = :IC_APP_ID"); query.bindValue(":IC_FILENAME", entryClone->iconDescription().filename()); - query.bindValue(":IC_BITMAP_ID", - entryClone->iconDescription().bitmapId()); - query.bindValue(":IC_MASK_ID", entryClone->iconDescription().maskId()); - query.bindValue(":IC_SKINMAJOR_ID", - entryClone->iconDescription().skinMajorId()); - query.bindValue(":IC_SKINMINOR_ID", - entryClone->iconDescription().skinMinorId()); + query.bindValue(":IC_SKIN_ID", + entryClone->iconDescription().filename()); + query.bindValue(":IC_APP_ID", + entryClone->iconDescription().filename()); + bool success = query.exec(); if (success && query.next()) { @@ -834,19 +865,17 @@ int iconId = query.value(query.record().indexOf("ICON_ID")).toInt(); qDebug() << "iconId = " << iconId; CaIconDescription iconDescription = entryClone->iconDescription(); - if (iconId <= 0 && (iconDescription.filename() != "" - || iconDescription.bitmapId() != 0 || iconDescription.maskId() != 0 - || iconDescription.skinMajorId() != 0 - || iconDescription.skinMinorId() != 0)) { + if (iconId <= 0 + && (!iconDescription.filename().isEmpty() + || !iconDescription.skinId().isEmpty() + || !iconDescription.applicationId().isEmpty())) { query.prepare( - "INSERT INTO CA_ICON \ - (IC_FILENAME,IC_BITMAP_ID,IC_MASK_ID,IC_SKINMAJOR_ID,IC_SKINMINOR_ID) \ - VALUES ( ? , ? , ? , ? , ? )"); + "INSERT INTO CA_ICON" + " (IC_FILENAME, IC_SKIN_ID, IC_APP_ID)" + " VALUES ( ? , ? , ? , ? , ? )"); query.addBindValue(iconDescription.filename()); - query.addBindValue(iconDescription.bitmapId()); - query.addBindValue(iconDescription.maskId()); - query.addBindValue(iconDescription.skinMajorId()); - query.addBindValue(iconDescription.skinMinorId()); + query.addBindValue(iconDescription.skinId()); + query.addBindValue(iconDescription.applicationId()); success = query.exec(); qDebug() << query.executedQuery(); iconId = query.lastInsertId().toInt(); @@ -857,9 +886,9 @@ return success; } -/*! - //TODO: - */ +//---------------------------------------------------------------------------- +// +//---------------------------------------------------------------------------- bool CaClientProxy::setEntryInDb(CaEntry *entryClone) const { QSqlQuery query(dbConnection()); @@ -911,9 +940,9 @@ return success; } -/*! - //TODO: - */ +//---------------------------------------------------------------------------- +// +//---------------------------------------------------------------------------- bool CaClientProxy::setAttributesInDb(CaEntry *entryClone) const { bool success = true; diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/app/app.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/app/app.pri Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,12 @@ +# 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: +HEADERS += ./inc/*.h ../inc/*.h +SOURCES += ./src/*.cpp diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/app/app.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/app/app.pro Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,56 @@ +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# Initial Contributors: +# Nokia Corporation - initial contribution. +# Contributors: +# Description: + +TEMPLATE = lib +TARGET = caapphandlerplugin +CONFIG += plugin hb mobility +MOBILITY = serviceframework + +PLUGIN_SUBDIR = /hsresources/plugins/commandhandler + +include(../../../common.pri) + + +DEPENDPATH += ./inc \ + ./src + +INCLUDEPATH += ./inc \ + ../../inc \ + ../../cautils/inc \ + ../../caclient/inc \ + ../../caclient/s60/inc \ + $$MW_LAYER_SYSTEMINCLUDE + +include(app.pri) + +symbian: { + TARGET.UID3 = 0x20022F83 + + LIBS += \ + -leuser \ + -lecom \ + -lswinstcli \ + -lcautils \ + -lcaclient \ + -lapgrfx \ + -lws32 \ + -lapparc \ + -lsisregistryclient \ + -leikcore \ + -lcone \ + -lefsrv \ + -lxqutils + + + exists($${EPOCROOT}epoc32/include/mw/XQSettingsManager):LIBS += -lxqsettingsmanager +} + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/app/inc/caapphandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/app/inc/caapphandler.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,89 @@ +/* + * 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 C_CAAPPHANDLER_H +#define C_CAAPPHANDLER_H + +#include + +// forward declarations +class CEikonEnv; +class CCaInnerEntry; +class CCaUninstallOperation; + +/** + * Command handler for application entries. + * + * @lib caclient.lib + */ +NONSHARABLE_CLASS( CCaAppHandler ) + { + +public: + /** + * Allocates memory for and initializes CCaAppHandler object + */ + static CCaAppHandler* NewL(); + + /** + * Destructor. + */ + virtual ~CCaAppHandler(); + +protected: + + CCaAppHandler(); + + void ConstructL(); + +public: + + /** + * Handle command. + * @param aItem Item of supported type. + * @param aCommand Command. + * @param aParams. Command parameters. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + */ + void HandleCommandL( CCaInnerEntry& aEntry, const TDesC8& aCommand ); + +private: + /** + * Launches application + * @param aUid UID of the application to launch + * @param aParam command parameters + * @param aViewId id of the view the application is to start in + */ + void LaunchApplicationL( const TUid aUid, const TDesC8 &aParam, + TInt aViewId ); + + /** + * Closes application + * @param aEntry the entry represeting application to close + */ + void CloseApplicationL( CCaInnerEntry& aEntry ); + +private: + // data + + CEikonEnv* iEikEnv; + CCaUninstallOperation* iUninstallOperation; + }; + +#endif // C_CAAPPHANDLER_H diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/app/inc/caapphandlerplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/app/inc/caapphandlerplugin.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,37 @@ +/* + * 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 CA_APP_HANDLER_PLUGIN_H +#define CA_APP_HANDLER_PLUGIN_H + +#include +#include + +QTM_USE_NAMESPACE + +class CaAppHandlerPlugin : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session); +}; + +#endif diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/app/inc/catasklist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/app/inc/catasklist.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,98 @@ +/* + * 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 CATASKLIST_H +#define CATASKLIST_H + +// INCLUDES + +#include +#include + +// CLASS DECLARATION + +/** +* Class for finding out about running applications. +* +* This is a modification of the original CAknTaskList class, which +* differs in that it does not discriminate applications based on their +* window group priority. +*/ +class CCaTaskList : public CBase + { +public: + + /** + * Factory function + * @param aWsSession an open session to the window server, often from CEikonEnv::WsSession() + * @return a new fully constructed instance of CCaTaskList + */ + static CCaTaskList* NewL( RWsSession& aWsSession ); + + /** + * Factory function + * @param aWsSession an open session to the window server, often from CEikonEnv::WsSession() + * @return a new fully constructed instance of CCaTaskList, which is on the cleanup stack + */ + + static CCaTaskList* NewLC( RWsSession& aWsSession ); + /** + * Destructor. + */ + ~CCaTaskList(); + + /** + * Refresh the window group array + */ + void UpdateListL(); + + /** + * Accessor for the window group array + * @return an array containing the window groups of running applications. + */ + const RArray& WgArray() const; + + /** + * Find an application with the requested UID 3, which is running as a root application + * @param aAppUid the UID 3 of the target application. + * @return a TApaTask which refers to the running instance of the application. + * if the application is not running, the TApaTask's Exists() function will return EFalse. + */ + TApaTask FindRootApp( TUid aAppUid ) const; + + /** + * Query whether an application's window group is running as a root application. + * @param aWgId the window group identifier of the target application. + * @return ETrue if this window group is running as a root window group. + */ + TBool IsRootWindowGroup( TInt aWgId ) const; + +private: + + CCaTaskList( RWsSession& aWsSession ); + + void ConstructL(); + +private: + + RWsSession& iWs; + + RArray iWgs; + + }; + +#endif diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/app/inc/cauninstalloperation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/app/inc/cauninstalloperation.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,98 @@ +/* + * 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 C_CAUNINSTALLOPERATION_H +#define C_CAUNINSTALLOPERATION_H + +#include +#include + +/** + * Uninstall CMenuOperation + * Encapsulates the functionality of uninstalling an application. + * + * @lib caclient.lib + */ +NONSHARABLE_CLASS(CCaUninstallOperation): public CActive { + +public: + /** + * Destructor + */ + virtual ~CCaUninstallOperation(); + + /** + * Two-phased constructor. Leaves on failure. + * Allocates memory for and constructs an uninstaller object. After that + * starts asynchronous uninnstallation of the requested entry + * @param aEntry entry to be uninstalled + * @param aPriority priority of the active scheduler responsible for handling + * asynchronous installation operation + * @return The constructed object. + */ + static CCaUninstallOperation *NewL(CCaInnerEntry &aEntry, + TInt aPriority = CActive::EPriorityStandard); + +private: + // construction + /** + * Constructor. + * Starts active scheduler. + * @param aEntry entry to be uninstalle + * @param aPriority priority of the active scheduler responsible for handling + * asynchronous installation operation + */ + CCaUninstallOperation(CCaInnerEntry &aEntry, TInt aPriority); + + /** + * Initializes the object and starts asynchronous uninstallation process. + * @param aEntry entry to be uninstalle + * asynchronous installation operation + */ + void ConstructL(CCaInnerEntry &aEntry); + + /** + * Retrieves package information for requested application uid + * @param aAppUid application uid + @param aMimeType placeholder for resulting mime type of the package + * @param aPackageUid placeholder for resulting package uid of the application + */ + void AppInfoL(const TUid &aAppUid, TPtrC8 &aMimeType, TUid &aPackageUid); + + /** + * Retrieves package uid + * @param aAppFullName application full name + @param aPackageUid placeholder for resulting package uid of the application + @return true if package uid was found + */ + TBool GetInstallPkgUidL(const TDesC &aAppFullName, TUid &aPackageUid); + +private: + // from CActive + + void RunL(); + void DoCancel(); + TInt RunError(TInt aError); + +private: + + CCaInnerEntry &iEntry; + SwiUI::RSWInstLauncher iUninstaller; + TInt iId; +}; + +#endif // C_CAUNINSTALLOPERATION_H diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/app/resource/caapphandlerplugin.s60xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/app/resource/caapphandlerplugin.s60xml Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,13 @@ + + + caapphandlerplugin + z:/hsresources/plugins/commandhandler/caapphandlerplugin.qtplugin + + + com.nokia.homescreen.ICommandHandler + 1.0 + + + application + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/app/resource/caapphandlerplugin.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/app/resource/caapphandlerplugin.xml Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,13 @@ + + + caapphandlerplugin + caapphandlerplugin + + + com.nokia.homescreen.ICommandHandler + 1.0 + + + application + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/app/src/caapphandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/app/src/caapphandler.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: ?Description + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "caapphandler.h" +#include "cainnerentry.h" +#include "cauninstalloperation.h" +#include"catasklist.h" + +#include "cautils.h" +#include "cadef.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCaAppHandler::~CCaAppHandler() +{ + delete iUninstallOperation; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCaAppHandler *CCaAppHandler::NewL() +{ + CCaAppHandler *handler = new(ELeave) CCaAppHandler(); + CleanupStack::PushL( handler ); + handler->ConstructL(); + CleanupStack::Pop( handler ); + return handler; +} + +// --------------------------------------------------------- +// CCaAppHandler::CCaAppHandler +// --------------------------------------------------------- +// +CCaAppHandler::CCaAppHandler() +{ + iEikEnv = CEikonEnv::Static(); + iUninstallOperation = NULL; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCaAppHandler::ConstructL() +{ +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCaAppHandler::HandleCommandL( + CCaInnerEntry &aEntry, const TDesC8 &aCommand ) +{ + if( aCommand == KCaCmdOpen() + && aEntry.GetEntryTypeName() == KCaTypeApp() ) + { + TInt viewId(-1); + TBuf viewIdValue; + if( aEntry.FindAttribute( KCaAttrView(), viewIdValue ) ) + { + if( MenuUtils::GetTUint( viewIdValue, (TUint &) viewId ) + != KErrNone ) + { + User::Leave( KErrCorrupt ); + } + } + LaunchApplicationL( + TUid::Uid( aEntry.GetUid() ), KNullDesC8(), viewId ); + } + else if ( aCommand == KCaCmdClose() + && aEntry.GetEntryTypeName() == KCaTypeApp() ) + { + CloseApplicationL( aEntry ); + } + else if ( aCommand == KCaCmdRemove() + && ( aEntry.GetEntryTypeName() == KCaTypeApp() + || aEntry.GetEntryTypeName() == KCaTypeWidget() ) ) + { + if ( iUninstallOperation && iUninstallOperation->IsActive() ) + { + User::Leave( KErrInUse ); + } + delete iUninstallOperation; + iUninstallOperation = NULL; + iUninstallOperation = CCaUninstallOperation::NewL( aEntry ); + } + else + { + User::Leave( KErrNotSupported ); + } +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCaAppHandler::LaunchApplicationL( + const TUid aUid, const TDesC8 &aParam, TInt aViewId ) +{ + if( aViewId > 0 && iEikEnv ) + { + TUid viewId = TUid::Uid( aViewId ); + TVwsViewId view( aUid, viewId ); + iEikEnv->EikAppUi()->ActivateViewL( view ); + } + else + { + RWsSession wsSession; + User::LeaveIfError( wsSession.Connect() ); + CleanupClosePushL( wsSession ); + + CCaTaskList* taskList = CCaTaskList::NewLC( wsSession ); + TApaTask task = taskList->FindRootApp( aUid ); + CleanupStack::PopAndDestroy( taskList ); + + if( task.Exists() ) + { + task.BringToForeground(); + } + else + { + TApaAppInfo appInfo; + TApaAppCapabilityBuf capabilityBuf; + RApaLsSession appArcSession; + User::LeaveIfError( appArcSession.Connect() ); + CleanupClosePushL( appArcSession ); + + User::LeaveIfError( appArcSession.GetAppInfo( appInfo, aUid ) ); + User::LeaveIfError( appArcSession.GetAppCapability( + capabilityBuf, aUid ) ); + + TApaAppCapability &caps = capabilityBuf(); + TFileName appName = appInfo.iFullName; + CApaCommandLine *cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetExecutableNameL( appName ); + + if( caps.iLaunchInBackground ) + { + cmdLine->SetCommandL( EApaCommandBackground ); + } + else + { + cmdLine->SetCommandL( EApaCommandRun ); + } + + cmdLine->SetTailEndL( aParam ); + + User::LeaveIfError( appArcSession.StartApp( *cmdLine ) ); + + CleanupStack::PopAndDestroy( cmdLine ); + CleanupStack::PopAndDestroy( &appArcSession ); + } + CleanupStack::PopAndDestroy( &wsSession ); + } +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCaAppHandler::CloseApplicationL( CCaInnerEntry &aEntry ) +{ + RWsSession wsSession; + User::LeaveIfError( wsSession.Connect() ); + CleanupClosePushL( wsSession ); + + if( ( aEntry.GetFlags() & ERunning ) + && !( aEntry.GetFlags() & ESystem ) ) + { + RBuf value; + CleanupClosePushL( value ); + value.CreateL( KCaMaxAttrValueLen ); + if( aEntry.FindAttribute( KCaAttrWindowGroupId, value ) ) + { + TInt wgId( KErrNotFound ); + TLex16 parser( value ); + if( KErrNone == parser.Val( wgId ) && wgId > 0 ) + { + TWsEvent event; + event.SetTimeNow(); + event.SetType( KAknShutOrHideApp ); + wsSession.SendEventToWindowGroup( wgId, event ); + } + } + CleanupStack::PopAndDestroy( &value ); + } + + CleanupStack::PopAndDestroy( &wsSession ); +} + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/app/src/caapphandlerplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/app/src/caapphandlerplugin.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include +#include +#include "cahandlerloader.h" + +#include "caapphandler.h" +#include "caapphandlerplugin.h" +#include "cas60handleradapter.h" + +/*! + \class CaAppHandlerPlugin + \ingroup + \brief Implementation of Qt SF plugin for application command handler. +*/ + +/*! + \param descriptor Service descriptor. + \param context Ignored. + \param session Ignored. + \return An instance of the CaS60HandlerAdapter when descriptor interface name + is "com.nokia.homescreen.ICommandHandler", NULL otherwise. +*/ +QObject *CaAppHandlerPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == + "com.nokia.homescreen.ICommandHandler") { + return new CaS60HandlerAdapter; + } else { + return 0; + } +} +// TODO: uncomment when it will be used in plugin +//Q_EXPORT_PLUGIN2(caapphandlerplugin, CaAppHandlerPlugin) + + +/*! + \class CaHandler + \ingroup + \brief Interface for command handlers +*/ + +/*! + \fn int CaHandler::execute(const CaEntry &entry, const QString &commandName) = 0 + \param entry Subject of the command. + \param commandName The name of the command to execute. + Returns 0 on success, error code otherwise. + \sa e32err.h for error code descriptions. +*/ + +/*! + \class CaS60HandlerAdapter + \ingroup + \brief Adapter for S60 command handlers. + + Adapts S60 command handlers to CaHandler interface + + \sa CaHandler +*/ + +/*! + \fn int CaS60HandlerAdapter::execute(const CaEntry &entry, const QString &commandName) + \param entry Subject of the command. + \param commandName The name of the command to execute. + \return 0 on success, error code otherwise. + \sa e32err.h for error code descriptions. +*/ diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/app/src/catasklist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/app/src/catasklist.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: ?Description + * + */ + +#include + +#include"catasklist.h" + +CCaTaskList* CCaTaskList::NewL( RWsSession& aWsSession ) + { + CCaTaskList* self = NewLC( aWsSession ); + CleanupStack::Pop( self ); + return self; + } + +CCaTaskList* CCaTaskList::NewLC( RWsSession& aWsSession ) + { + CCaTaskList* self = new(ELeave) CCaTaskList( aWsSession ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +CCaTaskList::CCaTaskList( RWsSession& aWsSession ) +: iWs(aWsSession) + { + } + +void CCaTaskList::ConstructL() + { + UpdateListL(); + } + +CCaTaskList::~CCaTaskList() + { + iWgs.Close(); + } + +void CCaTaskList::UpdateListL() + { + User::LeaveIfError( iWs.WindowGroupList( &iWgs ) ); + } + + +TApaTask CCaTaskList::FindRootApp( TUid aAppUid ) const + { + TApaTask task( iWs ); + task.SetWgId(0); // initialise task to non-existant task + // wgId = 0 tells FindAppByUid to start looking for apps + TInt wgId(0); + FOREVER + { + CApaWindowGroupName::FindByAppUid( aAppUid, iWs, wgId ); + // KErrNotFound means that no more apps can be found + if( wgId == KErrNotFound ) + break; + if( IsRootWindowGroup( wgId ) ) + { + // Found a root wg with the right app UID, return it. + task.SetWgId( wgId ); + break; + } + } + return task; + } + +TBool CCaTaskList::IsRootWindowGroup( TInt aWgId ) const + { + TInt count = iWgs.Count(); + for( TInt i=0; i +#include +#include +#include "cautils.h" +#include "cadef.h" +#include "cainnerentry.h" +#include "cauninstalloperation.h" +_LIT8(KAppMimeType, "x-epoc/x-sisx-app"); + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCaUninstallOperation::~CCaUninstallOperation +// --------------------------------------------------------------------------- +// +CCaUninstallOperation::~CCaUninstallOperation() +{ + Cancel(); + iUninstaller.Close(); +} + +// --------------------------------------------------------------------------- +// CCaUninstallOperation::NewL +// --------------------------------------------------------------------------- +// +CCaUninstallOperation *CCaUninstallOperation::NewL(CCaInnerEntry &aEntry, + TInt aPriority) +{ + CCaUninstallOperation *self; + + self = new(ELeave) CCaUninstallOperation(aEntry, aPriority); + CleanupStack::PushL(self); + self->ConstructL(aEntry); + CleanupStack::Pop(self); + return self; +} + +// --------------------------------------------------------------------------- +// CCaUninstallOperation::CCaUninstallOperation +// --------------------------------------------------------------------------- +// +CCaUninstallOperation::CCaUninstallOperation(CCaInnerEntry &aEntry, + TInt aPriority) : + CActive(aPriority), iEntry(aEntry), iUninstaller(), iId(0) +{ + CActiveScheduler::Add(this); +} + +// --------------------------------------------------------------------------- +// CCaUninstallOperation::ConstructL +// --------------------------------------------------------------------------- +// +void CCaUninstallOperation::ConstructL(CCaInnerEntry &aEntry) +{ + TBuf uidAttr; + TUint uid = aEntry.GetUid(); + + TUid packageUid = KNullUid; + TPtrC8 mimeType; + + if (!(aEntry.GetFlags() & ERemovable)) { + User::Leave(KErrAccessDenied); + } + + User::LeaveIfError(iUninstaller.Connect()); + iId = aEntry.GetId(); + if (aEntry.GetEntryTypeName() == KCaTypeWidget()) { + TBuf uidDesc; + aEntry.FindAttribute(KCaPackageUid, uidDesc); + TLex uidLex(uidDesc); + TUint32 uidValue; + User::LeaveIfError(uidLex.Val(uidValue, EHex)); + + packageUid.iUid = static_cast(uidValue); + mimeType.Set(KAppMimeType); + } else { + AppInfoL(TUid::Uid(uid), mimeType, packageUid); + } + + // Commence the uninstallations + iUninstaller.Uninstall(iStatus, packageUid, mimeType); + SetActive(); +} + +// --------------------------------------------------------------------------- +// CCaUninstallOperation::AppInfo +// --------------------------------------------------------------------------- +// +void CCaUninstallOperation::AppInfoL(const TUid &aAppUid, + TPtrC8 &aMimeType, TUid &aPackageUid) +{ + RApaLsSession apaLsSession; + + User::LeaveIfError(apaLsSession.Connect()); + CleanupClosePushL(apaLsSession); + User::LeaveIfError(apaLsSession.GetAllApps()); + + TApaAppInfo appInfo; + User::LeaveIfError(apaLsSession.GetAppInfo(appInfo, aAppUid)); + if (!GetInstallPkgUidL(appInfo.iFullName, aPackageUid)) { + aPackageUid = aAppUid; + } + aMimeType.Set(KAppMimeType); + + CleanupStack::PopAndDestroy(&apaLsSession); +} + +// --------------------------------------------------------------------------- +// CCaUninstallOperation::GetInstallPkgUidL +// --------------------------------------------------------------------------- +// +TBool CCaUninstallOperation::GetInstallPkgUidL(const TDesC &aAppFullName, + TUid &aPackageUid) +{ + // Search for the full name of the application amongst every file name in + // every installed packages. + TBool found = EFalse; + Swi::RSisRegistrySession iSisRegSession; + + // Get the array of ids of every installed packages + if (KErrNone != iSisRegSession.Connect()) { + return found; + } + CleanupClosePushL(iSisRegSession); + + RArray packageIds; + CleanupClosePushL(packageIds); + + iSisRegSession.InstalledUidsL(packageIds); + + RPointerArray packageFiles; + CleanupClosePushL(packageFiles); + + for (TInt i = 0; i < packageIds.Count() && !found; ++i) { + const TUid packageId = packageIds[i]; + Swi::RSisRegistryEntry packageEntry; + + // Get the array of file names in the current install package and look + // if there is one suggesting that the application was installed from + // the package. + if (KErrNone == packageEntry.Open(iSisRegSession, packageId)) { + CleanupClosePushL(packageEntry); + packageEntry.FilesL(packageFiles); + for (TInt pf = 0; pf < packageFiles.Count() && !found; ++pf) { + if (packageFiles[pf]->FindC(aAppFullName) == 0) { + aPackageUid = packageId; + found = ETrue; + } + } + packageFiles.ResetAndDestroy(); + CleanupStack::PopAndDestroy(&packageEntry); + } + } + + CleanupStack::PopAndDestroy(&packageFiles); + CleanupStack::PopAndDestroy(&packageIds); + CleanupStack::PopAndDestroy(&iSisRegSession); + + return found; +} + +// --------------------------------------------------------------------------- +// CCaUninstallOperation::RunL +// --------------------------------------------------------------------------- +// +void CCaUninstallOperation::RunL() +{ + iUninstaller.Close(); +} + +// --------------------------------------------------------------------------- +// CCaUninstallOperation::DoCancel +// --------------------------------------------------------------------------- +// +void CCaUninstallOperation::DoCancel() +{ + iUninstaller.CancelAsyncRequest(SwiUI::ERequestUninstall); +} + +// --------------------------------------------------------------------------- +// CCaUninstallOperation::RunError +// --------------------------------------------------------------------------- +// +TInt CCaUninstallOperation::RunError(TInt /* aError */) +{ + return KErrNone; +} diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/cahandler.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/cahandler.pro Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,23 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +SUBDIRS += app +SUBDIRS += tapp +SUBDIRS += url + +CONFIG += ordered \ No newline at end of file diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/inc/cas60handleradapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/inc/cas60handleradapter.h Fri Apr 16 15:16:09 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 CA_S60_HANDLER_ADAPTER_H +#define CA_S60_HANDLER_ADAPTER_H + +#include +#include +#include +#include +#include +#include +#include + +#include "cainnerentry.h" +#include "cahandler.h" +#include "caobjectadapter.h" + +template +class CaS60HandlerAdapter: public CaHandler +{ +public: + int execute(const CaEntry &entry, const QString &commandName) { + + QScopedPointer commandNameDesc8(XQConversions::qStringToS60Desc8(commandName)); + QScopedPointer innerEntry(NULL); + + TRAPD(result, + innerEntry.reset(CCaInnerEntry::NewL()); + CaObjectAdapter::convertL(entry, *innerEntry); + + static QScopedPointer plugin(Plugin::NewL()); + plugin->HandleCommandL(*innerEntry, commandNameDesc8->Des()); + ); + + return result; + } +}; + + +#endif diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/tapp/catapphandler.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/tapp/catapphandler.pro Fri Apr 16 15:16:09 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: +# + +TEMPLATE = lib +TARGET = catapphandlerplugin +CONFIG += plugin mobility +MOBILITY = serviceframework + +PLUGIN_SUBDIR = /hsresources/plugins/commandhandler + + +include (../../../common.pri) + + +DEPENDPATH += ./inc \ + ./src \ + ../../caclient/s60/inc + +INCLUDEPATH += ./inc \ + ../../caclient/s60/inc + + +symbian: { + TARGET.UID3 = 0x20028710 + + + LIBS += -lxqservice \ + -lxqutils +# -lhsutils + +} + + +include(catapphandler.pri) diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/tapp/catapphandlerplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/tapp/catapphandlerplugin.pri Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,20 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +HEADERS += ./inc/*.h ../inc/*.h +SOURCES += ./src/*.cpp + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/tapp/inc/catapphandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/tapp/inc/catapphandler.h Fri Apr 16 15:16:09 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: Default implementation of the tapp handler + * + */ + +#ifndef CATAPPHANDLER_H +#define CATAPPHANDLER_H + +#include +#include "cahandler.h" +#include "cadefs.h" + +class CaEntry; +class XQApplicationManager; + +const QString hsitemLaunchUri("item:launchuri"); + +class CaTappHandler: public CaHandler +{ +Q_OBJECT + +public: + +explicit CaTappHandler(QObject *parent = 0); + ~CaTappHandler(); + + Q_INVOKABLE + int execute(const CaEntry& entry, const QString& command); + +private: + XQApplicationManager* mAiwMgr; + +}; + +#endif diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/tapp/inc/catapphandlerplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/tapp/inc/catapphandlerplugin.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,37 @@ +/* + * 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: Default template app handler plugin + * + */ + +#ifndef CATAPPHANDLERPLUGIN_H +#define CATAPPHANDLERPLUGIN_H + +#include +#include +#include + +QTM_USE_NAMESPACE + +class CaTappHandlerPlugin: public QObject, public QServicePluginInterface +{ +Q_OBJECT +Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, QAbstractSecuritySession *session); +}; + +#endif //CATAPPHANDLERPLUGIN_H diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/tapp/resource/catapphandlerplugin.s60xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/tapp/resource/catapphandlerplugin.s60xml Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,13 @@ + + + catapphandlerplugin + z:/hsresources/plugins/commandhandler/catapphandlerplugin.qtplugin + Content Arsenal tapp handler plugin + + com.nokia.homescreen.ICommandHandler + 1.0 + executes commands on tapps + + + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/tapp/resource/catapphandlerplugin.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/tapp/resource/catapphandlerplugin.xml Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,13 @@ + + + catapphandlerplugin + z:/hsresources/plugins/commandhandler/catapphandlerplugin.qtplugin + Content Arsenal tapp handler plugin + + com.nokia.homescreen.ICommandHandler + 1.0 + executes commands on tapps + application + + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/tapp/src/catapphandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/tapp/src/catapphandler.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,74 @@ +/* + * 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: Default implementation of the home screen runtime. + * + */ + +#include +#include +#include + +#include + +#include "caentry.h" +#include "catapphandler.h" + +QTM_USE_NAMESPACE + +/*! + \class CaTappHandler + \ingroup + \brief Implementation of templated application command handler. +*/ + +/*! + Constructor. + \param parent Parent object of this object. + */ +CaTappHandler::CaTappHandler(QObject *parent) +{ + Q_UNUSED(parent); + mAiwMgr = new XQApplicationManager(); +} + +/*! + Destructor. + */ +CaTappHandler::~CaTappHandler() +{ + delete mAiwMgr; +} + +/*! + Executes \a command by default "open" on template application represented by \a entry. + Uses XQApplicationManager + \param entry Subject of the \a command. + \param command Description of the command. + \return Error code described in QSERVICEMANAGER.H + */ +int CaTappHandler::execute(const CaEntry& entry, const QString& command) +{ + int error = 0; // this returns Error enum from QSERVICEMANAGER.H + if (command == caCmdOpen) { + QUrl url(entry.attribute(hsitemLaunchUri)); // f.e. QUrl url ("application://101F7AE7?"); + QScopedPointer request(mAiwMgr->create(url, true)); + if (!request.isNull()) { + bool res = request->send(); + if (!res) { + error = request->lastError(); + } + } + } + return error; +} diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/tapp/src/catapphandlerplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/tapp/src/catapphandlerplugin.cpp Fri Apr 16 15:16:09 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: Default runtime plugin. + * + */ + +/*#include + #include + #include + */ + +#include "catapphandlerplugin.h" +#include "catapphandler.h" + +#include + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +/*! + \class CaTappHandlerPlugin + \ingroup + \brief Implementation of Qt SF plugin for templated application command handler. +*/ + +/*! + \param descriptor service descriptor + \param context ignored + \param session ignored + \return An instance of the CaTapphandler object when descriptor interface name + is "com.nokia.homescreen.ICommandHandler", NULL otherwise. +*/ +QObject *CaTappHandlerPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == QLatin1String("com.nokia.homescreen.ICommandHandler")) { + return new CaTappHandler(); + } + else { + return 0; + } +} + +Q_EXPORT_PLUGIN2(catapphandlerplugin, CaTappHandlerPlugin) + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/url/inc/caurlhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/url/inc/caurlhandler.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,89 @@ +/* + * 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 __CCAURLHANDLER_H__ +#define __CCAURLHANDLER_H__ + +#include + +class CCaInnerEntry; + +// Constants +const TUid KUidBrowser = + { + 0x10008D39 + }; +_LIT( KBrowserPrefix, "4 " ); + +/** + * Command handler for url entries. + * + * @lib caclient.lib + */ +NONSHARABLE_CLASS( CCaUrlHandler ) + { + +public: + // construction + + /** + * Destructor. + */ + virtual ~CCaUrlHandler(); + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed object. + */ + static CCaUrlHandler* NewL(); + +protected: + // construction + + /** + * Constructor. + * @param aMenu Menu. + */ + CCaUrlHandler(); + + /** + * Second-phase constructor. + */ + void ConstructL(); + +public: + + + /** + * Handle command. + * @param aEntry The url entry to be processed. + * @param aCommand Command. + */ + void HandleCommandL( CCaInnerEntry& aEntry, const TDesC8& aCommand ); + +private: + // internal + + /** + * Launches the url. + * @param aUrl The url to be launched. + */ + void LaunchUrlL( const TDesC& aUrl ); + + }; + +#endif // __CCAURLHANDLER_H__ diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/url/inc/caurlhandlerplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/url/inc/caurlhandlerplugin.h Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,37 @@ +/* + * 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 CA_URL_HANDLER_PLUGIN_H +#define CA_URL_HANDLER_PLUGIN_H + +#include +#include + +QTM_USE_NAMESPACE + +class CaUrlHandlerPlugin : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session); +}; + +#endif diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/url/resource/caurlhandlerplugin.s60xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/url/resource/caurlhandlerplugin.s60xml Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,13 @@ + + + caurlhandlerplugin + z:/hsresources/plugins/commandhandler/caurlhandlerplugin.qtplugin + + + com.nokia.homescreen.ICommandHandler + 1.0 + + + url + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/url/resource/caurlhandlerplugin.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/url/resource/caurlhandlerplugin.xml Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,13 @@ + + + caurlhandlerplugin + caurlhandlerplugin + + + com.nokia.homescreen.ICommandHandler + 1.0 + + + url + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/url/src/caurlhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/url/src/caurlhandler.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: ?Description + * + */ + +#include +#include +#include +#include + +#include "caurlhandler.h" +#include "cadef.h" +#include "cainnerentry.h" + +// ================= MEMBER FUNCTIONS ======================= + +// -------------------------------------------------------------------------- +// CCaUrlHandler::~CCaUrlHandler +// -------------------------------------------------------------------------- +// +CCaUrlHandler::~CCaUrlHandler() + { + } + +// -------------------------------------------------------------------------- +// CCaUrlHandler::NewL +// -------------------------------------------------------------------------- +// +CCaUrlHandler* CCaUrlHandler::NewL() + { + CCaUrlHandler* handler = new ( ELeave ) CCaUrlHandler(); + CleanupStack::PushL( handler ); + handler->ConstructL(); + CleanupStack::Pop( handler ); + return handler; + } + +// -------------------------------------------------------------------------- +// CCaUrlHandler::CCaUrlHandler +// -------------------------------------------------------------------------- +// +CCaUrlHandler::CCaUrlHandler() + { + } + +// -------------------------------------------------------------------------- +// CCaUrlHandler::ConstructL +// -------------------------------------------------------------------------- +// +void CCaUrlHandler::ConstructL() + { + } + +// -------------------------------------------------------------------------- +// CCaUrlHandler::HandleCommandL +// -------------------------------------------------------------------------- +// +void CCaUrlHandler::HandleCommandL( CCaInnerEntry& aEntry, + const TDesC8& aCommand ) + { + + if( !aCommand.Compare( KCaCmdOpen() ) ) + { + const RCaEntryAttrArray& attributes = aEntry.GetAttributes(); + TInt attributesArrayCount = attributes.Count(); + for( int i = 0; i < attributesArrayCount; ++i ) + { + const CCaEntryAttribute * const attribute = attributes[i]; + if( attribute->Name().Compare( KCaAttrUrl ) == 0 ) + { + LaunchUrlL( attribute->Value() ); + break; + } + } + } + else + { + User::Leave( KErrNotSupported ); + } + } + +// -------------------------------------------------------------------------- +// CCaUrlHandler::LaunchUrlL +// -------------------------------------------------------------------------- +// + +void CCaUrlHandler::LaunchUrlL( const TDesC& aUrl ) + { + // Launches browser stand-alone. + // Browser is launched with a parameter 4 ("4 http://...."), which + // Start/Continue the browser specifying a URL. + // Other available parameters are described in the Browser API Specification + // Document. + TInt length = aUrl.Length() + KBrowserPrefix.iTypeLength; + + RWsSession wsSession; + User::LeaveIfError( wsSession.Connect() ); + CleanupClosePushL ( wsSession ); + + CAknTaskList* taskList = CAknTaskList::NewL( wsSession ); + TApaTask task = taskList->FindRootApp( KUidBrowser ); + delete taskList; + + if( task.Exists() ) + { + HBufC8* param8 = HBufC8::NewLC( length ); + TPtr8 ptr8 = param8->Des(); + ptr8.Append( KBrowserPrefix ); + ptr8.Append( aUrl ); + + // Sends message to existing Browser task. + task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used + CleanupStack::PopAndDestroy( param8 ); + } + else + { + HBufC* buf = HBufC::NewLC( length ); + TPtr ptr = buf->Des(); + ptr.Append( KBrowserPrefix ); + ptr.Append( aUrl ); + + RApaLsSession appArcSession; + User::LeaveIfError( appArcSession.Connect() ); + CleanupClosePushL ( appArcSession ); + TThreadId id; + appArcSession.StartDocument( *buf, KUidBrowser, id ); + CleanupStack::PopAndDestroy( &appArcSession ); + CleanupStack::PopAndDestroy( buf ); + } + + CleanupStack::PopAndDestroy( &wsSession ); + } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/url/src/caurlhandlerplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/url/src/caurlhandlerplugin.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include +#include +#include "cahandlerloader.h" + +#include "caurlhandlerplugin.h" +#include "cas60handleradapter.h" +#include "caurlhandler.h" + +/*! + \class CaUrlHandlerPlugin + \ingroup + \brief Implementation of Qt SF plugin for url command handler. +*/ + +/*! + \param descriptor Service descriptor. + \param context Ignored. + \param session Ignored. + \return An instance of the CaS60HandlerAdapter when descriptor interface name + is "com.nokia.homescreen.ICommandHandler", NULL otherwise. +*/ +QObject *CaUrlHandlerPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == + "com.nokia.homescreen.ICommandHandler") { + return new CaS60HandlerAdapter; + } else { + return 0; + } +} +// TODO: uncomment when it will be a plugin +//Q_EXPORT_PLUGIN2(caurlhandlerplugin, CaUrlHandlerPlugin) diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/url/url.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/url/url.pri Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,13 @@ +# 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: + +HEADERS += ./inc/*.h ../inc/*.h +SOURCES += ./src/*.cpp diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cahandler/url/url.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/cahandler/url/url.pro Fri Apr 16 15:16:09 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: + +TEMPLATE = lib +TARGET = caurlhandlerplugin +CONFIG += plugin hb mobility +MOBILITY = serviceframework + +PLUGIN_SUBDIR = /hsresources/plugins/commandhandler + +include(../../../common.pri) + + +DEPENDPATH += ./inc \ + ./src + +INCLUDEPATH += ./inc \ + ../../caclient/inc \ + ../../caclient/s60/inc \ + ../../inc \ + ../../cautils/inc\ + $$MW_LAYER_SYSTEMINCLUDE + +include(url.pri) + +symbian: { + TARGET.UID3 = 0x20022F85 + + LIBS += \ + -leuser \ + -lecom \ + -lswinstcli \ + -lcautils \ + -lcaclient \ + -lapgrfx \ + -lws32 \ + -lapparc \ + -lsisregistryclient \ + -leikcore \ + -lcone \ + -lefsrv \ + -lxqutils + + exists($${EPOCROOT}epoc32/include/mw/XQSettingsManager):LIBS += -lxqsettingsmanager +} + + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/casrv/caappscanner/src/casrvappscanner.cpp --- a/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -751,10 +751,10 @@ attrVal.CreateL( KCaMaxAttrValueLen ); aEntry->FindAttribute( KCaAttrLongName, attrVal ); if( attrVal.Compare( info.iCaption ) != KErrNone - || aEntry->GetText().Compare( info.iShortCaption ) + || aEntry->GetText().Compare( info.iCaption ) != KErrNone ) { - aEntry->SetTextL( info.iShortCaption ); + aEntry->SetTextL( info.iCaption ); aEntry->AddAttributeL( KCaAttrLongName, info.iCaption ); changed = ETrue; } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp --- a/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -99,10 +99,7 @@ { QString locale = QLocale::system().name(); QString filename = QString( "contentstorage_" ) + locale; - if( !LoadTranslator( filename ) ) - { - //User::Leave(KErrNotFound); TODO what here - } + LoadTranslator( filename ); TPtrC ptrLocale( reinterpret_cast( locale.constData() ) ); TBuf propertyValue; // trap is here to assure deletion of qtranslator in case code leaves @@ -175,6 +172,7 @@ locals[i]->SetLocalizedStringL( locals[i]->GetStringId() ); } iStorageProxy->LocalizeEntryL( *( locals[i] ) ); + delete[] temp; } CleanupStack::PopAndDestroy( &localizedName ); CleanupStack::PopAndDestroy( &locals ); diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/casrv/carunningappmonitor/src/carunningappmonitor.cpp --- a/contentstorage/casrv/carunningappmonitor/src/carunningappmonitor.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/casrv/carunningappmonitor/src/carunningappmonitor.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -214,7 +214,6 @@ { UpdateRunningAppStorageL(); } - //TODO should we handle any event that will cancel observation? } // ----------------------------------------------------------------------------- diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/casrv/cawidgetscanner/data/cawidgetscanner.rss --- a/contentstorage/casrv/cawidgetscanner/data/cawidgetscanner.rss Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/casrv/cawidgetscanner/data/cawidgetscanner.rss Fri Apr 16 15:16:09 2010 +0300 @@ -31,7 +31,7 @@ RESOURCE REGISTRY_INFO theInfo { // UID for the DLL - dll_uid = 0x20028706;// TODO: change to proper uid + dll_uid = 0x20028706; // Declare array of interface info interfaces = { @@ -44,7 +44,7 @@ // Info for Widget IMPLEMENTATION_INFO { - implementation_uid = 0x20028707;// TODO: change to proper uid + implementation_uid = 0x20028707; version_no = 1; display_name = "Widget"; default_data = "WIDGET"; diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/casrv/cawidgetscanner/group/cawidgetscanner.mmp --- a/contentstorage/casrv/cawidgetscanner/group/cawidgetscanner.mmp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/casrv/cawidgetscanner/group/cawidgetscanner.mmp Fri Apr 16 15:16:09 2010 +0300 @@ -20,7 +20,7 @@ TARGET cawidgetscanner.dll TARGETTYPE PLUGIN -UID 0x10009D8D 0x20028706 // TODO: change to proper uid +UID 0x10009D8D 0x20028706 CAPABILITY CAP_ECOM_PLUGIN LANG SC diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h --- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h Fri Apr 16 15:16:09 2010 +0300 @@ -108,6 +108,18 @@ void SetLibraryL( const TDesC& aLibrary ); /* + * Path setter + * @param aLibrary widget library + */ + void SetPathL( const TDesC& aPath ); + + /* + * Path getter + * @return widget library + */ + TPtrC GetPath( ) const; + + /* * Missing flag setter * @param aMissing flag */ @@ -264,7 +276,11 @@ */ RBuf iIconUri; - + /* + * Widget library. Own + */ + RBuf iPath; + /* * Widget library. Own */ diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerparser.h --- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerparser.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerparser.h Fri Apr 16 15:16:09 2010 +0300 @@ -122,7 +122,7 @@ void SetUriL( TXmlEngElement & aElement, CCaWidgetDescription * aWidget ); /** - * Sets widgets library + * Sets widgets library and path created from library * @param aElement xml element * @param aPackageUid package uid * @param aWidget widget to set value diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/casrv/cawidgetscanner/inc/widgetscannerutils.h --- a/contentstorage/casrv/cawidgetscanner/inc/widgetscannerutils.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/casrv/cawidgetscanner/inc/widgetscannerutils.h Fri Apr 16 15:16:09 2010 +0300 @@ -24,6 +24,7 @@ #include // CONSTANTS +_LIT(KAttrWidgetPath, "widget:path"); _LIT(KAttrWidgetLibrary, "widget:library"); _LIT(KAttrWidgetUri, "widget:uri"); _LIT(KSlash, "/"); diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -74,6 +74,9 @@ //library iLibrary.CreateL( KCaMaxAttrValueLen ); aEntry->FindAttribute( KAttrWidgetLibrary, iLibrary ); + //path + iPath.CreateL( KCaMaxAttrValueLen ); + aEntry->FindAttribute( KAttrWidgetPath, iPath ); //uri iUri.CreateL( KCaMaxAttrValueLen ); aEntry->FindAttribute( KAttrWidgetUri, iUri ); @@ -146,6 +149,7 @@ iUri.Close(); iIconUri.Close(); iLibrary.Close(); + iPath.Close(); iModificationTime.Close(); } @@ -335,7 +339,23 @@ { return iLibrary; } - +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TPtrC CCaWidgetDescription::GetPath( ) const + { + return iPath; + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCaWidgetDescription::SetPathL( const TDesC& aPath ) + { + iPath.Close(); + iPath.CreateL(aPath); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -421,14 +441,12 @@ { entry->SetFlags( EVisible ); } - if ( iPackageUid ) { TBuf uidDesc; uidDesc.AppendNum( iPackageUid,EHex ); entry->AddAttributeL( KCaPackageUid, uidDesc ); } - if ( iEntryId != KNoId ) { entry->SetId( iEntryId ); @@ -449,7 +467,10 @@ entry->SetFlags( entry->GetFlags() & ~ERemovable ); } } - + if ( iPath != KNullDesC ) + { + entry->AddAttributeL(KAttrWidgetPath, iPath); + } if ( iTitle != KNullDesC ) { entry->SetTextL(iTitle); @@ -472,7 +493,8 @@ } if ( iIconUri != KNullDesC) { - entry->SetIconDataL(0, 0, 0, 0, iIconUri); + // aSkinId and AppId not used for widgets - KNullDesC + entry->SetIconDataL(iIconUri, KNullDesC, KNullDesC); } if( iModificationTime != KNullDesC ) diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -280,7 +280,7 @@ } // ---------------------------------------------------------------------------- -// +// keep in mind that setLibrary also setsPath // ---------------------------------------------------------------------------- // void CCaWidgetScannerParser::SetLibraryL( TXmlEngElement & aElement, @@ -293,6 +293,10 @@ if( attributeValue->Compare( KNullDesC ) != 0 ) { HBufC *libraryPath = GetManifestDirectoryPathLC( aPackageUid ); + + //set path for hs to use, trim last 2 chars (doubleslash) + aWidget->SetPathL(libraryPath->Mid(0,libraryPath->Length()-1)); + libraryPath->ReAllocL( libraryPath->Length() + attributeValue->Length()); diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -272,7 +272,7 @@ { CCaInnerEntry* entry = aWidget->GetEntryLC(); entry->SetFlags( entry->GetFlags() | EMissing ); - if(aWidget->IsUsed()) + if( aWidget->IsUsed() ) { entry->SetFlags( entry->GetFlags() | EUsed ); } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/data/castorage.db Binary file contentstorage/castorage/data/castorage.db has changed diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/data/castoragedb Binary file contentstorage/castorage/data/castoragedb has changed diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/data/castoragedb_create.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/castorage/data/castoragedb_create.sql Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,224 @@ +DROP TABLE IF EXISTS CA_ENTRY; +DROP TABLE IF EXISTS CA_GROUP_ENTRY; +DROP TABLE IF EXISTS CA_ICON; +DROP TABLE IF EXISTS CA_LAUNCH; +DROP TABLE IF EXISTS CA_ATTRIBUTE; +DROP TABLE IF EXISTS CA_LOCALIZATION_TEXT; +DROP TABLE IF EXISTS CA_DB_PROPERTIES; + +SELECT "CREATE TABLE CA_ENTRY" AS " "; +SELECT "------------------------------------" AS " "; +CREATE TABLE CA_ENTRY( ENTRY_ID INTEGER PRIMARY KEY, + EN_TEXT TEXT NOT NULL COLLATE NOCASE, + EN_DESCRIPTION TEXT COLLATE NOCASE, + EN_ROLE INTEGER default 1, + EN_TYPE_NAME TEXT NOT NULL, + EN_ICON_ID INTEGER, + EN_CREATION_TIME BIGINT default -1 NOT NULL, + EN_UID INTEGER UNIQUE, + EN_FLAGS INTEGER default 8, + FOREIGN KEY(EN_ICON_ID) REFERENCES CA_ICON(ICON_ID) ); +CREATE INDEX EntryText_CAIndex ON CA_ENTRY(EN_TEXT); +CREATE INDEX EntryCreationTime_CAIndex ON CA_ENTRY(EN_CREATION_TIME); + +SELECT "CREATE TABLE CA_GROUP_ENTRY" AS " "; +SELECT "------------------------------------" AS " "; +CREATE TABLE CA_GROUP_ENTRY( GROUP_ENTRY_ID INTEGER PRIMARY KEY , + GE_GROUP_ID INTEGER NOT NULL, + GE_ENTRY_ID INTEGER NOT NULL, + GE_POSITION INTEGER, + UNIQUE( GE_GROUP_ID, GE_ENTRY_ID ), + FOREIGN KEY(GE_GROUP_ID) REFERENCES CA_ENTRY(ENTRY_ID), + FOREIGN KEY(GE_ENTRY_ID) REFERENCES CA_ENTRY(ENTRY_ID) ); +CREATE INDEX GroupGE_POSITION_CAIndex ON CA_GROUP_ENTRY(GE_POSITION); +CREATE TRIGGER update_position_in_ca_group_entry_after_remove AFTER DELETE ON CA_GROUP_ENTRY +BEGIN + UPDATE CA_GROUP_ENTRY SET GE_POSITION = GE_POSITION - 1 WHERE GE_POSITION > old.GE_POSITION AND GE_GROUP_ID = old.GE_GROUP_ID; +END; +CREATE TRIGGER update_position_in_ca_group_entry_before_insert BEFORE INSERT ON CA_GROUP_ENTRY +BEGIN + UPDATE CA_GROUP_ENTRY SET GE_POSITION = GE_POSITION + 1 WHERE GE_POSITION >= new.GE_POSITION AND GE_GROUP_ID = new.GE_GROUP_ID; +END; + +SELECT "CREATE TABLE CA_ICON" AS " "; +SELECT "------------------------------------" AS " "; +CREATE TABLE CA_ICON( ICON_ID INTEGER PRIMARY KEY , + IC_FILENAME TEXT, + IC_SKIN_ID TEXT, + IC_APP_ID TEXT, + UNIQUE( IC_FILENAME, IC_SKIN_ID, IC_APP_ID ) ); + +SELECT "CREATE TABLE CA_LAUNCH" AS " "; +SELECT "------------------------------------" AS " "; +CREATE TABLE CA_LAUNCH( LAUNCH_ID INTEGER PRIMARY KEY , + LA_ENTRY_ID INTEGER NOT NULL, + LA_LAUNCH_TIME INTEGER NOT NULL, + FOREIGN KEY(LA_ENTRY_ID) REFERENCES CA_ENTRY(ENTRY_ID) ); +CREATE INDEX LaunchLaunchTime_CAIndex ON CA_LAUNCH(LA_LAUNCH_TIME); + +SELECT "CREATE TABLE CA_ATTRIBUTE" AS " "; +SELECT "------------------------------------" AS " "; +CREATE TABLE CA_ATTRIBUTE( ATTRIBUTE_ID INTEGER PRIMARY KEY , + AT_ENTRY_ID INTEGER NOT NULL, + AT_NAME TEXT NOT NULL, + AT_VALUE TEXT NOT NULL, + UNIQUE( AT_ENTRY_ID, AT_NAME ), + FOREIGN KEY(AT_ENTRY_ID) REFERENCES CA_ENTRY(ENTRY_ID) ); + +SELECT "CREATE TABLE CA_LOCALIZATION_TEXT" AS " "; +SELECT "------------------------------------" AS " "; +CREATE TABLE CA_LOCALIZATION_TEXT( LOC_TEXT_ID INTEGER PRIMARY KEY , + LT_TABLE_NAME TEXT , + LT_ATTRIBUTE_NAME TEXT , + LT_STRING_ID TEXT , + LT_ROW_ID INTEGER ); + +SELECT "CREATE TABLE CA_DB_PROPERTIES" AS " "; +SELECT "------------------------------------" AS " "; +CREATE TABLE CA_DB_PROPERTIES( DB_PROPERTIES_ID INTEGER PRIMARY KEY , + DB_PROPERTY TEXT UNIQUE, + DB_VALUE TEXT ); + + + +-- CREATE VIEW COLLECTION +SELECT "------------------------------------" AS " "; +SELECT "CREATE VIEW COLLECTION" AS " "; +DROP VIEW IF EXISTS COLLECTION; +CREATE VIEW COLLECTION + AS SELECT + "" AS "COLLECTION_NAME", + "" AS "COL_LOCNAME", + "" AS "ICON"; + +SELECT " CREATE TRIGGER collection_insert" AS " "; +CREATE TRIGGER collection_insert INSTEAD OF INSERT ON COLLECTION +BEGIN + -- INSERT ICON + INSERT INTO CA_ICON (IC_FILENAME) + VALUES ( new.ICON); + -- 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 OR (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON 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", 12, (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON )); + -- LOCALIZATION + INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_ROW_ID ) + VALUES ( 'CA_ENTRY', 'EN_TEXT', new.COL_LOCNAME, ( SELECT last_insert_rowid() ) ); + DELETE FROM CA_LOCALIZATION_TEXT WHERE 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") , + (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME), + (SELECT IFNULL(MAX(GE_POSITION)+1, 1) FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "menucollections")) ); +END; + +-- CREATE VIEW ITEM_TO_COLLECTION +SELECT "------------------------------------" AS " "; +SELECT "CREATE VIEW ITEM_TO_COLLECTION" AS " "; +DROP VIEW IF EXISTS ITEM_TO_COLLECTION; +CREATE VIEW ITEM_TO_COLLECTION + AS SELECT + "" AS "ITEM_TYPE", + "" AS "ITEM_NAME", + "" AS "ICON", + "" AS "ITEM_DEST", + "" AS "COLLECTION_NAME"; + +SELECT " CREATE TRIGGER item_to_collection_insert_app" AS " "; +CREATE TRIGGER item_to_collection_insert_app INSTEAD OF INSERT ON ITEM_TO_COLLECTION WHEN new.ITEM_TYPE="application" +BEGIN + -- INSERT ENTRY + INSERT OR IGNORE INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID ) + VALUES ( new.ITEM_NAME, 1, "application", new.ITEM_DEST ); + -- 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) , + (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME), + (SELECT IFNULL(MAX(GE_POSITION)+1, 1) FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME)) ); +END; + +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) + VALUES ( new.ICON); + DELETE FROM CA_ICON WHERE ICON_ID = last_insert_rowid() AND + (IC_FILENAME IS NULL OR (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON 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 )); + INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE ) + VALUES ( ( SELECT last_insert_rowid() ) ,"url",new.ITEM_DEST); + -- 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) , + (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME), + (SELECT IFNULL(MAX(GE_POSITION)+1, 1) FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME)) ); +END; + + +-- CREATE VIEW WIDGET _TO_COLLECTION +SELECT "------------------------------------" AS " "; +SELECT "CREATE VIEW WIDGET_TO_COLLECTION" AS " "; +DROP VIEW IF EXISTS WIDGET_TO_COLLECTION; +CREATE VIEW WIDGET_TO_COLLECTION + AS SELECT + "" AS "ITEM_TYPE", + "" AS "ITEM_NAME", + "" AS "ICON", + "" AS "PACKAGE_UID", + "" AS "LIBRARY", + "" AS "LONG_NAME", + "" AS "URI", + "" AS "COLLECTION_NAME" ; + +SELECT " CREATE TRIGGER insert_widget_to_collection" AS " "; +CREATE TRIGGER item_to_collection_insert_widget INSTEAD OF INSERT ON WIDGET_TO_COLLECTION WHEN new.ITEM_TYPE="widget" +BEGIN + -- INSERT ICON + INSERT OR IGNORE INTO CA_ICON (IC_FILENAME) + VALUES ( new.ICON); + DELETE FROM CA_ICON WHERE ICON_ID = last_insert_rowid() AND + (IC_FILENAME IS NULL OR (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON 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 )); + -- 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); + 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 ) ,"widget:library",new.LIBRARY); + 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 ) ,"long_name",new.LONG_NAME); + 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 ) ,"widget:uri",new.URI); + -- 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) , + (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME), + (SELECT IFNULL(MAX(GE_POSITION)+1, 1) FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME)) ); +END; + + + + +SELECT "INSERT INITIAL DATA TO CA_DB_PROPERTIES" AS " "; + +SELECT "------------------------------------" AS " "; +INSERT INTO CA_DB_PROPERTIES ( DB_PROPERTY, DB_VALUE ) +VALUES ( 'Version', '00001' ); +INSERT INTO CA_DB_PROPERTIES ( DB_PROPERTY, DB_VALUE ) +VALUES ( 'Language', '' ); +INSERT INTO CA_DB_PROPERTIES ( DB_PROPERTY, DB_VALUE ) +VALUES ( 'QMfile', 'db_textmap_' ); + + + + +SELECT "------------------------------------" AS " "; +SELECT "castoragedb_create - END" AS " "; +SELECT "------------------------------------" AS " "; + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/data/castoragedb_variant.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/castorage/data/castoragedb_variant.bat Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,21 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off + +del castorage.db +sqlite3 castorage.db ".read castoragedb_create.sql" +sqlite3 castorage.db ".genfkey --exec" +sqlite3 castorage.db ".read castoragedb_variant.sql" diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/data/castoragedb_variant.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/castorage/data/castoragedb_variant.sql Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,63 @@ +SELECT "------------------------------------" AS " "; +SELECT "castoragedb_variant - BEGIN" AS " "; + +-- insert neccessary items +SELECT "INSERT GROUPS" AS " "; +SELECT "." AS " "; +INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID ) +VALUES ( 'Menu', 2, "folder", NULL , NULL ); + +SELECT "INSERT menucollections ENTRY" AS " "; +INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID ) +VALUES ( 'AllCollections', 2, "menucollections", NULL , NULL ); + +INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID, EN_FLAGS ) +VALUES ( 'Application Library', 2, "applicationlibrary", NULL, NULL, 8 ); + +SELECT "------------------------------------" AS " "; +SELECT "INSERT Downloaded collection ENTRY" AS " "; +INSERT INTO CA_ICON (IC_FILENAME) +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 ); +INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_ROW_ID ) +VALUES ( 'CA_ENTRY', 'EN_TEXT', "txt_applib_dblist_downloaded", ( SELECT last_insert_rowid() ) ); +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 ); + +-- insert additional items + +INSERT INTO COLLECTION (COLLECTION_NAME, COL_LOCNAME, ICON) VALUES ( 'Office', "txt_applib_dblist_office", "qtg_large_applications_user"); + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME) + VALUES ("application", 'calendar', 268458241, 'Office' ); + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME) + VALUES ("application", 'Phonebook', 537014009, 'Office' ); + +INSERT INTO COLLECTION (COLLECTION_NAME, ICON) VALUES ( 'Multimedia', "qtg_large_applications_user" ); + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME) + VALUES ("application", 'Themes', 268458546, 'Multimedia' ); + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME) + VALUES ("application", 'Paint Cursor', 537001564, 'Multimedia' ); + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME) + VALUES ("application", 'Videoplayer', 537006590, 'Multimedia' ); + +INSERT INTO COLLECTION (COLLECTION_NAME, ICON) VALUES ( 'Utils', "qtg_large_applications_user" ); + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME) + VALUES ("application", 'ControlPanel', 537026521, 'Utils' ); + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME) + VALUES ("application", 'Bluetooth', 268458321, 'Utils' ); + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME) + VALUES ("application", 'SW update', 537001519, 'Utils' ); + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME) + VALUES ("application", 'eshell', 270498535, 'Utils' ); + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME) + VALUES ("application", 'Conn. mgr.', 270501072, 'Utils' ); + + +INSERT INTO COLLECTION (COLLECTION_NAME, COL_LOCNAME, ICON) VALUES ( 'Games', "txt_applib_dblist_games", "qtg_large_applications_user" ); + +SELECT "castoragedb_variant - END" AS " "; +SELECT "------------------------------------" AS " "; + diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/data/castoragedb_variant_test.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/castorage/data/castoragedb_variant_test.bat Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,21 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off + +del castorage.db +sqlite3 castorage.db ".read castoragedb_create.sql" +sqlite3 castorage.db ".genfkey --exec" +sqlite3 castorage.db ".read castoragedb_variant_test.sql" diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/data/castoragedb_variant_test.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/castorage/data/castoragedb_variant_test.sql Fri Apr 16 15:16:09 2010 +0300 @@ -0,0 +1,22 @@ +-- ONLY IF YOU SURE THAT WANT DEFAULT CONTENT +.read castoragedb_variant.sql + +SELECT "castoragedb_variant test - BEGIN" AS " "; + + +-- insert collection +INSERT INTO COLLECTION (COLLECTION_NAME, ICON) VALUES ( 'Favorites', "qtg_large_applications_user" ); + +-- insert example urls + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ICON,ITEM_DEST, COLLECTION_NAME) + VALUES ("url", 'Facebook', 'c:\data\Images\kqticaicons\facebook.png', "http://www.facebook.com/", 'Favorites' ); + INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ICON,ITEM_DEST, COLLECTION_NAME) + VALUES ("url", 'Google', 'c:\data\Images\kqticaicons\google.png', "http://www.google.com/", 'Favorites' ); + +-- insert example widgets + INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ICON, PACKAGE_UID, LIBRARY, LONG_NAME, URI, COLLECTION_NAME) + VALUES ("widget", 'aClock', 'Z:\private\20022F35\import\widgetregistry\20022F6C\tclock.png', '20022f43', 'Z:\private\20022F35\import\widgetregistry\20022F43\hsclockwidgetprovider.dll', 'Clock', 'homescreen.nokia.com/widget/clock', 'Office' ); + + + +SELECT "castoragedb_variant test - END" AS " "; \ No newline at end of file diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/data/create_castoragedb.sql --- a/contentstorage/castorage/data/create_castoragedb.sql Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -DROP TABLE IF EXISTS CA_ENTRY; -DROP TABLE IF EXISTS CA_GROUP_ENTRY; -DROP TABLE IF EXISTS CA_ICON; -DROP TABLE IF EXISTS CA_LAUNCH; -DROP TABLE IF EXISTS CA_ATTRIBUTE; - -SELECT "CREATE TABLE CA_ENTRY" AS " "; -SELECT "------------------------------------" AS " "; -CREATE TABLE CA_ENTRY( ENTRY_ID INTEGER PRIMARY KEY, - EN_TEXT TEXT NOT NULL COLLATE NOCASE, - EN_DESCRIPTION TEXT COLLATE NOCASE, - EN_ROLE INTEGER default 1, - EN_TYPE_NAME TEXT NOT NULL, - EN_ICON_ID INTEGER, - EN_CREATION_TIME BIGINT default -1 NOT NULL, - EN_UID INTEGER UNIQUE, - EN_FLAGS INTEGER default 8, - FOREIGN KEY(EN_ICON_ID) REFERENCES CA_ICON(ICON_ID) ); -CREATE INDEX EntryText_CAIndex ON CA_ENTRY(EN_TEXT); -CREATE INDEX EntryCreationTime_CAIndex ON CA_ENTRY(EN_CREATION_TIME); - -SELECT "CREATE TABLE CA_GROUP_ENTRY" AS " "; -SELECT "------------------------------------" AS " "; -CREATE TABLE CA_GROUP_ENTRY( GROUP_ENTRY_ID INTEGER PRIMARY KEY , - GE_GROUP_ID INTEGER NOT NULL, - GE_ENTRY_ID INTEGER NOT NULL, - GE_POSITION INTEGER, - UNIQUE( GE_GROUP_ID, GE_ENTRY_ID ), - FOREIGN KEY(GE_GROUP_ID) REFERENCES CA_ENTRY(ENTRY_ID), - FOREIGN KEY(GE_ENTRY_ID) REFERENCES CA_ENTRY(ENTRY_ID) ); -CREATE INDEX GroupGE_POSITION_CAIndex ON CA_GROUP_ENTRY(GE_POSITION); -CREATE TRIGGER update_position_in_ca_group_entry_after_remove AFTER DELETE ON CA_GROUP_ENTRY -BEGIN - UPDATE CA_GROUP_ENTRY SET GE_POSITION = GE_POSITION - 1 WHERE GE_POSITION > old.GE_POSITION AND GE_GROUP_ID = old.GE_GROUP_ID; -END; -CREATE TRIGGER update_position_in_ca_group_entry_before_insert BEFORE INSERT ON CA_GROUP_ENTRY -BEGIN - UPDATE CA_GROUP_ENTRY SET GE_POSITION = GE_POSITION + 1 WHERE GE_POSITION >= new.GE_POSITION AND GE_GROUP_ID = new.GE_GROUP_ID; -END; - -SELECT "CREATE TABLE CA_ICON" AS " "; -SELECT "------------------------------------" AS " "; -CREATE TABLE CA_ICON( ICON_ID INTEGER PRIMARY KEY , - IC_FILENAME TEXT, - IC_BITMAP_ID INTEGER, - IC_MASK_ID INTEGER, - IC_SKINMAJOR_ID INTEGER, - IC_SKINMINOR_ID INTEGER, - UNIQUE( IC_FILENAME, IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID) ); - -SELECT "CREATE TABLE CA_LAUNCH" AS " "; -SELECT "------------------------------------" AS " "; -CREATE TABLE CA_LAUNCH( LAUNCH_ID INTEGER PRIMARY KEY , - LA_ENTRY_ID INTEGER NOT NULL, - LA_LAUNCH_TIME INTEGER NOT NULL, - FOREIGN KEY(LA_ENTRY_ID) REFERENCES CA_ENTRY(ENTRY_ID) ); -CREATE INDEX LaunchLaunchTime_CAIndex ON CA_LAUNCH(LA_LAUNCH_TIME); - -SELECT "CREATE TABLE CA_ATTRIBUTE" AS " "; -SELECT "------------------------------------" AS " "; -CREATE TABLE CA_ATTRIBUTE( ATTRIBUTE_ID INTEGER PRIMARY KEY , - AT_ENTRY_ID INTEGER NOT NULL, - AT_NAME TEXT NOT NULL, - AT_VALUE TEXT NOT NULL, - UNIQUE( AT_ENTRY_ID, AT_NAME ), - FOREIGN KEY(AT_ENTRY_ID) REFERENCES CA_ENTRY(ENTRY_ID) ); - -SELECT "CREATE TABLE CA_LOCALIZATION_TEXT" AS " "; -SELECT "------------------------------------" AS " "; -CREATE TABLE CA_LOCALIZATION_TEXT( LOC_TEXT_ID INTEGER PRIMARY KEY , - LT_TABLE_NAME TEXT , - LT_ATTRIBUTE_NAME TEXT , - LT_STRING_ID TEXT , - LT_ROW_ID INTEGER ); - -SELECT "CREATE TABLE CA_DB_PROPERTIES" AS " "; -SELECT "------------------------------------" AS " "; -CREATE TABLE CA_DB_PROPERTIES( DB_PROPERTIES_ID INTEGER PRIMARY KEY , - DB_PROPERTY TEXT UNIQUE, - DB_VALUE TEXT ); diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/data/fill_castoragedb.sql --- a/contentstorage/castorage/data/fill_castoragedb.sql Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,380 +0,0 @@ -SELECT "INSERT GROUPS" AS " "; -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID ) -VALUES ( 'Menu', 2, "folder", NULL , NULL ); - - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID ) -VALUES ( 'AllCollections', 2, "menucollections", NULL , NULL ); - - -SELECT "." AS " "; -INSERT INTO CA_ICON (IC_FILENAME, IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID) -VALUES ( 'z:\resource\apps\matrixmenudata.mif', 16392, 16393, 8564, 270501603 ); -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID, EN_FLAGS ) -VALUES ( 'Application Library', 2, "applicationlibrary", ( SELECT last_insert_rowid() ), NULL, 8 ); - - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID, EN_FLAGS ) -VALUES ( 'Downloaded', 2, "collection::downloaded", NULL , NULL, 8 ); - -SELECT "." AS " "; -INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_ROW_ID ) -VALUES ( 'CA_ENTRY', 'EN_TEXT', "txt_applib_dblist_downloaded", ( SELECT last_insert_rowid() ) ); - - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID, EN_FLAGS ) -VALUES ( 'Office', 2, "collection", NULL , NULL, 12 ); - -SELECT "." AS " "; -INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_ROW_ID ) -VALUES ( 'CA_ENTRY', 'EN_TEXT', "txt_applib_dblist_office", ( SELECT last_insert_rowid() ) ); - - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'File mgr.', 1, "application", 270501099 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'QuickOffice', 1, "application", 536871616 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Zip', 1, "application", 536871485 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Adobe PDF', 1, "application", 536923435 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Active notes', 1, "application", 271063601 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Dictionary', 1, "application", 536959440 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Calculator', 1, "application", 268458242 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Converter', 1, "application", 270485096 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID, EN_FLAGS ) -VALUES ( 'Multimedia', 2, "collection", NULL , NULL, 12 ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Music Player', 1, "application", 270561987 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Photos', 1, "application", 536937700 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Radio', 1, "application", 270563977 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Recorder', 1, "application", 268458186 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Ovi Music', 1, "application", 270531409 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'RealPlayer', 1, "application", 268458558 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Videos & TV', 1, "application", 537006586 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Podcasting', 1, "application", 271063307 , NULL ); - - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID, EN_FLAGS ) -VALUES ( 'Utils', 2, "collection", NULL , NULL, 12 ); - - -SELECT "INSERT ITEMS" AS " "; -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'SW update', 1, "application", 537001519 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Device updates', 1, "application", 270495205 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'eshell', 1, "application", 270498535 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Phone setup', 1, "application", 536945316 , NULL ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Settings', 1, "application", 268458220 , NULL ); - -SELECT "BIND ITEMS TO GROUP Office (CREATE LINKS)" AS " "; -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Dictionary'), - 1 ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Quickoffice'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Converter'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Zip'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Calculator'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Active notes'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Adobe PDF'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'File mgr.'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office')) ); - -SELECT "BIND ITEMS TO GROUP Multimedia (CREATE LINKS)" AS " "; -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Music Player'), - 1 ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Photos'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Radio'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Recorder'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Ovi Music'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'RealPlayer'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Videos & TV'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Podcasting'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia')) ); - -SELECT "BIND ITEMS TO GROUP Utils (CREATE LINKS)" AS " "; -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Utils') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'SW update'), - 1 ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Utils') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Device updates'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Utils')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Utils') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'eshell'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Utils')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Utils') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Phone setup'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Utils')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Utils') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Settings'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Utils')) ); - -SELECT "BIND COLLECTIONS TO GROUP AllCollections (CREATE LINKS)" AS " "; -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'AllCollections') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Downloaded'), - 1 ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'AllCollections') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Office'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'AllCollections')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'AllCollections') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Multimedia'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'AllCollections')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'AllCollections') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Utils'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'AllCollections')) ); - - -SELECT "Create data for Favorites" AS " "; -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID, EN_FLAGS ) -VALUES ( 'Favorites', 2, "collection", NULL , NULL, 12 ); - - -SELECT "." AS " "; -INSERT INTO CA_ICON (IC_FILENAME, IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID) -VALUES ( 'c:\data\Images\kqticaicons\facebook.png', NULL, NULL, NULL, NULL); -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Facebook', 1, "url", NULL , ( SELECT last_insert_rowid() ) ); -INSERT INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE ) -VALUES ( ( SELECT last_insert_rowid() ) ,"url","http://www.facebook.com/"); - -SELECT "." AS " "; -INSERT INTO CA_ICON (IC_FILENAME, IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID) -VALUES ( 'c:\data\Images\kqticaicons\google.png', NULL, NULL, NULL, NULL); -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'Google', 1, "url", NULL , ( SELECT last_insert_rowid() ) ); -INSERT INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE ) -VALUES ( ( SELECT last_insert_rowid() ) ,"url","http://www.google.com/"); - -SELECT "." AS " "; -INSERT INTO CA_ICON (IC_FILENAME, IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID) -VALUES ( 'c:\data\Images\kqticaicons\youtube.png', NULL, NULL, NULL, NULL); -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'YouTube', 1, "url", NULL , ( SELECT last_insert_rowid() ) ); -INSERT INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE ) -VALUES ( ( SELECT last_insert_rowid() ) ,"url","http://www.youtube.com/"); - -SELECT "." AS " "; -INSERT INTO CA_ICON (IC_FILENAME, IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID) -VALUES ( 'c:\data\Images\kqticaicons\myspace.png', NULL, NULL, NULL, NULL); -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID, EN_ICON_ID ) -VALUES ( 'MySpace', 1, "url", NULL , ( SELECT last_insert_rowid() ) ); -INSERT INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE ) -VALUES ( ( SELECT last_insert_rowid() ) ,"url","http://www.myspace.com/"); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Favorites') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Facebook'), - 1 ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Favorites') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Google'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Favorites')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Favorites') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'YouTube'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Favorites')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Favorites') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'MySpace'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Favorites')) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'AllCollections') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Favorites'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'AllCollections')) ); - -SELECT "." AS " "; -INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID, EN_FLAGS ) -VALUES ( 'Games', 2, "collection", NULL , NULL, 12 ); - -SELECT "." AS " "; -INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_ROW_ID ) -VALUES ( 'CA_ENTRY', 'EN_TEXT', "txt_applib_dblist_games", ( SELECT last_insert_rowid() ) ); - -SELECT "." AS " "; -INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) -VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'AllCollections') , - (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'Games'), - (SELECT MAX(GE_POSITION) + 1 FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = 'AllCollections')) ); - -SELECT "." AS " "; -INSERT INTO CA_DB_PROPERTIES ( DB_PROPERTY, DB_VALUE ) -VALUES ( 'Version', '00001' ); - -SELECT "." AS " "; -INSERT INTO CA_DB_PROPERTIES ( DB_PROPERTY, DB_VALUE ) -VALUES ( 'Language', 'en_GB' ); - -SELECT "." AS " "; -INSERT INTO CA_DB_PROPERTIES ( DB_PROPERTY, DB_VALUE ) -VALUES ( 'QMfile', 'db_textmap_' ); - diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/data/make_castoragedb.sql --- a/contentstorage/castorage/data/make_castoragedb.sql Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -.read create_castoragedb.sql -.genfkey --exec -.read fill_castoragedb.sql - diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/inc/caconsts.h --- a/contentstorage/castorage/inc/caconsts.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/castorage/inc/caconsts.h Fri Apr 16 15:16:09 2010 +0300 @@ -18,7 +18,7 @@ #ifndef CACONSTS_H_ #define CACONSTS_H_ -_LIT( KDbName, "castoragedb" ); +_LIT( KDbName, "castorage.db" ); _LIT( KCDrive, "c:" ); _LIT( KZDrive, "z:" ); _LIT( KDoubleSlash, "\\" ); diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/inc/cadebug.h --- a/contentstorage/castorage/inc/cadebug.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/castorage/inc/cadebug.h Fri Apr 16 15:16:09 2010 +0300 @@ -46,14 +46,14 @@ #endif /** - * TODO - * - * @param aData + * Prints given descriptor to debug log file. + * @param aData descriptor with data. */ static void DoOutput( TDesC8& aData ); /** - * TODO + * Prints given descriptor to debug log file. + * @param aFmt descriptor with data. */ static void DebugStringNarrowL( const char* aFmt, ... ) { @@ -71,7 +71,8 @@ } /** - * TODO + * Prints given descriptor to debug log file. + * @param aFmt descriptor with data. */ static void DebugStringWideL( const char* aFmt, ... ) { @@ -93,7 +94,8 @@ } /** - * TODO + * Prints given time containinf descriptor to log file. + * @param aBuf descriptor with time information. */ static void DebugBufferL( const TDesC8& aBuf ) { @@ -101,7 +103,8 @@ } /** - * TODO + * Prints given time containinf descriptor to log file. + * @param aBuf descriptor with time information. */ static void DebugBufferL( const TDesC& aBuf ) { @@ -109,7 +112,8 @@ } /** - * TODO + * Prints given time to log file. + * @param aTime time to print. */ static void DebugTimeL( const TTime& aTime ) { @@ -123,7 +127,8 @@ } /** - * TODO + * Prints given descriptor to debug log file. + * @param aData descriptor with data. */ static void DoOutput( TDesC8& aData ) { @@ -135,7 +140,8 @@ #ifdef _KQTI_MENU_TRACE_PERFORMANCE /** - * TODO + * Prints given descriptor to preformance log file. + * @param aData descriptor with data. */ static void DoOutputPerf(TDesC8& aData) { @@ -146,7 +152,8 @@ } /** - * TODO + * Formats string for performance debug output. + * @param aFmt string for debug output. */ static void DebugStringNarrowPerfL( const char* aFmt, ... ) { diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/inc/casqlcommands.h --- a/contentstorage/castorage/inc/casqlcommands.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/castorage/inc/casqlcommands.h Fri Apr 16 15:16:09 2010 +0300 @@ -49,9 +49,8 @@ VALUES ( :GE_GROUP_ID, :GE_ENTRY_ID, :GE_POSITION )" ); _LIT( KSQLInsertToIcon, "INSERT INTO CA_ICON \ -(IC_FILENAME,IC_BITMAP_ID,IC_MASK_ID,IC_SKINMAJOR_ID,IC_SKINMINOR_ID) \ -VALUES ( :IC_FILENAME, :IC_BITMAP_ID, :IC_MASK_ID, \ -:IC_SKINMAJOR_ID, :IC_SKINMINOR_ID )" ); +(IC_FILENAME,IC_SKIN_ID,IC_APP_ID) \ +VALUES ( :IC_FILENAME, :IC_SKIN_ID, :IC_APP_ID )" ); _LIT( KSQLInsertToLaunch, "INSERT INTO CA_LAUNCH \ (LA_ENTRY_ID, LA_LAUNCH_TIME) \ @@ -96,10 +95,8 @@ // Update Icon _LIT( KSQLUpdateIconId, "ICON_ID = :ICON_ID " ); _LIT( KSQLUpdateIconFileName, "IC_FILENAME = :IC_FILENAME " ); -_LIT( KSQLUpdateIconBitmapId, "IC_BITMAP_ID = :IC_BITMAP_ID " ); -_LIT( KSQLUpdateIconMaskId, "IC_MASK_ID = :IC_MASK_ID " ); -_LIT( KSQLUpdateIconSkinMajorId, "IC_SKINMAJOR_ID = :IC_SKINMAJOR_ID " ); -_LIT( KSQLUpdateIconSkinMinorId, "IC_SKINMINOR_ID = :IC_SKINMINOR_ID " ); +_LIT( KSQLUpdateIconSkinId, "IC_SKIN_ID = :IC_SKIN_ID " ); +_LIT( KSQLUpdateIconAppId, "IC_APP_ID = :IC_APP_ID " ); _LIT( KSQLUpdateIconWhere, "WHERE ICON_ID = :ICON_ID" ); // Update property @@ -136,20 +133,23 @@ _LIT( KSQLGetListByEntryIds, "SELECT ENTRY_ID, EN_TEXT, EN_DESCRIPTION, \ EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_CREATION_TIME, EN_UID, EN_FLAGS, \ -IC_FILENAME, IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID \ +IC_FILENAME,IC_SKIN_ID,IC_APP_ID \ FROM CA_ENTRY LEFT JOIN CA_ICON ON EN_ICON_ID = ICON_ID \ WHERE ENTRY_ID IN ( %S )" ); -_LIT( KSQLGetList, "SELECT ENTRY_ID, EN_TEXT, EN_DESCRIPTION, EN_ROLE, \ +_LIT( KSQLGetList1, "SELECT ENTRY_ID, EN_TEXT, EN_DESCRIPTION, EN_ROLE, \ EN_TYPE_NAME, EN_ICON_ID, EN_CREATION_TIME, EN_UID, EN_FLAGS, IC_FILENAME, \ -IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID FROM \ -CA_ENTRY LEFT JOIN CA_ICON ON EN_ICON_ID = ICON_ID " ); +IC_SKIN_ID, IC_APP_ID FROM CA_ENTRY " ); + +_LIT( KSQLGetList2, "LEFT JOIN CA_ICON ON EN_ICON_ID = ICON_ID " ); + -_LIT( KSQLGetListByParentId, "SELECT ENTRY_ID, EN_TEXT, EN_DESCRIPTION, \ +_LIT( KSQLGetListByParentId1, "SELECT ENTRY_ID, EN_TEXT, EN_DESCRIPTION, \ EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_CREATION_TIME, EN_UID, EN_FLAGS, \ -IC_FILENAME, IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID, \ -GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION FROM CA_ENTRY \ -LEFT JOIN CA_ICON ON EN_ICON_ID = ICON_ID LEFT JOIN CA_GROUP_ENTRY ON \ +IC_FILENAME, IC_SKIN_ID, IC_APP_ID, \ +GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION FROM CA_ENTRY " ); + +_LIT( KSQLGetListByParentId2, "LEFT JOIN CA_ICON ON EN_ICON_ID = ICON_ID LEFT JOIN CA_GROUP_ENTRY ON \ GE_ENTRY_ID = ENTRY_ID WHERE GE_GROUP_ID = :GE_GROUP_ID %S " ); //Get all attributes by entry id @@ -162,8 +162,7 @@ // %S - the input table to work on. _LIT( KSQLGetListByLaunchDataPart1,"SELECT ENTRY_ID, EN_TEXT, \ EN_DESCRIPTION, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_CREATION_TIME, \ -EN_UID, EN_FLAGS, IC_FILENAME, IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, \ -IC_SKINMINOR_ID FROM ("); +EN_UID, EN_FLAGS, IC_FILENAME, IC_SKIN_ID, IC_APP_ID FROM ("); // %S - the table to match e.g KSQLGetMostUsed or KSQLGetLastUsed // The column USAGE_DATA is used to order the items @@ -178,10 +177,8 @@ _LIT( KSQLGetIconId,"SELECT ICON_ID AS Data FROM CA_ICON \ WHERE IC_FILENAME = :IC_FILENAME AND \ -IC_BITMAP_ID = :IC_BITMAP_ID AND \ -IC_MASK_ID = :IC_MASK_ID AND \ -IC_SKINMAJOR_ID = :IC_SKINMAJOR_ID AND \ -IC_SKINMINOR_ID = :IC_SKINMINOR_ID"); +IC_SKIN_ID = :IC_SKIN_ID AND \ +IC_APP_ID = :IC_APP_ID"); _LIT( KSQLGetEntryIdFromEntryTable,"SELECT ENTRY_ID AS Data FROM CA_ENTRY \ WHERE ENTRY_ID = :ENTRY_ID"); @@ -189,13 +186,12 @@ _LIT( KSQLGETIconIdFromEntryTable, "SELECT EN_ICON_ID AS Data FROM CA_ENTRY \ WHERE ENTRY_ID = :ENTRY_ID"); -_LIT( KSQLGetIconDataByIdIcon,"SELECT ICON_ID, IC_FILENAME, IC_BITMAP_ID, \ -IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID \ +_LIT( KSQLGetIconDataByIdIcon,"SELECT ICON_ID, IC_FILENAME, IC_SKIN_ID, IC_APP_ID \ FROM CA_ICON WHERE ICON_ID = :EN_ICON_ID"); _LIT( KSQLGetIconsItems,"SELECT ENTRY_ID, EN_TEXT, EN_DESCRIPTION, EN_ROLE, \ EN_TYPE_NAME, EN_ICON_ID, EN_CREATION_TIME, EN_UID, EN_FLAGS, IC_FILENAME, \ -IC_BITMAP_ID, IC_MASK_ID, IC_SKINMAJOR_ID, IC_SKINMINOR_ID FROM \ +IC_SKIN_ID, IC_APP_ID FROM \ CA_ENTRY LEFT JOIN CA_ICON ON EN_ICON_ID = ICON_ID \ WHERE EN_ICON_ID = :EN_ICON_ID"); @@ -255,6 +251,14 @@ _LIT( KAnd, " AND " ); _LIT( KLimit, " LIMIT "); _LIT( KSingleQuotes, "\'" ); +_LIT( KDot, "." ); +_LIT( KEqual, " = "); +_LIT( KEmpty, "" ); +_LIT( KGroupBy, " GROUP BY " ); +_LIT( KAt, " at" ); +_LIT( KLeftJoinCaAttrubute1, " LEFT JOIN CA_ATTRIBUTE as at" ); +_LIT( KLeftJoinCaAttrubute2, " ON ENTRY_ID = at" ); +_LIT( KLeftJoinCaAttrubute3, ".AT_ENTRY_ID " ); _LIT( KSQLSortOrderNameAsc, " ORDER BY EN_TEXT ASC" ); _LIT( KSQLSortOrderNameDesc, " ORDER BY EN_TEXT DESC" ); @@ -283,10 +287,8 @@ _LIT( KSQLIconId, ":ICON_ID" ); _LIT( KSQLIcFileName, ":IC_FILENAME" ); -_LIT( KSQLIcBitmapId, ":IC_BITMAP_ID" ); -_LIT( KSQLIcMaskId, ":IC_MASK_ID" ); -_LIT( KSQLIcSkinMajorId, ":IC_SKINMAJOR_ID" ); -_LIT( KSQLIcSkinMinorId, ":IC_SKINMINOR_ID" ); +_LIT( KSQLIcSkinId, ":IC_SKIN_ID" ); +_LIT( KSQLIcAppId, ":IC_APP_ID" ); _LIT( KSQLLaunchId, ":LAUNCH_ID" ); _LIT( KSQLLaLaunchTime, ":LA_LAUNCH_TIME" ); @@ -330,10 +332,8 @@ _LIT( KColumnIconId, "ICON_ID" ); _LIT( KColumnIcFileName, "IC_FILENAME" ); -_LIT( KColumnIcBitmapId, "IC_BITMAP_ID" ); -_LIT( KColumnIcMaskId, "IC_MASK_ID" ); -_LIT( KColumnIcSkinMajorId, "IC_SKINMAJOR_ID" ); -_LIT( KColumnIcSkinMinorId, "IC_SKINMINOR_ID" ); +_LIT( KColumnIcSkinId, "IC_SKIN_ID" ); +_LIT( KColumnIcAppId, "IC_APP_ID" ); _LIT( KColumnLaunchId, "LAUNCH_ID" ); _LIT( KColumnLaLaunchTime, "LA_LAUNCH_TIME" ); diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/inc/casqlitestorage.h --- a/contentstorage/castorage/inc/casqlitestorage.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/castorage/inc/casqlitestorage.h Fri Apr 16 15:16:09 2010 +0300 @@ -18,7 +18,7 @@ #ifndef C_CASTORAGE_ENGINE_H #define C_CASTORAGE_ENGINE_H -#include +#include #include #include #include "castorage.h" diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/src/casqlitestorage.cpp --- a/contentstorage/castorage/src/casqlitestorage.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/castorage/src/casqlitestorage.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -23,6 +23,8 @@ #include "cainnerquery.h" #include "caarraycleanup.inl" #include "calocalizationentry.h" +#include "cainternaltypes.h" +#include "cadef.h" // --------------------------------------------------------------------------- // CCASqLiteStorage::CCpStorageEngine() @@ -50,12 +52,25 @@ User::LeaveIfError( CreatePrivateDirPath( iPrivatePathCDrive, KCDrive, KNullDesC ) ); + if( iSqlDb.Open( iPrivatePathCDriveDb, &KSqlDbConfig ) ) { //we could not load data base from C-drive lets try Rom LoadDataBaseFromRomL(); } + else + { + TBuf versionValue; + DbPropertyL(KCaDbPropVersion, versionValue); + ASSERT(versionValue.Length()>0); + if( versionValue.CompareC( KCaDbVersion ) ) + { + // database loaded from C: is obsolete, load from Z: + iSqlDb.Close(); + LoadDataBaseFromRomL(); + } + } } // --------------------------------------------------------------------------- @@ -74,7 +89,7 @@ if( !( BaflUtils::FileExists( iRfs, iPrivatePathZDriveDb ) ) ) { - User::Panic( _L("fatal error - castoragedb not exists in ROM"), + User::Panic( _L("fatal error - castorage.db not exists in ROM"), KErrNotFound ); } else @@ -184,6 +199,7 @@ CCaSqlQuery::EAttribute ); CleanupStack::PopAndDestroy( sqlGetAttributesQuery ); } + // set entries if proper order if they were fetched by ids if( aQuery->GetIds().Count() > 0 ) { @@ -229,6 +245,7 @@ sqlGetEntriesIdsQuery->ExecuteL( aResultIdArray, CCaSqlQuery::EEntryTable ); CleanupStack::PopAndDestroy( sqlGetEntriesIdsQuery ); + } // --------------------------------------------------------------------------- @@ -799,7 +816,6 @@ case TCaOperationParams::EAppend: default: { - // TODO: do nothing when default break; } } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/src/casqlquery.cpp --- a/contentstorage/castorage/src/casqlquery.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/castorage/src/casqlquery.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -516,25 +516,15 @@ BindTextL( iStatement.ParameterIndex( KSQLIcFileName ), aEntry->GetIcon().iFileName ); } - if( iQuery.Find( KSQLIcBitmapId ) != KErrNotFound ) + if( iQuery.Find( KSQLIcSkinId ) != KErrNotFound ) { - BindIntL( iStatement.ParameterIndex( KSQLIcBitmapId ), - aEntry->GetIcon().iBitmapId ); - } - if( iQuery.Find(KSQLIcMaskId) != KErrNotFound ) - { - BindIntL( iStatement.ParameterIndex( KSQLIcMaskId ), - aEntry->GetIcon().iMaskId ); + BindTextL( iStatement.ParameterIndex( KSQLIcSkinId ), + aEntry->GetIcon().iSkinId ); } - if( iQuery.Find( KSQLIcSkinMajorId ) != KErrNotFound ) + if( iQuery.Find( KSQLIcAppId ) != KErrNotFound ) { - BindIntL( iStatement.ParameterIndex( KSQLIcSkinMajorId ), - aEntry->GetIcon().iSkinMajorId ); - } - if( iQuery.Find( KSQLIcSkinMinorId ) != KErrNotFound ) - { - BindIntL( iStatement.ParameterIndex( KSQLIcSkinMinorId ), - aEntry->GetIcon().iSkinMinorId ); + BindTextL( iStatement.ParameterIndex( KSQLIcAppId ), + aEntry->GetIcon().iApplicationId ); } } @@ -674,28 +664,17 @@ TInt rowCount(0); while( iStatement.Next() == KSqlAtRow ) { - TInt entryId = iStatement. - ColumnInt( ColumnIndexL( iStatement, KColumnEntryId ) ); - TInt role = iStatement. - ColumnInt( ColumnIndexL( iStatement, KColumnEnRole ) ); - // TODO get NULL ??? - TInt32 uid = - iStatement.ColumnInt( ColumnIndexL( iStatement, KColumnEnUid ) ) - ? iStatement.ColumnInt( ColumnIndexL( iStatement, KColumnEnUid ) ) - : 0; - TUint flags = iStatement.ColumnInt( ColumnIndexL( iStatement, - KColumnEnFlags ) ); - TInt idIcon = iStatement.ColumnInt( ColumnIndexL( iStatement, - KColumnEnIdIcon ) ); - TInt bitmapId = iStatement.ColumnInt( ColumnIndexL( iStatement, - KColumnIcBitmapId ) ); - TInt maskId = iStatement.ColumnInt( ColumnIndexL( iStatement, - KColumnIcMaskId ) ); - TInt skinMajorId = iStatement.ColumnInt( ColumnIndexL( iStatement, - KColumnIcSkinMajorId ) ); - TInt skinMinorId = iStatement.ColumnInt( ColumnIndexL( iStatement, - KColumnIcSkinMinorId ) ); - + TInt entryId = iStatement.ColumnInt( + ColumnIndexL( iStatement, KColumnEntryId ) ); + TInt role = iStatement.ColumnInt( + ColumnIndexL( iStatement, KColumnEnRole ) ); + TInt32 uid = iStatement.ColumnInt( + ColumnIndexL( iStatement, KColumnEnUid ) ); + TUint flags = iStatement.ColumnInt( + ColumnIndexL( iStatement, KColumnEnFlags ) ); + TInt idIcon = iStatement.ColumnInt( + ColumnIndexL( iStatement, KColumnEnIdIcon ) ); + TPtrC text; User::LeaveIfError( iStatement. ColumnText( ColumnIndexL( iStatement, KColumnEnText ), text ) ); @@ -706,15 +685,24 @@ TPtrC typeName; User::LeaveIfError( iStatement.ColumnText( ColumnIndexL(iStatement, KColumnEnTypeName ), typeName) ); + TPtrC iconFilename; User::LeaveIfError( iStatement.ColumnText( ColumnIndexL( iStatement, KColumnIcFileName ), iconFilename ) ); + TPtrC iconSkinId; + User::LeaveIfError( iStatement.ColumnText( ColumnIndexL( + iStatement, KColumnIcSkinId ), iconSkinId ) ); + + TPtrC iconApplicationId; + User::LeaveIfError( iStatement.ColumnText( ColumnIndexL( + iStatement, KColumnIcAppId ), iconApplicationId ) ); + CCaInnerEntry* result = CCaInnerEntry::NewLC(); result->SetId( entryId ); result->SetRole( role ); - result->SetIconDataL( bitmapId, maskId, skinMajorId, skinMinorId, - iconFilename ); + result->SetIconDataL( + iconFilename, iconSkinId, iconApplicationId ); result->SetIconId( idIcon ); result->SetFlags( flags ); result->SetUid( uid ); @@ -875,14 +863,12 @@ User::LeaveIfError(iStatement.ColumnText( ColumnIndexL( iStatement, KColumnIcFileName), aIconAttributes.iFileName)); - aIconAttributes.iBitmapId = iStatement.ColumnInt( - ColumnIndexL( iStatement, KColumnIcBitmapId ) ); - aIconAttributes.iMaskId = iStatement.ColumnInt( - ColumnIndexL( iStatement, KColumnIcMaskId ) ); - aIconAttributes.iSkinMajorId = iStatement.ColumnInt( - ColumnIndexL( iStatement, KColumnIcSkinMajorId ) ); - aIconAttributes.iSkinMinorId = iStatement.ColumnInt( - ColumnIndexL( iStatement, KColumnIcSkinMinorId ) ); + User::LeaveIfError(iStatement.ColumnText( + ColumnIndexL( iStatement, KColumnIcSkinId), + aIconAttributes.iSkinId)); + User::LeaveIfError(iStatement.ColumnText( + ColumnIndexL( iStatement, KColumnIcAppId), + aIconAttributes.iApplicationId)); columnCount++; } return columnCount; diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/castorage/src/casqlquerycreator.cpp --- a/contentstorage/castorage/src/casqlquerycreator.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/castorage/src/casqlquerycreator.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -231,10 +231,9 @@ { // entry's icon data is not in DB if( ( aEntry->GetIcon().iFileName.Length() != 0 ) || - ( aEntry->GetIcon().iBitmapId != 0 ) || - ( aEntry->GetIcon().iMaskId != 0 ) || - ( aEntry->GetIcon().iSkinMajorId != 0 ) || - ( aEntry->GetIcon().iSkinMinorId != 0 ) ) + ( aEntry->GetIcon().iSkinId.Length() != 0 ) || + ( aEntry->GetIcon().iApplicationId.Length() != 0 ) + ) { // icon is not null, so that insert it to storage aQuery->SetQueryL( KSQLInsertToIcon ); @@ -269,13 +268,10 @@ CCaInnerEntry::TIconAttributes iconAttributs; query->ExecuteL( iconAttributs ); query->CloseStatement(); - if( !( !iconAttributs.iFileName.Compare( aEntry->GetIcon().iFileName ) - && ( iconAttributs.iBitmapId == aEntry->GetIcon().iBitmapId ) - && ( iconAttributs.iMaskId == aEntry->GetIcon().iMaskId ) - && ( iconAttributs.iSkinMajorId - == aEntry->GetIcon().iSkinMajorId ) - && ( iconAttributs.iSkinMinorId - == aEntry->GetIcon().iSkinMinorId ) ) ) + if( !( !iconAttributs.iFileName.Compare( aEntry->GetIcon().iFileName ) + && (!iconAttributs.iSkinId.Compare( aEntry->GetIcon().iSkinId )) + && (!iconAttributs.iApplicationId.Compare( aEntry->GetIcon().iApplicationId )) + ) ) { // entry's icon data is updated // if icon is used by another entry(s), new icon'll added to DB and @@ -346,32 +342,18 @@ query.Append( KSQLUpdateIconFileName ); query.Append( KComma ); } - if( aEntry->GetIcon().iBitmapId ) + if( aEntry->GetIcon().iSkinId.Compare( KNullDesC ) ) { - query.ReAllocL( query.Length() + KSQLUpdateIconBitmapId().Length() + query.ReAllocL( query.Length() + KSQLUpdateIconSkinId().Length() + KComma().Length() ); - query.Append( KSQLUpdateIconBitmapId ); + query.Append( KSQLUpdateIconSkinId ); query.Append( KComma ); } - if( aEntry->GetIcon().iMaskId ) - { - query.ReAllocL( query.Length() + KSQLUpdateIconMaskId().Length() - + KComma().Length() ); - query.Append( KSQLUpdateIconMaskId ); - query.Append( KComma ); - } - if( aEntry->GetIcon().iSkinMajorId ) + if( aEntry->GetIcon().iApplicationId.Compare(KNullDesC) ) { - query.ReAllocL( query.Length() + KSQLUpdateIconSkinMajorId().Length() + query.ReAllocL( query.Length() + KSQLUpdateIconAppId().Length() + KComma().Length() ); - query.Append( KSQLUpdateIconSkinMajorId ); - query.Append( KComma ); - } - if( aEntry->GetIcon().iSkinMinorId ) - { - query.ReAllocL( query.Length() + KSQLUpdateIconSkinMinorId().Length() - + KComma().Length() ); - query.Append( KSQLUpdateIconSkinMinorId ); + query.Append( KSQLUpdateIconAppId ); } if( !query.Right( KComma().Length() ).Compare( KComma ) ) { @@ -686,26 +668,115 @@ &typeNameWhereStatement ); CleanupStack::PopAndDestroy( &typeNameWhereStatement ); } + + if( aQuery->GetAttributes().Count() ) + { + RBuf whereAttributes; + whereAttributes.CleanupClosePushL(); + whereAttributes.CreateL( KEmpty ); + + for( TInt j=1; j <= aQuery->GetAttributes().Count(); j++ ) + { + // at1.AT_NAME = 'Attribute_Name_1' AND at1.AT_VALUE = 'Attribute_VALUE_1' + TPtrC atrName( aQuery->GetAttributes().operator [](j-1)->Name() ); + TPtrC atrValue( aQuery->GetAttributes().operator [](j-1)->Value() ); + + whereAttributes.ReAllocL( whereAttributes.Length() + 2 * KAnd().Length() + + 4 * KSingleQuotes().Length() + + 2 * KMaxIntNumLength + + 2 * KAt().Length() + 2 * KDot().Length() + 2 * KEqual().Length() + + KColumnAttrName().Length() + KColumnAttrValue().Length() + + atrName.Length() + atrValue.Length() ); + + whereAttributes.Append( KAnd ); + + whereAttributes.Append( KAt ); + whereAttributes.AppendNum( j ); + whereAttributes.Append( KDot ); + whereAttributes.Append( KColumnAttrName ); + whereAttributes.Append( KEqual ); + whereAttributes.Append( KSingleQuotes ); + whereAttributes.Append( atrName ); + whereAttributes.Append( KSingleQuotes ); + + whereAttributes.Append( KAnd ); + + whereAttributes.Append( KAt ); + whereAttributes.AppendNum( j ); + whereAttributes.Append( KDot ); + whereAttributes.Append( KColumnAttrValue ); + whereAttributes.Append( KEqual ); + whereAttributes.Append( KSingleQuotes ); + whereAttributes.Append( atrValue ); + whereAttributes.Append( KSingleQuotes ); + + } + + whereStatement.ReAllocL( whereStatement.Length() + whereAttributes.Length() ); + whereStatement.Append( whereAttributes ); + + CleanupStack::PopAndDestroy( &whereAttributes ); + } + + RBuf leftJoins; + leftJoins.CleanupClosePushL(); + leftJoins.CreateL( KEmpty ); + if( aQuery->GetAttributes().Count() ) + { + for( TInt j=1; j <= aQuery->GetAttributes().Count(); j++ ) + { + // LEFT JOIN CA_ATTRIBUTE as at1 ON ENTRY_ID = at1.AT_ENTRY_ID + leftJoins.ReAllocL( leftJoins.Length() + + KLeftJoinCaAttrubute1().Length() + KMaxIntNumLength + + KLeftJoinCaAttrubute2().Length() + KMaxIntNumLength + + KLeftJoinCaAttrubute3().Length() + ); + + leftJoins.Append( KLeftJoinCaAttrubute1 ); + leftJoins.AppendNum( j ); + leftJoins.Append( KLeftJoinCaAttrubute2 ); + leftJoins.AppendNum( j ); + leftJoins.Append( KLeftJoinCaAttrubute3 ); + } + } + + + whereStatement.ReAllocL( whereStatement.Length() + + KGroupBy().Length() + KColumnEntryId().Length() ); + whereStatement.Append( KGroupBy ); + whereStatement.Append( KColumnEntryId ); TInt groupId = aQuery->GetParentId(); RBuf query; query.CleanupClosePushL(); if( groupId > 0 ) { - query.CreateL( KSQLGetListByParentId().Length() - + whereStatement.Length() - 2 ); - query.AppendFormat( KSQLGetListByParentId, &whereStatement ); + RBuf getListByParentId2withWhere; + getListByParentId2withWhere.CleanupClosePushL(); + getListByParentId2withWhere.CreateL( KSQLGetListByParentId2().Length() + whereStatement.Length() ); + getListByParentId2withWhere.AppendFormat( KSQLGetListByParentId2, &whereStatement ); + + query.ReAllocL( KSQLGetListByParentId1().Length() + leftJoins.Length() + + getListByParentId2withWhere.Length() ); + query.Append( KSQLGetListByParentId1 ); + query.Append( leftJoins ); + query.Append( getListByParentId2withWhere ); + CleanupStack::PopAndDestroy( &getListByParentId2withWhere ); } else { - query.CreateL( KSQLGetList().Length() ); - query.Append( KSQLGetList ); + query.CreateL( KSQLGetList1().Length() ); + query.Append( KSQLGetList1 ); + query.ReAllocL( query.Length() + leftJoins.Length() + KSQLGetList2().Length() ); + query.Append( leftJoins ); + query.Append( KSQLGetList2 ); if( whereStatement.Length() >= KAnd().Length() ) { TPtrC ptrWhereStatement( whereStatement.Right( whereStatement.Length() - KAnd().Length() ) ); - query.ReAllocL( KSQLGetList().Length() + KWhere().Length() + query.ReAllocL( query.Length() + KWhere().Length() + ptrWhereStatement.Length() ); + query.Append( KWhere ); query.Append( ptrWhereStatement ); } @@ -725,6 +796,7 @@ aSqlQuery->SetQueryL( query ); CleanupStack::PopAndDestroy( &query ); + CleanupStack::PopAndDestroy( &leftJoins ); CleanupStack::PopAndDestroy( &whereStatement ); } @@ -962,10 +1034,9 @@ CaSqlQueryCreator::TIconType CaSqlQueryCreator::CheckIconType( const CCaInnerEntry* aEntry ) { CaSqlQueryCreator::TIconType iconType; - if( aEntry->GetIcon().iBitmapId == 0 && - aEntry->GetIcon().iMaskId == 0 && - aEntry->GetIcon().iSkinMajorId == 0 && - aEntry->GetIcon().iSkinMinorId == 0 && + if( + aEntry->GetIcon().iApplicationId.Length() == 0 && + aEntry->GetIcon().iSkinId.Length() == 0 && aEntry->GetIcon().iFileName.Length() == 0 ) { if( aEntry->GetIconId() > 0 ) diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cautils/inc/cainnerentry.h --- a/contentstorage/cautils/inc/cainnerentry.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/cautils/inc/cainnerentry.h Fri Apr 16 15:16:09 2010 +0300 @@ -35,11 +35,9 @@ { //TODO: maybe it should be C class with RBuf instead of TFileName TInt iId; - TInt iBitmapId; - TInt iMaskId; - TInt iSkinMajorId; - TInt iSkinMinorId; TFileName iFileName; + TBuf iSkinId; + TBuf iApplicationId; }; public: @@ -149,14 +147,12 @@ /** * Sets icon data. - * @param aBitmapId Bitmap id. - * @param aMaskId Mask id. - * @param aSkinMajorId Skin major id. - * @param aSkinMinorId Skin minor id. * @param aFilename Filename. + * @param aSkinId Skin id. + * @param aApplicationId application id. */ - IMPORT_C void SetIconDataL( TInt aBitmapId, TInt aMaskId, - TInt aSkinMajorId, TInt aSkinMinorId, const TDesC& aFilename ); + IMPORT_C void SetIconDataL( + const TDesC& aFilename, const TDesC& aSkinId, const TDesC& aApplicationId ); /** * Adds attribute to entry. diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cautils/inc/cainnerquery.h --- a/contentstorage/cautils/inc/cainnerquery.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/cautils/inc/cainnerquery.h Fri Apr 16 15:16:09 2010 +0300 @@ -19,6 +19,7 @@ #define __CCAINNERQUERY_H__ #include +#include "caentryattribute.h" //FORWARD DECLARATIONS class CDesC16ArrayFlat; @@ -189,6 +190,20 @@ * @return The maximum amount of entries to be fetched. */ IMPORT_C TUint GetCount() const; + + /** + * Adds attribute to query. + * @param aKey Attribute key. + * @param aValue Attribute value. + */ + IMPORT_C void AddAttributeL( const TDesC& aKey, const TDesC& aValue ); + + /** + * Get attributes array + * @return attributes array + */ + IMPORT_C const RCaEntryAttrArray& GetAttributes() const; + private: @@ -249,6 +264,11 @@ * Number of entries to fetch */ TUint iCount; + + /* + * Attributes array. Own + */ + RCaEntryAttrArray iAttributes; }; diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cautils/src/cainnerentry.cpp --- a/contentstorage/cautils/src/cainnerentry.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/cautils/src/cainnerentry.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -64,12 +64,12 @@ aStream.WriteInt32L( iId ); aStream.WriteInt32L( iUid ); aStream.WriteInt32L( iIcon.iId ); - aStream.WriteInt32L( iIcon.iBitmapId ); - aStream.WriteInt32L( iIcon.iMaskId ); - aStream.WriteInt32L( iIcon.iSkinMajorId ); - aStream.WriteInt32L( iIcon.iSkinMinorId ); aStream.WriteUint32L( iIcon.iFileName.Length() ); aStream.WriteL( iIcon.iFileName, iIcon.iFileName.Length() ); + aStream.WriteUint32L( iIcon.iSkinId.Length() ); + aStream.WriteL( iIcon.iSkinId, iIcon.iSkinId.Length() ); + aStream.WriteUint32L( iIcon.iApplicationId.Length() ); + aStream.WriteL( iIcon.iApplicationId, iIcon.iApplicationId.Length() ); aStream.WriteUint32L( iFlags ); aStream.WriteUint32L( iRole ); aStream.WriteUint32L( iText.Length() ); @@ -91,12 +91,12 @@ iId = aStream.ReadInt32L(); iUid = aStream.ReadInt32L(); iIcon.iId = aStream.ReadInt32L(); - iIcon.iBitmapId = aStream.ReadInt32L(); - iIcon.iMaskId = aStream.ReadInt32L(); - iIcon.iSkinMajorId = aStream.ReadInt32L(); - iIcon.iSkinMinorId = aStream.ReadInt32L(); TUint length = aStream.ReadUint32L(); aStream.ReadL( iIcon.iFileName, length ); + length = aStream.ReadUint32L(); + aStream.ReadL( iIcon.iSkinId, length ); + length = aStream.ReadUint32L(); + aStream.ReadL( iIcon.iApplicationId, length ); iFlags = aStream.ReadUint32L(); iRole = aStream.ReadUint32L(); length = aStream.ReadUint32L(); @@ -266,15 +266,12 @@ // // --------------------------------------------------------------------------- // -EXPORT_C void CCaInnerEntry::SetIconDataL( TInt aBitmapId, TInt aMaskId, - TInt aSkinMajorId, TInt aSkinMinorId, const TDesC& aFilename ) +EXPORT_C void CCaInnerEntry::SetIconDataL( + const TDesC& aFilename, const TDesC& aSkinId, const TDesC& aApplicationId ) { - iIcon.iBitmapId = aBitmapId; - iIcon.iMaskId = aMaskId; - iIcon.iSkinMajorId = aSkinMajorId; - iIcon.iSkinMinorId = aSkinMinorId; - iIcon.iFileName.Copy( aFilename ); + iIcon.iSkinId.Copy( aSkinId ); + iIcon.iApplicationId.Copy(aApplicationId); } // --------------------------------------------------------------------------- diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/cautils/src/cainnerquery.cpp --- a/contentstorage/cautils/src/cainnerquery.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/cautils/src/cainnerquery.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -30,6 +30,7 @@ { delete iEntryTypeNames; iIds.Close(); + iAttributes.ResetAndDestroy(); } // --------------------------------------------------------------------------- @@ -81,6 +82,8 @@ aStream.WriteL( iEntryTypeNames->MdcaPoint( i ), iEntryTypeNames->MdcaPoint( i ).Length() ); } + iAttributes.ExternalizeL( aStream ); + aStream.CommitL(); } // --------------------------------------------------------------------------- @@ -114,6 +117,7 @@ iEntryTypeNames->AppendL( buf ); CleanupStack::PopAndDestroy( &buf ); } + iAttributes.InternalizeL( aStream ); } // --------------------------------------------------------------------------- @@ -124,8 +128,7 @@ { iEntryTypeNames = new ( ELeave ) CDesC16ArrayFlat( KDefaultGranularity ); iParentId = -1; - // TODO Item | Group - iRole = CCaInnerQuery::Item | CCaInnerQuery::Group; + iRole = Item | Group; } // --------------------------------------------------------------------------- @@ -190,7 +193,6 @@ // EXPORT_C void CCaInnerQuery::SetEntryTypeNames( CDesC16ArrayFlat* aArray ) { - //TODO: Quickt setter for now, probably sth more convinient needed ASSERT( aArray ); delete iEntryTypeNames; iEntryTypeNames = aArray; @@ -302,3 +304,30 @@ { return iCount; } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CCaInnerQuery::AddAttributeL( const TDesC& aKey, + const TDesC& aValue ) + { + // to avoid duplicated attribute + if( iAttributes.Exist( aKey ) ) + { + iAttributes.RemoveAttribute( aKey ); + } + CCaEntryAttribute* attr = CCaEntryAttribute::NewLC( aKey ); + attr->SetValueL( aValue ); + iAttributes.AppendL( attr ); + CleanupStack::Pop( attr ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const RCaEntryAttrArray& CCaInnerQuery::GetAttributes() const + { + return iAttributes; + } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/data/20022F82.rss --- a/contentstorage/data/20022F82.rss Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +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: Resource definitions for project castockhandlerplugins - * - */ - -#include - -#include "castrings.hrh" -#include "cahandlerplugin.hrh" - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = 0x20022F82; - interfaces = - { - INTERFACE_INFO - { - interface_uid = HANDLER_IF_UID; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = 0x20022F83; - version_no = 1; - display_name = ""; - default_data = str_datatype_app; - opaque_data = ""; - }, - IMPLEMENTATION_INFO - { - implementation_uid = 0x20022F85; - version_no = 1; - display_name = ""; - default_data = str_datatype_url; - opaque_data = ""; - } - }; - } - }; - } - diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/eabi/caextendedmenuu.def --- a/contentstorage/eabi/caextendedmenuu.def Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/eabi/caextendedmenuu.def Fri Apr 16 15:16:09 2010 +0300 @@ -1,19 +1,3 @@ EXPORTS - _ZN10CCaHandler12SupportsTypeERK7TDesC16 @ 1 NONAME - _ZN10CCaHandler14BaseConstructLEv @ 2 NONAME - _ZN10CCaHandler14HandleCommandLER13CCaInnerEntryRK6TDesC8 @ 3 NONAME - _ZN10CCaHandlerC1Ev @ 4 NONAME - _ZN10CCaHandlerC2Ev @ 5 NONAME - _ZN10CCaHandlerD0Ev @ 6 NONAME - _ZN10CCaHandlerD1Ev @ 7 NONAME - _ZN10CCaHandlerD2Ev @ 8 NONAME - _ZN16CCaHandlerEngine14HandleCommandLER13CCaInnerEntryRK6TDesC8 @ 9 NONAME - _ZN16CCaHandlerEngine4NewLEv @ 10 NONAME - _ZN16CCaHandlerEngine5NewLCEv @ 11 NONAME - _ZN16CCaHandlerEngineD0Ev @ 12 NONAME - _ZN16CCaHandlerEngineD1Ev @ 13 NONAME - _ZN16CCaHandlerEngineD2Ev @ 14 NONAME - _ZN17CaMenuIconUtility11GetItemIconERK13CCaInnerEntry @ 15 NONAME - _ZTI10CCaHandler @ 16 NONAME - _ZTV10CCaHandler @ 17 NONAME + _ZN17CaMenuIconUtility11GetItemIconERK13CCaInnerEntry @ 1 NONAME diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/eabi/camenuu.def --- a/contentstorage/eabi/camenuu.def Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/eabi/camenuu.def Fri Apr 16 15:16:09 2010 +0300 @@ -1,23 +1,24 @@ EXPORTS _Z11RunCaServerv @ 1 NONAME - _ZN15CCaStorageProxy11DbPropertyLERK7TDesC16R6TDes16 @ 2 NONAME - _ZN15CCaStorageProxy11GetEntriesLEPK13CCaInnerQueryR13RPointerArrayI13CCaInnerEntryE @ 3 NONAME - _ZN15CCaStorageProxy14GetEntriesIdsLEPK13CCaInnerQueryR6RArrayIiE @ 4 NONAME - _ZN15CCaStorageProxy14LocalizeEntryLER20CCaLocalizationEntry @ 5 NONAME - _ZN15CCaStorageProxy14SetDBPropertyLERK7TDesC16S2_ @ 6 NONAME - _ZN15CCaStorageProxy17GetLocalizationsLER13RPointerArrayI20CCaLocalizationEntryE @ 7 NONAME - _ZN15CCaStorageProxy4AddLEP13CCaInnerEntryi @ 8 NONAME - _ZN15CCaStorageProxy6TouchLEP13CCaInnerEntry @ 9 NONAME - _ZN15CCaStorageProxy7RemoveLERK6RArrayIiE @ 10 NONAME - _ZN15CCaStorageProxy9OrganizeLERK6RArrayIiE18TCaOperationParams @ 11 NONAME - _ZN16CCaSrvMmcHistory4FindEj @ 12 NONAME - _ZN16CCaSrvMmcHistory5LoadLER3RFsRK7TDesC16 @ 13 NONAME - _ZN16CCaSrvMmcHistory5SaveLER3RFsRK7TDesC16 @ 14 NONAME - _ZN16CCaSrvMmcHistory7InsertLEj @ 15 NONAME - _ZN18CCaInstallNotifier4NewLER18MCaInstallListenerNS_17TNotificationTypeE @ 16 NONAME - _ZNK14CCaSrvEngUtils10GetAppInfoERK13CCaInnerEntryR11TApaAppInfo @ 17 NONAME - _ZNK14CCaSrvEngUtils13GetApaAppInfoE4TUidR11TApaAppInfo @ 18 NONAME - _ZTI15CCaStorageProxy @ 19 NONAME - _ZTV15CCaStorageProxy @ 20 NONAME - _ZN15CCaStorageProxy11CustomSortLERK6RArrayIiEi @ 21 NONAME + _ZN15CCaStorageProxy11CustomSortLERK6RArrayIiEi @ 2 NONAME + _ZN15CCaStorageProxy11DbPropertyLERK7TDesC16R6TDes16 @ 3 NONAME + _ZN15CCaStorageProxy11GetEntriesLEPK13CCaInnerQueryR13RPointerArrayI13CCaInnerEntryE @ 4 NONAME + _ZN15CCaStorageProxy14GetEntriesIdsLEPK13CCaInnerQueryR6RArrayIiE @ 5 NONAME + _ZN15CCaStorageProxy14LocalizeEntryLER20CCaLocalizationEntry @ 6 NONAME + _ZN15CCaStorageProxy14SetDBPropertyLERK7TDesC16S2_ @ 7 NONAME + _ZN15CCaStorageProxy17GetLocalizationsLER13RPointerArrayI20CCaLocalizationEntryE @ 8 NONAME + _ZN15CCaStorageProxy20LoadDataBaseFromRomLEv @ 9 NONAME + _ZN15CCaStorageProxy4AddLEP13CCaInnerEntryi @ 10 NONAME + _ZN15CCaStorageProxy6TouchLEP13CCaInnerEntry @ 11 NONAME + _ZN15CCaStorageProxy7RemoveLERK6RArrayIiE @ 12 NONAME + _ZN15CCaStorageProxy9OrganizeLERK6RArrayIiE18TCaOperationParams @ 13 NONAME + _ZN16CCaSrvMmcHistory4FindEj @ 14 NONAME + _ZN16CCaSrvMmcHistory5LoadLER3RFsRK7TDesC16 @ 15 NONAME + _ZN16CCaSrvMmcHistory5SaveLER3RFsRK7TDesC16 @ 16 NONAME + _ZN16CCaSrvMmcHistory7InsertLEj @ 17 NONAME + _ZN18CCaInstallNotifier4NewLER18MCaInstallListenerNS_17TNotificationTypeE @ 18 NONAME + _ZNK14CCaSrvEngUtils10GetAppInfoERK13CCaInnerEntryR11TApaAppInfo @ 19 NONAME + _ZNK14CCaSrvEngUtils13GetApaAppInfoE4TUidR11TApaAppInfo @ 20 NONAME + _ZTI15CCaStorageProxy @ 21 NONAME + _ZTV15CCaStorageProxy @ 22 NONAME diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/eabi/cautilsu.def --- a/contentstorage/eabi/cautilsu.def Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/eabi/cautilsu.def Fri Apr 16 15:16:09 2010 +0300 @@ -1,7 +1,7 @@ EXPORTS _ZN11RCaIdsArray12InternalizeLER11RReadStream @ 1 NONAME _ZN13CCaInnerEntry12InternalizeLER11RReadStream @ 2 NONAME - _ZN13CCaInnerEntry12SetIconDataLEiiiiRK7TDesC16 @ 3 NONAME + _ZN13CCaInnerEntry12SetIconDataLERK7TDesC16S2_S2_ @ 3 NONAME _ZN13CCaInnerEntry13AddAttributeLERK7TDesC16S2_ @ 4 NONAME _ZN13CCaInnerEntry13FindAttributeERK7TDesC16R6TDes16 @ 5 NONAME _ZN13CCaInnerEntry15SetDescriptionLERK7TDesC16 @ 6 NONAME @@ -19,71 +19,73 @@ _ZN13CCaInnerQuery11SetFlagsOffEj @ 18 NONAME _ZN13CCaInnerQuery11SetParentIdEi @ 19 NONAME _ZN13CCaInnerQuery12InternalizeLER11RReadStream @ 20 NONAME - _ZN13CCaInnerQuery17SetEntryTypeNamesEP16CDesC16ArrayFlat @ 21 NONAME - _ZN13CCaInnerQuery4NewLEv @ 22 NONAME - _ZN13CCaInnerQuery5NewLCEv @ 23 NONAME - _ZN13CCaInnerQuery6SetUidEj @ 24 NONAME - _ZN13CCaInnerQuery7SetIdsLERK6RArrayIiE @ 25 NONAME - _ZN13CCaInnerQuery7SetRoleEi @ 26 NONAME - _ZN13CCaInnerQuery7SetSortENS_14TSortAttributeE @ 27 NONAME - _ZN13CCaInnerQuery8SetCountEj @ 28 NONAME - _ZN15RCaEntriesArray12InternalizeLER11RReadStream @ 29 NONAME - _ZN17CCaEntryAttribute4NewLERK7TDesC16 @ 30 NONAME - _ZN17CCaEntryAttribute5NewLCERK7TDesC16 @ 31 NONAME - _ZN17CCaEntryAttribute9SetValueLERK7TDesC16 @ 32 NONAME - _ZN17RCaEntryAttrArray15RemoveAttributeERK7TDesC16 @ 33 NONAME - _ZN17RCaEntryAttrArray4FindERK7TDesC16R6TDes16 @ 34 NONAME - _ZN17RCaEntryAttrArray5ExistERK7TDesC16 @ 35 NONAME - _ZN20CCaLocalizationEntry12SetStringIdLERK7TDesC16 @ 36 NONAME - _ZN20CCaLocalizationEntry13SetTableNameLERK7TDesC16 @ 37 NONAME - _ZN20CCaLocalizationEntry17SetAttributeNameLERK7TDesC16 @ 38 NONAME - _ZN20CCaLocalizationEntry19SetLocalizedStringLERK7TDesC16 @ 39 NONAME - _ZN20CCaLocalizationEntry4NewLEv @ 40 NONAME - _ZN20CCaLocalizationEntry5NewLCEv @ 41 NONAME - _ZN20CCaLocalizationEntry8SetRowIdEj @ 42 NONAME - _ZN20CCaLocalizationEntry9SetTextIdEj @ 43 NONAME - _ZN22CCaInnerNotifierFilter11SetParentIdEi @ 44 NONAME - _ZN22CCaInnerNotifierFilter12InternalizeLER11RReadStream @ 45 NONAME - _ZN22CCaInnerNotifierFilter12SetEntryRoleE10TEntryRole @ 46 NONAME - _ZN22CCaInnerNotifierFilter12SetTypeNamesEP16CDesC16ArrayFlat @ 47 NONAME - _ZN22CCaInnerNotifierFilter4NewLENS_13TNotifierTypeE @ 48 NONAME - _ZN22CCaInnerNotifierFilter5NewLCENS_13TNotifierTypeE @ 49 NONAME - _ZN22CCaInnerNotifierFilter7SetIdsLERK6RArrayIiE @ 50 NONAME - _ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 51 NONAME - _ZNK11RCaIdsArray12ExternalizeLER12RWriteStream @ 52 NONAME - _ZNK11RCaIdsArray13MarshalDataLCEv @ 53 NONAME - _ZNK13CCaInnerEntry12ExternalizeLER12RWriteStream @ 54 NONAME - _ZNK13CCaInnerEntry13GetAttributesEv @ 55 NONAME - _ZNK13CCaInnerEntry14GetDescriptionEv @ 56 NONAME - _ZNK13CCaInnerEntry16GetEntryTypeNameEv @ 57 NONAME - _ZNK13CCaInnerEntry5GetIdEv @ 58 NONAME - _ZNK13CCaInnerEntry6GetUidEv @ 59 NONAME - _ZNK13CCaInnerEntry7GetIconEv @ 60 NONAME - _ZNK13CCaInnerEntry7GetRoleEv @ 61 NONAME - _ZNK13CCaInnerEntry7GetTextEv @ 62 NONAME - _ZNK13CCaInnerEntry8GetFlagsEv @ 63 NONAME - _ZNK13CCaInnerEntry9GetIconIdEv @ 64 NONAME - _ZNK13CCaInnerQuery10GetFlagsOnEv @ 65 NONAME - _ZNK13CCaInnerQuery11GetFlagsOffEv @ 66 NONAME - _ZNK13CCaInnerQuery11GetParentIdEv @ 67 NONAME - _ZNK13CCaInnerQuery12ExternalizeLER12RWriteStream @ 68 NONAME - _ZNK13CCaInnerQuery17GetEntryTypeNamesEv @ 69 NONAME - _ZNK13CCaInnerQuery6GetIdsEv @ 70 NONAME - _ZNK13CCaInnerQuery6GetUidEv @ 71 NONAME - _ZNK13CCaInnerQuery7GetRoleEv @ 72 NONAME - _ZNK13CCaInnerQuery7GetSortEv @ 73 NONAME - _ZNK13CCaInnerQuery8GetCountEv @ 74 NONAME - _ZNK15RCaEntriesArray12ExternalizeLER12RWriteStream @ 75 NONAME - _ZNK20CCaLocalizationEntry11GetStringIdEv @ 76 NONAME - _ZNK20CCaLocalizationEntry12GetTableNameEv @ 77 NONAME - _ZNK20CCaLocalizationEntry16GetAttributeNameEv @ 78 NONAME - _ZNK20CCaLocalizationEntry18GetLocalizedStringEv @ 79 NONAME - _ZNK20CCaLocalizationEntry8GetRowIdEv @ 80 NONAME - _ZNK20CCaLocalizationEntry9GetTextIdEv @ 81 NONAME - _ZNK22CCaInnerNotifierFilter11GetParentIdEv @ 82 NONAME - _ZNK22CCaInnerNotifierFilter12ExternalizeLER12RWriteStream @ 83 NONAME - _ZNK22CCaInnerNotifierFilter12GetEntryRoleEv @ 84 NONAME - _ZNK22CCaInnerNotifierFilter12GetTypeNamesEv @ 85 NONAME - _ZNK22CCaInnerNotifierFilter15GetNotifierTypeEv @ 86 NONAME - _ZNK22CCaInnerNotifierFilter6GetIdsEv @ 87 NONAME + _ZN13CCaInnerQuery13AddAttributeLERK7TDesC16S2_ @ 21 NONAME + _ZN13CCaInnerQuery17SetEntryTypeNamesEP16CDesC16ArrayFlat @ 22 NONAME + _ZN13CCaInnerQuery4NewLEv @ 23 NONAME + _ZN13CCaInnerQuery5NewLCEv @ 24 NONAME + _ZN13CCaInnerQuery6SetUidEj @ 25 NONAME + _ZN13CCaInnerQuery7SetIdsLERK6RArrayIiE @ 26 NONAME + _ZN13CCaInnerQuery7SetRoleEi @ 27 NONAME + _ZN13CCaInnerQuery7SetSortENS_14TSortAttributeE @ 28 NONAME + _ZN13CCaInnerQuery8SetCountEj @ 29 NONAME + _ZN15RCaEntriesArray12InternalizeLER11RReadStream @ 30 NONAME + _ZN17CCaEntryAttribute4NewLERK7TDesC16 @ 31 NONAME + _ZN17CCaEntryAttribute5NewLCERK7TDesC16 @ 32 NONAME + _ZN17CCaEntryAttribute9SetValueLERK7TDesC16 @ 33 NONAME + _ZN17RCaEntryAttrArray15RemoveAttributeERK7TDesC16 @ 34 NONAME + _ZN17RCaEntryAttrArray4FindERK7TDesC16R6TDes16 @ 35 NONAME + _ZN17RCaEntryAttrArray5ExistERK7TDesC16 @ 36 NONAME + _ZN20CCaLocalizationEntry12SetStringIdLERK7TDesC16 @ 37 NONAME + _ZN20CCaLocalizationEntry13SetTableNameLERK7TDesC16 @ 38 NONAME + _ZN20CCaLocalizationEntry17SetAttributeNameLERK7TDesC16 @ 39 NONAME + _ZN20CCaLocalizationEntry19SetLocalizedStringLERK7TDesC16 @ 40 NONAME + _ZN20CCaLocalizationEntry4NewLEv @ 41 NONAME + _ZN20CCaLocalizationEntry5NewLCEv @ 42 NONAME + _ZN20CCaLocalizationEntry8SetRowIdEj @ 43 NONAME + _ZN20CCaLocalizationEntry9SetTextIdEj @ 44 NONAME + _ZN22CCaInnerNotifierFilter11SetParentIdEi @ 45 NONAME + _ZN22CCaInnerNotifierFilter12InternalizeLER11RReadStream @ 46 NONAME + _ZN22CCaInnerNotifierFilter12SetEntryRoleE10TEntryRole @ 47 NONAME + _ZN22CCaInnerNotifierFilter12SetTypeNamesEP16CDesC16ArrayFlat @ 48 NONAME + _ZN22CCaInnerNotifierFilter4NewLENS_13TNotifierTypeE @ 49 NONAME + _ZN22CCaInnerNotifierFilter5NewLCENS_13TNotifierTypeE @ 50 NONAME + _ZN22CCaInnerNotifierFilter7SetIdsLERK6RArrayIiE @ 51 NONAME + _ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 52 NONAME + _ZNK11RCaIdsArray12ExternalizeLER12RWriteStream @ 53 NONAME + _ZNK11RCaIdsArray13MarshalDataLCEv @ 54 NONAME + _ZNK13CCaInnerEntry12ExternalizeLER12RWriteStream @ 55 NONAME + _ZNK13CCaInnerEntry13GetAttributesEv @ 56 NONAME + _ZNK13CCaInnerEntry14GetDescriptionEv @ 57 NONAME + _ZNK13CCaInnerEntry16GetEntryTypeNameEv @ 58 NONAME + _ZNK13CCaInnerEntry5GetIdEv @ 59 NONAME + _ZNK13CCaInnerEntry6GetUidEv @ 60 NONAME + _ZNK13CCaInnerEntry7GetIconEv @ 61 NONAME + _ZNK13CCaInnerEntry7GetRoleEv @ 62 NONAME + _ZNK13CCaInnerEntry7GetTextEv @ 63 NONAME + _ZNK13CCaInnerEntry8GetFlagsEv @ 64 NONAME + _ZNK13CCaInnerEntry9GetIconIdEv @ 65 NONAME + _ZNK13CCaInnerQuery10GetFlagsOnEv @ 66 NONAME + _ZNK13CCaInnerQuery11GetFlagsOffEv @ 67 NONAME + _ZNK13CCaInnerQuery11GetParentIdEv @ 68 NONAME + _ZNK13CCaInnerQuery12ExternalizeLER12RWriteStream @ 69 NONAME + _ZNK13CCaInnerQuery13GetAttributesEv @ 70 NONAME + _ZNK13CCaInnerQuery17GetEntryTypeNamesEv @ 71 NONAME + _ZNK13CCaInnerQuery6GetIdsEv @ 72 NONAME + _ZNK13CCaInnerQuery6GetUidEv @ 73 NONAME + _ZNK13CCaInnerQuery7GetRoleEv @ 74 NONAME + _ZNK13CCaInnerQuery7GetSortEv @ 75 NONAME + _ZNK13CCaInnerQuery8GetCountEv @ 76 NONAME + _ZNK15RCaEntriesArray12ExternalizeLER12RWriteStream @ 77 NONAME + _ZNK20CCaLocalizationEntry11GetStringIdEv @ 78 NONAME + _ZNK20CCaLocalizationEntry12GetTableNameEv @ 79 NONAME + _ZNK20CCaLocalizationEntry16GetAttributeNameEv @ 80 NONAME + _ZNK20CCaLocalizationEntry18GetLocalizedStringEv @ 81 NONAME + _ZNK20CCaLocalizationEntry8GetRowIdEv @ 82 NONAME + _ZNK20CCaLocalizationEntry9GetTextIdEv @ 83 NONAME + _ZNK22CCaInnerNotifierFilter11GetParentIdEv @ 84 NONAME + _ZNK22CCaInnerNotifierFilter12ExternalizeLER12RWriteStream @ 85 NONAME + _ZNK22CCaInnerNotifierFilter12GetEntryRoleEv @ 86 NONAME + _ZNK22CCaInnerNotifierFilter12GetTypeNamesEv @ 87 NONAME + _ZNK22CCaInnerNotifierFilter15GetNotifierTypeEv @ 88 NONAME + _ZNK22CCaInnerNotifierFilter6GetIdsEv @ 89 NONAME diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/extinc/cahandler.h --- a/contentstorage/extinc/cahandler.h Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +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 C_CAHANDLER_H -#define C_CAHANDLER_H - -#include - -class CCaInnerEntry; - -/** - * ?one_line_short_description - * ?more_complete_description - * - * @code - * ?good_class_usage_example(s) - * @endcode - * - * @lib ?library - * @since S60 ?S60_version *** for example, S60 v3.0 - */ -class CCaHandler: public CBase - { - -public: - - /** - * Destructor. - */ - IMPORT_C virtual ~CCaHandler(); - - /** - * Query support for item type. - * @since S60 v5.0 - * @param aType Type. - * @return ETrue if handler supports this type, EFalse otherwise. - * @capability None. - * @throws None. - * @panic None. - */ - IMPORT_C virtual TBool SupportsType( const TDesC& aType ); - - /** - * Handle command. - * @since S60 v5.0 - * @param aItem Item of supported type. - * @param aCommand Command. - * this status will be completed with the resulting error code. - * @capability None. - * @throws This implementation throws KErrNotSupported. - * @panic None. - */ - IMPORT_C virtual void HandleCommandL( CCaInnerEntry& aEntry, - const TDesC8& aCommand ); - -protected: - - /** - * Constructor. - */ - IMPORT_C CCaHandler(); - - /** - * Base constructor. - */ - IMPORT_C void BaseConstructL(); - -private: - // data - - class TData; - - /** - * Private data. - */ - TData* iData; - - }; - -#endif // C_CAHANDLER_H diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/extinc/cahandlerengine.h --- a/contentstorage/extinc/cahandlerengine.h Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +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 C_CAHANDLERENGINE_H -#define C_CAHANDLERENGINE_H - -#include - -class CCaHandler; -class CCaInnerEntry; - -/** - * ?one_line_short_description - * ?more_complete_description - * - * @code - * ?good_class_usage_example(s) - * @endcode - * - * @lib ?library - * @since S60 ?S60_version *** for example, S60 v3.0 - */ -NONSHARABLE_CLASS( CCaHandlerEngine ): public CBase - { - -public: - IMPORT_C static CCaHandlerEngine* NewL(); - IMPORT_C static CCaHandlerEngine* NewLC(); - - /** - * Destructor. - */ - IMPORT_C virtual ~CCaHandlerEngine(); - - /** - * ?description - * - * @since S60 ?S60_version - * @param ?arg1 ?description - * @param ?arg2 ?description - * @return ?description - */ - IMPORT_C void HandleCommandL( CCaInnerEntry& aEntry, - const TDesC8& aCommand ); - -private: - - CCaHandlerEngine(); - - void ConstructL(); - - /** - * Find loaded handler by type. - * @param aType Type. - * @return Loaded handler or NULL no handler is loaded for that type. - */ - CCaHandler* FindHandler( const TDesC& aType ); - - /** - * Load handler for given type. - * @param aType Type. - * @return Loaded handler or NULL no handler is found for that type. - */ - CCaHandler* LoadHandlerL( const TDesC& aType ); - -private: - // data - - /** - * Array of Handlers. - * Contents owned. - */ - RPointerArray iHandlers; - - }; - -#endif // C_CAHANDLERENGINE_H diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/extinc/cahandlerplugin.h --- a/contentstorage/extinc/cahandlerplugin.h Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +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 C_CAHANDLERPLUGIN_H -#define C_CAHANDLERPLUGIN_H - -#include -#include - -#include "cahandler.h" - -/** - * ?one_line_short_description - * ?more_complete_description - * - * @code - * ?good_class_usage_example(s) - * @endcode - * - * @lib ?library - * @since S60 ?S60_version *** for example, S60 v3.0 - */ -class CCaHandlerPlugin: public CCaHandler - { - -public: - - /** - * Two-phased constructor. - * @param aImplementationUid implementation uid - * @return pointer to a newly created instance of CCaHandlerPlugin. - */ - inline static CCaHandlerPlugin* NewL( TUid aImplementationUid ); - - /** - * Constructor. - */ - inline CCaHandlerPlugin(); - - /** - * Destructor. - */ - inline virtual ~CCaHandlerPlugin(); - -private: - - /** - * Destructor ID key. - */ - TUid iDtor_ID_Key; - - }; - -#include "cahandlerplugin.inl" - -#endif // C_CAHANDLERPLUGIN_H diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/extinc/cahandlerplugin.hrh --- a/contentstorage/extinc/cahandlerplugin.hrh Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +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 CAHANDLERPLUGIN_HRH -#define CAHANDLERPLUGIN_HRH - -/// Definition of the CA Handler ECom plugin interface. -#define HANDLER_IF_UID 0x20022F93 - -#endif // CAHANDLERPLUGIN_HRH diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/extinc/cahandlerplugin.inl --- a/contentstorage/extinc/cahandlerplugin.inl Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +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 - * - */ - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -inline CCaHandlerPlugin* CCaHandlerPlugin::NewL( TUid aImplementationUid ) - { - TAny* ptr = REComSession::CreateImplementationL( aImplementationUid, - _FOFF( CCaHandlerPlugin, iDtor_ID_Key ) ); - return reinterpret_cast ( ptr ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -inline CCaHandlerPlugin::CCaHandlerPlugin() - { - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -inline CCaHandlerPlugin::~CCaHandlerPlugin() - { - REComSession::DestroyedImplementation( iDtor_ID_Key ); - } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/extsrc/cahandler.cpp --- a/contentstorage/extsrc/cahandler.cpp Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +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 "cahandler.h" - -// ======== MEMBER FUNCTIONS ======== - -NONSHARABLE_CLASS( CCaHandler::TData ) - { - // Future-proofing only. - }; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -EXPORT_C CCaHandler::~CCaHandler() - { - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -EXPORT_C CCaHandler::CCaHandler() - { - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -EXPORT_C void CCaHandler::BaseConstructL() - { - // Future-proofing only. - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -EXPORT_C TBool CCaHandler::SupportsType( const TDesC& /*aType*/) - { - return EFalse; - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -EXPORT_C void CCaHandler::HandleCommandL( CCaInnerEntry& /*aEntry*/, - const TDesC8& /*aCommand*/) - { - User::Leave( KErrNotSupported ); - } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/extsrc/cahandlerengine.cpp --- a/contentstorage/extsrc/cahandlerengine.cpp Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +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 "cahandlerengine.h" -#include "cahandler.h" -#include "cahandlerplugin.h" -#include "cahandlerplugin.hrh" -#include "cadef.h" -#include "cainnerentry.h" - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Cleanupstack support method, calls RImplInfoPtrArray::ResetAndDestroy() -// of the passed argument (array). -// --------------------------------------------------------------------------- -// -LOCAL_C void ResetAndDestroyArray( TAny* aArray ) - { - ( (RImplInfoPtrArray* ) aArray )->ResetAndDestroy(); - } - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -EXPORT_C CCaHandlerEngine::~CCaHandlerEngine() - { - iHandlers.ResetAndDestroy(); - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -EXPORT_C CCaHandlerEngine* CCaHandlerEngine::NewL() - { - CCaHandlerEngine* self = NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -EXPORT_C CCaHandlerEngine* CCaHandlerEngine::NewLC() - { - CCaHandlerEngine* self = new ( ELeave ) CCaHandlerEngine(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -void CCaHandlerEngine::ConstructL() - { - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -CCaHandlerEngine::CCaHandlerEngine() - { - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -EXPORT_C void CCaHandlerEngine::HandleCommandL( CCaInnerEntry& aEntry, - const TDesC8& aCommand ) - { - // Currently, we load handlers on demand and never unload them. - // As there aren't many types of items, this seems appropriate. - CCaHandler* handler = FindHandler( aEntry.GetEntryTypeName() ); - if( !handler ) - { - //TODO: need to change this - if( aEntry.GetEntryTypeName() == KCaTypeApp() - || aEntry.GetEntryTypeName() == KCaTypeWidget() ) - { - handler = LoadHandlerL( KCaTypeApp() ); - } - else - { - handler = LoadHandlerL( aEntry.GetEntryTypeName() ); - } - } - if( handler ) - { - handler->HandleCommandL( aEntry, aCommand ); - } - else - { - User::Leave( KErrNotFound ); - } - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -CCaHandler* CCaHandlerEngine::FindHandler( const TDesC& aType ) - { - for( TInt i = 0; i < iHandlers.Count(); i++ ) - { - CCaHandler* handler = iHandlers[i]; - if( handler->SupportsType( aType ) ) - { - return handler; - } - } - return NULL; - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// -CCaHandler* CCaHandlerEngine::LoadHandlerL( const TDesC& aType ) - { - CCaHandlerPlugin* handler = NULL; - TBuf8 type; - type.Copy( aType ); - TEComResolverParams resolverParams; - resolverParams.SetDataType( type ); - RImplInfoPtrArray implInfoArray; - CleanupStack::PushL( - TCleanupItem( ResetAndDestroyArray, &implInfoArray ) ); - REComSession::ListImplementationsL( TUid::Uid( HANDLER_IF_UID ), - resolverParams, implInfoArray ); - - __ASSERT_DEBUG( implInfoArray.Count() <= 1, User::Invariant() ); - - if( implInfoArray.Count() != 0 ) - { - TUid implUid = implInfoArray[0]->ImplementationUid(); - handler = CCaHandlerPlugin::NewL( implUid ); - CleanupStack::PushL( handler ); - // Here we check if this is the handler we need. Currently we only do - // a sanity check for the handler (it should support the registered - // types!), but later this can be extended with better support query. - // E.g. support for type AND command, etc. - if( handler->SupportsType( aType ) ) - { - iHandlers.AppendL( handler ); - CleanupStack::Pop( handler ); - } - else - { - CleanupStack::PopAndDestroy( handler ); - handler = NULL; - } - } - - CleanupStack::PopAndDestroy( &implInfoArray ); - return handler; - } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/extsrc/caiconutility.cpp --- a/contentstorage/extsrc/caiconutility.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/extsrc/caiconutility.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -28,35 +28,9 @@ #include "camenuiconutility.h" #include "caarraycleanup.inl" #include "casathandler.h" -// Constants -_LIT( KMifIconPath, "\\resource\\apps\\" ); -const TUint32 KMifIconPathLenght = 18; // ================= LOCAL FUNCTIONS ======================== - -// --------------------------------------------------------- -// ParseIconFilePathL -// --------------------------------------------------------- -// - -LOCAL_C void ParseIconFilePathL( const TDesC& aIconFilePath, - RBuf& aIconFilePathBuf ) - { - TParsePtrC fileParsePtrC( aIconFilePath ); - if( !fileParsePtrC.PathPresent() ) - { - aIconFilePathBuf.CreateL( KMifIconPathLenght - + aIconFilePath.Length() ); - aIconFilePathBuf.Append( KMifIconPath ); - } - else - { - aIconFilePathBuf.CreateL( aIconFilePath.Length() ); - } - aIconFilePathBuf.Append( aIconFilePath ); - } - // --------------------------------------------------------- // LoadSkinL // --------------------------------------------------------- @@ -119,32 +93,6 @@ return icon; } -// --------------------------------------------------------- -// GetIconL -// --------------------------------------------------------- -// -LOCAL_C CAknIcon* GetIconL( TFileName aFilename, int aBitmapId, int aMaskId ) - { - CAknIcon* icon = NULL; - if( aFilename.Length() > 0 && aBitmapId >= 0 && aMaskId >= 0 ) - { - CFbsBitmap* bitmap( 0 ); - CFbsBitmap* mask( 0 ); - - RBuf pathBuf; - pathBuf.CleanupClosePushL(); - ParseIconFilePathL( aFilename, pathBuf ); - - AknIconUtils::CreateIconLC( bitmap, mask, pathBuf, aBitmapId, - aMaskId ); - icon = CAknIcon::NewL(); - icon->SetBitmap( bitmap ); - icon->SetMask( mask ); - CleanupStack::Pop( 2 ); - CleanupStack::PopAndDestroy( &pathBuf ); - } - return icon; - } // --------------------------------------------------------- // GetDefaultSkinL @@ -191,6 +139,20 @@ icon = GetSkinL( KAknsIIDQgnIndiBrowserTbFeeds.iMajor, KAknsIIDQgnIndiBrowserTbFeeds.iMinor ); } + else if( aItem.GetEntryTypeName().Compare( KCaTypeTemplatedApp ) == KErrNone ) + { + TInt uid; + TLex lex (aItem.GetIcon().iApplicationId); + lex.Val(uid); + TUid appUid( TUid::Uid( uid ) ); + icon = GetAppSkinL( appUid ); + if( !icon ) + { + icon = GetSkinL( KAknsIIDQgnMenuUnknownLst.iMajor, + KAknsIIDQgnMenuUnknownLst.iMinor ); + } + } + return icon; } @@ -205,20 +167,6 @@ { CAknIcon* icon = NULL; CCaInnerEntry::TIconAttributes iconAttributes( aEntry.GetIcon() ); - // Try to get the skin of the item - TRAP_IGNORE(icon = GetSkinL( iconAttributes.iSkinMajorId, - iconAttributes.iSkinMinorId ) ); - if( !icon ) - { - // Try to get the icon of the item (skin failed) - TRAP_IGNORE( icon = GetIconL( iconAttributes.iFileName, - iconAttributes.iBitmapId, - iconAttributes.iMaskId ) ); - if( !icon ) - { - // Return a default (skin and icon failed) - TRAP_IGNORE( icon = GetDefaultSkinL( aEntry ) ); - } - } + TRAP_IGNORE( icon = GetDefaultSkinL( aEntry ) ); return icon; } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/group/caextendedmenu.mmp --- a/contentstorage/group/caextendedmenu.mmp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/group/caextendedmenu.mmp Fri Apr 16 15:16:09 2010 +0300 @@ -25,8 +25,6 @@ VENDORID VID_DEFAULT SOURCEPATH ../extsrc -SOURCE cahandler.cpp -SOURCE cahandlerengine.cpp SOURCE caiconutility.cpp USERINCLUDE ../inc diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/group/camenu.mmp --- a/contentstorage/group/camenu.mmp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/group/camenu.mmp Fri Apr 16 15:16:09 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: 19.1.2 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: 19.1.3 % << Don't touch! Updated by Synergy at check-out. * */ diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/group/castockhandlerplugins.mmp --- a/contentstorage/group/castockhandlerplugins.mmp Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file for project castockhandlerplugins -* -*/ - - -// To get the MW_LAYER_SYSTEMINCLUDE-definition -#include - -TARGET castockhandlerplugins.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0x20022F82 - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../handlersrc - -SOURCE castockhandlersproxy.cpp -SOURCE caapphandlerplugin.cpp -SOURCE cauninstalloperation.cpp -SOURCE caurlhandlerplugin.cpp - -USERINCLUDE ../inc -USERINCLUDE ../handlerinc -USERINCLUDE ../cautils/inc -USERINCLUDE ../extinc - -MW_LAYER_SYSTEMINCLUDE - -//TODO: check which ones are really needed -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY swinstcli.lib -LIBRARY camenu.lib -LIBRARY cautils.lib -LIBRARY apgrfx.lib -LIBRARY ws32.lib - -LIBRARY apparc.lib -LIBRARY sisregistryclient.lib -LIBRARY eikcore.lib -LIBRARY cone.lib -LIBRARY efsrv.lib -LIBRARY avkon.lib -LIBRARY caextendedmenu.lib - -SOURCEPATH ../data -START RESOURCE 20022F82.rss -LANG sc -TARGET castockhandlerplugins.rsc -END // RESOURCE - diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/group/group.pro --- a/contentstorage/group/group.pro Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/group/group.pro Fri Apr 16 15:16:09 2010 +0300 @@ -19,9 +19,9 @@ #Exporting ibys BLD_INF_RULES.prj_exports += \ "$${LITERAL_HASH}ifndef CONTENT_ARSENAL_STORAGE_UT" \ - "../castorage/data/castoragedb z:/private/20022F90/castoragedb" \ + "../castorage/data/castorage.db z:/private/20022F90/castorage.db" \ "$${LITERAL_HASH}else " \ - "../castorage/data/castoragedb z:/castoragedb" \ + "../castorage/data/castorage.db z:/castorage.db" \ "$${LITERAL_HASH}endif" \ "../data/backup_registration.xml z:/private/20022F90/backup_registration.xml" @@ -32,7 +32,6 @@ "camenu.mmp" \ "camenusrv.mmp" \ "caextendedmenu.mmp" \ - "castockhandlerplugins.mmp" \ "../casrv/caappscanner/group/caappscanner.mmp" \ "../casrv/casatmonitor/group/casatmonitor.mmp" \ "../casrv/cawidgetscanner/group/cawidgetscanner.mmp" \ diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/handlerinc/caapphandlerplugin.h --- a/contentstorage/handlerinc/caapphandlerplugin.h Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +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 C_CAAPPHANDLERPLUGIN_H -#define C_CAAPPHANDLERPLUGIN_H - -#include - -#include "cahandlerplugin.h" - -class CEikonEnv; -class CCaUninstallOperation; - -/** - * ?one_line_short_description - * ?more_complete_description - * - * @code - * ?good_class_usage_example(s) - * @endcode - * - * @lib ?library - * @since S60 ?S60_version *** for example, S60 v3.0 - */ -NONSHARABLE_CLASS( CCaAppHandlerPlugin ): public CCaHandlerPlugin - { - -public: - - static CCaAppHandlerPlugin* NewL(); - - /** - * Destructor. - */ - virtual ~CCaAppHandlerPlugin(); - -protected: - - CCaAppHandlerPlugin(); - - void ConstructL(); - -public: - - // from CCaHandlerPlugin - - /** - * Query support for item type. - * @param aType Type. - * @return ETrue if handler supports this type, EFalse otherwise. - */ - TBool SupportsType( const TDesC& aType ); - - /** - * Handle command. - * @param aItem Item of supported type. - * @param aCommand Command. - * @param aParams. Command parameters. - * @param aStatus Observer request status. When the operation completes, - * this status will be completed with the resulting error code. - * @return Asynchronous operation. Owned by the caller. - */ - void HandleCommandL( CCaInnerEntry& aEntry, const TDesC8& aCommand ); - -private: - - void LaunchApplicationL( const TUid aUid, const TDesC8 &aParam, - TInt aViewId ); - void CloseApplicationL( CCaInnerEntry& aEntry ); - -private: - // data - - CEikonEnv* iEikEnv; - CCaUninstallOperation* iUninstallOperation; - }; - -#endif // C_CAAPPHANDLERPLUGIN_H diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/handlerinc/cauninstalloperation.h --- a/contentstorage/handlerinc/cauninstalloperation.h Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +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 C_CAUNINSTALLOPERATION_H -#define C_CAUNINSTALLOPERATION_H - -#include -#include - -/** - * Uninstall CMenuOperation - * Encapsulates the functionality of uninstalling an application. - */ -NONSHARABLE_CLASS( CCaUninstallOperation ): public CActive - { - -public: - // construction - - virtual ~CCaUninstallOperation(); - - static CCaUninstallOperation* NewL( CCaInnerEntry &aEntry, - TInt aPriority = CActive::EPriorityStandard ); - -private: - // construction - - CCaUninstallOperation( CCaInnerEntry &aEntry, TInt aPriority ); - - void ConstructL( CCaInnerEntry &aEntry ); - - void AppInfoL( const TUid& aAppUid, TPtrC8& aMimeType, - TUid& aPackageUid ); - - TBool GetInstallPkgUidL( const TDesC& aAppFullName, TUid& aPackageUid ); - -private: - // from CActive - - void RunL(); - void DoCancel(); - TInt RunError( TInt aError ); - -private: - - CCaInnerEntry& iEntry; - SwiUI::RSWInstLauncher iUninstaller; - TInt iId; - }; - -#endif // C_CAUNINSTALLOPERATION_H diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/handlerinc/caurlhandlerplugin.h --- a/contentstorage/handlerinc/caurlhandlerplugin.h Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +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 __CCAURLHANDLERPLUGIN_H__ -#define __CCAURLHANDLERPLUGIN_H__ - -#include "cahandlerplugin.h" - -#include - -// Constants -const TUid KUidBrowser = - { - 0x10008D39 - }; -_LIT( KBrowserPrefix, "4 " ); - -/** - * Handler for entries with typenme "url". - */ -NONSHARABLE_CLASS( CCaUrlHandlerPlugin ): public CCaHandlerPlugin - { - -public: - // construction - - /** - * Destructor. - */ - virtual ~CCaUrlHandlerPlugin(); - - /** - * Two-phased constructor. Leaves on failure. - * @return The constructed object. - */ - static CCaUrlHandlerPlugin* NewL(); - -protected: - // construction - - /** - * Constructor. - * @param aMenu Menu. - */ - CCaUrlHandlerPlugin(); - - /** - * Second-phase constructor. - */ - void ConstructL(); - -public: - - /** - * Query support for item type. - * @param aType Type. - * @return ETrue if handler supports this type, EFalse otherwise. - */ - TBool SupportsType( const TDesC& aType ); - - /** - * Handle command. - * @param aEntry The url entry to be processed. - * @param aCommand Command. - */ - void HandleCommandL( CCaInnerEntry& aEntry, const TDesC8& aCommand ); - -private: - // internal - - /** - * Launches the url. - * @param aUrl The url to be launched. - */ - void LaunchUrlL( const TDesC& aUrl ); - - }; - -#endif // __CCAURLHANDLERPLUGIN_H__ diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/handlersrc/caapphandlerplugin.cpp --- a/contentstorage/handlersrc/caapphandlerplugin.cpp Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,233 +0,0 @@ -/* - * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: ?Description - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "caapphandlerplugin.h" -#include "cainnerentry.h" -#include "cauninstalloperation.h" - -#include "cautils.h" -#include "cadef.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CCaAppHandlerPlugin::~CCaAppHandlerPlugin() - { - delete iUninstallOperation; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CCaAppHandlerPlugin* CCaAppHandlerPlugin::NewL() - { - CCaAppHandlerPlugin* handler = new ( ELeave ) CCaAppHandlerPlugin(); - CleanupStack::PushL( handler ); - handler->ConstructL(); - CleanupStack::Pop( handler ); - return handler; - } - -// --------------------------------------------------------- -// CCaAppHandlerPlugin::CCaAppHandlerPlugin -// --------------------------------------------------------- -// -CCaAppHandlerPlugin::CCaAppHandlerPlugin() - { - iEikEnv = CEikonEnv::Static(); - iUninstallOperation = NULL; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaAppHandlerPlugin::ConstructL() - { - BaseConstructL(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CCaAppHandlerPlugin::SupportsType( const TDesC& aType ) - { - if( !aType.Compare( KCaTypeApp() ) || !aType.Compare( KCaTypeWidget() ) ) - { - return ETrue; - } - return EFalse; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaAppHandlerPlugin::HandleCommandL( CCaInnerEntry& aEntry, - const TDesC8& aCommand ) - { - if( aCommand == KCaCmdOpen() && aEntry.GetEntryTypeName() - == KCaTypeApp() ) - { - TInt viewId( -1 ); - TBuf viewIdValue; - if( aEntry.FindAttribute( KCaAttrView(), viewIdValue ) ) - { - if( MenuUtils::GetTUint( viewIdValue, (TUint& ) viewId ) - != KErrNone ) - { - User::Leave( KErrCorrupt ); - } - } - LaunchApplicationL( TUid::Uid( aEntry.GetUid() ), KNullDesC8(), - viewId ); - } - else if( aCommand == KCaCmdClose() && aEntry.GetEntryTypeName() - == KCaTypeApp() ) - { - CloseApplicationL( aEntry ); - } - else if( aCommand == KCaCmdRemove() - && ( aEntry.GetEntryTypeName() == KCaTypeApp() - || aEntry.GetEntryTypeName() == KCaTypeWidget() ) ) - { - if( iUninstallOperation && iUninstallOperation->IsActive() ) - { - User::Leave( KErrInUse ); - } - delete iUninstallOperation; - iUninstallOperation = NULL; - iUninstallOperation = CCaUninstallOperation::NewL( aEntry ); - } - else - { - User::Leave( KErrNotSupported ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaAppHandlerPlugin::LaunchApplicationL( const TUid aUid, - const TDesC8 &aParam, TInt aViewId ) - { - if( aViewId > 0 && iEikEnv ) - { - TUid viewId = TUid::Uid( aViewId ); - TVwsViewId view( aUid, viewId ); - iEikEnv->EikAppUi()->ActivateViewL( view ); - } - else - { - RWsSession wsSession; - User::LeaveIfError( wsSession.Connect() ); - CleanupClosePushL ( wsSession ); - - CAknTaskList* taskList = CAknTaskList::NewL( wsSession ); - TApaTask task = taskList->FindRootApp( aUid ); - delete taskList; - - if( task.Exists() ) - { - task.BringToForeground(); - } - else - { - TApaAppInfo appInfo; - TApaAppCapabilityBuf capabilityBuf; - RApaLsSession appArcSession; - User::LeaveIfError( appArcSession.Connect() ); - CleanupClosePushL ( appArcSession ); - - User::LeaveIfError( appArcSession.GetAppInfo( appInfo, aUid ) ); - User::LeaveIfError( appArcSession.GetAppCapability( - capabilityBuf, aUid ) ); - - TApaAppCapability& caps = capabilityBuf(); - TFileName appName = appInfo.iFullName; - CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); - cmdLine->SetExecutableNameL( appName ); - - if( caps.iLaunchInBackground ) - { - cmdLine->SetCommandL( EApaCommandBackground ); - } - else - { - cmdLine->SetCommandL( EApaCommandRun ); - } - - cmdLine->SetTailEndL( aParam ); - - User::LeaveIfError( appArcSession.StartApp( *cmdLine ) ); - - CleanupStack::PopAndDestroy( cmdLine ); - CleanupStack::PopAndDestroy( &appArcSession ); - } - CleanupStack::PopAndDestroy( &wsSession ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CCaAppHandlerPlugin::CloseApplicationL( CCaInnerEntry& aEntry ) - { - RWsSession wsSession; - User::LeaveIfError( wsSession.Connect() ); - CleanupClosePushL ( wsSession ); - - if( ( aEntry.GetFlags() & ERunning ) && - ( !( aEntry.GetFlags() & ESystem ) ) ) - { - RBuf value; - CleanupClosePushL( value ); - value.CreateL( KCaMaxAttrValueLen ); - if( aEntry.FindAttribute( KCaAttrWindowGroupId, value )) - { - TInt wgId( KErrNotFound ); - TLex16 parser(value); - if ( KErrNone == parser.Val( wgId ) && wgId > 0 ) - { - TWsEvent event; - event.SetTimeNow(); - event.SetType( KAknShutOrHideApp ); - wsSession.SendEventToWindowGroup( wgId, event ); - } - } - CleanupStack::PopAndDestroy( &value ); - } - - CleanupStack::PopAndDestroy( &wsSession ); - } - diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/handlersrc/castockhandlersproxy.cpp --- a/contentstorage/handlersrc/castockhandlersproxy.cpp Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: ?Description - * - */ - -#include -#include -#include "caapphandlerplugin.h" -#include "caurlhandlerplugin.h" - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -LOCAL_C CCaHandlerPlugin* AppHandlerNewL() - { - return CCaAppHandlerPlugin::NewL(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -LOCAL_C CCaHandlerPlugin* UrlHandlerNewL() - { - return CCaUrlHandlerPlugin::NewL(); - } - -// ======== GLOBAL FUNCTIONS ======== - -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( 0x20022F83, AppHandlerNewL ), - IMPLEMENTATION_PROXY_ENTRY( 0x20022F85, UrlHandlerNewL ), - }; - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( - TInt& aTableCount ) - { - aTableCount = sizeof( ImplementationTable ) - / sizeof(TImplementationProxy); - return ImplementationTable; - } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/handlersrc/cauninstalloperation.cpp --- a/contentstorage/handlersrc/cauninstalloperation.cpp Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: ?Description - * - */ - -#include -#include -#include -#include "cautils.h" -#include "cadef.h" -#include "cainnerentry.h" -#include "cauninstalloperation.h" -_LIT8( KAppMimeType, "x-epoc/x-sisx-app" ); - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CCaUninstallOperation::~CCaUninstallOperation -// --------------------------------------------------------------------------- -// -CCaUninstallOperation::~CCaUninstallOperation() - { - Cancel(); - iUninstaller.Close(); - } - -// --------------------------------------------------------------------------- -// CCaUninstallOperation::NewL -// --------------------------------------------------------------------------- -// -CCaUninstallOperation* CCaUninstallOperation::NewL( CCaInnerEntry &aEntry, - TInt aPriority ) - { - CCaUninstallOperation* self; - - self = new ( ELeave ) CCaUninstallOperation( aEntry, aPriority ); - CleanupStack::PushL( self ); - self->ConstructL( aEntry ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CCaUninstallOperation::CCaUninstallOperation -// --------------------------------------------------------------------------- -// -CCaUninstallOperation::CCaUninstallOperation( CCaInnerEntry& aEntry, - TInt aPriority ) : - CActive( aPriority ), iEntry( aEntry ), iUninstaller(), iId( 0 ) - { - CActiveScheduler::Add( this ); - } - -// --------------------------------------------------------------------------- -// CCaUninstallOperation::ConstructL -// --------------------------------------------------------------------------- -// -void CCaUninstallOperation::ConstructL( CCaInnerEntry& aEntry ) - { - TBuf uidAttr; - TUint uid = aEntry.GetUid(); - - TUid packageUid = KNullUid; - TPtrC8 mimeType; - - if( !( aEntry.GetFlags() & ERemovable ) ) - { - User::Leave( KErrAccessDenied ); - } - - User::LeaveIfError( iUninstaller.Connect() ); - iId = aEntry.GetId(); - if( aEntry.GetEntryTypeName() == KCaTypeWidget() ) - { - TBuf uidDesc; - aEntry.FindAttribute( KCaPackageUid, uidDesc ); - TLex uidLex(uidDesc); - TUint32 uidValue; - User::LeaveIfError( uidLex.Val( uidValue, EHex )); - - packageUid.iUid = static_cast(uidValue); - mimeType.Set( KAppMimeType ); - } - else - { - AppInfoL( TUid::Uid( uid ), mimeType, packageUid ); - } - - // Commence the uninstallations - iUninstaller.Uninstall( iStatus, packageUid, mimeType ); - SetActive(); - } - -// --------------------------------------------------------------------------- -// CCaUninstallOperation::AppInfo -// --------------------------------------------------------------------------- -// -void CCaUninstallOperation::AppInfoL( const TUid& aAppUid, - TPtrC8& aMimeType, TUid& aPackageUid ) - { - RApaLsSession apaLsSession; - - User::LeaveIfError( apaLsSession.Connect() ); - CleanupClosePushL( apaLsSession ); - User::LeaveIfError( apaLsSession.GetAllApps() ); - - TApaAppInfo appInfo; - User::LeaveIfError( apaLsSession.GetAppInfo( appInfo, aAppUid ) ); - if( !GetInstallPkgUidL( appInfo.iFullName, aPackageUid ) ) - { - aPackageUid = aAppUid; - } - aMimeType.Set( KAppMimeType ); - - CleanupStack::PopAndDestroy( &apaLsSession ); - } - -// --------------------------------------------------------------------------- -// CCaUninstallOperation::GetInstallPkgUidL -// --------------------------------------------------------------------------- -// -TBool CCaUninstallOperation::GetInstallPkgUidL( const TDesC& aAppFullName, - TUid& aPackageUid ) - { - // Search for the full name of the application amongst every file name in - // every installed packages. - TBool found = EFalse; - Swi::RSisRegistrySession iSisRegSession; - - // Get the array of ids of every installed packages - if( KErrNone != iSisRegSession.Connect() ) - { - return found; - } - CleanupClosePushL( iSisRegSession ); - - RArray packageIds; - CleanupClosePushL( packageIds ); - - iSisRegSession.InstalledUidsL( packageIds ); - - RPointerArray packageFiles; - CleanupClosePushL( packageFiles ); - - for( TInt i = 0; i < packageIds.Count() && !found; ++i ) - { - const TUid packageId = packageIds[i]; - Swi::RSisRegistryEntry packageEntry; - - // Get the array of file names in the current install package and look - // if there is one suggesting that the application was installed from - // the package. - if( KErrNone == packageEntry.Open( iSisRegSession, packageId ) ) - { - CleanupClosePushL( packageEntry ); - packageEntry.FilesL( packageFiles ); - for( TInt pf = 0; pf < packageFiles.Count() && !found; ++pf ) - { - if( packageFiles[pf]->FindC( aAppFullName ) == 0 ) - { - aPackageUid = packageId; - found = ETrue; - } - } - packageFiles.ResetAndDestroy(); - CleanupStack::PopAndDestroy( &packageEntry ); - } - } - - CleanupStack::PopAndDestroy( &packageFiles ); - CleanupStack::PopAndDestroy( &packageIds ); - CleanupStack::PopAndDestroy( &iSisRegSession ); - - return found; - } - -// --------------------------------------------------------------------------- -// CCaUninstallOperation::RunL -// --------------------------------------------------------------------------- -// -void CCaUninstallOperation::RunL() - { - } - -// --------------------------------------------------------------------------- -// CCaUninstallOperation::DoCancel -// --------------------------------------------------------------------------- -// -void CCaUninstallOperation::DoCancel() - { - iUninstaller.CancelAsyncRequest( SwiUI::ERequestUninstall ); - } - -// --------------------------------------------------------------------------- -// CCaUninstallOperation::RunError -// --------------------------------------------------------------------------- -// -TInt CCaUninstallOperation::RunError( TInt /* aError */) - { - return KErrNone; - } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/handlersrc/caurlhandlerplugin.cpp --- a/contentstorage/handlersrc/caurlhandlerplugin.cpp Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: ?Description - * - */ - -#include -#include -#include -#include - -#include "caurlhandlerplugin.h" -#include "cadef.h" -#include "cainnerentry.h" - -// ================= MEMBER FUNCTIONS ======================= - -// -------------------------------------------------------------------------- -// CCaUrlHandlerPlugin::~CCaUrlHandlerPlugin -// -------------------------------------------------------------------------- -// -CCaUrlHandlerPlugin::~CCaUrlHandlerPlugin() - { - } - -// -------------------------------------------------------------------------- -// CCaUrlHandlerPlugin::NewL -// -------------------------------------------------------------------------- -// -CCaUrlHandlerPlugin* CCaUrlHandlerPlugin::NewL() - { - CCaUrlHandlerPlugin* handler = new ( ELeave ) CCaUrlHandlerPlugin(); - CleanupStack::PushL( handler ); - handler->ConstructL(); - CleanupStack::Pop( handler ); - return handler; - } - -// -------------------------------------------------------------------------- -// CCaUrlHandlerPlugin::CCaUrlHandlerPlugin -// -------------------------------------------------------------------------- -// -CCaUrlHandlerPlugin::CCaUrlHandlerPlugin() - { - } - -// -------------------------------------------------------------------------- -// CCaUrlHandlerPlugin::ConstructL -// -------------------------------------------------------------------------- -// -void CCaUrlHandlerPlugin::ConstructL() - { - BaseConstructL(); - } - -// -------------------------------------------------------------------------- -// CCaUrlHandlerPlugin::SupportsType -// -------------------------------------------------------------------------- -// -TBool CCaUrlHandlerPlugin::SupportsType( const TDesC& aType ) - { - if( !aType.Compare( KCaTypeUrl() ) ) - { - return ETrue; - } - - return EFalse; - } - -// -------------------------------------------------------------------------- -// CCaUrlHandlerPlugin::HandleCommandL -// -------------------------------------------------------------------------- -// -void CCaUrlHandlerPlugin::HandleCommandL( CCaInnerEntry& aEntry, - const TDesC8& aCommand ) - { - - if( !aCommand.Compare( KCaCmdOpen() ) ) - { - const RCaEntryAttrArray& attributes = aEntry.GetAttributes(); - TInt attributesArrayCount = attributes.Count(); - for( int i = 0; i < attributesArrayCount; ++i ) - { - const CCaEntryAttribute * const attribute = attributes[i]; - if( attribute->Name().Compare( KCaAttrUrl ) == 0 ) - { - LaunchUrlL( attribute->Value() ); - break; - } - } - } - else - { - User::Leave( KErrNotSupported ); - } - } - -// -------------------------------------------------------------------------- -// CCaUrlHandlerPlugin::LaunchUrlL -// -------------------------------------------------------------------------- -// - -void CCaUrlHandlerPlugin::LaunchUrlL( const TDesC& aUrl ) - { - // Launches browser stand-alone. - // Browser is launched with a parameter 4 ("4 http://...."), which - // Start/Continue the browser specifying a URL. - // Other available parameters are described in the Browser API Specification - // Document. - TInt length = aUrl.Length() + KBrowserPrefix.iTypeLength; - - RWsSession wsSession; - User::LeaveIfError( wsSession.Connect() ); - CleanupClosePushL ( wsSession ); - - CAknTaskList* taskList = CAknTaskList::NewL( wsSession ); - TApaTask task = taskList->FindRootApp( KUidBrowser ); - delete taskList; - - if( task.Exists() ) - { - HBufC8* param8 = HBufC8::NewLC( length ); - TPtr8 ptr8 = param8->Des(); - ptr8.Append( KBrowserPrefix ); - ptr8.Append( aUrl ); - - // Sends message to existing Browser task. - task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used - CleanupStack::PopAndDestroy( param8 ); - } - else - { - HBufC* buf = HBufC::NewLC( length ); - TPtr ptr = buf->Des(); - ptr.Append( KBrowserPrefix ); - ptr.Append( aUrl ); - - RApaLsSession appArcSession; - User::LeaveIfError( appArcSession.Connect() ); - CleanupClosePushL ( appArcSession ); - TThreadId id; - appArcSession.StartDocument( *buf, KUidBrowser, id ); - CleanupStack::PopAndDestroy( &appArcSession ); - CleanupStack::PopAndDestroy( buf ); - } - - CleanupStack::PopAndDestroy( &wsSession ); - } diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/inc/cadef.h --- a/contentstorage/inc/cadef.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/inc/cadef.h Fri Apr 16 15:16:09 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: Definition of different constants - * Version : %version: 10.1.4 % << Don't touch! Updated by Synergy at check-out. + * Version : %version: 10.1.7 % << Don't touch! Updated by Synergy at check-out. * */ @@ -22,6 +22,12 @@ #include #include "cainternaltypes.h" + +// database version +_LIT( KCaDbVersion, "00001" ); + + + // --------------------------------------------------------- //Ca constants @@ -62,6 +68,7 @@ _LIT( KCaTypeCollectionDownload, "collection::downloaded" ); _LIT( KCaPackageUid,"packageuid"); _LIT( KCaAttrInstallationTime, "installationTime"); +_LIT( KCaTypeTemplatedApp, "templatedApplication" ); const TInt KGranularityOne = 1; const TInt KUidChars = 10; @@ -88,7 +95,7 @@ { 0x20022F35 }; - + const TInt KCenRepBufferSize = 255; // // Attributes commonly used for all items. diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/inc/casrvdef.h --- a/contentstorage/inc/casrvdef.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/inc/casrvdef.h Fri Apr 16 15:16:09 2010 +0300 @@ -35,8 +35,6 @@ const TInt KInputPosition2 = 1; const TInt KOutputPosition = 2; -//TODO: move to another location so that server have access to it -// Opcodes used in message passing between client and server enum TCaServerRequests { EContentArsenalGetList_GetSize = 100, diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/srvinc/cainstallnotifier.h --- a/contentstorage/srvinc/cainstallnotifier.h Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/srvinc/cainstallnotifier.h Fri Apr 16 15:16:09 2010 +0300 @@ -85,7 +85,7 @@ * @param aNotifier Reference to notifier interface. * @param aNotificationType Notification type. */ - static CCaInstallNotifier* NewL( MCaInstallListener& aListener, +IMPORT_C static CCaInstallNotifier* NewL( MCaInstallListener& aListener, TNotificationType aNotificationType ); /** diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/srvsrc/casrv.cpp --- a/contentstorage/srvsrc/casrv.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/srvsrc/casrv.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -28,19 +28,6 @@ // ==================== LOCAL FUNCTIONS ==================== /** - * Stop the Active Scheduler. - * @param aPtr Not used. - * @return KErrNone. - */ -LOCAL_C TInt StopScheduler( TAny* /*aPtr*/) - { - // Called by the exit timer, after all clients disconnected (plus a small - // delay). Stop the scheduler, this will enable he thread exit. - CActiveScheduler::Stop(); - return KErrNone; - } - -/** * Create a server. * @param Pointer to created server (if created) returned here. * @return Error code. diff -r f62f87b200ec -r 8e5041d13c84 homescreensrv.pro --- a/homescreensrv.pro Fri Mar 19 09:35:23 2010 +0200 +++ b/homescreensrv.pro Fri Apr 16 15:16:09 2010 +0300 @@ -23,6 +23,7 @@ homescreensrv_plat \ screensavermodel \ bagetmodel \ + activityfw \ tsrc CONFIG += ordered diff -r f62f87b200ec -r 8e5041d13c84 homescreensrv_plat/contentstorage_api/caicondescription.h --- a/homescreensrv_plat/contentstorage_api/caicondescription.h Fri Mar 19 09:35:23 2010 +0200 +++ b/homescreensrv_plat/contentstorage_api/caicondescription.h Fri Apr 16 15:16:09 2010 +0300 @@ -42,16 +42,11 @@ QString filename() const; void setFilename(const QString &filename); - int bitmapId() const; - void setBitmapId(int id); + QString skinId() const; + void setSkinId(const QString &skinId); - int maskId() const; - void setMaskId(int id); - - int skinMajorId() const; - void setSkinMajorId(int id); - int skinMinorId() const; - void setSkinMinorId(int id); + QString applicationId() const; + void setApplicationId(const QString &applicationId); private: diff -r f62f87b200ec -r 8e5041d13c84 homescreensrv_plat/contentstorage_api/caquery.h --- a/homescreensrv_plat/contentstorage_api/caquery.h Fri Mar 19 09:35:23 2010 +0200 +++ b/homescreensrv_plat/contentstorage_api/caquery.h Fri Apr 16 15:16:09 2010 +0300 @@ -58,6 +58,11 @@ unsigned int count() const; void setCount(unsigned int count); + QMap attributes() const; + QString attribute(const QString &name) const; + void setAttribute(const QString &name, const QString &value); + void removeAttribute(const QString &name); + void clear(); private: diff -r f62f87b200ec -r 8e5041d13c84 homescreensrv_plat/homescreen_information_api/inc/homescreendomainpskeys.h --- a/homescreensrv_plat/homescreen_information_api/inc/homescreendomainpskeys.h Fri Mar 19 09:35:23 2010 +0200 +++ b/homescreensrv_plat/homescreen_information_api/inc/homescreendomainpskeys.h Fri Apr 16 15:16:09 2010 +0300 @@ -19,23 +19,17 @@ #define HOMESCREEN_DOMAIN_PS_KEYS_H /** - * P&S UID for all Home Screen state information keys provided by this API. - */ -const QUuid KPSUidHsState("0x20022F75"); - -/** * P&S Key path for all Home Screen state information keys provided by this API. */ -const QString HsStatePSKeyPath = "/homescreeninformation"; +const char HsStatePSKeyPath[] = "/homescreen"; /** * P&S Key sub path to represent the state of the Home Screen. This property is updated when - * Home screen state is changed. Valid values are defined by the enum EPSHsState - * and range from 0 to 1. + * Home screen state is changed. Valid values are defined by the enum EPSHsState. * * @see EPSHsState */ -const QString HsStatePSKeySubPath = "resources/homescreen/state"; +const char HsStatePSKeySubPath[] = "state"; /** * Home screen state. @@ -56,4 +50,4 @@ EHomeScreenIdleState = 2 }; -#endif //HOMESCREEN_DOMAIN_PS_KEYS_H \ No newline at end of file +#endif //HOMESCREEN_DOMAIN_PS_KEYS_H diff -r f62f87b200ec -r 8e5041d13c84 homescreensrv_plat/homescreen_information_api/inc/homescreeninformation.qcrml --- a/homescreensrv_plat/homescreen_information_api/inc/homescreeninformation.qcrml Fri Mar 19 09:35:23 2010 +0200 +++ b/homescreensrv_plat/homescreen_information_api/inc/homescreeninformation.qcrml Fri Apr 16 15:16:09 2010 +0300 @@ -1,5 +1,5 @@ - - + + diff -r f62f87b200ec -r 8e5041d13c84 package_definition.xml --- a/package_definition.xml Fri Mar 19 09:35:23 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r f62f87b200ec -r 8e5041d13c84 rom/homescreensrv_core.iby --- a/rom/homescreensrv_core.iby Fri Mar 19 09:35:23 2010 +0200 +++ b/rom/homescreensrv_core.iby Fri Apr 16 15:16:09 2010 +0300 @@ -31,7 +31,6 @@ file=ABI_DIR\BUILD_DIR\casathandler.dll SHARED_LIB_DIR\casathandler.dll file=ABI_DIR\BUILD_DIR\castorage.dll SHARED_LIB_DIR\castorage.dll file=ABI_DIR\BUILD_DIR\MenuInterface.dll SHARED_LIB_DIR\MenuInterface.dll -ECOM_PLUGIN( castockhandlerplugins.dll, castockhandlerplugins.rsc ) file=ABI_DIR\BUILD_DIR\casrvmanager.dll SHARED_LIB_DIR\casrvmanager.dll ECOM_PLUGIN( casatmonitor.dll, casatmonitor.rsc ) ECOM_PLUGIN( caappscanner.dll, caappscanner.rsc ) @@ -39,7 +38,7 @@ ECOM_PLUGIN( calocalizerscanner.dll, calocalizerscanner.rsc ) ECOM_PLUGIN( carunningappmonitor.dll, carunningappmonitor.rsc ) -data=ZPRIVATE\20022F90\castoragedb private\20022F90\castoragedb +data=ZPRIVATE\20022F90\castorage.db private\20022F90\castorage.db // ---- appfoundation -------------------------------------------- diff -r f62f87b200ec -r 8e5041d13c84 sis/homescreensrv.pkg --- a/sis/homescreensrv.pkg Fri Mar 19 09:35:23 2010 +0200 +++ b/sis/homescreensrv.pkg Fri Apr 16 15:16:09 2010 +0300 @@ -137,7 +137,7 @@ "/epoc32/release/armv5/urel/casathandler.dll" - "c:/sys/bin/casathandler.dll" "/epoc32/release/armv5/urel/castorage.dll" - "c:/sys/bin/castorage.dll" "/epoc32/release/armv5/urel/castockhandlerplugins.dll" - "c:/sys/bin/castockhandlerplugins.dll" -"/epoc32/data/z/private/20022F90/castoragedb" - "c:/private/20022F90/castoragedb" +"/epoc32/data/z/private/20022F90/castorage.db" - "c:/private/20022F90/castorage.db" "/epoc32/data/z/resource/plugins/castockhandlerplugins.rsc"-"c:/resource/plugins/castockhandlerplugins.rsc" ; ---- appfoundation --------------------------------------------