# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277307220 -10800 # Node ID b99b84bcd2d117f219bca1dbb264d034edb07cb2 # Parent 156f692b168748b424e867f6387f7cd10bdc5910 Revision: 201023 Kit: 2010125 diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/bwins/hsactivitydbclientu.def --- a/activityfw/activitydatabase/bwins/hsactivitydbclientu.def Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/bwins/hsactivitydbclientu.def Wed Jun 23 18:33:40 2010 +0300 @@ -5,27 +5,28 @@ ?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 &) ?getThumbnail@HsActivityDbClient@@QAEHVQSize@@VQString@@1PAX@Z @ 6 NONAME ; int HsActivityDbClient::getThumbnail(class QSize, class QString, class QString, void *) - ?qt_metacast@HsActivityDbClient@@UAEPAXPBD@Z @ 7 NONAME ; void * HsActivityDbClient::qt_metacast(char const *) - ?qt_metacall@HsActivityDbClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 8 NONAME ; int HsActivityDbClient::qt_metacall(enum QMetaObject::Call, int, void * *) - ?waitActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 9 NONAME ; int HsActivityDbClient::waitActivity(class QHash const &) - ?activities@HsActivityDbClient@@UAEHAAV?$QList@V?$QHash@VQString@@VQVariant@@@@@@@Z @ 10 NONAME ; int HsActivityDbClient::activities(class QList > &) - ?trUtf8@HsActivityDbClient@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString HsActivityDbClient::trUtf8(char const *, char const *, int) - ??0HsActivityDbClient@@QAE@PAVQObject@@@Z @ 12 NONAME ; HsActivityDbClient::HsActivityDbClient(class QObject *) - ?tr@HsActivityDbClient@@SA?AVQString@@PBD0@Z @ 13 NONAME ; class QString HsActivityDbClient::tr(char const *, char const *) - ?getStaticMetaObject@HsActivityDbClient@@SAABUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const & HsActivityDbClient::getStaticMetaObject(void) - ??_EHsActivityDbClient@@UAE@I@Z @ 15 NONAME ; HsActivityDbClient::~HsActivityDbClient(unsigned int) - ?removeApplicationActivities@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 16 NONAME ; int HsActivityDbClient::removeApplicationActivities(class QHash const &) - ?metaObject@HsActivityDbClient@@UBEPBUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const * HsActivityDbClient::metaObject(void) const - ?tr@HsActivityDbClient@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString HsActivityDbClient::tr(char const *, char const *, int) - ?addActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 19 NONAME ; int HsActivityDbClient::addActivity(class QHash const &) - ?asyncRequestCompleated@HsActivityDbClient@@UAEXHHABVQPixmap@@PAX@Z @ 20 NONAME ; void HsActivityDbClient::asyncRequestCompleated(int, int, class QPixmap const &, void *) - ?staticMetaObject@HsActivityDbClient@@2UQMetaObject@@B @ 21 NONAME ; struct QMetaObject const HsActivityDbClient::staticMetaObject - ??1HsActivityDbClient@@UAE@XZ @ 22 NONAME ; HsActivityDbClient::~HsActivityDbClient(void) - ?thumbnailRequested@HsActivityDbClient@@IAEXVQPixmap@@PAX@Z @ 23 NONAME ; void HsActivityDbClient::thumbnailRequested(class QPixmap, void *) - ?activityRequested@HsActivityDbClient@@IAEXABVQString@@@Z @ 24 NONAME ; void HsActivityDbClient::activityRequested(class QString const &) - ?updateActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 25 NONAME ; int HsActivityDbClient::updateActivity(class QHash const &) - ?removeActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 26 NONAME ; int HsActivityDbClient::removeActivity(class QHash const &) - ?dataChanged@HsActivityDbClient@@IAEXXZ @ 27 NONAME ; void HsActivityDbClient::dataChanged(void) - ?notifyDataChange@HsActivityDbClient@@QAEHXZ @ 28 NONAME ; int HsActivityDbClient::notifyDataChange(void) - ?asyncRequestCompleated@HsActivityDbClient@@UAEXHH@Z @ 29 NONAME ; void HsActivityDbClient::asyncRequestCompleated(int, int) + ?dataChanged@HsActivityDbClient@@IAEXXZ @ 7 NONAME ; void HsActivityDbClient::dataChanged(void) + ?qt_metacast@HsActivityDbClient@@UAEPAXPBD@Z @ 8 NONAME ; void * HsActivityDbClient::qt_metacast(char const *) + ?qt_metacall@HsActivityDbClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int HsActivityDbClient::qt_metacall(enum QMetaObject::Call, int, void * *) + ?waitActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 10 NONAME ; int HsActivityDbClient::waitActivity(class QHash const &) + ?activities@HsActivityDbClient@@UAEHAAV?$QList@V?$QHash@VQString@@VQVariant@@@@@@@Z @ 11 NONAME ; int HsActivityDbClient::activities(class QList > &) + ?notifyDataChange@HsActivityDbClient@@QAEHXZ @ 12 NONAME ; int HsActivityDbClient::notifyDataChange(void) + ?trUtf8@HsActivityDbClient@@SA?AVQString@@PBD0H@Z @ 13 NONAME ; class QString HsActivityDbClient::trUtf8(char const *, char const *, int) + ?asyncRequestCompleated@HsActivityDbClient@@UAEXHH@Z @ 14 NONAME ; void HsActivityDbClient::asyncRequestCompleated(int, int) + ??0HsActivityDbClient@@QAE@PAVQObject@@@Z @ 15 NONAME ; HsActivityDbClient::HsActivityDbClient(class QObject *) + ?tr@HsActivityDbClient@@SA?AVQString@@PBD0@Z @ 16 NONAME ; class QString HsActivityDbClient::tr(char const *, char const *) + ?getStaticMetaObject@HsActivityDbClient@@SAABUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const & HsActivityDbClient::getStaticMetaObject(void) + ??_EHsActivityDbClient@@UAE@I@Z @ 18 NONAME ; HsActivityDbClient::~HsActivityDbClient(unsigned int) + ?removeApplicationActivities@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 19 NONAME ; int HsActivityDbClient::removeApplicationActivities(class QHash const &) + ?metaObject@HsActivityDbClient@@UBEPBUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const * HsActivityDbClient::metaObject(void) const + ?tr@HsActivityDbClient@@SA?AVQString@@PBD0H@Z @ 21 NONAME ; class QString HsActivityDbClient::tr(char const *, char const *, int) + ?addActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@0@Z @ 22 NONAME ; int HsActivityDbClient::addActivity(class QHash const &, class QHash const &) + ?asyncRequestCompleated@HsActivityDbClient@@UAEXHHABVQPixmap@@PAX@Z @ 23 NONAME ; void HsActivityDbClient::asyncRequestCompleated(int, int, class QPixmap const &, void *) + ?staticMetaObject@HsActivityDbClient@@2UQMetaObject@@B @ 24 NONAME ; struct QMetaObject const HsActivityDbClient::staticMetaObject + ?updateActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@0@Z @ 25 NONAME ; int HsActivityDbClient::updateActivity(class QHash const &, class QHash const &) + ??1HsActivityDbClient@@UAE@XZ @ 26 NONAME ; HsActivityDbClient::~HsActivityDbClient(void) + ?thumbnailRequested@HsActivityDbClient@@IAEXVQPixmap@@PAX@Z @ 27 NONAME ; void HsActivityDbClient::thumbnailRequested(class QPixmap, void *) + ?activityRequested@HsActivityDbClient@@IAEXABVQString@@@Z @ 28 NONAME ; void HsActivityDbClient::activityRequested(class QString const &) + ?removeActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 29 NONAME ; int HsActivityDbClient::removeActivity(class QHash const &) + ?activityData@HsActivityDbClient@@UAEHAAVQVariant@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 30 NONAME ; int HsActivityDbClient::activityData(class QVariant &, class QHash const &) diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/eabi/hsactivitydbclientu.def --- a/activityfw/activitydatabase/eabi/hsactivitydbclientu.def Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/eabi/hsactivitydbclientu.def Wed Jun 23 18:33:40 2010 +0300 @@ -1,42 +1,44 @@ EXPORTS _ZN18HsActivityDbClient10activitiesER5QListI5QHashI7QString8QVariantEE @ 1 NONAME - _ZN18HsActivityDbClient11addActivityERK5QHashI7QString8QVariantE @ 2 NONAME - _ZN18HsActivityDbClient11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME - _ZN18HsActivityDbClient11qt_metacastEPKc @ 4 NONAME - _ZN18HsActivityDbClient12getThumbnailE5QSize7QStringS1_Pv @ 5 NONAME - _ZN18HsActivityDbClient12waitActivityERK5QHashI7QString8QVariantE @ 6 NONAME - _ZN18HsActivityDbClient14launchActivityERK5QHashI7QString8QVariantE @ 7 NONAME - _ZN18HsActivityDbClient14removeActivityERK5QHashI7QString8QVariantE @ 8 NONAME - _ZN18HsActivityDbClient14updateActivityERK5QHashI7QString8QVariantE @ 9 NONAME - _ZN18HsActivityDbClient16staticMetaObjectE @ 10 NONAME DATA 16 - _ZN18HsActivityDbClient17activityRequestedERK7QString @ 11 NONAME - _ZN18HsActivityDbClient18thumbnailRequestedE7QPixmapPv @ 12 NONAME - _ZN18HsActivityDbClient19getStaticMetaObjectEv @ 13 NONAME - _ZN18HsActivityDbClient21applicationActivitiesER5QListI5QHashI7QString8QVariantEERKS4_ @ 14 NONAME - _ZN18HsActivityDbClient22asyncRequestCompleatedEiiRK7QPixmapPv @ 15 NONAME - _ZN18HsActivityDbClient22asyncRequestCompleatedEiiRK7QString @ 16 NONAME - _ZN18HsActivityDbClient27removeApplicationActivitiesERK5QHashI7QString8QVariantE @ 17 NONAME - _ZN18HsActivityDbClient7connectEv @ 18 NONAME - _ZN18HsActivityDbClientC1EP7QObject @ 19 NONAME - _ZN18HsActivityDbClientC2EP7QObject @ 20 NONAME - _ZN18HsActivityDbClientD0Ev @ 21 NONAME - _ZN18HsActivityDbClientD1Ev @ 22 NONAME - _ZN18HsActivityDbClientD2Ev @ 23 NONAME - _ZNK18HsActivityDbClient10metaObjectEv @ 24 NONAME - _ZTI18HsActivityDbClient @ 25 NONAME - _ZTV18HsActivityDbClient @ 26 NONAME - _ZThn12_N18HsActivityDbClient22asyncRequestCompleatedEiiRK7QPixmapPv @ 27 NONAME - _ZThn12_N18HsActivityDbClient22asyncRequestCompleatedEiiRK7QString @ 28 NONAME - _ZThn8_N18HsActivityDbClient10activitiesER5QListI5QHashI7QString8QVariantEE @ 29 NONAME - _ZThn8_N18HsActivityDbClient11addActivityERK5QHashI7QString8QVariantE @ 30 NONAME - _ZThn8_N18HsActivityDbClient12waitActivityERK5QHashI7QString8QVariantE @ 31 NONAME - _ZThn8_N18HsActivityDbClient14launchActivityERK5QHashI7QString8QVariantE @ 32 NONAME - _ZThn8_N18HsActivityDbClient14removeActivityERK5QHashI7QString8QVariantE @ 33 NONAME - _ZThn8_N18HsActivityDbClient14updateActivityERK5QHashI7QString8QVariantE @ 34 NONAME - _ZThn8_N18HsActivityDbClient21applicationActivitiesER5QListI5QHashI7QString8QVariantEERKS4_ @ 35 NONAME - _ZThn8_N18HsActivityDbClient27removeApplicationActivitiesERK5QHashI7QString8QVariantE @ 36 NONAME - _ZN18HsActivityDbClient11dataChangedEv @ 37 NONAME - _ZN18HsActivityDbClient16notifyDataChangeEv @ 38 NONAME - _ZN18HsActivityDbClient22asyncRequestCompleatedEii @ 39 NONAME - _ZThn12_N18HsActivityDbClient22asyncRequestCompleatedEii @ 40 NONAME + _ZN18HsActivityDbClient11addActivityERK5QHashI7QString8QVariantES5_ @ 2 NONAME + _ZN18HsActivityDbClient11dataChangedEv @ 3 NONAME + _ZN18HsActivityDbClient11qt_metacallEN11QMetaObject4CallEiPPv @ 4 NONAME + _ZN18HsActivityDbClient11qt_metacastEPKc @ 5 NONAME + _ZN18HsActivityDbClient12getThumbnailE5QSize7QStringS1_Pv @ 6 NONAME + _ZN18HsActivityDbClient12waitActivityERK5QHashI7QString8QVariantE @ 7 NONAME + _ZN18HsActivityDbClient14launchActivityERK5QHashI7QString8QVariantE @ 8 NONAME + _ZN18HsActivityDbClient14removeActivityERK5QHashI7QString8QVariantE @ 9 NONAME + _ZN18HsActivityDbClient14updateActivityERK5QHashI7QString8QVariantES5_ @ 10 NONAME + _ZN18HsActivityDbClient16notifyDataChangeEv @ 11 NONAME + _ZN18HsActivityDbClient16staticMetaObjectE @ 12 NONAME DATA 16 + _ZN18HsActivityDbClient17activityRequestedERK7QString @ 13 NONAME + _ZN18HsActivityDbClient18thumbnailRequestedE7QPixmapPv @ 14 NONAME + _ZN18HsActivityDbClient19getStaticMetaObjectEv @ 15 NONAME + _ZN18HsActivityDbClient21applicationActivitiesER5QListI5QHashI7QString8QVariantEERKS4_ @ 16 NONAME + _ZN18HsActivityDbClient22asyncRequestCompleatedEii @ 17 NONAME + _ZN18HsActivityDbClient22asyncRequestCompleatedEiiRK7QPixmapPv @ 18 NONAME + _ZN18HsActivityDbClient22asyncRequestCompleatedEiiRK7QString @ 19 NONAME + _ZN18HsActivityDbClient27removeApplicationActivitiesERK5QHashI7QString8QVariantE @ 20 NONAME + _ZN18HsActivityDbClient7connectEv @ 21 NONAME + _ZN18HsActivityDbClientC1EP7QObject @ 22 NONAME + _ZN18HsActivityDbClientC2EP7QObject @ 23 NONAME + _ZN18HsActivityDbClientD0Ev @ 24 NONAME + _ZN18HsActivityDbClientD1Ev @ 25 NONAME + _ZN18HsActivityDbClientD2Ev @ 26 NONAME + _ZNK18HsActivityDbClient10metaObjectEv @ 27 NONAME + _ZTI18HsActivityDbClient @ 28 NONAME + _ZTV18HsActivityDbClient @ 29 NONAME + _ZThn12_N18HsActivityDbClient22asyncRequestCompleatedEii @ 30 NONAME + _ZThn12_N18HsActivityDbClient22asyncRequestCompleatedEiiRK7QPixmapPv @ 31 NONAME + _ZThn12_N18HsActivityDbClient22asyncRequestCompleatedEiiRK7QString @ 32 NONAME + _ZThn8_N18HsActivityDbClient10activitiesER5QListI5QHashI7QString8QVariantEE @ 33 NONAME + _ZThn8_N18HsActivityDbClient11addActivityERK5QHashI7QString8QVariantES5_ @ 34 NONAME + _ZThn8_N18HsActivityDbClient12waitActivityERK5QHashI7QString8QVariantE @ 35 NONAME + _ZThn8_N18HsActivityDbClient14launchActivityERK5QHashI7QString8QVariantE @ 36 NONAME + _ZThn8_N18HsActivityDbClient14removeActivityERK5QHashI7QString8QVariantE @ 37 NONAME + _ZThn8_N18HsActivityDbClient14updateActivityERK5QHashI7QString8QVariantES5_ @ 38 NONAME + _ZThn8_N18HsActivityDbClient21applicationActivitiesER5QListI5QHashI7QString8QVariantEERKS4_ @ 39 NONAME + _ZThn8_N18HsActivityDbClient27removeApplicationActivitiesERK5QHashI7QString8QVariantE @ 40 NONAME + _ZN18HsActivityDbClient12activityDataER8QVariantRK5QHashI7QStringS0_E @ 41 NONAME + _ZThn8_N18HsActivityDbClient12activityDataER8QVariantRK5QHashI7QStringS0_E @ 42 NONAME diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbclient/hsactivitydbclient.pro --- a/activityfw/activitydatabase/hsactivitydbclient/hsactivitydbclient.pro Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/hsactivitydbclient/hsactivitydbclient.pro Wed Jun 23 18:33:40 2010 +0300 @@ -29,11 +29,13 @@ symbian{ TARGET.UID3 = 0xE467C21E -HEADERS += ../s60/inc/hsserializer.h \ +HEADERS += ../s60/inc/afentry.h \ + ../s60/inc/hsserializer.h \ s60/inc/hsactivitydbclient_p.h \ s60/inc/hsactivitydbasyncrequest_p.h -SOURCES += ../s60/src/hsserializer.cpp \ +SOURCES += ../s60/src/afentry.cpp \ + ../s60/src/hsserializer.cpp \ s60/src/hsactivitydbclient_p.cpp \ s60/src/hsactivitydbasyncrequest_p.cpp diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbclient.h --- a/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbclient.h Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbclient.h Wed Jun 23 18:33:40 2010 +0300 @@ -74,17 +74,9 @@ void asyncRequestCompleated(int result, int requestType); - /** - * Interface implementation. - * @see int HsActivityDbClientInterface::saveActivity(const QVariantHash&) - */ - int addActivity(const QVariantHash &); + int addActivity(const QVariantHash &, const QVariantHash &); - /** - * Interface implementation. - * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash&) - */ - int updateActivity(const QVariantHash &); + int updateActivity(const QVariantHash &, const QVariantHash &); /** * Interface implementation. @@ -113,6 +105,12 @@ /** * Interface implementation. + * @see int HsActivityDbClientInterface::activityData(QVariant &, const QVariantHash &) + */ + int activityData(QVariant &result, const QVariantHash &activity); + + /** + * Interface implementation. * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &) */ int waitActivity(const QVariantHash &activity); diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h --- a/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h Wed Jun 23 18:33:40 2010 +0300 @@ -30,153 +30,77 @@ 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 &); + int addActivity(const QVariantHash &privateData, + const QVariantHash &publicData); - /** - * Interface implementation. - * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash &) - */ - int updateActivity(const QVariantHash &); + int updateActivity(const QVariantHash &privateData, + const QVariantHash &publicData); - /** - * 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 &); - /** - * Interface implementation. - * @see int HsActivityDbClientInterface::applicationActivities(QList &, const QVariantHash &) - */ int applicationActivities(QList&, const QVariantHash &); - /** - * Interface implementation. - * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &) - */ + int activityData(QVariant &result, const QVariantHash &activity); + int waitActivity(const QVariantHash &activity); int getThumbnail(QSize size, QString imagePath, QString mimeType, void *userDdata); int notifyDataChange(); - /** - * Interface implementation. - * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &) - */ int launchActivity(const QVariantHash &); - /** - * Interface implementation. - * @see int HsActivityDbClientInterface::cancelWaitActivity() - */ int cancelWaitActivity(); - + int cancelNotifyDataChange(); - + public: - /** - * Function get cached data from server - * @param taskId - request task id - * @param dst - destination, preallocated buffer - */ void getData(int taskId, 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); - -// void emitActivityRequested(); -// void emitThumbnailRequested(); - + public: void PushL(HsActivityDbAsyncRequestPrivate * task); + void Pop(HsActivityDbAsyncRequestPrivate *task); 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); + void execSimpleRequestL(int function, + const QVariantHash &privateData, + const QVariantHash &publicData); - /** - * 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); - + void activityDataL(QVariant &result, const QVariantHash &activity); + + void launchActivityL(const QVariantHash &activity); + void getThumbnailL(QSize size, QString imagePath, QString mimeType, void *userDdata); + + int checkDataConstraint(int func, const QVariantHash &data); + + int execute(int func, const QVariantHash &privateData, const QVariantHash &publicData); + + int execute(int func, QList&dst, const QVariantHash &src); + private: RPointerArray mAsyncTasks; HsActivityDbAsyncRequestObserver& mObserver; diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbclient_p.cpp --- a/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbclient_p.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbclient_p.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -14,29 +14,34 @@ * Description: * */ +#include +#include + +#include +#include #include "hsactivitydbclient_p.h" #include "hsactivitydbasyncrequest_p.h" #include "hsactivityglobals.h" #include "hsserializer.h" -#include -#include +#include "afentry.h" + // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// +/** + * Constructor + */ HsActivityDbClientPrivate::HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver &observer): mObserver(observer) { - + } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// +/** + * Destructor + */ HsActivityDbClientPrivate::~HsActivityDbClientPrivate() { mAsyncTasks.ResetAndDestroy(); @@ -44,9 +49,10 @@ } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// +/** + * Function establish connection to activity server + * @return 0 on succees, error code otherwise + */ int HsActivityDbClientPrivate::connect() { TRAPD(errNo, connectL()); @@ -54,90 +60,91 @@ } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -int HsActivityDbClientPrivate::addActivity(const QVariantHash &activity) +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::addActivity(const QVariantHash &) + */ +int HsActivityDbClientPrivate::addActivity(const QVariantHash &privateData, + const QVariantHash &publicData) { - int errNo(KErrCorrupt); - if (activity.end() != activity.find(ActivityApplicationKeyword) && - activity.end() != activity.find(ActivityActivityKeyword)) { - TRAP(errNo, execSimpleRequestL(AddActivity, activity);) - } - return errNo; + return execute(AddActivity, privateData, publicData); + +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash &) + */ +int HsActivityDbClientPrivate::updateActivity(const QVariantHash &privateData, + const QVariantHash &publicData) +{ + return execute(UpdateActivity, privateData, publicData); +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::removeActivity(const QVariantHash &) + */ +int HsActivityDbClientPrivate::removeActivity(const QVariantHash &activity) +{ + return execute(RemoveActivity, QVariantHash(), activity); } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -int HsActivityDbClientPrivate::updateActivity(const QVariantHash &activity) +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::removeApplicationActivities(const QVariantHash &) +*/ + +int HsActivityDbClientPrivate::removeApplicationActivities(const QVariantHash &activity) { - int errNo(KErrCorrupt); - if (activity.end() != activity.find(ActivityApplicationKeyword) && - activity.end() != activity.find(ActivityActivityKeyword)) { - TRAP(errNo, execSimpleRequestL(UpdateActivity, activity);) - } - return errNo; + return execute(RemoveApplicationActivities, QVariantHash(), activity); +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::activities(QList &); + */ +int HsActivityDbClientPrivate::activities(QList& result) +{ + return execute(Activities, result, QVariantHash()); } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -int HsActivityDbClientPrivate::removeActivity(const QVariantHash &activity) +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::applicationActivities(QList &, const QVariantHash &) + */ +int HsActivityDbClientPrivate::applicationActivities(QList& result, + const QVariantHash &condition) { - int errNo(KErrCorrupt); - if (activity.end() != activity.find(ActivityApplicationKeyword) && - activity.end() != activity.find(ActivityActivityKeyword)) { - TRAP(errNo, execSimpleRequestL(RemoveActivity, activity);) - } + return execute(ApplicationActivities, result, condition); +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::activityData(QVariant &, const QVariantHash &) + */ +int HsActivityDbClientPrivate::activityData(QVariant &result, const QVariantHash &activity) +{ + TRAPD(errNo, + User::LeaveIfError(checkDataConstraint(ApplicationActivity, activity)); + activityDataL(result, activity);) return errNo; } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -int HsActivityDbClientPrivate::removeApplicationActivities(const QVariantHash &activity) -{ - int errNo(KErrCorrupt); - if (activity.end() != activity.find(ActivityApplicationKeyword)) { - TRAP(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; -} - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &) + */ int HsActivityDbClientPrivate::waitActivity(const QVariantHash &activity) { - TRAPD(errNo, waitActivityL(activity);) - return errNo; + return execute(WaitActivity, QVariantHash(), activity); } // ----------------------------------------------------------------------------- @@ -156,24 +163,24 @@ // int HsActivityDbClientPrivate::notifyDataChange() { - TRAPD(errNo,HsActivityDbAsyncRequestPrivate::notifyDataChangeLD(mObserver, *this);) - return errNo; + return execute(NotifyChange, QVariantHash(), QVariantHash()); } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &) + */ int HsActivityDbClientPrivate::launchActivity(const QVariantHash &activity) { - TRAPD(errNo, execSimpleRequestL(LaunchActivity, activity);) - return errNo; + return execute(LaunchActivity, QVariantHash(), activity); } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::cancelWaitActivity() + */ int HsActivityDbClientPrivate::cancelWaitActivity() { return SendReceive(CancelWait, TIpcArgs()); @@ -189,9 +196,10 @@ } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// +/** + * Function start activity server process. + * Function can leave on failure. + */ void HsActivityDbClientPrivate::startServerL() { RProcess server; @@ -215,9 +223,10 @@ } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// +/** + * Function establish connection to activity server. + * Function can leave on failure + */ void HsActivityDbClientPrivate::connectL() { const int asyncMessageSlots(12); @@ -241,78 +250,248 @@ } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void HsActivityDbClientPrivate::execSimpleRequestL(int function, const QVariantHash &activity) +/** + * Function execute remote call request. + * @param function - remote function identyfier + * @param activity - remote function parameters + */ +void HsActivityDbClientPrivate::execSimpleRequestL(int function, + const QVariantHash &privateData, + const QVariantHash &publicData) { - TPckgBuf appId( activity.find(ActivityApplicationKeyword).value().toInt() ); - HBufC8 *actId = XQConversions::qStringToS60Desc8(activity.find(ActivityActivityKeyword).value().toString()); + + TPckgBuf bitmapHdl(0); + int flags(0); + if(publicData.end() != publicData.find(ActivityPersistence) && + publicData[ActivityPersistence].toBool()) { + flags |= CAfEntry::Persistent; + } + if(publicData.end() != publicData.find(ActivityVisibility) && + !publicData[ActivityVisibility].toBool()) { + flags |= CAfEntry::Invisible; + } + CFbsBitmap* bitmap(0); + if (publicData.end() != publicData.find(ActivityScreenshotKeyword)) { + bitmap = publicData[ActivityScreenshotKeyword].value().toSymbianCFbsBitmap(); + if (bitmap) { + CleanupStack::PushL(bitmap); + bitmapHdl = bitmap->Handle(); + } + + + } + + RBuf8 prvBuffer, pubBuffer, data; + CleanupClosePushL(data); + CleanupClosePushL(prvBuffer); + CleanupClosePushL(pubBuffer); + + prvBuffer << privateData; + if (publicData.end() != publicData.find(ActivityScreenshotKeyword)) { + QVariantHash localData(publicData); + localData.remove(ActivityScreenshotKeyword); + pubBuffer << localData; + } else { + pubBuffer << publicData; + } + + HBufC *actId = XQConversions::qStringToS60Desc(publicData[ActivityActivityKeyword].toString()); CleanupStack::PushL(actId); - TPckgBuf taskId(0); - RBuf8 data; - CleanupClosePushL(data); - data.CreateL(256); - data << activity; - User::LeaveIfError(SendReceive(function, TIpcArgs(&appId, actId, &data, &taskId))); + CAfEntry *entry = CAfEntry::NewL(flags, + publicData[ActivityApplicationKeyword].toInt(), + *actId, + KNullDesC, + prvBuffer, + pubBuffer); + CleanupStack::PopAndDestroy(actId); + CleanupStack::PopAndDestroy(&pubBuffer); + CleanupStack::PopAndDestroy(&prvBuffer); + + CleanupStack::PushL(entry); + data.CreateL(entry->Size()); + RDesWriteStream stream(data); + CleanupClosePushL(stream); + stream << (*entry); + CleanupStack::PopAndDestroy(&stream); + CleanupStack::PopAndDestroy(entry); + User::LeaveIfError(SendReceive(function, TIpcArgs(&data, &bitmapHdl))); + CleanupStack::PopAndDestroy(&data); - CleanupStack::PopAndDestroy(actId); + if (0 != bitmap) { + CleanupStack::PopAndDestroy(bitmap); + } + +} + +// ----------------------------------------------------------------------------- +/** + * Function retrieve all stored activity + * Function can leave on failure + * @param result - list of activity + */ +void HsActivityDbClientPrivate::activitiesL(QList& result) +{ + result.clear(); + + RBuf8 buffer; + CleanupClosePushL(buffer); + + TPckgBuf emptyFilter(0), length(0), taskId(0); + User::LeaveIfError(SendReceive(Activities, + TIpcArgs(&emptyFilter, &length, &taskId))); + + CAfEntry::ReallocL(buffer, length()); + + User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &buffer))); + + RPointerArray entries; + CleanupClosePushL(entries); + + entries << buffer; + buffer.Close();//release unneeded resources + + + while(entries.Count()) { + QVariantHash publicData; + publicData << entries[0]->Data(CAfEntry::Public); + publicData.insert(ActivityScreenshotKeyword, + QString::fromUtf16(entries[0]->ImageSrc().Ptr(), + entries[0]->ImageSrc().Length())); + result.append(publicData); + entries.Remove(0); + } + CleanupStack::PopAndDestroy(&entries); + CleanupStack::PopAndDestroy(&buffer); +} + +// ----------------------------------------------------------------------------- +/** + * Function retrieve all stored activity + * Function can leave on failure + * @param result - list of activity + * @param cond - request conditions + */ +void HsActivityDbClientPrivate::applicationActivitiesL(QList& result, + const QVariantHash & condition) +{ + result.clear(); + + RBuf8 buffer; + CleanupClosePushL(buffer); + CAfEntry *entry = CAfEntry::NewLC(0, + condition[ActivityApplicationKeyword].toInt(), + KNullDesC, + KNullDesC, + KNullDesC8, + KNullDesC8);//filtering using application id only + CAfEntry::ReallocL(buffer, entry->Size()); + RDesWriteStream writer(buffer); + CleanupClosePushL(writer); + writer << (*entry); + CleanupStack::PopAndDestroy(&writer); + CleanupStack::PopAndDestroy(entry); + + TPckgBuf length(0), taskId(0); + User::LeaveIfError(SendReceive(ApplicationActivities, + TIpcArgs(&buffer, &length, &taskId))); + + CAfEntry::ReallocL(buffer, length()); + + User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &buffer))); + + RPointerArray entries; + CleanupClosePushL(entries); + + entries << buffer; + buffer.Close();//release unneeded resources + + + while(entries.Count()) { + QVariantHash publicData; + publicData << entries[0]->Data(CAfEntry::Public); + publicData.insert(ActivityScreenshotKeyword, + QString::fromUtf16(entries[0]->ImageSrc().Ptr(), + entries[0]->ImageSrc().Length())); + result.append(publicData); + entries.Remove(0); + } + CleanupStack::PopAndDestroy(&entries); + CleanupStack::PopAndDestroy(&buffer); +} + +// ----------------------------------------------------------------------------- +/** + * Function retrieve private data of stored activity + * Function can leave on failure + * @param result - list of activity + * @param activity - request conditions + */ +void HsActivityDbClientPrivate::activityDataL(QVariant &result, const QVariantHash &activity) +{ + result.clear(); + + RBuf8 buffer; + CleanupClosePushL(buffer); + + { // prepare entry to send + HBufC *activityId = XQConversions::qStringToS60Desc(activity[ActivityActivityKeyword].toString()); + CleanupStack::PushL(activityId); + + CAfEntry *entry = CAfEntry::NewLC(0, + activity[ActivityApplicationKeyword].toInt(), + *activityId, + KNullDesC, + KNullDesC8, + KNullDesC8);//filtering using application id only + CAfEntry::ReallocL(buffer, entry->Size()); + RDesWriteStream writer(buffer); + CleanupClosePushL(writer); + writer << (*entry); + CleanupStack::PopAndDestroy(&writer); + CleanupStack::PopAndDestroy(entry); + CleanupStack::PopAndDestroy(activityId); + } + + { // get data + TPckgBuf length(0), taskId(0); + User::LeaveIfError(SendReceive(ApplicationActivity, TIpcArgs(&buffer, &length, &taskId))); + + CAfEntry::ReallocL(buffer, length()); + User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &buffer))); + } + + { // read data to Qt structure + CAfEntry *entry = CAfEntry::NewLC(); + RDesReadStream reader(buffer); + CleanupClosePushL(reader); + entry->InternalizeL(reader); + CleanupStack::PopAndDestroy(&reader); + + buffer.Close(); //release unneeded resources + + QVariantHash privateData; + privateData << entry->Data(CAfEntry::Private); + result = privateData.value(ActivityDataKeyword); + + CleanupStack::PopAndDestroy(entry); + } + CleanupStack::PopAndDestroy(&buffer); } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -void HsActivityDbClientPrivate::activitiesL(QList& result) +void HsActivityDbClientPrivate::launchActivityL(const QVariantHash &activity) { - TPckgBuf appId(0); - TPtrC8 actId(KNullDesC8); - TPtrC8 desc(KNullDesC8); - TPckgBuf taskId(0); - User::LeaveIfError(SendReceive(Activities, - TIpcArgs(&appId, &actId, &desc, &taskId))); - - int sizeBuf(appId()); - RBuf8 data; - CleanupClosePushL(data); - data.Create(sizeBuf); - User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &data))); - - result << data; - CleanupStack::PopAndDestroy(&data); -} + TPckgC applicationId(activity[ActivityApplicationKeyword].toInt()); + HBufC8 *activityId = XQConversions::qStringToS60Desc8(activity[ActivityActivityKeyword].toString()); + CleanupStack::PushL(activityId); + TPtrC8 empty(KNullDesC8); + User::LeaveIfError(SendReceive(LaunchActivity, + TIpcArgs(&applicationId, activityId, &empty, &empty))); + CleanupStack::PopAndDestroy(activityId); -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void HsActivityDbClientPrivate::applicationActivitiesL(QList& result, - const QVariantHash & condition) -{ - TPckgBuf appId = condition.find(ActivityApplicationKeyword).value().toInt(); - TPtrC8 actId(KNullDesC8); - TPtrC8 desc(KNullDesC8); - TPckgBuf taskId(0); - User::LeaveIfError(SendReceive(ApplicationActivities, - TIpcArgs(&appId, &actId, &desc, &taskId))); - - int sizeBuf(appId()); - RBuf8 data; - CleanupClosePushL(data); - data.Create(sizeBuf); - User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &data))); - - result << data; - CleanupStack::PopAndDestroy(&data); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void HsActivityDbClientPrivate::waitActivityL(const QVariantHash &activity) -{ - HsActivityDbAsyncRequestPrivate::waitActivityLD(mObserver,*this, activity); } // ----------------------------------------------------------------------------- @@ -326,9 +505,11 @@ } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// +/** + * Function get cached data from server + * @param taskId - request task id + * @param dst - destination, preallocated buffer + */ void HsActivityDbClientPrivate::getData(int taskId, RBuf8 &data) { TPckgBuf requestId(taskId); @@ -336,11 +517,14 @@ } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// +/** + * Function initialize aync request + * @param func - requested function + * @param data - request data + * @param status - request status + */ void HsActivityDbClientPrivate::sendDataAsync(int func, - const TIpcArgs &data, + const TIpcArgs &data, TRequestStatus& status) { SendReceive(func, data, status); @@ -368,3 +552,92 @@ mAsyncTasks.Remove(offset); } } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::execute(int func, const QVariantHash &privateData, const QVariantHash &publicData) +{ + TRAPD(errNo, + User::LeaveIfError(checkDataConstraint(func, publicData)); + switch (func) { + case AddActivity: + case UpdateActivity: + case RemoveActivity: + case RemoveApplicationActivities: + execSimpleRequestL(func, privateData, publicData); + break; + + case LaunchActivity: + launchActivityL(publicData); + break; + + case NotifyChange: + HsActivityDbAsyncRequestPrivate::notifyDataChangeLD(mObserver, *this); + break; + + case WaitActivity: + HsActivityDbAsyncRequestPrivate::waitActivityLD(mObserver,*this, publicData); + break; + + } + + ) + return errNo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::execute(int func, + QList&dst, + const QVariantHash &src) +{ + TRAPD(errNo, + User::LeaveIfError(checkDataConstraint(func, src)); + switch (func) { + case Activities: activitiesL(dst);break; + case ApplicationActivities: applicationActivitiesL(dst, src); break; + } + ) + return errNo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int HsActivityDbClientPrivate::checkDataConstraint(int func, const QVariantHash &data) +{ + int retVal(KErrNone); + QStringList constraints; + switch(func) { + case AddActivity: + case UpdateActivity: + constraints << ActivityApplicationKeyword + << ActivityActivityKeyword + << ActivityScreenshotKeyword; + break; + + case ApplicationActivity: + case LaunchActivity: + case RemoveActivity: + constraints << ActivityApplicationKeyword + << ActivityActivityKeyword; + break; + + case WaitActivity: + case RemoveApplicationActivities: + constraints << ActivityApplicationKeyword; + break; + } + foreach (QString constraint, constraints) { + if (data.end() == data.find(constraint)) { + retVal = KErrCorrupt; + break; + } + } + return retVal; +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbclient/src/hsactivitydbclient.cpp --- a/activityfw/activitydatabase/hsactivitydbclient/src/hsactivitydbclient.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/hsactivitydbclient/src/hsactivitydbclient.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -57,7 +57,7 @@ { switch (requestType) { case WaitActivity: - if(KErrCancel != result) { + if (KErrCancel != result) { waitActivity(QVariantHash()); } if (KErrNone == result) { @@ -104,21 +104,25 @@ } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -int HsActivityDbClient::addActivity(const QVariantHash &activity) +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::addActivity(const QVariantHash&) + */ +int HsActivityDbClient::addActivity(const QVariantHash &privateData, + const QVariantHash &publicData) { - return d_ptr->addActivity(activity); + return d_ptr->addActivity(privateData, publicData); } // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -int HsActivityDbClient::updateActivity(const QVariantHash &activity) +/** + * Interface implementation. + * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash&) + */ +int HsActivityDbClient::updateActivity(const QVariantHash &privateData, + const QVariantHash &publicData) { - return d_ptr->updateActivity(activity); + return d_ptr->updateActivity(privateData, publicData); } // ----------------------------------------------------------------------------- @@ -162,6 +166,15 @@ // // ----------------------------------------------------------------------------- // +int HsActivityDbClient::activityData(QVariant &result, const QVariantHash &activity) +{ + return d_ptr->activityData(result, activity); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// int HsActivityDbClient::waitActivity(const QVariantHash &activity) { QVariantHash condition(activity); diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/group/hsactivitydbserver.mmp --- a/activityfw/activitydatabase/hsactivitydbserver/group/hsactivitydbserver.mmp Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/hsactivitydbserver/group/hsactivitydbserver.mmp Wed Jun 23 18:33:40 2010 +0300 @@ -23,19 +23,23 @@ USERINCLUDE ../inc USERINCLUDE ../../inc +USERINCLUDE ../../s60/inc USERINCLUDE ../../../../inc SOURCEPATH ../src SOURCE main.cpp -SOURCE activityserver.cpp -SOURCE activitysession.cpp -SOURCE activitystorage.cpp -SOURCE activitydataprovidertask.cpp -SOURCE activitybroadcasttask.cpp -SOURCE activitystoragesynctask.cpp -SOURCE activitystorageasynctask.cpp -SOURCE activityobservertask.cpp -SOURCE activitythumbnailtask.cpp +SOURCE afserver.cpp +SOURCE afsession.cpp +SOURCE afstorage.cpp +SOURCE afdataprovidertask.cpp +SOURCE afbroadcasttask.cpp +SOURCE afstoragesynctask.cpp +SOURCE afstorageasynctask.cpp +SOURCE afobservertask.cpp +SOURCE afthumbnailtask.cpp + +SOURCEPATH ../../s60/src +SOURCE afentry.cpp LIBRARY euser.lib LIBRARY estor.lib @@ -43,6 +47,7 @@ LIBRARY efsrv.lib LIBRARY bafl.lib LIBRARY fbscli.lib +LIBRARY hash.lib LIBRARY bitmaptransforms.lib LIBRARY imageconversion.lib LIBRARY tsutils.lib diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activitybroadcasttask.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitybroadcasttask.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYBROADCASTTASK_H -#define ACTIVITYBROADCASTTASK_H - -// INCLUDES -#include -#include - -#include "activitytaskstorage.h" -#include "activitytask.h" -// CLASS DECLARATION - -/** - * CActivityBroadcastTask - * - */ -class ActivityBroadcastTask -{ -public: - /** - * Handle broadccast message request - * @param storage - observer tasks storage - * @param msg - request message that will be provided to observers - */ - static void ExecuteL(MActivityTaskStorage& storage, const RMessage2& msg); -}; - -#endif // ACTIVITYBROADCASTTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activitydataprovidertask.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitydataprovidertask.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYDATAPROVIDERTASK_H -#define ACTIVITYDATAPROVIDERTASK_H - -// INCLUDES -#include -#include - -#include "activitytaskstorage.h" -#include "activitytask.h" - -/** - * CActivityDataProviderTask - * - */ -class ActivityDataProviderTask -{ -public: - /** - * Handle data request. Deliver data stored in other task. - * @param storage - data tasks storage - * @param msg - request message - */ - static void ExecuteL(MActivityTaskStorage& storage, const RMessage2& msg); - -private: - /** - * Write response data to request message - * @param msg - destination message - * @param src - data source - */ - static void ProvideDataL(const RMessage2& msg, const CActivityTask& src); - -}; - -#endif // ACTIVITYDATAPROVIDERTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activityobservertask.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activityobservertask.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYOBSERVERTASK_H -#define ACTIVITYOBSERVERTASK_H - -// INCLUDES -#include -#include - -#include "activitytask.h" -#include "activitytaskstorage.h" - -/** - * CActivityObserverTask - * - */ -class CActivityObserverTask : public CActivityTask -{ -public: - /** - * Destructor. - */ - ~CActivityObserverTask(); - - /** - * Handle observer request. - * @param globalStorage - global observers storage - * @param localStorage - local observers storage - * @param msg - request message - */ - static void ExecuteLD(MActivityTaskStorage& globalStorage, - MActivityTaskStorage& localStorage, - const RMessage2& msg); - - /** - * Interface implementation - * @see CActivityTask::Data() - */ - const TDesC8& Data() const; - - /** - * Interface implementation - * @see CActivityTask::BroadcastReceivedL(const RMessage2&) - */ - void BroadcastReceivedL(const RMessage2& ); - -private: - - /** - * Constructor for performing 1st stage construction - * @param globalStorage - global observers storage - * @param localStorage - local observers storage - * @param msg - request message - */ - CActivityObserverTask(MActivityTaskStorage& globalStorage, - MActivityTaskStorage& localStorage, - const RMessage2& msg); - - /** - * Write response data to requested message - */ - void WriteResponseL(); - - /** - * Returns ETrue if task is related with session argument - */ - TBool IsSessionTask(const CSession2* session); - -private: - MActivityTaskStorage& mGlobalStorage; - MActivityTaskStorage& mLocalStorage; - const RMessage2 mMsg; - RBuf8 mData; -}; - -#endif // ACTIVITYOBSERVERTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activityqueries.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activityqueries.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYQUERIES_H -#define ACTIVITYQUERIES_H - - -#include - -_LIT( KSelectRow, "SELECT * FROM Activities WHERE ApplicationId=%S AND ActivityName='%S'"); -_LIT( KSelectRows, "SELECT Data FROM Activities"); -_LIT( KSelectAppRows, "SELECT Data FROM Activities WHERE ApplicationId=%S"); -_LIT( KDeleteRow, "DELETE FROM Activities WHERE ApplicationId=%S AND ActivityName='%S'"); -_LIT( KDeleteRows, "DELETE FROM Activities WHERE ApplicationId=%S"); - -_LIT(KApplicationColumnName, "ApplicationId"); -_LIT(KActivityColumnName, "ActivityName"); -_LIT(KDataColumnName, "Data"); - -_LIT(KActivityTableName, "Activities"); -_LIT(KActivityIndexName, "ActivitiesKey"); -#endif // ACTIVITYQUERIES_H - diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activityserver.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activityserver.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYSERVER_H -#define ACTIVITYSERVER_H - -#define __E32SVR_H__ - -// INCLUDES -#include -#include -#include // RFs - -#include "activitytaskstorage.h" - -class CActivityStorage; -/** - * CActivityServer - * - */ -class CActivityServer : public CServer2, - public MActivityTaskStorage -{ -public: - /** - * Destructor. - */ - ~CActivityServer(); - - /** - * Two-phased constructor. - */ - static CActivityServer* NewLC(); - -public: - /** - * Interface implementation - * @see MActivityTaskStorage::PushL(CActivityTask *) - */ - void PushL(CActivityTask *); - - /** - * Interface implementation - * @see MActivityTaskStorage::Pop(CActivityTask *) - */ - void Pop(CActivityTask *); - - /** - * Interface implementation - * @see MActivityTaskStorage::StorageData() - */ - const RPointerArray& StorageData() const; - - -private: - - /** - * Constructor for performing 1st stage construction - */ - CActivityServer(); - - /** - * Default constructor for performing 2nd stage construction - */ - void ConstructL(); - - /** - * Interface implementation - * @see CServer2::NewSessionL(const TVersion&, const RMessage2&) - */ - CSession2* NewSessionL(const TVersion& version, const RMessage2& message) const; - - /** - * Removes not valid task - */ - void RemoveNotValidTasks(const CSession2* session); - -private: - RFs mFsSession; - CActivityStorage* mStorage; - RPointerArray mObservers; -}; - -#endif // ACTIVITYSERVER_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activitysession.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitysession.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYSESSION_H -#define ACTIVITYSESSION_H - -#ifndef __E32SVR_H__ -#define __E32SVR_H__ -#endif -// INCLUDES -#include -#include -#include - -#include "activitytaskstorage.h" - -class CActivityStorage; -/** - * CActivitySession - * - */ -class CActivitySession : public CSession2, - public MActivityTaskStorage -{ -public: - // Constructors and destructor - - /** - * Destructor. - */ - ~CActivitySession(); - - /** - * Two-phased constructor. - * @param fileSession - initialized file system session - * @param taskStorage - global observers storage - * @param storage - data storage - */ - static CActivitySession* NewL(RFs& fileSession, - MActivityTaskStorage& taskStorage, - CActivityStorage&storage); - -public: - /** - * Interface implementation - * @see MActivityTaskStorage::PushL(CActivityTask *) - */ - void PushL(CActivityTask *); - - /** - * Interface implementation - * @see MActivityTaskStorage::Pop(CActivityTask *) - */ - void Pop(CActivityTask *); - - /** - * Interface implementation - * @see MActivityTaskStorage::StorageData() - */ - const RPointerArray& StorageData() const; - - /** - * Removes not valid task - */ - void RemoveNotValidTasks(const CSession2* session); -private: - - /** - * Constructor for performing 1st stage construction - * @param fileSession - initialized file system session - * @param taskStorage - global observers storage - * @param storage - data storage - */ - CActivitySession(RFs& fileSession, - MActivityTaskStorage& taskStorage, - CActivityStorage& storage); - - /** - * EPOC default constructor for performing 2nd stage construction - */ - void ConstructL(); - -private: - /** - * Implements interface - * @see void CSession2::ServiceL(const RMessage2&) - */ - void ServiceL(const RMessage2& message); - -private: - RFs& mFileSession; - MActivityTaskStorage& mTasksStorage; - CActivityStorage& mStorage; - RPointerArray mRunningTasks; -}; - -#endif // ACTIVITYSESSION_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activitystorage.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitystorage.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,196 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYSTORAGE_H -#define ACTIVITYSTORAGE_H - -#define __E32SVR_H__ - -#include -#include -#include // RDbStoreDatabase -#include // CFileStore & CPermanentFileStore - -/** - * CActivityStorage - * - */ -class CActivityStorage : public CBase - { -public: - /** - * Destructor. - */ - ~CActivityStorage(); - - /** - * Two-phased constructor. - * @param session - initialized session to file system - */ - static CActivityStorage* NewL(RFs& session); - - /** - * Register new activity - * @param appId - application id - * @param actId - activity id - * @param data - activity data - */ - void AddActivityL(TInt appId,const TDesC8& actId, const TDesC8& data); - - /** - * Update activity - * @param appId - application id - * @param actId - activity id - * @param data - activity data - */ - void UpdateActivityL(TInt appId,const TDesC8& actId, const TDesC8& data); - - /** - * Delete activity - * @param appId - application id - * @param actId - activity id - */ - void DeleteActivityL(TInt appId,const TDesC8& actId); - - /** - * Delete activity - * @param appId - application id - */ - void DeleteActivitiesL(TInt appId); - - /** - * Serialize all activity into the buffer - * @param dst - destination buffer - */ - void ActivitiesL(RBuf8 &dst); - - /** - * Serialize application activity into the buffer - * @param dst - destination buffer - * @param appId - application id - */ - void ActivitiesL(RBuf8 &dst, TInt appId); - -private: - /** - * Constructor for performing 1st stage construction - * @param session - initialized session to file system - */ - CActivityStorage(RFs& session); - - /** - * EPOC default constructor for performing 2nd stage construction - */ - void ConstructL(); - - /** - * Create database and its structure - * @param databaseFile - database file path - */ - void CreateDbL(const TDesC& databaseFile); - - /** - * Open database - * @param databaseFile - database file path - */ - void OpenDbL(const TDesC& databaseFile); - - /** - * Create database structure - */ - void CreateTableL(); - - /** - * Serialize activity into buffer - * @param dst - destination buffer - */ - void GetActivitiesL(const TDesC& dst); - - /** - * Format query to select activity row - * @param appId - application id - * @param actId - activity id - * @return formated sql query - */ - HBufC* SelectRowLC(TInt appId, const TDesC8& actId) const; - - /** - * Format query to select activities for application - * @param appId - application id - * @return formated sql query - */ - HBufC* SelectRowsLC(TInt appId) const; - - /** - * Format query to delete activity - * @param appId - application id - * @param actId - activity id - * @return formated sql query - */ - HBufC* DeleteRowLC(TInt appId, const TDesC8& actId) const; - - /** - * Format query to delete activities for application - * @param appId - application id - * @return formated sql query - */ - HBufC* DeleteRowsLC(TInt appId) const; - - /** - * Format sql query - * @format - sql format string - * @param appId - application id - * @param actId - activity id - * @return formated sql query - */ - HBufC* BuildQueryLC(const TDesC& format, TInt appId, const TDesC8& actId) const; - - /** - * Count require buffer size to serialize activity query result - * @param data - sql query result - * @return reuired buffer size to seriazlie activity - */ - TInt DataSizeL(RDbRowSet& data)const; - - /** - * Serialize activity query result to preallocated buffer - * @param dst - preallocated buffer - * @param view - sql query result - */ - void ExternalizeL(TDes8& dst, RDbRowSet& view)const; - - /** - * Execute sql query and result serialize into buffer - * @param dst - destination result buffer - * @param query - sql activity query - */ - void ActivitiesL(RBuf8& dst, const TDesC& query); - - /** - * Get activity for update - * @param query - destination query result - * @param appId - application id - * @param actId - activity id - */ - void GetActivityForUpdateL(RDbView& query, TInt appId, const TDesC8& actId); - -private: - RFs& mFsSession; - RDbStoreDatabase mActDb;/* For database operations */ - CFileStore* mFileStore; /* For creating and opening database files */ -}; - -#endif // ACTIVITYSTORAGE_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activitystorageasynctask.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitystorageasynctask.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYSTORAGEASYNCTASK_H -#define ACTIVITYSTORAGEASYNCTASK_H - -// INCLUDES -#include -#include - -#include "activitytask.h" -#include "activitytaskstorage.h" -#include "activitystorage.h" - -/** - * CActivityStorageAsyncTask - * - */ -class CActivityStorageAsyncTask : public CActivityTask -{ -public: - // Constructors and destructor - - /** - * Destructor. - */ - ~CActivityStorageAsyncTask(); - - /** - * Handle asynchronous data storage requests - * @param taskStorage - data tasks storage - * @param dataStorage - data storage - * @param msg - request message - */ - static void ExecuteLD(MActivityTaskStorage& taskStorage, - CActivityStorage& dataStorage, - const RMessage2& msg); - - /** - * Interface implementation - * @see CActivityTask::Data() - */ - const TDesC8& Data() const; - - /** - * Interface implementation - * @see CActivityTask::BroadcastReceivedL(const RMessage2 &) - */ - void BroadcastReceivedL(const RMessage2 &); - -private: - - - /** - * Constructor for performing 1st stage construction - */ - CActivityStorageAsyncTask(); - - /** - * Handle asynchronous data storage requests - * @param dataStorage - data storage - * @param msg - request message - */ - void ExecuteL(CActivityStorage& dataStorage, const RMessage2& msg); - - /** - * Handle getting all activities request - * @param dataStorage - data storage - * @param msg - requested message - */ - void AllActivitiesL(CActivityStorage& dataStorage, const RMessage2& msg); - - /** - * Handle getting application activities request - * @param dataStorage - data storage - * @param msg - requested message - */ - void ApplicationActivitiesL(CActivityStorage& dataStorage, const RMessage2& msg); - - /** - * Write response data into request message - * @param msg - destination message - */ - void WriteResponseL(const RMessage2& msg); - - /** - * Returns ETrue if task is related with session argument - */ - TBool IsSessionTask(const CSession2* session); - -private: - RBuf8 mData; -}; - -#endif // ACTIVITYSTORAGEASYNCTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activitystoragesynctask.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitystoragesynctask.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYSTORAGESYNCTASK_H -#define ACTIVITYSTORAGESYNCTASK_H - -// INCLUDES -#include -#include - -#include "activitytask.h" -#include "activitystorage.h" -#include "activitytaskstorage.h" - -/** - * CActivityStorageSyncTask - * - */ -class ActivityStorageSyncTask - { -public: - /** - * Handle synchronous data storage requests - * @param dataStorage - data storage - * @param msg - request message - */ - static void ExecuteL(MActivityTaskStorage& observers, - CActivityStorage& dataStorage, - const RMessage2& msg); - -private: - /** - * Handle adding new activity. - * @param dataStorage - data storage - * @param msg - request message - */ - static void AddActivityL(CActivityStorage& dataStorage, - const RMessage2& msg); - - /** - * Handle updating existing activiy - * @param dataStorage - data storage - * @param msg - request message - */ - static void UpdateActivityL(CActivityStorage& dataStorage, - const RMessage2& msg); - - /** - * Handle removing activity. - * @param dataStorage - data storage - * @param msg - request message - */ - static void DeleteActivityL(CActivityStorage& dataStorage, - const RMessage2& msg); - - /** - * Handle removing all application activities. - * @param dataStorage - data storage - * @param msg - request message - */ - static void DeleteApplicationActivitiesL(CActivityStorage& dataStorage, - const RMessage2& msg); - - static void NotifyChangeL(MActivityTaskStorage& observers, - const RMessage2& msg); - - }; - -#endif // ACTIVITYSTORAGESYNCTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activitytask.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitytask.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYTASK_H -#define ACTIVITYTASK_H - -class CActivityTask: public CBase -{ -public: - /** - * Return task data - */ - virtual const TDesC8& Data() const =0; - - /** - * Notify instance about incoming broadcast message. - * @param msg - broadcast message - */ - virtual void BroadcastReceivedL(const RMessage2& msg) =0; - - /** - * Returns ETrue if task is related with session argument - */ - virtual TBool IsSessionTask(const CSession2* session) =0; -}; - -#endif //ACTIVITYTASK_H - diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activitytaskstorage.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitytaskstorage.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYTASKSTORAGE_H -#define ACTIVITYTASKSTORAGE_H -#include -class CActivityTask; -class MActivityTaskStorage -{ -public: - /** - * Register new task instance in storage. Ownership is transfered to storage. - * @param task - instance that need to be registered - */ - virtual void PushL(CActivityTask * task)=0; - - /** - * Unregister task instance from storage. Ownership is transfered to caller. - * @param task - instance that need to be unregistered - */ - virtual void Pop(CActivityTask *)=0; - - /** - * List of registered tasks - */ - virtual const RPointerArray& StorageData() const =0; - - /** - * Removes not valid task - */ - virtual void RemoveNotValidTasks(const CSession2* session) =0; -}; - -#endif //ACTIVITYTASKSTORAGE_H - diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/activitythumbnailtask.h --- a/activityfw/activitydatabase/hsactivitydbserver/inc/activitythumbnailtask.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef ACTIVITYTHUMBNAILTASK_H -#define ACTIVITYTHUMBNAILTASK_H - -#ifndef __E32SVR_H__ -#define __E32SVR_H__ -#endif - -#include -#include -#include - -#include "activitytask.h" -#include "activitytaskstorage.h" -#include "tsgraphicfilescalinghandler.h" - -class CFbsBitmap; - -/** - * CActivityThumbnailTask - * - */ -class CActivityThumbnailTask : public CActivityTask, - public MImageReadyCallBack - { -public: - /** - * Destructor. - */ - ~CActivityThumbnailTask(); - - static void ExecuteLD(RFs& session, - MActivityTaskStorage& taskStorage, - const RMessage2& message); - -private: - /** - * Constructor for performing 1st stage construction - */ - CActivityThumbnailTask(MActivityTaskStorage& storage, const RMessage2 msg); - - /** - * EPOC default constructor for performing 2nd stage construction - */ - void ConstructL(RFs& session); - - /** - * - */ - void ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap ); - - const TDesC8& Data()const; - - void BroadcastReceivedL(const RMessage2& ); - - /** - * Returns ETrue if task is related with session argument - */ - TBool IsSessionTask(const CSession2* session); - -private: - MActivityTaskStorage& mStorage; - const RMessage2 mMsg; - CBase* mService; - }; - -#endif // ACTIVITYTHUMBNAILTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/afbroadcasttask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/afbroadcasttask.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef AFBROADCASTTASK_H +#define AFBROADCASTTASK_H + +// INCLUDES +#include +#include + +#include "aftaskstorage.h" +#include "aftask.h" + +class AfBroadcastTask +{ +public: + static void ExecuteL(MAfTaskStorage& storage, const RMessage2& msg); +}; + +#endif // AFBROADCASTTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/afdataprovidertask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/afdataprovidertask.h Wed Jun 23 18:33:40 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 AFDATAPROVIDERTASK_H +#define AFDATAPROVIDERTASK_H + +// INCLUDES +#include +#include + +#include "aftaskstorage.h" +#include "aftask.h" + +class AfDataProviderTask +{ +public: + static void ExecuteL(MAfTaskStorage& storage, const RMessage2& msg); + +private: + static void ProvideDataL(const RMessage2& msg, const CAfTask& src); + +}; + +#endif // AFDATAPROVIDERTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/afobservertask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/afobservertask.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef AFOBSERVERTASK_H +#define AFOBSERVERTASK_H + +// INCLUDES +#include +#include + +#include "aftask.h" +#include "aftaskstorage.h" + +class CAfObserverTask : public CAfTask +{ +public: + ~CAfObserverTask(); + + static void ExecuteLD(MAfTaskStorage& globalStorage, + MAfTaskStorage& localStorage, + const RMessage2& msg); + + const TDesC8& Data() const; + + void BroadcastReceivedL(const RMessage2& ); + +private: + CAfObserverTask(MAfTaskStorage& globalStorage, + MAfTaskStorage& localStorage, + const RMessage2& msg); + + void WriteResponseL(); + + TBool IsSessionTask(const CSession2* session); + +private: + MAfTaskStorage& mGlobalStorage; + MAfTaskStorage& mLocalStorage; + const RMessage2 mMsg; + RBuf8 mData; +}; + +#endif // AFOBSERVERTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/afqueries.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/afqueries.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef AFQUERIES_H +#define AFQUERIES_H + + +#include + +_LIT( KSelectRow, "SELECT * FROM Activities WHERE ApplicationId=%S AND ActivityName='%S'"); +_LIT( KSelectRows, "SELECT * FROM Activities"); +_LIT( KSelectAppRows, "SELECT * FROM Activities WHERE ApplicationId=%S"); +_LIT( KDeleteRow, "DELETE FROM Activities WHERE ApplicationId=%S AND ActivityName='%S'"); +_LIT( KDeleteRows, "DELETE FROM Activities WHERE ApplicationId=%S"); +_LIT( KDeleteNonPersistentActivities, "DELETE FROM Activities WHERE Flags<%S"); + +_LIT(KApplicationColumnName, "ApplicationId"); +_LIT(KActivityColumnName, "ActivityName"); +_LIT(KFlagsColumnName, "Flags"); +_LIT(KDataColumnName, "Data"); + +_LIT(KActivityTableName, "Activities"); +_LIT(KActivityIndexName, "ActivitiesKey"); +#endif // AFQUERIES_H + diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/afserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/afserver.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef AFSERVER_H +#define AFSERVER_H + +#define __E32SVR_H__ + +// INCLUDES +#include +#include +#include // RFs + +#include "aftaskstorage.h" + +class CAfStorage; + +class CAfServer : public CServer2, + public MAfTaskStorage +{ +public: + ~CAfServer(); + + static CAfServer* NewLC(); + +public: + void PushL(CAfTask *); + + void Pop(CAfTask *); + + const RPointerArray& StorageData() const; + + +private: + CAfServer(); + + void ConstructL(); + + CSession2* NewSessionL(const TVersion& version, const RMessage2& message) const; + + void RemoveNotValidTasks(const CSession2* session); + +private: + RFs mFsSession; + CAfStorage* mStorage; + RPointerArray mObservers; +}; + +#endif // AFSERVER_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/afsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/afsession.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,68 @@ +/* +* 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 AFSESSION_H +#define AFSESSION_H + +#ifndef __E32SVR_H__ +#define __E32SVR_H__ +#endif +// INCLUDES +#include +#include +#include + +#include "aftaskstorage.h" + +class CAfStorage; + +class CAfSession : public CSession2, + public MAfTaskStorage +{ +public: + ~CAfSession(); + + static CAfSession* NewL(RFs& fileSession, + MAfTaskStorage& taskStorage, + CAfStorage&storage); + +public: + void PushL(CAfTask *); + + void Pop(CAfTask *); + + const RPointerArray& StorageData() const; + + void RemoveNotValidTasks(const CSession2* session); + +private: + CAfSession(RFs& fileSession, + MAfTaskStorage& taskStorage, + CAfStorage& storage); + + void ConstructL(); + +private: + void ServiceL(const RMessage2& message); + +private: + RFs& mFileSession; + MAfTaskStorage& mTasksStorage; + CAfStorage& mStorage; + RPointerArray mRunningTasks; +}; + +#endif // AFSESSION_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/afstorage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/afstorage.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef AFSTORAGE_H +#define AFSTORAGE_H + +#define __E32SVR_H__ + +#include +#include +#include // RDbStoreDatabase +#include // CFileStore & CPermanentFileStore +#include "afentry.h" + +class CAfStorage : public CBase + { +public: + ~CAfStorage(); + + static CAfStorage* NewL(RFs& session); + + void AddActivityL(CAfEntry &entry); + + void UpdateActivityL(CAfEntry &entry); + + void DeleteActivityL(CAfEntry &entry); + + void DeleteActivitiesL(CAfEntry &entry); + + void ActivitiesL(RPointerArray &dst); + + void ActivitiesL(RPointerArray &dst, TInt appId); + + void ActivityL(CAfEntry *&dst, CAfEntry &src); + + RFs& Fs(); + +private: + CAfStorage(RFs& session); + + void ConstructL(); + + void CreateDbL(const TDesC& databaseFile); + + void OpenDbL(const TDesC& databaseFile); + + void CreateTableL(); + + void DeleteNonPersistentActivitiesL(); + + void GetActivitiesL(const TDesC& dst); + + HBufC* SelectRowLC(TInt appId, const TDesC& actId) const; + + HBufC* SelectRowsLC(TInt appId) const; + + HBufC* DeleteRowLC(TInt appId, const TDesC& actId) const; + + HBufC* DeleteRowsLC(TInt appId) const; + + HBufC* BuildQueryLC(const TDesC& format, TInt appId, const TDesC& actId) const; + + void ActivitiesL(RPointerArray& dst, + const TDesC& query, + CAfEntry::AccessRights rights, + TInt limit = 0); + + void ActivitiesL(RPointerArray& dst, + RDbView& query, + CAfEntry::AccessRights rights, + TInt limit = 0); + + void GetActivityForUpdateL(RDbView& query, TInt appId, const TDesC& actId); + + void ReadDataL(RBuf& dst, RDbRowSet& src, TInt offset) const; + + void ExternalizeDataL(RDbRowSet &dst,const CAfEntry & src, TInt offset) const; + + void InternalizeDataL(CAfEntry &dst, RDbRowSet& src, TInt offset) const; + +private: + RFs& mFsSession; + RDbStoreDatabase mActDb;/* For database operations */ + CFileStore* mFileStore; /* For creating and opening database files */ +}; + +#endif //AFSTORAGE_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/afstorageasynctask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/afstorageasynctask.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,65 @@ +/* +* 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 AFSTORAGEASYNCTASK_H +#define AFSTORAGEASYNCTASK_H + +// INCLUDES +#include +#include + +#include "aftask.h" +#include "aftaskstorage.h" +#include "afstorage.h" + +class CAfStorageAsyncTask : public CAfTask +{ +public: + ~CAfStorageAsyncTask(); + + static void ExecuteLD(MAfTaskStorage& taskStorage, + CAfStorage& dataStorage, + const RMessage2& msg); + + const TDesC8& Data() const; + + void BroadcastReceivedL(const RMessage2 &); + +private: + CAfStorageAsyncTask(); + + void ExecuteL(CAfStorage& dataStorage, const RMessage2& msg); + + void AllActivitiesL(CAfStorage& dataStorage, const RMessage2& msg); + + void ApplicationActivitiesL(CAfStorage& dataStorage, const RMessage2& msg); + + void ApplicationActivityL(CAfStorage& dataStorage, const RMessage2& msg); + + void WriteResponseL(const RMessage2& msg); + + TBool IsSessionTask(const CSession2* session); + + void ExternalizeL(); + + void ExternalizeL(const CAfEntry &entry); + +private: + RBuf8 mExternalizedData; + RPointerArray mInternalizedData; +}; + +#endif // AFSTORAGEASYNCTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/afstoragesynctask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/afstoragesynctask.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef AFSTORAGESYNCTASK_H +#define AFSTORAGESYNCTASK_H + +// INCLUDES +#include +#include + +#include "aftask.h" +#include "afstorage.h" +#include "aftaskstorage.h" + +class CAfEntry; +/** + * CActivityStorageSyncTask + * + */ +class AfStorageSyncTask + { +public: + static void ExecuteL(MAfTaskStorage& observers, + CAfStorage& dataStorage, + const RMessage2& msg); + +private: + static void AddActivityL(CAfStorage& dataStorage, + const RMessage2& msg); + + static void UpdateActivityL(CAfStorage& dataStorage, + const RMessage2& msg); + + static void DeleteActivityL(CAfStorage& dataStorage, + const RMessage2& msg); + + static void DeleteApplicationActivitiesL(CAfStorage& dataStorage, + const RMessage2& msg); + + static void NotifyChangeL(MAfTaskStorage& observers, + const RMessage2& msg); + + static void ReadEntryL(CAfEntry& entry, const RMessage2& msg); + + static void CreateThumbnailL(const TDesC &path, TInt hdl); + + static void ThumbnailPathL(RBuf &dst, + RFs& fileSystem, + TInt uid, + const TDesC &activityName); + + static HBufC8* Md5HexDigestL(const TDes8 &string); + + }; + +#endif // AFSTORAGESYNCTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/aftask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/aftask.h Wed Jun 23 18:33:40 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 AFTASK_H +#define AFTASK_H + +#include + +class CAfTask: public CBase +{ +public: + /** + * Return task data + */ + virtual const TDesC8& Data() const =0; + + /** + * Notify instance about incoming broadcast message. + * @param msg - broadcast message + */ + virtual void BroadcastReceivedL(const RMessage2& msg) =0; + + /** + * Returns ETrue if task is related with session argument + */ + virtual TBool IsSessionTask(const CSession2* session) =0; +}; + +#endif //AFTASK_H + diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/aftaskstorage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/aftaskstorage.h Wed Jun 23 18:33:40 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 AFTASKSTORAGE_H +#define AFTASKSTORAGE_H +#include +class CAfTask; +class MAfTaskStorage +{ +public: + /** + * Register new task instance in storage. Ownership is transfered to storage. + * @param task - instance that need to be registered + */ + virtual void PushL(CAfTask * task)=0; + + /** + * Unregister task instance from storage. Ownership is transfered to caller. + * @param task - instance that need to be unregistered + */ + virtual void Pop(CAfTask *)=0; + + /** + * List of registered tasks + */ + virtual const RPointerArray& StorageData() const =0; + + /** + * Removes not valid task + */ + virtual void RemoveNotValidTasks(const CSession2* session) =0; +}; + +#endif //AFTASKSTORAGE_H + diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/inc/afthumbnailtask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/inc/afthumbnailtask.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef AFTHUMBNAILTASK_H +#define AFTHUMBNAILTASK_H + +#ifndef __E32SVR_H__ +#define __E32SVR_H__ +#endif + +#include +#include +#include + +#include "aftask.h" +#include "aftaskstorage.h" +#include "tsgraphicfilescalinghandler.h" + +class CFbsBitmap; + +class CAfThumbnailTask : public CAfTask, + public MImageReadyCallBack +{ +public: + ~CAfThumbnailTask(); + + static void ExecuteLD(MAfTaskStorage& taskStorage, + const RMessage2& message); + +private: + CAfThumbnailTask(MAfTaskStorage& storage, const RMessage2 msg); + + void ConstructL(); + + void ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap ); + + const TDesC8& Data()const; + + void BroadcastReceivedL(const RMessage2& ); + + TBool IsSessionTask(const CSession2* session); + +private: + MAfTaskStorage& mStorage; + const RMessage2 mMsg; + CBase* mService; +}; + +#endif // AFTHUMBNAILTASK_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/activitybroadcasttask.cpp --- a/activityfw/activitydatabase/hsactivitydbserver/src/activitybroadcasttask.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "activitybroadcasttask.h" - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void ActivityBroadcastTask::ExecuteL(MActivityTaskStorage& storage, - const RMessage2& msg) -{ - const RPointerArray &tasks(storage.StorageData()); - for (TInt iter(tasks.Count() - 1); iter >= 0 ; --iter ) { - (tasks[iter])->BroadcastReceivedL(msg); - } - if(EFalse == msg.IsNull()) { - msg.Complete(KErrNone); - } -} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/activitydataprovidertask.cpp --- a/activityfw/activitydatabase/hsactivitydbserver/src/activitydataprovidertask.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "activitydataprovidertask.h" -#include "activitycmd.h" - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void ActivityDataProviderTask::ExecuteL(MActivityTaskStorage& storage, - const RMessage2& msg) -{ - TPckgBuf requestId; - CActivityTask* taskPtr(0); - msg.Read(KRequestIdOffset, requestId); - - for (TInt iter(0);iter observerdId; - mMsg.ReadL(KRequestAppIdOffset, observerdId); - - TPckgBuf requestedId; - msg.ReadL(KRequestAppIdOffset, requestedId); - if (observerdId() == requestedId()) { - if (msg.GetDesLength(KRequestActOffset) > mData.MaxLength()) { - mData.ReAllocL(msg.GetDesLength(1)); - } - msg.ReadL(KRequestActOffset, mData, 0); - WriteResponseL(); - mLocalStorage.PushL(this); - mGlobalStorage.Pop(this); - mMsg.Complete(KErrNone); - } - } else if (WaitActivity == mMsg.Function() && - CancelWait == msg.Function() && - mMsg.Session() == msg.Session()) { - mGlobalStorage.Pop(this); - mMsg.Complete(KErrCancel); - delete this; - } else if (NotifyChange == mMsg.Function() && - CancelNotify == msg.Function() && - mMsg.Session() == msg.Session()) { - mGlobalStorage.Pop(this); - mMsg.Complete(KErrCancel); - delete this; - } else if(NotifyChange == mMsg.Function() && - (AddActivity == msg.Function() || - UpdateActivity == msg.Function() || - RemoveActivity == msg.Function() || - RemoveApplicationActivities == msg.Function())){ - mMsg.Complete(KErrNone); - mGlobalStorage.Pop(this); - delete this; - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityObserverTask::WriteResponseL() -{ - mMsg.WriteL(KResponseDataSizeOffset, TPckgBuf(mData.Length()));//write data size - mMsg.WriteL(KResponseIdOffset, TPckgBuf(this));//task identyfier -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CActivityObserverTask::IsSessionTask(const CSession2* session) -{ - return mMsg.Session() == session ? ETrue : EFalse; -} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/activityserver.cpp --- a/activityfw/activitydatabase/hsactivitydbserver/src/activityserver.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "activityserver.h" -#include "activitysession.h" -#include "activitystorage.h" -#include "activitytask.h" - -#include - -_LIT( KActivityServerName, "hsactivitydbserver" ); -_LIT(KObserverAlreadyExists, "Observer task exists"); - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivityServer::CActivityServer() -: -CServer2( EPriorityStandard ) -{ - // No implementation required -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivityServer::~CActivityServer() -{ - delete mStorage; - mFsSession.Close(); - mObservers.ResetAndDestroy(); - RFbsSession::Disconnect(); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivityServer* CActivityServer::NewLC() -{ - CActivityServer* self = new (ELeave) CActivityServer(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityServer::ConstructL() -{ - StartL(KActivityServerName); - User::LeaveIfError(mFsSession.Connect()); - User::LeaveIfError(RFbsSession::Connect(mFsSession)); - mStorage = CActivityStorage::NewL(mFsSession); - mObservers.Array(); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CSession2* CActivityServer::NewSessionL(const TVersion &, const RMessage2&) const -{ - return CActivitySession::NewL(const_cast(this)->mFsSession, - *const_cast(this), - *mStorage); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityServer::PushL(CActivityTask * task) -{ - (KErrNotFound == mObservers.Find(task)) ? - mObservers.AppendL(task) : - User::Panic(KObserverAlreadyExists, KErrAlreadyExists); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityServer::Pop(CActivityTask *task) -{ - const TInt offset(mObservers.Find(task)); - if (KErrNotFound != offset) { - mObservers.Remove(offset); - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const RPointerArray& CActivityServer::StorageData() const -{ - return mObservers; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityServer::RemoveNotValidTasks(const CSession2* session) -{ - for (TInt i=mObservers.Count()-1; i>=0; --i) { - if( mObservers[i]->IsSessionTask(session) ) { - delete mObservers[i]; - mObservers.Remove(i); - } - } -} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/activitysession.cpp --- a/activityfw/activitydatabase/hsactivitydbserver/src/activitysession.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "activitysession.h" -#include "activitytask.h" -#include "activitycmd.h" - -#include "activitystorageasynctask.h" -#include "activitystoragesynctask.h" -#include "activityobservertask.h" -#include "activitybroadcasttask.h" -#include "activitydataprovidertask.h" -#include "activitythumbnailtask.h" - -_LIT(KTaskAlreadyExists, "Activity task exists"); - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivitySession::CActivitySession(RFs& fileSession, - MActivityTaskStorage& taskStorage, - CActivityStorage& storage) -: -mFileSession(fileSession), -mTasksStorage(taskStorage), -mStorage(storage) -{ - // No implementation required -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivitySession::~CActivitySession() -{ - RemoveNotValidTasks(this); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivitySession* CActivitySession::NewL(RFs& fileSession, - MActivityTaskStorage& taskStorage, - CActivityStorage& storage) -{ - CActivitySession* self = new (ELeave) CActivitySession(fileSession, - taskStorage, - storage); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivitySession::ConstructL() -{ -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivitySession::ServiceL(const RMessage2& message) -{ - switch (message.Function()) { - case AddActivity: - case UpdateActivity: - case RemoveActivity: - case RemoveApplicationActivities: - ActivityStorageSyncTask::ExecuteL(mTasksStorage, mStorage, message); - break; - - case Activities: - case ApplicationActivities: - CActivityStorageAsyncTask::ExecuteLD(*this, mStorage, message); - break; - - case WaitActivity: - case NotifyChange: - CActivityObserverTask::ExecuteLD(mTasksStorage, *this, message); - break; - case GetThumbnail: - CActivityThumbnailTask::ExecuteLD(mFileSession, *this, message); - break; - - case LaunchActivity: - case CancelWait: - case CancelNotify: - ActivityBroadcastTask::ExecuteL(mTasksStorage, message); - break; - - case GetData: - ActivityDataProviderTask::ExecuteL(*this,message); - break; - - default: - message.Complete(CServer2::EBadMessageNumber); - break; - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivitySession::PushL(CActivityTask * task) -{ - (KErrNotFound == mRunningTasks.Find(task)) ? - mRunningTasks.AppendL(task) : - User::Panic(KTaskAlreadyExists, KErrAlreadyExists); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivitySession::Pop(CActivityTask *task) -{ - const TInt offset(mRunningTasks.Find(task)); - if (KErrNotFound != offset) { - mRunningTasks.Remove(offset); - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const RPointerArray& CActivitySession::StorageData() const -{ - return mRunningTasks; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivitySession::RemoveNotValidTasks(const CSession2* session) -{ - mRunningTasks.ResetAndDestroy(); - mTasksStorage.RemoveNotValidTasks(this); -} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/activitystorage.cpp --- a/activityfw/activitydatabase/hsactivitydbserver/src/activitystorage.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,399 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "activitystorage.h" -#include "activityqueries.h" -#include -#include - -_LIT(KDbName, "activity.db"); -_LIT(KDbDrive, "c:"); -const TInt KMaxPathLength = 256; - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivityStorage::CActivityStorage(RFs& session) -: -mFsSession(session) -{ - // No implementation required -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivityStorage::~CActivityStorage() -{ -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivityStorage* CActivityStorage::NewL(RFs& session) -{ - CActivityStorage* self = new (ELeave) CActivityStorage(session); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); // self; - return self; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::ConstructL() -{ - RBuf path; - CleanupClosePushL( path ); - path.CreateL(KMaxPathLength); - User::LeaveIfError(mFsSession.PrivatePath(path )); - path.Append(KDbName); - path.Insert(0, KDbDrive); - BaflUtils::EnsurePathExistsL(mFsSession, path); - BaflUtils::FileExists(mFsSession, path) ? OpenDbL(path) : CreateDbL(path); - CleanupStack::PopAndDestroy(&path); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::CreateDbL(const TDesC& databaseFile) -{ - mFileStore = CPermanentFileStore::ReplaceL(mFsSession, - databaseFile, - EFileRead|EFileWrite); - mFileStore->SetTypeL(mFileStore->Layout());// Set file store type - TStreamId id = mActDb.CreateL(mFileStore);// Create stream object - mFileStore->SetRootL(id);// Keep database id as root of store - mFileStore->CommitL();// Complete creation by commiting - CreateTableL(); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::OpenDbL(const TDesC& databaseFile) -{ - mFileStore = CPermanentFileStore::OpenL(mFsSession, - databaseFile, - EFileRead|EFileWrite); - mFileStore->SetTypeL(mFileStore->Layout()); /* Set file store type*/ - mActDb.OpenL(mFileStore,mFileStore->Root()); - CDbTableNames* tables = mActDb.TableNamesL(); - CleanupStack::PushL(tables); - if (0 == tables->Count()) { - CreateTableL(); - } - CleanupStack::PopAndDestroy(tables); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::CreateTableL() -{ - // Add the columns to column set - CDbColSet* actColSet = CDbColSet::NewLC(); - - TDbCol appName(KApplicationColumnName, EDbColInt64);// Using default length - appName.iAttributes = TDbCol::ENotNull; - actColSet->AddL(appName); - - TDbCol actName(KActivityColumnName, EDbColText8);// Using default length - actName.iAttributes = TDbCol::ENotNull; - actColSet->AddL(actName); - - actColSet->AddL(TDbCol(KDataColumnName, EDbColLongText8));// Stream Data - - // Add the columns to index definition - CDbKey* primaryKey = CDbKey::NewLC(); - primaryKey->AddL(TDbKeyCol(KApplicationColumnName)); - primaryKey->AddL(TDbKeyCol(KActivityColumnName)); - primaryKey->MakePrimary(); - - // Create the table - /*User::LeaveIfError(mActDb.CreateTable(KActivityTableName, - *actColSet, - *primaryKey));*/ - User::LeaveIfError(mActDb.CreateTable(KActivityTableName, - *actColSet)); - /*User::LeaveIfError(mActDb.CreateIndex(KActivityIndexName, - KActivityTableName, - *primaryKey));*/ - CleanupStack::PopAndDestroy(primaryKey); - CleanupStack::PopAndDestroy(actColSet); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::AddActivityL(TInt appId, - const TDesC8& actId, - const TDesC8& data) -{ - //verify if row already exists - RDbView view; - CleanupClosePushL(view); - TRAPD( errNo, GetActivityForUpdateL(view, appId, actId)); - if (KErrNone == errNo) { - User::Leave(KErrAlreadyExists); - } - CleanupStack::PopAndDestroy(&view); - - //write table - RDbTable table; - CleanupClosePushL(table); - User::LeaveIfError(table.Open(mActDb, KActivityTableName, table.EUpdatable)); - CDbColSet *row = table.ColSetL(); - CleanupStack::PushL(row); - - table.InsertL(); - table.SetColL(row->ColNo(KApplicationColumnName), TInt64(appId)); - table.SetColL(row->ColNo(KActivityColumnName), actId); - - //write blob data - RDbColWriteStream stream; - CleanupClosePushL(stream); - stream.OpenL(table, row->ColNo(KDataColumnName)); - stream.WriteL(data); - CleanupStack::PopAndDestroy(&stream); - - table.PutL(); - CleanupStack::PopAndDestroy(row); - CleanupStack::PopAndDestroy(&table); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::UpdateActivityL(TInt appId, - const TDesC8& actId, - const TDesC8& data) -{ - RDbView view; - CleanupClosePushL(view); - GetActivityForUpdateL(view, appId, actId); - view.UpdateL(); - CDbColSet* colSet = view.ColSetL(); - CleanupStack::PushL(colSet); - RDbColWriteStream writeStream; - CleanupClosePushL(writeStream); - writeStream.OpenL(view, colSet->ColNo(KDataColumnName)); - writeStream.WriteL(data); - CleanupStack::PopAndDestroy(&writeStream); - view.PutL(); - CleanupStack::PopAndDestroy(colSet); - CleanupStack::PopAndDestroy(&view); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::DeleteActivityL(TInt appId,const TDesC8& actId) -{ - HBufC *query(DeleteRowLC(appId, actId)); - User::LeaveIfError(mActDb.Execute(*query)); - CleanupStack::PopAndDestroy(query); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::DeleteActivitiesL(TInt appId) -{ - HBufC *query(DeleteRowsLC(appId)); - User::LeaveIfError(mActDb.Execute(*query)); - CleanupStack::PopAndDestroy(query); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::ActivitiesL(RBuf8 &dst) -{ - ActivitiesL(dst, KSelectRows() ); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::ActivitiesL(RBuf8 &dst,TInt appId) -{ - HBufC *query(SelectRowsLC(appId)); - ActivitiesL(dst, *query); - CleanupStack::PopAndDestroy(query); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -HBufC* CActivityStorage::SelectRowLC(TInt appId, const TDesC8& actId) const -{ - return BuildQueryLC(KSelectRow(),appId, actId); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -HBufC* CActivityStorage::SelectRowsLC(TInt appId) const -{ - return BuildQueryLC(KSelectAppRows(), appId, KNullDesC8); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -HBufC* CActivityStorage::DeleteRowLC(TInt appId, const TDesC8& actId) const -{ - return BuildQueryLC(KDeleteRow(),appId, actId); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -HBufC* CActivityStorage::DeleteRowsLC(TInt appId) const -{ - return BuildQueryLC(KDeleteRows(),appId, KNullDesC8); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -HBufC* CActivityStorage::BuildQueryLC(const TDesC& format, - TInt appId, - const TDesC8& actId) const -{ - TBuf<16> appName; - appName.AppendNum(appId); - RBuf actName; - CleanupClosePushL(actName); - actName.CreateL(actId.Length()); - actName.Copy(actId); - HBufC* query = HBufC::NewL(format.Length() + - appName.Length() + - actName.Length() ); - query->Des().AppendFormat(format, &appName, &actName); - CleanupStack::PopAndDestroy(&actName); - CleanupStack::PushL(query); - return query; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CActivityStorage::DataSizeL(RDbRowSet& data)const -{ - TInt dataSize(sizeof(TInt)); - CDbColSet* row = data.ColSetL(); - CleanupStack::PushL(row); - const TInt dataOffset(row->ColNo(KDataColumnName)); - for (data.FirstL(); data.AtRow(); data.NextL()) { - data.GetL(); - dataSize += (sizeof(TInt) + - data.ColLength(dataOffset)); - } - CleanupStack::PopAndDestroy(row); - return dataSize; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::ExternalizeL(TDes8& dst, RDbRowSet& src)const -{ - RDesWriteStream dstStream(dst); - CleanupClosePushL(dstStream); - dstStream.WriteInt32L(src.CountL()); - RBuf8 data; - CleanupClosePushL(data); - CDbColSet* row = src.ColSetL(); - CleanupStack::PushL(row); - const TInt dataOffset(row->ColNo(KDataColumnName)); - RDbColReadStream srcStream; - CleanupClosePushL(srcStream); - for (src.FirstL(); src.AtRow(); src.NextL()) { - src.GetL(); - if (data.MaxLength() < src.ColLength(dataOffset)) { - data.ReAllocL(src.ColLength(dataOffset)); - } - data.SetLength(0); - srcStream.OpenL(src,dataOffset); - srcStream.ReadL(data, src.ColLength(dataOffset)); - srcStream.Close(); - dstStream.WriteInt32L(src.ColLength(dataOffset)); - if (0 < src.ColLength(dataOffset)) { - dstStream.WriteL(data, src.ColLength(dataOffset)); - } - } - CleanupStack::PopAndDestroy(&srcStream); - CleanupStack::PopAndDestroy(row); - CleanupStack::PopAndDestroy(&data); - CleanupStack::PopAndDestroy(&dstStream); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::ActivitiesL(RBuf8& dst, const TDesC& query) -{ - RDbView view;// Create a view on the database - CleanupClosePushL(view); - User::LeaveIfError(view.Prepare(mActDb, TDbQuery(query), view.EReadOnly)); - User::LeaveIfError(view.EvaluateAll()); - const TInt dataSize(DataSizeL(view)); - if(dst.MaxLength() < dataSize) { - dst.ReAllocL(dataSize); - } - ExternalizeL(dst, view); - CleanupStack::PopAndDestroy(&view); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorage::GetActivityForUpdateL(RDbView& view, TInt appId, const TDesC8& actId) -{ - HBufC* query(SelectRowLC(appId, actId)); - User::LeaveIfError(view.Prepare(mActDb, TDbQuery(*query), view.EUpdatable)); - CleanupStack::PopAndDestroy(query); - User::LeaveIfError(view.EvaluateAll()); - if (!view.FirstL()) { - User::Leave(KErrNotFound); - } -} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/activitystorageasynctask.cpp --- a/activityfw/activitydatabase/hsactivitydbserver/src/activitystorageasynctask.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "activitystorageasynctask.h" -#include "activitycmd.h" - -_LIT(KUnsupportedStorageAsyncTask, "Unsupported async storage task"); - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivityStorageAsyncTask::CActivityStorageAsyncTask() -{ - // No implementation required -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivityStorageAsyncTask::~CActivityStorageAsyncTask() -{ - mData.Close(); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorageAsyncTask::ExecuteLD(MActivityTaskStorage& taskStorage, - CActivityStorage& dataStorage, - const RMessage2& msg) -{ - CActivityStorageAsyncTask* self = new (ELeave) CActivityStorageAsyncTask(); - CleanupStack::PushL(self); - self->ExecuteL(dataStorage, msg); - taskStorage.PushL(self); - CleanupStack::Pop(self); - msg.Complete(KErrNone); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TDesC8& CActivityStorageAsyncTask::CActivityStorageAsyncTask::Data() const -{ - return mData; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorageAsyncTask::BroadcastReceivedL(const RMessage2& ) -{ - // No implementation required -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorageAsyncTask::ExecuteL(CActivityStorage& dataStorage, - const RMessage2& msg) -{ - switch (msg.Function()) { - case Activities: - AllActivitiesL(dataStorage, msg); - break; - case ApplicationActivities: - ApplicationActivitiesL(dataStorage, msg); - break; - default: - //this code shouldn't be called. fatal error: means wrong session implementation - User::Panic(KUnsupportedStorageAsyncTask, KErrGeneral); - }; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorageAsyncTask::AllActivitiesL(CActivityStorage& dataStorage, - const RMessage2& msg) -{ - dataStorage.ActivitiesL(mData); - WriteResponseL(msg); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorageAsyncTask::ApplicationActivitiesL(CActivityStorage& dataStorage, - const RMessage2& msg) -{ - TPckgBuf appId; - msg.ReadL(KRequestAppIdOffset, appId); - dataStorage.ActivitiesL(mData, appId()); - WriteResponseL(msg); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityStorageAsyncTask::WriteResponseL(const RMessage2& msg) -{ - if (EFalse == msg.IsNull()) { - msg.WriteL(KResponseDataSizeOffset, - TPckgBuf(mData.Length()));//write data size - msg.WriteL(KResponseIdOffset, - TPckgBuf(this));//task identyfier - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CActivityStorageAsyncTask::IsSessionTask(const CSession2* /*session*/) -{ - return EFalse; -} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/activitystoragesynctask.cpp --- a/activityfw/activitydatabase/hsactivitydbserver/src/activitystoragesynctask.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "activitystoragesynctask.h" -#include "activitycmd.h" - -_LIT(KUnsupportedStorageSyncTask, "Unsupported sync storage task"); - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void ActivityStorageSyncTask::ExecuteL(MActivityTaskStorage& observers, - CActivityStorage& dataStorage, - const RMessage2& msg) -{ - switch (msg.Function()) { - case AddActivity: - AddActivityL(dataStorage, msg); - break; - case UpdateActivity: - UpdateActivityL(dataStorage, msg); - break; - case RemoveActivity: - DeleteActivityL(dataStorage, msg); - break; - case RemoveApplicationActivities: - DeleteApplicationActivitiesL(dataStorage, msg); - break; - default: - //this code shouldn't be called. fatal error: means wrong session implementation - User::Panic(KUnsupportedStorageSyncTask, KErrGeneral); - }; - msg.Complete(KErrNone); - NotifyChangeL(observers, msg); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void ActivityStorageSyncTask::AddActivityL(CActivityStorage& dataStorage, const RMessage2& msg) -{ - TPckgBuf appId; - msg.ReadL(KRequestAppIdOffset, appId); - - RBuf8 actId; - CleanupClosePushL(actId); - actId.CreateL(msg.GetDesLengthL(KRequestActOffset)); - msg.ReadL(KRequestActOffset, actId, 0); - - RBuf8 data; - CleanupClosePushL(data); - data.CreateL(msg.GetDesLengthL(KRequestData)); - msg.ReadL(KRequestData, data, 0); - - dataStorage.AddActivityL(appId(), actId, data); - - CleanupStack::PopAndDestroy(&data); - CleanupStack::PopAndDestroy(&actId); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void ActivityStorageSyncTask::UpdateActivityL(CActivityStorage& dataStorage, const RMessage2& msg) -{ - TPckgBuf appId; - msg.ReadL(KRequestAppIdOffset, appId); - - RBuf8 actId; - CleanupClosePushL(actId); - actId.CreateL(msg.GetDesLengthL(KRequestActOffset)); - msg.ReadL(KRequestActOffset, actId, 0); - - RBuf8 data; - CleanupClosePushL(data); - data.CreateL(msg.GetDesLengthL(KRequestData)); - msg.ReadL(KRequestData, data, 0); - - dataStorage.UpdateActivityL(appId(), actId, data); - - CleanupStack::PopAndDestroy(&data); - CleanupStack::PopAndDestroy(&actId); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void ActivityStorageSyncTask::DeleteActivityL(CActivityStorage& dataStorage, const RMessage2& msg) -{ - TPckgBuf appId; - msg.ReadL(KRequestAppIdOffset, appId); - - RBuf8 actId; - CleanupClosePushL(actId); - actId.CreateL(msg.GetDesLengthL(KRequestActOffset)); - msg.ReadL(KRequestActOffset, actId, 0); - - dataStorage.DeleteActivityL(appId(), actId); - - CleanupStack::PopAndDestroy(&actId); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void ActivityStorageSyncTask::DeleteApplicationActivitiesL(CActivityStorage& dataStorage, const RMessage2& msg) -{ - TPckgBuf appId; - msg.ReadL(KRequestAppIdOffset, appId); - dataStorage.DeleteActivitiesL(appId()); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void ActivityStorageSyncTask::NotifyChangeL(MActivityTaskStorage& observers, - const RMessage2& msg) -{ - const RPointerArray &table(observers.StorageData()); - for (TInt iter(table.Count() - 1); 0 <= iter; --iter) { - table[iter]->BroadcastReceivedL(msg); - } -} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/activitythumbnailtask.cpp --- a/activityfw/activitydatabase/hsactivitydbserver/src/activitythumbnailtask.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "activitythumbnailtask.h" -#include "activitycmd.h" - -#include - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivityThumbnailTask::CActivityThumbnailTask(MActivityTaskStorage& storage, - const RMessage2 msg) -: - mStorage(storage), - mMsg(msg) -{ - // No implementation required -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CActivityThumbnailTask::~CActivityThumbnailTask() -{ - delete mService; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityThumbnailTask::ExecuteLD(RFs& session, - MActivityTaskStorage& taskStorage, - const RMessage2& message) -{ - CActivityThumbnailTask *self = new (ELeave)CActivityThumbnailTask(taskStorage, - message); - CleanupStack::PushL(self); - self->ConstructL(session); - taskStorage.PushL(self); - CleanupStack::Pop(self); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityThumbnailTask::ConstructL(RFs& session) -{ - TPckgBuf width(0), height(0); - RBuf path; - RBuf8 mime; - CleanupClosePushL(path); - CleanupClosePushL(mime); - mMsg.ReadL(0, width); - mMsg.ReadL(1, height); - path.CreateL(mMsg.GetDesLengthL(2)); - mMsg.ReadL(2, path); - mime.CreateL(mMsg.GetDesLengthL(3)); - mMsg.ReadL(3, mime); - - mService = CTsGraphicFileScalingHandler::NewL(*this, - session, - path, - mime, - TSize(width(), height()), - CTsGraphicFileScalingHandler::EKeepAspectRatio); - - CleanupStack::PopAndDestroy(&mime); - CleanupStack::PopAndDestroy(&path); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityThumbnailTask::ImageReadyCallBack(TInt error,const CFbsBitmap *bitmap) -{ - if (EFalse == mMsg.IsNull() && - KErrNone == error) { - mMsg.Write(0, TPckgBuf(const_cast(bitmap)->Handle())); - mMsg.Write(1, TPckgBuf(this)); - mMsg.Complete(error); - } else { - if (EFalse == mMsg.IsNull()) { - mMsg.Complete(error); - } - mStorage.Pop(this); - delete this; - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TDesC8& CActivityThumbnailTask::Data() const -{ - return KNullDesC8(); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CActivityThumbnailTask::BroadcastReceivedL(const RMessage2&) -{ -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CActivityThumbnailTask::IsSessionTask(const CSession2* session) -{ - return mMsg.Session() == session ? ETrue : EFalse; -} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/afbroadcasttask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/afbroadcasttask.cpp Wed Jun 23 18:33:40 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: +* +*/ +#include "afbroadcasttask.h" + +// ----------------------------------------------------------------------------- +/** + * Handle broadccast message request + * @param storage - observer tasks storage + * @param msg - request message that will be provided to observers + */ +void AfBroadcastTask::ExecuteL(MAfTaskStorage& storage, + const RMessage2& msg) +{ + const RPointerArray &tasks(storage.StorageData()); + for (TInt iter(tasks.Count() - 1); iter >= 0 ; --iter ) { + if(EFalse == msg.IsNull()) { + (tasks[iter])->BroadcastReceivedL(msg); + } + } + if(EFalse == msg.IsNull()) { + msg.Complete(KErrNone); + } +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/afdataprovidertask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/afdataprovidertask.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "afdataprovidertask.h" +#include "activitycmd.h" + +// ----------------------------------------------------------------------------- +/** + * Handle data request. Deliver data stored in other task. + * @param storage - data tasks storage + * @param msg - request message + */ +void AfDataProviderTask::ExecuteL(MAfTaskStorage& storage, + const RMessage2& msg) +{ + TPckgBuf requestId; + CAfTask* taskPtr(0); + msg.Read(KRequestIdOffset, requestId); + + for (TInt iter(0);iter observerdId; + mMsg.ReadL(KRequestAppIdOffset, observerdId); + + TPckgBuf requestedId; + msg.ReadL(KRequestAppIdOffset, requestedId); + if (observerdId() == requestedId()) { + if (msg.GetDesLength(KRequestActOffset) > mData.MaxLength()) { + mData.ReAllocL(msg.GetDesLength(1)); + } + msg.ReadL(KRequestActOffset, mData, 0); + WriteResponseL(); + mLocalStorage.PushL(this); + mGlobalStorage.Pop(this); + mMsg.Complete(KErrNone); + } + } else if (WaitActivity == mMsg.Function() && + CancelWait == msg.Function() && + mMsg.Session() == msg.Session()) { + mGlobalStorage.Pop(this); + mMsg.Complete(KErrCancel); + delete this; + } else if (NotifyChange == mMsg.Function() && + CancelNotify == msg.Function() && + mMsg.Session() == msg.Session()) { + mGlobalStorage.Pop(this); + mMsg.Complete(KErrCancel); + delete this; + } else if(NotifyChange == mMsg.Function() && + (AddActivity == msg.Function() || + UpdateActivity == msg.Function() || + RemoveActivity == msg.Function() || + RemoveApplicationActivities == msg.Function())){ + mMsg.Complete(KErrNone); + mGlobalStorage.Pop(this); + delete this; + } +} + +// ----------------------------------------------------------------------------- +/** + * Write response data to requested message + */ +void CAfObserverTask::WriteResponseL() +{ + mMsg.WriteL(KResponseDataSizeOffset, TPckgBuf(mData.Length()));//write data size + mMsg.WriteL(KResponseIdOffset, TPckgBuf(this));//task identyfier +} + +// ----------------------------------------------------------------------------- +/** + * Returns ETrue if task is related with session argument + */ +TBool CAfObserverTask::IsSessionTask(const CSession2* session) +{ + return mMsg.Session() == session ? ETrue : EFalse; +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/afserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/afserver.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,134 @@ +/* +* 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 "afserver.h" +#include "afsession.h" +#include "afstorage.h" +#include "aftask.h" + +_LIT( KActivityServerName, "hsactivitydbserver" ); +_LIT(KObserverAlreadyExists, "Observer task exists"); + +// ----------------------------------------------------------------------------- +/** + * Constructor for performing 1st stage construction + */ +CAfServer::CAfServer() +: +CServer2( EPriorityStandard ) +{ + // No implementation required +} + +// ----------------------------------------------------------------------------- +/** + * Destructor. + */ +CAfServer::~CAfServer() +{ + delete mStorage; + mFsSession.Close(); + mObservers.ResetAndDestroy(); + RFbsSession::Disconnect(); +} + +// ----------------------------------------------------------------------------- +/** + * Two-phased constructor. + */ +CAfServer* CAfServer::NewLC() +{ + CAfServer* self = new (ELeave) CAfServer(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; +} + +// ----------------------------------------------------------------------------- +/** + * Default constructor for performing 2nd stage construction + */ +void CAfServer::ConstructL() +{ + StartL(KActivityServerName); + User::LeaveIfError(mFsSession.Connect()); + User::LeaveIfError(RFbsSession::Connect(mFsSession)); + mStorage = CAfStorage::NewL(mFsSession); + mObservers.Array(); +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation + * @see CServer2::NewSessionL(const TVersion&, const RMessage2&) + */ +CSession2* CAfServer::NewSessionL(const TVersion &, const RMessage2&) const +{ + return CAfSession::NewL(const_cast(this)->mFsSession, + *const_cast(this), + *mStorage); +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation + * @see MAfTaskStorage::PushL(CAfTask *) + */ +void CAfServer::PushL(CAfTask * task) +{ + (KErrNotFound == mObservers.Find(task)) ? + mObservers.AppendL(task) : + User::Panic(KObserverAlreadyExists, KErrAlreadyExists); +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation + * @see MAfTaskStorage::Pop(CActivityTask *) + */ +void CAfServer::Pop(CAfTask *task) +{ + const TInt offset(mObservers.Find(task)); + if (KErrNotFound != offset) { + mObservers.Remove(offset); + } +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation + * @see MAfTaskStorage::StorageData() + */ +const RPointerArray& CAfServer::StorageData() const +{ + return mObservers; +} + +// ----------------------------------------------------------------------------- +/** + * Removes not valid task + */ +void CAfServer::RemoveNotValidTasks(const CSession2* session) +{ + for (TInt i=mObservers.Count()-1; i>=0; --i) { + if( mObservers[i]->IsSessionTask(session) ) { + delete mObservers[i]; + mObservers.Remove(i); + } + } +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/afsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/afsession.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,177 @@ +/* +* 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 "afsession.h" +#include "aftask.h" +#include "activitycmd.h" + +#include "afstorageasynctask.h" +#include "afstoragesynctask.h" +#include "afobservertask.h" +#include "afbroadcasttask.h" +#include "afdataprovidertask.h" +#include "afthumbnailtask.h" + +_LIT(KTaskAlreadyExists, "Activity task exists"); + +// ----------------------------------------------------------------------------- +/** + * Constructor for performing 1st stage construction + * @param fileSession - initialized file system session + * @param taskStorage - global observers storage + * @param storage - data storage + */ + +CAfSession::CAfSession(RFs& fileSession, + MAfTaskStorage& taskStorage, + CAfStorage& storage) +: +mFileSession(fileSession), +mTasksStorage(taskStorage), +mStorage(storage) +{ + // No implementation required +} + +// ----------------------------------------------------------------------------- +/** + * Destructor. + */ +CAfSession::~CAfSession() +{ + RemoveNotValidTasks(this); + mTasksStorage.RemoveNotValidTasks(this); +} + +// ----------------------------------------------------------------------------- +/** + * Two-phased constructor. + * @param fileSession - initialized file system session + * @param taskStorage - global observers storage + * @param storage - data storage + */ +CAfSession* CAfSession::NewL(RFs& fileSession, + MAfTaskStorage& taskStorage, + CAfStorage& storage) +{ + CAfSession* self = new (ELeave) CAfSession(fileSession, + taskStorage, + storage); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +// ----------------------------------------------------------------------------- +/** + * EPOC default constructor for performing 2nd stage construction + */ +void CAfSession::ConstructL() +{ +} + +// ----------------------------------------------------------------------------- +/** + * Implements interface + * @see void CSession2::ServiceL(const RMessage2&) + */ +void CAfSession::ServiceL(const RMessage2& message) +{ + switch (message.Function()) { + case AddActivity: + case UpdateActivity: + case RemoveActivity: + case RemoveApplicationActivities: + AfStorageSyncTask::ExecuteL(mTasksStorage, mStorage, message); + break; + + case ApplicationActivity: + case Activities: + case ApplicationActivities: + CAfStorageAsyncTask::ExecuteLD(*this, mStorage, message); + break; + + case WaitActivity: + case NotifyChange: + CAfObserverTask::ExecuteLD(mTasksStorage, *this, message); + break; + + case GetThumbnail: + CAfThumbnailTask::ExecuteLD(*this, message); + break; + + case LaunchActivity: + case CancelWait: + case CancelNotify: + AfBroadcastTask::ExecuteL(mTasksStorage, message); + break; + + case GetData: + AfDataProviderTask::ExecuteL(*this,message); + break; + + default: + message.Complete(CServer2::EBadMessageNumber); + break; + } +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation + * @see MAfTaskStorage::PushL(CAfTask *) + */ +void CAfSession::PushL(CAfTask * task) +{ + (KErrNotFound == mRunningTasks.Find(task)) ? + mRunningTasks.AppendL(task) : + User::Panic(KTaskAlreadyExists, KErrAlreadyExists); +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation + * @see MAfTaskStorage::Pop(CAfTask *) + */ +void CAfSession::Pop(CAfTask *task) +{ + const TInt offset(mRunningTasks.Find(task)); + if (KErrNotFound != offset) { + mRunningTasks.Remove(offset); + } +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation + * @see MAfTaskStorage::StorageData() + */ +const RPointerArray& CAfSession::StorageData() const +{ + return mRunningTasks; +} + +// ----------------------------------------------------------------------------- +/** + * Removes not valid task + */ +void CAfSession::RemoveNotValidTasks(const CSession2* session) +{ + if (session == this) { + mRunningTasks.ResetAndDestroy(); + } +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/afstorage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/afstorage.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,505 @@ +/* +* 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 "afstorage.h" +#include "afqueries.h" +#include "afentry.h" +#include +#include + +_LIT(KDbName, "activity.db"); +_LIT(KDbDrive, "c:"); +const TInt KMaxPathLength = 256; + +// ----------------------------------------------------------------------------- +LOCAL_C void CleanupResetAndDestroy(TAny* item) +{ + RPointerArray *array = static_cast< RPointerArray* >(item); + array->ResetAndDestroy(); + array->Close(); +} + +// ----------------------------------------------------------------------------- +/** + * Constructor for performing 1st stage construction + * @param session - initialized session to file system + */ +CAfStorage::CAfStorage(RFs& session) +: +mFsSession(session) +{ + // No implementation required +} + +// ----------------------------------------------------------------------------- +/** + * Destructor. + */ +CAfStorage::~CAfStorage() +{ +} + +// ----------------------------------------------------------------------------- +/** + * Two-phased constructor. + * @param session - initialized session to file system + */ +CAfStorage* CAfStorage::NewL(RFs& session) +{ + CAfStorage* self = new (ELeave) CAfStorage(session); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // self; + return self; +} + +// ----------------------------------------------------------------------------- +/** + * EPOC default constructor for performing 2nd stage construction + */ +void CAfStorage::ConstructL() +{ + RBuf path; + CleanupClosePushL( path ); + path.CreateL(KMaxPathLength); + User::LeaveIfError(mFsSession.PrivatePath(path )); + path.Append(KDbName); + path.Insert(0, KDbDrive); + BaflUtils::EnsurePathExistsL(mFsSession, path); + BaflUtils::FileExists(mFsSession, path) ? OpenDbL(path) : CreateDbL(path); + CleanupStack::PopAndDestroy(&path); + + DeleteNonPersistentActivitiesL(); +} + +// ----------------------------------------------------------------------------- +/** + * Create database and its structure + * @param databaseFile - database file path + */ +void CAfStorage::CreateDbL(const TDesC& databaseFile) +{ + mFileStore = CPermanentFileStore::ReplaceL(mFsSession, + databaseFile, + EFileRead|EFileWrite); + mFileStore->SetTypeL(mFileStore->Layout());// Set file store type + TStreamId id = mActDb.CreateL(mFileStore);// Create stream object + mFileStore->SetRootL(id);// Keep database id as root of store + mFileStore->CommitL();// Complete creation by commiting + CreateTableL(); +} + +// ----------------------------------------------------------------------------- +/** + * Open database + * @param databaseFile - database file path + */ +void CAfStorage::OpenDbL(const TDesC& databaseFile) +{ + mFileStore = CPermanentFileStore::OpenL(mFsSession, + databaseFile, + EFileRead|EFileWrite); + mFileStore->SetTypeL(mFileStore->Layout()); /* Set file store type*/ + mActDb.OpenL(mFileStore,mFileStore->Root()); + CDbTableNames* tables = mActDb.TableNamesL(); + CleanupStack::PushL(tables); + if (0 == tables->Count()) { + CreateTableL(); + } + CleanupStack::PopAndDestroy(tables); +} + +// ----------------------------------------------------------------------------- +/** + * Create database structure + */ +void CAfStorage::CreateTableL() +{ + // Add the columns to column set + CDbColSet* actColSet = CDbColSet::NewLC(); + + TDbCol appName(KApplicationColumnName, EDbColInt64); + appName.iAttributes = TDbCol::ENotNull; + actColSet->AddL(appName); + + TDbCol actName(KActivityColumnName, EDbColText16);// Using default length + actName.iAttributes = TDbCol::ENotNull; + actColSet->AddL(actName); + + TDbCol actFlags(KFlagsColumnName, EDbColInt32); + actFlags.iAttributes = TDbCol::ENotNull; + actColSet->AddL(actFlags); + + actColSet->AddL(TDbCol(KDataColumnName, EDbColLongBinary));// Stream Data + + // Create the table + User::LeaveIfError(mActDb.CreateTable(KActivityTableName, + *actColSet)); + + CleanupStack::PopAndDestroy(actColSet); +} + +// ----------------------------------------------------------------------------- +/** + * Delete non-persistent activities + */ +void CAfStorage::DeleteNonPersistentActivitiesL() +{ + HBufC *query(BuildQueryLC(KDeleteNonPersistentActivities(), CAfEntry::Persistent, KNullDesC)); + User::LeaveIfError(mActDb.Execute(*query)); + CleanupStack::PopAndDestroy(query); +} + +// ----------------------------------------------------------------------------- +/** + * Register new activity + * @param appId - application id + * @param actId - activity id + * @param flags - activity flags + * @param imgSrc - activity thumbnail source + * @param privateData - activity private data + * @param publicData - activity public data + */ +void CAfStorage::AddActivityL(CAfEntry& entry) +{ + //verify if row already exists + TInt errNo(KErrNone); + RDbView view; + CleanupClosePushL(view); + TRAP( errNo, GetActivityForUpdateL(view, entry.ApplicationId(), entry.ActivityId())); + if (KErrNone == errNo) { + User::Leave(KErrAlreadyExists); + } + CleanupStack::PopAndDestroy(&view); + + //write table + RDbTable table; + CleanupClosePushL(table); + User::LeaveIfError(table.Open(mActDb, KActivityTableName, table.EUpdatable)); + CDbColSet *row = table.ColSetL(); + CleanupStack::PushL(row); + + table.InsertL(); + TRAP(errNo, + table.SetColL(row->ColNo(KApplicationColumnName), TInt64(entry.ApplicationId())); + table.SetColL(row->ColNo(KActivityColumnName), entry.ActivityId()); + table.SetColL(row->ColNo(KFlagsColumnName), entry.Flags()); + ExternalizeDataL(table, entry, row->ColNo(KDataColumnName)); + table.PutL();) + if (KErrNone != errNo) { + table.Cancel(); + User::Leave(errNo); + } + CleanupStack::PopAndDestroy(row); + CleanupStack::PopAndDestroy(&table); +} + +// ----------------------------------------------------------------------------- +/** + * Update activity + * @param entry - activity data + */ +void CAfStorage::UpdateActivityL(CAfEntry& entry) +{ + RDbView view; + CleanupClosePushL(view); + GetActivityForUpdateL(view, entry.ApplicationId(), entry.ActivityId()); + view.UpdateL(); + TRAPD(errNo, + CDbColSet* colSet = view.ColSetL(); + CleanupStack::PushL(colSet); + + view.SetColL(colSet->ColNo(KFlagsColumnName), entry.Flags()); + ExternalizeDataL(view, entry, colSet->ColNo(KDataColumnName)); + + view.PutL(); + if (KErrNone != errNo) { + view.Cancel(); + User::Leave(errNo); + } + CleanupStack::PopAndDestroy(colSet);) + + if (KErrNone != errNo) { + view.Cancel(); + User::Leave(errNo); + } + CleanupStack::PopAndDestroy(&view); +} + +// ----------------------------------------------------------------------------- +/** + * Delete activity + * @param appId - application id + * @param actId - activity id + */ +void CAfStorage::DeleteActivityL(CAfEntry& entry) +{ + HBufC *query(DeleteRowLC(entry.ApplicationId(), entry.ActivityId())); + User::LeaveIfError(mActDb.Execute(*query)); + CleanupStack::PopAndDestroy(query); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CAfStorage::DeleteActivitiesL(CAfEntry& entry) +{ + HBufC *query(DeleteRowsLC(entry.ApplicationId())); + User::LeaveIfError(mActDb.Execute(*query)); + CleanupStack::PopAndDestroy(query); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CAfStorage::ActivitiesL(RPointerArray& dst) +{ + ActivitiesL(dst, KSelectRows(), CAfEntry::Public); +} + +// ----------------------------------------------------------------------------- +/** + * Serialize application activity into the buffer + * @param dst - destination buffer + * @param appId - application id + */ +void CAfStorage::ActivitiesL(RPointerArray& dst,TInt appId) +{ + HBufC *query(SelectRowsLC(appId)); + ActivitiesL(dst, *query, CAfEntry::Private); + CleanupStack::PopAndDestroy(query); +} + +// ----------------------------------------------------------------------------- +/** + * Serialize application activity into the buffer + * @param dst - destination entry + * @param src - condition pattern + */ +void CAfStorage::ActivityL(CAfEntry *&dst, CAfEntry& src) +{ + HBufC *query = SelectRowLC(src.ApplicationId(), src.ActivityId()); + RPointerArray array; + CleanupStack::PushL(TCleanupItem(CleanupResetAndDestroy,&array)); + ActivitiesL(array, *query, CAfEntry::Private, 1); + if (0 >= array.Count()) { + User::Leave(KErrNotFound); + } + dst = array[0]; + array.Remove(0); + CleanupStack::PopAndDestroy(&array); + CleanupStack::PopAndDestroy(query); +} + +// ----------------------------------------------------------------------------- +/** + * Provide initialized file system session + * @return file system session + */ +RFs& CAfStorage::Fs() +{ + return mFsSession; +} + +// ----------------------------------------------------------------------------- +/** + * Format query to select activity row + * @param appId - application id + * @param actId - activity id + * @return formated sql query + */ +HBufC* CAfStorage::SelectRowLC(TInt appId, const TDesC& actId) const +{ + return BuildQueryLC(KSelectRow(),appId, actId); +} + +// ----------------------------------------------------------------------------- +/** + * Format query to select activities for application + * @param appId - application id + * @return formated sql query + */ +HBufC* CAfStorage::SelectRowsLC(TInt appId) const +{ + return BuildQueryLC(KSelectAppRows(), appId, KNullDesC); +} + +// ----------------------------------------------------------------------------- +/** + * Format query to delete activity + * @param appId - application id + * @param actId - activity id + * @return formated sql query + */ +HBufC* CAfStorage::DeleteRowLC(TInt appId, const TDesC& actId) const +{ + return BuildQueryLC(KDeleteRow(),appId, actId); +} + +// ----------------------------------------------------------------------------- +/** + * Format query to delete activities for application + * @param appId - application id + * @return formated sql query + */ +HBufC* CAfStorage::DeleteRowsLC(TInt appId) const +{ + return BuildQueryLC(KDeleteRows(),appId, KNullDesC); +} + +// ----------------------------------------------------------------------------- +/** + * Format sql query + * @format - sql format string + * @param appId - application id + * @param actId - activity id + * @return formated sql query + */ +HBufC* CAfStorage::BuildQueryLC(const TDesC& format, + TInt appId, + const TDesC& actId) const +{ + TBuf<16> appName; + appName.AppendNum(appId); + RBuf actName; + CleanupClosePushL(actName); + actName.CreateL(actId.Length()); + actName.Copy(actId); + HBufC* query = HBufC::NewL(format.Length() + + appName.Length() + + actName.Length() ); + query->Des().AppendFormat(format, &appName, &actName); + CleanupStack::PopAndDestroy(&actName); + CleanupStack::PushL(query); + return query; +} + +// ----------------------------------------------------------------------------- +/** + * Execute sql query and result serialize into buffer + * @param dst - destination result buffer + * @param query - sql activity query + */ +void CAfStorage::ActivitiesL(RPointerArray& dst, const TDesC& query, CAfEntry::AccessRights rights, TInt limit) +{ + RDbView view;// Create a view on the database + CleanupClosePushL(view); + User::LeaveIfError(view.Prepare(mActDb, TDbQuery(query), view.EReadOnly)); + User::LeaveIfError(view.EvaluateAll()); + ActivitiesL(dst, view, rights, limit); + CleanupStack::PopAndDestroy(&view); +} + +// ----------------------------------------------------------------------------- +/** + * Return view deserialisd into entries array + * @param dst - destination result + * @param query - view + * @param rights - acess rights + */ +void CAfStorage::ActivitiesL(RPointerArray& dst, RDbView& src, CAfEntry::AccessRights rights, TInt limit) +{ + CDbColSet* row = src.ColSetL(); + CleanupStack::PushL(row); + + const TInt flagsOffset(row->ColNo(KFlagsColumnName)), + applicationOffset(row->ColNo(KApplicationColumnName)), + activityOffset(row->ColNo(KActivityColumnName)), + dataOffset(row->ColNo(KDataColumnName)); + + RBuf activityName; + CleanupClosePushL(activityName); + + for (src.FirstL(); src.AtRow(); src.NextL()) { + if(0 < limit && dst.Count() >= limit) { + break; + } + src.GetL(); + ReadDataL(activityName, src, activityOffset); + + CAfEntry *entry = CAfEntry::NewLC(src.ColInt32(flagsOffset), + src.ColInt64(applicationOffset), + activityName, + KNullDesC, + KNullDesC8, + KNullDesC8); + if (CAfEntry::Public == rights && (entry->Flags() & CAfEntry::Invisible)) { + CleanupStack::PopAndDestroy(entry); + continue; + } + InternalizeDataL(*entry, src, dataOffset); + + if (CAfEntry::Public == rights || 0 >= limit) { + entry->SetDataL(KNullDesC8(), CAfEntry::Private); + } + dst.AppendL(entry); + CleanupStack::Pop(entry); + } + + CleanupStack::PopAndDestroy(&activityName); + CleanupStack::PopAndDestroy(row); +} + +// ----------------------------------------------------------------------------- +/** + * Get activity for update + * @param query - destination query result + * @param appId - application id + * @param actId - activity id + */ +void CAfStorage::GetActivityForUpdateL(RDbView& view, TInt appId, const TDesC& actId) +{ + HBufC* query(SelectRowLC(appId, actId)); + User::LeaveIfError(view.Prepare(mActDb, TDbQuery(*query), view.EUpdatable)); + CleanupStack::PopAndDestroy(query); + User::LeaveIfError(view.EvaluateAll()); + if (!view.FirstL()) { + User::Leave(KErrNotFound); + } +} + +// ----------------------------------------------------------------------------- +void CAfStorage::ReadDataL(RBuf& dst, RDbRowSet& src, TInt offset) const +{ + const TInt length(src.ColLength(offset)); + CAfEntry::ReallocL(dst, length); + RDbColReadStream srcStream; + srcStream.OpenLC(src,offset); + srcStream.ReadL(dst, src.ColLength(offset)); + CleanupStack::PopAndDestroy(&srcStream); +} + +// ----------------------------------------------------------------------------- +void CAfStorage::ExternalizeDataL(RDbRowSet& dst,const CAfEntry &src, TInt offset) const +{ + RDbColWriteStream dbStream; + CleanupClosePushL(dbStream); + dbStream.OpenL(dst, offset); + src.ExternalizeDataOnlyL(dbStream); + CleanupStack::PopAndDestroy(&dbStream); +} + +// ----------------------------------------------------------------------------- +void CAfStorage::InternalizeDataL(CAfEntry & dst, RDbRowSet& src, TInt offset) const +{ + RDbColReadStream dbStream; + CleanupClosePushL(dbStream); + dbStream.OpenL(src, offset); + dst.InternalizeDataOnlyL(dbStream); + CleanupStack::PopAndDestroy(&dbStream); +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/afstorageasynctask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/afstorageasynctask.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,221 @@ +/* +* 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 "afstorageasynctask.h" +#include "activitycmd.h" + +_LIT(KUnsupportedStorageAsyncTask, "Unsupported async storage task"); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +LOCAL_C void ReadEntryL(CAfEntry& entry, const RMessage2& msg) +{ + RBuf8 serializedEntry; + CleanupClosePushL(serializedEntry); + serializedEntry.CreateL(msg.GetDesLengthL(0)); + msg.ReadL(0, serializedEntry); + RDesReadStream reader(serializedEntry); + CleanupClosePushL(reader); + + reader >> entry; + + CleanupStack::PopAndDestroy(&reader); + CleanupStack::PopAndDestroy(&serializedEntry); +} +// ----------------------------------------------------------------------------- +/** + * Constructor for performing 1st stage construction + */ +CAfStorageAsyncTask::CAfStorageAsyncTask() +{ + // No implementation required +} + +// ----------------------------------------------------------------------------- +/** + * Destructor. + */ +CAfStorageAsyncTask::~CAfStorageAsyncTask() +{ + mExternalizedData.Close(); + mInternalizedData.ResetAndDestroy(); +} + +// ----------------------------------------------------------------------------- +/** + * Handle asynchronous data storage requests + * @param taskStorage - data tasks storage + * @param dataStorage - data storage + * @param msg - request message + */ +void CAfStorageAsyncTask::ExecuteLD(MAfTaskStorage& taskStorage, + CAfStorage& dataStorage, + const RMessage2& msg) +{ + CAfStorageAsyncTask* self = new (ELeave) CAfStorageAsyncTask(); + CleanupStack::PushL(self); + self->ExecuteL(dataStorage, msg); + taskStorage.PushL(self); + CleanupStack::Pop(self); + if (EFalse == msg.IsNull()) { + msg.Complete(KErrNone); + } +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation + * @see CActivityTask::Data() + */ +const TDesC8& CAfStorageAsyncTask::CAfStorageAsyncTask::Data() const +{ + return mExternalizedData; +} + +// ----------------------------------------------------------------------------- +/** + * Interface implementation + * @see CActivityTask::BroadcastReceivedL(const RMessage2 &) + */ +void CAfStorageAsyncTask::BroadcastReceivedL(const RMessage2& ) +{ + // No implementation required +} + +// ----------------------------------------------------------------------------- +/** + * Handle asynchronous data storage requests + * @param dataStorage - data storage + * @param msg - request message + */ +void CAfStorageAsyncTask::ExecuteL(CAfStorage& dataStorage, + const RMessage2& msg) +{ + switch (msg.Function()) { + case Activities: + AllActivitiesL(dataStorage, msg); + break; + case ApplicationActivities: + ApplicationActivitiesL(dataStorage, msg); + break; + case ApplicationActivity: + ApplicationActivityL(dataStorage, msg); + break; + default: + //this code shouldn't be called. fatal error: means wrong session implementation + User::Panic(KUnsupportedStorageAsyncTask, KErrGeneral); + }; +} + +// ----------------------------------------------------------------------------- +/** + * Handle getting all activities request + * @param dataStorage - data storage + * @param msg - requested message + */ +void CAfStorageAsyncTask::AllActivitiesL(CAfStorage& dataStorage, + const RMessage2& msg) +{ + dataStorage.ActivitiesL(mInternalizedData); + ExternalizeL(); + WriteResponseL(msg); +} + +// ----------------------------------------------------------------------------- +/** + * Handle getting application activities request + * @param dataStorage - data storage + * @param msg - requested message + */ +void CAfStorageAsyncTask::ApplicationActivitiesL(CAfStorage& dataStorage, + const RMessage2& msg) +{ + CAfEntry *entry = CAfEntry::NewLC(); + ReadEntryL(*entry, msg); + dataStorage.ActivitiesL(mInternalizedData, entry->ApplicationId()); + CleanupStack::PopAndDestroy(entry); + ExternalizeL(); + WriteResponseL(msg); +} + +// ----------------------------------------------------------------------------- +/** + * Handle getting application activity request + * @param dataStorage - data storage + * @param msg - requested message + */ +void CAfStorageAsyncTask::ApplicationActivityL(CAfStorage& dataStorage, + const RMessage2& msg) +{ + CAfEntry *src(CAfEntry::NewLC()) , *dst(0); + ReadEntryL(*src, msg); + dataStorage.ActivityL(dst, *src); + CleanupStack::PushL(dst); + ExternalizeL(*dst); + CleanupStack::PopAndDestroy(dst); + CleanupStack::PopAndDestroy(src); + WriteResponseL(msg); +} + +// ----------------------------------------------------------------------------- +void CAfStorageAsyncTask::ExternalizeL() +{ + mExternalizedData << mInternalizedData; + mInternalizedData.ResetAndDestroy(); +} + +// ----------------------------------------------------------------------------- +/** + * Externalzie entry into output buffer + * @param entry - source entry + */ +void CAfStorageAsyncTask::ExternalizeL(const CAfEntry &entry) +{ + CAfEntry::ReallocL(mExternalizedData, entry.Size()); + RDesWriteStream writer(mExternalizedData); + CleanupClosePushL(writer); + writer << entry; + CleanupStack::PopAndDestroy(&writer); +} + +// ----------------------------------------------------------------------------- +/** + * Write response data into request message + * @param msg - destination message + */ +void CAfStorageAsyncTask::WriteResponseL(const RMessage2& msg) +{ + if (EFalse == msg.IsNull()) { + msg.WriteL(1, + TPckgBuf(mExternalizedData.Length()));//write data size + msg.WriteL(2, + TPckgBuf(this));//task identyfier + } +} + +// ----------------------------------------------------------------------------- +/** + * Returns ETrue if task is related with session argument + */ + +TBool CAfStorageAsyncTask::IsSessionTask(const CSession2* /*session*/) +{ + return EFalse; +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/afstoragesynctask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/afstoragesynctask.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,260 @@ +/* +* 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 "afstoragesynctask.h" +#include "activitycmd.h" +#include "afentry.h" +const TInt KMaxPathLength = 256; + +_LIT(KUnsupportedStorageSyncTask, "Unsupported sync storage task"); + +// ----------------------------------------------------------------------------- +/** + * Handle synchronous data storage requests + * @param dataStorage - data storage + * @param msg - request message + */ +void AfStorageSyncTask::ExecuteL(MAfTaskStorage& observers, + CAfStorage& dataStorage, + const RMessage2& msg) +{ + switch (msg.Function()) { + case AddActivity: + AddActivityL(dataStorage, msg); + break; + case UpdateActivity: + UpdateActivityL(dataStorage, msg); + break; + case RemoveActivity: + DeleteActivityL(dataStorage, msg); + break; + case RemoveApplicationActivities: + DeleteApplicationActivitiesL(dataStorage, msg); + break; + default: + //this code shouldn't be called. fatal error: means wrong session implementation + User::Panic(KUnsupportedStorageSyncTask, KErrGeneral); + }; + msg.Complete(KErrNone); + NotifyChangeL(observers, msg); +} + +// ----------------------------------------------------------------------------- +/** + * Handle adding new activity. + * @param dataStorage - data storage + * @param msg - request message + */ +void AfStorageSyncTask::AddActivityL(CAfStorage& dataStorage, + const RMessage2& msg) +{ + //Read message and bitmap handle + TPckgBuf bitmapHdl(0); + CAfEntry *entry = CAfEntry::NewLC(); + ReadEntryL(*entry, msg); + msg.ReadL(1, bitmapHdl); + + RBuf thumbnailPath; + CleanupClosePushL(thumbnailPath); + ThumbnailPathL(thumbnailPath, + dataStorage.Fs(), + entry->ApplicationId(), + entry->ActivityId()); + CreateThumbnailL(thumbnailPath, bitmapHdl()); + entry->SetImageSrcL(thumbnailPath); + dataStorage.AddActivityL(*entry); + CleanupStack::PopAndDestroy(&thumbnailPath); + + CleanupStack::PopAndDestroy(entry); +} + +// ----------------------------------------------------------------------------- +/** + * Handle updating existing activiy + * @param dataStorage - data storage + * @param msg - request message + */ +void AfStorageSyncTask::UpdateActivityL(CAfStorage& dataStorage, + const RMessage2& msg) +{ + TPckgBuf bitmapHdl(0); + CAfEntry *entry = CAfEntry::NewLC(); + ReadEntryL(*entry, msg); + msg.ReadL(1, bitmapHdl); + + RBuf thumbnailPath; + CleanupClosePushL(thumbnailPath); + ThumbnailPathL(thumbnailPath, + dataStorage.Fs(), + entry->ApplicationId(), + entry->ActivityId()); + CreateThumbnailL(thumbnailPath, bitmapHdl()); + entry->SetImageSrcL(thumbnailPath); + dataStorage.UpdateActivityL(*entry); + CleanupStack::PopAndDestroy(&thumbnailPath); + CleanupStack::PopAndDestroy(entry); +} + +// ----------------------------------------------------------------------------- +/** + * Handle removing activity. + * @param dataStorage - data storage + * @param msg - request message + */ +void AfStorageSyncTask::DeleteActivityL(CAfStorage& dataStorage, + const RMessage2& msg) +{ + CAfEntry *entry = CAfEntry::NewLC(); + ReadEntryL(*entry, msg); + dataStorage.DeleteActivityL(*entry); + CleanupStack::PopAndDestroy(entry); +} + +// ----------------------------------------------------------------------------- +/** + * Handle removing all application activities. + * @param dataStorage - data storage + * @param msg - request message + */ +void AfStorageSyncTask::DeleteApplicationActivitiesL(CAfStorage& dataStorage, + const RMessage2& msg) +{ + CAfEntry *entry = CAfEntry::NewLC(); + ReadEntryL(*entry, msg); + dataStorage.DeleteActivitiesL(*entry); + CleanupStack::PopAndDestroy(entry); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void AfStorageSyncTask::NotifyChangeL(MAfTaskStorage& observers, + const RMessage2& msg) +{ + const RPointerArray &table(observers.StorageData()); + for (TInt iter(table.Count() - 1); 0 <= iter; --iter) { + table[iter]->BroadcastReceivedL(msg); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void AfStorageSyncTask::ReadEntryL(CAfEntry& entry, const RMessage2& msg) +{ + RBuf8 serializedEntry; + CleanupClosePushL(serializedEntry); + serializedEntry.CreateL(msg.GetDesLengthL(0)); + msg.ReadL(0, serializedEntry); + RDesReadStream reader(serializedEntry); + CleanupClosePushL(reader); + + reader >> entry; + + CleanupStack::PopAndDestroy(&reader); + CleanupStack::PopAndDestroy(&serializedEntry); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void AfStorageSyncTask::CreateThumbnailL(const TDesC &path, TInt hdl) +{ + if (0 >= hdl) { + User::Leave(KErrCorrupt); + } + CFbsBitmap *bitmap = new (ELeave) CFbsBitmap; + CleanupStack::PushL(bitmap); + User::LeaveIfError(bitmap->Duplicate(hdl)); + User::LeaveIfError(bitmap->Save(path)); + CleanupStack::PopAndDestroy(bitmap); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void AfStorageSyncTask::ThumbnailPathL(RBuf &dst, + RFs& fileSystem, + TInt uid, + const TDesC &activityName) +{ + _LIT(KUidFormat, "%+08x\\"); + _LIT(KExtFormat, ".mbm"); + //Generate activity hash + RBuf8 buff8; + CleanupClosePushL(buff8); + buff8.CreateL(activityName.Length()); + buff8.Copy(activityName); + HBufC8 *activityHash = Md5HexDigestL(buff8); + CleanupStack::PopAndDestroy(&buff8); + CleanupStack::PushL(activityHash); + + //Get private path + RBuf privatePath; + CleanupClosePushL(privatePath); + privatePath.CreateL(KMaxPathLength); + User::LeaveIfError(fileSystem.PrivatePath(privatePath)); + + //Format activity path + privatePath.AppendFormat( KUidFormat, uid); + + const TInt requiredSize(privatePath.Length() + + activityHash->Length() + + KExtFormat().Length()); + CAfEntry::ReallocL(dst, requiredSize); + + //Copy path + dst.Copy(privatePath); + privatePath.Copy(*activityHash);//reuse already allocated buffer to convert 8 -> 16 + dst.Append(privatePath); + dst.Append(KExtFormat()); + + CleanupStack::PopAndDestroy(&privatePath); + CleanupStack::PopAndDestroy(activityHash); + + BaflUtils::EnsurePathExistsL(fileSystem, dst); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC8* AfStorageSyncTask::Md5HexDigestL(const TDes8 &string) +{ + _LIT8(KMd5HexFormat, "%+02x"); + CMD5* md5 = CMD5::NewL(); + CleanupStack::PushL(md5); + + TPtrC8 hashedSig(md5->Hash(string)); + + HBufC8* buf = HBufC8::NewL(hashedSig.Length() * 2); + TPtr8 bufPtr = buf->Des(); + + for(TInt i(0); i< hashedSig.Length(); ++i) { + bufPtr.AppendFormat(KMd5HexFormat,hashedSig[i]); + } + CleanupStack::PopAndDestroy(md5); + return buf; +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/afthumbnailtask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/afthumbnailtask.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,135 @@ +/* +* 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 "afthumbnailtask.h" +#include "activitycmd.h" + +#include + +// ----------------------------------------------------------------------------- +/** + * Constructor for performing 1st stage construction + */ +CAfThumbnailTask::CAfThumbnailTask(MAfTaskStorage& storage, + const RMessage2 msg) +: + mStorage(storage), + mMsg(msg) +{ + // No implementation required +} + +// ----------------------------------------------------------------------------- +/** + * Destructor. + */ +CAfThumbnailTask::~CAfThumbnailTask() +{ + delete mService; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CAfThumbnailTask::ExecuteLD(MAfTaskStorage& taskStorage, + const RMessage2& message) +{ + CAfThumbnailTask *self = new (ELeave)CAfThumbnailTask(taskStorage, + message); + CleanupStack::PushL(self); + self->ConstructL(); + taskStorage.PushL(self); + CleanupStack::Pop(self); +} + +// ----------------------------------------------------------------------------- +/** + * EPOC default constructor for performing 2nd stage construction + */ +void CAfThumbnailTask::ConstructL() +{ + TPckgBuf width(0), height(0); + RBuf path; + RBuf8 mime; + CleanupClosePushL(path); + CleanupClosePushL(mime); + mMsg.ReadL(0, width); + mMsg.ReadL(1, height); + path.CreateL(mMsg.GetDesLengthL(2)); + mMsg.ReadL(2, path); + mime.CreateL(mMsg.GetDesLengthL(3)); + mMsg.ReadL(3, mime); + + CFbsBitmap *bitmap = new (ELeave) CFbsBitmap(); + CleanupStack::PushL(bitmap); + User::LeaveIfError(bitmap->Load(path)); + mService = CTsGraphicFileScalingHandler::NewL(*this, + *bitmap, + TSize(width(), height()), + CTsGraphicFileScalingHandler::EKeepAspectRatioByExpanding); + CleanupStack::PopAndDestroy(bitmap); + + CleanupStack::PopAndDestroy(&mime); + CleanupStack::PopAndDestroy(&path); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CAfThumbnailTask::ImageReadyCallBack(TInt error,const CFbsBitmap *bitmap) +{ + if (EFalse == mMsg.IsNull() && + KErrNone == error) { + mMsg.Write(0, TPckgBuf(const_cast(bitmap)->Handle())); + mMsg.Write(1, TPckgBuf(this)); + mMsg.Complete(error); + } else { + if (EFalse == mMsg.IsNull()) { + mMsg.Complete(error); + } + mStorage.Pop(this); + delete this; + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC8& CAfThumbnailTask::Data() const +{ + return KNullDesC8(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CAfThumbnailTask::BroadcastReceivedL(const RMessage2&) +{ +} + +// ----------------------------------------------------------------------------- +/** + * Returns ETrue if task is related with session argument + */ +TBool CAfThumbnailTask::IsSessionTask(const CSession2* session) +{ + return mMsg.Session() == session ? ETrue : EFalse; +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/hsactivitydbserver/src/main.cpp --- a/activityfw/activitydatabase/hsactivitydbserver/src/main.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/hsactivitydbserver/src/main.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -14,7 +14,7 @@ * Description: * */ -#include "activityserver.h" +#include "afserver.h" #include // ----------------------------------------------------------------------------- @@ -26,7 +26,7 @@ CActiveScheduler* activeScheduler = new( ELeave ) CActiveScheduler; CleanupStack::PushL( activeScheduler ); CActiveScheduler::Install( activeScheduler ); - CActivityServer* serverObject = CActivityServer::NewLC(); + CAfServer* serverObject = CAfServer::NewLC(); RProcess::Rendezvous( KErrNone ); CActiveScheduler::Start(); CleanupStack::PopAndDestroy( serverObject ); diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/inc/activitycmd.h --- a/activityfw/activitydatabase/inc/activitycmd.h Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/inc/activitycmd.h Wed Jun 23 18:33:40 2010 +0300 @@ -34,6 +34,7 @@ RemoveApplicationActivities, Activities, ApplicationActivities, + ApplicationActivity, WaitActivity, LaunchActivity, GetThumbnail, diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/inc/hsactivitydbclientinterface.h --- a/activityfw/activitydatabase/inc/hsactivitydbclientinterface.h Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/inc/hsactivitydbclientinterface.h Wed Jun 23 18:33:40 2010 +0300 @@ -25,7 +25,10 @@ const char ActivityApplicationKeyword [] = ":ApplicationId"; const char ActivityActivityKeyword [] = ":ActivityName"; const char ActivityParametersKeyword [] = ":ActivityParams"; +const char ActivityPersistence [] = ":ActivityPersistence"; +const char ActivityVisibility [] = ":ActivityVisibility"; const char ActivityScreenshotKeyword [] = "screenshot"; +const char ActivityDataKeyword [] = ":ActivityData"; class HsActivityDbClientInterface { @@ -36,14 +39,16 @@ * @param activity - activity to store * @return 0 on succees, error code otherwise */ - virtual int addActivity(const QVariantHash &activity) =0; + virtual int addActivity(const QVariantHash &privateData, + const QVariantHash &publicData) =0; /** * Function update exiting activity * @param activity - filtering rules * @return 0 on succees, error code otherwise */ - virtual int updateActivity(const QVariantHash &activity) =0; + virtual int updateActivity(const QVariantHash &privateData, + const QVariantHash &publicData) =0; /** * Function delete activity @@ -76,6 +81,14 @@ const QVariantHash &activity) =0; /** + * Function returns data for activity + * @param result - activity data + * @param activity - filtering rules + * @return 0 on succees, error code otherwise + */ + virtual int activityData(QVariant &result, const QVariantHash &activity) = 0; + + /** * Function subscribe to activity * @param activity - filtering rules * @return 0 on succees, error code otherwise diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/s60/inc/afentry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/s60/inc/afentry.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef AFENTRYDATA_H +#define AFENTRYDATA_H + +#include +#include +class RDbColWriteStream; +class RDbColReadStream; +const TInt KAfMask(0x0001); + +#ifdef AF_ADD_MASK +#undef AF_ADD_MASK +#endif +#define AF_ADD_MASK(n) (KAfMask << n) + +class CAfEntry: public CBase +{ +public: + enum AccessRights { + Private =0, + Public + }; + + enum Flags { + Invisible = KAfMask, + Persistent = 0x40000000, + }; + +public: + static CAfEntry* NewL(); + + static CAfEntry* NewLC(); + + static CAfEntry* NewL(TInt flags, + TInt applicationId, + const TDesC &activityId, + const TDesC &imgSrc, + const TDesC8 &privateData, + const TDesC8 &publicData); + + static CAfEntry* NewLC(TInt flags, + TInt applicationId, + const TDesC &activityId, + const TDesC &imgSrc, + const TDesC8 &privateData, + const TDesC8 &publicData); + + ~CAfEntry(); + + TInt Size() const; + + TInt DataSize() const; + + void ExternalizeL(RWriteStream &stream) const; + + void InternalizeL(RReadStream &stream); + + void ExternalizeDataOnlyL(RWriteStream &stream) const; + + void InternalizeDataOnlyL(RReadStream &stream); + + TInt Flags() const; + + TInt ApplicationId() const; + + const TDesC& ActivityId() const; + + const TDesC& ImageSrc() const; + + void SetImageSrcL(const TDesC& src); + + const TDesC8& Data(CAfEntry::AccessRights rights) const; + + void SetDataL(const TDesC8& src, CAfEntry::AccessRights rights); + + static void ReallocL(RBuf8 &dst,TInt length); + + static void ReallocL(RBuf &dst,TInt length); + + static void CopyL(RBuf8 &dst,const TDesC8 &src); + + static void CopyL(RBuf &dst,const TDesC &src); + +private: + CAfEntry(); + + void ConstructL(TInt flags, + TInt applicationId, + const TDesC &activityId, + const TDesC &imgSrc, + const TDesC8 &privateData, + const TDesC8 &publicData); + + static void InternalizeL(RBuf8 &dst, RReadStream &src); + + static void InternalizeL(RBuf &dst, RReadStream &src); + + static void ExternalizeL(RWriteStream &dst,const TDesC8 & src); + + static void ExternalizeL(RWriteStream &dst,const TDesC& src); +private: + TInt mFlags; + TInt mAppId; + RBuf mActivityId; + RBuf mImgSrc; + RBuf8 mPrivateData; + RBuf8 mPublicData; + +}; + +RPointerArray& operator <<(RPointerArray& dst, const TDesC8 &src); + +RBuf8& operator << (RBuf8 &dst, const RPointerArray& src); + +#endif diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/s60/inc/hsserializer.h --- a/activityfw/activitydatabase/s60/inc/hsserializer.h Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/s60/inc/hsserializer.h Wed Jun 23 18:33:40 2010 +0300 @@ -16,8 +16,8 @@ */ #ifndef HSSERIALIZER_H #define HSSERIALIZER_H + #include -#include /** * Operator serialize VarinatHash to RBuf8 @@ -29,8 +29,4 @@ */ QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src); -/** - * Operator deserialize RBuf8 to QList - */ -QList& operator <<(QList& dst, const TDesC8 &src); #endif diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/s60/src/afentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/activitydatabase/s60/src/afentry.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,446 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "afentry.h" +#include + +// ----------------------------------------------------------------------------- +/** + * Two-phase constructor. Create and initialize instance + * @return entry instance + */ +CAfEntry* CAfEntry::NewL() +{ + CAfEntry *self = CAfEntry::NewLC(); + CleanupStack::Pop(self); + return self; +} + +// ----------------------------------------------------------------------------- +/** + * Two-phase constructor. Create, initialize and push instance into cleanup stack + * @return entry instance + */ +CAfEntry* CAfEntry::NewLC() +{ + CAfEntry *self = new (ELeave)CAfEntry(); + CleanupStack::PushL(self); + return self; +} + +// ----------------------------------------------------------------------------- +/** + * Two-phase constructor. Create and initialize instance + * @param flags - entry flags + * @param applicationId - application unique identifier + * @param activityId - activity unique identifier + * @param imgSrc - thumbanail source + * @param privateData - privated application data + * @param publicData - public activity data + * @return entry instance + */ +CAfEntry* CAfEntry::NewL(TInt flags, + TInt applicationId, + const TDesC &activityId, + const TDesC &imgSrc, + const TDesC8 &privateData, + const TDesC8 &publicData) +{ + CAfEntry* self = CAfEntry::NewLC(flags, + applicationId, + activityId, + imgSrc, + privateData, + publicData); + CleanupStack::Pop(self); + return self; +} + +// ----------------------------------------------------------------------------- +/** + * Two-phase constructor. Create, initialize and push instance into cleanup stack + * @param flags - entry flags + * @param applicationId - application unique identifier + * @param activityId - activity unique identifier + * @param imgSrc - thumbanail source + * @param privateData - privated application data + * @param publicData - public activity data + * @return entry instance + */ +CAfEntry* CAfEntry::NewLC(TInt flags, + TInt applicationId, + const TDesC &activityId, + const TDesC &imgSrc, + const TDesC8 &privateData, + const TDesC8 &publicData) +{ + CAfEntry *self = CAfEntry::NewLC(); + self->ConstructL(flags, + applicationId, + activityId, + imgSrc, + privateData, + publicData); + return self; +} + +// ----------------------------------------------------------------------------- +/** + * First phase constructor + */ +CAfEntry::CAfEntry() +{ +} + +// ----------------------------------------------------------------------------- +/** + * Second phase constructor. Initialize instance + * @param flags - entry flags + * @param applicationId - application unique identifier + * @param activityId - activity unique identifier + * @param imgSrc - thumbanail source + * @param privateData - privated application data + * @param publicData - public activity data + */ +void CAfEntry::ConstructL(TInt flags, + TInt applicationId, + const TDesC &activityId, + const TDesC &imgSrc, + const TDesC8 &privateData, + const TDesC8 &publicData) +{ + mFlags = flags; + mAppId = applicationId; + CopyL(mActivityId, activityId); + CopyL(mImgSrc, imgSrc); + CopyL(mPrivateData, privateData); + CopyL(mPublicData, publicData); +} + +// ----------------------------------------------------------------------------- +/** + * Destructor. Release allocated resources + */ +CAfEntry::~CAfEntry() +{ + mActivityId.Close(); + mPrivateData.Close(); + mPublicData.Close(); + mImgSrc.Close(); +} + +// ----------------------------------------------------------------------------- +/** + * Provide size of serialized entry + * @return size of serialized entry instance + */ +TInt CAfEntry::Size() const +{ + return (sizeof(TInt) * 3) + //flags + appId + actId size info + mActivityId.Size() + //actId content size + DataSize(); //data size + +} + +// ----------------------------------------------------------------------------- +/** + * Provide size of serialized entry + * @return size of serialized entry instance + */ +TInt CAfEntry::DataSize() const +{ + return (sizeof(TInt) * 3) + //privData size info + pubData size info + imgSrc size info + mImgSrc.Size() + //imgSize content size + mPrivateData.Size() + //privData content size + mPublicData.Size(); //pubData content size +} +// ----------------------------------------------------------------------------- +/** + * Serialize entry content into output stream. + * @param stream - output stream + */ +void CAfEntry::ExternalizeL(RWriteStream &stream) const +{ + stream.WriteInt32L(mFlags); + stream.WriteInt32L(mAppId); + ExternalizeL(stream, mActivityId); + ExternalizeDataOnlyL(stream); +} + +// ----------------------------------------------------------------------------- +/** + * Deserialize entry content from input stream + * @param stream - input stream + */ +void CAfEntry::InternalizeL(RReadStream &stream) +{ + mFlags = stream.ReadInt32L(); + mAppId = stream.ReadInt32L(); + InternalizeL(mActivityId, stream); + InternalizeDataOnlyL(stream); +} + +// ----------------------------------------------------------------------------- +/** + * Serialize entry content into output stream. + * @param stream - output stream + */ +void CAfEntry::ExternalizeDataOnlyL(RWriteStream &stream) const +{ + ExternalizeL(stream, mImgSrc); + ExternalizeL(stream, mPrivateData); + ExternalizeL(stream, mPublicData); +} + +// ----------------------------------------------------------------------------- +/** + * Deserialize entry content from input stream + * @param stream - input stream + */ +void CAfEntry::InternalizeDataOnlyL(RReadStream &stream) +{ + + InternalizeL(mImgSrc, stream); + InternalizeL(mPrivateData, stream); + InternalizeL(mPublicData, stream); + +} + +// ----------------------------------------------------------------------------- +/** + * Provide access to activity flags + * @return activity flags + */ +TInt CAfEntry::Flags() const +{ + return mFlags; +} + +// ----------------------------------------------------------------------------- +/** + * Provide access to activity identifier. + * @return activity identifier + */ +TInt CAfEntry::ApplicationId() const +{ + return mAppId; +} + +// ----------------------------------------------------------------------------- +/** + * Provide access to activity identifier. + * @return activity identifier + */ +const TDesC& CAfEntry::ActivityId() const +{ + return mActivityId; +} + +// ----------------------------------------------------------------------------- +/** + * Provide access to activity data. + * @param rights - type of requested data + * @return activity data + */ +const TDesC8& CAfEntry::Data(CAfEntry::AccessRights rights) const +{ + return Private == rights ? mPrivateData : mPublicData; +} + +// ----------------------------------------------------------------------------- +/** + * Provide access to activity data. + * @param rights - type of requested data + * @return activity data + */ +void CAfEntry::SetDataL(const TDesC8& src, CAfEntry::AccessRights rights) +{ + CopyL(Private == rights ? mPrivateData : mPublicData, src); +} + +// ----------------------------------------------------------------------------- +/** + * Provide access to activity thumbail path + * @return path to activity thumbnail + */ +const TDesC& CAfEntry::ImageSrc() const +{ + return mImgSrc; +} + +// ----------------------------------------------------------------------------- +/** + * Set new value of image source + */ +void CAfEntry::SetImageSrcL(const TDesC& src) +{ + CopyL(mImgSrc, src); +} + +// ----------------------------------------------------------------------------- +/** + * Reallocate blob buffer to requested size + * @param dst - destination buffer + * @param length - requested length + */ +void CAfEntry::ReallocL(RBuf8 &dst,TInt length) +{ + if (0 < length) { + if (dst.MaxLength() < length) { + dst.ReAllocL(length); + } + } else { + dst.Close(); + } +} + +// ----------------------------------------------------------------------------- +/** + * Reallocate text buffer to requested size + * @param dst - destination buffer + * @param length - requested length + */ +void CAfEntry::ReallocL(RBuf &dst,TInt length) +{ + if (0 < length) { + if (dst.MaxLength() < length) { + dst.ReAllocL(length); + } + } else { + dst.Close(); + } +} +// ----------------------------------------------------------------------------- +/** + * Copy blob content from input stream + * @param dst - destination buffer + * @param src - source buffer + */ +void CAfEntry::CopyL(RBuf8 &dst,const TDesC8 &src) +{ + ReallocL(dst, src.Length()); + if(0 < src.Length()) { + dst.Copy(src); + } +} + +// ----------------------------------------------------------------------------- +/** + * Copy text content from input buffer + * @param dst - destination buffer + * @param src - source buffer + */ +void CAfEntry::CopyL(RBuf &dst,const TDesC &src) +{ + ReallocL(dst, src.Length()); + if(0 < src.Length()) { + dst.Copy(src); + } +} + +// ----------------------------------------------------------------------------- +/** + * Deserialize blob content from input stream + * @param dst - destination buffer + * @param src - input stream + */ +void CAfEntry::InternalizeL(RBuf8 &dst, RReadStream &src) +{ + const TInt length(src.ReadInt32L()); + ReallocL(dst, length); + if (0 < length) { + src.ReadL(dst, length); + } +} + +// ----------------------------------------------------------------------------- +/** + * Deserialize text content from input stream + * @param dst - destination buffer + * @param src - input stream + */ +void CAfEntry::InternalizeL(RBuf &dst, RReadStream &src) +{ + const TInt length(src.ReadInt32L()); + ReallocL(dst, length); + if (0 < length) { + src.ReadL(dst, length); + } +} + +// ----------------------------------------------------------------------------- +/** + * Serialize blob content into output stream + * @param dst - destination stream + * @param src - input buffer + */ +void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC8 & src) +{ + dst.WriteInt32L(src.Length()); + if (src.Length()) { + dst.WriteL(src, src.Length()); + } +} + +// ----------------------------------------------------------------------------- +/** + * Serialize text content into output stream + * @param dst - destination stream + * @param src - input buffer + */ +void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC& src) +{ + dst.WriteInt32L(src.Length()); + if (src.Length()) { + dst.WriteL(src, src.Length()); + } +} + +// ----------------------------------------------------------------------------- +RPointerArray& operator <<(RPointerArray& dst, const TDesC8 &src) +{ + dst.ResetAndDestroy(); + RDesReadStream srcStream(src); + CleanupClosePushL(srcStream); + int numOfItems(srcStream.ReadInt32L()); + for (int i(0); i < numOfItems; ++i) { + CAfEntry *entry = CAfEntry::NewLC(); + srcStream >> (*entry); + dst.AppendL(entry); + CleanupStack::Pop(entry); + } + CleanupStack::PopAndDestroy(&srcStream); + return dst; +} + +// ----------------------------------------------------------------------------- +RBuf8& operator <<(RBuf8 &dst, const RPointerArray& src) +{ + int iter(0), + requiredSize(sizeof(int)); + for(iter =0; iter< src.Count(); ++iter) { + requiredSize += src[iter]->Size(); + } + CAfEntry::ReallocL(dst, requiredSize); + RDesWriteStream dstStream(dst); + CleanupClosePushL(dstStream); + dstStream.WriteInt32L(src.Count()); + for (iter =0; iter < src.Count(); ++iter) { + dstStream << *(src[iter]); + } + CleanupStack::PopAndDestroy(&dstStream); + return dst; +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitydatabase/s60/src/hsserializer.cpp --- a/activityfw/activitydatabase/s60/src/hsserializer.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activitydatabase/s60/src/hsserializer.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -14,8 +14,8 @@ * Description: * */ +#include #include "hsserializer.h" -#include // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -48,35 +48,3 @@ QT_TRYCATCH_LEAVING(stream >> dst); return dst; } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -QList& operator <<(QList& dst, const TDesC8 &src) -{ - dst.clear(); - - QVariantHash item; - TRAP_IGNORE( - RDesReadStream srcStream(src); - int numOfItems(srcStream.ReadInt32L()); - int bufferSize; - - RBuf8 tmpBuff; - CleanupClosePushL(tmpBuff); - for (int iter(0); iter < numOfItems; ++iter) { - bufferSize = srcStream.ReadInt32L(); - if (tmpBuff.MaxLength() < bufferSize) { - tmpBuff.ReAllocL(bufferSize); - } - item.clear(); - if (0 < bufferSize) { - srcStream.ReadL(tmpBuff, bufferSize); - item << tmpBuff; - } - dst.append(item); - } - CleanupStack::PopAndDestroy(&tmpBuff)); - return dst; -} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activitylauncher/activitylauncher.pro --- a/activityfw/activitylauncher/activitylauncher.pro Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app - -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 156f692b1687 -r b99b84bcd2d1 activityfw/activitylauncher/activitylauncherview.cpp --- a/activityfw/activitylauncher/activitylauncherview.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "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 156f692b1687 -r b99b84bcd2d1 activityfw/activitylauncher/activitylauncherview.h --- a/activityfw/activitylauncher/activitylauncherview.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef 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 156f692b1687 -r b99b84bcd2d1 activityfw/activitylauncher/main.cpp --- a/activityfw/activitylauncher/main.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include - -#include -#include - -#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 156f692b1687 -r b99b84bcd2d1 activityfw/activityserviceplugin/activityserviceplugin.pro --- a/activityfw/activityserviceplugin/activityserviceplugin.pro Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activityserviceplugin/activityserviceplugin.pro Wed Jun 23 18:33:40 2010 +0300 @@ -23,7 +23,6 @@ INCLUDEPATH += ./inc \ HEADERS += ./inc/activityserviceplugin.h \ - ./inc/activitydatastorage.h \ ./inc/activityclient.h \ ./inc/activityclient_p.h \ ./inc/activitymanager.h \ @@ -31,7 +30,6 @@ ./inc/applicationlauncher.h \ SOURCES += ./src/activityserviceplugin.cpp \ - ./src/activitydatastorage.cpp \ ./src/activityclient.cpp \ ./src/activityclient_p.cpp \ ./src/activitymanager.cpp \ diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activityserviceplugin/inc/activityclient_p.h --- a/activityfw/activityserviceplugin/inc/activityclient_p.h Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activityserviceplugin/inc/activityclient_p.h Wed Jun 23 18:33:40 2010 +0300 @@ -44,11 +44,6 @@ QVariantHash parseCommandLine(const QStringList &commandLineParams) const; private: - void registerThumbnail(const QString &, QVariantHash&); - QString thumbnailName(const QString &) const; - -private: - ActivityDataStorage *mDataStorage; HsActivityDbClient *mServerClient; bool mIsconnected; }; diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activityserviceplugin/inc/activitydatastorage.h --- a/activityfw/activityserviceplugin/inc/activitydatastorage.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef 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 156f692b1687 -r b99b84bcd2d1 activityfw/activityserviceplugin/src/activityclient_p.cpp --- a/activityfw/activityserviceplugin/src/activityclient_p.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/activityserviceplugin/src/activityclient_p.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -16,7 +16,6 @@ */ #include "activityclient_p.h" #include "activityclient.h" -#include "activitydatastorage.h" #include #include @@ -28,7 +27,6 @@ ActivityClientPrivate::ActivityClientPrivate(ActivityClient *q) : QObject(q), mIsconnected(false) { - mDataStorage = new ActivityDataStorage(); mServerClient = new HsActivityDbClient(); mIsconnected = ( KErrNone == mServerClient->connect()); if( mIsconnected) { @@ -40,25 +38,20 @@ ActivityClientPrivate::~ActivityClientPrivate() { delete mServerClient; - delete mDataStorage; } bool ActivityClientPrivate::addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) { bool result(false); if (mIsconnected) { - result = mDataStorage->addActivity(activityId, data); - if ( result ) { - QVariantHash activity(parameters); - RProcess process; - registerThumbnail(activityId, activity); - activity.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); - activity.insert(ActivityActivityKeyword, activityId); - int error = mServerClient->addActivity(activity); - result = error == KErrNone ? true : false; - } + QVariantHash privateData; + privateData.insert(ActivityDataKeyword, data); + QVariantHash publicData(parameters); + RProcess process; + publicData.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); + publicData.insert(ActivityActivityKeyword, activityId); + result = (KErrNone == mServerClient->addActivity(privateData, publicData)); } - // @todo make those operations atomic return result; } @@ -66,20 +59,12 @@ { bool result(false); if (mIsconnected) { - result = mDataStorage->removeActivity(activityId); - if ( result ) { - QVariantHash activity; - RProcess process; - activity.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); - activity.insert(ActivityActivityKeyword, activityId); - int error = mServerClient->removeActivity(activity); - result = error == KErrNone ? true : false; - if (result) { - result = QFile::remove(thumbnailName(activityId)); - } - } + QVariantHash activity; + RProcess process; + activity.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); + activity.insert(ActivityActivityKeyword, activityId); + result = (KErrNone == mServerClient->removeActivity(activity)); } - // @todo make those operations atomic return result; } @@ -87,18 +72,14 @@ { bool result(false); if (mIsconnected) { - result = mDataStorage->updateActivity(activityId, data); - if ( result ) { - QVariantHash activity(parameters); - RProcess process; - registerThumbnail(activityId, activity); - activity.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); - activity.insert(ActivityActivityKeyword, activityId); - int error = mServerClient->updateActivity(activity); - result = error == KErrNone ? true : false; - } + QVariantHash privateData; + privateData.insert(ActivityDataKeyword, data); + QVariantHash publicData(parameters); + RProcess process; + publicData.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); + publicData.insert(ActivityActivityKeyword, activityId); + result = (KErrNone == mServerClient->updateActivity(privateData, publicData)); } - // @todo make those operations atomic return result; } @@ -116,7 +97,15 @@ QVariant ActivityClientPrivate::activityData(const QString &activityId) const { - return mIsconnected ? mDataStorage->activityData(activityId) : QVariant(); + QVariant data; + if (mIsconnected) { + QVariantHash activity; + RProcess process; + activity.insert(ActivityApplicationKeyword, static_cast(process.SecureId().iId)); + activity.insert(ActivityActivityKeyword, activityId); + mServerClient->activityData(data, activity); + } + return data; } QVariantHash ActivityClientPrivate::parseCommandLine(const QStringList &commandLineParams) const @@ -138,26 +127,3 @@ } return QVariantHash(); } - -void ActivityClientPrivate::registerThumbnail(const QString &name, QVariantHash &activity) -{ - QVariantHash::const_iterator findIterator(activity.constFind(ActivityScreenshotKeyword)); - if (activity.constEnd() != findIterator && - findIterator.value().canConvert()) { - const QString thumbnailManagerName = thumbnailName(name); - if (findIterator.value().value().save(thumbnailManagerName)) { - activity.insert(ActivityScreenshotKeyword, thumbnailManagerName); - } else { - activity.remove(ActivityScreenshotKeyword); - } - } -} - -QString ActivityClientPrivate::thumbnailName(const QString &activityId) const -{ - return QDir::toNativeSeparators(qApp->applicationDirPath() + - "/" + - QString::number(qHash(activityId), 16) + - ".png"); -} - diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/activityserviceplugin/src/activitydatastorage.cpp --- a/activityfw/activityserviceplugin/src/activitydatastorage.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "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 156f692b1687 -r b99b84bcd2d1 activityfw/tsutils/bwins/tsutilsu.def --- a/activityfw/tsutils/bwins/tsutilsu.def Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/tsutils/bwins/tsutilsu.def Wed Jun 23 18:33:40 2010 +0300 @@ -1,7 +1,18 @@ EXPORTS - ?NewLC@CTsGraphicFileScalingHandler@@SAPAV1@AAVMImageReadyCallBack@@AAVRFs@@ABVTDesC16@@ABVTDesC8@@ABVTSize@@W4TKindOfScaling@1@@Z @ 1 NONAME ; class CTsGraphicFileScalingHandler * CTsGraphicFileScalingHandler::NewLC(class MImageReadyCallBack &, class RFs &, class TDesC16 const &, class TDesC8 const &, class TSize const &, enum CTsGraphicFileScalingHandler::TKindOfScaling) - ?NewL@CTsGraphicFileScalingHandler@@SAPAV1@AAVMImageReadyCallBack@@AAVRFs@@ABVTDesC16@@ABVTDesC8@@ABVTSize@@W4TKindOfScaling@1@@Z @ 2 NONAME ; class CTsGraphicFileScalingHandler * CTsGraphicFileScalingHandler::NewL(class MImageReadyCallBack &, class RFs &, class TDesC16 const &, class TDesC8 const &, class TSize const &, enum CTsGraphicFileScalingHandler::TKindOfScaling) - ?NewLC@CTsGraphicFileScalingHandler@@SAPAV1@AAVMImageReadyCallBack@@ABVCFbsBitmap@@ABVTSize@@W4TKindOfScaling@1@@Z @ 3 NONAME ; class CTsGraphicFileScalingHandler * CTsGraphicFileScalingHandler::NewLC(class MImageReadyCallBack &, class CFbsBitmap const &, class TSize const &, enum CTsGraphicFileScalingHandler::TKindOfScaling) - ?NewL@CTsGraphicFileScalingHandler@@SAPAV1@AAVMImageReadyCallBack@@ABVCFbsBitmap@@ABVTSize@@W4TKindOfScaling@1@@Z @ 4 NONAME ; class CTsGraphicFileScalingHandler * CTsGraphicFileScalingHandler::NewL(class MImageReadyCallBack &, class CFbsBitmap const &, class TSize const &, enum CTsGraphicFileScalingHandler::TKindOfScaling) - ??1CTsGraphicFileScalingHandler@@UAE@XZ @ 5 NONAME ; CTsGraphicFileScalingHandler::~CTsGraphicFileScalingHandler(void) + ?WsSession@CTsResourceManager@@UAEAAVRWsSession@@XZ @ 1 NONAME ; class RWsSession & CTsResourceManager::WsSession(void) + ?ApaSession@CTsResourceManager@@UAEAAVRApaLsSession@@XZ @ 2 NONAME ; class RApaLsSession & CTsResourceManager::ApaSession(void) + ?BaseConstructL@CTsWindowGroupsObserver@@IAEXXZ @ 3 NONAME ; void CTsWindowGroupsObserver::BaseConstructL(void) + ??1CTsWindowGroupsObserver@@UAE@XZ @ 4 NONAME ; CTsWindowGroupsObserver::~CTsWindowGroupsObserver(void) + ??1CTsWindowGroupsMonitor@@UAE@XZ @ 5 NONAME ; CTsWindowGroupsMonitor::~CTsWindowGroupsMonitor(void) + ?NewL@CTsGraphicFileScalingHandler@@SAPAV1@AAVMImageReadyCallBack@@AAVRFs@@ABVTDesC16@@ABVTDesC8@@ABVTSize@@W4TKindOfScaling@1@@Z @ 6 NONAME ; class CTsGraphicFileScalingHandler * CTsGraphicFileScalingHandler::NewL(class MImageReadyCallBack &, class RFs &, class TDesC16 const &, class TDesC8 const &, class TSize const &, enum CTsGraphicFileScalingHandler::TKindOfScaling) + ?SubscribeL@CTsWindowGroupsMonitor@@UAEXAAVMTsWindowGroupsObserver@@@Z @ 7 NONAME ; void CTsWindowGroupsMonitor::SubscribeL(class MTsWindowGroupsObserver &) + ?NewL@CTsWindowGroupsMonitor@@SAPAV1@AAVMTsResourceManager@@@Z @ 8 NONAME ; class CTsWindowGroupsMonitor * CTsWindowGroupsMonitor::NewL(class MTsResourceManager &) + ??1CTsGraphicFileScalingHandler@@UAE@XZ @ 9 NONAME ; CTsGraphicFileScalingHandler::~CTsGraphicFileScalingHandler(void) + ?NewLC@CTsGraphicFileScalingHandler@@SAPAV1@AAVMImageReadyCallBack@@ABVCFbsBitmap@@ABVTSize@@W4TKindOfScaling@1@@Z @ 10 NONAME ; class CTsGraphicFileScalingHandler * CTsGraphicFileScalingHandler::NewLC(class MImageReadyCallBack &, class CFbsBitmap const &, class TSize const &, enum CTsGraphicFileScalingHandler::TKindOfScaling) + ?NewL@CTsGraphicFileScalingHandler@@SAPAV1@AAVMImageReadyCallBack@@ABVCFbsBitmap@@ABVTSize@@W4TKindOfScaling@1@@Z @ 11 NONAME ; class CTsGraphicFileScalingHandler * CTsGraphicFileScalingHandler::NewL(class MImageReadyCallBack &, class CFbsBitmap const &, class TSize const &, enum CTsGraphicFileScalingHandler::TKindOfScaling) + ?NewLC@CTsGraphicFileScalingHandler@@SAPAV1@AAVMImageReadyCallBack@@AAVRFs@@ABVTDesC16@@ABVTDesC8@@ABVTSize@@W4TKindOfScaling@1@@Z @ 12 NONAME ; class CTsGraphicFileScalingHandler * CTsGraphicFileScalingHandler::NewLC(class MImageReadyCallBack &, class RFs &, class TDesC16 const &, class TDesC8 const &, class TSize const &, enum CTsGraphicFileScalingHandler::TKindOfScaling) + ??0CTsWindowGroupsObserver@@IAE@AAVMTsWindowGroupsMonitor@@@Z @ 13 NONAME ; CTsWindowGroupsObserver::CTsWindowGroupsObserver(class MTsWindowGroupsMonitor &) + ?NewL@CTsResourceManager@@SAPAV1@XZ @ 14 NONAME ; class CTsResourceManager * CTsResourceManager::NewL(void) + ?Cancel@CTsWindowGroupsMonitor@@UAEXAAVMTsWindowGroupsObserver@@@Z @ 15 NONAME ; void CTsWindowGroupsMonitor::Cancel(class MTsWindowGroupsObserver &) + ??1CTsResourceManager@@UAE@XZ @ 16 NONAME ; CTsResourceManager::~CTsResourceManager(void) diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/tsutils/eabi/tsutilsu.def --- a/activityfw/tsutils/eabi/tsutilsu.def Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/tsutils/eabi/tsutilsu.def Wed Jun 23 18:33:40 2010 +0300 @@ -1,11 +1,38 @@ EXPORTS - _ZN28CTsGraphicFileScalingHandler4NewLER19MImageReadyCallBackR3RFsRK7TDesC16RK6TDesC8RK5TSizeNS_14TKindOfScalingE @ 1 NONAME - _ZN28CTsGraphicFileScalingHandler4NewLER19MImageReadyCallBackRK10CFbsBitmapRK5TSizeNS_14TKindOfScalingE @ 2 NONAME - _ZN28CTsGraphicFileScalingHandler5NewLCER19MImageReadyCallBackR3RFsRK7TDesC16RK6TDesC8RK5TSizeNS_14TKindOfScalingE @ 3 NONAME - _ZN28CTsGraphicFileScalingHandler5NewLCER19MImageReadyCallBackRK10CFbsBitmapRK5TSizeNS_14TKindOfScalingE @ 4 NONAME - _ZN28CTsGraphicFileScalingHandlerD0Ev @ 5 NONAME - _ZN28CTsGraphicFileScalingHandlerD1Ev @ 6 NONAME - _ZN28CTsGraphicFileScalingHandlerD2Ev @ 7 NONAME - _ZTI28CTsGraphicFileScalingHandler @ 8 NONAME - _ZTV28CTsGraphicFileScalingHandler @ 9 NONAME + _ZN18CTsResourceManager10ApaSessionEv @ 1 NONAME + _ZN18CTsResourceManager4NewLEv @ 2 NONAME + _ZN18CTsResourceManager9WsSessionEv @ 3 NONAME + _ZN18CTsResourceManagerD0Ev @ 4 NONAME + _ZN18CTsResourceManagerD1Ev @ 5 NONAME + _ZN18CTsResourceManagerD2Ev @ 6 NONAME + _ZN22CTsWindowGroupsMonitor10SubscribeLER23MTsWindowGroupsObserver @ 7 NONAME + _ZN22CTsWindowGroupsMonitor4NewLER18MTsResourceManager @ 8 NONAME + _ZN22CTsWindowGroupsMonitor6CancelER23MTsWindowGroupsObserver @ 9 NONAME + _ZN22CTsWindowGroupsMonitorD0Ev @ 10 NONAME + _ZN22CTsWindowGroupsMonitorD1Ev @ 11 NONAME + _ZN22CTsWindowGroupsMonitorD2Ev @ 12 NONAME + _ZN23CTsWindowGroupsObserver14BaseConstructLEv @ 13 NONAME + _ZN23CTsWindowGroupsObserverC2ER22MTsWindowGroupsMonitor @ 14 NONAME + _ZN23CTsWindowGroupsObserverD0Ev @ 15 NONAME + _ZN23CTsWindowGroupsObserverD1Ev @ 16 NONAME + _ZN23CTsWindowGroupsObserverD2Ev @ 17 NONAME + _ZN28CTsGraphicFileScalingHandler4NewLER19MImageReadyCallBackR3RFsRK7TDesC16RK6TDesC8RK5TSizeNS_14TKindOfScalingE @ 18 NONAME + _ZN28CTsGraphicFileScalingHandler4NewLER19MImageReadyCallBackRK10CFbsBitmapRK5TSizeNS_14TKindOfScalingE @ 19 NONAME + _ZN28CTsGraphicFileScalingHandler5NewLCER19MImageReadyCallBackR3RFsRK7TDesC16RK6TDesC8RK5TSizeNS_14TKindOfScalingE @ 20 NONAME + _ZN28CTsGraphicFileScalingHandler5NewLCER19MImageReadyCallBackRK10CFbsBitmapRK5TSizeNS_14TKindOfScalingE @ 21 NONAME + _ZN28CTsGraphicFileScalingHandlerD0Ev @ 22 NONAME + _ZN28CTsGraphicFileScalingHandlerD1Ev @ 23 NONAME + _ZN28CTsGraphicFileScalingHandlerD2Ev @ 24 NONAME + _ZTI18CTsResourceManager @ 25 NONAME + _ZTI22CTsWindowGroupsMonitor @ 26 NONAME + _ZTI23CTsWindowGroupsObserver @ 27 NONAME + _ZTI28CTsGraphicFileScalingHandler @ 28 NONAME + _ZTV18CTsResourceManager @ 29 NONAME + _ZTV22CTsWindowGroupsMonitor @ 30 NONAME + _ZTV23CTsWindowGroupsObserver @ 31 NONAME + _ZTV28CTsGraphicFileScalingHandler @ 32 NONAME + _ZThn28_N22CTsWindowGroupsMonitor10SubscribeLER23MTsWindowGroupsObserver @ 33 NONAME + _ZThn28_N22CTsWindowGroupsMonitor6CancelER23MTsWindowGroupsObserver @ 34 NONAME + _ZThn4_N18CTsResourceManager10ApaSessionEv @ 35 NONAME + _ZThn4_N18CTsResourceManager9WsSessionEv @ 36 NONAME diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/tsutils/group/bld.inf --- a/activityfw/tsutils/group/bld.inf Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/tsutils/group/bld.inf Wed Jun 23 18:33:40 2010 +0300 @@ -18,6 +18,8 @@ DEFAULT PRJ_EXPORTS +../inc/tsresourcemanager.h |../../../inc/tsresourcemanager.h +../inc/tswindowgroupsobserver.h |../../../inc/tswindowgroupsobserver.h ../inc/tsgraphicfilescalinghandler.h |../../../inc/tsgraphicfilescalinghandler.h PRJ_MMPFILES diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/tsutils/group/tsutils.mmp --- a/activityfw/tsutils/group/tsutils.mmp Fri Jun 11 13:58:37 2010 +0300 +++ b/activityfw/tsutils/group/tsutils.mmp Wed Jun 23 18:33:40 2010 +0300 @@ -20,16 +20,23 @@ CAPABILITY CAP_GENERAL_DLL +MW_LAYER_SYSTEMINCLUDE + USERINCLUDE ../inc SOURCEPATH ../src SOURCE tsgraphicfilescalinghandler.cpp +SOURCE tswindowgroupsmonitor.cpp +SOURCE tswindowgroupsobserver.cpp +SOURCE tsresourcemanager.cpp LIBRARY euser.lib LIBRARY bitmaptransforms.lib LIBRARY imageconversion.lib LIBRARY fbscli.lib LIBRARY efsrv.lib +LIBRARY ws32.lib +LIBRARY apgrfx.lib //EXPORTUNFROZEN diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/tsutils/inc/tsresourcemanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/tsutils/inc/tsresourcemanager.h Wed Jun 23 18:33:40 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 : + * + */ +#ifndef TSRESOURCEMANAGER_H +#define TSRESOURCEMANAGER_H + +#ifndef __E32SVR_H__ +#define __E32SVR_H__ +#endif +#include +#include +#include +#include + +/** + * Interface decalre methods to access initialized OS resources + */ +class MTsResourceManager +{ +public: + /** + * Access to initialized window server session + */ + virtual RWsSession& WsSession() =0; + + /** + * Access to initilaized APA session + */ + virtual RApaLsSession& ApaSession() =0; +}; + +/** + * Resource manager implemetatioin + */ +class CTsResourceManager: public CBase, + public MTsResourceManager +{ +public: + /** + * Two phase constructor + */ + IMPORT_C static CTsResourceManager* NewL(); + + /** + * Destructor + */ + IMPORT_C ~CTsResourceManager(); + + /** + * @see MTsResourceManager::WsSession + */ + IMPORT_C RWsSession& WsSession(); + + /** + * @see MTsResourceManager::ApaSession + */ + IMPORT_C RApaLsSession& ApaSession(); + +private: + /** + * Second phase constructor + */ + void ConstructL(); + +private: + RWsSession mWsSession; + RApaLsSession mApaSeesion; +}; + + + +#endif // TSRESOURCEMANAGER_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/tsutils/inc/tswindowgroupsobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/tsutils/inc/tswindowgroupsobserver.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,173 @@ +/* + * 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 TSWINDOWGROUPSOBSERVER_H +#define TSWINDOWGROUPSOBSERVER_H + +#include "tsresourcemanager.h" + +/** + * Interface declare mathods to notify about window server events + */ +class MTsWindowGroupsObserver +{ +public: + /** + * Method notidy about window group changes. + * @param rsc - resource manager + * @param wgs - list of window groups associated with running applications + */ + virtual void HandleWindowGroupChanged(MTsResourceManager &rsc, + const TArray & wgs) =0; +}; + +/** + * Interface declare methods to subscribe windo server events + */ +class MTsWindowGroupsMonitor +{ +public: + /** + * Method make subscription for window server events + * @param observer - events observer + */ + virtual void SubscribeL(MTsWindowGroupsObserver & observer) =0; + + /** + * Method cancel subscription for window server events + * @param observer - events observer + */ + virtual void Cancel(MTsWindowGroupsObserver &) =0; +}; + +/** + * Window server observer implementation. Class automaticly subscribe / cancel subscription + * at construction / destruction level. + * + */ +class CTsWindowGroupsObserver: public CBase, + public MTsWindowGroupsObserver +{ +public: + /** + * Destructor + * Function automaticly cancel subscrption to window server events + */ + IMPORT_C ~CTsWindowGroupsObserver(); + +protected: + /** + * First phase constructor + */ + IMPORT_C CTsWindowGroupsObserver(MTsWindowGroupsMonitor &); + + /** + * Second phase constructor. + * Function automaticly subscribe window server events + */ + IMPORT_C void BaseConstructL(); + +private: + MTsWindowGroupsMonitor & mMonitor; +}; + +/** + * Window server monitor implementation. + */ +class CTsWindowGroupsMonitor: public CActive, + public MTsWindowGroupsMonitor + +{ +public: + /** + * Two phase constructor + */ + IMPORT_C static CTsWindowGroupsMonitor* NewL(MTsResourceManager &); + + /** + * Destructor + */ + IMPORT_C ~CTsWindowGroupsMonitor(); + + /** + * @see MTsWindowGroupsMonitor::SubscribeL + */ + IMPORT_C void SubscribeL(MTsWindowGroupsObserver &); + + /** + * @see MTsWindowGroupsMonitor::Cancel + */ + IMPORT_C void Cancel(MTsWindowGroupsObserver &); + +protected: + /** + * @see CActive::RunL + */ + void RunL(); + + /** + * @see CActive::DoCancel + */ + void DoCancel(); + + /** + * @see CActive::RunError + */ + TInt RunError(TInt error); + +private: + /** + * First phase constructor + */ + CTsWindowGroupsMonitor(MTsResourceManager &); + + /** + * Second phase constructor + */ + void ConstructL(); + + /** + * Function subscribe for event to window server and activate object + */ + void Subscribe(); + + /** + * Function provide window server event to observers + */ + void ProvideEventL(); + + /** + * Function provide window server event to observer + */ + void ProvideEventL(TWsEvent, MTsWindowGroupsObserver &); + +private: + /** + * Registry of subscribed observers + */ + RPointerArray mObservers; + + /** + * Resources manager + */ + MTsResourceManager &mResources; + + /** + * Monitor window group + */ + RWindowGroup mWg; +}; +#endif //TSWINDOWGROUPSOBSERVER_H diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/tsutils/src/tsresourcemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/tsutils/src/tsresourcemanager.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description : + * + */ +#include "tswindowgroupsobserver.h" +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CTsResourceManager* CTsResourceManager::NewL() +{ + CTsResourceManager* self =new(ELeave) CTsResourceManager(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsResourceManager::ConstructL() +{ + User::LeaveIfError(mWsSession.Connect()); + User::LeaveIfError(mApaSeesion.Connect()); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CTsResourceManager::~CTsResourceManager() +{ + mApaSeesion.Close(); + mWsSession.Close(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C RWsSession& CTsResourceManager::WsSession() +{ + return mWsSession; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C RApaLsSession& CTsResourceManager::ApaSession() +{ + return mApaSeesion; +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/tsutils/src/tswindowgroupsmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/tsutils/src/tswindowgroupsmonitor.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description : + * + */ +#include "tswindowgroupsobserver.h" +#include + +const int KOrdinalPositionNoZOrder(-1); +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CTsWindowGroupsMonitor* CTsWindowGroupsMonitor::NewL(MTsResourceManager &resources) +{ + CTsWindowGroupsMonitor* self = new (ELeave) CTsWindowGroupsMonitor(resources); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CTsWindowGroupsMonitor::CTsWindowGroupsMonitor(MTsResourceManager &resources) +: + CActive(EPriorityStandard), + mResources(resources) +{ + CActiveScheduler::Add(this); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::ConstructL() +{ + + // Initial window group + mWg = RWindowGroup (mResources.WsSession()); + User::LeaveIfError (mWg.Construct ((TUint32)&mWg, EFalse)); + mWg.SetOrdinalPosition (KOrdinalPositionNoZOrder); + mWg.EnableReceiptOfFocus (EFalse); + + // Hide window + CApaWindowGroupName* wn = CApaWindowGroupName::NewLC(mResources.WsSession()); + wn->SetHidden (ETrue); + wn->SetWindowGroupName (mWg); + CleanupStack::PopAndDestroy (wn); + + // Window group change event + User::LeaveIfError (mWg.EnableGroupListChangeEvents()); + Subscribe(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CTsWindowGroupsMonitor::~CTsWindowGroupsMonitor() +{ + CActive::Cancel(); + mWg.Close(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTsWindowGroupsMonitor::SubscribeL(MTsWindowGroupsObserver &observer) +{ + const TInt offset(mObservers.Find(&observer)); + KErrNotFound == offset ? mObservers.AppendL(&observer) : + User::Leave(KErrAlreadyExists); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTsWindowGroupsMonitor::Cancel(MTsWindowGroupsObserver & observer) +{ + const TInt offset(mObservers.Find(&observer)); + if (KErrNotFound != offset) { + mObservers.Remove(offset); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::RunL() +{ + User::LeaveIfError(iStatus.Int()); + ProvideEventL(); + Subscribe(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::DoCancel() +{ + if (IsActive()) { + mResources.WsSession().EventReadyCancel(); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTsWindowGroupsMonitor::RunError(TInt error) +{ + if (!IsActive() && KErrCancel != error) { + Subscribe(); + } + return KErrNone; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::Subscribe() +{ + mResources.WsSession().EventReady( &iStatus ); + SetActive(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::ProvideEventL() +{ + TWsEvent wsEvent; + mResources.WsSession().GetEvent(wsEvent); + for (TInt iter(0); iter < mObservers.Count(); ++iter) { + ProvideEventL(wsEvent, *mObservers[iter]); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTsWindowGroupsMonitor::ProvideEventL(TWsEvent event, + MTsWindowGroupsObserver &observer) +{ + RArray wgInfo; + CleanupClosePushL(wgInfo); + switch(event.Type()) { + case EEventWindowGroupListChanged: + User::LeaveIfError(mResources.WsSession().WindowGroupList(&wgInfo)); + observer.HandleWindowGroupChanged(mResources, wgInfo.Array()); + break; + } + CleanupStack::PopAndDestroy(&wgInfo); +} diff -r 156f692b1687 -r b99b84bcd2d1 activityfw/tsutils/src/tswindowgroupsobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/activityfw/tsutils/src/tswindowgroupsobserver.cpp Wed Jun 23 18:33:40 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 "tswindowgroupsobserver.h" +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CTsWindowGroupsObserver::CTsWindowGroupsObserver(MTsWindowGroupsMonitor & monitor) +: + mMonitor(monitor) +{} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTsWindowGroupsObserver::BaseConstructL() +{ + mMonitor.SubscribeL(*this); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CTsWindowGroupsObserver::~CTsWindowGroupsObserver() +{ + mMonitor.Cancel(*this); +} diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/appfoundation.pro --- a/appfoundation/appfoundation.pro Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = subdirs - -SUBDIRS+= statemodel \ - appruntimemodel - -CONFIG += ordered - -tests:include(appfoundation_tests.pri) diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/appfoundation_tests.pri --- a/appfoundation/appfoundation_tests.pri Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -SUBDIRS += ./appruntimemodel/tsrc \ - ./statemodel/tsrc diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/appruntimemodel/appruntimemodel.pri --- a/appfoundation/appruntimemodel/appruntimemodel.pri Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += ./inc/*.h \ - ../../homescreensrv_plat/appruntimemodel_api/*.h - -SOURCES += ./src/*.cpp - diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/appruntimemodel/appruntimemodel.pro --- a/appfoundation/appruntimemodel/appruntimemodel.pro Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -DEPENDPATH += . \ - inc \ - src -INCLUDEPATH += . \ - inc - -symbian: { -TARGET.UID3 = 0x20022F37 -} - -# Sources -include(appruntimemodel.pri) -include(../../common.pri) - -DEFINES += HSRUNTIMEMODEL_LIB - -QT += xml - diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/appruntimemodel/inc/hsruntimefactory_p.h --- a/appfoundation/appruntimemodel/inc/hsruntimefactory_p.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +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: HsRuntime factory private implementation.. -* -*/ - - -#ifndef HSRUNTIMEFACTORY_P_H -#define HSRUNTIMEFACTORY_P_H - -#include "hsiruntimeprovider.h" - -class HsRuntimeFactory; -class IHsRuntimeProvider; - -class HsRuntimeFactoryPrivate : public QObject -{ - Q_OBJECT - -public: - HsRuntimeFactoryPrivate(HsRuntimeFactory* aPublic); - ~HsRuntimeFactoryPrivate(); - - QList runtimes(); - HsRuntime* createRuntime(const HsRuntimeToken& aToken); - IHsRuntimeProvider* loadProviderFromPlugin(const QString& aPluginName); - - -private: - Q_DISABLE_COPY(HsRuntimeFactoryPrivate) - -public: - HsRuntimeFactory* mQ; - QString mPluginManifestDirectory; - QString mPluginDirectory; -}; - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/appruntimemodel/inc/hsruntimeprovidermanifest.h --- a/appfoundation/appruntimemodel/inc/hsruntimeprovidermanifest.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +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: HsRuntime provider manifest. -* -*/ - - -#ifndef HSRUNTIMEPROVIDERMANIFEST_H -#define HSRUNTIMEPROVIDERMANIFEST_H - -#include - -#include "hsruntimemodel_global.h" -#include "hsiruntimeprovider.h" - -class HsRuntimeProviderManifestPrivate; - -class HSRUNTIMEMODEL_EXPORT HsRuntimeProviderManifest : public QObject -{ - Q_OBJECT - -public: - - HsRuntimeProviderManifest(QObject* aParent = 0); - virtual ~HsRuntimeProviderManifest(); - - bool loadFromXml(const QString& aFileName) const; - QList runtimes() const; - bool loadOnQuery() const; - -private: - Q_DISABLE_COPY(HsRuntimeProviderManifest) - -private: - HsRuntimeProviderManifestPrivate* mD; - friend class HsRuntimeProviderManifestPrivate; - -}; - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/appruntimemodel/inc/hsruntimeprovidermanifest_p.h --- a/appfoundation/appruntimemodel/inc/hsruntimeprovidermanifest_p.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +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: HsRuntime provider manifest private implementation. -* -*/ - - -#ifndef HSRUNTIMEPROVIDERMANIFEST_P_H -#define HSRUNTIMEPROVIDERMANIFEST_P_H - -#include - -#include "hsiruntimeprovider.h" - -class HsRuntimeProviderManifest; - -class HsRuntimeProviderManifestPrivate : public QObject -{ - Q_OBJECT - -public: - HsRuntimeProviderManifestPrivate(HsRuntimeProviderManifest* aPublic); - ~HsRuntimeProviderManifestPrivate(); - - QList runtimes() const; - bool loadFromXml(const QString& aFileName); - -private: - QString parseAttribute(QDomElement& aElement, const QString& aAttributeName, bool aIsRequired = true) const; - Q_DISABLE_COPY(HsRuntimeProviderManifestPrivate) - -public: - - HsRuntimeProviderManifest* mQ; - QList mRuntimeTokens; - bool mLoadOnQuery; - -}; - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/appruntimemodel/src/hsruntimefactory.cpp --- a/appfoundation/appruntimemodel/src/hsruntimefactory.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,228 +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: HsRuntime factory. -* -*/ - - -#include "hsruntimefactory.h" -#include "hsruntimefactory_p.h" -#include "hsruntimeprovidermanifest.h" -#include "hstest_global.h" - -#include -#include -#include - - -HsRuntimeFactoryPrivate::HsRuntimeFactoryPrivate(HsRuntimeFactory* aPublic) - : QObject(aPublic), - mQ(aPublic) -{ - -} - - -HsRuntimeFactoryPrivate::~HsRuntimeFactoryPrivate() -{ - -} - -QList HsRuntimeFactoryPrivate::runtimes() -{ - QStringList pluginPaths; - - //Check plugin dirs from root of different drives - QFileInfoList drives = QDir::drives(); - for(int i=0; i < drives.count(); i++) - { - QFileInfo drive = drives.at(i); - QString driveLetter = drive.absolutePath(); - QString path = driveLetter + mPluginManifestDirectory; - if(QDir(path).exists()) - { - pluginPaths << path; - } - } - - //Check plugin dir relative to current dir - if(QDir(mPluginManifestDirectory).exists() && !pluginPaths.contains(QDir(mPluginManifestDirectory).absolutePath())) - { - pluginPaths << mPluginManifestDirectory; - } - - QList runtimes; - - for(int h=0; h < pluginPaths.count(); h++) - { - QString path = pluginPaths.at(h); - QDir dir(path); - QStringList filters("*.manifest"); - - for(int i=0; i < dir.entryList(filters, QDir::Files).count(); ++i) - { - QString fileName = dir.entryList(filters, QDir::Files).at(i); - - HsRuntimeProviderManifest manifest; - manifest.loadFromXml(dir.absoluteFilePath(fileName)); - - if(manifest.loadOnQuery()) - { - QList tokens = manifest.runtimes(); - for(int j=0; j < tokens.count(); ++j) - { - HsRuntimeToken token = tokens.at(j); - IHsRuntimeProvider* provider = loadProviderFromPlugin(token.mLibrary); - if(provider) - { - runtimes << provider->runtimes(); - delete provider; - } - } - } - else - { - runtimes << manifest.runtimes(); - } - } - } - return runtimes; -} - -HsRuntime* HsRuntimeFactoryPrivate::createRuntime(const HsRuntimeToken& aToken) -{ - IHsRuntimeProvider* provider = loadProviderFromPlugin(aToken.mLibrary); - if(!provider) - { - HSDEBUG("Runtime creation failed - No provider.") - return 0; - } - - HsRuntime* runtime = provider->createRuntime(aToken); - delete provider; - if(!runtime) - { - HSDEBUG("Runtime creation failed.") - } - return runtime; -} - -IHsRuntimeProvider* HsRuntimeFactoryPrivate::loadProviderFromPlugin(const QString& aPluginName) -{ - QStringList pluginPaths; - - //Check plugin dirs from root of different drives - QFileInfoList drives = QDir::drives(); - for(int i=0; i < drives.count(); i++) - { - QFileInfo drive = drives.at(i); - QString driveLetter = drive.absolutePath(); - QString path = driveLetter + mPluginDirectory; - if(QDir(path).exists()) - { - pluginPaths << path; - } - } - - - //Check plugin dir relative to current dir - if(QDir(mPluginManifestDirectory).exists() && !pluginPaths.contains(QDir(mPluginDirectory).absolutePath())) - { - pluginPaths << mPluginDirectory; - } - - IHsRuntimeProvider* provider = 0; - QPluginLoader loader; - QObject* plugin = 0; - - for(int i=0; i < pluginPaths.count(); i++) - { - QString path = pluginPaths.at(i); - QString fileName = QDir(path).absoluteFilePath(aPluginName); - - loader.setFileName(fileName); - plugin = loader.instance(); - provider = qobject_cast(plugin); - if(provider) - { - return provider; - } - - //Don't leak memory if provider not IHsRuntimeProvider - if(plugin) - { - HSDEBUG("Runtime provider load - !provider, deleting plugin.") - delete plugin; - } - } - - HSDEBUG("Runtime provider load failed - Not found.") - return 0; -} - -/*! - \class HsRuntimeFactory - \ingroup group_hsruntimemodel - \brief Finds and creates home screen runtimes. - - HsRuntime factory finds home screen runtimes from HsRuntime provider - plugins. The search is done based on given plugin manifest - and plugin binary directories. Found runtimes are returned as - a list of HsRuntime tokens. HsRuntime factory creates an instance of - a HsRuntime base on a HsRuntime token that is given to it. -*/ - -/*! - Constructor. - - \a aPluginManifestDirectory Directory that contains plugin manifests. - \a aPluginDirectory Directory that contains plugin binaries. - \a aParent Parent object. -*/ -HsRuntimeFactory::HsRuntimeFactory(const QString& aPluginManifestDirectory, - const QString& aPluginDirectory, - QObject* aParent) - : QObject(aParent) -{ - mD = new HsRuntimeFactoryPrivate(this); - mD->mPluginManifestDirectory = aPluginManifestDirectory; - mD->mPluginDirectory = aPluginDirectory; -} - -/*! - Destructor. -*/ -HsRuntimeFactory::~HsRuntimeFactory() -{ - -} - -/*! - Returns found runtimes as a list of HsRuntime tokens. -*/ -QList HsRuntimeFactory::runtimes() -{ - return mD->runtimes(); -} - -/*! - Creates and returns a HsRuntime based on the given token. - \a aToken Identifies the HsRuntime to be created. - - Return The created HsRuntime. -*/ -HsRuntime* HsRuntimeFactory::createRuntime(const HsRuntimeToken& aToken) -{ - return mD->createRuntime(aToken); -} diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/appruntimemodel/src/hsruntimeprovidermanifest.cpp --- a/appfoundation/appruntimemodel/src/hsruntimeprovidermanifest.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +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: HsRuntime provider manifest. -* -*/ - - -#include "hsruntimeprovidermanifest.h" -#include "hsruntimeprovidermanifest_p.h" -#include "hstest_global.h" - -#include -#include - -HsRuntimeProviderManifestPrivate::HsRuntimeProviderManifestPrivate(HsRuntimeProviderManifest* aPublic) - : QObject(aPublic), - mQ(aPublic), - mLoadOnQuery(false) -{ - -} - -HsRuntimeProviderManifestPrivate::~HsRuntimeProviderManifestPrivate() -{ - -} - -bool HsRuntimeProviderManifestPrivate::loadFromXml(const QString& aFileName) -{ - mRuntimeTokens.clear(); - - QFile file(aFileName); - if(!file.exists()) - { - return false; - } - - QDomDocument document; - if(!document.setContent(&file)) - { - return false; - } - - QDomElement element = document.documentElement(); - if(element.tagName() != "runtimeprovider") - { - return false; - } - - mLoadOnQuery = false; - QDomAttr attribute = element.attributeNode("loadonquery"); - if(attribute.value().toLower() == "true") - { - mLoadOnQuery = true; - } - - QList tokens; - HsRuntimeToken token; - - QDomNodeList runtimes = element.elementsByTagName("runtime"); - - for(int i = 0; i < runtimes.count(); ++i) - { - element = runtimes.at(i).toElement(); - token.mLibrary = parseAttribute(element, "library"); - token.mUri = parseAttribute(element, "uri"); - tokens << token; - } - - mRuntimeTokens = tokens; - return true; -} - -QList HsRuntimeProviderManifestPrivate::runtimes() const -{ - return mRuntimeTokens; -} - -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -QString HsRuntimeProviderManifestPrivate::parseAttribute(QDomElement& aElement, - const QString& aAttributeName, - bool aIsRequired) const -{ - QDomAttr attribute = aElement.attributeNode(aAttributeName); - if(attribute.isNull() || attribute.value().isEmpty()) - { - if(aIsRequired) - { - HSDEBUG("Required attribute missing") - } - else - { - HSDEBUG("Attribute missing") - } - - return QString(); - } - - return attribute.value(); -} - - -/*! - \class HsRuntimeProviderManifest - \ingroup group_hsruntimemodel - \brief Loads home screen HsRuntime tokens from an XML manifest file. - Used by the HsRuntimeFactory for loading HsRuntime tokens from an XML - manifest file. - -*/ - -/*! - Constructor. Loads runtimes as HsRuntime tokens from the given - manifest file. - \a aParent Parent object. -*/ -HsRuntimeProviderManifest::HsRuntimeProviderManifest(QObject* aParent) - : QObject(aParent) -{ - mD = new HsRuntimeProviderManifestPrivate(this); -} - - -/*! - Destructor. -*/ -HsRuntimeProviderManifest::~HsRuntimeProviderManifest() -{ - -} - -/*! - return loaded runtimes as HsRuntime tokens. -*/ -QList HsRuntimeProviderManifest::runtimes() const -{ - return mD->runtimes(); -} - -/*! - Tells if the HsRuntime tokens must be asked from plugin - instead of manifest file. - - return True if loading required, false otherwise. -*/ -bool HsRuntimeProviderManifest::loadOnQuery() const -{ - return mD->mLoadOnQuery; -} - - -/*! - Loads runtimes as HsRuntime tokens from a manifest file. - \a aFileName Manifest file name. - - return true if load was succesfull, false otherwise -*/ -bool HsRuntimeProviderManifest::loadFromXml(const QString& aFileName) const -{ - return mD->loadFromXml(aFileName); -} diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/statemodel/inc/hsstatefactory_p.h --- a/appfoundation/statemodel/inc/hsstatefactory_p.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +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: State factory private implementation. -* -*/ - - -#ifndef HSSTATEFACTORY_P_H -#define HSSTATEFACTORY_P_H - -#include "hsistateprovider.h" - -class QState; -class HsStateFactory; -class IHsStateProvider; - -class HsStateFactoryPrivate : public QObject -{ - Q_OBJECT - -public: - - HsStateFactoryPrivate(HsStateFactory* aPublic); - ~HsStateFactoryPrivate(); - -private: - - Q_DISABLE_COPY(HsStateFactoryPrivate) - -public: - QList states(); - QState* createState(const HsStateToken& aToken); - IHsStateProvider* loadProviderFromPlugin(const QString& aPluginName); - -public: - HsStateFactory* mQ; - QString mPluginManifestDirectory; - QString mPluginDirectory; - -}; - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/statemodel/inc/hsstateprovidermanifest.h --- a/appfoundation/statemodel/inc/hsstateprovidermanifest.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: State provider manifest. -* -*/ - - -#ifndef HSSTATEPROVIDERMANIFEST_H -#define HSSTATEPROVIDERMANIFEST_H - -#include - -#include "hsstatemodel_global.h" -#include "hsistateprovider.h" - -class HsStateProviderManifestPrivate; - -class HSSTATEMODEL_EXPORT HsStateProviderManifest : public QObject -{ - Q_OBJECT - -public: - HsStateProviderManifest(QObject* aParent = 0); - virtual ~HsStateProviderManifest(); - - QList states() const; - bool loadOnQuery() const; - bool loadFromXml(const QString& aFileName); - -private: - Q_DISABLE_COPY(HsStateProviderManifest) - -private: - HsStateProviderManifestPrivate* mD; - friend class HsStateProviderManifestPrivate; - -}; - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/statemodel/inc/hsstateprovidermanifest_p.h --- a/appfoundation/statemodel/inc/hsstateprovidermanifest_p.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: State provider manifest private implementation. -* -*/ - - -#ifndef HSSTATEPROVIDERMANIFEST_P_H -#define HSSTATEPROVIDERMANIFEST_P_H - -#include - -#include "hsistateprovider.h" - -class HsStateProviderManifest; -class HsStateProviderManifestPrivate : public QObject -{ - Q_OBJECT - -public: - HsStateProviderManifestPrivate(HsStateProviderManifest* aPublic); - ~HsStateProviderManifestPrivate(); - - bool loadFromXml(const QString& aFileName); - QList states() const; - -private: - QString parseAttribute(QDomElement& aElement, const QString& aAttributeName, bool aIsRequired = true) const; - Q_DISABLE_COPY(HsStateProviderManifestPrivate) - -public: - HsStateProviderManifest* mQ; - QList mStateTokens; - bool mLoadOnQuery; -}; - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/statemodel/src/hsstatefactory.cpp --- a/appfoundation/statemodel/src/hsstatefactory.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,225 +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: State factory. -* -*/ - -#include -#include -#include -#include - -#include "hsstatefactory.h" -#include "hsstatefactory_p.h" -#include "hsstateprovidermanifest.h" -#include "hstest_global.h" - -HsStateFactoryPrivate::HsStateFactoryPrivate(HsStateFactory* aPublic) - : QObject(aPublic), - mQ(aPublic) -{ - -} - -HsStateFactoryPrivate::~HsStateFactoryPrivate() -{ - -} - -QList HsStateFactoryPrivate::states() -{ - QStringList pluginPaths; - - //Check plugin dirs from root of different drives - QFileInfoList drives = QDir::drives(); - for(int i=0; i < drives.count(); i++) - { - QFileInfo drive = drives.at(i); - QString driveLetter = drive.absolutePath(); - QString path = driveLetter + mPluginManifestDirectory; - if(QDir(path).exists()) - { - pluginPaths << path; - } - } - - //Check plugin dir relative to current dir - if(QDir(mPluginManifestDirectory).exists() && !pluginPaths.contains(QDir(mPluginManifestDirectory).absolutePath())) - { - pluginPaths << mPluginManifestDirectory; - } - - QList states; - - for(int h=0; h < pluginPaths.count(); h++) - { - QString path = pluginPaths.at(h); - QDir dir(path); - QStringList filters("*.manifest"); - - for(int i=0; i < dir.entryList(filters, QDir::Files).count(); ++i) - { - QString fileName = dir.entryList(filters, QDir::Files).at(i); - - HsStateProviderManifest manifest; - manifest.loadFromXml(dir.absoluteFilePath(fileName)); - - if(manifest.loadOnQuery()) - { - QList tokens = manifest.states(); - for(int j=0; j < tokens.count(); ++j) - { - HsStateToken token = tokens.at(j); - IHsStateProvider* provider = loadProviderFromPlugin(token.mLibrary); - if(provider) - { - states << provider->states(); - delete provider; - } - } - } - else - { - states << manifest.states(); - } - } - } - return states; -} - -QState* HsStateFactoryPrivate::createState(const HsStateToken& aToken) -{ - IHsStateProvider* provider = loadProviderFromPlugin(aToken.mLibrary); - if(!provider) - { - HSDEBUG("Widget creation failed - No provider.") - return 0; - } - - QState* state = provider->createState(aToken); - delete provider; - if(!state) - { - HSDEBUG("State creation failed.") - } - return state; -} - -IHsStateProvider* HsStateFactoryPrivate::loadProviderFromPlugin(const QString& aPluginName) -{ - QStringList pluginPaths; - - //Check plugin dirs from root of different drives - QFileInfoList drives = QDir::drives(); - for(int i=0; i < drives.count(); i++) - { - QFileInfo drive = drives.at(i); - QString driveLetter = drive.absolutePath(); - QString path = driveLetter + mPluginDirectory; - if(QDir(path).exists()) - { - pluginPaths << path; - } - } - - - //Check plugin dir relative to current dir - if(QDir(mPluginManifestDirectory).exists() && !pluginPaths.contains(QDir(mPluginDirectory).absolutePath())) - { - pluginPaths << mPluginDirectory; - } - - IHsStateProvider* provider = 0; - QPluginLoader loader; - QObject* plugin = 0; - - for(int i=0; i < pluginPaths.count(); i++) - { - QString path = pluginPaths.at(i); - QString fileName = QDir(path).absoluteFilePath(aPluginName); - - loader.setFileName(fileName); - plugin = loader.instance(); - provider = qobject_cast(plugin); - if(provider) - { - return provider; - } - - //Don't leak memory if provider not IHsStateProvider - if(plugin) - { - HSDEBUG("State provider load - !provider, deleting plugin.") - delete plugin; - } - } - - HSDEBUG("State provider load failed - Not found.") - return 0; -} - -/*! - \class HsStateFactory - \ingroup group_hsstatemodel - \brief Finds and creates home screen states. - State factory finds home screen states from state provider - plugins. The search is done based on given plugin manifest - and plugin binary directories. Found states are returned as - a list of state tokens. State factory creates an instance of - a state base on a state token that is given to it. -*/ - -/*! - Constructor. - \a aPluginManifestDirectory Directory that contains plugin manifests. - \a aPluginDirectory Directory that contains plugin binaries. - \a aParent Parent object. -*/ -HsStateFactory::HsStateFactory(const QString& aPluginManifestDirectory, - const QString& aPluginDirectory, - QObject* aParent) - : QObject(aParent) -{ - mD = new HsStateFactoryPrivate(this); - mD->mPluginManifestDirectory = aPluginManifestDirectory; - mD->mPluginDirectory = aPluginDirectory; -} - - -/*! - Destructor. -*/ -HsStateFactory::~HsStateFactory() -{ - -} - -/*! - Returns found states as a list of state tokens. -*/ -QList HsStateFactory::states() -{ - return mD->states(); -} - -/*! - Creates and returns a state based on the given token. - \a aToken Identifies the state to be created. - - Returns The created state. -*/ -QState* HsStateFactory::createState(const HsStateToken& aToken) -{ - return mD->createState(aToken); -} diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/statemodel/src/hsstateprovidermanifest.cpp --- a/appfoundation/statemodel/src/hsstateprovidermanifest.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +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: State provider manifest. -* -*/ - - -#include -#include - -#include "hsstateprovidermanifest.h" -#include "hsstateprovidermanifest_p.h" -#include "hstest_global.h" - -HsStateProviderManifestPrivate::HsStateProviderManifestPrivate(HsStateProviderManifest* aPublic) - : QObject(aPublic), - mQ(aPublic), - mLoadOnQuery(false) -{ -} - -HsStateProviderManifestPrivate::~HsStateProviderManifestPrivate() -{ - -} - -bool HsStateProviderManifestPrivate::loadFromXml(const QString& aFileName) -{ - mStateTokens.clear(); - - QFile file(aFileName); - if(!file.exists()) - { - return false; - } - - QDomDocument document; - if(!document.setContent(&file)) - { - return false; - } - - QDomElement element = document.documentElement(); - if(element.tagName() != "stateprovider") - { - return false; - } - - mLoadOnQuery = false; - QDomAttr attribute = element.attributeNode("loadonquery"); - if(attribute.value().toLower() == "true") - { - mLoadOnQuery = true; - } - - QList tokens; - HsStateToken token; - - QDomNodeList states = element.elementsByTagName("state"); - - for(int i = 0; i < states.count(); ++i) - { - element = states.at(i).toElement(); - token.mLibrary = parseAttribute(element, "library"); - token.mUri = parseAttribute(element, "uri"); - tokens << token; - } - - mStateTokens = tokens; - return true; -} - -QList HsStateProviderManifestPrivate::states() const -{ - return mStateTokens; -} - -QString HsStateProviderManifestPrivate::parseAttribute(QDomElement& aElement, const QString& aAttributeName, bool aIsRequired) const -{ - QDomAttr attribute = aElement.attributeNode(aAttributeName); - if(attribute.isNull() || attribute.value().isEmpty()) - { - if(aIsRequired) - { - HSDEBUG("Required attribute missing") - } - else - { - HSDEBUG("Attribute missing") - } - - return QString(); - } - - return attribute.value(); -} - - -/*! - \class HsStateProviderManifest - \ingroup group_hsstatemodel - \brief Loads home screen state tokens from an XML manifest file. - Used by the HsStateFactory for loading state tokens from an XML - manifest file. -*/ - -/*! - Constructor. Loads states as state tokens from the given - manifest file. - \a aParent Parent object. -*/ -HsStateProviderManifest::HsStateProviderManifest(QObject* aParent) - : QObject(aParent) -{ - mD = new HsStateProviderManifestPrivate(this); -} - -/*! - Destructor. -*/ -HsStateProviderManifest::~HsStateProviderManifest() -{ - -} - -/*! - Returns loaded states as state tokens. -*/ -QList HsStateProviderManifest::states() const -{ - return mD->states(); -} - -/*! - Returns true if the state tokens must be asked from plugin - instead of manifest file. -*/ -bool HsStateProviderManifest::loadOnQuery()const -{ - return mD->mLoadOnQuery; -} - -/*! - Loads states as state tokens from a manifest file. - \a aFileName Manifest file name. - - Returns true if load was succesfull, false otherwise -*/ -bool HsStateProviderManifest::loadFromXml(const QString& aFileName) -{ - return mD->loadFromXml(aFileName); -} - diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/statemodel/statemodel.pri --- a/appfoundation/statemodel/statemodel.pri Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += ./inc/*.h \ - ../../homescreensrv_plat/statemodel_api/*.h - -SOURCES += ./src/*.cpp - diff -r 156f692b1687 -r b99b84bcd2d1 appfoundation/statemodel/statemodel.pro --- a/appfoundation/statemodel/statemodel.pro Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -DEPENDPATH += . \ - inc \ - src -INCLUDEPATH += . \ - inc - -symbian: { -TARGET.UID3 = 0x20022F3B -} - -# Sources -include(statemodel.pri) -include(../../common.pri) - -DEFINES += HSSTATEMODEL_LIB - -QT += xml diff -r 156f692b1687 -r b99b84bcd2d1 common.pri --- a/common.pri Fri Jun 11 13:58:37 2010 +0300 +++ b/common.pri Wed Jun 23 18:33:40 2010 +0300 @@ -77,11 +77,9 @@ win32 { # add platfrom API for windows - INCLUDEPATH += \ - $$PWD/homescreensrv_plat/appruntimemodel_api \ + INCLUDEPATH += \ $$PWD/homescreensrv_plat/contentstorage_api \ - $$PWD/homescreensrv_plat/hswidgetmodel_api \ - $$PWD/homescreensrv_plat/statemodel_api \ + $$PWD/homescreensrv_plat/hswidgetmodel_api \ $$PWD/homescreensrv_plat/homescreen_information_api/inc } diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/bwins/cautilsu.def --- a/contentstorage/bwins/cautilsu.def Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/bwins/cautilsu.def Wed Jun 23 18:33:40 2010 +0300 @@ -7,95 +7,96 @@ ?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 - ?SetId@CCaInnerIconDescription@@QAEXH@Z @ 26 NONAME ; void CCaInnerIconDescription::SetId(int) - ?GetStringId@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 27 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetStringId(void) const - ?GetFlags@CCaInnerEntry@@QBEIXZ @ 28 NONAME ; unsigned int CCaInnerEntry::GetFlags(void) const - ?NewL@CCaInnerIconDescription@@SAPAV1@XZ @ 29 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewL(void) - ?NewL@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 30 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewL(class TDesC16 const &) - ?Find@RCaEntryAttrArray@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 31 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TPtrC16 &) - ?SetFileNameL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 32 NONAME ; void CCaInnerIconDescription::SetFileNameL(class TDesC16 const &) - ?SetParentId@CCaInnerNotifierFilter@@QAEXH@Z @ 33 NONAME ; void CCaInnerNotifierFilter::SetParentId(int) - ?SetFlagsOn@CCaInnerQuery@@QAEXI@Z @ 34 NONAME ; void CCaInnerQuery::SetFlagsOn(unsigned int) - ?SetTypeNames@CCaInnerNotifierFilter@@QAEXPAVCDesC16ArrayFlat@@@Z @ 35 NONAME ; void CCaInnerNotifierFilter::SetTypeNames(class CDesC16ArrayFlat *) - ?NewLC@CCaLocalizationEntry@@SAPAV1@XZ @ 36 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewLC(void) - ?NewL@CCaInnerNotifierFilter@@SAPAV1@W4TNotifierType@1@@Z @ 37 NONAME ; class CCaInnerNotifierFilter * CCaInnerNotifierFilter::NewL(enum CCaInnerNotifierFilter::TNotifierType) - ?GetTableName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 38 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetTableName(void) const - ?GetFlagsOff@CCaInnerQuery@@QBEIXZ @ 39 NONAME ; unsigned int CCaInnerQuery::GetFlagsOff(void) const - ?InternalizeL@CCaInnerEntry@@QAEXAAVRReadStream@@@Z @ 40 NONAME ; void CCaInnerEntry::InternalizeL(class RReadStream &) - ?GetAttributeName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 41 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetAttributeName(void) const - ?GetTUint@MenuUtils@@SAHABVTDesC16@@AAI@Z @ 42 NONAME ; int MenuUtils::GetTUint(class TDesC16 const &, unsigned int &) - ?AddAttributeL@CCaInnerQuery@@QAEXABVTDesC16@@0@Z @ 43 NONAME ; void CCaInnerQuery::AddAttributeL(class TDesC16 const &, class TDesC16 const &) - ?Exist@RCaEntryAttrArray@@QAEHABVTDesC16@@@Z @ 44 NONAME ; int RCaEntryAttrArray::Exist(class TDesC16 const &) - ?AddAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@0@Z @ 45 NONAME ; void CCaInnerEntry::AddAttributeL(class TDesC16 const &, class TDesC16 const &) - ?GetParentId@CCaInnerQuery@@QBEHXZ @ 46 NONAME ; int CCaInnerQuery::GetParentId(void) const - ?SetDescriptionL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 47 NONAME ; void CCaInnerEntry::SetDescriptionL(class TDesC16 const &) + ?GetQmFilename@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 9 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetQmFilename(void) const + ?GetText@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 10 NONAME ; class RBuf16 const & CCaInnerEntry::GetText(void) const + ?InternalizeL@RCaEntriesArray@@QAEXAAVRReadStream@@@Z @ 11 NONAME ; void RCaEntriesArray::InternalizeL(class RReadStream &) + ?SetIdsL@CCaInnerNotifierFilter@@QAEXABV?$RArray@H@@@Z @ 12 NONAME ; void CCaInnerNotifierFilter::SetIdsL(class RArray const &) + ?GetTextId@CCaLocalizationEntry@@QBEHXZ @ 13 NONAME ; int CCaLocalizationEntry::GetTextId(void) const + ?GetUid@CCaInnerEntry@@QBEJXZ @ 14 NONAME ; long CCaInnerEntry::GetUid(void) const + ?SetId@CCaInnerEntry@@QAEXI@Z @ 15 NONAME ; void CCaInnerEntry::SetId(unsigned int) + ?GetSort@CCaInnerQuery@@QBE?AW4TSortAttribute@1@XZ @ 16 NONAME ; enum CCaInnerQuery::TSortAttribute CCaInnerQuery::GetSort(void) const + ?SetCount@CCaInnerQuery@@QAEXI@Z @ 17 NONAME ; void CCaInnerQuery::SetCount(unsigned int) + ?ExternalizeL@CCaInnerNotifierFilter@@QBEXAAVRWriteStream@@@Z @ 18 NONAME ; void CCaInnerNotifierFilter::ExternalizeL(class RWriteStream &) const + ?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 19 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TDes16 &) + ?Find@RCaEntryAttrArray@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 20 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TDes16 &) + ?SetRowId@CCaLocalizationEntry@@QAEXI@Z @ 21 NONAME ; void CCaLocalizationEntry::SetRowId(unsigned int) + ?GetUid@CCaInnerQuery@@QBEIXZ @ 22 NONAME ; unsigned int CCaInnerQuery::GetUid(void) const + ?SetFlags@CCaInnerEntry@@QAEXI@Z @ 23 NONAME ; void CCaInnerEntry::SetFlags(unsigned int) + ?SetAttributeNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 24 NONAME ; void CCaLocalizationEntry::SetAttributeNameL(class TDesC16 const &) + ?GetCount@CCaInnerQuery@@QBEIXZ @ 25 NONAME ; unsigned int CCaInnerQuery::GetCount(void) const + ?GetParentId@CCaInnerNotifierFilter@@QBEHXZ @ 26 NONAME ; int CCaInnerNotifierFilter::GetParentId(void) const + ?SetId@CCaInnerIconDescription@@QAEXH@Z @ 27 NONAME ; void CCaInnerIconDescription::SetId(int) + ?GetStringId@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 28 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetStringId(void) const + ?GetFlags@CCaInnerEntry@@QBEIXZ @ 29 NONAME ; unsigned int CCaInnerEntry::GetFlags(void) const + ?NewL@CCaInnerIconDescription@@SAPAV1@XZ @ 30 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewL(void) + ?NewL@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 31 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewL(class TDesC16 const &) + ?Find@RCaEntryAttrArray@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 32 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TPtrC16 &) + ?SetFileNameL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 33 NONAME ; void CCaInnerIconDescription::SetFileNameL(class TDesC16 const &) + ?SetParentId@CCaInnerNotifierFilter@@QAEXH@Z @ 34 NONAME ; void CCaInnerNotifierFilter::SetParentId(int) + ?SetFlagsOn@CCaInnerQuery@@QAEXI@Z @ 35 NONAME ; void CCaInnerQuery::SetFlagsOn(unsigned int) + ?SetTypeNames@CCaInnerNotifierFilter@@QAEXPAVCDesC16ArrayFlat@@@Z @ 36 NONAME ; void CCaInnerNotifierFilter::SetTypeNames(class CDesC16ArrayFlat *) + ?NewLC@CCaLocalizationEntry@@SAPAV1@XZ @ 37 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewLC(void) + ?NewL@CCaInnerNotifierFilter@@SAPAV1@W4TNotifierType@1@@Z @ 38 NONAME ; class CCaInnerNotifierFilter * CCaInnerNotifierFilter::NewL(enum CCaInnerNotifierFilter::TNotifierType) + ?GetTableName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 39 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetTableName(void) const + ?GetFlagsOff@CCaInnerQuery@@QBEIXZ @ 40 NONAME ; unsigned int CCaInnerQuery::GetFlagsOff(void) const + ?InternalizeL@CCaInnerEntry@@QAEXAAVRReadStream@@@Z @ 41 NONAME ; void CCaInnerEntry::InternalizeL(class RReadStream &) + ?GetAttributeName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 42 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetAttributeName(void) const + ?GetTUint@MenuUtils@@SAHABVTDesC16@@AAI@Z @ 43 NONAME ; int MenuUtils::GetTUint(class TDesC16 const &, unsigned int &) + ?AddAttributeL@CCaInnerQuery@@QAEXABVTDesC16@@0@Z @ 44 NONAME ; void CCaInnerQuery::AddAttributeL(class TDesC16 const &, class TDesC16 const &) + ?Exist@RCaEntryAttrArray@@QAEHABVTDesC16@@@Z @ 45 NONAME ; int RCaEntryAttrArray::Exist(class TDesC16 const &) + ?AddAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@0@Z @ 46 NONAME ; void CCaInnerEntry::AddAttributeL(class TDesC16 const &, class TDesC16 const &) + ?GetParentId@CCaInnerQuery@@QBEHXZ @ 47 NONAME ; int CCaInnerQuery::GetParentId(void) const ?SetEntryRole@CCaInnerNotifierFilter@@QAEXW4TEntryRole@@@Z @ 48 NONAME ; void CCaInnerNotifierFilter::SetEntryRole(enum TEntryRole) ?GetFlagsOn@CCaInnerQuery@@QBEIXZ @ 49 NONAME ; unsigned int CCaInnerQuery::GetFlagsOn(void) const ?GetIconId@CCaInnerEntry@@QBEHXZ @ 50 NONAME ; int CCaInnerEntry::GetIconId(void) const ?SetIconDataL@CCaInnerEntry@@QAEXABVTDesC16@@00@Z @ 51 NONAME ; void CCaInnerEntry::SetIconDataL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &) ?GetEntryRole@CCaInnerNotifierFilter@@QBE?AW4TEntryRole@@XZ @ 52 NONAME ; enum TEntryRole CCaInnerNotifierFilter::GetEntryRole(void) const ?GetId@CCaInnerEntry@@QBEHXZ @ 53 NONAME ; int CCaInnerEntry::GetId(void) const - ?SetEntryTypeNames@CCaInnerQuery@@QAEXPAVCDesC16ArrayFlat@@@Z @ 54 NONAME ; void CCaInnerQuery::SetEntryTypeNames(class CDesC16ArrayFlat *) - ?GetNotifierType@CCaInnerNotifierFilter@@QBE?AW4TNotifierType@1@XZ @ 55 NONAME ; enum CCaInnerNotifierFilter::TNotifierType CCaInnerNotifierFilter::GetNotifierType(void) const - ?ExternalizeL@CCaInnerEntry@@QBEXAAVRWriteStream@@@Z @ 56 NONAME ; void CCaInnerEntry::ExternalizeL(class RWriteStream &) const - ?SetRole@CCaInnerQuery@@QAEXH@Z @ 57 NONAME ; void CCaInnerQuery::SetRole(int) - ?NewL@CCaLocalizationEntry@@SAPAV1@XZ @ 58 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewL(void) - ?InternalizeL@CCaInnerNotifierFilter@@QAEXAAVRReadStream@@@Z @ 59 NONAME ; void CCaInnerNotifierFilter::InternalizeL(class RReadStream &) - ?InternalizeL@RCaIdsArray@@QAEXAAVRReadStream@@@Z @ 60 NONAME ; void RCaIdsArray::InternalizeL(class RReadStream &) - ?MarshalDataLC@RCaIdsArray@@QBEPAVHBufC8@@XZ @ 61 NONAME ; class HBufC8 * RCaIdsArray::MarshalDataLC(void) const - ?GetEntryTypeNames@CCaInnerQuery@@QBEPBVCDesC16ArrayFlat@@XZ @ 62 NONAME ; class CDesC16ArrayFlat const * CCaInnerQuery::GetEntryTypeNames(void) const - ?SetValueL@CCaEntryAttribute@@QAEXABVTDesC16@@@Z @ 63 NONAME ; void CCaEntryAttribute::SetValueL(class TDesC16 const &) - ?SetSkinIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 64 NONAME ; void CCaInnerIconDescription::SetSkinIdL(class TDesC16 const &) - ?ExternalizeL@CCaInnerQuery@@QBEXAAVRWriteStream@@@Z @ 65 NONAME ; void CCaInnerQuery::ExternalizeL(class RWriteStream &) const - ?GetLocalizedString@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 66 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetLocalizedString(void) const - ?InternalizeL@CCaInnerQuery@@QAEXAAVRReadStream@@@Z @ 67 NONAME ; void CCaInnerQuery::InternalizeL(class RReadStream &) - ?NewLC@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 68 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewLC(class TDesC16 const &) - ?GetTypeNames@CCaInnerNotifierFilter@@QBEPAVCDesC16ArrayFlat@@XZ @ 69 NONAME ; class CDesC16ArrayFlat * CCaInnerNotifierFilter::GetTypeNames(void) const - ?NewL@CCaInnerEntry@@SAPAV1@XZ @ 70 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewL(void) - ?SetRole@CCaInnerEntry@@QAEXI@Z @ 71 NONAME ; void CCaInnerEntry::SetRole(unsigned int) - ?NewLC@CCaInnerEntry@@SAPAV1@XZ @ 72 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewLC(void) - ?SetTableNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 73 NONAME ; void CCaLocalizationEntry::SetTableNameL(class TDesC16 const &) - ?GetAttributes@CCaInnerEntry@@QBEABVRCaEntryAttrArray@@XZ @ 74 NONAME ; class RCaEntryAttrArray const & CCaInnerEntry::GetAttributes(void) const - ?GetRowId@CCaLocalizationEntry@@QBEHXZ @ 75 NONAME ; int CCaLocalizationEntry::GetRowId(void) const - ?NewLC@CCaInnerIconDescription@@SAPAV1@XZ @ 76 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewLC(void) - ?SetIdsL@CCaInnerQuery@@QAEXABV?$RArray@H@@@Z @ 77 NONAME ; void CCaInnerQuery::SetIdsL(class RArray const &) - ?SetFlagsOff@CCaInnerQuery@@QAEXI@Z @ 78 NONAME ; void CCaInnerQuery::SetFlagsOff(unsigned int) - ?Icon@CCaInnerEntry@@QBEPBVCCaInnerIconDescription@@XZ @ 79 NONAME ; class CCaInnerIconDescription const * CCaInnerEntry::Icon(void) const - ?SetApplicationIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 80 NONAME ; void CCaInnerIconDescription::SetApplicationIdL(class TDesC16 const &) - ?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 81 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TPtrC16 &) - ?RemoveAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 82 NONAME ; void CCaInnerEntry::RemoveAttributeL(class TDesC16 const &) - ?GetRole@CCaInnerEntry@@QBEIXZ @ 83 NONAME ; unsigned int CCaInnerEntry::GetRole(void) const - ?GetIds@CCaInnerQuery@@QBEABV?$RArray@H@@XZ @ 84 NONAME ; class RArray const & CCaInnerQuery::GetIds(void) const - ?ExternalizeL@RCaEntriesArray@@QBEXAAVRWriteStream@@@Z @ 85 NONAME ; void RCaEntriesArray::ExternalizeL(class RWriteStream &) const - ?NewL@CCaInnerQuery@@SAPAV1@XZ @ 86 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewL(void) - ?SetUid@CCaInnerQuery@@QAEXI@Z @ 87 NONAME ; void CCaInnerQuery::SetUid(unsigned int) - ?GetDescription@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 88 NONAME ; class RBuf16 const & CCaInnerEntry::GetDescription(void) const - ?GetRole@CCaInnerQuery@@QBEHXZ @ 89 NONAME ; int CCaInnerQuery::GetRole(void) const - ?GetEntryTypeName@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 90 NONAME ; class RBuf16 const & CCaInnerEntry::GetEntryTypeName(void) const - ?NewLC@CCaInnerQuery@@SAPAV1@XZ @ 91 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewLC(void) - ?SetTextL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 92 NONAME ; void CCaInnerEntry::SetTextL(class TDesC16 const &) - ?SetParentId@CCaInnerQuery@@QAEXH@Z @ 93 NONAME ; void CCaInnerQuery::SetParentId(int) - ?GetIds@CCaInnerNotifierFilter@@QBE?AV?$RArray@H@@XZ @ 94 NONAME ; class RArray CCaInnerNotifierFilter::GetIds(void) const - ?SetStringIdL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 95 NONAME ; void CCaLocalizationEntry::SetStringIdL(class TDesC16 const &) - ?SetTextId@CCaLocalizationEntry@@QAEXI@Z @ 96 NONAME ; void CCaLocalizationEntry::SetTextId(unsigned int) - ?RemoveAttribute@RCaEntryAttrArray@@QAEXABVTDesC16@@@Z @ 97 NONAME ; void RCaEntryAttrArray::RemoveAttribute(class TDesC16 const &) - ?GetQmFilename@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 98 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetQmFilename(void) const - ?SetQmFilenameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 99 NONAME ; void CCaLocalizationEntry::SetQmFilenameL(class TDesC16 const &) + ?SetDescriptionL@CCaInnerEntry@@QAEXABVTDesC16@@H@Z @ 54 NONAME ; void CCaInnerEntry::SetDescriptionL(class TDesC16 const &, int) + ?SetEntryTypeNames@CCaInnerQuery@@QAEXPAVCDesC16ArrayFlat@@@Z @ 55 NONAME ; void CCaInnerQuery::SetEntryTypeNames(class CDesC16ArrayFlat *) + ?GetNotifierType@CCaInnerNotifierFilter@@QBE?AW4TNotifierType@1@XZ @ 56 NONAME ; enum CCaInnerNotifierFilter::TNotifierType CCaInnerNotifierFilter::GetNotifierType(void) const + ?SetTextL@CCaInnerEntry@@QAEXABVTDesC16@@H@Z @ 57 NONAME ; void CCaInnerEntry::SetTextL(class TDesC16 const &, int) + ?ExternalizeL@CCaInnerEntry@@QBEXAAVRWriteStream@@@Z @ 58 NONAME ; void CCaInnerEntry::ExternalizeL(class RWriteStream &) const + ?SetRole@CCaInnerQuery@@QAEXH@Z @ 59 NONAME ; void CCaInnerQuery::SetRole(int) + ?NewL@CCaLocalizationEntry@@SAPAV1@XZ @ 60 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewL(void) + ?InternalizeL@CCaInnerNotifierFilter@@QAEXAAVRReadStream@@@Z @ 61 NONAME ; void CCaInnerNotifierFilter::InternalizeL(class RReadStream &) + ?InternalizeL@RCaIdsArray@@QAEXAAVRReadStream@@@Z @ 62 NONAME ; void RCaIdsArray::InternalizeL(class RReadStream &) + ?SetQmFilenameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 63 NONAME ; void CCaLocalizationEntry::SetQmFilenameL(class TDesC16 const &) + ?MarshalDataLC@RCaIdsArray@@QBEPAVHBufC8@@XZ @ 64 NONAME ; class HBufC8 * RCaIdsArray::MarshalDataLC(void) const + ?GetEntryTypeNames@CCaInnerQuery@@QBEPBVCDesC16ArrayFlat@@XZ @ 65 NONAME ; class CDesC16ArrayFlat const * CCaInnerQuery::GetEntryTypeNames(void) const + ?SetValueL@CCaEntryAttribute@@QAEXABVTDesC16@@@Z @ 66 NONAME ; void CCaEntryAttribute::SetValueL(class TDesC16 const &) + ?SetSkinIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 67 NONAME ; void CCaInnerIconDescription::SetSkinIdL(class TDesC16 const &) + ?ExternalizeL@CCaInnerQuery@@QBEXAAVRWriteStream@@@Z @ 68 NONAME ; void CCaInnerQuery::ExternalizeL(class RWriteStream &) const + ?GetLocalizedString@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 69 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetLocalizedString(void) const + ?InternalizeL@CCaInnerQuery@@QAEXAAVRReadStream@@@Z @ 70 NONAME ; void CCaInnerQuery::InternalizeL(class RReadStream &) + ?NewLC@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 71 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewLC(class TDesC16 const &) + ?GetTypeNames@CCaInnerNotifierFilter@@QBEPAVCDesC16ArrayFlat@@XZ @ 72 NONAME ; class CDesC16ArrayFlat * CCaInnerNotifierFilter::GetTypeNames(void) const + ?NewL@CCaInnerEntry@@SAPAV1@XZ @ 73 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewL(void) + ?SetRole@CCaInnerEntry@@QAEXI@Z @ 74 NONAME ; void CCaInnerEntry::SetRole(unsigned int) + ?NewLC@CCaInnerEntry@@SAPAV1@XZ @ 75 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewLC(void) + ?SetTableNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 76 NONAME ; void CCaLocalizationEntry::SetTableNameL(class TDesC16 const &) + ?GetAttributes@CCaInnerEntry@@QBEABVRCaEntryAttrArray@@XZ @ 77 NONAME ; class RCaEntryAttrArray const & CCaInnerEntry::GetAttributes(void) const + ?GetRowId@CCaLocalizationEntry@@QBEHXZ @ 78 NONAME ; int CCaLocalizationEntry::GetRowId(void) const + ?NewLC@CCaInnerIconDescription@@SAPAV1@XZ @ 79 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewLC(void) + ?SetIdsL@CCaInnerQuery@@QAEXABV?$RArray@H@@@Z @ 80 NONAME ; void CCaInnerQuery::SetIdsL(class RArray const &) + ?SetFlagsOff@CCaInnerQuery@@QAEXI@Z @ 81 NONAME ; void CCaInnerQuery::SetFlagsOff(unsigned int) + ?Icon@CCaInnerEntry@@QBEPBVCCaInnerIconDescription@@XZ @ 82 NONAME ; class CCaInnerIconDescription const * CCaInnerEntry::Icon(void) const + ?SetApplicationIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 83 NONAME ; void CCaInnerIconDescription::SetApplicationIdL(class TDesC16 const &) + ?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 84 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TPtrC16 &) + ?RemoveAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 85 NONAME ; void CCaInnerEntry::RemoveAttributeL(class TDesC16 const &) + ?GetRole@CCaInnerEntry@@QBEIXZ @ 86 NONAME ; unsigned int CCaInnerEntry::GetRole(void) const + ?GetIds@CCaInnerQuery@@QBEABV?$RArray@H@@XZ @ 87 NONAME ; class RArray const & CCaInnerQuery::GetIds(void) const + ?ExternalizeL@RCaEntriesArray@@QBEXAAVRWriteStream@@@Z @ 88 NONAME ; void RCaEntriesArray::ExternalizeL(class RWriteStream &) const + ?NewL@CCaInnerQuery@@SAPAV1@XZ @ 89 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewL(void) + ?isLocalized@CCaInnerEntry@@QBEHW4TLocalizedType@1@@Z @ 90 NONAME ; int CCaInnerEntry::isLocalized(enum CCaInnerEntry::TLocalizedType) const + ?SetUid@CCaInnerQuery@@QAEXI@Z @ 91 NONAME ; void CCaInnerQuery::SetUid(unsigned int) + ?GetDescription@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 92 NONAME ; class RBuf16 const & CCaInnerEntry::GetDescription(void) const + ?GetRole@CCaInnerQuery@@QBEHXZ @ 93 NONAME ; int CCaInnerQuery::GetRole(void) const + ?GetEntryTypeName@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 94 NONAME ; class RBuf16 const & CCaInnerEntry::GetEntryTypeName(void) const + ?NewLC@CCaInnerQuery@@SAPAV1@XZ @ 95 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewLC(void) + ?SetParentId@CCaInnerQuery@@QAEXH@Z @ 96 NONAME ; void CCaInnerQuery::SetParentId(int) + ?GetIds@CCaInnerNotifierFilter@@QBE?AV?$RArray@H@@XZ @ 97 NONAME ; class RArray CCaInnerNotifierFilter::GetIds(void) const + ?SetStringIdL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 98 NONAME ; void CCaLocalizationEntry::SetStringIdL(class TDesC16 const &) + ?SetTextId@CCaLocalizationEntry@@QAEXI@Z @ 99 NONAME ; void CCaLocalizationEntry::SetTextId(unsigned int) + ?RemoveAttribute@RCaEntryAttrArray@@QAEXABVTDesC16@@@Z @ 100 NONAME ; void RCaEntryAttrArray::RemoveAttribute(class TDesC16 const &) diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/caclient.pro --- a/contentstorage/caclient/caclient.pro Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/caclient.pro Wed Jun 23 18:33:40 2010 +0300 @@ -53,7 +53,9 @@ -lxqutils \ -lsif \ -lscrclient \ - -laknicon + -laknicon \ + -lapgrfx \ + -lapparc include(caclient_s60.pri) } diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/inc/caclient_defines.h --- a/contentstorage/caclient/inc/caclient_defines.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/inc/caclient_defines.h Wed Jun 23 18:33:40 2010 +0300 @@ -18,7 +18,8 @@ #ifndef CACLIENT_DEFINES_H #define CACLIENT_DEFINES_H -const char APPLICATION_UID_ATTRIBUTE_NAME[] = "application:uid"; +const char APPLICATION_UID_ATTRIBUTE_NAME[] = "application:uid"; +const char UNINSTALL_PROGRESS_APPLICATION_ATTRIBUTE_NAME[] = "uninstall_progress"; const char APPLICATION_ENTRY_TYPE_NAME[] = "application"; const char WIDGET_ENTRY_TYPE_NAME[] = "widget"; const char URL_ENTRY_TYPE_NAME[] = "url"; diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/inc/caentry_p.h --- a/contentstorage/caclient/inc/caentry_p.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/inc/caentry_p.h Wed Jun 23 18:33:40 2010 +0300 @@ -43,10 +43,10 @@ void setId(int id); QString text() const; - void setText(const QString &text); + void setText(const QString &text, bool localized = false); QString description() const; - void setDescription(const QString &text); + void setDescription(const QString &text, bool localized = false); CaIconDescription iconDescription() const; void setIconDescription(const CaIconDescription &iconDescription); @@ -65,6 +65,8 @@ EntryRole role() const; void setRole(const EntryRole &role); + + bool isLocalized(LocalizationType localized) const; private: @@ -85,6 +87,10 @@ QMap mAttributes; EntryRole mEntryRole; + + bool mTextLocalized; + + bool mDescriptionLocalized; }; #endif // CAENTRY_PRIVATE_H diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/inc/cahandler.h --- a/contentstorage/caclient/inc/cahandler.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/inc/cahandler.h Wed Jun 23 18:33:40 2010 +0300 @@ -34,4 +34,4 @@ Q_DECLARE_INTERFACE(CaHandler, "com.nokia.homescreen.ICommandHandler") -#endif //CAHANDLER_H +#endif // CAHANDLER_H diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/inc/caitemmodel_p.h --- a/contentstorage/caclient/inc/caitemmodel_p.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/inc/caitemmodel_p.h Wed Jun 23 18:33:40 2010 +0300 @@ -73,7 +73,7 @@ // Function declarations void updateParentEntry(); - void updateItemData(int id); + void updateItemData(const QSharedPointer &entry); void addItem(int id); void addItemBlock(const QList &itemsList); void handleAddItems(const QList &itemsList); @@ -89,7 +89,7 @@ private slots: // Function declarations - void updateModelItem(int id, ChangeType changeType); + void updateModelItem(const CaEntry &entry, ChangeType changeType); void updateModelContent(int id); private: diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/inc/caitemmodellist.h --- a/contentstorage/caclient/inc/caitemmodellist.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/inc/caitemmodellist.h Wed Jun 23 18:33:40 2010 +0300 @@ -43,7 +43,7 @@ int count() const; QSharedPointer at(int row) const; void reloadEntries(const CaQuery &query); - void updateEntry(int id); + void updateEntry(const QSharedPointer &entry); void updateEntries(const CaQuery &query); int indexOf(const int &id) const; void insert(int row, int id); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/s60/src/camenuiconutility.cpp --- a/contentstorage/caclient/s60/src/camenuiconutility.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/s60/src/camenuiconutility.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -55,20 +55,7 @@ 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); - } + icon = HbIcon(fileName); } } return icon; diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/s60/src/caobjectadapter.cpp --- a/contentstorage/caclient/s60/src/caobjectadapter.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/s60/src/caobjectadapter.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -48,12 +48,12 @@ toEntry.SetId(fromEntry.id()); toEntry.SetTextL( - XQConversions::qStringToS60Desc(fromEntry.text())->Des()); + XQConversions::qStringToS60Desc(fromEntry.text())->Des(), + fromEntry.isLocalized(NameLocalized)); toEntry.SetDescriptionL( - XQConversions::qStringToS60Desc(fromEntry.description())->Des()); - toEntry.SetDescriptionL( - XQConversions::qStringToS60Desc(fromEntry.description())->Des()); + XQConversions::qStringToS60Desc(fromEntry.description())->Des(), + fromEntry.isLocalized(DescriptionLocalized)); toEntry.SetEntryTypeNameL( XQConversions::qStringToS60Desc(fromEntry.entryTypeName())->Des()); @@ -148,10 +148,12 @@ { toEntry.setId(fromEntry.GetId()); - toEntry.setText(XQConversions::s60DescToQString(fromEntry.GetText())); + toEntry.setText(XQConversions::s60DescToQString(fromEntry.GetText()), + fromEntry.isLocalized(CCaInnerEntry::ENameLocalized)); toEntry.setDescription( - XQConversions::s60DescToQString(fromEntry.GetDescription())); + XQConversions::s60DescToQString(fromEntry.GetDescription()), + fromEntry.isLocalized(CCaInnerEntry::EDescriptionLocalized)); toEntry.setEntryTypeName( XQConversions::s60DescToQString(fromEntry.GetEntryTypeName())); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/s60/src/caobserver.cpp --- a/contentstorage/caclient/s60/src/caobserver.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/s60/src/caobserver.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -58,7 +58,8 @@ { qDebug() << "CaClientProxy::entryChanged changeType:" << changeType; - CaEntry *caEntry = new CaEntry(static_cast(entry.GetRole())); + QSharedPointer caEntry( + new CaEntry(static_cast(entry.GetRole()))); ChangeType entryChangeType(AddChangeType); CaObjectAdapter::convert(entry, *caEntry); CaObjectAdapter::convert(changeType, entryChangeType); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/src/caentry.cpp --- a/contentstorage/caclient/src/caentry.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/src/caentry.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -150,19 +150,20 @@ } /*! - Sets name of the item. + Sets localized name of the item. \param text new name of the item. + \param localized set to true if its localized \code ... QString entryText( QString("EntryText") ); - resultEntry->setText( entryText); + resultEntry->setText( entryText, true); ... \endcode */ -void CaEntry::setText(const QString &text) +void CaEntry::setText(const QString &text, bool localized) { - m_d->setText(text); + m_d->setText(text, localized); } /*! @@ -180,8 +181,9 @@ return m_d->description(); } + /*! -Sets description of the item. +Sets localized description of the item. \param new description of the item. \code @@ -191,9 +193,10 @@ ... \endcode */ -void CaEntry::setDescription(const QString &description) +void CaEntry::setDescription(const QString &description, + bool localized) { - m_d->setDescription(description); + m_d->setDescription(description, localized); } /*! @@ -472,6 +475,11 @@ } +bool CaEntry::isLocalized(LocalizationType localized) const +{ + return m_d->isLocalized(localized); +} + /* Constructor \param entryPublic associated public entry @@ -479,7 +487,8 @@ CaEntryPrivate::CaEntryPrivate(CaEntry *entryPublic) : m_q(entryPublic), mId(0), mText(), mDescription(), mIconDescription(), mFlags(RemovableEntryFlag|VisibleEntryFlag),mEntryTypeName(), - mAttributes(), mEntryRole(ItemEntryRole) + mAttributes(), mEntryRole(ItemEntryRole), + mTextLocalized(false), mDescriptionLocalized(false) { } /*! @@ -497,6 +506,8 @@ mEntryTypeName = entry.mEntryTypeName; mAttributes = entry.mAttributes; mEntryRole = entry.mEntryRole; + mTextLocalized = entry.mTextLocalized; + mDescriptionLocalized = entry.mDescriptionLocalized; return *this; } @@ -524,12 +535,13 @@ } /*! - Sets name of the item. + Sets localized name of the item. \param text new name of the item. */ -void CaEntryPrivate::setText(const QString &text) +void CaEntryPrivate::setText(const QString &text, bool localized) { mText = text; + mTextLocalized = localized; } /*! @@ -544,9 +556,11 @@ Sets description of the item. \param text new name of the item. */ -void CaEntryPrivate::setDescription(const QString &description) +void CaEntryPrivate::setDescription(const QString &description, + bool localized) { mDescription = description; + mDescriptionLocalized = localized; } /*! @@ -663,3 +677,18 @@ mEntryRole = role; } +bool CaEntryPrivate::isLocalized(LocalizationType localized) const +{ + if(localized == NameLocalized) + { + return mTextLocalized; + } + if(localized == DescriptionLocalized) + { + return mDescriptionLocalized; + } + return false; + +} + + diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/src/cahandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/src/cahandler.cpp Wed Jun 23 18:33:40 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: + * + */ + +/*! + \class CaHandler + \ingroup + \brief Interface for command handlers +*/ + +/*! + \fn int CaHandler::execute(const CaEntry &entry, const QString &commandName) = 0 + \param entry the entry for which the command is executed. + \param commandName the name of the command to execute. + \retval an error code. + \sa e32err.h for error code descriptions. +*/ diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/src/cahandlerloader.cpp --- a/contentstorage/caclient/src/cahandlerloader.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/src/cahandlerloader.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -33,4 +33,14 @@ { } +/*! + \fn virtual CaHandler *loadHandler(const QString &entryTypeName, + const QString &commandName) = 0; + Loads handler implementations appropriate for the requested entry type name and command. + The caller takes ownership of the returned pointer. + + \param entryTypeName an entry type name. + \param commandName a name of the command to be handled. + \retval a pointer to the handler serving the entry type and command if found, NULL otherwise. +*/ diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/src/cahandlerproxy.cpp --- a/contentstorage/caclient/src/cahandlerproxy.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/src/cahandlerproxy.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -52,7 +52,7 @@ 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. + \retval KErrNone on succes, error code otherwise. \sa e32err.h for KErrNone definition. */ ErrorCode CaHandlerProxy::execute(const CaEntry &entry, const QString &commandName) diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/src/caiconcache.cpp --- a/contentstorage/caclient/src/caiconcache.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/src/caiconcache.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -145,7 +145,7 @@ void CaIconCache::remove(const CaEntry &entry, ChangeType changeType) { CACLIENTTEST_FUNC_ENTRY("CaIconCache::remove"); - if (changeType != AddChangeType) { + if (changeType != AddChangeType && !(entry.flags() & UninstallEntryFlag)) { QString entryKey = key(entry); entryKey.append(separator); QList keys = mCache.keys(); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/src/caitemmodel.cpp --- a/contentstorage/caclient/src/caitemmodel.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/src/caitemmodel.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -17,6 +17,7 @@ #include +#include "caclient_defines.h" #include "caitemmodel.h" #include "caitemmodel_p.h" #include "canotifier.h" @@ -469,6 +470,9 @@ variant = QVariant(entry(modelIndex)->text() + QString(" ") + entry(modelIndex)->description()); break; + case CaItemModel::UninstalRole: + variant = QVariant(entry(modelIndex)->attribute(UNINSTALL_PROGRESS_APPLICATION_ATTRIBUTE_NAME).toInt()); + break; default: variant = QVariant(QVariant::Invalid); } @@ -699,22 +703,27 @@ /*! Updates model item with fresh data - \param id id of item to update + \param entry item to update */ -void CaItemModelPrivate::updateItemData(int id) +void CaItemModelPrivate::updateItemData(const QSharedPointer &entry) { CACLIENTTEST_FUNC_ENTRY("CaItemModelPrivate::updateItemData"); - mEntries.updateEntry(id); + int id = entry->id(); QList ids = mService->getEntryIds(mQuery); if (mEntries.indexOf(id) >= 0 && ids.indexOf(id) == mEntries.indexOf(id)) { - emit m_q->dataChanged(index(mEntries.indexOf(id)), index( - mEntries.indexOf(id))); + mEntries.updateEntry(entry); + emit m_q->dataChanged( + index(mEntries.indexOf(id)), index(mEntries.indexOf(id))); } else if (mParentEntry && id == mParentEntry->id()) { updateParentEntry(); m_q->reset(); + } else if (ids.indexOf(id) < 0) { + removeItem(id); + } else if (mEntries.indexOf(id) < 0) { + addItem(id); } else { updateModel(); } @@ -911,8 +920,8 @@ void CaItemModelPrivate::connectSlots() { CACLIENTTEST_FUNC_ENTRY("CaItemModelPrivate::connectSlots"); - connect(mNotifier, SIGNAL(entryChanged(int,ChangeType)), - this, SLOT(updateModelItem(int,ChangeType))); + connect(mNotifier, SIGNAL(entryChanged(CaEntry ,ChangeType)), + this, SLOT(updateModelItem(CaEntry, ChangeType))); if (mQuery.parentId() > 0) { connect(mNotifier, SIGNAL(groupContentChanged(int)), @@ -927,8 +936,8 @@ void CaItemModelPrivate::disconnectSlots() { CACLIENTTEST_FUNC_ENTRY("CaItemModelPrivate::disconnectSlots"); - disconnect(mNotifier, SIGNAL(entryChanged(int,ChangeType)), - this, SLOT(updateModelItem(int,ChangeType))); + disconnect(mNotifier, SIGNAL(entryChanged(CaEntry ,ChangeType)), + this, SLOT(updateModelItem(CaEntry, ChangeType))); if (mQuery.parentId() > 0) { disconnect(mNotifier, SIGNAL(groupContentChanged(int)), this, SLOT(updateModelContent(int))); @@ -952,20 +961,22 @@ \param id of item to handle \param changeType change type */ -void CaItemModelPrivate::updateModelItem(int id, ChangeType changeType) +void CaItemModelPrivate::updateModelItem( + const CaEntry &entry, ChangeType changeType) { CACLIENTTEST_FUNC_ENTRY("CaItemModelPrivate::updateModelItem"); + QSharedPointer sharedEntry(new CaEntry(entry)); int previousCount = rowCount(); switch (changeType) { - case AddChangeType: - addItem(id); - break; - case RemoveChangeType: - removeItem(id); - break; - default: - updateItemData(id); - break; + case AddChangeType: + addItem(sharedEntry->id()); + break; + case RemoveChangeType: + removeItem(sharedEntry->id()); + break; + default: + updateItemData(sharedEntry); + break; } emitEmpty(previousCount); CACLIENTTEST_FUNC_EXIT("CaItemModelPrivate::updateModelItem"); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/src/caitemmodellist.cpp --- a/contentstorage/caclient/src/caitemmodellist.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/src/caitemmodellist.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -93,13 +93,13 @@ /*! Updates entry with given id - \param id of item in the list + \param entry of item in the list */ -void CaItemModelList::updateEntry(int id) +void CaItemModelList::updateEntry(const QSharedPointer &entry) { CACLIENTTEST_FUNC_ENTRY("CaItemModelList::updateEntry"); - if (mEntriesHash.contains(id)) { - mEntriesHash.insert(id, mService->getEntry(id)); + if (mEntriesHash.contains(entry->id())) { + mEntriesHash.insert(entry->id(), entry); } CACLIENTTEST_FUNC_EXIT("CaItemModelList::updateEntry"); } diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/src/caqtsfhandlerloader.cpp --- a/contentstorage/caclient/src/caqtsfhandlerloader.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/src/caqtsfhandlerloader.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -57,11 +57,11 @@ const QString pluginPath("hsresources/plugins/commandhandler"); const QFileInfoList drives = QDir::drives(); - foreach(QFileInfo drive, drives) { + foreach (QFileInfo drive, drives) { const QString driveLetter = drive.absolutePath(); const QString pluginAbsolutePath = driveLetter + pluginPath; const QDir pluginDir(pluginAbsolutePath); - if(QDir(pluginDir).exists()) { + if (QDir(pluginDir).exists()) { const QFileInfoList fileInfos = pluginDir.entryInfoList(QStringList("*.xml")); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/src/caservice.cpp --- a/contentstorage/caclient/src/caservice.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/src/caservice.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -973,7 +973,8 @@ \param entryIdList list of entry ids \retval list of entries (pointers) */ -QList< QSharedPointer > CaServicePrivate::getEntries(const QList &entryIdList) const +QList< QSharedPointer > CaServicePrivate::getEntries( + const QList &entryIdList) const { qDebug() << "CaServicePrivate::getEntries" << "entryIdList:" << entryIdList; @@ -1338,6 +1339,10 @@ CACLIENTTEST_FUNC_ENTRY("CaServicePrivate::executeCommand"); + if (entry.flags() & UninstallEntryFlag) { + return false; + } + if (command == caCmdOpen) { touch(entry); } diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/stub/inc/caobjectadapter.h --- a/contentstorage/caclient/stub/inc/caobjectadapter.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/stub/inc/caobjectadapter.h Wed Jun 23 18:33:40 2010 +0300 @@ -15,8 +15,8 @@ * */ -#ifndef OBJECTADAPTER_H -#define OBJECTADAPTER_H +#ifndef CAOBJECTADAPTER_H +#define CAOBJECTADAPTER_H // INCLUDES #include @@ -28,46 +28,18 @@ class CaIconDescription; class HbIcon; -/** - * CaObjectAdapter - * - */ class CaObjectAdapter { public: - /** - * Create an icon. - * @param entry entry. - * @param size size of the icon - * @return QPixmap. - */ - static HbIcon makeIcon( - const CaEntry &entry, - const QSize &size); + static HbIcon makeIcon(const CaEntry &entry, const QSize &size); + + static void setId(CaEntry &entry, int id); - /** - * Set entry id. - * @param entry entry. - * @param id entry id. - */ - static void setId(CaEntry &entry, - int id); - - /** - * Set icon description id. - * @param iconDescription icon description. - * @param id icon description id. - */ - static void setId(CaIconDescription &iconDescription, - int id); + static void setId(CaIconDescription &iconDescription, int id); - /** - * Converts symbian error code to error code (used in QT code). - */ - static ErrorCode convertErrorCode( - int internalErrorCode); + static ErrorCode convertErrorCode(int internalErrorCode); }; -#endif // OBJECTADAPTER_H +#endif // CAOBJECTADAPTER_H diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/caclient/stub/src/caobjectadapter.cpp --- a/contentstorage/caclient/stub/src/caobjectadapter.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/caclient/stub/src/caobjectadapter.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -24,9 +24,12 @@ #include "caicondescription.h" #include -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- +/*! + * Create an icon. + * \param entry a CaEntry instance. + * \param size a size of the icon + * \retval a HbIcon instance. + */ HbIcon CaObjectAdapter::makeIcon(const CaEntry &entry, const QSize &size) { HbIcon icon; @@ -42,27 +45,31 @@ } -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- -void CaObjectAdapter::setId(CaEntry &entry, - int id) +/*! + * Set entry id. + * \param entry entry. + * \param id entry id. + */ +void CaObjectAdapter::setId(CaEntry &entry, int id) { entry.setId(id); } -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- -void CaObjectAdapter::setId(CaIconDescription &iconDescription, - int id) +/*! + * Set icon description id. + * \param iconDescription icon description. + * \param id icon description id. + */ +void CaObjectAdapter::setId(CaIconDescription &iconDescription, int id) { iconDescription.setId(id); } -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- +/** + * Convert Symbian error code to error code (used in QT code). + * \param internalErrorCode Symbian error code. + * \retval converted error code (ErrorCode enum). + */ ErrorCode CaObjectAdapter::convertErrorCode(int internalErrorCode) { ErrorCode error(NoErrorCode); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cahandler/app/inc/caapphandler.h --- a/contentstorage/cahandler/app/inc/caapphandler.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cahandler/app/inc/caapphandler.h Wed Jun 23 18:33:40 2010 +0300 @@ -26,11 +26,6 @@ class CCaUsifUninstallOperation; class CaEntry; -/** - * Command handler for application entries. - * - * @lib caclient.lib - */ class CaAppHandler: public QObject, public CaHandler { Q_OBJECT @@ -40,9 +35,6 @@ explicit CaAppHandler(QObject *parent = 0); - /** - * Destructor. - */ virtual ~CaAppHandler(); public: @@ -51,33 +43,15 @@ 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, TInt aViewId); + void launchApplicationL(const TUid uid, TInt viewId); - /** - * Closes application - * @param aEntry the entry represeting application to close - */ int closeApplication(const EntryFlags &flags, TInt windowGroupId); - /** - * Uninstall application - * @param aEntry the entry represeting application to uninstall - */ int handleRemove(const EntryFlags &flags, const QString &typeName, const QString &componentId); - /** - * Start uninstall operation via usif - * @param aComponentId component id - */ - void startUsifUninstallL(TInt aComponentId); + void startUsifUninstallL(TInt componentId); private: CEikonEnv *iEikEnv; diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cahandler/app/inc/caapphandlerplugin.h --- a/contentstorage/cahandler/app/inc/caapphandlerplugin.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cahandler/app/inc/caapphandlerplugin.h Wed Jun 23 18:33:40 2010 +0300 @@ -15,8 +15,8 @@ * */ -#ifndef CA_APP_HANDLER_PLUGIN_H -#define CA_APP_HANDLER_PLUGIN_H +#ifndef CAAPPHANDLERPLUGIN_H +#define CAAPPHANDLERPLUGIN_H #include #include @@ -34,4 +34,4 @@ QAbstractSecuritySession *session); }; -#endif +#endif // CAAPPHANDLERPLUGIN_H diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cahandler/app/src/caapphandler.cpp --- a/contentstorage/cahandler/app/src/caapphandler.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cahandler/app/src/caapphandler.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -49,12 +49,16 @@ static const char caCmdClose[] = "close"; static const char caAttrWindowGroupId[] = "window_group_id"; static const char caAttrComponentId[] = "component_id"; -static const char caCmdRemove[] = "remove"; -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// +/*! + * Command handler for application entries. + * + * \lib caclient.lib + */ + +/*! + * Constructor. + */ CaAppHandler::CaAppHandler(QObject *parent): iEikEnv(CEikonEnv::Static()), iUsifUninstallOperation(NULL) @@ -62,15 +66,20 @@ Q_UNUSED(parent); } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// +/*! + * Destructor. + */ CaAppHandler::~CaAppHandler() { delete iUsifUninstallOperation; } +/*! + * Execute a given command. + * \param entry a reference to a CaEntry instance. + * \param command a given command. + * \retval an error code. + */ int CaAppHandler::execute(const CaEntry &entry, const QString &command) { int result(KErrGeneral); @@ -104,99 +113,93 @@ return result; } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CaAppHandler::launchApplicationL(const TUid aUid, TInt aViewId) +/*! + * Launch application + * \param uid UID of the application to launch. + * \param viewId id of the view the application is to start in. + */ +void CaAppHandler::launchApplicationL(const TUid uid, TInt viewId) { - if( aViewId > 0 && iEikEnv ) - { - TUid viewId = TUid::Uid( aViewId ); - TVwsViewId view( aUid, viewId ); + if (viewId > 0 && iEikEnv) { + TVwsViewId view(uid, TUid::Uid(viewId)); iEikEnv->EikAppUi()->ActivateViewL( view ); - } - else - { + } else { RWsSession wsSession; - User::LeaveIfError( wsSession.Connect() ); - CleanupClosePushL( wsSession ); + User::LeaveIfError(wsSession.Connect()); + CleanupClosePushL(wsSession); - CCaTaskList* taskList = CCaTaskList::NewLC( wsSession ); - TApaTask task = taskList->FindRootApp( aUid ); - CleanupStack::PopAndDestroy( taskList ); + CCaTaskList* taskList = CCaTaskList::NewLC(wsSession); + TApaTask task = taskList->FindRootApp(uid); + CleanupStack::PopAndDestroy(taskList); - if( task.Exists() ) - { + if (task.Exists()) { task.BringToForeground(); - } - else - { + } else { // TApaAppInfo size is greater then 1024 bytes // so its instances should not be created on the stack. - TApaAppInfo* appInfo = new( ELeave ) TApaAppInfo; - CleanupStack::PushL( appInfo ); + TApaAppInfo* appInfo = new(ELeave) TApaAppInfo; + CleanupStack::PushL(appInfo); TApaAppCapabilityBuf capabilityBuf; RApaLsSession appArcSession; - User::LeaveIfError( appArcSession.Connect() ); - CleanupClosePushL( appArcSession ); + User::LeaveIfError(appArcSession.Connect()); + CleanupClosePushL(appArcSession); - User::LeaveIfError( appArcSession.GetAppInfo( *appInfo, aUid ) ); - User::LeaveIfError( appArcSession.GetAppCapability( - capabilityBuf, aUid ) ); + User::LeaveIfError(appArcSession.GetAppInfo(*appInfo, uid)); + User::LeaveIfError(appArcSession.GetAppCapability( + capabilityBuf, uid)); TApaAppCapability &caps = capabilityBuf(); CApaCommandLine *cmdLine = CApaCommandLine::NewLC(); - cmdLine->SetExecutableNameL( appInfo->iFullName ); + cmdLine->SetExecutableNameL(appInfo->iFullName); + + if (caps.iLaunchInBackground) { + cmdLine->SetCommandL(EApaCommandBackground); + } else { + cmdLine->SetCommandL(EApaCommandRun); + } - if( caps.iLaunchInBackground ) - { - cmdLine->SetCommandL( EApaCommandBackground ); - } - else - { - cmdLine->SetCommandL( EApaCommandRun ); - } + cmdLine->SetTailEndL(KNullDesC8); + + User::LeaveIfError(appArcSession.StartApp(*cmdLine)); - cmdLine->SetTailEndL( KNullDesC8 ); - - User::LeaveIfError( appArcSession.StartApp( *cmdLine ) ); - - CleanupStack::PopAndDestroy( cmdLine ); - CleanupStack::PopAndDestroy( &appArcSession ); - CleanupStack::PopAndDestroy( appInfo ); + CleanupStack::PopAndDestroy(cmdLine); + CleanupStack::PopAndDestroy(&appArcSession); + CleanupStack::PopAndDestroy(appInfo); } CleanupStack::PopAndDestroy( &wsSession ); } } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// +/*! + * Closes application. + * \param flags an entry flags. + * \param windowGroupId window group id. + * \retval an error code. + */ int CaAppHandler::closeApplication(const EntryFlags &flags, int windowGroupId) { int result(KErrNone); - if (flags.testFlag(RunningEntryFlag) - && !( flags.testFlag(SystemEntryFlag)) - && windowGroupId > 0) { + if (flags.testFlag(RunningEntryFlag) && windowGroupId > 0) { RWsSession wsSession; result = wsSession.Connect(); if (result==KErrNone) { TWsEvent event; event.SetTimeNow(); - event.SetType( KAknShutOrHideApp ); - wsSession.SendEventToWindowGroup( windowGroupId, event ); + event.SetType(KAknShutOrHideApp); + wsSession.SendEventToWindowGroup(windowGroupId, event); } wsSession.Close(); } return result; } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// +/*! + * Uninstall application. + * \param flags flags of the application which is to uninstall. + * \param typeName type name of the entry. + * \param componentId component id. + * \retval an error code. + */ int CaAppHandler::handleRemove(const EntryFlags &flags, const QString &typeName, const QString &componentId) @@ -227,17 +230,17 @@ return result; } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CaAppHandler::startUsifUninstallL(TInt aComponentId) +/*! + * Start uninstall operation via usif. + * \param componentId component id. + */ +void CaAppHandler::startUsifUninstallL(TInt componentId) { if (iUsifUninstallOperation && iUsifUninstallOperation->IsActive()) { User::Leave( KErrInUse ); } delete iUsifUninstallOperation; iUsifUninstallOperation = NULL; - iUsifUninstallOperation = CCaUsifUninstallOperation::NewL(aComponentId); + iUsifUninstallOperation = CCaUsifUninstallOperation::NewL(componentId); } diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cahandler/app/src/caapphandlerplugin.cpp --- a/contentstorage/cahandler/app/src/caapphandlerplugin.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cahandler/app/src/caapphandlerplugin.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -34,7 +34,7 @@ \param descriptor Service descriptor. \param context Ignored. \param session Ignored. - \return An instance of the CaS60HandlerAdapter when descriptor interface name + \retval an instance of the CaAppHandler when descriptor interface name is "com.nokia.homescreen.ICommandHandler", NULL otherwise. */ QObject *CaAppHandlerPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, @@ -51,37 +51,14 @@ return 0; } } + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (QT macro) + 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. -*/ +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT -/*! - \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 156f692b1687 -r b99b84bcd2d1 contentstorage/cahandler/app/src/causifuninstalloperation.cpp --- a/contentstorage/cahandler/app/src/causifuninstalloperation.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cahandler/app/src/causifuninstalloperation.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -93,6 +93,9 @@ iUninstaller.CancelOperation(); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (error ignored) // --------------------------------------------------------------------------- // CCaUsifUninstallOperation::RunError // --------------------------------------------------------------------------- @@ -101,3 +104,7 @@ { return KErrNone; } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cahandler/tapp/src/catapphandler.cpp --- a/contentstorage/cahandler/tapp/src/catapphandler.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cahandler/tapp/src/catapphandler.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -58,7 +58,7 @@ Uses XQApplicationManager \param entry Subject of the \a command. \param command Description of the command. - \return Error code described in QSERVICEMANAGER.H + \retval Error code described in QSERVICEMANAGER.H */ int CaTappHandler::execute(const CaEntry& entry, const QString& command) { @@ -78,7 +78,7 @@ } } } else { - // TODO: error code cleanning and appropriate conversion (in other classes too). + // TODO: error code cleanning and an appropriate conversion (in other classes too). static const int NotSupportedErrorCode = 100; error = NotSupportedErrorCode; } diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cahandler/tapp/src/catapphandlerplugin.cpp --- a/contentstorage/cahandler/tapp/src/catapphandlerplugin.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cahandler/tapp/src/catapphandlerplugin.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -18,9 +18,6 @@ #include "catapphandlerplugin.h" #include "catapphandler.h" -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT /*! \class CaTappHandlerPlugin \ingroup @@ -31,7 +28,7 @@ \param descriptor service descriptor \param context ignored \param session ignored - \return An instance of the CaTapphandler object when descriptor interface name + \retval An instance of the CaTapphandler object when descriptor interface name is "com.nokia.homescreen.ICommandHandler", NULL otherwise. */ QObject *CaTappHandlerPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, @@ -48,6 +45,10 @@ } } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (QT macro) + Q_EXPORT_PLUGIN2(catapphandlerplugin, CaTappHandlerPlugin) #ifdef COVERAGE_MEASUREMENT diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cahandler/url/src/caurlhandler.cpp --- a/contentstorage/cahandler/url/src/caurlhandler.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cahandler/url/src/caurlhandler.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -24,15 +24,27 @@ static const QString caAttrUrl("url"); +/*! + * Constructor. + */ CaUrlHandler::CaUrlHandler(QObject *parent) { Q_UNUSED(parent); } +/*! + * Destructor. + */ CaUrlHandler::~CaUrlHandler() { } +/*! + * Execute a given command. + * \param entry a reference to CaEntry instance. + * \param command a given command. + * \retval an error code. + */ int CaUrlHandler::execute(const CaEntry &entry, const QString &command) { int err(KErrGeneral); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cahandler/url/src/caurlhandlerplugin.cpp --- a/contentstorage/cahandler/url/src/caurlhandlerplugin.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cahandler/url/src/caurlhandlerplugin.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -51,4 +51,12 @@ } } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (QT macro) + Q_EXPORT_PLUGIN2(caurlhandlerplugin, CaUrlHandlerPlugin) + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casoftwareregistry/casoftwareregistry.pro --- a/contentstorage/casoftwareregistry/casoftwareregistry.pro Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casoftwareregistry/casoftwareregistry.pro Wed Jun 23 18:33:40 2010 +0300 @@ -15,7 +15,7 @@ # TEMPLATE = lib - +CONFIG += hb DEFINES += CACLIENT_LIB include(../../common.pri) @@ -41,7 +41,8 @@ -lestor \ -lscrclient \ -lxqutils \ - -lPlatformEnv + -lPlatformEnv \ + -lefsrv include(casoftwareregistry_s60.pri) } diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casoftwareregistry/s60/inc/casoftwareregistry_p.h --- a/contentstorage/casoftwareregistry/s60/inc/casoftwareregistry_p.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casoftwareregistry/s60/inc/casoftwareregistry_p.h Wed Jun 23 18:33:40 2010 +0300 @@ -15,13 +15,17 @@ * */ -#ifndef CA_SOFTWARE_REGISTRY_PRIVATE_H -#define CA_SOFTWARE_REGISTRY_PRIVATE_H +#ifndef CASOFTWAREREGISTRY_P_H +#define CASOFTWAREREGISTRY_P_H #include #include +#include + +class QStringList; class CaSoftwareRegistry; + namespace Usif { class CComponentEntry; @@ -37,13 +41,28 @@ CaSoftwareRegistry *softwareRegistryPublic); ~CaSoftwareRegistryPrivate(); + bool getUninstallDetails(int componentId, + QString &componentName, + QStringList &applicationsUids, + QString &confirmationMessage); + + bool getApplicationsUids(int componentId, + QStringList &appUids); + DetailMap entryDetails(int componentId) const; DetailMap entryDetails( const Usif::CComponentEntry& entry) const; private: + void getUninstallDetailsL(int componentId, + QString &componentName, + QStringList &appUids, + QString &confirmationMessage); + void getApplicationsUidsL(int componentId, + QStringList &appUids); +private: CaSoftwareRegistry *const m_q; }; -#endif // CA_SOFTWARE_REGISTRY_PRIVATE_H +#endif // CASOFTWAREREGISTRY_P_H diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp --- a/contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -14,10 +14,10 @@ * Description: ?Description * */ -#include +#include #include #include -#include +#include #include #include @@ -29,6 +29,8 @@ using namespace Usif; +_LIT(KConfirmMessageKey, "MIDlet-Delete-Confirm"); + template struct RClassDeleter { @@ -61,6 +63,140 @@ } /*! + Provides details needed for uninstalling process of Java applications. + \param[in] componentId component id of an application to be uninstalled. + \param[out] componentName a name of the component. + \param[out] applicationsUids a list of uids of applications in the package + of the given component id. + \param[out] confirmationMessage optional deletion confirmation message, + null string means the lack of the message. + \retval true if there is no error. + */ + +bool CaSoftwareRegistryPrivate::getUninstallDetails(int componentId, + QString &componentName, + QStringList &applicationsUids, + QString &confirmationMessage) +{ + TRAPD(error, getUninstallDetailsL(componentId, + componentName, + applicationsUids, + confirmationMessage) + ); + return error == KErrNone; +} + +/*! + Provides a list of uids of applications installed by the given package. + \param[in] componentId component id of an application to be uninstalled. + \param[out] applicationsUids a list of uids of applications in the package + of the given component id. + \retval true if there is no error. + */ + +bool CaSoftwareRegistryPrivate::getApplicationsUids(int componentId, + QStringList &applicationsUids) +{ + TRAPD(error, getApplicationsUidsL(componentId, applicationsUids)); + return error == KErrNone; +} + +/*! + Provides details needed for uninstalling process of Java applications + (leaving version). + \param[in] componentId component id of an application to be uninstalled. + \param[out] componentName a name of the component. + \param[out] applicationsUids a list of uids of applications in the package + of the given component id. + \param[out] confirmationMessage optional deletion confirmation message, + null string means the lack of the message. + */ +void CaSoftwareRegistryPrivate::getUninstallDetailsL(int componentId, + QString &componentName, + QStringList &appUids, + QString &confirmationMessage) +{ + componentName.clear(); + appUids.clear(); + confirmationMessage.clear(); + + if (componentId >= 1) { + TComponentId componentIdValue(componentId); + RArray appUidsArray; + CleanupClosePushL(appUidsArray); + CLocalizablePropertyEntry *confirmationMessageProperty = NULL; + + RSoftwareComponentRegistry softwareComponentRegistry; + CleanupClosePushL(softwareComponentRegistry); + User::LeaveIfError(softwareComponentRegistry.Connect()); + + CComponentEntry *entry = CComponentEntry::NewLC(); + softwareComponentRegistry.GetComponentL(componentId, *entry); + softwareComponentRegistry.GetAppUidsForComponentL(componentIdValue, + appUidsArray); + + CPropertyEntry *confirmationProperty = + softwareComponentRegistry.GetComponentPropertyL(componentId, + KConfirmMessageKey); + if (confirmationProperty && + confirmationProperty->PropertyType() == + CPropertyEntry::ELocalizedProperty) { + confirmationMessageProperty = + static_cast( + confirmationProperty); + } else { + delete confirmationProperty; + confirmationProperty = NULL; + } + + QT_TRYCATCH_LEAVING(componentName = + XQConversions::s60DescToQString(entry->Name()); + for (TInt i = 0; iStrValue()); + } + ); + + CleanupStack::PopAndDestroy(3, &appUidsArray); + } +} + +/*! + Provides details needed for uninstalling process of Java applications + (leaving version). + \param[in] componentId component id of an application to be uninstalled. + \param[out] applicationsUids a list of uids of applications in the package + of the given component id. + */ +void CaSoftwareRegistryPrivate::getApplicationsUidsL(int componentId, + QStringList &appUids) +{ + appUids.clear(); + if (componentId >= 1) { + TComponentId componentIdValue(componentId); + RArray appUidsArray; + CleanupClosePushL(appUidsArray); + + RSoftwareComponentRegistry softwareComponentRegistry; + CleanupClosePushL(softwareComponentRegistry); + User::LeaveIfError(softwareComponentRegistry.Connect()); + + softwareComponentRegistry.GetAppUidsForComponentL(componentIdValue, + appUidsArray); + + QT_TRYCATCH_LEAVING( + for (TInt i = 0; i= 1) { RSoftwareComponentRegistry softwareComponentRegistry; ScrScopedPointer scr(&softwareComponentRegistry); - QT_TRAP_THROWING(User::LeaveIfError(scr->Connect())); - - QScopedPointer entry; - - QT_TRAP_THROWING(entry.reset(CComponentEntry::NewL())); - QT_TRAP_THROWING(scr->GetComponentL(componentId, *entry)); - result = entryDetails(*entry); + if (scr->Connect() == KErrNone) { + + QScopedPointer entry; + + QT_TRAP_THROWING(entry.reset(CComponentEntry::NewL())); + + TBool resultCode = EFalse; + TRAPD(leaveCode, resultCode = scr->GetComponentL(componentId, *entry)); + if (leaveCode == KErrNone && resultCode) { + result = entryDetails(*entry); + } + } } return result; @@ -104,7 +245,8 @@ XQConversions::s60DescToQString(entry.Vendor()); QString drives; - TChar drive; + QString drv; + TChar drive; const TInt driveListLen(entry.InstalledDrives().Length()); for (TInt i( 0 ); i < driveListLen; ++i) { @@ -112,50 +254,70 @@ if (!drives.isEmpty()) { drives = drives.append(","); - } - - if(DriveInfo::GetDefaultDrive(DriveInfo::EDefaultPhoneMemory, drive ) == KErrNone + } + drv = QString(QChar('A'+ i)).append(":"); + if(DriveInfo::GetDefaultDrive( + DriveInfo::EDefaultPhoneMemory, drive ) == KErrNone && QChar('A'+ i) == QChar(drive)) { - drives = drives.append(QChar('A'+ i)).append(":").append( - " txt_applib_dialog_1_device_memory"); + drives = drives.append( + HbParameterLengthLimiter("txt_applib_dialog_1_device_memory").arg( + QString(QChar('A'+ i)).append(":"))); } - else if(DriveInfo::GetDefaultDrive(DriveInfo::EDefaultMassStorage, drive ) == KErrNone + else if(DriveInfo::GetDefaultDrive( + DriveInfo::EDefaultMassStorage, drive ) == KErrNone && QChar('A'+ i) == QChar(drive)) { - drives = drives.append(QChar('A'+ i)).append(":").append( - " txt_applib_dialog_1_mass_storage"); + drives = drives.append( + HbParameterLengthLimiter("txt_applib_dialog_1_mass_storage").arg( + QString(QChar('A'+ i)).append(":"))); } - else if(DriveInfo::GetDefaultDrive(DriveInfo::EDefaultRemovableMassStorage, drive ) == KErrNone + else if(DriveInfo::GetDefaultDrive( + DriveInfo::EDefaultRemovableMassStorage, drive ) == KErrNone && QChar('A'+ i) == QChar(drive)) { RFs fs; RFSScopedPointer fSPointer(&fs); - qt_symbian_throwIfError(fs.Connect()); - - TInt driveNumber; - TVolumeInfo tv; - DriveInfo::GetDefaultDrive(DriveInfo::EDefaultRemovableMassStorage, driveNumber ); - - qt_symbian_throwIfError(fs.Volume(tv, driveNumber)); - if(tv.iName.Length()) { - drives = drives.append(QChar('A'+ i)).append(": ").append( - XQConversions::s60DescToQString(tv.iName)); + if (fs.Connect() == KErrNone) { + TInt driveNumber; + TVolumeInfo tv; + DriveInfo::GetDefaultDrive( + DriveInfo::EDefaultRemovableMassStorage, driveNumber ); + qt_symbian_throwIfError(fs.Volume(tv, driveNumber)); + if(tv.iName.Length()) { + drives = drives.append( + HbParameterLengthLimiter("txt_applib_dialog_1_2").arg( + QString(QChar('A'+ i)).append(":")).arg( + XQConversions::s60DescToQString(tv.iName))); + } + else { + drives = drives.append( + HbParameterLengthLimiter("txt_applib_dialog_1_memory_card").arg( + QString(QChar('A'+ i)).append(":"))); + } } - else { - drives = drives.append(QChar('A'+ i)).append(":").append( - " txt_applib_dialog_1_memory_card"); - } - } - else { + } else { drives = drives.append(QChar('A'+ i)).append(":"); } } } detailMap[CaSoftwareRegistry::componentDriveInfoKey()] = drives; - detailMap[CaSoftwareRegistry::componentSizeKey()].setNum( - entry.ComponentSize() / 1024); + + + static const TInt64 KKilo = 1024; + static const TInt64 KMega = KKilo * KKilo; + if(entry.ComponentSize() >= KMega) { + detailMap[CaSoftwareRegistry::componentSizeKey()] = + HbParameterLengthLimiter("txt_applib_dialog_l1_mb").arg(QString().setNum( + static_cast(entry.ComponentSize() / KMega))); + } + else { + detailMap[CaSoftwareRegistry::componentSizeKey()] = + HbParameterLengthLimiter("txt_applib_dialog_l1_kb").arg(QString().setNum( + static_cast(entry.ComponentSize() / KKilo))); + } + detailMap[CaSoftwareRegistry::componentTypeKey()] = XQConversions::s60DescToQString(entry.SoftwareType()); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casoftwareregistry/src/casoftwareregistry.cpp --- a/contentstorage/casoftwareregistry/src/casoftwareregistry.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casoftwareregistry/src/casoftwareregistry.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -15,8 +15,8 @@ * */ #include -#include #include +#include #include "casoftwareregistry.h" @@ -94,6 +94,53 @@ } /*! + Provides details needed for uninstalling process of Java applications. + \code + QSharedPointer service = CaSoftwareRegistry::create(); + int componentId(20); + QString &componentName, + QStringList applicationsUids; + QString confirmationMessage; + CaSoftwareRegistry::DetailMap detailMap = service->getUninstallDetails( + componentId, + componentName, + applicationsUids, + confirmationMessage); + \endcode + \param[in] componentId component id of an application to be uninstalled. + \param[out] componentName a name of the component. + \param[out] applicationsUids a list of uids of applications in the package + of the given component id. + \param[out] confirmationMessage optional deletion confirmation message, + null string means the lack of the message. + \retval true if there is no error. + */ +bool CaSoftwareRegistry::getUninstallDetails(int componentId, + QString &componentName, + QStringList &applicationsUids, + QString &confirmationMessage) +{ + return m_d->getUninstallDetails(componentId, + componentName, + applicationsUids, + confirmationMessage); +} + +/*! + Provides a list of uids of applications installed by the given package. + \param[in] componentId component id of an application to be uninstalled. + \param[out] applicationsUids a list of uids of applications in the package + of the given component id. + \retval true if there is no error. + */ + +bool CaSoftwareRegistry::getApplicationsUids(int componentId, + QStringList &applicationsUids) +{ + return m_d->getApplicationsUids(componentId, applicationsUids); +} + +/*! The method provides component details from USIF for a given component id. \code QSharedPointer service = CaSoftwareRegistry::create(); @@ -165,5 +212,3 @@ return key; } - - diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casoftwareregistry/stub/inc/casoftwareregistry_p.h --- a/contentstorage/casoftwareregistry/stub/inc/casoftwareregistry_p.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casoftwareregistry/stub/inc/casoftwareregistry_p.h Wed Jun 23 18:33:40 2010 +0300 @@ -15,12 +15,13 @@ * */ -#ifndef CA_SOFTWARE_REGISTRY_PRIVATE_H -#define CA_SOFTWARE_REGISTRY_PRIVATE_H +#ifndef CASOFTWAREREGISTRY_P_H +#define CASOFTWAREREGISTRY_P_H #include #include +class QStringList; class CaSoftwareRegistry; class CaSoftwareRegistryPrivate @@ -32,6 +33,14 @@ CaSoftwareRegistry *softwareRegistryPublic); ~CaSoftwareRegistryPrivate(); + bool getApplicationsUids(int componentId, + QStringList &applicationsUids); + + bool getUninstallDetails(int componentId, + QString &componentName, + QStringList &applicationsUids, + QString &confirmationMessage); + DetailMap entryDetails(int componentId) const; private: @@ -39,4 +48,4 @@ }; -#endif // CA_SOFTWARE_REGISTRY_PRIVATE_H +#endif // CASOFTWAREREGISTRY_P_H diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casoftwareregistry/stub/src/casoftwareregistry_p.cpp --- a/contentstorage/casoftwareregistry/stub/src/casoftwareregistry_p.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casoftwareregistry/stub/src/casoftwareregistry_p.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -16,7 +16,7 @@ */ #include #include -#include +#include #include "casoftwareregistry.h" @@ -39,6 +39,45 @@ { } +/*! + Provides details needed for uninstalling process of Java applications + (windows stub). + \param[in] componentId component id of an application to be uninstalled. + \param[out] componentName a name of the component. + \param[out] applicationsUids a list of uids of applications in the package + of the given component id. + \param[out] confirmationMessage optional deletion confirmation message, + null string means the lack of the message. + \retval true if there is no error. + */ +bool CaSoftwareRegistryPrivate::getUninstallDetails(int componentId, + QString &componentName, + QStringList &applicationsUids, + QString &confirmationMessage) +{ + Q_UNUSED(componentId); + componentName.clear(); + applicationsUids.clear(); + confirmationMessage.clear(); + return true; +} + +/*! + Provides a list of uids of applications installed by the given package + (windows stub). + \param[in] componentId component id of an application to be uninstalled. + \param[out] applicationsUids a list of uids of applications in the package + of the given component id. + \retval true if there is no error. + */ +bool CaSoftwareRegistryPrivate::getApplicationsUids(int componentId, + QStringList &applicationsUids) +{ + Q_UNUSED(componentId); + applicationsUids.clear(); + return true; +} + /* Stub for windows development. \param Component id. diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/caappscanner/group/caappscanner.mmp --- a/contentstorage/casrv/caappscanner/group/caappscanner.mmp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/caappscanner/group/caappscanner.mmp Wed Jun 23 18:33:40 2010 +0300 @@ -36,7 +36,6 @@ USERINCLUDE ../../../inc USERINCLUDE ../../../cautils/inc USERINCLUDE ../../../srvinc -USERINCLUDE ../../../castorage/inc MW_LAYER_SYSTEMINCLUDE diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/caappscanner/inc/casrvappscanner.h --- a/contentstorage/casrv/caappscanner/inc/casrvappscanner.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/caappscanner/inc/casrvappscanner.h Wed Jun 23 18:33:40 2010 +0300 @@ -150,6 +150,9 @@ * @result id of download collection. */ TInt GetCollectionDownloadIdL(); + + //TODO temporary sollution for fake uninstall progres notification + void ClearUninstallFlagL(); /** * Gets collectionId of all collection. @@ -308,12 +311,6 @@ void HandleMissingItemsL( RPointerArray& aCaEnties ); /** - * Removes app from storage. - * @param aAppEntry app to remove. - */ - void RemoveAppL( CCaInnerEntry* aAppEntry ); - - /** * Set "missing" flag. * @param aEntry entry. */ diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/caappscanner/src/casrvappscanner.cpp --- a/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -141,6 +141,10 @@ iApaLsSession.RegisterListPopulationCompleteObserver( iStatus ); iCollectionDownloadId = 0; iAllCollectionId = 0; + + //TODO temporary sollution for fake uninstall progres notification + ClearUninstallFlagL(); + SetActive(); } @@ -148,6 +152,29 @@ // // --------------------------------------------------------- // +//TODO temporary sollution for fake uninstall progres notification +void CCaSrvAppScanner::ClearUninstallFlagL() + { + CCaInnerQuery* uninstallQuery = CCaInnerQuery::NewLC(); + uninstallQuery->SetFlagsOn( EUninstall ); + + RPointerArray resultArray; + CleanupResetAndDestroyPushL( resultArray ); + iCaStorageProxy.GetEntriesL( uninstallQuery, resultArray ); + for( TInt i = 0; i < resultArray.Count(); i++ ) + { + resultArray[i]->SetFlags( resultArray[i]->GetFlags() & ~EUninstall ); + iCaStorageProxy.AddL( resultArray[i] ); + } + CleanupStack::PopAndDestroy( &resultArray ); + + CleanupStack::PopAndDestroy( uninstallQuery ); + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// void CCaSrvAppScanner::RunL() { User::LeaveIfError( iStatus.Int() ); @@ -912,13 +939,13 @@ RBuf attrVal; attrVal.CleanupClosePushL(); attrVal.CreateL( KCaMaxAttrValueLen ); - aEntry->FindAttribute( KCaAttrLongName, attrVal ); - if( attrVal.Compare( info->iCaption ) != KErrNone + aEntry->FindAttribute( KCaAttrShortName, attrVal ); + if( attrVal.Compare( info->iShortCaption ) != KErrNone || aEntry->GetText().Compare( info->iCaption ) != KErrNone ) { aEntry->SetTextL( info->iCaption ); - aEntry->AddAttributeL( KCaAttrLongName, info->iCaption ); + aEntry->AddAttributeL( KCaAttrShortName, info->iShortCaption ); changed = ETrue; } @@ -939,9 +966,20 @@ aEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueJava ); - aEntry->AddAttributeL( - KCaAttrAppSettingsPlugin, - KCaAttrJavaAppSettingsPluginValue ); + + TComponentId compId = + iSoftwareRegistry.GetComponentIdForAppL( info->iUid ); + CPropertyEntry* propertyEntry = + iSoftwareRegistry.GetComponentPropertyL( compId, KCaScrPropertyAppSettings ); + CleanupStack::PushL( propertyEntry ); + if ( propertyEntry && + propertyEntry->PropertyType() == CPropertyEntry::ELocalizedProperty ) + { + aEntry->AddAttributeL( + KCaAttrAppSettingsPlugin, + static_cast(propertyEntry)->StrValue() ); + } + CleanupStack::PopAndDestroy( propertyEntry ); } else if ( appTypeUid == KCWRTApplicationTypeUid ) { @@ -998,9 +1036,9 @@ TUint mmcId = 0; MenuUtils::GetTUint( attrVal, mmcId ); if( ( mmcId && KErrNotFound != iMmcHistory->Find( mmcId ) - && mmcId != CurrentMmcId() ) || - ( attrVal == KCaMassStorage() && - IsDriveInUse( DriveInfo::EDefaultMassStorage ) ) ) + && mmcId != CurrentMmcId() ) + || ( attrVal == KCaMassStorage() + && IsDriveInUse( DriveInfo::EDefaultMassStorage ) ) ) { // This item is on an MMC which is currently // in the MMC history or on a mass storage in use. @@ -1009,7 +1047,7 @@ } else { - aCaEntries[i]->RemoveAttributeL(KCaAttrMmcId()); + aCaEntries[i]->RemoveAttributeL( KCaAttrMmcId() ); ClearVisibleFlagL( aCaEntries[i] ); } } @@ -1025,24 +1063,11 @@ // // --------------------------------------------------------- // -void CCaSrvAppScanner::RemoveAppL( CCaInnerEntry* aAppEntry ) - { - RArray idsToRemove; - CleanupClosePushL( idsToRemove ); - idsToRemove.AppendL( aAppEntry->GetId() ); - iCaStorageProxy.RemoveL( idsToRemove ); - CleanupStack::PopAndDestroy( &idsToRemove ); - } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- -// void CCaSrvAppScanner::SetMissingFlagL( CCaInnerEntry* aEntry ) { if( !( aEntry->GetFlags() & EMissing ) ) { - aEntry->SetFlags( aEntry->GetFlags() | EMissing ); + aEntry->SetFlags( ( aEntry->GetFlags() | EMissing ) & ~EUninstall ); iCaStorageProxy.AddL( aEntry, EFalse, EItemDisappeared ); } } @@ -1057,6 +1082,7 @@ { aEntry->SetFlags( aEntry->GetFlags() & + ~EUninstall & ~EVisible & ~EMissing & ~EUsed ); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/caappscanner/src/proxy.cpp --- a/contentstorage/casrv/caappscanner/src/proxy.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/caappscanner/src/proxy.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -26,6 +26,10 @@ IMPLEMENTATION_PROXY_ENTRY(0x20026FAF, CCaAppScannerHandler::NewL) }; +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (proxy for instantiation) + // Function used to return an instance of the proxy table. EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) @@ -34,3 +38,9 @@ / sizeof(TImplementationProxy); return ImplementationTable; } + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + + diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/calocalizerscanner/calocalizerscanner.pro --- a/contentstorage/casrv/calocalizerscanner/calocalizerscanner.pro Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/calocalizerscanner/calocalizerscanner.pro Wed Jun 23 18:33:40 2010 +0300 @@ -56,7 +56,8 @@ LIBS += -leuser \ -lecom \ -lcautils \ - -lcamenu + -lcamenu \ + -lefsrv } exportResources(./*.qm, resource/qt/translations) diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/calocalizerscanner/inc/calocalizerscannerproxy.h --- a/contentstorage/casrv/calocalizerscanner/inc/calocalizerscannerproxy.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/calocalizerscanner/inc/calocalizerscannerproxy.h Wed Jun 23 18:33:40 2010 +0300 @@ -22,8 +22,6 @@ #include #include -#include "hbtextresolversymbian.h" - #include "castorage_global.h" // FORWARD DECLARATIONS diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp --- a/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -20,6 +20,7 @@ #include #include #include +#include //#include "cainternaltypes.h" #include "caarraycleanup.inl" @@ -150,6 +151,7 @@ } CleanupStack::PopAndDestroy( localizedName ); } + HbTextResolverSymbian::Init( _L(""), KLocalizationFilepathZ ); CleanupStack::PopAndDestroy( &ids ); CleanupStack::PopAndDestroy( &entries ); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/casatmonitor/src/casatmonitor.cpp --- a/contentstorage/casrv/casatmonitor/src/casatmonitor.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/casatmonitor/src/casatmonitor.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -115,7 +115,7 @@ resultArray[0]->SetRole( EItemEntryRole ); resultArray[0]->SetEntryTypeNameL( KCaTypeApp ); resultArray[0]->SetTextL( satName ); - resultArray[0]->AddAttributeL( KCaAttrLongName, satName ); + resultArray[0]->AddAttributeL( KCaAttrShortName, satName ); resultArray[0]->SetFlags( resultArray[0]->GetFlags() | EVisible ); iCaStorageProxy.AddL( resultArray[0] ); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/casatmonitor/src/casatnotifier.cpp --- a/contentstorage/casrv/casatmonitor/src/casatnotifier.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/casatmonitor/src/casatnotifier.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -95,6 +95,9 @@ iProperty.Cancel(); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (error ignored) // --------------------------------------------------------------------------- // CCaSatNotifier::RunError // --------------------------------------------------------------------------- @@ -103,6 +106,9 @@ { return KErrNone; } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT // --------------------------------------------------------------------------- // CCaSatNotifier::RunL diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/causifscanner/src/causifscanner.cpp --- a/contentstorage/casrv/causifscanner/src/causifscanner.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/causifscanner/src/causifscanner.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -161,7 +161,6 @@ if( aEntry->Name().Compare( KNullDesC ) ) { aCaEntry->SetTextL( aEntry->Name() ); - aCaEntry->AddAttributeL( KCaAttrLongName, aEntry->Name() ); } if( !aEntry->IsHidden() ) { diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/causifscanner/src/proxy.cpp --- a/contentstorage/casrv/causifscanner/src/proxy.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/causifscanner/src/proxy.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -28,6 +28,10 @@ IMPLEMENTATION_PROXY_ENTRY(KCaUsifScannerImplProxyUid, CCaUsifScanner::NewL) }; +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (proxy for instantiation) + // Function used to return an instance of the proxy table. EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) @@ -35,3 +39,8 @@ aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy); return ImplementationTable; } + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/group/cawidgetscanner.mmp --- a/contentstorage/casrv/cawidgetscanner/group/cawidgetscanner.mmp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/group/cawidgetscanner.mmp Wed Jun 23 18:33:40 2010 +0300 @@ -45,7 +45,6 @@ USERINCLUDE ../../casrvmgr/inc USERINCLUDE ../../../cautils/inc USERINCLUDE ../../../srvinc -USERINCLUDE ../../../castorage/inc USERINCLUDE ../../../inc MW_LAYER_SYSTEMINCLUDE diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h --- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h Wed Jun 23 18:33:40 2010 +0300 @@ -1,19 +1,19 @@ /* -* 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: -* -*/ + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ #ifndef C_WIDGETDESCRIPTION_H #define C_WIDGETDESCRIPTION_H @@ -49,13 +49,14 @@ /** * Static method to compare two CCaWidgetDescription objects + * used in Find() method * @param aFirst first item to compare * @param aSecond second item to compare - * @return ETrue if iLibrary value is the same in both objects, + * @return ETrue if widget uri value is the same in both objects, * otherwise returns EFalse */ static TBool Compare( const CCaWidgetDescription& aFirst, - const CCaWidgetDescription& aSecond); + const CCaWidgetDescription& aSecond ); /** * Method to compare two CCaWidgetDescription objects @@ -78,6 +79,12 @@ void SetPackageUidL( const TDesC& aPackageUid ); /* + * PackageUid getter + * @return iPackageUid - package UID + */ + TUint GetPackageUidL(); + + /* * Title setter * @param aTitle widget title */ @@ -102,107 +109,88 @@ void SetIconUriL( const TDesC& aIconUri ); /* + * Preview image name setter. + * @param aPreview preview image name identifier. + */ + void SetPreviewImageNameL( const TDesC& aPreviewName ); + + /* * Library setter * @param aLibrary widget library */ 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 + * Content storage entry id getter + * @return CS entry id */ - void SetMissing( TBool aMissing ); - - /* - * Visible flag setter - * @param aVisible flag - */ - void SetVisible( TBool aVisible ); - - /* - * Used flag setter - * @param aUsed flag - */ - void SetUsed( TBool aUsed ); - - /* - * Content arsenal entry id getter - * @return CA entry id - */ - TInt GetEntryId( ) const; + TInt GetEntryId() const; /* * MMC id getter * @return CA entry id */ - TPtrC GetMmcId( ) const; - + TPtrC GetMmcId() const; + /* * Library getter * @return widget library */ - TPtrC GetLibrary( ) const; + TPtrC GetLibrary() const; /* * Description getter * @return widget Description */ - TPtrC GetDescription( ) const; + TPtrC GetDescription() const; /* * Uri getter * @return widget Uri */ - TPtrC GetUri( ) const; + TPtrC GetUri() const; /* * IconUri getter * @return widget IconUri */ - TPtrC GetIconUri( ) const; + TPtrC GetIconUri() const; /* + * Preview image name getter + * @return widget preview image name + */ + TPtrC GetPreviewImageName( ) const; + + /* * Title getter - * @return widget IconUri + * @return widget title */ - TPtrC GetTitle( ) const; + TPtrC GetTitle() const; /* * Missing flag * @return ETrue if flag missing is set */ - TBool IsMissing( ) const; + TBool IsMissing() const; /* * Used flag * @return ETrue if flag used is set */ - TBool IsUsed( ) const; - + TBool IsUsed() const; /* * Used flag * @return ETrue if flag visible is set */ - TBool IsVisible( ) const; + TBool IsVisible() const; /* * Entry getter * @return entry representing widget */ - CCaInnerEntry* GetEntryLC( ) const; + CCaInnerEntry* GetEntryLC() const; /* * Modification time setter @@ -224,54 +212,55 @@ * Set service fw xml filename * @param aServiceXml Service xml filename */ - void SetServiceXmlL(const TDesC& aServiceXml); + void SetServiceXmlL( const TDesC& aServiceXml ); /* * Get service fw xml filename * @return Service xml filename */ TPtrC GetServiceXml() const; - - /* + /* - * Localizes title and description, fill string id fields - */ + /* + * Localizes title and description, fill string id fields + */ void LocalizeTextsL(); - + /* * StringIdDescription time getter * @return StringIdDescription */ TPtrC GetStringIdDescription() const; - + /* * StringIdTitle time getter * @return widget StringIdTitle */ TPtrC GetStringIdTitle() const; - - /* + + /* * Set manifest file path name. * @param aServiceXml Manifest file path name. */ - void SetManifestFilePathNameL(const TDesC& aManifestFilePathName); - + void SetManifestFilePathNameL( const TDesC& aManifestFilePathName ); + /* * Get manifest file path name. * @return Manifest file path name. */ TPtrC GetManifestFilePathName() const; + /* + * Set logical string for description. + * @param aStringIdDescription logical string for description. + */ void SetStringIdDescriptionL( const TDesC& aStringIdDescription ); + /* + * Set logical string for title. + * @param aStringIdTitle logical string for title. + */ void SetStringidTitleL( const TDesC& aStringIdTitle ); -private: - /* - * Library name getter - * @return libraru name - */ - TPtrC GetLibraryName( ) const; - /* * Flag setter * @param aFlag flag @@ -279,7 +268,24 @@ */ void SetFlag( TInt aFlag, TBool aValue ); -private: + /* + * Valid setter + * @param aVal value + */ + void SetValid(TBool aVal); + + /* + * Valid getter + * @return valid value + */ + TBool CCaWidgetDescription::IsValid(); + + /* + * Library name getter + * @return libraru name + */ + TPtrC GetLibraryName() const; + /** * C++ default constructor. @@ -289,17 +295,20 @@ /** * By default Symbian 2nd phase constructor is private. */ - void ConstructL( ); + void ConstructL(); void ConstructL( CCaInnerEntry* aEntry ); - -private: // Data /* * Content Storage entry id */ TInt iEntryId; + + /* + * Marks vidget as valid, used to remove widgets + */ + TBool iValid; /* * Package UID @@ -330,12 +339,11 @@ * Widget icon uri. Own */ RBuf iIconUri; - + /* - * Widget library. Own + * Preview name. Own */ - RBuf iPath; - + RBuf iPreviewImageName; /* * Widget library. Own */ diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerdef.h --- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerdef.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerdef.h Wed Jun 23 18:33:40 2010 +0300 @@ -25,12 +25,13 @@ const TInt KModificationTimeLength = 17; const TInt KNoId = -1; +const TInt KPackageUidPosition = 9; // position in path from end +const TInt KPackageUidLength = 8; + + // LIT _LIT( KDoubleSlash, "\\" ); _LIT( KWidgetScannerUnderline, "_" ); -_LIT( KWidgetScannerCaEntry, "CA_ENTRY" ); -_LIT( KWidgetScannerEnText, "EN_TEXT" ); -_LIT( KWidgetScannerEnDescription, "EN_DESCRIPTION" ); _LIT( KManifest, ".manifest"); @@ -48,7 +49,16 @@ _LIT8(KWidgetManifest, "hswidgetmanifest"); _LIT8(KIcon, "icon"); +_LIT8( KPreviewImageElementName, "previewimage" ); _LIT8(KServiceXml, "servicexml"); +// CONSTANTS +_LIT(KAttrWidgetPath, "widget:path"); +_LIT(KAttrWidgetLibrary, "widget:library"); +_LIT(KAttrWidgetUri, "widget:uri"); +_LIT(KAttrWidgetServiceXml, "widget:servicexml"); +_LIT(KSlash, "/"); +_LIT(KDllExt, ".dll"); +_LIT(KNoLibrary, "NoLibrary"); #endif // CA_WIDGETSCANNERDEF_H diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerinstallnotifier.h --- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerinstallnotifier.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerinstallnotifier.h Wed Jun 23 18:33:40 2010 +0300 @@ -1,20 +1,19 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Sis package installation event listener + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". * -*/ - + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Sis package installation event listener + * + */ #ifndef C_CAWIDGETSCANNERINSTALLNOTIFIER_H #define C_CAWIDGETSCANNERINSTALLNOTIFIER_H @@ -61,12 +60,12 @@ * @param aKey Key for central repository. */ static CCaWidgetScannerInstallNotifier* NewL( - CCaWidgetScannerPlugin* aCallback, TUid aCategory, TUint aKey ); + CCaWidgetScannerPlugin* aCallback, TUid aCategory, TUint aKey ); /** * Destructor. */ - virtual ~CCaWidgetScannerInstallNotifier (); + virtual ~CCaWidgetScannerInstallNotifier(); private: /** @@ -76,7 +75,7 @@ * @param aKey Key for central repository. */ CCaWidgetScannerInstallNotifier( CCaWidgetScannerPlugin* aCallback, - TUid aCategory, TUint aKey ); + TUid aCategory, TUint aKey ); /** * Symbian 2nd phase constructor. diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerparser.h --- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerparser.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerparser.h Wed Jun 23 18:33:40 2010 +0300 @@ -21,17 +21,19 @@ // INCLUDES #include -#include -#include +#include #include #include #include "cawidgetdescription.h" +#include "castorage_global.h" // CONSTANTS // FORWARD DECLARATIONS + class CDir; - +CA_STORAGE_TEST_CLASS( T_CaWidgetScanner ) +class TXmlEngElement; /** * Widget Parser * @@ -58,124 +60,8 @@ * WidgetsL * @return array containing widgets description */ - RWidgetArray& WidgetsScanL( ); - -private: - - /** - * Looks for manifests on a drive - * @param aDriveLetter drive letter - */ - void ScanOnDriveL( ); - - /** - * Parses all manifest files in a directory - * @param aDriveLetter drive letter - * @param aDirectoryName directory name - */ - void ParseDirectoryL( const TDesC& aDirectoryName ); - - /** - * Parse manifest file - * @param aFilePath full file path to manifest file - * @param aPackageUid descriptor containing package uid - */ - void ParseManifestFileL( const TDesC& aFilePath, - const TDesC& aPackageUid); - - /** - * Parse a widget, store parsed object in an internal array - * @param aFilePath full file path to manifest file - * @param aElement widget element - * @param aPackageUid descriptor containing package uid - */ - void ParseWidgetL( const TDesC& aFilePath, - TXmlEngElement aElement, const TDesC& aPackageUid ); - - /** - * Gets all directories from import folder - * @param aDriveLetter drive letter - * @return directories - */ - CDir* GetDirectoriesLC( ); - - /** - * Returns import path - * @param aDriveLetter drive letter - * @return import path - */ - HBufC* FullPathLC( ); - - /** - * Returns manifest directory path - * @param aDriveLetter drive letter - * @param aDirectoryName directory name - * @return manifest directory path - */ - HBufC* GetManifestDirectoryPathLC( const TDesC& aDirectoryName ); - - /** - * Sets widgets URI - * @param aElement xml element - * @param aWidget widget to set value - */ - void SetUriL( TXmlEngElement & aElement, CCaWidgetDescription * aWidget ); - - /** - * Sets widgets library and path created from library - * @param aElement xml element - * @param aPackageUid package uid - * @param aWidget widget to set value - */ - void SetLibraryL( TXmlEngElement & aElement, const TDesC & aPackageUid, - CCaWidgetDescription * aWidget ); - - /** - * Sets widgets title - * @param aElement xml element - * @param aWidget widget to set value - */ - void SetTitleL( TXmlEngElement & aElement, - CCaWidgetDescription * aWidget ); - - /** - * Sets widgets description - * @param aElement xml element - * @param aWidget widget to set value - */ - void SetDescriptionL( TXmlEngElement & aElement, - CCaWidgetDescription * aWidget ); - - /** - * Sets widgets visibility - * @param aElement xml element - * @param aWidget widget to set value - */ - void SetVisibilityL( TXmlEngElement & aElement, - CCaWidgetDescription * aWidget ); - - /** - * Sets icons URI - * @param aElement xml element - * @param aPackageUid package uid - * @param aWidget widget to set value - */ - void SetIconUriL( TXmlEngElement & aElement, const TDesC & aPackageUid, - CCaWidgetDescription * aWidget ); - - /** - * Sets widgets mmc id - * @param aWidget widget to set value - */ - void SetMmcIdL( CCaWidgetDescription * aWidget ); + RWidgetArray& WidgetsScanL( const RWidgetArray& aWidgets ); - void ParseUriL(TXmlEngElement & aElement); - void ParseTitleL(TXmlEngElement & aElement); - void ParseIconL(TXmlEngElement & aElement, const TDesC & aPackageUid); - void ParseDescriptionL(TXmlEngElement & aElement); - void ParseHiddenL(TXmlEngElement & aElement); - void ParseServiceXmlL(TXmlEngElement & aElement); - private: /** @@ -188,13 +74,162 @@ */ void ConstructL( ); -private: - // Data + + /** + * Looks for manifests on a drive + * @param aDrive drive to use + */ + void ScanOnDriveL( TChar& aDrive ); + + /** + * Parses all manifest files in a directory + * @param aDirectoryName directory name + * @param aDrive drive to use + */ + void ParseDirectoryL( const TDesC& aDirectoryName, TChar& aDrive ); + + /** + * Parse manifest file + * @param aFilePath full file path to manifest file + * @param aPackageUid descriptor containing package uid + * @param aDrive drive to use + */ + void ParseManifestFileL( const TDesC& aFilePath, + const TDesC& aPackageUid, TChar& aDrive ); + + /** + * Parse a widget, store parsed object in an internal array + * @param aFilePath full file path to manifest file + * @param aElement widget element + * @param aPackageUid descriptor containing package uid + * @param aDrive drive to use + */ + void ParseWidgetL( const TDesC& aFilePath, + TXmlEngElement& aElement, const TDesC& aPackageUid, + TChar& aDrive ); + + /** + * Gets all directories from import folder + * @param aDriveLetter drive letter + * @return directories + */ + CDir* GetDirectoriesLC( TChar& aDrive ); + + /** + * Returns import path + * @param aDriveLetter drive letter + * @return import path + */ + HBufC* FullPathLC( TChar& aDrive ) const; + + /** + * Returns manifest directory path + * @param aDriveLetter drive letter + * @param aDirectoryName directory name + * @param aDrive drive to use + * @return manifest directory path + */ + HBufC* GetManifestDirectoryPathLC( const TDesC& aDirectoryName, TChar& aDrive ) const; + + /** + * Sets widgets URI + * @param aElement xml element + * @param aWidget widget to set value + */ + void SetUriL( TXmlEngElement& aElement, CCaWidgetDescription* aWidget ); + + /** + * Sets widgets library and path created from library + * @param aElement xml element + * @param aPackageUid package uid + * @param aWidget widget to set value + */ + void SetLibraryL( TXmlEngElement& aElement, const TDesC& aPackageUid, + CCaWidgetDescription* aWidget, TChar& aDrive ); - /* - * Stores current drive letter + /** + * Sets widgets title + * @param aElement xml element + * @param aWidget widget to set value + */ + void SetTitleL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidget ); + + /** + * Sets widgets description + * @param aElement xml element + * @param aWidget widget to set value + */ + void SetDescriptionL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidget ); + + /** + * Sets widgets visibility + * @param aElement xml element + * @param aWidget widget to set value + */ + void SetVisibilityL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidget ); + + /** + * Sets icons URI + * @param aElement xml element + * @param aPackageUid package uid + * @param aWidget widget to set value + */ + void SetIconUriL( TXmlEngElement& aElement, const TDesC& aPackageUid, + CCaWidgetDescription* aWidget, TChar& aDrive ); + + /** + * Sets widgets mmc id + * @param aWidget widget to set value */ - TChar iCurrentDriveLetter; + void SetMmcIdL( CCaWidgetDescription* aWidget, TChar& aDrive ); + + void ParseUriL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidgetDescriptor ); + void ParseTitleL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidgetDescriptor ); + void ParseIconL( TXmlEngElement& aElement, const TDesC& aPackageUid, + CCaWidgetDescription* aWidgetDescriptor, TChar& aDrive ); + void ParseDescriptionL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidgetDescriptor ); + void ParseHiddenL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidgetDescriptor ); + void ParseServiceXmlL(TXmlEngElement & aElement, + CCaWidgetDescription* aWidgetDescriptor ); + void SetModificationTimeL( const TDesC& aFilePath, + CCaWidgetDescription* aWidgetDescriptor ); + + void ParsePreviewImageNameL( TXmlEngElement& aElement, + const TDesC& aPackageUid, + CCaWidgetDescription* aWidgetDescriptor, + TChar& aDrive ); + + /** + * @param aElement xml document element. + * @return created descriptor with element's text value. Ownership + * of the descriptor is passed to the caller. + */ + HBufC *CCaWidgetScannerParser::GetElementTextLC( + const TXmlEngElement& aElement ) const; + + /** + * Parses graphics name value and if the name has a file extension + * adds widget root directory path to it. + * @param aElement xml document element. + * @return created descriptor with graphics name value. Ownership + * of the descriptor is passed to the caller. + */ + HBufC* GetThemableGraphicsNameLC( + const TXmlEngElement & aElement, + const TDesC & aPackageUid, + TChar& aDrive ) const; + + + +private: + // Data /* * File server session.Not Own @@ -210,13 +245,19 @@ * Widgets. Own. */ RWidgetArray iWidgets; + + /* + * Widgets. Not own. + */ + RWidgetArray iFetchedWidgets; /* * Own. */ RXmlEngDOMImplementation iDomImpl; - CCaWidgetDescription* iWidgetDescriptor; - + + CA_STORAGE_TEST_FRIEND_CLASS( T_CaWidgetScanner ) + }; #endif // C_WIDGETSCANNERPARSER_H diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerplugin.h --- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerplugin.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerplugin.h Wed Jun 23 18:33:40 2010 +0300 @@ -1,31 +1,28 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Ecom plugin + * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". * -*/ - + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Ecom plugin + * + */ #ifndef C_CAWIDGETSCANNERPLUGIN_H #define C_CAWIDGETSCANNERPLUGIN_H #include #include -#include "cawidgetdescription.h" #include "cammcwatcher.h" class TPluginParams; -class CCaWidgetScannerParser; class CCaWidgetScannerInstallNotifier; class CCaWidgetStorageHandler; @@ -47,12 +44,12 @@ ~CCaWidgetScannerPlugin(); /** - * SynchronizeL + * SynchronizeL - synchronizes widgets on device with database */ void SynchronizeL(); private: -//from MWidgetMmcWatcherCallback + //from MWidgetMmcWatcherCallback /** * MmcChangeL is called when the MMC is removed or inserted. @@ -64,7 +61,7 @@ /** * C++ default constructor. */ - CCaWidgetScannerPlugin( ); + CCaWidgetScannerPlugin(); /** * By default Symbian 2nd phase constructor is private. @@ -84,11 +81,6 @@ CCaWidgetScannerInstallNotifier* iInstallNotifier; /** - * Pointer to a parser object. Own - */ - CCaWidgetScannerParser* iParser; - - /** * Content Storage Handler. Own. */ CCaWidgetStorageHandler* iStorageHandler; diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h --- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h Wed Jun 23 18:33:40 2010 +0300 @@ -1,26 +1,26 @@ /* -* 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: + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". * -*/ - + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ #ifndef C_WIDGETSTORAGEHANDLER_H #define C_WIDGETSTORAGEHANDLER_H class CCaStorageProxy; class CCaWidgetDescription; +class CCaWidgetScannerParser; // INCLUDES #include @@ -40,7 +40,7 @@ class CCaWidgetStorageHandler : public CBase { public: - CA_STORAGE_TEST_FRIEND_CLASS (T_CaWidgetScanner) +CA_STORAGE_TEST_FRIEND_CLASS (T_CaWidgetScanner) public: // Constructors and destructor @@ -59,11 +59,9 @@ virtual ~CCaWidgetStorageHandler(); /** - * Synchronizes widgets - * @param aWidgets widgets to synchronize + * SynchronizeL - synchronizes widgets on device with database */ - void SynchronizeL( const RWidgetArray& aWidgets ); - + void SynchronizeL(); private: @@ -76,6 +74,7 @@ /** * Updates widget in storage. * @param aWidget widget to be updated + * @param aEntryId entry of widget in db */ void UpdateL( const CCaWidgetDescription* aWidget, TUint aEntryId ); @@ -88,12 +87,12 @@ /** * Removes widgets from DB */ - void RemoveWidgetsL( ) ; + void RemoveWidgetsL(); /** * Fetch widgets from content storage */ - void FetchWidgetsL( ); + void FetchWidgetsL(); /** * Add widget to download collection @@ -112,14 +111,13 @@ * @param aWidget widget. */ void ClearVisibleFlagL( const CCaWidgetDescription* aWidget ); - + /** - * Set localizations for widget in db - * @param aWidget widget. - * @param aEntryId of widget. - */ - void SetLocalizationsL( const CCaWidgetDescription* aWidget, - TInt aEntryId ); + * Set localizations for widget in db + * @param aWidget widget. + * @param aEntryId of widget. + */ + void SetLocalizationsL( const CCaWidgetDescription* aWidget, TInt aEntryId ); private: @@ -131,7 +129,7 @@ /** * By default Symbian 2nd phase constructor is private. */ - void ConstructL( ); + void ConstructL(); /** * Check if mass storage is not in use. @@ -145,9 +143,8 @@ * is delivered with * @param aEntry widget entry being updated with component id attribute. */ - void UpdateComponentIdL( const TDesC& aManifestFilePathName, - CCaInnerEntry& aEntry ) const; - + void UpdateComponentIdL( const TDesC& aManifestFilePathName, + CCaInnerEntry& aEntry ) const; private: // Data @@ -167,11 +164,10 @@ */ RWidgetArray iWidgets; - /* - * Indexes updated during last add operation. Own. + /** + * Pointer to a parser object. Own */ - RArray iUpdatedIndexes; - + CCaWidgetScannerParser* iParser; Usif::RSoftwareComponentRegistry iSoftwareRegistry; }; diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/inc/widgetscannerutils.h --- a/contentstorage/casrv/cawidgetscanner/inc/widgetscannerutils.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/inc/widgetscannerutils.h Wed Jun 23 18:33:40 2010 +0300 @@ -1,20 +1,19 @@ /* -* 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: + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". * -*/ - + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ #ifndef WIDGETSCANNERUTILS_H #define WIDGETSCANNERUTILS_H @@ -22,15 +21,7 @@ // INCLUDES #include #include - -// CONSTANTS -_LIT(KAttrWidgetPath, "widget:path"); -_LIT(KAttrWidgetLibrary, "widget:library"); -_LIT(KAttrWidgetUri, "widget:uri"); -_LIT(KAttrWidgetServiceXml, "widget:servicexml"); -_LIT(KSlash, "/"); -_LIT(KDllExt, ".dll"); -_LIT(KNoLibrary, "NoLibrary"); +#include "cawidgetscannerdef.h" // FORWARD DECLARATIONS class CCaInnerEntry; @@ -49,8 +40,8 @@ * @param aDriveLetter drive letter * @return ETrue if file is present, EFalse if not */ - static TBool IsFileOnDrive(const TDesC& aFileName, - const DriveInfo::TDefaultDrives& aDefaultDrive); + static TBool IsFileOnDrive( const TDesC& aFileName, + const DriveInfo::TDefaultDrives& aDefaultDrive ); /** * Returns current MMC id. diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -17,13 +17,12 @@ // INCLUDE FILES +#include #include "cadef.h" #include "cawidgetdescription.h" #include "cainnerentry.h" #include "widgetscannerutils.h" -#include "hbtextresolversymbian.h" - #include "cawidgetscannerdef.h" // ============================ MEMBER FUNCTIONS =============================== @@ -34,7 +33,7 @@ // ----------------------------------------------------------------------------- // CCaWidgetDescription::CCaWidgetDescription() : - iEntryId(KNoId), iMmcId() + iEntryId( KNoId ), iValid ( EFalse ) { } @@ -65,13 +64,17 @@ User::LeaveIfError( uidLex.Val( iPackageUid, EHex )); } iTitle.CreateL( aEntry->GetText() ); + iIconUri.CreateL( aEntry->Icon()->FileName() ); + + TPtrC attribute; + aEntry->FindAttribute( KPreviewImageAttrName, attribute ); + iPreviewImageName.CreateL( attribute.Length() ); + iPreviewImageName = attribute; + //library iLibrary.CreateL( KCaMaxAttrValueLen ); aEntry->FindAttribute( KAttrWidgetLibrary, iLibrary ); - //path - iPath.CreateL( KCaMaxAttrValueLen ); - aEntry->FindAttribute( KAttrWidgetPath, iPath ); //uri iUri.CreateL( KCaMaxAttrValueLen ); aEntry->FindAttribute( KAttrWidgetUri, iUri ); @@ -131,18 +134,20 @@ // CCaWidgetDescription::~CCaWidgetDescription() { + + iModificationTime.Close(); + iServiceXml.Close(); + iMmcId.Close(); + iUri.Close(); + iLibrary.Close(); + iPreviewImageName.Close(); + iIconUri.Close(); iTitle.Close(); iDescription.Close(); - iUri.Close(); - iIconUri.Close(); - iLibrary.Close(); - iPath.Close(); - iModificationTime.Close(); - iMmcId.Close(); - iServiceXml.Close(); - iManifestFilePathName.Close(); iStringIdTitle.Close(); iStringIdDescription.Close(); + iManifestFilePathName.Close(); + } // ---------------------------------------------------------------------------- @@ -152,14 +157,16 @@ TBool CCaWidgetDescription::Compare( const CCaWidgetDescription& aFirst,const CCaWidgetDescription& aSecond) { + TBool result = EFalse; if( aFirst.GetUri() == aSecond.GetUri() ) { - return ETrue; + result = ETrue; } else { - return EFalse; + result = EFalse; } + return result; } // ---------------------------------------------------------------------------- @@ -168,24 +175,28 @@ // TBool CCaWidgetDescription::Compare( const CCaWidgetDescription& aToCompare ) { + TBool result = EFalse; if( aToCompare.GetLibrary() == GetLibrary() && aToCompare.GetDescription() == GetDescription() && aToCompare.GetUri() == GetUri() && aToCompare.GetIconUri() == GetIconUri() && + aToCompare.GetPreviewImageName() == GetPreviewImageName() && aToCompare.GetTitle() == GetTitle() && aToCompare.GetLibrary() != KNoLibrary && aToCompare.GetModificationTime() == GetModificationTime() && aToCompare.GetServiceXml() == GetServiceXml() ) { - return ETrue; + result = ETrue; } else { - return EFalse; + result = EFalse; } + return result; } + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -210,6 +221,15 @@ // // ----------------------------------------------------------------------------- // +TUint CCaWidgetDescription::GetPackageUidL() + { + return iPackageUid; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// void CCaWidgetDescription::SetTitleL( const TDesC& aTitle ) { iTitle.Close(); @@ -248,37 +268,19 @@ // // ----------------------------------------------------------------------------- // -void CCaWidgetDescription::SetLibraryL( const TDesC& aLibrary ) +void CCaWidgetDescription::SetPreviewImageNameL( const TDesC& aPreviewName ) { - iLibrary.Close(); - iLibrary.CreateL(aLibrary); + iPreviewImageName.Close(); + iPreviewImageName.CreateL( aPreviewName ); } - // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -void CCaWidgetDescription::SetMissing( TBool aMissing ) - { - SetFlag( EMissing, aMissing ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CCaWidgetDescription::SetVisible( TBool aVisible ) +void CCaWidgetDescription::SetLibraryL( const TDesC& aLibrary ) { - SetFlag( EVisible, aVisible ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CCaWidgetDescription::SetUsed( TBool aUsed ) - { - SetFlag( EUsed, aUsed ); + iLibrary.Close(); + iLibrary.CreateL(aLibrary); } // ----------------------------------------------------------------------------- @@ -375,23 +377,6 @@ // // ----------------------------------------------------------------------------- // -TPtrC CCaWidgetDescription::GetPath( ) const - { - return iPath; - } -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CCaWidgetDescription::SetPathL( const TDesC& aPath ) - { - iPath.Close(); - iPath.CreateL(aPath); - } -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// TPtrC CCaWidgetDescription::GetDescription( ) const { return iDescription; @@ -419,16 +404,27 @@ // // ----------------------------------------------------------------------------- // +TPtrC CCaWidgetDescription::GetPreviewImageName( ) const + { + return iPreviewImageName; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// TPtrC CCaWidgetDescription::GetTitle( ) const { + TPtrC result ; if ( iTitle == KNullDesC ) { - return GetLibraryName(); + result.Set( GetLibraryName() ); } else { - return iTitle; + result.Set( iTitle ); } + return result; } // ----------------------------------------------------------------------------- @@ -504,20 +500,14 @@ entry->SetFlags( entry->GetFlags() & ~ERemovable ); } } - if ( iPath != KNullDesC ) - { - entry->AddAttributeL(KAttrWidgetPath, iPath); - } if ( iTitle != KNullDesC ) { entry->SetTextL(iTitle); - entry->AddAttributeL(KCaAttrLongName, iTitle); } else { TPtrC libraryName( GetLibraryName() ); entry->SetTextL( libraryName ); - entry->AddAttributeL( KCaAttrLongName, libraryName ); } if ( iDescription != KNullDesC ) @@ -531,9 +521,12 @@ if ( iIconUri != KNullDesC) { // aSkinId and AppId not used for widgets - KNullDesC - entry->SetIconDataL(iIconUri, KNullDesC, KNullDesC); + entry->SetIconDataL( iIconUri, KNullDesC, KNullDesC ); } - + if ( iPreviewImageName != KNullDesC ) + { + entry->AddAttributeL( KPreviewImageAttrName, iPreviewImageName ); + } if( iModificationTime != KNullDesC ) { entry->AddAttributeL( KCaAttrInstallationTime, iModificationTime ); @@ -591,6 +584,10 @@ return iServiceXml; } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// void CCaWidgetDescription::LocalizeTextsL() { @@ -659,10 +656,28 @@ } } -/* - * Set manifest file path name - * @param aManifestFilePt - */ +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CCaWidgetDescription::IsValid() + { + return iValid; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCaWidgetDescription::SetValid(TBool aVal) + { + iValid = aVal; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// void CCaWidgetDescription::SetManifestFilePathNameL( const TDesC& aManifestFilePathName ) { @@ -670,10 +685,10 @@ iManifestFilePathName.CreateL( aManifestFilePathName ); } -/* - * Get service fw xml filename - * @return Service xml filename - */ +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// TPtrC CCaWidgetDescription::GetManifestFilePathName() const { return iManifestFilePathName; diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/src/cawidgetscannerinstallnotifier.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerinstallnotifier.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerinstallnotifier.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -1,20 +1,19 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Sis package installation event listener + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". * -*/ - + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Sis package installation event listener + * + */ #include #include "cawidgetscannerinstallnotifier.h" @@ -23,73 +22,73 @@ // ============================ MEMBER FUNCTIONS ============================= // ----------------------------------------------------------------------------- -// CCaWidgetScannerInstallNotifier::CCaWidgetScannerInstallNotifier -// C++ default constructor +// // ----------------------------------------------------------------------------- // CCaWidgetScannerInstallNotifier::CCaWidgetScannerInstallNotifier( - CCaWidgetScannerPlugin* aCallback, TUid aCategory, TUint aKey ) : - CActive(EPriorityNormal) + CCaWidgetScannerPlugin* aCallback, TUid aCategory, TUint aKey ) : + CActive( EPriorityNormal ) { CActiveScheduler::Add( this ); iCallback = aCallback; iCategory = aCategory; iKey = aKey; - // Prepare automatically iProperty.Attach( iCategory, iKey ); - SetActive( ); + SetActive(); iProperty.Subscribe( iStatus ); + iHackFlag = EFalse; } // ----------------------------------------------------------------------------- -// CCaWidgetScannerInstallNotifier::ConstructL -// S2nd phase constructor. +// // ----------------------------------------------------------------------------- // void CCaWidgetScannerInstallNotifier::ConstructL() { - iHackFlag = EFalse; } // --------------------------------------------------------------------------- -// CCaWidgetScannerInstallNotifier::NewL +// // --------------------------------------------------------------------------- // CCaWidgetScannerInstallNotifier* CCaWidgetScannerInstallNotifier::NewL( - CCaWidgetScannerPlugin* aCallback, TUid aCategory, TUint aKey ) + CCaWidgetScannerPlugin* aCallback, TUid aCategory, TUint aKey ) { - CCaWidgetScannerInstallNotifier* self = - new (ELeave) CCaWidgetScannerInstallNotifier( aCallback, - aCategory, aKey ); + CCaWidgetScannerInstallNotifier* self = + new ( ELeave ) CCaWidgetScannerInstallNotifier( aCallback, + aCategory, aKey ); CleanupStack::PushL( self ); - self->ConstructL( ); + self->ConstructL(); CleanupStack::Pop( self ); return self; } // --------------------------------------------------------------------------- -// CCaWidgetScannerInstallNotifier::~CCaWidgetScannerInstallNotifier +// // --------------------------------------------------------------------------- // CCaWidgetScannerInstallNotifier::~CCaWidgetScannerInstallNotifier() { - Cancel( ); - iProperty.Close( ); + Cancel(); + iProperty.Close(); } // --------------------------------------------------------------------------- -// CCaWidgetScannerInstallNotifier::DoCancel +// // --------------------------------------------------------------------------- // void CCaWidgetScannerInstallNotifier::DoCancel() { - iProperty.Cancel( ); + iProperty.Cancel(); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (error is ignored) // --------------------------------------------------------------------------- -// CCaWidgetScannerInstallNotifier::RunError +// // --------------------------------------------------------------------------- // TInt CCaWidgetScannerInstallNotifier::RunError( TInt /*aError*/) @@ -97,27 +96,30 @@ // No need to do anything return KErrNone; } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT // --------------------------------------------------------------------------- -// CCaWidgetScannerInstallNotifier::RunL +// // --------------------------------------------------------------------------- // void CCaWidgetScannerInstallNotifier::RunL() { // Re-issue request before notifying - SetActive( ); + SetActive(); iProperty.Subscribe( iStatus ); TInt status; User::LeaveIfError( iProperty.Get( KUidSystemCategory, - KSAUidSoftwareInstallKeyValue, status ) ); - - if( iHackFlag ) + KSAUidSoftwareInstallKeyValue, status ) ); + + if ( iHackFlag ) { iHackFlag = EFalse; iCallback->SynchronizeL(); } - else if ( (status & EInstOpInstall )||(status & EInstOpUninstall ) ) + else if ( ( status & EInstOpInstall ) || ( status & EInstOpUninstall ) ) { iHackFlag = ETrue; } diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -1,65 +1,59 @@ /* -* 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: + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". * -*/ - + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ // INCLUDE FILES #include -#include -#include -#include +#include +#include +#include +#include #include +#include #include "cadef.h" #include "cawidgetscannerparser.h" #include "widgetscannerutils.h" - #include "cawidgetscannerdef.h" - // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- -// CCaWidgetScannerParser::CCaWidgetScannerParser -// C++ default constructor can NOT contain any code, that -// might leave. +// // ----------------------------------------------------------------------------- // -CCaWidgetScannerParser::CCaWidgetScannerParser( RFs& aFs ): +CCaWidgetScannerParser::CCaWidgetScannerParser( RFs& aFs ) : iFs( aFs ) { } // ----------------------------------------------------------------------------- -// CCaWidgetScannerParser::ConstructL -// Symbian 2nd phase constructor can leave. +// // ----------------------------------------------------------------------------- // -void CCaWidgetScannerParser::ConstructL( ) +void CCaWidgetScannerParser::ConstructL() { iImportPath.CreateL( KMaxPath ); - //iFs.PrivatePath( iImportPath ); iImportPath.Append( KImportDir ); iDomImpl.OpenL(); } // ----------------------------------------------------------------------------- -// CCaWidgetScannerParser::NewL -// Two-phased constructor. +// // ----------------------------------------------------------------------------- // CCaWidgetScannerParser* CCaWidgetScannerParser::NewL( RFs& aFs ) @@ -70,25 +64,23 @@ } // ----------------------------------------------------------------------------- -// CCaWidgetScannerParser::NewLC -// Two-phased constructor. +// // ----------------------------------------------------------------------------- // CCaWidgetScannerParser* CCaWidgetScannerParser::NewLC( RFs& aFs ) { - CCaWidgetScannerParser* self = new( ELeave ) CCaWidgetScannerParser( aFs ); + CCaWidgetScannerParser* self = new ( ELeave ) CCaWidgetScannerParser( aFs ); CleanupStack::PushL( self ); - self->ConstructL( ); + self->ConstructL(); return self; } // ----------------------------------------------------------------------------- -// Destructor +// // ----------------------------------------------------------------------------- // CCaWidgetScannerParser::~CCaWidgetScannerParser() { - delete iWidgetDescriptor; iImportPath.Close(); iWidgets.ResetAndDestroy(); iDomImpl.Close(); @@ -98,39 +90,44 @@ // // ---------------------------------------------------------------------------- // -RWidgetArray& CCaWidgetScannerParser::WidgetsScanL( ) +RWidgetArray& CCaWidgetScannerParser::WidgetsScanL( + const RWidgetArray& aWidgets ) { TDriveList driveList; + TChar currentDriveLetter; User::LeaveIfError( iFs.DriveList( driveList ) ); iWidgets.ResetAndDestroy(); - for ( TInt driveNumber=EDriveZ; driveNumber >= EDriveA; driveNumber-- ) + iFetchedWidgets = aWidgets; + + for ( TInt driveNumber = EDriveZ; driveNumber >= EDriveA; driveNumber-- ) { if ( driveList[driveNumber] ) { User::LeaveIfError( iFs.DriveToChar( driveNumber, - iCurrentDriveLetter ) ); - ScanOnDriveL( ); + currentDriveLetter ) ); + ScanOnDriveL( currentDriveLetter ); } } + + return iWidgets; } - // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CCaWidgetScannerParser::ScanOnDriveL( ) +void CCaWidgetScannerParser::ScanOnDriveL( TChar& aDrive ) { - CDir* directories = GetDirectoriesLC( ); + CDir* directories = GetDirectoriesLC( aDrive ); if ( directories ) { - for ( TInt i(0); iCount( ); i++ ) + for ( TInt i( 0 ); i < directories->Count(); i++ ) { - if((*directories)[i].IsDir()) + if ( ( *directories )[i].IsDir() ) { - ParseDirectoryL((*directories)[i].iName); + ParseDirectoryL( ( *directories )[i].iName, aDrive ); } } } @@ -141,30 +138,66 @@ // // ---------------------------------------------------------------------------- // -void CCaWidgetScannerParser::ParseDirectoryL( const TDesC& aDirectoryName ) +void CCaWidgetScannerParser::ParseDirectoryL( const TDesC& aDirectoryName, + TChar& aDrive ) { - HBufC* manifestDirectoryPath = - GetManifestDirectoryPathLC( aDirectoryName ); + HBufC* manifestDirectoryPath = GetManifestDirectoryPathLC( aDirectoryName, + aDrive ); CDir* fileList = NULL; User::LeaveIfError( iFs.GetDir( *manifestDirectoryPath, - KEntryAttMatchExclude|KEntryAttDir, - ESortByDate, fileList ) ); + KEntryAttMatchExclude | KEntryAttDir, ESortByDate, fileList ) ); CleanupStack::PushL( fileList ); - for ( TInt i = 0; iCount( ); i++ ) + for ( TInt i = 0; i < fileList->Count(); i++ ) { - if( (*fileList)[i].iName.Find( KManifest ) != KErrNotFound ) + if ( ( *fileList )[i].iName.Find( KManifest ) != KErrNotFound ) { RBuf fullFilePath; CleanupClosePushL( fullFilePath ); - fullFilePath.CreateL( manifestDirectoryPath->Length() + - (*fileList)[i].iName.Length() ); + fullFilePath.CreateL( manifestDirectoryPath->Length() + + ( *fileList )[i].iName.Length() ); fullFilePath.Append( *manifestDirectoryPath ); - fullFilePath.Append( (*fileList)[i].iName ); - //if file is corrupted we go to the next one - TRAP_IGNORE(ParseManifestFileL( fullFilePath, aDirectoryName )); + fullFilePath.Append( ( *fileList )[i].iName ); + + TPtrC packageUidPtr = manifestDirectoryPath->Mid( + manifestDirectoryPath->Length() - KPackageUidPosition, + KPackageUidLength); + TUint packageUid; + TLex lexer( packageUidPtr ); + User::LeaveIfError( lexer.Val( packageUid, EHex ) ); + + CCaWidgetDescription* compareWidget = NULL; + for ( TInt j = 0; j < iFetchedWidgets.Count(); j++ ) + { + if ( iFetchedWidgets[j]->GetPackageUidL() == packageUid ) + { + compareWidget = iFetchedWidgets[j]; + compareWidget->SetValid( ETrue ); //do not remove from db + break; // once found we dont iterate anymore + } + } + + if ( compareWidget ) + { + TTime modificationTime = ( *fileList )[i].iModified; + TInt64 modificationIntTime = modificationTime.Int64(); + TLex lex( compareWidget->GetModificationTime() ); + TInt64 uintTimeDB( 0 ); + User::LeaveIfError( lex.Val( uintTimeDB ) ); + + if ( uintTimeDB != modificationIntTime ) + { + TRAP_IGNORE( ParseManifestFileL( fullFilePath, + aDirectoryName, aDrive ) ); + } + } + else + { + TRAP_IGNORE( ParseManifestFileL( fullFilePath, aDirectoryName, + aDrive ) ); + } CleanupStack::PopAndDestroy( &fullFilePath ); } } @@ -176,144 +209,125 @@ // // ---------------------------------------------------------------------------- // -void CCaWidgetScannerParser::ParseManifestFileL( - const TDesC& aFilePath, const TDesC& aPackageUid ) +void CCaWidgetScannerParser::ParseManifestFileL( const TDesC& aFilePath, + const TDesC& aPackageUid, TChar& aDrive ) { RXmlEngDOMParser parser; - CleanupClosePushL(parser); - User::LeaveIfError(parser.Open(iDomImpl)); - RXmlEngDocument doc = parser.ParseFileL(aFilePath, KChunkSize); - CleanupClosePushL(doc); + CleanupClosePushL( parser ); + User::LeaveIfError( parser.Open( iDomImpl ) ); + RXmlEngDocument doc = parser.ParseFileL( aFilePath, KChunkSize ); + CleanupClosePushL( doc ); TXmlEngElement docElement = doc.DocumentElement(); - if (docElement.Name() == KWidgetProvider) { + if ( docElement.Name() == KWidgetProvider ) + { TXmlEngElement element; RXmlEngNodeList elementList; - CleanupClosePushL(elementList); - docElement.GetElementsByTagNameL(elementList, KWidget); + CleanupClosePushL( elementList ); + docElement.GetElementsByTagNameL( elementList, KWidget ); - while (elementList.HasNext()) + while ( elementList.HasNext() ) { element = elementList.Next(); if ( element.HasAttributes() ) { - ParseWidgetL( aFilePath, element, aPackageUid ); + ParseWidgetL( aFilePath, element, aPackageUid, aDrive ); } } - CleanupStack::PopAndDestroy(&elementList); - } else if (docElement.Name() == KWidgetManifest) { + CleanupStack::PopAndDestroy( &elementList ); + } + else if ( docElement.Name() == KWidgetManifest ) + { + CCaWidgetDescription* widgetDescriptor = CCaWidgetDescription::NewL(); + widgetDescriptor->SetPackageUidL( aPackageUid ); + widgetDescriptor->SetFlag( EVisible, ETrue ); + widgetDescriptor->SetManifestFilePathNameL( aFilePath ); - delete iWidgetDescriptor; - iWidgetDescriptor = NULL; - iWidgetDescriptor = CCaWidgetDescription::NewL(); - iWidgetDescriptor->SetPackageUidL(aPackageUid); - iWidgetDescriptor->SetVisible(ETrue); - iWidgetDescriptor->SetManifestFilePathNameL( aFilePath ); + SetMmcIdL( widgetDescriptor, aDrive ); - SetMmcIdL( iWidgetDescriptor ); - RXmlEngNodeList childElementList; - CleanupClosePushL(childElementList); - docElement.GetChildElements(childElementList); + CleanupClosePushL( childElementList ); + docElement.GetChildElements( childElementList ); TXmlEngElement element; - while (childElementList.HasNext()) - { - element = childElementList.Next(); - if (element.Name() == KUri) - { - ParseUriL(element); - } - else if (element.Name() == KTitle) - { - ParseTitleL(element); - } - else if (element.Name() == KIcon) - { - ParseIconL(element,aPackageUid); - } - else if (element.Name() == KDescription) - { - ParseDescriptionL(element); - } - else if (element.Name() == KHidden) - { - ParseHiddenL(element); - } - else if (element.Name() == KServiceXml) - { - ParseServiceXmlL(element); - } - } - CleanupStack::PopAndDestroy(&childElementList); + while ( childElementList.HasNext() ) + { + element = childElementList.Next(); + if ( element.Name() == KUri ) + { + ParseUriL( element, widgetDescriptor ); + } + else if ( element.Name() == KTitle ) + { + ParseTitleL( element, widgetDescriptor ); + } + else if ( element.Name() == KIcon ) + { + ParseIconL( element, aPackageUid, widgetDescriptor, aDrive ); + } + else if ( element.Name() == KDescription ) + { + ParseDescriptionL( element, widgetDescriptor ); + } + else if ( element.Name() == KHidden ) + { + ParseHiddenL( element, widgetDescriptor ); + } + else if ( element.Name() == KServiceXml ) + { + ParseServiceXmlL( element, widgetDescriptor ); + } + else if ( element.Name() == KPreviewImageElementName ) + { + ParsePreviewImageNameL( element, aPackageUid, widgetDescriptor, aDrive ); + } + } + CleanupStack::PopAndDestroy( &childElementList ); - //set path for hs to use, trim last 2 chars (doubleslash) - HBufC *libraryPath = GetManifestDirectoryPathLC( aPackageUid ); - iWidgetDescriptor->SetPathL(libraryPath->Mid(0,libraryPath->Length()-1)); - CleanupStack::PopAndDestroy(libraryPath); - - HBufC *libraryPath2 = GetManifestDirectoryPathLC( aPackageUid ); - libraryPath2 = libraryPath2->ReAllocL(libraryPath2->Length() + iWidgetDescriptor->GetUri().Length()); - CleanupStack::Pop(1); - CleanupStack::PushL(libraryPath2); - libraryPath2->Des().Append(iWidgetDescriptor->GetUri()); - iWidgetDescriptor->SetLibraryL(*libraryPath2); - CleanupStack::PopAndDestroy(libraryPath2); - - - TTime modificationTime; - iFs.Modified( aFilePath, modificationTime); - TInt64 modificationIntTime = modificationTime.Int64(); - RBuf16 rBuf; - rBuf.CleanupClosePushL(); - rBuf.CreateL( KModificationTimeLength ); - rBuf.AppendNum( modificationIntTime ); - iWidgetDescriptor->SetModificationTimeL( rBuf ); - CleanupStack::PopAndDestroy( &rBuf ); + HBufC *libraryPath2 = GetManifestDirectoryPathLC( aPackageUid, aDrive ); + libraryPath2 = libraryPath2->ReAllocL( libraryPath2->Length() + + widgetDescriptor->GetUri().Length() ); + libraryPath2->Des().Append( widgetDescriptor->GetUri() ); + widgetDescriptor->SetLibraryL( *libraryPath2 ); + CleanupStack::PopAndDestroy( libraryPath2 ); - TInt index = iWidgets.Find( iWidgetDescriptor, CCaWidgetDescription::Compare ); + SetModificationTimeL( aFilePath, widgetDescriptor ); + + TInt index = iWidgets.Find( widgetDescriptor, + CCaWidgetDescription::Compare ); if ( index != KErrNotFound ) { delete iWidgets[index]; iWidgets.Remove( index ); } - iWidgets.AppendL( iWidgetDescriptor );//ownership transfer - iWidgetDescriptor = NULL; - } + iWidgets.AppendL( widgetDescriptor );//ownership transfer + widgetDescriptor = NULL; + } - CleanupStack::PopAndDestroy(&doc); - CleanupStack::PopAndDestroy(&parser); + CleanupStack::PopAndDestroy( &doc ); + CleanupStack::PopAndDestroy( &parser ); } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CCaWidgetScannerParser::ParseWidgetL( - const TDesC& aFilePath, TXmlEngElement aElement, - const TDesC& aPackageUid ) +void CCaWidgetScannerParser::ParseWidgetL( const TDesC& aFilePath, + TXmlEngElement& aElement, const TDesC& aPackageUid, TChar& aDrive ) { CCaWidgetDescription* widget = CCaWidgetDescription::NewLC(); SetUriL( aElement, widget ); - SetLibraryL( aElement, aPackageUid, widget); + SetLibraryL( aElement, aPackageUid, widget, aDrive ); SetTitleL( aElement, widget ); SetDescriptionL( aElement, widget ); SetVisibilityL( aElement, widget ); - SetIconUriL( aElement, aPackageUid, widget); + SetIconUriL( aElement, aPackageUid, widget, aDrive ); widget->SetPackageUidL( aPackageUid ); widget->SetManifestFilePathNameL( aFilePath ); - SetMmcIdL( widget ); + SetMmcIdL( widget, aDrive ); - TTime modificationTime; - iFs.Modified( aFilePath, modificationTime); - TInt64 modificationIntTime = modificationTime.Int64(); - RBuf16 rBuf; - rBuf.CleanupClosePushL(); - rBuf.CreateL( KModificationTimeLength ); - rBuf.AppendNum( modificationIntTime ); - widget->SetModificationTimeL( rBuf ); - CleanupStack::PopAndDestroy( &rBuf ); + SetModificationTimeL( aFilePath, widget ); TInt index = iWidgets.Find( widget, CCaWidgetDescription::Compare ); if ( index != KErrNotFound ) @@ -325,45 +339,40 @@ CleanupStack::Pop( widget ); } - // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CCaWidgetScannerParser::SetUriL( - TXmlEngElement & aElement, CCaWidgetDescription * aWidget ) -{ +void CCaWidgetScannerParser::SetUriL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidget ) + { HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L( - aElement.AttributeValueL( KUri ) ); + aElement.AttributeValueL( KUri ) ); CleanupStack::PushL( attributeValue ); - if( attributeValue->Compare( KNullDesC ) != 0 ) + if ( attributeValue->Compare( KNullDesC ) != 0 ) { aWidget->SetUriL( *attributeValue ); } CleanupStack::PopAndDestroy( attributeValue ); -} + } // ---------------------------------------------------------------------------- -// keep in mind that setLibrary also setsPath +// // ---------------------------------------------------------------------------- // -void CCaWidgetScannerParser::SetLibraryL( TXmlEngElement & aElement, - const TDesC & aPackageUid, CCaWidgetDescription * aWidget ) -{ +void CCaWidgetScannerParser::SetLibraryL( TXmlEngElement& aElement, + const TDesC& aPackageUid, CCaWidgetDescription* aWidget, TChar& aDrive ) + { HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L( - aElement.AttributeValueL( KLibrary ) ); + aElement.AttributeValueL( KLibrary ) ); CleanupStack::PushL( attributeValue ); - if( attributeValue->Compare( KNullDesC ) != 0 ) + if ( attributeValue->Compare( KNullDesC ) != 0 ) { - HBufC *libraryPath = GetManifestDirectoryPathLC( aPackageUid ); + HBufC *libraryPath = GetManifestDirectoryPathLC( aPackageUid, aDrive ); - //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()); + libraryPath->ReAllocL( libraryPath->Length() + attributeValue->Length() ); TPtr libraryPathModifier( libraryPath->Des() ); libraryPathModifier.Append( *attributeValue ); @@ -376,82 +385,81 @@ aWidget->SetLibraryL( KNoLibrary ); } CleanupStack::PopAndDestroy( attributeValue ); -} + } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CCaWidgetScannerParser::SetTitleL( - TXmlEngElement & aElement, CCaWidgetDescription * aWidget ) -{ +void CCaWidgetScannerParser::SetTitleL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidget ) + { HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L( - aElement.AttributeValueL( KTitle ) ); + aElement.AttributeValueL( KTitle ) ); CleanupStack::PushL( attributeValue ); - if( attributeValue->Compare( KNullDesC ) != 0 ) + if ( attributeValue->Compare( KNullDesC ) != 0 ) { aWidget->SetTitleL( *attributeValue ); } CleanupStack::PopAndDestroy( attributeValue ); -} + } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CCaWidgetScannerParser::SetDescriptionL( - TXmlEngElement & aElement, CCaWidgetDescription * aWidget ) -{ +void CCaWidgetScannerParser::SetDescriptionL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidget ) + { HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L( - aElement.AttributeValueL( KDescription ) ); + aElement.AttributeValueL( KDescription ) ); CleanupStack::PushL( attributeValue ); - if( attributeValue->Compare( KNullDesC ) != 0 ) + if ( attributeValue->Compare( KNullDesC ) != 0 ) { aWidget->SetDescriptionL( *attributeValue ); } CleanupStack::PopAndDestroy( attributeValue ); -} + } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CCaWidgetScannerParser::SetVisibilityL( - TXmlEngElement & aElement, CCaWidgetDescription * aWidget ) -{ +void CCaWidgetScannerParser::SetVisibilityL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidget ) + { HBufC *hidden = CnvUtfConverter::ConvertToUnicodeFromUtf8L( - aElement.AttributeValueL( KHidden ) ); + aElement.AttributeValueL( KHidden ) ); CleanupStack::PushL( hidden ); - if( hidden->Compare( KTrue ) == 0 ) + if ( hidden->Compare( KTrue ) == 0 ) { - aWidget->SetVisible( EFalse ); + aWidget->SetFlag( EVisible, EFalse ); } else { - aWidget->SetVisible( ETrue ); + aWidget->SetFlag( EVisible, ETrue ); } CleanupStack::PopAndDestroy( hidden ); -} + } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CCaWidgetScannerParser::SetIconUriL( TXmlEngElement & aElement, - const TDesC & aPackageUid, CCaWidgetDescription * aWidget ) -{ +void CCaWidgetScannerParser::SetIconUriL( TXmlEngElement& aElement, + const TDesC& aPackageUid, CCaWidgetDescription* aWidget, TChar& aDrive ) + { HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L( - aElement.AttributeValueL( KIconUri ) ); + aElement.AttributeValueL( KIconUri ) ); CleanupStack::PushL( attributeValue ); - if( attributeValue->Compare( KNullDesC ) != 0 ) + if ( attributeValue->Compare( KNullDesC ) != 0 ) { - HBufC* iconUriPath = GetManifestDirectoryPathLC( aPackageUid ); - iconUriPath->ReAllocL( - iconUriPath->Length() + attributeValue->Length() ); + HBufC* iconUriPath = GetManifestDirectoryPathLC( aPackageUid, aDrive ); + iconUriPath->ReAllocL( iconUriPath->Length() + attributeValue->Length() ); TPtr iconUriPathModifier( iconUriPath->Des() ); iconUriPathModifier.Append( *attributeValue ); @@ -460,44 +468,62 @@ CleanupStack::PopAndDestroy( iconUriPath ); } CleanupStack::PopAndDestroy( attributeValue ); -} + } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CCaWidgetScannerParser::SetMmcIdL( CCaWidgetDescription * widget ) -{ +void CCaWidgetScannerParser::SetMmcIdL( CCaWidgetDescription* aWidget, + TChar& aDrive ) + { TChar removableDrive; User::LeaveIfError( DriveInfo::GetDefaultDrive( - DriveInfo::EDefaultRemovableMassStorage, removableDrive ) ); + DriveInfo::EDefaultRemovableMassStorage, removableDrive ) ); TChar massStorageDrive; User::LeaveIfError( DriveInfo::GetDefaultDrive( - DriveInfo::EDefaultMassStorage, massStorageDrive ) ); - if( iCurrentDriveLetter == removableDrive ) + DriveInfo::EDefaultMassStorage, massStorageDrive ) ); + if ( aDrive == removableDrive ) { RBuf mmcId; - mmcId.CreateL(KMassStorageIdLength); mmcId.CleanupClosePushL(); + mmcId.CreateL( KMassStorageIdLength ); WidgetScannerUtils::CurrentMmcId( iFs, mmcId ); - widget->SetMmcIdL( mmcId ); + aWidget->SetMmcIdL( mmcId ); CleanupStack::PopAndDestroy( &mmcId ); } - else if( iCurrentDriveLetter == massStorageDrive ) + else if ( aDrive == massStorageDrive ) { - widget->SetMmcIdL( KCaMassStorage ); + aWidget->SetMmcIdL( KCaMassStorage ); } -} + } +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCaWidgetScannerParser::SetModificationTimeL( const TDesC& aFilePath, + CCaWidgetDescription* aWidgetDescriptor ) + { + TTime modificationTime; + iFs.Modified( aFilePath, modificationTime ); + TInt64 modificationIntTime = modificationTime.Int64(); + RBuf16 rBuf; + rBuf.CleanupClosePushL(); + rBuf.CreateL( KModificationTimeLength ); + rBuf.AppendNum( modificationIntTime ); + aWidgetDescriptor->SetModificationTimeL( rBuf ); + CleanupStack::PopAndDestroy( &rBuf ); + } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -CDir* CCaWidgetScannerParser::GetDirectoriesLC( ) +CDir* CCaWidgetScannerParser::GetDirectoriesLC( TChar& aDrive ) { CDir* result = NULL; - HBufC* path = FullPathLC( ); + HBufC* path = FullPathLC( aDrive ); iFs.GetDir( *path, KEntryAttDir, ESortByName, result ); CleanupStack::PopAndDestroy( path ); CleanupStack::PushL( result ); @@ -508,12 +534,11 @@ // // ---------------------------------------------------------------------------- // -HBufC* CCaWidgetScannerParser::FullPathLC( ) +HBufC* CCaWidgetScannerParser::FullPathLC( TChar& aDrive ) const { - HBufC* result = - HBufC16::NewLC( iImportPath.Length() + KDriveLetterLength ); + HBufC* result = HBufC16::NewLC( iImportPath.Length() + KDriveLetterLength ); TPtr modifier( result->Des() ); - modifier.Append( iCurrentDriveLetter ); + modifier.Append( aDrive ); modifier.Append( KColen ); modifier.Append( iImportPath ); return result; @@ -524,11 +549,11 @@ // ---------------------------------------------------------------------------- // HBufC* CCaWidgetScannerParser::GetManifestDirectoryPathLC( - const TDesC& aDirectoryName ) + const TDesC& aDirectoryName, TChar& aDrive ) const { HBufC* result = HBufC16::NewLC( KMaxPath ); TPtr modifier( result->Des() ); - HBufC* path = FullPathLC( ); + HBufC* path = FullPathLC( aDrive ); modifier.Append( *path ); CleanupStack::PopAndDestroy( path ); modifier.Append( aDirectoryName ); @@ -536,79 +561,160 @@ return result; } -void CCaWidgetScannerParser::ParseUriL(TXmlEngElement & aElement) - { - if (aElement.Text().Length()) - { - HBufC *utf16 = - CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() ); - CleanupStack::PushL( utf16 ); - iWidgetDescriptor->SetUriL( *utf16 ); - CleanupStack::PopAndDestroy( utf16 ); - } - - } -void CCaWidgetScannerParser::ParseTitleL(TXmlEngElement & aElement) +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCaWidgetScannerParser::ParseUriL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidgetDescriptor ) { - if (aElement.Text().Length()) - { - HBufC *utf16 = - CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() ); - CleanupStack::PushL( utf16 ); - iWidgetDescriptor->SetTitleL( *utf16 ); - CleanupStack::PopAndDestroy( utf16 ); - } + aWidgetDescriptor->SetUriL( *GetElementTextLC( aElement ) ); + CleanupStack::PopAndDestroy( ); } -void CCaWidgetScannerParser::ParseIconL(TXmlEngElement & aElement, - const TDesC & aPackageUid ) + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCaWidgetScannerParser::ParseTitleL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidgetDescriptor ) { - HBufC *utf16 = - CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() ); - CleanupStack::PushL( utf16 ); - if ( utf16->Compare( KNullDesC ) ) - { - HBufC* iconUriPath = GetManifestDirectoryPathLC( aPackageUid ); - iconUriPath = iconUriPath->ReAllocL( iconUriPath->Length() + utf16->Length() ); - CleanupStack::Pop(1); - CleanupStack::PushL(iconUriPath); - TPtr iconUriPathModifier( iconUriPath->Des() ); - iconUriPathModifier.Append( *utf16 ); - iWidgetDescriptor->SetIconUriL( *iconUriPath ); - CleanupStack::PopAndDestroy( iconUriPath ); - } - - CleanupStack::PopAndDestroy( utf16 ); + aWidgetDescriptor->SetTitleL( *GetElementTextLC( aElement ) ); + CleanupStack::PopAndDestroy( ); } -void CCaWidgetScannerParser::ParseDescriptionL(TXmlEngElement & aElement) +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCaWidgetScannerParser::ParseIconL( TXmlEngElement& aElement, + const TDesC& aPackageUid, CCaWidgetDescription* aWidgetDescriptor, + TChar& aDrive ) { - HBufC *desc = - CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() ); - CleanupStack::PushL( desc ); + aWidgetDescriptor->SetIconUriL( + *GetThemableGraphicsNameLC(aElement, aPackageUid, aDrive ) ); + + CleanupStack::PopAndDestroy( ); + } - if( desc->Compare( KNullDesC ) != 0 ) - { - iWidgetDescriptor->SetDescriptionL( *desc ); - } - CleanupStack::PopAndDestroy( desc ); +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCaWidgetScannerParser::ParsePreviewImageNameL( + TXmlEngElement & aElement, + const TDesC & aPackageUid, + CCaWidgetDescription* aWidgetDescriptor, + TChar& aDrive ) + { + aWidgetDescriptor->SetPreviewImageNameL( + *GetThemableGraphicsNameLC(aElement, aPackageUid, aDrive ) ); + + CleanupStack::PopAndDestroy( ); } -void CCaWidgetScannerParser::ParseHiddenL( TXmlEngElement& aElement ) + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCaWidgetScannerParser::ParseDescriptionL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidgetDescriptor ) + { + aWidgetDescriptor->SetDescriptionL( *GetElementTextLC( aElement ) ); + CleanupStack::PopAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCaWidgetScannerParser::ParseHiddenL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidgetDescriptor ) { if( aElement.Text().Compare( _L8("true") ) == 0 ) { - iWidgetDescriptor->SetVisible( EFalse ); + aWidgetDescriptor->SetFlag( EVisible, EFalse ); } + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCaWidgetScannerParser::ParseServiceXmlL( TXmlEngElement& aElement, + CCaWidgetDescription* aWidgetDescriptor ) + { + aWidgetDescriptor->SetServiceXmlL( *GetElementTextLC( aElement ) ); + CleanupStack::PopAndDestroy( ); + } +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +HBufC* CCaWidgetScannerParser::GetElementTextLC( + const TXmlEngElement& aElement ) const + { + HBufC* const elementText = + CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() ); + CleanupStack::PushL( elementText ); + return elementText; } -void CCaWidgetScannerParser::ParseServiceXmlL( TXmlEngElement& aElement ) + + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +HBufC* CCaWidgetScannerParser::GetThemableGraphicsNameLC( + const TXmlEngElement& aElement, + const TDesC& aPackageUid, + TChar& aDrive ) const { - HBufC *serviceXml = CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() ); - CleanupStack::PushL( serviceXml ); - - if (serviceXml->Compare(KNullDesC) != 0) + RBuf graphicsName; + graphicsName.CleanupClosePushL(); + HBufC* result; + + + if ( aElement.Text() != KNullDesC8 ) { - iWidgetDescriptor->SetServiceXmlL( *serviceXml ); + RBuf elementText; + elementText.CleanupClosePushL(); + + elementText.Assign( + CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() ) ); + + if ( TParsePtrC(elementText).Ext() != KNullDesC ) + { + HBufC* const manifestDirectoryPath( + GetManifestDirectoryPathLC( aPackageUid, aDrive ) ); + + graphicsName.CreateL( manifestDirectoryPath->Length() + + elementText.Length() ); + graphicsName.Append( *manifestDirectoryPath ); + + CleanupStack::PopAndDestroy( manifestDirectoryPath ); + } + else + { + graphicsName.CreateL( elementText.Length() ); + } + + graphicsName.Append( elementText ); + result = HBufC::NewL( graphicsName.Length() ) ; + *result = graphicsName; + + CleanupStack::PopAndDestroy( &elementText ); } - CleanupStack::PopAndDestroy( serviceXml ); + else + { + result = HBufC::NewL( 1 ) ; + } + CleanupStack::PopAndDestroy( &graphicsName ); + CleanupStack::PushL( result ); + + return result; } + + // End of File diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/src/cawidgetscannerplugin.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerplugin.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerplugin.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -1,19 +1,19 @@ /* -* 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: + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". * -*/ + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ // INCLUDE FILES @@ -21,63 +21,60 @@ #include #include "cawidgetscannerplugin.h" -#include "cawidgetscannerparser.h" #include "cawidgetstoragehandler.h" #include "cawidgetscannerinstallnotifier.h" - // Function used to return an instance of the proxy table. const TImplementationProxy ImplementationTable[] = { IMPLEMENTATION_PROXY_ENTRY(0x20028707, CCaWidgetScannerPlugin::NewL) }; +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (proxy for instantiation) // ---------------------------------------------------------------------------- -// ImplementationGroupProxy -// Exported proxy for instantiation method resolution +// // ---------------------------------------------------------------------------- // EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) { - aTableCount = sizeof( ImplementationTable ) / - sizeof( TImplementationProxy ); + aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy); return ImplementationTable; } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT // ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CCaWidgetScannerPlugin ::CCaWidgetScannerPlugin -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // CCaWidgetScannerPlugin::CCaWidgetScannerPlugin() { } -// ----------------------------------------------------------------------------- -// CCaWidgetScannerPlugin ::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // void CCaWidgetScannerPlugin::ConstructL( TPluginParams* aPluginParams ) { User::LeaveIfError( iFs.Connect() ); iMmcWatcher = CCaMmcWatcher::NewL( iFs, this ); iInstallNotifier = CCaWidgetScannerInstallNotifier::NewL( this, - KUidSystemCategory, KSAUidSoftwareInstallKeyValue ); - iParser = CCaWidgetScannerParser::NewL( iFs ); + KUidSystemCategory, KSAUidSoftwareInstallKeyValue ); iStorageHandler = CCaWidgetStorageHandler::NewL( aPluginParams->storageProxy, iFs ); SynchronizeL(); } -// ----------------------------------------------------------------------------- -// CCaWidgetScannerPlugin ::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewL( TPluginParams* aPluginParams ) @@ -87,29 +84,27 @@ return self; } -// ----------------------------------------------------------------------------- -// CCaWidgetScannerPlugin ::NewLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewLC( TPluginParams* aPluginParams ) { - CCaWidgetScannerPlugin * self = new( ELeave ) CCaWidgetScannerPlugin ( ); + CCaWidgetScannerPlugin * self = new ( ELeave ) CCaWidgetScannerPlugin(); CleanupStack::PushL( self ); self->ConstructL( aPluginParams ); return self; } -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- // -CCaWidgetScannerPlugin::~CCaWidgetScannerPlugin () +CCaWidgetScannerPlugin::~CCaWidgetScannerPlugin() { delete iMmcWatcher; delete iInstallNotifier; - delete iParser; delete iStorageHandler; iFs.Close(); } @@ -120,7 +115,7 @@ // void CCaWidgetScannerPlugin::SynchronizeL() { - iStorageHandler->SynchronizeL( iParser->WidgetsScanL() ); + iStorageHandler->SynchronizeL(); } // ---------------------------------------------------------------------------- diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp --- a/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -18,6 +18,8 @@ #include #include +#include + #include "widgetscannerutils.h" #include "cawidgetstoragehandler.h" #include "cadef.h" @@ -26,41 +28,36 @@ #include "castorageproxy.h" #include "caarraycleanup.inl" #include "calocalizationentry.h" - +#include "cawidgetscannerparser.h" #include "cawidgetscannerdef.h" - using namespace Usif; - -// ============================ MEMBER FUNCTIONS =============================== +// ============================ MEMBER FUNCTIONS ============================z=== // ----------------------------------------------------------------------------- -// CCaWidgetStorageHandler::CCaWidgetStorageHandler -// C++ default constructor can NOT contain any code, that -// might leave. +// // ----------------------------------------------------------------------------- // -CCaWidgetStorageHandler::CCaWidgetStorageHandler( - CCaStorageProxy* aStorage, RFs& aFs ) +CCaWidgetStorageHandler::CCaWidgetStorageHandler( CCaStorageProxy* aStorage, + RFs& aFs ) { iStorage = aStorage; iFs = aFs; } // ----------------------------------------------------------------------------- -// CCaWidgetStorageHandler::ConstructL -// Symbian 2nd phase constructor can leave. +// // ----------------------------------------------------------------------------- // void CCaWidgetStorageHandler::ConstructL() { User::LeaveIfError( iSoftwareRegistry.Connect() ); + iParser = CCaWidgetScannerParser::NewL( iFs ); } // ----------------------------------------------------------------------------- -// CCaWidgetStorageHandler::NewL -// Two-phased constructor. +// // ----------------------------------------------------------------------------- // CCaWidgetStorageHandler* CCaWidgetStorageHandler::NewL( @@ -72,8 +69,7 @@ } // ----------------------------------------------------------------------------- -// CCaWidgetStorageHandler::NewLC -// Two-phased constructor. +// // ----------------------------------------------------------------------------- // CCaWidgetStorageHandler* CCaWidgetStorageHandler::NewLC( @@ -87,24 +83,24 @@ } // ----------------------------------------------------------------------------- -// Destructor +// // ----------------------------------------------------------------------------- // CCaWidgetStorageHandler::~CCaWidgetStorageHandler() { + delete iParser; iSoftwareRegistry.Close(); iWidgets.ResetAndDestroy(); - iUpdatedIndexes.Close(); } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CCaWidgetStorageHandler::SynchronizeL( const RWidgetArray& aWidgets ) +void CCaWidgetStorageHandler::SynchronizeL() { FetchWidgetsL(); - AddWidgetsL( aWidgets ); + AddWidgetsL( iParser->WidgetsScanL( iWidgets ) ); RemoveWidgetsL(); } @@ -119,8 +115,8 @@ iStorage->AddL( entry ); SetLocalizationsL( aWidget, entry->GetId() ); - - if( entry->GetFlags() & ERemovable ) + + if ( entry->GetFlags() & ERemovable ) { AddWidgetToDownloadCollectionL( entry ); } @@ -137,22 +133,21 @@ CCaInnerEntry* entry = aWidget->GetEntryLC(); UpdateComponentIdL( aWidget->GetManifestFilePathName(), *entry ); entry->SetId( aEntryId ); - if( !aWidget->IsMissing() && aWidget->IsUsed() ) + if ( !aWidget->IsMissing() && aWidget->IsUsed() ) { entry->SetFlags( entry->GetFlags() & ~EUsed ); } TItemAppearance itemAppearanceChange = EItemAppearanceNotChanged; - if( ( entry->GetFlags() & EMissing ) || - !( entry->GetFlags() & EVisible ) ) + if ( ( entry->GetFlags() & EMissing ) || !( entry->GetFlags() & EVisible ) ) { itemAppearanceChange = EItemAppeared; } entry->SetFlags( entry->GetFlags() & ~EMissing | EVisible ); iStorage->AddL( entry, EFalse, itemAppearanceChange ); - + SetLocalizationsL( aWidget, entry->GetId() ); - - if( !aWidget->IsMissing() ) + + if ( !aWidget->IsMissing() ) { AddWidgetToDownloadCollectionL( entry ); } @@ -165,29 +160,28 @@ // void CCaWidgetStorageHandler::AddWidgetsL( const RWidgetArray& aWidgets ) { - iUpdatedIndexes.Reset(); - for( TInt i = 0; i < aWidgets.Count(); i++ ) + for ( TInt i = 0; i < aWidgets.Count(); i++ ) { aWidgets[i]->LocalizeTextsL(); - TInt index = iWidgets.Find( - aWidgets[i], CCaWidgetDescription::Compare ); - if( index != KErrNotFound ) + TInt index = iWidgets.Find( aWidgets[i], CCaWidgetDescription::Compare ); + if ( index != KErrNotFound ) { - if( !iWidgets[index]->Compare( *aWidgets[i] ) || - iWidgets[index]->IsMissing() ) + iWidgets[index]->SetValid( ETrue ); + if ( !iWidgets[index]->Compare( *aWidgets[i] ) + || iWidgets[index]->IsMissing() ) { - aWidgets[i]->SetMissing( iWidgets[index]->IsMissing() ); - aWidgets[i]->SetUsed( iWidgets[index]->IsUsed() ); - aWidgets[i]->SetVisible( iWidgets[index]->IsVisible() ); + aWidgets[i]->SetFlag( EMissing, iWidgets[index]->IsMissing() ); + aWidgets[i]->SetFlag( EUsed, iWidgets[index]->IsUsed() ); + aWidgets[i]->SetFlag( EVisible, iWidgets[index]->IsVisible() ); UpdateL( aWidgets[i], iWidgets[index]->GetEntryId() ); } - iUpdatedIndexes.AppendL( index ); } else { AddL( aWidgets[i] ); } } + HbTextResolverSymbian::Init( _L(""), KLocalizationFilepathZ ); } // ---------------------------------------------------------------------------- @@ -196,11 +190,11 @@ // void CCaWidgetStorageHandler::RemoveWidgetsL() { - for( TInt i = 0; i < iWidgets.Count(); i++ ) + for ( TInt i = 0; i < iWidgets.Count(); i++ ) { - if( iUpdatedIndexes.Find( i ) == KErrNotFound ) + if ( !iWidgets[i]->IsValid() ) { - if( iWidgets[i]->GetMmcId() != KNullDesC ) + if ( iWidgets[i]->GetMmcId() != KNullDesC ) { RBuf currentMmcId; currentMmcId.CreateL( KMassStorageIdLength ); @@ -218,15 +212,12 @@ { SetMissingFlagL( iWidgets[i] ); } - CleanupStack::PopAndDestroy(¤tMmcId); + CleanupStack::PopAndDestroy( ¤tMmcId ); } else { //item was uninstalled so we remove its mmc id - if ( iWidgets[i]->IsVisible() ) - { - ClearVisibleFlagL( iWidgets[i] ); - } + ClearVisibleFlagL( iWidgets[i] ); } } } @@ -284,12 +275,11 @@ RPointerArray entries; CleanupResetAndDestroyPushL( entries ); iStorage->GetEntriesL( query, entries ); - + iWidgets.ResetAndDestroy(); - for( TInt i = 0; i < entries.Count(); i++ ) + for ( TInt i = 0; i < entries.Count(); i++ ) { - CCaWidgetDescription* widget = CCaWidgetDescription::NewLC( - entries[i] ); + CCaWidgetDescription* widget = CCaWidgetDescription::NewLC( entries[i] ); iWidgets.AppendL( widget ); //iWidgets takes ownership CleanupStack::Pop( widget ); } @@ -304,11 +294,11 @@ void CCaWidgetStorageHandler::SetMissingFlagL( const CCaWidgetDescription* aWidget ) { - if( !aWidget->IsMissing() ) + if ( !aWidget->IsMissing() ) { CCaInnerEntry* entry = aWidget->GetEntryLC(); - entry->SetFlags( entry->GetFlags() | EMissing ); - if( aWidget->IsUsed() ) + entry->SetFlags( ( entry->GetFlags() | EMissing ) & ~EUninstall ); + if ( aWidget->IsUsed() ) { entry->SetFlags( entry->GetFlags() | EUsed ); } @@ -324,10 +314,17 @@ void CCaWidgetStorageHandler::ClearVisibleFlagL( const CCaWidgetDescription* aWidget ) { - CCaInnerEntry* entry = aWidget->GetEntryLC(); - entry->SetFlags( entry->GetFlags() & ~EVisible & ~EMissing & ~EUsed ); - iStorage->AddL( entry, EFalse, EItemDisappeared ); - CleanupStack::PopAndDestroy( entry ); + if ( aWidget->IsVisible() ) + { + CCaInnerEntry* entry = aWidget->GetEntryLC(); + entry->SetFlags( entry->GetFlags() + & ~EUninstall + & ~EVisible + & ~EMissing + & ~EUsed ); + iStorage->AddL( entry, EFalse, EItemDisappeared ); + CleanupStack::PopAndDestroy( entry ); + } } // ---------------------------------------------------------------------------- @@ -355,24 +352,24 @@ // ---------------------------------------------------------------------------- // -void CCaWidgetStorageHandler::SetLocalizationsL( const CCaWidgetDescription* aWidget, - TInt aEntryId ) +void CCaWidgetStorageHandler::SetLocalizationsL( + const CCaWidgetDescription* aWidget, TInt aEntryId ) { RBuf filename; - filename.Create( aWidget->GetUri().Length() + 1 ); //1 for _ + filename.CreateL( aWidget->GetUri().Length() + 1 ); //1 for _ CleanupClosePushL( filename ); filename.Copy( aWidget->GetUri() ); filename.Append( KWidgetScannerUnderline ); - + // prepare localizations - if ( aWidget->GetTitle().Length() > 0 && - aWidget->GetTitle().Compare( aWidget->GetStringIdTitle() ) ) - // lets do not add localization when key and value are identical + if ( aWidget->GetTitle().Length() > 0 && aWidget->GetTitle().Compare( + aWidget->GetStringIdTitle() ) ) + // lets do not add localization when key and value are identical { CCaLocalizationEntry* titleEntry = CCaLocalizationEntry::NewL(); CleanupStack::PushL( titleEntry ); - titleEntry->SetTableNameL( KWidgetScannerCaEntry ); - titleEntry->SetAttributeNameL( KWidgetScannerEnText ); + titleEntry->SetTableNameL( KLocalizationCaEntry ); + titleEntry->SetAttributeNameL( KLocalizationEnText ); titleEntry->SetStringIdL( aWidget->GetStringIdTitle() ); titleEntry->SetQmFilenameL( filename ); titleEntry->SetRowId( aEntryId ); @@ -382,12 +379,12 @@ if ( aWidget->GetDescription().Length() > 0 && aWidget->GetDescription().Compare( aWidget->GetStringIdDescription() ) ) - // lets do not add localization when key and value are identical + // lets do not add localization when key and value are identical { CCaLocalizationEntry* descEntry = CCaLocalizationEntry::NewL(); CleanupStack::PushL( descEntry ); - descEntry->SetTableNameL( KWidgetScannerCaEntry ); - descEntry->SetAttributeNameL( KWidgetScannerEnDescription ); + descEntry->SetTableNameL( KLocalizationCaEntry ); + descEntry->SetAttributeNameL( KLocalizationEnDescription ); descEntry->SetStringIdL( aWidget->GetStringIdDescription() ); descEntry->SetQmFilenameL( filename ); descEntry->SetRowId( aEntryId ); @@ -402,41 +399,39 @@ // ---------------------------------------------------------------------------- // -void CCaWidgetStorageHandler::UpdateComponentIdL( - const TDesC& aManifestFilePathName, - CCaInnerEntry& aEntry ) const +void CCaWidgetStorageHandler::UpdateComponentIdL( + const TDesC& aManifestFilePathName, CCaInnerEntry& aEntry ) const { RArray componentIds; CleanupClosePushL( componentIds ); - + CComponentFilter* const fileNameFilter = CComponentFilter::NewLC(); fileNameFilter->SetFileL( aManifestFilePathName ); iSoftwareRegistry.GetComponentIdsL( componentIds, fileNameFilter ); CleanupStack::PopAndDestroy( fileNameFilter ); - + if ( componentIds.Count() == 1 ) { RBuf newComponentId; newComponentId.CleanupClosePushL(); newComponentId.CreateL( sizeof(TComponentId) + 1 ); newComponentId.AppendNum( componentIds[0] ); - + RBuf oldComponentId; oldComponentId.CleanupClosePushL(); oldComponentId.CreateL( KCaMaxAttrValueLen ); - - const TBool componentIdAttributeFound = - aEntry.FindAttribute( KCaComponentId, oldComponentId ); - - if ( !componentIdAttributeFound - || oldComponentId.Compare( newComponentId ) != 0 ) + + const TBool componentIdAttributeFound = aEntry.FindAttribute( + KCaComponentId, oldComponentId ); + + if ( !componentIdAttributeFound || oldComponentId.Compare( + newComponentId ) != 0 ) { // 'add' or 'update' the component id attribute value - aEntry.AddAttributeL( KCaComponentId, - newComponentId ); + aEntry.AddAttributeL( KCaComponentId, newComponentId ); } - + CleanupStack::PopAndDestroy( &oldComponentId ); CleanupStack::PopAndDestroy( &newComponentId ); } @@ -444,5 +439,4 @@ CleanupStack::PopAndDestroy( &componentIds ); } - // End of File diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/casrv/cawidgetscanner/src/widgetscannerutils.cpp --- a/contentstorage/casrv/cawidgetscanner/src/widgetscannerutils.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/casrv/cawidgetscanner/src/widgetscannerutils.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -1,19 +1,19 @@ /* -* 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: + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". * -*/ + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ // INCLUDE FILES #include "widgetscannerutils.h" @@ -24,23 +24,26 @@ // // ----------------------------------------------------------------------------- // -TBool WidgetScannerUtils::IsFileOnDrive(const TDesC& aFileName, - const DriveInfo::TDefaultDrives& aDefaultDrive) -{ - if (aFileName.Length()) { +TBool WidgetScannerUtils::IsFileOnDrive( const TDesC& aFileName, + const DriveInfo::TDefaultDrives& aDefaultDrive ) + { + TBool result = EFalse; + if ( aFileName.Length() ) + { TInt drive; - TInt err = DriveInfo::GetDefaultDrive(aDefaultDrive, drive); - if (!err) { + TInt err = DriveInfo::GetDefaultDrive( aDefaultDrive, drive ); + if ( !err ) + { TInt fileDrive; - err = RFs::CharToDrive(aFileName[0], fileDrive); - if (!err && fileDrive == drive) { - return ETrue; + err = RFs::CharToDrive( aFileName[0], fileDrive ); + if ( !err && fileDrive == drive ) + { + result = ETrue; + } } } + return result; } - return EFalse; -} - // ----------------------------------------------------------------------------- // @@ -49,11 +52,11 @@ void WidgetScannerUtils::CurrentMmcId( const RFs& aFs, TDes& aMmcId ) { TInt mmcDrive; - if ( DriveInfo::GetDefaultDrive( - DriveInfo::EDefaultRemovableMassStorage, mmcDrive ) == KErrNone ) + if ( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, + mmcDrive ) == KErrNone ) { TVolumeInfo volumeInfo; - if( aFs.Volume( volumeInfo, mmcDrive ) == KErrNone ) + if ( aFs.Volume( volumeInfo, mmcDrive ) == KErrNone ) { aMmcId.Zero(); aMmcId.AppendNum( volumeInfo.iUniqueID ); diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/castorage/data/castorage.db Binary file contentstorage/castorage/data/castorage.db has changed diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/castorage/data/castoragedb_create.sql --- a/contentstorage/castorage/data/castoragedb_create.sql Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/castorage/data/castoragedb_create.sql Wed Jun 23 18:33:40 2010 +0300 @@ -193,7 +193,6 @@ "" AS "ICON_SKIN_ID", "" AS "PACKAGE_UID", "" AS "LIBRARY", - "" AS "LONG_NAME", "" AS "URI", "" AS "COLLECTION_NAME"; @@ -216,8 +215,6 @@ 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) diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/castorage/data/castoragedb_variant_test.sql --- a/contentstorage/castorage/data/castoragedb_variant_test.sql Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/castorage/data/castoragedb_variant_test.sql Wed Jun 23 18:33:40 2010 +0300 @@ -14,8 +14,8 @@ VALUES ("url", 'Google', 'c:\data\Images\kqticaicons\google.png', "http://www.google.com/", 'Test Apps', '4' ); -- insert example widgets - INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON_FILENAME, ICON_SKIN_ID, PACKAGE_UID, LIBRARY, LONG_NAME, URI, COLLECTION_NAME) - VALUES ("widget", 'Clock', 'Z:\private\20022F35\import\widgetregistry\20022F6C\tclock.png', '4' , '20022f6c', 'Z:\private\20022F35\import\widgetregistry\20022F6C\hsclockwidgetplugin', 'Clock', 'hsclockwidgetplugin', 'Test Apps' ); + INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON_FILENAME, ICON_SKIN_ID, PACKAGE_UID, LIBRARY, URI, COLLECTION_NAME) + VALUES ("widget", 'Clock', 'Z:\private\20022F35\import\widgetregistry\20022F6C\tclock.png', '4' , '20022f6c', 'Z:\private\20022F35\import\widgetregistry\20022F6C\hsclockwidgetplugin', 'hsclockwidgetplugin', 'Test Apps' ); SELECT "castoragedb_variant_test - END" AS " "; diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/castorage/inc/casqlitestorage.h --- a/contentstorage/castorage/inc/casqlitestorage.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/castorage/inc/casqlitestorage.h Wed Jun 23 18:33:40 2010 +0300 @@ -129,9 +129,12 @@ * @param aEntryIdArray List of enties ids. * @param aParentIdArray The result list of parents * ids for a specific select. + * @param aCheckParentsParent falg if set to true then + * search also for parent of the parent */ void GetParentsIdsL( const RArray& aEntryIdArray, - RArray& aParentIdArray ); + RArray& aParentIdArray, + TBool aCheckParentsParent = ETrue ); /** * Adds or Updates data & action to database. diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/castorage/inc/castorage.h --- a/contentstorage/castorage/inc/castorage.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/castorage/inc/castorage.h Wed Jun 23 18:33:40 2010 +0300 @@ -79,9 +79,12 @@ * @param aEntryIdArray list of enties ids. * @param aParentIdArray The result list of parents' ids * for a specific select. + * @param aCheckParentsParent falg if set to true then + * search also for parent of the parent */ virtual void GetParentsIdsL( const RArray& aEntryIdArray, - RArray& aParentIdArray ) = 0; + RArray& aParentIdArray, + TBool aCheckParentsParent = ETrue ) = 0; /** * Adds or Updates data & action to the storage. diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/castorage/inc/castorage_global.h --- a/contentstorage/castorage/inc/castorage_global.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#ifndef CA_STORAGE_GLOBAL -#define CA_STORAGE_GLOBAL - -#ifndef CONTENT_ARSENAL_STORAGE_UT -#define CA_STORAGE_TEST_CLASS(aClassName) -#else -#define CA_STORAGE_TEST_CLASS(aClassName) class aClassName; -#endif - -#ifndef CONTENT_ARSENAL_STORAGE_UT -#define CA_STORAGE_TEST_FRIEND_CLASS(aClassName) -#else -#define CA_STORAGE_TEST_FRIEND_CLASS(aClassName) friend class aClassName; -#endif - -#endif // CA_STORAGE_GLOBAL diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/castorage/src/casqlitestorage.cpp --- a/contentstorage/castorage/src/casqlitestorage.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/castorage/src/casqlitestorage.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -320,7 +320,7 @@ // --------------------------------------------------------------------------- // void CCaSqLiteStorage::GetParentsIdsL( const RArray& aEntryIdArray, - RArray& aParentIdArray ) + RArray& aParentIdArray, TBool aCheckParentsParent ) { CCaSqlQuery* sqlGetParentIdsQuery = CCaSqlQuery::NewLC( iSqlDb ); CaSqlQueryCreator::CreateGetParentsIdsQueryL( aEntryIdArray, @@ -334,7 +334,7 @@ TInt parentCount = sqlGetParentIdsQuery->ExecuteL( aParentIdArray, CCaSqlQuery::EGroupTable ); CleanupStack::PopAndDestroy( sqlGetParentIdsQuery ); - if( parentCount > 0 ) + if( aCheckParentsParent && parentCount > 0 ) { GetParentsIdsL( aParentIdArray, aParentIdArray ); } @@ -910,3 +910,4 @@ } } + diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cautils/cautils.pro --- a/contentstorage/cautils/cautils.pro Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cautils/cautils.pro Wed Jun 23 18:33:40 2010 +0300 @@ -16,6 +16,7 @@ TEMPLATE = lib symbian:{ +defFilePath = ./.. DEPENDPATH += ./inc \ ./src INCLUDEPATH += ./inc \ diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cautils/inc/cainnerentry.h --- a/contentstorage/cautils/inc/cainnerentry.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cautils/inc/cainnerentry.h Wed Jun 23 18:33:40 2010 +0300 @@ -30,6 +30,12 @@ { public: + + enum TLocalizedType + { + ENameLocalized = 0, + EDescriptionLocalized + }; /** * Destructor. */ @@ -116,16 +122,17 @@ IMPORT_C void SetId( TUint aId ); /** - * Sets the entry text. + * Sets localized entry text. * @param aText Entry text. */ - IMPORT_C void SetTextL( const TDesC& aText ); - + IMPORT_C void SetTextL( + const TDesC& aText, TBool localized = false ); /** - * Sets the entry description. + * Sets localized entry description. * @param aText Entry description. */ - IMPORT_C void SetDescriptionL( const TDesC& aText ); + IMPORT_C void SetDescriptionL( + const TDesC& aText, TBool localized = false ); /** * Sets the entry typename. @@ -206,6 +213,12 @@ * @param aStream a read stream */ IMPORT_C void InternalizeL( RReadStream& aStream ); + + /** + * Gets if Description is localized. + * @return ETrue if entry desscription is localized. + */ + IMPORT_C TBool isLocalized(TLocalizedType aLocalized) const; private: @@ -270,6 +283,11 @@ * Uid */ TInt32 iUid; + + TBool iTextLocalized; + + TBool iDescriptionLocalized; + }; diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cautils/src/caentryattribute.cpp --- a/contentstorage/cautils/src/caentryattribute.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cautils/src/caentryattribute.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -32,6 +32,9 @@ iValue.Close(); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (only NewLC used in code) // --------------------------------------------------------- // CCaEntryAttribute::NewL // --------------------------------------------------------- @@ -42,6 +45,9 @@ CleanupStack::Pop( attr ); return attr; } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT // --------------------------------------------------------- // CCaEntryAttribute::NewLC diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/cautils/src/cainnerentry.cpp --- a/contentstorage/cautils/src/cainnerentry.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/cautils/src/cainnerentry.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -72,6 +72,8 @@ aStream.WriteL( iDescription, iDescription.Length() ); aStream.WriteUint32L( iEntryTypeName.Length() ); aStream.WriteL( iEntryTypeName, iEntryTypeName.Length() ); + aStream.WriteUint32L( iTextLocalized ); + aStream.WriteUint32L( iDescriptionLocalized ); iAttributes.ExternalizeL( aStream ); iIcon->ExternalizeL( aStream ); aStream.CommitL(); @@ -99,6 +101,8 @@ iEntryTypeName.Close(); iEntryTypeName.CreateL( length ); aStream.ReadL( iEntryTypeName, length ); + iTextLocalized = aStream.ReadUint32L(); + iDescriptionLocalized = aStream.ReadUint32L(); iAttributes.InternalizeL( aStream ); iIcon->InternalizeL( aStream ); } @@ -110,6 +114,8 @@ void CCaInnerEntry::ConstructL() { iIcon = CCaInnerIconDescription::NewL(); + iTextLocalized = EFalse; + iDescriptionLocalized = EFalse; } // --------------------------------------------------------------------------- @@ -224,20 +230,23 @@ // // --------------------------------------------------------------------------- // -EXPORT_C void CCaInnerEntry::SetTextL( const TDesC& aText ) +EXPORT_C void CCaInnerEntry::SetTextL( const TDesC& aText, TBool localized ) { iText.Close(); iText.CreateL( aText ); + iTextLocalized = localized; } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // -EXPORT_C void CCaInnerEntry::SetDescriptionL( const TDesC& aText ) +EXPORT_C void CCaInnerEntry::SetDescriptionL( + const TDesC& aText, TBool localized ) { iDescription.Close(); iDescription.CreateL( aText ); + iDescriptionLocalized = localized; } // --------------------------------------------------------------------------- @@ -344,3 +353,23 @@ { iIcon->SetId( aIconId ); } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CCaInnerEntry::isLocalized(TLocalizedType aLocalized) const + { + if(aLocalized == EDescriptionLocalized) + { + return iDescriptionLocalized; + } + if(aLocalized == ENameLocalized) + { + return iTextLocalized; + } + else + return EFalse; + } + + diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/eabi/cautilsu.def --- a/contentstorage/eabi/cautilsu.def Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/eabi/cautilsu.def Wed Jun 23 18:33:40 2010 +0300 @@ -5,7 +5,7 @@ _ZN13CCaInnerEntry13AddAttributeLERK7TDesC16S2_ @ 4 NONAME _ZN13CCaInnerEntry13FindAttributeERK7TDesC16R6TDes16 @ 5 NONAME _ZN13CCaInnerEntry13FindAttributeERK7TDesC16R7TPtrC16 @ 6 NONAME - _ZN13CCaInnerEntry15SetDescriptionLERK7TDesC16 @ 7 NONAME + _ZN13CCaInnerEntry15SetDescriptionLERK7TDesC16i @ 7 NONAME _ZN13CCaInnerEntry16RemoveAttributeLERK7TDesC16 @ 8 NONAME _ZN13CCaInnerEntry17SetEntryTypeNameLERK7TDesC16 @ 9 NONAME _ZN13CCaInnerEntry4NewLEv @ 10 NONAME @@ -14,7 +14,7 @@ _ZN13CCaInnerEntry6SetUidEl @ 13 NONAME _ZN13CCaInnerEntry7SetRoleEj @ 14 NONAME _ZN13CCaInnerEntry8SetFlagsEj @ 15 NONAME - _ZN13CCaInnerEntry8SetTextLERK7TDesC16 @ 16 NONAME + _ZN13CCaInnerEntry8SetTextLERK7TDesC16i @ 16 NONAME _ZN13CCaInnerEntry9SetIconIdEi @ 17 NONAME _ZN13CCaInnerQuery10SetFlagsOnEj @ 18 NONAME _ZN13CCaInnerQuery11SetFlagsOffEj @ 19 NONAME @@ -39,63 +39,64 @@ _ZN17RCaEntryAttrArray5ExistERK7TDesC16 @ 38 NONAME _ZN20CCaLocalizationEntry12SetStringIdLERK7TDesC16 @ 39 NONAME _ZN20CCaLocalizationEntry13SetTableNameLERK7TDesC16 @ 40 NONAME - _ZN20CCaLocalizationEntry17SetAttributeNameLERK7TDesC16 @ 41 NONAME - _ZN20CCaLocalizationEntry19SetLocalizedStringLERK7TDesC16 @ 42 NONAME - _ZN20CCaLocalizationEntry4NewLEv @ 43 NONAME - _ZN20CCaLocalizationEntry5NewLCEv @ 44 NONAME - _ZN20CCaLocalizationEntry8SetRowIdEj @ 45 NONAME - _ZN20CCaLocalizationEntry9SetTextIdEj @ 46 NONAME - _ZN22CCaInnerNotifierFilter11SetParentIdEi @ 47 NONAME - _ZN22CCaInnerNotifierFilter12InternalizeLER11RReadStream @ 48 NONAME - _ZN22CCaInnerNotifierFilter12SetEntryRoleE10TEntryRole @ 49 NONAME - _ZN22CCaInnerNotifierFilter12SetTypeNamesEP16CDesC16ArrayFlat @ 50 NONAME - _ZN22CCaInnerNotifierFilter4NewLENS_13TNotifierTypeE @ 51 NONAME - _ZN22CCaInnerNotifierFilter5NewLCENS_13TNotifierTypeE @ 52 NONAME - _ZN22CCaInnerNotifierFilter7SetIdsLERK6RArrayIiE @ 53 NONAME - _ZN23CCaInnerIconDescription10SetSkinIdLERK7TDesC16 @ 54 NONAME - _ZN23CCaInnerIconDescription12SetFileNameLERK7TDesC16 @ 55 NONAME - _ZN23CCaInnerIconDescription17SetApplicationIdLERK7TDesC16 @ 56 NONAME - _ZN23CCaInnerIconDescription4NewLEv @ 57 NONAME - _ZN23CCaInnerIconDescription5NewLCEv @ 58 NONAME - _ZN23CCaInnerIconDescription5SetIdEi @ 59 NONAME - _ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 60 NONAME - _ZNK11RCaIdsArray12ExternalizeLER12RWriteStream @ 61 NONAME - _ZNK11RCaIdsArray13MarshalDataLCEv @ 62 NONAME - _ZNK13CCaInnerEntry12ExternalizeLER12RWriteStream @ 63 NONAME - _ZNK13CCaInnerEntry13GetAttributesEv @ 64 NONAME - _ZNK13CCaInnerEntry14GetDescriptionEv @ 65 NONAME - _ZNK13CCaInnerEntry16GetEntryTypeNameEv @ 66 NONAME - _ZNK13CCaInnerEntry4IconEv @ 67 NONAME - _ZNK13CCaInnerEntry5GetIdEv @ 68 NONAME - _ZNK13CCaInnerEntry6GetUidEv @ 69 NONAME - _ZNK13CCaInnerEntry7GetRoleEv @ 70 NONAME - _ZNK13CCaInnerEntry7GetTextEv @ 71 NONAME - _ZNK13CCaInnerEntry8GetFlagsEv @ 72 NONAME - _ZNK13CCaInnerEntry9GetIconIdEv @ 73 NONAME - _ZNK13CCaInnerQuery10GetFlagsOnEv @ 74 NONAME - _ZNK13CCaInnerQuery11GetFlagsOffEv @ 75 NONAME - _ZNK13CCaInnerQuery11GetParentIdEv @ 76 NONAME - _ZNK13CCaInnerQuery12ExternalizeLER12RWriteStream @ 77 NONAME - _ZNK13CCaInnerQuery13GetAttributesEv @ 78 NONAME - _ZNK13CCaInnerQuery17GetEntryTypeNamesEv @ 79 NONAME - _ZNK13CCaInnerQuery6GetIdsEv @ 80 NONAME - _ZNK13CCaInnerQuery6GetUidEv @ 81 NONAME - _ZNK13CCaInnerQuery7GetRoleEv @ 82 NONAME - _ZNK13CCaInnerQuery7GetSortEv @ 83 NONAME - _ZNK13CCaInnerQuery8GetCountEv @ 84 NONAME - _ZNK15RCaEntriesArray12ExternalizeLER12RWriteStream @ 85 NONAME - _ZNK20CCaLocalizationEntry11GetStringIdEv @ 86 NONAME - _ZNK20CCaLocalizationEntry12GetTableNameEv @ 87 NONAME - _ZNK20CCaLocalizationEntry16GetAttributeNameEv @ 88 NONAME - _ZNK20CCaLocalizationEntry18GetLocalizedStringEv @ 89 NONAME - _ZNK20CCaLocalizationEntry8GetRowIdEv @ 90 NONAME - _ZNK20CCaLocalizationEntry9GetTextIdEv @ 91 NONAME - _ZNK22CCaInnerNotifierFilter11GetParentIdEv @ 92 NONAME - _ZNK22CCaInnerNotifierFilter12ExternalizeLER12RWriteStream @ 93 NONAME - _ZNK22CCaInnerNotifierFilter12GetEntryRoleEv @ 94 NONAME - _ZNK22CCaInnerNotifierFilter12GetTypeNamesEv @ 95 NONAME - _ZNK22CCaInnerNotifierFilter15GetNotifierTypeEv @ 96 NONAME - _ZNK22CCaInnerNotifierFilter6GetIdsEv @ 97 NONAME - _ZN20CCaLocalizationEntry14SetQmFilenameLERK7TDesC16 @ 98 NONAME - _ZNK20CCaLocalizationEntry13GetQmFilenameEv @ 99 NONAME + _ZN20CCaLocalizationEntry14SetQmFilenameLERK7TDesC16 @ 41 NONAME + _ZN20CCaLocalizationEntry17SetAttributeNameLERK7TDesC16 @ 42 NONAME + _ZN20CCaLocalizationEntry19SetLocalizedStringLERK7TDesC16 @ 43 NONAME + _ZN20CCaLocalizationEntry4NewLEv @ 44 NONAME + _ZN20CCaLocalizationEntry5NewLCEv @ 45 NONAME + _ZN20CCaLocalizationEntry8SetRowIdEj @ 46 NONAME + _ZN20CCaLocalizationEntry9SetTextIdEj @ 47 NONAME + _ZN22CCaInnerNotifierFilter11SetParentIdEi @ 48 NONAME + _ZN22CCaInnerNotifierFilter12InternalizeLER11RReadStream @ 49 NONAME + _ZN22CCaInnerNotifierFilter12SetEntryRoleE10TEntryRole @ 50 NONAME + _ZN22CCaInnerNotifierFilter12SetTypeNamesEP16CDesC16ArrayFlat @ 51 NONAME + _ZN22CCaInnerNotifierFilter4NewLENS_13TNotifierTypeE @ 52 NONAME + _ZN22CCaInnerNotifierFilter5NewLCENS_13TNotifierTypeE @ 53 NONAME + _ZN22CCaInnerNotifierFilter7SetIdsLERK6RArrayIiE @ 54 NONAME + _ZN23CCaInnerIconDescription10SetSkinIdLERK7TDesC16 @ 55 NONAME + _ZN23CCaInnerIconDescription12SetFileNameLERK7TDesC16 @ 56 NONAME + _ZN23CCaInnerIconDescription17SetApplicationIdLERK7TDesC16 @ 57 NONAME + _ZN23CCaInnerIconDescription4NewLEv @ 58 NONAME + _ZN23CCaInnerIconDescription5NewLCEv @ 59 NONAME + _ZN23CCaInnerIconDescription5SetIdEi @ 60 NONAME + _ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 61 NONAME + _ZNK11RCaIdsArray12ExternalizeLER12RWriteStream @ 62 NONAME + _ZNK11RCaIdsArray13MarshalDataLCEv @ 63 NONAME + _ZNK13CCaInnerEntry11isLocalizedENS_14TLocalizedTypeE @ 64 NONAME + _ZNK13CCaInnerEntry12ExternalizeLER12RWriteStream @ 65 NONAME + _ZNK13CCaInnerEntry13GetAttributesEv @ 66 NONAME + _ZNK13CCaInnerEntry14GetDescriptionEv @ 67 NONAME + _ZNK13CCaInnerEntry16GetEntryTypeNameEv @ 68 NONAME + _ZNK13CCaInnerEntry4IconEv @ 69 NONAME + _ZNK13CCaInnerEntry5GetIdEv @ 70 NONAME + _ZNK13CCaInnerEntry6GetUidEv @ 71 NONAME + _ZNK13CCaInnerEntry7GetRoleEv @ 72 NONAME + _ZNK13CCaInnerEntry7GetTextEv @ 73 NONAME + _ZNK13CCaInnerEntry8GetFlagsEv @ 74 NONAME + _ZNK13CCaInnerEntry9GetIconIdEv @ 75 NONAME + _ZNK13CCaInnerQuery10GetFlagsOnEv @ 76 NONAME + _ZNK13CCaInnerQuery11GetFlagsOffEv @ 77 NONAME + _ZNK13CCaInnerQuery11GetParentIdEv @ 78 NONAME + _ZNK13CCaInnerQuery12ExternalizeLER12RWriteStream @ 79 NONAME + _ZNK13CCaInnerQuery13GetAttributesEv @ 80 NONAME + _ZNK13CCaInnerQuery17GetEntryTypeNamesEv @ 81 NONAME + _ZNK13CCaInnerQuery6GetIdsEv @ 82 NONAME + _ZNK13CCaInnerQuery6GetUidEv @ 83 NONAME + _ZNK13CCaInnerQuery7GetRoleEv @ 84 NONAME + _ZNK13CCaInnerQuery7GetSortEv @ 85 NONAME + _ZNK13CCaInnerQuery8GetCountEv @ 86 NONAME + _ZNK15RCaEntriesArray12ExternalizeLER12RWriteStream @ 87 NONAME + _ZNK20CCaLocalizationEntry11GetStringIdEv @ 88 NONAME + _ZNK20CCaLocalizationEntry12GetTableNameEv @ 89 NONAME + _ZNK20CCaLocalizationEntry13GetQmFilenameEv @ 90 NONAME + _ZNK20CCaLocalizationEntry16GetAttributeNameEv @ 91 NONAME + _ZNK20CCaLocalizationEntry18GetLocalizedStringEv @ 92 NONAME + _ZNK20CCaLocalizationEntry8GetRowIdEv @ 93 NONAME + _ZNK20CCaLocalizationEntry9GetTextIdEv @ 94 NONAME + _ZNK22CCaInnerNotifierFilter11GetParentIdEv @ 95 NONAME + _ZNK22CCaInnerNotifierFilter12ExternalizeLER12RWriteStream @ 96 NONAME + _ZNK22CCaInnerNotifierFilter12GetEntryRoleEv @ 97 NONAME + _ZNK22CCaInnerNotifierFilter12GetTypeNamesEv @ 98 NONAME + _ZNK22CCaInnerNotifierFilter15GetNotifierTypeEv @ 99 NONAME + _ZNK22CCaInnerNotifierFilter6GetIdsEv @ 100 NONAME diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/extsrc/casathandler.cpp --- a/contentstorage/extsrc/casathandler.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/extsrc/casathandler.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -145,6 +145,9 @@ iSatIcon.OpenL( iSatSession ); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (Icon can be created only from SIM) // --------------------------------------------------------------------------- // CCaSatHandler::GetVisibility // --------------------------------------------------------------------------- @@ -192,5 +195,8 @@ return NULL; } } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT // End of File diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/group/camenu.mmp --- a/contentstorage/group/camenu.mmp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/group/camenu.mmp Wed Jun 23 18:33:40 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: 19.1.6 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: 19.1.8 % << Don't touch! Updated by Synergy at check-out. * */ @@ -39,6 +39,7 @@ SOURCE casrvengutils.cpp SOURCE casrvnotifier.cpp SOURCE castorageproxy.cpp +SOURCE caprogressnotifier.cpp USERINCLUDE ../srvinc @@ -64,4 +65,12 @@ LIBRARY bafl.lib LIBRARY casrvmanager.lib +LIBRARY sifnotification.lib +LIBRARY sif.lib +LIBRARY scrclient.lib +// HB LIBRARIES +SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore +LIBRARY HbCore.lib + + diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/inc/cadef.h --- a/contentstorage/inc/cadef.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/inc/cadef.h Wed Jun 23 18:33:40 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: Definition of different constants - * Version : %version: ou1s60ui#10.1.19 % << Don't touch! Updated by Synergy at check-out. + * Version : %version: 10.1.25 % << Don't touch! Updated by Synergy at check-out. * */ @@ -49,7 +49,7 @@ enum TEntryFlag { EUsed = 1, - ESystem = 2, + EUninstall = 2, ERemovable = 4, EVisible = 8, ERunning = 16, @@ -61,7 +61,8 @@ { EItemAppearanceNotChanged, EItemDisappeared, - EItemAppeared + EItemAppeared, + EItemUninstallProgressChanged }; // Ca - Application @@ -86,9 +87,8 @@ _LIT( KCaAttrAppTypeValueNative, "native"); _LIT( KCaAttrComponentId, "component_id" ); _LIT( KCaAttrAppSettingsPlugin, "app_settings_plugin"); -// app settings plugin for java apps -_LIT( KCaAttrJavaAppSettingsPluginValue, - "/resource/qt/plugins/appsettings/javaapplicationsettingsview.qtplugin"); +_LIT( KCaScrPropertyAppSettings, "settingsName"); +_LIT( KPreviewImageAttrName, "preview_image_name" ); _LIT( KCaAttrAppWidgetUri, "widget:uri"); _LIT( KCaAttrAppWidgetServiceXml, "widget:servicexml"); @@ -98,12 +98,19 @@ _LIT( KCaScrPropertyIsMiniviewSupported, "isMiniviewSupported"); _LIT( KCaAppGroupName, "appgroup_name" ); +_LIT( KCaAppUninstallProgress, "uninstall_progress" ); _LIT( KCollectionIconFileName, "qtg_large_applications_user"); + _LIT(KLocalizationFilepathZ, "z:/resource/qt/translations"); _LIT(KLocalizationFilepathC, "c:/resource/qt/translations"); _LIT(KLocalizationFilepath, ":/resource/qt/translations"); +_LIT( KLocalizationCaEntry, "CA_ENTRY" ); +_LIT( KLocalizationEnText, "EN_TEXT" ); +_LIT( KLocalizationEnDescription, "EN_DESCRIPTION" ); +const TInt charsToFilename= 6; // loc://email/qtn_gmail_mail_account + const TInt KGranularityOne = 1; const TInt KUidChars = 10; @@ -153,8 +160,8 @@ // Note, however, that none of these is guaranteed to be set, or be used by a menu UI. // Menu clients always need to check that the necessary attributes are present. // -_LIT( KCaAttrLongName, "long_name" ); ///< Long name. -_LIT( KCaComponentId, "component_id" ); ///< Long name. +_LIT( KCaAttrShortName, "short_name" ); ///< Short name. +_LIT( KCaComponentId, "component_id" ); ///< Component Id. // Built-in types and attributes. // diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/inc/castorage_global.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/inc/castorage_global.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CA_STORAGE_GLOBAL_H +#define CA_STORAGE_GLOBAL_H + +#ifndef CONTENT_ARSENAL_STORAGE_UT +#define CA_STORAGE_TEST_CLASS(aClassName) +#else +#define CA_STORAGE_TEST_CLASS(aClassName) class aClassName; +#endif + +#ifndef CONTENT_ARSENAL_STORAGE_UT +#define CA_STORAGE_TEST_FRIEND_CLASS(aClassName) +#else +#define CA_STORAGE_TEST_FRIEND_CLASS(aClassName) friend class aClassName; +#endif + +#endif // CA_STORAGE_GLOBAL_H diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/srvinc/caprogressnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/srvinc/caprogressnotifier.h Wed Jun 23 18:33:40 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 + * + */ + +#ifndef CAPROGRESSNOTIFIER_H +#define CAPROGRESSNOTIFIER_H + +#include +#include +#include "castorage_global.h" +using namespace Usif; + +class CCaStorageProxy; + +// needed for fake notifier +#include "cainstallnotifier.h" + +/** + * Interface for updating after installer events. + */ +class MCaFakeProgressListener + { +public: + /** + * Pure virtual method. + * @param aEvent event type. + */ + virtual void HandleFakeProgressNotifyL(TInt aCurrentProgress) = 0; + }; + +/** + * Fake Install notifier. + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CCaFakeProgressNotifier ) : public CActive + { +public: + +/** + * Creates an instance of CCaFakeProgressNotifier. + * @param aListener Reference to notifier interface. + */ +IMPORT_C static CCaFakeProgressNotifier* NewL( MCaFakeProgressListener& aListener); + + /** + * Destructor. + */ + virtual ~CCaFakeProgressNotifier(); + + /** + * Starts fake progress notifications. + */ + void StartNotifying(); + +private: + + /** + * Constructor. + * @param aListener Reference to notifier interface. + */ + CCaFakeProgressNotifier( MCaFakeProgressListener& aListener ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL( ); + + /** + * From CActive. + */ + void DoCancel(); + + /** + * From CActive. + */ + void RunL(); + + /** + * From CActive. + */ + TInt RunError( TInt aError ); + +private: + + /** + * Interface for fake notifications + * Not Own. + */ + MCaFakeProgressListener& iListener; + + /** + * Timer + */ + RTimer iTimer; + + /** + * Counter for fake notifications + */ + TInt iCount; + + }; + + +/** + * Uninstall Progress notifier. + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CCaProgressNotifier ) : public CBase, + //public MSifOperationsHandler, // USIF not working yet + public MCaInstallListener, //needed for fake + public MCaFakeProgressListener //needed for fake + { + +public: + /** + * Creates an instance of CCaProgressNotifier. + * @param aCaStorageProxy Reference to storage. + */ +IMPORT_C static CCaProgressNotifier* NewL( CCaStorageProxy& aCaStorageProxy); + + /** + * Destructor. + */ + virtual ~CCaProgressNotifier(); + +private: + + /** + * Constructor. + */ + CCaProgressNotifier( ); + + /** + * Symbian 2nd phase constructor. + * @param aCaStorageProxy Reference to storage. + */ + void ConstructL( CCaStorageProxy& aCaStorageProxy ); + +public: + /** + * From MSifOperationsHandler + */ + void StartOperationHandler(TUint aKey, const CSifOperationStartData& aStartData); + + /** + * From MSifOperationsHandler + */ + void EndOperationHandler(const CSifOperationEndData& aEndData); + + /** + * From MSifOperationsHandler + */ + void ProgressOperationHandler(const CSifOperationProgressData& aProgressData); + +public: + + /** + * From MCaInstallListener, needed for fake + */ + void HandleInstallNotifyL( TInt aUid ); + + /** + * From MCaFakeProgressListener, needed for fake + */ + void HandleFakeProgressNotifyL(TInt aCurrentProgress); + +private: + + /** + * USIF notifier + * Own. + * + * Commented out since USIF notifications do not + * work on MCL wk20 + */ + //CSifOperationsNotifier* iNotifier; + + /** + * Not Own. + * Reference to the Storage Proxy. + */ + CCaStorageProxy* iStorageProxy; + + /** + * Uninstall notifier. Own. Needed for fake + */ + CCaInstallNotifier *iUsifUninstallNotifier; + + /** + * Install and uninstall notifier. Own. Needed for fake + */ + CCaInstallNotifier *iJavaInstallNotifier; + + /** + * Fake uninstall progress notifier. Own. Needed for fake + */ + CCaFakeProgressNotifier *iFakeProgressNotifier; + + }; + + +#endif /* CAPROGRESSNOTIFIER_H */ + +// End of File + diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/srvinc/casrv.h --- a/contentstorage/srvinc/casrv.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/srvinc/casrv.h Wed Jun 23 18:33:40 2010 +0300 @@ -25,6 +25,7 @@ class CCaSrvEngUtils; class CCaSrvManager; class CCaStorageProxy; +class CCaProgressNotifier; // GLOBAL FUNCTIONS /** @@ -119,6 +120,11 @@ */ CCaSrvManager* iSrvManager; + /* + * Uninstall progress notifier + */ + CCaProgressNotifier* iProgressNotifier; + }; #endif // CASRV_H diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/srvinc/castorageproxy.h --- a/contentstorage/srvinc/castorageproxy.h Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/srvinc/castorageproxy.h Wed Jun 23 18:33:40 2010 +0300 @@ -19,9 +19,11 @@ #define CASTORAGEPROXY_H #include "cadef.h" +#include "castorage_global.h" #include "caoperationparams.h" + // FORWARD DECLARATIONS class CCaStorage; class CCaInnerQuery; @@ -29,6 +31,8 @@ class CCaLocalizationEntry; class MCaSessionNorifier; +CA_STORAGE_TEST_CLASS( TestCaClient ) + /** * Interface for CA database implementations. * @@ -180,6 +184,12 @@ * C++ default constructor. */ CCaStorageProxy(); + + CCaLocalizationEntry* LocalizeTextL( CCaInnerEntry* aEntry ); + + CCaLocalizationEntry* LocalizeDescriptionL( CCaInnerEntry* aEntry ); + + TBool InitializeTranslatorL( TDesC& aQmFilename ); private: //Data @@ -193,6 +203,9 @@ * Sessions using this engine. Own. */ RPointerArray iHandlerNotifier; + + CA_STORAGE_TEST_FRIEND_CLASS( TestCaClient ) + }; #endif //CASTORAGEPROXY_H diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/srvsrc/cainstallstrategy.cpp --- a/contentstorage/srvsrc/cainstallstrategy.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/srvsrc/cainstallstrategy.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -146,9 +146,10 @@ User::LeaveIfError( aProperty.Get( KUidSystemCategory, Swi::KUidSoftwareInstallKey, status ) ); //if( status == ( Swi::ESwisStatusSuccess | Swi::ESwisUninstall ) ) - if( iUninstallStatus == Swi::ESwisUninstall && !status ) + // notify subscribers on begenning and at the end of uninstallation + if( status == Swi::ESwisUninstall || iUninstallStatus == Swi::ESwisUninstall /*&& !status*/ ) { - aListener.HandleInstallNotifyL( iUninstallStatus ); + aListener.HandleInstallNotifyL( status ); } iUninstallStatus = status; } diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/srvsrc/cammcwatcher.cpp --- a/contentstorage/srvsrc/cammcwatcher.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/srvsrc/cammcwatcher.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -107,6 +107,9 @@ iFs.NotifyChangeCancel(); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (error is ignored) // --------------------------------------------------------------------------- // CCaWidgetMmcWatcher::RunError // --------------------------------------------------------------------------- @@ -116,7 +119,13 @@ // No need to do anything return KErrNone; } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (memory card removal) // --------------------------------------------------------- // CCaWidgetMmcWatcher::RunL // --------------------------------------------------------- @@ -130,4 +139,6 @@ iObserver->MmcChangeL(); } } - +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/srvsrc/caprogressnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/srvsrc/caprogressnotifier.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: ?Description + * + */ + +#include "s32mem.h" + +#include +#include +#include + +#include "caprogressnotifier.h" +#include "castorageproxy.h" +#include "cainnerquery.h" +#include "cainnerentry.h" +#include "caarraycleanup.inl" + +using namespace Usif; + +//fake constants +const TInt KMaxProgressValue = 100; +const TInt KDelayTimeBetweenNotifications(500000); + + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (fake notifier timer) + +EXPORT_C CCaFakeProgressNotifier* CCaFakeProgressNotifier::NewL( + MCaFakeProgressListener& aListener ) + { + CCaFakeProgressNotifier* self = new ( ELeave ) CCaFakeProgressNotifier( aListener ); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop( self ); + return self; + } + +CCaFakeProgressNotifier::~CCaFakeProgressNotifier() + { + Cancel(); + iTimer.Close(); + } + +CCaFakeProgressNotifier::CCaFakeProgressNotifier( MCaFakeProgressListener& aListener ) : + CActive( EPriorityNormal ), iListener( aListener ), iCount( 0 ) + { + CActiveScheduler::Add( this ); + } + +void CCaFakeProgressNotifier::ConstructL( ) + { + User::LeaveIfError( iTimer.CreateLocal() ); + } + +void CCaFakeProgressNotifier::StartNotifying() + { + iCount = 0; + Cancel(); + iTimer.After( iStatus, TTimeIntervalMicroSeconds32( KDelayTimeBetweenNotifications ) ); + SetActive(); + } + +void CCaFakeProgressNotifier::DoCancel() + { + iTimer.Cancel(); + } + +void CCaFakeProgressNotifier::RunL() + { + User::LeaveIfError( iStatus.Int() ); + + if ( iCount <= KMaxProgressValue ) + { + if( iCount > 20 ) + { + iListener.HandleFakeProgressNotifyL(iCount); + } + iTimer.After( iStatus, TTimeIntervalMicroSeconds32( KDelayTimeBetweenNotifications ) ); + SetActive(); + iCount += 20; + } + } + +TInt CCaFakeProgressNotifier::RunError( TInt /*aError*/) + { + // No need to do anything + return KErrNone; + } + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT (fake notifier) + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CCaProgressNotifier* CCaProgressNotifier::NewL( + CCaStorageProxy& aCaStorageProxy ) + { + CCaProgressNotifier* self = new ( ELeave ) CCaProgressNotifier( ); + CleanupStack::PushL( self ); + self->ConstructL( aCaStorageProxy ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCaProgressNotifier::~CCaProgressNotifier() + { + // TODO: Commented out since USIF notifications do not + // work on MCL wk20 + /* + iNotifier->CancelSubscribeL(); + delete iNotifier; + */ + + // needed for fake: + delete iUsifUninstallNotifier; + delete iJavaInstallNotifier; + delete iFakeProgressNotifier; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCaProgressNotifier::CCaProgressNotifier() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCaProgressNotifier::ConstructL( CCaStorageProxy& aCaStorageProxy ) + { + // TODO: Commented out since USIF notifications do not + // work on MCL wk20 + /* + iNotifier = CSifOperationsNotifier::NewL(*this); + */ + + iStorageProxy = &aCaStorageProxy; + + iUsifUninstallNotifier = CCaInstallNotifier::NewL( *this, + CCaInstallNotifier::EUsifUninstallNotification ); + + iJavaInstallNotifier = CCaInstallNotifier::NewL( *this, + CCaInstallNotifier::EJavaInstallNotification ); + + iFakeProgressNotifier = CCaFakeProgressNotifier::NewL(*this); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCaProgressNotifier::StartOperationHandler(TUint /*aKey*/, const CSifOperationStartData& /*aStartData*/) + { + // TODO: Commented out since USIF notifications do not + // work on MCL wk20 + /* + iNotifier->SubscribeL( aKey, ETrue ); + */ + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCaProgressNotifier::EndOperationHandler(const CSifOperationEndData& /*aEndData*/) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCaProgressNotifier::ProgressOperationHandler(const CSifOperationProgressData& /*aProgressData*/) + { + + // TODO: Commented out since USIF notifications do not + // work on MCL wk20 + + /* + // extract component ID + TBuf8<20> globalIdBuf; + globalIdBuf.Copy( aProgressData.GlobalComponentId() ); + + RDesReadStream readStream( globalIdBuf ); + CleanupClosePushL( readStream ); + CGlobalComponentId *globalId = CGlobalComponentId::NewL( readStream ); + CleanupStack::PushL(globalId); + + RSoftwareComponentRegistry iScrSession; + TComponentId componentId = iScrSession.GetComponentIdL( globalId->GlobalIdName(), + globalId->SoftwareTypeName() ); + + CleanupStack::PopAndDestroy( globalId ); + CleanupStack::PopAndDestroy( &readStream ); + + RBuf componentIdBuf; + componentIdBuf.CleanupClosePushL(); + componentIdBuf.CreateL( sizeof(TComponentId) + 1 ); + componentIdBuf.AppendNum( componentId ); + + // find entry by componentID + CCaInnerQuery *innerQuery = CCaInnerQuery::NewLC(); + innerQuery->SetRole( CCaInnerQuery::Item ); + innerQuery->AddAttributeL( KCaAttrComponentId, + componentIdBuf ); + + RPointerArray resultArrayItems; + CleanupResetAndDestroyPushL( resultArrayItems ); + iStorageProxy->GetEntriesL( innerQuery, resultArrayItems ); + + RBuf totalProgressBuf; + totalProgressBuf.CleanupClosePushL(); + totalProgressBuf.CreateL( sizeof(TComponentId) + 1 ); + totalProgressBuf.AppendNum( aProgressData.CurrentProgess() ); + + if (resultArrayItems.Count() && aProgressData.Phase() == EUninstalling) + { + CCaInnerEntry* appEntry = resultArrayItems[0]; + appEntry->AddAttributeL(KCaAppUninstallProgress, totalProgressBuf); + + iStorageProxy->AddL(appEntry, ETrue, EItemUninstallProgressChanged ); + } + CleanupStack::PopAndDestroy( &totalProgressBuf ); + CleanupStack::PopAndDestroy( &resultArrayItems ); + CleanupStack::PopAndDestroy( innerQuery ); + CleanupStack::PopAndDestroy( &componentIdBuf ); + */ + } + +void CCaProgressNotifier::HandleInstallNotifyL( TInt /*aUid*/) + { + // start sending fake notifications + iFakeProgressNotifier->StartNotifying(); + } + +void CCaProgressNotifier::HandleFakeProgressNotifyL(TInt aCurrentProgress) + { + //update storage with new info + + // find entry by componentID + CCaInnerQuery *innerQuery = CCaInnerQuery::NewLC(); + innerQuery->SetRole( CCaInnerQuery::Item ); + innerQuery->SetFlagsOn(EUninstall); + + RPointerArray resultArrayItems; + CleanupResetAndDestroyPushL( resultArrayItems ); + iStorageProxy->GetEntriesL( innerQuery, resultArrayItems ); + + + RBuf totalProgressBuf; + totalProgressBuf.CleanupClosePushL(); + totalProgressBuf.CreateL( sizeof( TInt ) + 1 ); + totalProgressBuf.AppendNum( aCurrentProgress ); + + for ( TInt i = 0; iAddAttributeL(KCaAppUninstallProgress, totalProgressBuf); + iStorageProxy->AddL(appEntry, ETrue, EItemUninstallProgressChanged ); + } + + CleanupStack::PopAndDestroy( &totalProgressBuf ); + CleanupStack::PopAndDestroy( &resultArrayItems ); + CleanupStack::PopAndDestroy( innerQuery ); + } diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/srvsrc/casrv.cpp --- a/contentstorage/srvsrc/casrv.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/srvsrc/casrv.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -24,6 +24,7 @@ #include "casrvengutils.h" #include "castorageproxy.h" #include "casrvmanager.h" +#include "caprogressnotifier.h" // ==================== LOCAL FUNCTIONS ==================== @@ -124,6 +125,7 @@ } delete iSrvManager; delete iSrvEngUtils; + delete iProgressNotifier; delete iStorageProxy; } @@ -154,7 +156,8 @@ iSessionCount = 0; iStorageProxy = CCaStorageProxy::NewL(); iSrvEngUtils = CCaSrvEngUtils::NewL(); - iSrvManager = CCaSrvManager::NewL(*iStorageProxy, iSrvEngUtils); + iProgressNotifier = CCaProgressNotifier::NewL( *iStorageProxy ); + iSrvManager = CCaSrvManager::NewL( *iStorageProxy, iSrvEngUtils ); TInt errCode = iSrvManager->LoadOperationErrorCodeL(); if( KSqlErrNotDb <= errCode && errCode <= KSqlErrGeneral ) { diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/srvsrc/casrvnotifier.cpp --- a/contentstorage/srvsrc/casrvnotifier.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/srvsrc/casrvnotifier.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -38,6 +38,9 @@ delete iFilter; } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (only NewLC used in code) // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -48,6 +51,9 @@ CleanupStack::Pop(); return self; } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT // ----------------------------------------------------------------------------- // diff -r 156f692b1687 -r b99b84bcd2d1 contentstorage/srvsrc/castorageproxy.cpp --- a/contentstorage/srvsrc/castorageproxy.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/contentstorage/srvsrc/castorageproxy.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -15,6 +15,9 @@ * */ +#include +#include + #include "castorage.h" #include "castorageproxy.h" #include "castoragefactory.h" @@ -107,14 +110,23 @@ TChangeType changeType = EAddChangeType; RArray parentArray; CleanupClosePushL( parentArray ); - + if( aEntry->GetId() > 0 ) { changeType = EUpdateChangeType; RArray id; CleanupClosePushL( id ); id.AppendL( aEntry->GetId() ); - iStorage->GetParentsIdsL( id, parentArray ); + if (aItemAppearanceChange == EItemUninstallProgressChanged) + { + // no need to search for parent parents for uninstall + // progress change + iStorage->GetParentsIdsL( id, parentArray, EFalse ); + } + else + { + iStorage->GetParentsIdsL( id, parentArray ); + } CleanupStack::PopAndDestroy( &id ); } @@ -126,8 +138,47 @@ { changeType = EAddChangeType; } - - iStorage->AddL( aEntry, aUpdate ); + + // do not update entry in db with uninstall progress + if (aItemAppearanceChange != EItemUninstallProgressChanged) + { + RPointerArray localizations; + CleanupResetAndDestroyPushL( localizations ); + CCaLocalizationEntry* tempLocalization = NULL; + if( aEntry->isLocalized( CCaInnerEntry::ENameLocalized ) ) + { + tempLocalization = LocalizeTextL( aEntry ); + if( tempLocalization ) + { + localizations.Append( tempLocalization ); + tempLocalization = NULL; + } + } + if( aEntry->isLocalized( CCaInnerEntry::EDescriptionLocalized ) ) + { + tempLocalization = LocalizeDescriptionL( aEntry ); + if (tempLocalization) + { + localizations.Append(tempLocalization); + tempLocalization = NULL; + } + } + + iStorage->AddL( aEntry, aUpdate ); + + for( TInt j =0; j < localizations.Count(); j++ ) + { + localizations[j]->SetRowId( aEntry->GetId() ); + AddLocalizationL( *( localizations[j] ) ); + } + if( localizations.Count() > 0 ) + { + HbTextResolverSymbian::Init( _L(""), KLocalizationFilepathZ ); + } + CleanupStack::PopAndDestroy( &localizations ); + } + + for( TInt i = 0; i < iHandlerNotifier.Count(); i++ ) { iHandlerNotifier[i]->EntryChanged( aEntry, changeType, parentArray ); @@ -317,6 +368,9 @@ CleanupStack::PopAndDestroy( &parentArray ); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT (calls another method) // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- @@ -325,6 +379,9 @@ { iStorage->LoadDataBaseFromRomL(); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT // --------------------------------------------------------- // @@ -350,3 +407,147 @@ iHandlerNotifier.Remove( i ); } } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +CCaLocalizationEntry* CCaStorageProxy::LocalizeTextL( CCaInnerEntry* aEntry ) + { + CCaLocalizationEntry* result = NULL; + TInt textLength = aEntry->GetText().Length(); + if (textLength > 0) + { + TChar delimiter = '/'; // cannot add it as global + RBuf title; + CleanupClosePushL( title ); + title.CreateL( aEntry->GetText() ); + TInt pos = title.LocateReverse( delimiter ); + if ( pos > 0 && pos + 1 < textLength ) // 1 is for delimiters + { + TPtrC16 logString = title.Mid( pos + 1 ); + TInt qmFileNameLength = textLength - charsToFilename - 1 - logString.Length(); + TPtrC16 qmFile = title.Mid( charsToFilename, qmFileNameLength ); + if ( InitializeTranslatorL( qmFile ) ) + { + result = CCaLocalizationEntry::NewLC(); + HBufC* translatedString = HbTextResolverSymbian::LoadLC( logString ); + if ( translatedString->Compare( logString ) ) + { + result->SetStringIdL( logString ); + aEntry->SetTextL( *translatedString ); + if( translatedString ) + { + CleanupStack::PopAndDestroy( translatedString ); + } + result->SetTableNameL( KLocalizationCaEntry ); + result->SetAttributeNameL( KLocalizationEnText ); + result->SetQmFilenameL( qmFile ); + result->SetRowId( aEntry->GetId() ? 0 : aEntry->GetId() ); // must be added when present + } + else + { + if (translatedString) + { + CleanupStack::PopAndDestroy(translatedString); + } + } + CleanupStack::Pop( result ); + } + } + CleanupStack::PopAndDestroy( &title ); + } + return result; + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +CCaLocalizationEntry* CCaStorageProxy::LocalizeDescriptionL( CCaInnerEntry* aEntry ) + { + CCaLocalizationEntry* result = NULL; + TInt dscLength = aEntry->GetDescription().Length(); + if ( dscLength ) + { + TChar delimiter = '/'; // cannot add it as global + RBuf description; + CleanupClosePushL( description ); + description.CreateL( aEntry->GetDescription() ); + TInt pos = description.LocateReverse( delimiter ); + if ( pos > 0 && pos + 1 < dscLength ) // 1 is for delimiters + { + TPtrC16 logString = description.Mid(pos + 1); + TInt qmFileNameLength = dscLength - charsToFilename - 1 - logString.Length(); + TPtrC16 qmFile = description.Mid(charsToFilename, qmFileNameLength); + if ( InitializeTranslatorL( qmFile ) ) + { + result = CCaLocalizationEntry::NewLC(); + HBufC* translatedString = HbTextResolverSymbian::LoadLC( logString ); + if ( translatedString->Compare( logString ) ) + { + result->SetStringIdL( logString ); + aEntry->SetDescriptionL( *translatedString ); + CleanupStack::PopAndDestroy( translatedString ); + result->SetTableNameL( KLocalizationCaEntry ); + result->SetAttributeNameL( KLocalizationEnDescription ); + result->SetQmFilenameL( qmFile ); + result->SetRowId( aEntry->GetId() ? 0 : aEntry->GetId() ); // must be added when present + } + else + { + CleanupStack::PopAndDestroy( translatedString ); + } + CleanupStack::Pop( result ); + } + } + CleanupStack::PopAndDestroy( &description ); + } + return result; + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +TBool CCaStorageProxy::InitializeTranslatorL( TDesC& aQmFilename ) + { + TBool result = HbTextResolverSymbian::Init( aQmFilename, KLocalizationFilepathC ); + if ( !result ) + { + // this should not be called too often + TChar currentDriveLetter; + TDriveList driveList; + RFs fs; + User::LeaveIfError( fs.Connect() ); + User::LeaveIfError( fs.DriveList( driveList ) ); + + RBuf path; + CleanupClosePushL( path ); + path.CreateL( KLocalizationFilepath().Length() + 1 ); + + for ( TInt driveNr = EDriveY; driveNr >= EDriveA; driveNr-- ) + { + if ( driveList[driveNr] ) + { + User::LeaveIfError(fs.DriveToChar( driveNr, currentDriveLetter )); + path.Append( currentDriveLetter ); + path.Append( KLocalizationFilepath ); + if (HbTextResolverSymbian::Init( aQmFilename, path )) + { + result = ETrue; + break; + } + } + path.Zero(); + } + CleanupStack::PopAndDestroy( &path ); + fs.Close(); + + if( !result ) + { + result = HbTextResolverSymbian::Init( aQmFilename, KLocalizationFilepathZ ); + } + } + return result; + } diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv.pro --- a/homescreensrv.pro Fri Jun 11 13:58:37 2010 +0300 +++ b/homescreensrv.pro Wed Jun 23 18:33:40 2010 +0300 @@ -16,8 +16,7 @@ TEMPLATE = subdirs -SUBDIRS += appfoundation \ - hswidgetmodel \ +SUBDIRS += hswidgetmodel \ contentstorage \ homescreensrv_plat \ tsrc diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/appruntimemodel_api/appruntimemodel_api.pri --- a/homescreensrv_plat/appruntimemodel_api/appruntimemodel_api.pri Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -PLATFORM_HEADERS += \ - appruntimemodel_api/hsiruntimeprovider.h \ - appruntimemodel_api/hsruntime.h \ - appruntimemodel_api/hsruntimefactory.h \ - appruntimemodel_api/hsruntimemodel_global.h \ No newline at end of file diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/appruntimemodel_api/hsiruntimeprovider.h --- a/homescreensrv_plat/appruntimemodel_api/hsiruntimeprovider.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +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: HsRuntime provider interface. -* -*/ - - -#ifndef HSIRUNTIMEPROVIDER_H -#define HSIRUNTIMEPROVIDER_H - -#include -#include -#include - -/*! - \class HsRuntimeToken - \ingroup group_hsruntimemodel - \brief Represents a home screen runtime that can be created. - - Home screen runtimes are located in runtime providers. Each provider - exposes its contained runtimes as runtime tokens. A token has all - the needed information for runtime selection and creation - -*/ -class HsRuntimeToken -{ - -public: - -/*! - The name of the library/plugin that contains the runtime. -*/ - QString mLibrary; - -/*! - Uniquely identifies the runtime. -*/ - QString mUri; - -}; - -class HsRuntime; - -/*! - \class IHsRuntimeProvider - \ingroup group_hsruntimemodel - \brief Defines a mechanism for retrieving a home screen runtime. - Interface that defines a mechanism for retrieving a home screen - runtime. Each home screen runtime provider implements this interface. - -*/ -class IHsRuntimeProvider -{ - -public: - -/*! - Destructor. -*/ - virtual ~IHsRuntimeProvider() {} - -public: - -/*! - Returns contained runtimes as a list of runtime tokens. -*/ - virtual QList runtimes() = 0; - -/*! - Creates and returns a runtime based on the given token. - - \a aToken Identifies the runtime to be created. - - Returns The created runtime or null in failure cases. -*/ - virtual HsRuntime* createRuntime(const HsRuntimeToken& aToken) = 0; - -}; - -Q_DECLARE_INTERFACE(IHsRuntimeProvider, "com.nokia.homescreen.iruntimeprovider/1.0") - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/appruntimemodel_api/hsruntime.h --- a/homescreensrv_plat/appruntimemodel_api/hsruntime.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +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: Base class for all homescreen runtimes. -* -*/ - - -#ifndef HSRUNTIME_H -#define HSRUNTIME_H - -#include - -#include "hsruntimemodel_global.h" - -/*! - \class HsRuntime - \ingroup group_hsruntimemodel - \brief Base class for all home screen runtimes. - - Provides the common functionality for all home screen runtime - implementations. - -*/ -class HSRUNTIMEMODEL_EXPORT HsRuntime : public QObject -{ - Q_OBJECT - -public: - HsRuntime(QObject* aParent = 0) : QObject(aParent) {} - virtual ~HsRuntime() {} - - -signals: -/*! - Emitted when the runtime has started. -*/ - void started(); - -/*! - Emitted when the runtime has stopped. -*/ - void stopped(); - -/*! - Emitted when the runtime has faulted. -*/ - void faulted(); - - -public slots: - -/*! - Starts the runtime. -*/ - virtual void start() = 0; - -/*! - Stops the runtime. -*/ - virtual void stop() = 0; - - - -private: - - Q_DISABLE_COPY(HsRuntime) -}; - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/appruntimemodel_api/hsruntimefactory.h --- a/homescreensrv_plat/appruntimemodel_api/hsruntimefactory.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +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: HsRuntime factory. -* -*/ - - -#ifndef HSRUNTIMEFACTORY_H -#define HSRUNTIMEFACTORY_H - -#include - -#include "hsruntimemodel_global.h" -#include "hsiruntimeprovider.h" - -class HsRuntimeFactoryPrivate; - -class HSRUNTIMEMODEL_EXPORT HsRuntimeFactory : public QObject -{ - Q_OBJECT - -public: - HsRuntimeFactory(const QString& aPluginManifestDirectory, - const QString& aPluginDirectory, - QObject* aParent = 0); - virtual ~HsRuntimeFactory(); - - QList runtimes(); - HsRuntime* createRuntime(const HsRuntimeToken& aToken); - -private: - Q_DISABLE_COPY(HsRuntimeFactory) - -private: - HsRuntimeFactoryPrivate* mD; - friend class HsRuntimeFactoryPrivate; - -}; - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/appruntimemodel_api/hsruntimemodel_global.h --- a/homescreensrv_plat/appruntimemodel_api/hsruntimemodel_global.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: The dll header file. -* -*/ - - -#ifndef HSRUNTIMEMODEL_GLOBAL_H -#define HSRUNTIMEMODEL_GLOBAL_H - -#include - - -#ifdef HSRUNTIMEMODEL_LIB - #define HSRUNTIMEMODEL_EXPORT Q_DECL_EXPORT -#else - #ifdef HSRUNTIMEMODEL_TEST - #define HSRUNTIMEMODEL_EXPORT - #else - #define HSRUNTIMEMODEL_EXPORT Q_DECL_IMPORT - #endif -#endif - - -#endif // HSRUNTIMEMODEL_GLOBAL_H diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/contentstorage_api/cadefs.h --- a/homescreensrv_plat/contentstorage_api/cadefs.h Fri Jun 11 13:58:37 2010 +0300 +++ b/homescreensrv_plat/contentstorage_api/cadefs.h Wed Jun 23 18:33:40 2010 +0300 @@ -49,13 +49,20 @@ enum EntryFlag { UsedEntryFlag = 1, - SystemEntryFlag = 2, + UninstallEntryFlag = 2, RemovableEntryFlag = 4, VisibleEntryFlag = 8, RunningEntryFlag = 16, NativeEntryFlag = 32, MissingEntryFlag = 64 }; + +enum LocalizationType +{ + NameLocalized, + DescriptionLocalized +}; + Q_DECLARE_FLAGS(EntryFlags, EntryFlag) Q_DECLARE_OPERATORS_FOR_FLAGS(EntryFlags) Q_DECLARE_METATYPE(EntryFlags) @@ -71,6 +78,7 @@ }; static const QString caCmdOpen("open"); +static const QString caCmdRemove("remove"); #ifndef QT_NO_DEBUG_OUTPUT # define USE_QDEBUG_IF(predicate) if (!predicate) {} else qDebug() diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/contentstorage_api/caentry.h --- a/homescreensrv_plat/contentstorage_api/caentry.h Fri Jun 11 13:58:37 2010 +0300 +++ b/homescreensrv_plat/contentstorage_api/caentry.h Wed Jun 23 18:33:40 2010 +0300 @@ -47,10 +47,10 @@ int id() const; QString text() const; - void setText(const QString &text); + void setText(const QString &text, bool localized = false); QString description() const; - void setDescription(const QString &text); + void setDescription(const QString &text, bool localized = false); CaIconDescription iconDescription() const; void setIconDescription(const CaIconDescription &iconDescription); @@ -76,6 +76,7 @@ private: void setId(int id); + bool isLocalized(LocalizationType localized) const; private: /*! diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/contentstorage_api/caitemmodel.h --- a/homescreensrv_plat/contentstorage_api/caitemmodel.h Fri Jun 11 13:58:37 2010 +0300 +++ b/homescreensrv_plat/contentstorage_api/caitemmodel.h Wed Jun 23 18:33:40 2010 +0300 @@ -48,7 +48,8 @@ TypeRole, FlagsRole, TextRole,//contains title represented as QString, - FullTextRole //'title description' convinient for operations such as search + FullTextRole, //'title description' convinient for operations such as search + UninstalRole //contains progress status as decimal number in QString }; // Function declarations diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/contentstorage_api/casoftwareregistry.h --- a/homescreensrv_plat/contentstorage_api/casoftwareregistry.h Fri Jun 11 13:58:37 2010 +0300 +++ b/homescreensrv_plat/contentstorage_api/casoftwareregistry.h Wed Jun 23 18:33:40 2010 +0300 @@ -26,6 +26,7 @@ #include "caclient_global.h" //FORWARD DECLARATIONS +class QStringList; class CaSoftwareRegistryPrivate; /** @@ -46,6 +47,13 @@ typedef QHash DetailMap; + bool getUninstallDetails(int componentId, + QString &componentName, + QStringList &applicationsUids, + QString &confirmationMessage); + + bool getApplicationsUids(int componentId, QStringList &applicationsUids); + DetailMap entryDetails(int componentId) const; static QString componentNameKey(); diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/homescreen_information_api/inc/homescreendomainpskeys.h --- a/homescreensrv_plat/homescreen_information_api/inc/homescreendomainpskeys.h Fri Jun 11 13:58:37 2010 +0300 +++ b/homescreensrv_plat/homescreen_information_api/inc/homescreendomainpskeys.h Wed Jun 23 18:33:40 2010 +0300 @@ -18,36 +18,42 @@ #ifndef HOMESCREEN_DOMAIN_PS_KEYS_H #define HOMESCREEN_DOMAIN_PS_KEYS_H -/** - * P&S Key path for all Home Screen information keys provided by this API. - */ + +/*! + \file homescreendomainpskeys.h + \brief +*/ + +/*! + P&S Key path for all Home Screen information keys provided by this API. +*/ 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. - * - * @see EPSHsState - */ +/*! + 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. + + @see EPSHsState +*/ const char HsStatePSKeySubPath[] = "state"; #ifdef Q_OS_SYMBIAN -/** - * Home Screen P&S category Uid for pure Symbian usage. - */ +/*! + Home Screen P&S category Uid for pure Symbian usage. +*/ const TUid KHsCategoryUid = { 0x20022F35 }; -/** - * P&S Key to represent the state of the Home Screen for pure Symbian usage. - * This property is updated when Home screen state is changed. Valid values - * are defined by the enum EPSHsState. - */ +/*! + P&S Key to represent the state of the Home Screen for pure Symbian usage. + This property is updated when Home screen state is changed. Valid values + are defined by the enum EPSHsState. +*/ const TUint KHsCategoryStateKey = 0x1; #endif //Q_OS_SYMBIAN -/** - * Home screen state. - */ +/*! + Home screen state. +*/ enum EPSHsState { /** diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/homescreensrv_plat.pro --- a/homescreensrv_plat/homescreensrv_plat.pro Fri Jun 11 13:58:37 2010 +0300 +++ b/homescreensrv_plat/homescreensrv_plat.pro Wed Jun 23 18:33:40 2010 +0300 @@ -17,15 +17,11 @@ TEMPLATE = subdirs BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " -include(appruntimemodel_api/appruntimemodel_api.pri) include(contentstorage_api/contentstorage_api.pri) include(hswidgetmodel_api/hswidgetmodel_api.pri) -include(statemodel_api/statemodel_api.pri) include(menu_sat_interface_api/menu_sat_interface_api.pri) include(homescreen_information_api/homescreen_information_api.pri) for(filename,PLATFORM_HEADERS){ BLD_INF_RULES.prj_exports *= "$$filename MW_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))" } - - diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/hswidgetmodel_api/hsipreferencestore.h --- a/homescreensrv_plat/hswidgetmodel_api/hsipreferencestore.h Fri Jun 11 13:58:37 2010 +0300 +++ b/homescreensrv_plat/hswidgetmodel_api/hsipreferencestore.h Wed Jun 23 18:33:40 2010 +0300 @@ -18,11 +18,10 @@ #ifndef HSIPREFERENCESTORE_H #define HSIPREFERENCESTORE_H - class QString; -/*! - \ingroup group_hscontentmodel group_widget_api_candidates + +/*DEPRECATED \class IHsPreferenceStore \brief Interface class for preference store. @@ -74,7 +73,4 @@ }; - - - #endif diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/hswidgetmodel_api/hsiwidgetprovider.h --- a/homescreensrv_plat/hswidgetmodel_api/hsiwidgetprovider.h Fri Jun 11 13:58:37 2010 +0300 +++ b/homescreensrv_plat/hswidgetmodel_api/hsiwidgetprovider.h Wed Jun 23 18:33:40 2010 +0300 @@ -25,15 +25,15 @@ #include #include -/*! + +/*DEPRECATED \class HsWidgetToken - \ingroup group_hswidgetmodel group_widget_api_candidates + \ingroup group_hswidgetmodel_api \brief Represents a home screen widget that can be created. Home screen widgets are located in widget providers. Each provider exposes its contained widgets as widget tokens. A token has all the needed information for widget selection and creation. - */ class HsWidgetToken { @@ -82,7 +82,7 @@ class HsWidget; -/*! +/*DEPRECATED \class IHsWidgetProvider \ingroup group_hswidgetmodel group_widget_api_candidates \brief Defines a mechanism for retrieving a home screen widget. @@ -114,10 +114,7 @@ }; - - Q_DECLARE_METATYPE(HsWidgetToken) Q_DECLARE_INTERFACE(IHsWidgetProvider, "com.nokia.homescreen.iwidgetprovider/1.0") - #endif diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/hswidgetmodel_api/ihswidgetpreferenceservice.h --- a/homescreensrv_plat/hswidgetmodel_api/ihswidgetpreferenceservice.h Fri Jun 11 13:58:37 2010 +0300 +++ b/homescreensrv_plat/hswidgetmodel_api/ihswidgetpreferenceservice.h Wed Jun 23 18:33:40 2010 +0300 @@ -22,7 +22,7 @@ class QString; class HsWidget; -/** +/*DEPRECATED * @ingroup group_hswidgetmodel group_widget_api_candidates * @brief Preference store for widget. * diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/statemodel_api/hsistateprovider.h --- a/homescreensrv_plat/statemodel_api/hsistateprovider.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +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: State provider interface. -* -*/ - - -#ifndef HSISTATEPROVIDER_H -#define HSISTATEPROVIDER_H - -#include -#include -#include - -class QState; - -/*! - \class HsStateToken - \ingroup group_hsstatemodel - \brief Represents a home screen state that can be created. - Home screen states are located in state providers. Each provider - exposes its contained states as state tokens. A token has all - the needed information for state selection and creation. -*/ -class HsStateToken -{ - -public: - -/*! - The name of the library/plugin that contains the state. - */ -QString mLibrary; - -/*! - Uniquely identifies the state. -*/ - QString mUri; - -}; - -/*! - \class IHsStateProvider - \ingroup group_hsstatemodel - \brief Defines a mechanism for retrieving a home screen state. - Interface that defines a mechanism for retrieving a home screen - state. Each home screen state provider implements this interface. -*/ -class IHsStateProvider -{ - -public: - -/*! - Destructor. -*/ - virtual ~IHsStateProvider() {} - -public: - -/*! - Returns contained states as a list of state tokens. -*/ - virtual QList states() = 0; - -/*! - Creates and returns a state based on the given token. - \a aToken Identifies the state to be created. - - Returns The created state or null in failure cases. -*/ - virtual QState* createState(const HsStateToken& aToken) = 0; - -}; - -Q_DECLARE_INTERFACE(IHsStateProvider, "com.nokia.homescreen.istateprovider/1.0") - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/statemodel_api/hsstatefactory.h --- a/homescreensrv_plat/statemodel_api/hsstatefactory.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +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: State factory. -* -*/ - - -#ifndef HSSTATEFACTORY_H -#define HSSTATEFACTORY_H - -#include - -#include "hsstatemodel_global.h" -#include "hsistateprovider.h" - -class QState; -class HsStateFactoryPrivate; - -class HSSTATEMODEL_EXPORT HsStateFactory : public QObject -{ - Q_OBJECT - -public: - HsStateFactory(const QString& aPluginManifestDirectory, - const QString& aPluginDirectory, - QObject* aParent = 0); - - virtual ~HsStateFactory(); - - QList states(); - QState* createState(const HsStateToken& aToken); - -private: - - Q_DISABLE_COPY(HsStateFactory) - -private: - HsStateFactoryPrivate* mD; - friend class HsStateFactoryPrivate; - -}; - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/statemodel_api/hsstatemodel_global.h --- a/homescreensrv_plat/statemodel_api/hsstatemodel_global.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: The dll header file. -* -*/ - - -#ifndef HSSTATEMODEL_GLOBAL_H -#define HSSTATEMODEL_GLOBAL_H - -#include - - -#ifdef HSSTATEMODEL_LIB - #define HSSTATEMODEL_EXPORT Q_DECL_EXPORT -#else - #ifdef HSSTATEMODEL_TEST - #define HSSTATEMODEL_EXPORT - #else - #define HSSTATEMODEL_EXPORT Q_DECL_IMPORT - #endif -#endif - - -#endif // HSSTATEMODEL_GLOBAL_H diff -r 156f692b1687 -r b99b84bcd2d1 homescreensrv_plat/statemodel_api/statemodel_api.pri --- a/homescreensrv_plat/statemodel_api/statemodel_api.pri Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +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: -# - -PLATFORM_HEADERS += \ - statemodel_api/hsistateprovider.h \ - statemodel_api/hsstatefactory.h \ - statemodel_api/hsstatemodel_global.h \ No newline at end of file diff -r 156f692b1687 -r b99b84bcd2d1 hswidgetmodel/src/hswidget.cpp --- a/hswidgetmodel/src/hswidget.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/hswidgetmodel/src/hswidget.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -20,7 +20,7 @@ #include "hswidget_p.h" #include "ihswidgetpreferenceservice.h" -/*! +/*DEPRECATED \ingroup group_hswidgetmodel group_widget_api_candidates \class HsWidget \brief Base class for all home screen widgets. diff -r 156f692b1687 -r b99b84bcd2d1 hswidgetmodel/src/hswidgetfactory.cpp --- a/hswidgetmodel/src/hswidgetfactory.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/hswidgetmodel/src/hswidgetfactory.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -28,7 +28,7 @@ -/*! +/*DEPRECATED \class HsPluginUnloader \ingroup group_hswidgetmodel \brief Unloads plugin and deletes plugin loader. @@ -63,7 +63,7 @@ } } -/*! +/*DEPRECATED \class HsWidgetFactory \ingroup group_hswidgetmodel \brief Finds and creates home screen widgets. diff -r 156f692b1687 -r b99b84bcd2d1 hswidgetmodel/src/hswidgetprovidermanifest.cpp --- a/hswidgetmodel/src/hswidgetprovidermanifest.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/hswidgetmodel/src/hswidgetprovidermanifest.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -23,7 +23,7 @@ #include "hstest_global.h" -/** +/*DEPRECATED \class HsWidgetProviderManifest \ingroup group_hswidgetmodel \brief Loads home screen widget tokens from an XML manifest file. diff -r 156f692b1687 -r b99b84bcd2d1 rom/homescreensrv_core.iby --- a/rom/homescreensrv_core.iby Fri Jun 11 13:58:37 2010 +0300 +++ b/rom/homescreensrv_core.iby Wed Jun 23 18:33:40 2010 +0300 @@ -52,14 +52,6 @@ data=ZPRIVATE\20022F90\castorage.db private\20022F90\castorage.db -// ---- appfoundation -------------------------------------------- - -// -------- statemodel -file=ABI_DIR\BUILD_DIR\statemodel.dll SHARED_LIB_DIR\statemodel.dll - -// -------- appruntimemodel -file=ABI_DIR\BUILD_DIR\appruntimemodel.dll SHARED_LIB_DIR\appruntimemodel.dll - // ---- hswidgetmodel -------------------------------------------- file=ABI_DIR\BUILD_DIR\hswidgetmodel.dll SHARED_LIB_DIR\hswidgetmodel.dll diff -r 156f692b1687 -r b99b84bcd2d1 sis/homescreensrv.pkg --- a/sis/homescreensrv.pkg Fri Jun 11 13:58:37 2010 +0300 +++ b/sis/homescreensrv.pkg Wed Jun 23 18:33:40 2010 +0300 @@ -143,14 +143,6 @@ "/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 -------------------------------------------- - -; -------- statemodel -"/epoc32/release/armv5/urel/statemodel.dll" - "c:/sys/bin/statemodel.dll" - -; -------- appruntimemodel -"/epoc32/release/armv5/urel/appruntimemodel.dll" - "c:/sys/bin/appruntimemodel.dll" - ; ---- hswidgetmodel -------------------------------------------- "/epoc32/release/armv5/urel/hswidgetmodel.dll" - "c:/sys/bin/hswidgetmodel.dll" diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/backstepping/bwins/tsbacksteppingu.def --- a/tstaskmonitor/backstepping/bwins/tsbacksteppingu.def Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/backstepping/bwins/tsbacksteppingu.def Wed Jun 23 18:33:40 2010 +0300 @@ -1,5 +1,5 @@ EXPORTS - ?NewLC@CTsBackstepping@@SAPAV1@AAVRWsSession@@@Z @ 1 NONAME ; class CTsBackstepping * CTsBackstepping::NewLC(class RWsSession &) - ?NewL@CTsBackstepping@@SAPAV1@AAVRWsSession@@@Z @ 2 NONAME ; class CTsBackstepping * CTsBackstepping::NewL(class RWsSession &) + ?NewL@CTsBackstepping@@SAPAV1@AAVMTsWindowGroupsMonitor@@@Z @ 1 NONAME ; class CTsBackstepping * CTsBackstepping::NewL(class MTsWindowGroupsMonitor &) + ?NewLC@CTsBackstepping@@SAPAV1@AAVMTsWindowGroupsMonitor@@@Z @ 2 NONAME ; class CTsBackstepping * CTsBackstepping::NewLC(class MTsWindowGroupsMonitor &) ??1CTsBackstepping@@UAE@XZ @ 3 NONAME ; CTsBackstepping::~CTsBackstepping(void) diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/backstepping/eabi/tsbacksteppingu.def --- a/tstaskmonitor/backstepping/eabi/tsbacksteppingu.def Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/backstepping/eabi/tsbacksteppingu.def Wed Jun 23 18:33:40 2010 +0300 @@ -1,6 +1,6 @@ EXPORTS - _ZN15CTsBackstepping4NewLER10RWsSession @ 1 NONAME - _ZN15CTsBackstepping5NewLCER10RWsSession @ 2 NONAME + _ZN15CTsBackstepping4NewLER22MTsWindowGroupsMonitor @ 1 NONAME + _ZN15CTsBackstepping5NewLCER22MTsWindowGroupsMonitor @ 2 NONAME _ZN15CTsBacksteppingD0Ev @ 3 NONAME _ZN15CTsBacksteppingD1Ev @ 4 NONAME _ZN15CTsBacksteppingD2Ev @ 5 NONAME diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/backstepping/group/tsbackstepping.mmp --- a/tstaskmonitor/backstepping/group/tsbackstepping.mmp Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/backstepping/group/tsbackstepping.mmp Wed Jun 23 18:33:40 2010 +0300 @@ -26,6 +26,7 @@ MW_LAYER_SYSTEMINCLUDE USERINCLUDE ../inc +USERINCLUDE ../../../inc SOURCEPATH ../src SOURCE tsbackstepping.cpp @@ -33,5 +34,6 @@ LIBRARY euser.lib LIBRARY ws32.lib // for RWsSession LIBRARY apgrfx.lib // for TApaTask / TApaTasksList +LIBRARY tsutils.lib DEBUGLIBRARY flogger.lib diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/backstepping/inc/tsbackstepping.h --- a/tstaskmonitor/backstepping/inc/tsbackstepping.h Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/backstepping/inc/tsbackstepping.h Wed Jun 23 18:33:40 2010 +0300 @@ -19,28 +19,25 @@ #define __CBACKSTEPPING_H #include - +#include -class CTsBackstepping : public CActive +class CTsBackstepping : public CTsWindowGroupsObserver { public: - IMPORT_C static CTsBackstepping* NewL(RWsSession &); - IMPORT_C static CTsBackstepping* NewLC(RWsSession &); + IMPORT_C static CTsBackstepping* NewL(MTsWindowGroupsMonitor &); + IMPORT_C static CTsBackstepping* NewLC(MTsWindowGroupsMonitor &); IMPORT_C virtual ~CTsBackstepping(); private: - CTsBackstepping(RWsSession&); + CTsBackstepping(MTsWindowGroupsMonitor &); void ConstructL(); - void RunL(); - TInt RunError(TInt error); - void DoCancel(); - void Subscribe(); - void AnalyseWindowStackL(); -private: - RWsSession &mWsSession; - RWindowGroup mWg; + void HandleWindowGroupChanged(MTsResourceManager &, + const TArray &); + + void HandleWindowGroupChangedL(MTsResourceManager &, + const TArray &); }; #endif // __CBACKSTEPPING_H diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/backstepping/inc/tsbacksteppingactivation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tstaskmonitor/backstepping/inc/tsbacksteppingactivation.h Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,78 @@ +/* +* 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 CTSBACKSTEPPINGWAITINGDLE_H +#define CTSBACKSTEPPINGWAITINGDLE_H + +#include + +class RProperty; +class MTsWindowGroupsMonitor; + + +NONSHARABLE_CLASS(CTsBacksteppingActivation) : public CActive + { +public: + /** + * Two-phased constructor. + * @param aPriority priority for the timer. + * @return new instance of CTeleWaitingIdle. + */ + static CTsBacksteppingActivation* NewL(MTsWindowGroupsMonitor &monitor); + /** + * destructor + */ + virtual ~CTsBacksteppingActivation(); + +protected: + /** + * @see CActive. + */ + void RunL(); + + /** + * @see CActive::RunError(TInt) + */ + TInt RunError(TInt); + + /** + * @see CActive. + */ + void DoCancel(); + +private: + /** + * constructor. + * @return new instance of CTeleWaitingIdle. + */ + CTsBacksteppingActivation(MTsWindowGroupsMonitor &monitor); + + void ConstructL(); + + void Subscribe(); + +private: + MTsWindowGroupsMonitor &mMonitor; + + // Central Repository. + RProperty mProperty; + + // Backstepping engine. Own + CBase* mEngine; + }; + +#endif /* CTSBACKSTEPPINGWAITINGDLE_H */ diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/backstepping/src/tsbackstepping.cpp --- a/tstaskmonitor/backstepping/src/tsbackstepping.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/backstepping/src/tsbackstepping.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -27,17 +27,16 @@ #include "tsbackstepping.h" const TUid KHSUid = {0x20022f35}; -const int KOrdinalPositionNoZOrder(-1); /** * CTsBackstepping::NewL * two phase constructor */ -EXPORT_C CTsBackstepping* CTsBackstepping::NewL(RWsSession &session) +EXPORT_C CTsBackstepping* CTsBackstepping::NewL(MTsWindowGroupsMonitor &monitor) { RDebug::Print(_L("CTsBackstepping::NewL")); - CTsBackstepping* self = CTsBackstepping::NewLC(session); + CTsBackstepping* self = CTsBackstepping::NewLC(monitor); CleanupStack::Pop(self); return self; } @@ -46,9 +45,9 @@ * CTsBackstepping::NewLC * two phase constructor */ -EXPORT_C CTsBackstepping* CTsBackstepping::NewLC(RWsSession &session) +EXPORT_C CTsBackstepping* CTsBackstepping::NewLC(MTsWindowGroupsMonitor &monitor) { - CTsBackstepping* self = new (ELeave) CTsBackstepping(session); + CTsBackstepping* self = new (ELeave) CTsBackstepping(monitor); CleanupStack::PushL(self); self->ConstructL(); return self; @@ -58,11 +57,10 @@ * CTsBackstepping::CTsBackstepping * constructor */ -CTsBackstepping::CTsBackstepping(RWsSession &session) -:CActive(EPriorityStandard), -mWsSession(session) +CTsBackstepping::CTsBackstepping(MTsWindowGroupsMonitor &monitor) +: +CTsWindowGroupsObserver(monitor) { - CActiveScheduler::Add(this); } @@ -72,12 +70,6 @@ */ EXPORT_C CTsBackstepping::~CTsBackstepping() { - RDebug::Print(_L("CTsBackstepping::~CTsBackstepping")); - // Cancel AO - Cancel(); - // Close opened session - mWg.Close(); - } /** @@ -87,102 +79,38 @@ void CTsBackstepping::ConstructL () { RDebug::Print(_L("CTsBackstepping::ConstructL")); - // Initial window group - mWg = RWindowGroup (mWsSession); - User::LeaveIfError (mWg.Construct ((TUint32)&mWg, EFalse)); - mWg.SetOrdinalPosition (KOrdinalPositionNoZOrder); - mWg.EnableReceiptOfFocus (EFalse); - - // Hide window - CApaWindowGroupName* wn = CApaWindowGroupName::NewLC (mWsSession); - wn->SetHidden (ETrue); - wn->SetWindowGroupName (mWg); - CleanupStack::PopAndDestroy (wn); - - // Window group change event - User::LeaveIfError (mWg.EnableGroupListChangeEvents()); - - TRAP_IGNORE(AnalyseWindowStackL());//not critical operation - Subscribe(); + BaseConstructL(); } /** - * CTsBackstepping::RunL - * called for handling events from window server + * CTsBackstepping::AnalyseWindowStackL + * Analyzes window stack and move homescreen to proper position */ -void CTsBackstepping::RunL() -{ - User::LeaveIfError(iStatus.Int()); - TWsEvent wsEvent; - mWsSession.GetEvent (wsEvent); - if (EEventWindowGroupListChanged == wsEvent.Type()) { - RDebug::Print(_L("CTsBackstepping::RunL : EEventWindowGroupListChanged")); - AnalyseWindowStackL (); - } - Subscribe(); -} - -/** - * CTsBackstepping::DoCancel - * Handling RunL errors. - */ -TInt CTsBackstepping::RunError(TInt error) +void CTsBackstepping::HandleWindowGroupChanged(MTsResourceManager &resource, const TArray &windowGroups) { - if (!IsActive() && KErrCancel != error) { - Subscribe(); - } - return KErrNone; -} - -/** - * CTsBackstepping::DoCancel - * Stopping active object - */ -void CTsBackstepping::DoCancel () -{ - if (IsActive()) { - mWsSession.EventReadyCancel(); - } -} - -/** - * CTsBackstepping::ActivateListeningL - * Starts listening to Window session events - */ -void CTsBackstepping::Subscribe() -{ - RDebug::Print(_L("CTsBackstepping::Subscribe")); - // and start listening - iStatus = KRequestPending; - mWsSession.EventReady( &iStatus ); - SetActive(); + TRAP_IGNORE(HandleWindowGroupChangedL(resource, windowGroups)); } /** * CTsBackstepping::AnalyseWindowStackL * Analyzes window stack and move homescreen to proper position */ -void CTsBackstepping::AnalyseWindowStackL () +void CTsBackstepping::HandleWindowGroupChangedL(MTsResourceManager &resource, + const TArray &windowGroups) { RDebug::Print(_L("CTsBackstepping::GetWindowCaption")); - RArray windowGroups; - CleanupClosePushL(windowGroups); - - CApaWindowGroupName *windowGroupName = CApaWindowGroupName::NewLC(mWsSession ); - //update window group list - mWsSession.WindowGroupList( &windowGroups ); + CApaWindowGroupName *windowGroupName = CApaWindowGroupName::NewLC(resource.WsSession()); TInt count(windowGroups.Count()); TInt pos(0); TInt whereToJump(1); for (TInt i=0; iConstructFromWgIdL(info.iId); + windowGroupName->ConstructFromWgIdL(windowGroups[i].iId); if (windowGroupName->AppUid() != TUid::Null()) { // find the window group id and check that it has no parent - if ( info.iParentId <= 0 ) { - RDebug::Print( _L("CTsBackstepping::GetWindowCaption wgid:%d is standalone view"), info.iId); + if ( windowGroups[i].iParentId <= 0 ) { + RDebug::Print( _L("CTsBackstepping::GetWindowCaption wgid:%d is standalone view"), windowGroups[i].iId); //check if it is homescreen if (windowGroupName->AppUid() == KHSUid) { RDebug::Print(_L("CTsBackstepping::GetWindowCaption Homescreen position = %d ; list:%d/%d"), pos, i, count); @@ -191,7 +119,7 @@ } else {//we should move homescreen to be second (ommit embeded views) from top RDebug::Print(_L("CTsBackstepping::moving homescreen to be second from top")); RDebug::Print(_L("CTsBackstepping::whereToJump = %d"), whereToJump); - mWsSession.SetWindowGroupOrdinalPosition(info.iId, whereToJump); + resource.WsSession().SetWindowGroupOrdinalPosition(windowGroups[i].iId, whereToJump); } // and break break; @@ -202,12 +130,11 @@ if (!pos) { ++whereToJump; } - RDebug::Print(_L("CTsBackstepping::GetWindowCaption wgid:%d is embedded view"), info.iId); + RDebug::Print(_L("CTsBackstepping::GetWindowCaption wgid:%d is embedded view"), windowGroups[i].iId); } } } CleanupStack::PopAndDestroy(windowGroupName); - CleanupStack::PopAndDestroy(&windowGroups); } // end of file diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/backstepping/src/tsbacksteppingactivation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tstaskmonitor/backstepping/src/tsbacksteppingactivation.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -0,0 +1,137 @@ +/* +* 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 "tsbacksteppingactivation.h" +#include "tsbackstepping.h" + + // ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CBacksteppingActivation::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTsBacksteppingActivation* CTsBacksteppingActivation::NewL(MTsWindowGroupsMonitor &monitor) +{ + RDebug::Print(_L("CBacksteppingActivation::NewL")); + CTsBacksteppingActivation* self = new( ELeave ) CTsBacksteppingActivation(monitor); + self->ConstructL(); + return self; +} + +// ----------------------------------------------------------------------------- +// CBacksteppingWaitingIdle::CBacksteppingWaitingIdle +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CTsBacksteppingActivation::CTsBacksteppingActivation(MTsWindowGroupsMonitor &monitor) +: + CActive(EPriorityLow), + mMonitor(monitor) +{ + CActiveScheduler::Add(this); +} + +// ----------------------------------------------------------------------------- +// CBacksteppingActivation::ConstructL() +// ----------------------------------------------------------------------------- +// +void CTsBacksteppingActivation::ConstructL() +{ + User::LeaveIfError(mProperty.Attach(KPSUidStartup, KPSIdlePhase1Ok)); + iStatus = KRequestPending; + SetActive(); + TRequestStatus* status(&iStatus); + User::RequestComplete(status); +} + +// ----------------------------------------------------------------------------- +// CBacksteppingActivation::~CBacksteppingActivation +// Destructor +// ----------------------------------------------------------------------------- +// +CTsBacksteppingActivation::~CTsBacksteppingActivation() +{ + Cancel(); + delete mEngine; + mProperty.Close(); +} + +// ----------------------------------------------------------------------------- +// CBacksteppingActivation::DoCancel +// +// ----------------------------------------------------------------------------- +// +void CTsBacksteppingActivation::DoCancel() +{ + if ( IsActive() && mProperty.Handle() ) { + mProperty.Cancel(); + } +} + +// ----------------------------------------------------------------------------- +// CBacksteppingActivation::RunL +// +// ----------------------------------------------------------------------------- +// +void CTsBacksteppingActivation::RunL() +{ + User::LeaveIfError(iStatus.Int()); + + TInt state(~EIdlePhase1Ok); + User::LeaveIfError(mProperty.Get(state)); + + if (EIdlePhase1Ok == state) { + if (0 == mEngine) { + mEngine = CTsBackstepping::NewL(mMonitor); + } + } else { + delete mEngine; + mEngine = 0; + } + Subscribe(); +} + +// ----------------------------------------------------------------------------- +// CBacksteppingActivation::RunError +// +// ----------------------------------------------------------------------------- +// +TInt CTsBacksteppingActivation::RunError(TInt error) +{ + if (KErrCancel != error) { + Subscribe(); + } + return KErrNone; +} + +// ----------------------------------------------------------------------------- +// CBacksteppingActivation::Subscribe +// +// ----------------------------------------------------------------------------- +// +void CTsBacksteppingActivation::Subscribe() +{ + mProperty.Subscribe(iStatus); + SetActive(); +} +// end of file diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/client/client.pro --- a/tstaskmonitor/client/client.pro Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/client/client.pro Wed Jun 23 18:33:40 2010 +0300 @@ -25,7 +25,7 @@ dll.sources = tstaskmonitorclient.dll dll.path = $$SHARED_LIB_DIR DEPLOYMENT += dll - LIBS += -ltsutils + LIBS += -ltsutils -lws32 -lapgrfx -lcone BLD_INF_RULES.prj_exports += "s60\inc\tstaskmonitorclient.h" \ "s60\inc\tstaskmonitorobserver.h" \ diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/server/group/hsrunningappmonitor.mmp --- a/tstaskmonitor/server/group/hsrunningappmonitor.mmp Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/server/group/hsrunningappmonitor.mmp Wed Jun 23 18:33:40 2010 +0300 @@ -38,8 +38,6 @@ SOURCE tsrunningappstorage.cpp SOURCE tsfswdatalist.cpp -SOURCE tsfswengine.cpp -SOURCE tsfswmonitor.cpp SOURCE tsscreenshotprovider.cpp SOURCEPATH ../../utils/src diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/server/inc/hsrunningappserver.h --- a/tstaskmonitor/server/inc/hsrunningappserver.h Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/server/inc/hsrunningappserver.h Wed Jun 23 18:33:40 2010 +0300 @@ -24,6 +24,8 @@ #include "tsdataobserver.h" class CRunningAppStorage; +class CTsResourceManager; +class CTsWindowGroupsMonitor; /** * CRunningAppServer * @@ -70,7 +72,10 @@ private: RPointerArray mObservers; RWsSession mWsSession; + CTsResourceManager* mResources; + CTsWindowGroupsMonitor* mMonitor; CRunningAppStorage* mStorage; + CBase *mScreenshotProviderStarter; CBase *mBacksteppingEngine; }; diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/server/inc/tsfswdatalist.h --- a/tstaskmonitor/server/inc/tsfswdatalist.h Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/server/inc/tsfswdatalist.h Wed Jun 23 18:33:40 2010 +0300 @@ -20,8 +20,7 @@ #define TSFSWDATALIST_H #include -#include -#include +#include #include "tsfswentry.h" #include "tsdataobserver.h" @@ -31,15 +30,15 @@ /** * Engine's data list. */ -NONSHARABLE_CLASS( CTsFswDataList ) : public CBase +NONSHARABLE_CLASS( CTsFswDataList ) : public CTsWindowGroupsObserver { public: /** * Two-phased constructor. - * - * @param aParent */ - static CTsFswDataList* NewL(MHsDataObserver& observer); + static CTsFswDataList* NewL(MTsResourceManager& resources, + MTsWindowGroupsMonitor &monitor, + MHsDataObserver& observer); /* * Destructor @@ -50,7 +49,9 @@ /** * Constructor. */ - CTsFswDataList(MHsDataObserver& observer); + CTsFswDataList(MTsResourceManager& resources, + MTsWindowGroupsMonitor &monitor, + MHsDataObserver& observer); /** * Performs 2nd phase construction. @@ -67,10 +68,11 @@ const RTsFswArray& FswDataL(); /** - * Gets the window group list and reconstructs the fsw content. - * @return TBool ETrue if the content iData has been modified + * Interface implementation + * @see MTsWindowGroupsObserver HandleWindowGroupChanged */ - TBool CollectTasksL(); + void HandleWindowGroupChanged(MTsResourceManager &, + const TArray &); /** * Checks if given uid is on hidden list @@ -82,19 +84,20 @@ /** * Set screenshot */ - TBool SetScreenshotL(const CFbsBitmap* bitmap, UpdatePriority priority, TInt wgId); + void SetScreenshotL(const CFbsBitmap* bitmap, UpdatePriority priority, TInt wgId); /** * Removes screenshot */ - TBool RemoveScreenshotL(TInt wgId); + void RemoveScreenshotL(TInt wgId); private: /** * Adds running apps to the list. * @param appsList array to add to */ - void CollectAppsL( RTsFswArray& appsList ); + void CollectAppsL(RTsFswArray& appsList, + const TArray &wgList); /** * Called from CollectTasksL for each entry in the task list. @@ -103,10 +106,10 @@ * @param wgName window group name or NULL * @param newList list to add to */ - void AddEntryL( const TTsEntryKey& key, - const TUid& appUid, - CApaWindowGroupName* wgName, - RTsFswArray& newList ); + void AddEntryL(const TTsEntryKey& key, + const TUid& appUid, + CApaWindowGroupName* wgName, + RTsFswArray& newList ); /** * Checks if there is an entry for same app in the content list. @@ -135,9 +138,8 @@ * on aConsiderWidgets param. * Function removes or add entries into data depend on given list. * @param listToFit list with actual data - * @return ETrue if change occours on data list, EFalse otherwise */ - TBool FitDataToListL( RTsFswArray& listToFit); + void FitDataToList( RTsFswArray& listToFit); /** * Checks if there is an entry for same app in the given list. @@ -176,20 +178,39 @@ /** * Gets allowed uids, tries to filter non GUI application */ - void GetAllowedUidsL(); + TBool VerifyApplicationL(TUid); + + /** + * Function generate task key using window group id + * @param wgId - window group id of running application + * @param entry key + */ + TTsEntryKey GenerateKeyL(TInt); + /** + * Analyse and compress lookup table id needed + * @param array - lookup table that has to be checked + * + */ + void CompressLookupTable(RArray &array); + + /** + * Change priority of an item in the lookup table + * @param array - look up table + * @param offset - index of an item in the table + */ + void UpdateLookupTableL(RArray &array, TInt offset); private: + /** + * Resource manager. Not own + */ + MTsResourceManager& mResources; + MHsDataObserver &mObserver; RTsFswArray mData; // current fsw content, i.e. the task list - // window server session - RWsSession mWsSession; - - // apparc session - RApaLsSession mAppArcSession; - // list of hidden uids RArray mHiddenUids; diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/server/inc/tsfswengine.h --- a/tstaskmonitor/server/inc/tsfswengine.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +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: Task monitor engine - * -*/ - - -#ifndef TSFSWENGINE_H -#define TSFSWENGINE_H - -#include -#include "tsfswentry.h" -#include "tsdataobserver.h" - -class CTsFswDataList; - - -/** - * Engine for fast swap server. - * Performs task monitoring, notifications about wg changes are - * received from the appui. - */ -NONSHARABLE_CLASS( CTsFswEngine ) : public CBase, - public MHsDataObserver - - { - -public: - /** - * Creates a new instance. - * @param observer ref to observer - */ - static CTsFswEngine* NewL( MHsDataObserver& observer ); - - /** - * @copydoc NewL - */ - static CTsFswEngine* NewLC( MHsDataObserver& observer ); - - /** - * Destructor. - */ - ~CTsFswEngine(); - - /** - * Returns a reference to the current content. - * @return ref to content array - */ - const RTsFswArray& FswDataL(); - - /** - * Set screenshot - */ - void SetScreenshotL(const CFbsBitmap* bitmap, UpdatePriority priority, TInt wgId); - - /** - * Removes screenshot - */ - void RemoveScreenshotL(TInt wgId); - - -private: - - // from MTsFswTaskListObserver - void DataChanged(); - - - -private: - /** - * Constructor. - */ - CTsFswEngine( MHsDataObserver& observer ); - - /** - * Performs 2nd phase construction. - */ - void ConstructL(); - - /** - * Gets the window group list and reconstructs the fsw content. - * @return TBool ETrue if the list has been modified - */ - TBool CollectTasksL(); - -private: - MHsDataObserver& mObserver; - CTsFswDataList* mDataList; //own - - }; - -#endif diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/server/inc/tsfswmonitor.h --- a/tstaskmonitor/server/inc/tsfswmonitor.h Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +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: Monitor for server - * -*/ - - -#ifndef TSFSWMONITOR_H -#define TSFSWMONITOR_H - -#include -#include - -class MHsDataObserver; -class MTsFswResourceObserver; - -/** - * Monitor for the fsw server. - * Reimplements HandleWsEventL from base class to get notifications about - * window group changes. - */ -class CTsFswMonitor : public CActive - { -public: - ~CTsFswMonitor(); - - - -static CTsFswMonitor* NewL(MHsDataObserver& taskListObserver); -static CTsFswMonitor* NewLC(MHsDataObserver& taskListObserver); - -protected: - CTsFswMonitor(MHsDataObserver& taskListObserver); - void ConstructL(); - - // from CActive - void RunL(); - TInt RunError( TInt error ); - void DoCancel(); - - -private: - void Subscribe(); - void ConstractObserverL(); -private: - MHsDataObserver* mTaskListObserver; // not own - - // window server session - RWsSession mWsSession; - - // Window group. - RWindowGroup mWg; - }; - -#endif //TSFSWMONITOR_H diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/server/inc/tsrunningappstorage.h --- a/tstaskmonitor/server/inc/tsrunningappstorage.h Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/server/inc/tsrunningappstorage.h Wed Jun 23 18:33:40 2010 +0300 @@ -25,8 +25,10 @@ #include "hsdataprovider.h" #include "tsdatastorage.h" -class CTsFswEngine; -class CTsFswMonitor; +class CTsFswDataList; +class MTsResourceManager; +class MTsWindowGroupsMonitor; + /** * CRunningAppServer * @@ -45,7 +47,9 @@ /** * Two-phased constructor. */ - static CRunningAppStorage* NewL(MHsDataObserver& observer); + static CRunningAppStorage* NewL(MHsDataObserver& observer, + MTsResourceManager& resources, + MTsWindowGroupsMonitor &wsMonitor); public: //MHsDataObserver const TDesC8& Data() const; @@ -66,17 +70,15 @@ /** * Default constructor for performing 2nd stage construction */ - void ConstructL(); + void ConstructL(MTsResourceManager& resources, + MTsWindowGroupsMonitor &wsMonitor); void DataChangedL(); private: MHsDataObserver& mObserver; RBuf8 mData; - - CTsFswEngine* mEngine; - CTsFswMonitor* mMonitor; - + CTsFswDataList* mEngine; }; #endif // RUNNINGAPPSERVER_H diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/server/src/hsrunningappserver.cpp --- a/tstaskmonitor/server/src/hsrunningappserver.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/server/src/hsrunningappserver.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -14,6 +14,7 @@ * Description: * */ +#include #include "tstaskmonitorglobals.h" #include "hsrunningappserver.h" #include "hsrunningappsession.h" @@ -42,6 +43,7 @@ delete mBacksteppingEngine; delete mScreenshotProviderStarter; delete mStorage; + delete mMonitor; mObservers.ResetAndDestroy(); } @@ -65,9 +67,11 @@ { StartL(KRunningAppServerName); User::LeaveIfError(mWsSession.Connect()); - mStorage = CRunningAppStorage::NewL(*this); + mResources = CTsResourceManager::NewL(); + mMonitor = CTsWindowGroupsMonitor::NewL(*mResources); + mStorage = CRunningAppStorage::NewL(*this, *mResources, *mMonitor); TRAP_IGNORE(mScreenshotProviderStarter = CTsScreenshotProvider::NewL(*mStorage); - mBacksteppingEngine = CTsBackstepping::NewL(mWsSession);) + mBacksteppingEngine = CTsBackstepping::NewL(*mMonitor);) } // ----------------------------------------------------------------------------- diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/server/src/tsfswdatalist.cpp --- a/tstaskmonitor/server/src/tsfswdatalist.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/server/src/tsfswdatalist.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -18,7 +18,6 @@ //INCLUDES: #include "tsfswdatalist.h" -#include "tsfswengine.h" #include "tsentrykeygenerator.h" #include // for CleanupResetAndDestroyPushL #include @@ -27,7 +26,7 @@ #include // fbsbitmap #include #include -#include +#include // size for the created app icons @@ -37,15 +36,19 @@ //uids to be hidden const TUid KHsApplicationUid = { 0x20022F35 }; +const TInt KMaxLookupSize(75); + // ================= MEMBER FUNCTIONS ======================= // -------------------------------------------------------------------------- // CTsFswDataList::NewL // -------------------------------------------------------------------------- // -CTsFswDataList* CTsFswDataList::NewL(MHsDataObserver &observer) +CTsFswDataList* CTsFswDataList::NewL(MTsResourceManager& resources, + MTsWindowGroupsMonitor &monitor, + MHsDataObserver& observer) { - CTsFswDataList* self = new (ELeave) CTsFswDataList(observer); + CTsFswDataList* self = new (ELeave) CTsFswDataList(resources, monitor, observer); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); @@ -56,7 +59,12 @@ // CTsFswDataList::CTsFswDataList // -------------------------------------------------------------------------- // -CTsFswDataList::CTsFswDataList(MHsDataObserver& observer) : +CTsFswDataList::CTsFswDataList(MTsResourceManager& resources, + MTsWindowGroupsMonitor &monitor, + MHsDataObserver& observer) +: + CTsWindowGroupsObserver(monitor), + mResources(resources), mObserver(observer) { } @@ -68,8 +76,6 @@ CTsFswDataList::~CTsFswDataList() { mData.ResetAndDestroy(); - mAppArcSession.Close(); - mWsSession.Close(); mHiddenUids.Close(); mAllowedUids.Close(); RFbsSession::Disconnect(); @@ -82,8 +88,7 @@ // void CTsFswDataList::ConstructL() { - User::LeaveIfError(mWsSession.Connect()); - User::LeaveIfError(mAppArcSession.Connect()); + BaseConstructL(); mHiddenUids.AppendL(KHsApplicationUid); User::LeaveIfError(RFbsSession::Connect()); RAknIconSrvClient::Connect(); @@ -102,34 +107,27 @@ // CTsFswDataList::CollectTasksL // -------------------------------------------------------------------------- // -TBool CTsFswDataList::CollectTasksL() +void CTsFswDataList::HandleWindowGroupChanged(MTsResourceManager &, + const TArray &wgList) { - TBool changed = EFalse; - RTsFswArray newAppsList; - CleanupResetAndDestroyPushL(newAppsList); - CollectAppsL(newAppsList); - changed |= FitDataToListL(newAppsList); - CleanupStack::PopAndDestroy(&newAppsList); - return changed; + TRAP_IGNORE(RTsFswArray newAppsList; + CleanupResetAndDestroyPushL(newAppsList); + CollectAppsL(newAppsList, wgList); + FitDataToList(newAppsList); + CleanupStack::PopAndDestroy(&newAppsList)); + } // -------------------------------------------------------------------------- // CTsFswDataList:: // -------------------------------------------------------------------------- // -void CTsFswDataList::CollectAppsL(RTsFswArray& appsList) +void CTsFswDataList::CollectAppsL(RTsFswArray& appsList, + const TArray &wgList) { - // gets allowed uids - running apps without hidden uids, null uids, filtered uid - GetAllowedUidsL(); - - // get all window groups - RArray allWgIds; - CleanupClosePushL(allWgIds); - User::LeaveIfError(mWsSession.WindowGroupList(0, &allWgIds)); - - TInt count = allWgIds.Count(); - for (TInt i = 0; i < count; ++i) { - TTsEntryKey key = TsEntryKeyGeneraror::GenerateL(allWgIds[i].iId, allWgIds.Array()); + TInt offset(KErrNotFound); + for (TInt i = 0; i < wgList.Count(); ++i) { + TTsEntryKey key = TsEntryKeyGeneraror::GenerateL(wgList[i].iId, wgList); //skip this entry if it is already on list if (FindEntry(appsList, key) >= 0) { continue; @@ -137,16 +135,22 @@ // get window group name TInt wgId = key.mParentId; - CApaWindowGroupName* windowName = CApaWindowGroupName::NewLC(mWsSession, wgId); + CApaWindowGroupName* windowName = CApaWindowGroupName::NewLC(mResources.WsSession(), wgId); TUid appUid = windowName->AppUid(); - - // add item to task list if uid is allowed - if (mAllowedUids.Find(appUid) >= 0) { + + //Check hidden applications + if (KErrNotFound != (offset = mHiddenUids.Find(appUid))) { + UpdateLookupTableL(mHiddenUids, offset); + } else if (KErrNotFound != (offset = mAllowedUids.Find(appUid))) { + UpdateLookupTableL(mAllowedUids, offset); + AddEntryL(key, appUid, windowName, appsList); + } else if(VerifyApplicationL(appUid)) { AddEntryL(key, appUid, windowName, appsList); } CleanupStack::PopAndDestroy(windowName); } - CleanupStack::PopAndDestroy(&allWgIds); + CompressLookupTable(mHiddenUids); + CompressLookupTable(mAllowedUids); } // -------------------------------------------------------------------------- @@ -208,7 +212,7 @@ { //Retrieve the app name TApaAppInfo info; - mAppArcSession.GetAppInfo(info, appUid); + mResources.ApaSession().GetAppInfo(info, appUid); TPtrC caption = info.iShortCaption; HBufC* tempName = 0; @@ -220,7 +224,7 @@ } else { TThreadId threadId; - TInt err = mWsSession.GetWindowGroupClientThreadId(wgId, threadId); + TInt err = mResources.WsSession().GetWindowGroupClientThreadId(wgId, threadId); if (err == KErrNone) { RThread thread; CleanupClosePushL(thread); @@ -245,7 +249,7 @@ // CTsFswDataList::FitDataToListL // -------------------------------------------------------------------------- // -TBool CTsFswDataList::FitDataToListL(RTsFswArray& listToFit) +void CTsFswDataList::FitDataToList(RTsFswArray& listToFit) { TBool changed = EFalse; TInt listCount = listToFit.Count(); @@ -272,9 +276,10 @@ } //establish order TBool orderChanged = EstablishOrder(allKeys); - changed = changed || orderChanged; + if (changed || orderChanged) { + mObserver.DataChanged(); + } allKeys.Close(); - return changed; } // -------------------------------------------------------------------------- @@ -302,10 +307,10 @@ TSize size(KAppIconWidth, KAppIconHeight); CApaMaskedBitmap* apaMaskedBitmap = CApaMaskedBitmap::NewLC(); - TInt err = mAppArcSession.GetAppIcon(aAppUid, size, *apaMaskedBitmap); + TInt err = mResources.ApaSession().GetAppIcon(aAppUid, size, *apaMaskedBitmap); TInt iconsCount(0); if (err == KErrNone) { - err = mAppArcSession.NumberOfOwnDefinedIcons(aAppUid, iconsCount); + err = mResources.ApaSession().NumberOfOwnDefinedIcons(aAppUid, iconsCount); } if ((err == KErrNone) && (iconsCount > 0)) { @@ -318,7 +323,7 @@ else { CleanupStack::PopAndDestroy(apaMaskedBitmap); HBufC* fileNameFromApparc = NULL; - TInt err = mAppArcSession.GetAppIcon(aAppUid, fileNameFromApparc); + TInt err = mResources.ApaSession().GetAppIcon(aAppUid, fileNameFromApparc); if (err == KErrNone) { CleanupStack::PushL(fileNameFromApparc); CFbsBitmap *bitamp(0); @@ -378,44 +383,23 @@ // CTsFswDataList::SetScreenshotL // -------------------------------------------------------------------------- // -TBool CTsFswDataList::SetScreenshotL(const CFbsBitmap* bitmap, UpdatePriority priority, TInt wgId) +void CTsFswDataList::SetScreenshotL(const CFbsBitmap* bitmap, UpdatePriority priority, TInt wgId) { - RArray allWgIds; - CleanupClosePushL(allWgIds); - User::LeaveIfError(mWsSession.WindowGroupList(0, &allWgIds)); - TTsEntryKey key = TsEntryKeyGeneraror::GenerateL(wgId, allWgIds.Array()); - TInt pos = FindEntry(mData, key); - TBool updated(EFalse); - if (pos >= 0) { - updated = mData[pos]->SetScreenshotL(bitmap, priority); - } - else { - User::Leave(KErrNotFound); - } - CleanupStack::PopAndDestroy(&allWgIds); - return updated; + TInt pos = FindEntry(mData, GenerateKeyL(wgId)); + User::LeaveIfError(pos); + mData[pos]->SetScreenshotL(bitmap, priority); } // -------------------------------------------------------------------------- // CTsFswDataList::RemoveScreenshotL // -------------------------------------------------------------------------- // -TBool CTsFswDataList::RemoveScreenshotL(TInt wgId) +void CTsFswDataList::RemoveScreenshotL(TInt wgId) { - RArray allWgIds; - CleanupClosePushL(allWgIds); - User::LeaveIfError(mWsSession.WindowGroupList(0, &allWgIds)); - TTsEntryKey key = TsEntryKeyGeneraror::GenerateL(wgId, allWgIds.Array()); - TInt pos = FindEntry(mData, key); - TBool updated(EFalse); - if (pos >= 0) { - updated = mData[pos]->RemoveScreenshot(); - } - else { - User::Leave(KErrNotFound); - } - CleanupStack::PopAndDestroy(&allWgIds); - return updated; + + TInt pos = FindEntry(mData, GenerateKeyL(wgId)); + User::LeaveIfError(pos); + mData[pos]->RemoveScreenshotL(); } // -------------------------------------------------------------------------- @@ -445,25 +429,65 @@ // CTsFswDataList::GetAllowedUidsL // -------------------------------------------------------------------------- // -void CTsFswDataList::GetAllowedUidsL() +TBool CTsFswDataList::VerifyApplicationL(TUid uid) { - mAllowedUids.Close(); - TApaAppInfo* appInfo = new (ELeave) TApaAppInfo(); - CleanupStack::PushL(appInfo); + TBool retVal(EFalse); + TApaAppInfo appInfo; TApaAppCapabilityBuf appCap; - User::LeaveIfError(mAppArcSession.GetAllApps(0)); + User::LeaveIfError(mResources.ApaSession().GetAllApps(0)); // for every application get uid, hidden and missing attribute // and add to aArray. - while (KErrNone == mAppArcSession.GetNextApp(*appInfo)) { - TUid uid = appInfo->iUid; - User::LeaveIfError(mAppArcSession.GetAppCapability(appCap, uid)); - // do not add hidden app and with null uid. - if (!appCap().iAppIsHidden && !IsHiddenUid(uid) && uid.iUid) { - mAllowedUids.AppendL(uid); + while (KErrNone == mResources.ApaSession().GetNextApp(appInfo)) { + User::LeaveIfError(mResources.ApaSession().GetAppCapability(appCap, appInfo.iUid)); + if(!appCap().iAppIsHidden) { + if (uid == appInfo.iUid) { + retVal = ETrue; + mAllowedUids.InsertL(appInfo.iUid, mAllowedUids.Count()); + } + } else if(KErrNotFound == mHiddenUids.Find(appInfo.iUid)) { + mHiddenUids.InsertL(appInfo.iUid, mHiddenUids.Count()); } } - CleanupStack::PopAndDestroy(appInfo); + if (EFalse == retVal && KErrNotFound == mHiddenUids.Find(uid)) { + mHiddenUids.InsertL(uid, mHiddenUids.Count()); + } + return retVal; +} + +// -------------------------------------------------------------------------- +// CTsFswDataList::GenerateKeyL(TInt) +// -------------------------------------------------------------------------- +// +TTsEntryKey CTsFswDataList::GenerateKeyL(TInt wgId) +{ + RArray allWgIds; + CleanupClosePushL(allWgIds); + User::LeaveIfError(mResources.WsSession().WindowGroupList(0, &allWgIds)); + const TTsEntryKey key = TsEntryKeyGeneraror::GenerateL(wgId, allWgIds.Array()); + CleanupStack::PopAndDestroy(&allWgIds); + return key; } +// -------------------------------------------------------------------------- +// CTsFswDataList::CompressLookupTable(RArray &) +// -------------------------------------------------------------------------- +// +void CTsFswDataList::CompressLookupTable(RArray &array) +{ + while(KMaxLookupSize < array.Count()) { + array.Remove(0); + } +} + +// -------------------------------------------------------------------------- +// CTsFswDataList::UpdateLookupTableL(RArray &, TInt) +// -------------------------------------------------------------------------- +// +void CTsFswDataList::UpdateLookupTableL(RArray &array, TInt offset) +{ + const TUid uid(array[offset]); + array.Remove(offset); + array.InsertL(uid, array.Count()); +} // end of file diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/server/src/tsfswengine.cpp --- a/tstaskmonitor/server/src/tsfswengine.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +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: Task monitor engine - * -*/ - - -#include "tsfswengine.h" -#include "tsfswdatalist.h" - - -// -------------------------------------------------------------------------- -// CTsFswEngine::NewL -// -------------------------------------------------------------------------- -// -CTsFswEngine* CTsFswEngine::NewL(MHsDataObserver& observer) -{ - CTsFswEngine* self = NewLC(observer); - CleanupStack::Pop(self); - return self; -} - -// -------------------------------------------------------------------------- -// CTsFswEngine::NewLC -// -------------------------------------------------------------------------- -// -CTsFswEngine* CTsFswEngine::NewLC(MHsDataObserver& observer) -{ - CTsFswEngine* self = new (ELeave) CTsFswEngine(observer); - CleanupStack::PushL(self); - self->ConstructL(); - return self; -} - -// -------------------------------------------------------------------------- -// CTsFswEngine::CTsFswEngine -// -------------------------------------------------------------------------- -// -CTsFswEngine::CTsFswEngine(MHsDataObserver& observer) : - mObserver(observer) -{ -} - -// -------------------------------------------------------------------------- -// CTsFswEngine::ConstructL -// -------------------------------------------------------------------------- -// -void CTsFswEngine::ConstructL() -{ - mDataList = CTsFswDataList::NewL(mObserver); - CollectTasksL(); -} - -// -------------------------------------------------------------------------- -// CTsFswEngine::~CTsFswEngine -// -------------------------------------------------------------------------- -// -CTsFswEngine::~CTsFswEngine() -{ - delete mDataList; -} - -// -------------------------------------------------------------------------- -// CTsFswEngine::FswDataL -// -------------------------------------------------------------------------- -// -const RTsFswArray& CTsFswEngine::FswDataL() -{ - return mDataList->FswDataL(); -} - -// -------------------------------------------------------------------------- -// CTsFswEngine::UpdateTaskList -// Callback from appui -// -------------------------------------------------------------------------- -// -void CTsFswEngine::DataChanged() -{ - TBool changed = EFalse; - TRAPD( err, changed = CollectTasksL() ); - if (err == KErrNone && changed) { - mObserver.DataChanged(); - } -} - -// -------------------------------------------------------------------------- -// CTsFswEngine::CollectTasksL -// -------------------------------------------------------------------------- -// -TBool CTsFswEngine::CollectTasksL() -{ - TBool changed = mDataList->CollectTasksL(); - return changed; -} - -// -------------------------------------------------------------------------- -// CTsFswEngine::SetScreenshotL -// -------------------------------------------------------------------------- -// -void CTsFswEngine::SetScreenshotL(const CFbsBitmap* bitmap, UpdatePriority priority, TInt wgId) -{ - TBool changed = mDataList->SetScreenshotL(bitmap, priority, wgId); - if (!changed) { - User::Leave(KErrAccessDenied); - } -} - -// -------------------------------------------------------------------------- -// CTsFswEngine::SetScreenshotL -// -------------------------------------------------------------------------- -// -void CTsFswEngine::RemoveScreenshotL(TInt wgId) -{ - TBool changed = mDataList->RemoveScreenshotL(wgId); - if (changed) { - mObserver.DataChanged(); - } -} -// end of file diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/server/src/tsfswmonitor.cpp --- a/tstaskmonitor/server/src/tsfswmonitor.cpp Fri Jun 11 13:58:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +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: ws monitor implementation - * - */ - -#include "tsfswmonitor.h" -#include "tsdataobserver.h" - -// -------------------------------------------------------------------------- -// CTsFswMonitor::~CTsFswMonitor -// -------------------------------------------------------------------------- -// -CTsFswMonitor::~CTsFswMonitor() -{ - Cancel(); - mWg.Close(); - mWsSession.Close(); -} - -// -------------------------------------------------------------------------- -// CTsFswMonitor::CTsFswMonitor -// -------------------------------------------------------------------------- -// -CTsFswMonitor::CTsFswMonitor(MHsDataObserver& taskListObserver) : - CActive(EPriorityStandard), mTaskListObserver(&taskListObserver) -{ -} - -// -------------------------------------------------------------------------- -// CTsFswMonitor::NewL -// -------------------------------------------------------------------------- -// -CTsFswMonitor* CTsFswMonitor::NewL(MHsDataObserver& taskListObserver) -{ - CTsFswMonitor* self = NewLC(taskListObserver); - CleanupStack::Pop(self); - return self; -} - -// -------------------------------------------------------------------------- -// CTsFswMonitor::NewLC -// -------------------------------------------------------------------------- -// -CTsFswMonitor* CTsFswMonitor::NewLC(MHsDataObserver& taskListObserver) -{ - CTsFswMonitor* self = new (ELeave) CTsFswMonitor(taskListObserver); - CleanupStack::PushL(self); - self->ConstructL(); - return self; -} - -// -------------------------------------------------------------------------- -// CTsFswMonitor::ConstructL -// -------------------------------------------------------------------------- -// -void CTsFswMonitor::ConstructL() -{ - CActiveScheduler::Add(this); - //Create window server observer - ConstractObserverL(); - Subscribe(); -} - -// ----------------------------------------------------------------------------- -// Subscribe -// ----------------------------------------------------------------------------- -// -void CTsFswMonitor::Subscribe() -{ - if (!IsActive()) { - mWsSession.EventReady(&iStatus); - SetActive(); - } -} - -// ----------------------------------------------------------------------------- -// ConstractObserverL -// ----------------------------------------------------------------------------- -// -void CTsFswMonitor::ConstractObserverL() -{ - User::LeaveIfError(mWsSession.Connect()); - mWg = RWindowGroup(mWsSession); - User::LeaveIfError(mWg.Construct(reinterpret_cast (&mWg))); - mWg.DisableFocusChangeEvents(); - mWg.DisableModifierChangedEvents(); - mWg.DisableOnEvents(); - mWg.DisableScreenChangeEvents(); - - //enable notifications about group lists - User::LeaveIfError(mWg.EnableGroupListChangeEvents()); -} - -void CTsFswMonitor::RunL() -{ - User::LeaveIfError(iStatus.Int()); - TWsEvent event; - mWsSession.GetEvent(event); - Subscribe();//new subscribtion has to be called after picking event - if (EEventWindowGroupListChanged == event.Type() /*|| EEventFocusGroupChanged == event.Type()*/) { - if (mTaskListObserver) { - mTaskListObserver->DataChanged(); - } - } -} - -TInt CTsFswMonitor::RunError(TInt /*aError*/) -{ - Subscribe(); - return KErrNone; -} - -void CTsFswMonitor::DoCancel() -{ - if (IsActive()) { - mWsSession.EventReadyCancel(); - } -} - -// end of file diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/server/src/tsrunningappstorage.cpp --- a/tstaskmonitor/server/src/tsrunningappstorage.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/server/src/tsrunningappstorage.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -15,8 +15,7 @@ * */ #include "tsrunningappstorage.h" -#include "tsfswengine.h" -#include "tsfswmonitor.h" +#include "tsfswdatalist.h" #include "tsfswentry.h" #include #include @@ -37,18 +36,19 @@ { mData.Close(); delete mEngine; - delete mMonitor; } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // -CRunningAppStorage* CRunningAppStorage::NewL(MHsDataObserver& observer) +CRunningAppStorage* CRunningAppStorage::NewL(MHsDataObserver& observer, + MTsResourceManager& resources, + MTsWindowGroupsMonitor &wsMonitor) { CRunningAppStorage * self = new (ELeave)CRunningAppStorage(observer); CleanupStack::PushL(self); - self->ConstructL(); + self->ConstructL(resources, wsMonitor); CleanupStack::Pop(self); return self; } @@ -57,10 +57,15 @@ // // ----------------------------------------------------------------------------- // -void CRunningAppStorage::ConstructL() +void CRunningAppStorage::ConstructL(MTsResourceManager& resources, + MTsWindowGroupsMonitor &wsMonitor) { - mEngine = CTsFswEngine::NewL(*this) ; - mMonitor = CTsFswMonitor::NewL(*mEngine); + mEngine = CTsFswDataList::NewL(resources, wsMonitor, *this) ; + RArray wgList; + CleanupClosePushL(wgList); + User::LeaveIfError(resources.WsSession().WindowGroupList(&wgList)); + mEngine->HandleWindowGroupChanged(resources, wgList.Array()); + CleanupStack::PopAndDestroy(&wgList); DataChangedL(); } diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/utils/inc/tsfswentry.h --- a/tstaskmonitor/utils/inc/tsfswentry.h Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/utils/inc/tsfswentry.h Wed Jun 23 18:33:40 2010 +0300 @@ -113,8 +113,8 @@ void SetAppUid( const TUid& uid ); void SetAppNameL( const TDesC& appName ); void SetCloseableApp( TBool value ); - TBool SetScreenshotL(const CFbsBitmap* bitmap, UpdatePriority priority); - TBool RemoveScreenshot(); + void SetScreenshotL(const CFbsBitmap* bitmap, UpdatePriority priority); + void RemoveScreenshotL(); // takes ownership of bitmaps void SetAppIcon( CFbsBitmap* aBitmap, CFbsBitmap* aMask ); diff -r 156f692b1687 -r b99b84bcd2d1 tstaskmonitor/utils/src/tsfswentry.cpp --- a/tstaskmonitor/utils/src/tsfswentry.cpp Fri Jun 11 13:58:37 2010 +0300 +++ b/tstaskmonitor/utils/src/tsfswentry.cpp Wed Jun 23 18:33:40 2010 +0300 @@ -319,43 +319,45 @@ // CTsFswEntry::SetScreenshot // -------------------------------------------------------------------------- // -TBool CTsFswEntry::SetScreenshotL(const CFbsBitmap* bitmapArg, UpdatePriority priority) +void CTsFswEntry::SetScreenshotL(const CFbsBitmap* bitmapArg, UpdatePriority priority) { TInt currentPriority = static_cast (mPriority); TInt newPriority = static_cast (priority); - if (newPriority >= currentPriority) { - CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; - CleanupStack::PushL(bitmap); - User::LeaveIfError(bitmap->Duplicate(bitmapArg->Handle())); - CleanupStack::Pop(bitmap); + if(newPriority Duplicate(bitmapArg->Handle())); + CleanupStack::Pop(bitmap); - mPriority = priority; - delete mScreenshot; - mScreenshot = bitmap; + mPriority = priority; + delete mScreenshot; + mScreenshot = bitmap; - delete mImgTool; - mImgTool = 0; + delete mImgTool; + mImgTool = 0; - mImgTool = CTsGraphicFileScalingHandler::NewL(*this, *mScreenshot, TSize(128, 128), - CTsGraphicFileScalingHandler::EKeepAspectRatioByExpanding); - return ETrue; - } - return EFalse; + mImgTool = CTsGraphicFileScalingHandler::NewL(*this, *mScreenshot, TSize(128, 128), + CTsGraphicFileScalingHandler::EKeepAspectRatioByExpanding); } // -------------------------------------------------------------------------- // CTsFswEntry::RemoveScreenshot // -------------------------------------------------------------------------- // -TBool CTsFswEntry::RemoveScreenshot() +void CTsFswEntry::RemoveScreenshotL() { - if (mScreenshot) { - delete mScreenshot; - mScreenshot = NULL; - mPriority = Low; - return ETrue; + if (!mScreenshot) { + User::Leave(KErrNotFound); } - return EFalse; + delete mScreenshot; + mScreenshot = NULL; + mPriority = Low; + if (mObserver) { + mObserver->DataChanged(); + } } // --------------------------------------------------------------------------