--- a/activityfw/activitydatabase/bwins/hsactivitydbclientu.def Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/bwins/hsactivitydbclientu.def Fri Apr 30 15:22:08 2010 +0300
@@ -4,22 +4,25 @@
?asyncRequestCompleated@HsActivityDbClient@@UAEXHHABVQString@@@Z @ 3 NONAME ; void HsActivityDbClient::asyncRequestCompleated(int, int, class QString const &)
?trUtf8@HsActivityDbClient@@SA?AVQString@@PBD0@Z @ 4 NONAME ; class QString HsActivityDbClient::trUtf8(char const *, char const *)
?applicationActivities@HsActivityDbClient@@UAEHAAV?$QList@V?$QHash@VQString@@VQVariant@@@@@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 5 NONAME ; int HsActivityDbClient::applicationActivities(class QList<class QHash<class QString, class QVariant> > &, class QHash<class QString, class QVariant> const &)
- ?qt_metacast@HsActivityDbClient@@UAEPAXPBD@Z @ 6 NONAME ; void * HsActivityDbClient::qt_metacast(char const *)
- ?qt_metacall@HsActivityDbClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 7 NONAME ; int HsActivityDbClient::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?waitActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 8 NONAME ; int HsActivityDbClient::waitActivity(class QHash<class QString, class QVariant> const &)
- ?activities@HsActivityDbClient@@UAEHAAV?$QList@V?$QHash@VQString@@VQVariant@@@@@@@Z @ 9 NONAME ; int HsActivityDbClient::activities(class QList<class QHash<class QString, class QVariant> > &)
- ?trUtf8@HsActivityDbClient@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString HsActivityDbClient::trUtf8(char const *, char const *, int)
- ??0HsActivityDbClient@@QAE@PAVQObject@@@Z @ 11 NONAME ; HsActivityDbClient::HsActivityDbClient(class QObject *)
- ?tr@HsActivityDbClient@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString HsActivityDbClient::tr(char const *, char const *)
- ?getStaticMetaObject@HsActivityDbClient@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & HsActivityDbClient::getStaticMetaObject(void)
- ??_EHsActivityDbClient@@UAE@I@Z @ 14 NONAME ; HsActivityDbClient::~HsActivityDbClient(unsigned int)
- ?metaObject@HsActivityDbClient@@UBEPBUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const * HsActivityDbClient::metaObject(void) const
+ ?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<class QString, class QVariant> const &)
+ ?activities@HsActivityDbClient@@UAEHAAV?$QList@V?$QHash@VQString@@VQVariant@@@@@@@Z @ 10 NONAME ; int HsActivityDbClient::activities(class QList<class QHash<class QString, class QVariant> > &)
+ ?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<class QString, class QVariant> const &)
- ?tr@HsActivityDbClient@@SA?AVQString@@PBD0H@Z @ 17 NONAME ; class QString HsActivityDbClient::tr(char const *, char const *, int)
- ?addActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 18 NONAME ; int HsActivityDbClient::addActivity(class QHash<class QString, class QVariant> const &)
- ?staticMetaObject@HsActivityDbClient@@2UQMetaObject@@B @ 19 NONAME ; struct QMetaObject const HsActivityDbClient::staticMetaObject
- ??1HsActivityDbClient@@UAE@XZ @ 20 NONAME ; HsActivityDbClient::~HsActivityDbClient(void)
- ?activityRequested@HsActivityDbClient@@IAEXABVQString@@@Z @ 21 NONAME ; void HsActivityDbClient::activityRequested(class QString const &)
- ?updateActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 22 NONAME ; int HsActivityDbClient::updateActivity(class QHash<class QString, class QVariant> const &)
- ?removeActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 23 NONAME ; int HsActivityDbClient::removeActivity(class QHash<class QString, class QVariant> 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<class QString, class QVariant> 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<class QString, class QVariant> const &)
+ ?removeActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 26 NONAME ; int HsActivityDbClient::removeActivity(class QHash<class QString, class QVariant> const &)
--- a/activityfw/activitydatabase/eabi/hsactivitydbclientu.def Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/eabi/hsactivitydbclientu.def Fri Apr 30 15:22:08 2010 +0300
@@ -3,33 +3,36 @@
_ZN18HsActivityDbClient11addActivityERK5QHashI7QString8QVariantE @ 2 NONAME
_ZN18HsActivityDbClient11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME
_ZN18HsActivityDbClient11qt_metacastEPKc @ 4 NONAME
- _ZN18HsActivityDbClient12waitActivityERK5QHashI7QString8QVariantE @ 5 NONAME
- _ZN18HsActivityDbClient14launchActivityERK5QHashI7QString8QVariantE @ 6 NONAME
- _ZN18HsActivityDbClient14removeActivityERK5QHashI7QString8QVariantE @ 7 NONAME
- _ZN18HsActivityDbClient14updateActivityERK5QHashI7QString8QVariantE @ 8 NONAME
- _ZN18HsActivityDbClient16staticMetaObjectE @ 9 NONAME DATA 16
- _ZN18HsActivityDbClient17activityRequestedERK7QString @ 10 NONAME
- _ZN18HsActivityDbClient19getStaticMetaObjectEv @ 11 NONAME
- _ZN18HsActivityDbClient21applicationActivitiesER5QListI5QHashI7QString8QVariantEERKS4_ @ 12 NONAME
- _ZN18HsActivityDbClient22asyncRequestCompleatedEiiRK7QString @ 13 NONAME
- _ZN18HsActivityDbClient27removeApplicationActivitiesERK5QHashI7QString8QVariantE @ 14 NONAME
- _ZN18HsActivityDbClient7connectEv @ 15 NONAME
- _ZN18HsActivityDbClientC1EP7QObject @ 16 NONAME
- _ZN18HsActivityDbClientC2EP7QObject @ 17 NONAME
- _ZN18HsActivityDbClientD0Ev @ 18 NONAME
- _ZN18HsActivityDbClientD1Ev @ 19 NONAME
- _ZN18HsActivityDbClientD2Ev @ 20 NONAME
- _ZNK18HsActivityDbClient10metaObjectEv @ 21 NONAME
- _ZTI18HsActivityDbClient @ 22 NONAME
- _ZTV18HsActivityDbClient @ 23 NONAME
- _ZThn12_N18HsActivityDbClient22asyncRequestCompleatedEiiRK7QString @ 24 NONAME
- _ZThn8_N18HsActivityDbClient10activitiesER5QListI5QHashI7QString8QVariantEE @ 25 NONAME
- _ZThn8_N18HsActivityDbClient11addActivityERK5QHashI7QString8QVariantE @ 26 NONAME
- _ZThn8_N18HsActivityDbClient12waitActivityERK5QHashI7QString8QVariantE @ 27 NONAME
- _ZThn8_N18HsActivityDbClient14launchActivityERK5QHashI7QString8QVariantE @ 28 NONAME
- _ZThn8_N18HsActivityDbClient14removeActivityERK5QHashI7QString8QVariantE @ 29 NONAME
- _ZThn8_N18HsActivityDbClient14updateActivityERK5QHashI7QString8QVariantE @ 30 NONAME
- _ZThn8_N18HsActivityDbClient21applicationActivitiesER5QListI5QHashI7QString8QVariantEERKS4_ @ 31 NONAME
- _ZThn8_N18HsActivityDbClient27removeApplicationActivitiesERK5QHashI7QString8QVariantE @ 32 NONAME
- _ZN18HsActivityDbClient12getThumbnailER7QPixmapRK7QString @ 33 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
--- a/activityfw/activitydatabase/hsactivitydbclient/hsactivitydbclient.pro Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/hsactivitydbclient.pro Fri Apr 30 15:22:08 2010 +0300
@@ -37,12 +37,17 @@
s60/src/hsactivitydbclient_p.cpp \
s60/src/hsactivitydbasyncrequest_p.cpp
+LIBS += -lxqutils \
+ -lestor \
+ -lfbscli
+
hsactivitydbclientdll.sources = hsactivitydbclient.dll
hsactivitydbclientdll.path = $$SHARED_LIB_DIR
DEPLOYMENT += hsactivitydbclientdll
BLD_INF_RULES.prj_exports += "../inc/hsactivitydbclientinterface.h /epoc32/include/hsactivitydbclientinterface.h" \
+ "../inc/activitycmd.h /epoc32/include/activitycmd.h" \
"inc/hsactivitydbclient.h /epoc32/include/hsactivitydbclient.h" \
"inc/hsactivitydbasyncrequestobserver.h /epoc32/include/hsactivitydbasyncrequestobserver.h"
DEPLOYMENT += api
--- a/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbasyncrequestobserver.h Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbasyncrequestobserver.h Fri Apr 30 15:22:08 2010 +0300
@@ -18,6 +18,8 @@
#ifndef HSACTIVITYDBASYNCREQUESTOBSERVER_H
#define HSACTIVITYDBASYNCREQUESTOBSERVER_H
#include <QString>
+#include <QPixmap>
+
class HsActivityDbAsyncRequestObserver
{
public:
@@ -30,5 +32,16 @@
virtual void asyncRequestCompleated(int result,
int requestType,
const QString &data)=0;
+
+ /**
+ * Function inform observer about asynchronous request results
+ * @param result - request result
+ * @param requestType - request type
+ * @param pixmap - pixmap respons
+ */
+ virtual void asyncRequestCompleated(int result,
+ int requestType,
+ const QPixmap& pixmap,
+ void* userData)=0;
};
#endif // HSACTIVITYDBASYNCREQUESTOBSERVER_H
--- a/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbclient.h Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbclient.h Fri Apr 30 15:22:08 2010 +0300
@@ -62,6 +62,12 @@
/**
* Interface implementation.
+ * @see int HsActivityDbAsyncRequestObserver::asyncRequestCompleated(int, int, QPixmap&)
+ */
+ void asyncRequestCompleated(int, int, const QPixmap&, void*);
+
+ /**
+ * Interface implementation.
* @see int HsActivityDbClientInterface::saveActivity(const QVariantHash&)
*/
int addActivity(const QVariantHash &);
@@ -110,12 +116,9 @@
int launchActivity(const QVariantHash &);
/**
- * Read thumbnail from file
- * @param dst - destination QPixmap instance
- * @param src - thumbnail file path
- * @return 0 on success, error code otherwise
*/
- int getThumbnail(QPixmap &dst, const QString & src);
+ //getThumbnail(resolution, thumbnailPath, "image/png", data)
+ int getThumbnail(QSize size, QString imagePath, QString mimeType, void* userDdata);
signals:
/**
@@ -123,12 +126,21 @@
* @param activityId - requested activity name
*/
void activityRequested(const QString &activityId);
+
+ /**
+ * Function notify about runtime activity change
+ * @param thumbnailPixmap - requested thumbnail
+ */
+ void thumbnailRequested(QPixmap thumbnailPixmap, void *userData);
+
private:
/**
* Private client implementation.
* Own.
*/
HsActivityDbClientPrivate *d_ptr;
+
+ friend class HsActivityDbClientPrivate;
};
#endif //HSACTIVITYDBCLIENT_H
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbasyncrequest_p.h Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbasyncrequest_p.h Fri Apr 30 15:22:08 2010 +0300
@@ -18,7 +18,9 @@
#define HSACTIVITYDBASYNCREQUESTPRIVATE_H
#include <e32base.h>
#include <QVariant>
+#include <QPixmap>
#include <hsactivitydbasyncrequestobserver.h>
+#include <activitycmd.h>
class HsActivityDbClientPrivate;
@@ -29,17 +31,36 @@
{
public:
+
+ enum TAsyncRequest{
+ EWaitActivity = WaitActivity,
+ EWaitGetThumbnail = GetThumbnail
+ };
+
+private:
/**
* First step constructor
*/
static HsActivityDbAsyncRequestPrivate*
- NewL(HsActivityDbAsyncRequestObserver &, HsActivityDbClientPrivate &);
-
- /**
- * First step constructor
- */
+ NewL(HsActivityDbAsyncRequestObserver &,
+ HsActivityDbClientPrivate &,
+ TAsyncRequest,
+ void* userData = 0);
+
+public:
+
static HsActivityDbAsyncRequestPrivate*
- NewLC(HsActivityDbAsyncRequestObserver &, HsActivityDbClientPrivate &);
+ newWaitActivityL(HsActivityDbAsyncRequestObserver &,
+ HsActivityDbClientPrivate &);
+
+ static void
+ getThumbnailLD(HsActivityDbAsyncRequestObserver &observer,
+ HsActivityDbClientPrivate &session,
+ QSize size,
+ QString imagePath,
+ QString mimeType,
+ void *userDdata);
+
/**
* Destructor
@@ -51,6 +72,15 @@
* @param condition - activity filetering rules
*/
void waitActivity(const QVariantHash &condition);
+private:
+ /**
+ */
+ void getThumbnail(QSize size, QString imagePath, QString mimeType);
+
+ /**
+ */
+ QPixmap copyPixmap(CFbsBitmap* bitmap);
+
protected:
/**
* Interface implementation.
@@ -67,13 +97,20 @@
/**
* Constructor
*/
- HsActivityDbAsyncRequestPrivate(HsActivityDbAsyncRequestObserver &,
- HsActivityDbClientPrivate &);
+ HsActivityDbAsyncRequestPrivate(HsActivityDbAsyncRequestObserver &,
+ HsActivityDbClientPrivate &,
+ TAsyncRequest,
+ void* userData);
private:
HsActivityDbAsyncRequestObserver &mObserver;
HsActivityDbClientPrivate &mSession;
- int mRequestType;
+ const TAsyncRequest mRequestType;
+ TPckgBuf<int> mTaskId;
+ TPckgBuf<int> mDataSize;
+ TPckgBuf<int> mBitmapId;
+ HBufC* mBitmapPath;
+ HBufC8* mBitmapMimeType;
RBuf8 mDataBuf;
- TPckgBuf<int> mDataSize;
+ void *const mUserData;
};
#endif // HSACTIVITYDBCLIENTPRIVATE_H
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h Fri Apr 30 15:22:08 2010 +0300
@@ -72,12 +72,6 @@
/**
* Interface implementation.
- * @see int HsActivityDbClientInterface::requestedActivityName(QString &, const QVariantHash &);
- */
- int requestedActivityName(QString &, const QVariantHash &);
-
- /**
- * Interface implementation.
* @see int HsActivityDbClientInterface::activities(QList<QVariantHash> &);
*/
int activities(QList<QVariantHash> &);
@@ -93,6 +87,8 @@
* @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &)
*/
int waitActivity(const QVariantHash &activity);
+
+ int getThumbnail(QSize size, QString imagePath, QString mimeType, void *userDdata);
/**
* Interface implementation.
@@ -106,20 +102,13 @@
*/
int cancelWaitActivity();
- /**
- * Read thumbnail from file
- * @param dst - destination QPixmap instance
- * @param src - thumbnail file path
- * @return 0 on success, error code otherwise
- */
- int getThumbnail(QPixmap &dst, const QString & src);
-
public:
/**
* Function get cached data from server
+ * @param taskId - request task id
* @param dst - destination, preallocated buffer
*/
- void getData(RBuf8 &dst);
+ void getData(int taskId, RBuf8 &dst);
/**
* Function initialize aync request
@@ -128,6 +117,13 @@
* @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:
/**
@@ -175,12 +171,15 @@
const QVariantHash &cond);
void waitActivityL(const QVariantHash &activity);
+
+ void getThumbnailL(QSize size, QString imagePath, QString mimeType, void *userDdata);
private:
/**
* Async request handler
* Own
*/
HsActivityDbAsyncRequestPrivate *mAsyncDataHandler;
-
+ RPointerArray<HsActivityDbAsyncRequestPrivate> mAsyncTasks;
+ HsActivityDbAsyncRequestObserver& mObserver;
};
#endif // HSACTIVITYDBCLIENTPRIVATE_H
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbasyncrequest_p.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbasyncrequest_p.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -17,46 +17,70 @@
#include "hsactivitydbasyncrequest_p.h"
#include "hsactivitydbclient_p.h"
-#include "hsserializer.h"
+#include "hsactivitydbclient.h"
+#include <fbs.h>
+#include <xqconversions>
+
+
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
HsActivityDbAsyncRequestPrivate*
HsActivityDbAsyncRequestPrivate::NewL(HsActivityDbAsyncRequestObserver &observer,
- HsActivityDbClientPrivate &session)
+ HsActivityDbClientPrivate &session,
+ TAsyncRequest requestType,
+ void* userData)
{
- HsActivityDbAsyncRequestPrivate *self =
- HsActivityDbAsyncRequestPrivate::NewLC(observer, session);
+ HsActivityDbAsyncRequestPrivate *self =
+ new(ELeave)HsActivityDbAsyncRequestPrivate(observer, session, requestType, userData);
+ CleanupStack::PushL(self);
+ self->mDataBuf.CreateL(64);
CleanupStack::Pop(self);
return self;
}
+
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
HsActivityDbAsyncRequestPrivate*
-HsActivityDbAsyncRequestPrivate::NewLC(HsActivityDbAsyncRequestObserver &observer,
- HsActivityDbClientPrivate &session)
+HsActivityDbAsyncRequestPrivate::newWaitActivityL(HsActivityDbAsyncRequestObserver & observer,
+ HsActivityDbClientPrivate & session)
+ {
+ return HsActivityDbAsyncRequestPrivate::NewL(observer, session, EWaitActivity);
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void HsActivityDbAsyncRequestPrivate::getThumbnailLD(HsActivityDbAsyncRequestObserver &observer,
+ HsActivityDbClientPrivate &session,
+ QSize size,
+ QString imagePath,
+ QString mimeType,
+ void *userDdata)
{
- HsActivityDbAsyncRequestPrivate *self =
- new(ELeave)HsActivityDbAsyncRequestPrivate(observer, session);
- CleanupStack::PushL(self);
- self->mDataBuf.CreateL(64);
- return self;
+ HsActivityDbAsyncRequestPrivate *instance =
+ HsActivityDbAsyncRequestPrivate::NewL(observer, session, EWaitGetThumbnail, userDdata);
+ instance->getThumbnail( size, imagePath, mimeType);
}
+
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
HsActivityDbAsyncRequestPrivate::HsActivityDbAsyncRequestPrivate(HsActivityDbAsyncRequestObserver &observer,
- HsActivityDbClientPrivate &session)
+ HsActivityDbClientPrivate &session,
+ TAsyncRequest requestType,
+ void* userData)
:
CActive(EPriorityStandard),
mObserver(observer),
mSession(session),
- mRequestType(-1),
- mDataSize()
+ mRequestType(requestType),
+ mUserData(userData)
{
CActiveScheduler::Add(this);
}
@@ -69,6 +93,8 @@
{
mDataBuf.Close();
Cancel();
+ delete mBitmapPath;
+ delete mBitmapMimeType;
}
// -----------------------------------------------------------------------------
@@ -88,21 +114,36 @@
//
void HsActivityDbAsyncRequestPrivate::RunL()
{
- RBuf8 buff;
- CleanupClosePushL(buff);
- QString data;
int requestResult(iStatus.Int());
if (KErrNone == requestResult) {
- if (0 < mDataSize()) {
- buff.CreateL(mDataSize());
+ switch (mRequestType){
+ case WaitActivity: {
+ RBuf8 buff;
+ CleanupClosePushL(buff);
+ QString data;
+ if (0 < mDataSize()) {
+ buff.CreateL(mDataSize());
+ }
+ mSession.getData(mTaskId(), buff);
+ data = QString::fromAscii(reinterpret_cast<const char *>(buff.Ptr()),
+ buff.Length());
+ buff.Close();
+ mObserver.asyncRequestCompleated(requestResult, mRequestType, data);
+ CleanupStack::PopAndDestroy(&buff);
+ break;
+ }
+ case EWaitGetThumbnail: {
+ CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+ CleanupStack::PushL(bitmap);
+ User::LeaveIfError(bitmap->Duplicate(mBitmapId()));
+ mSession.getData(mTaskId(), mDataBuf);//ACK Bitmap copy
+ mObserver.asyncRequestCompleated(requestResult, mRequestType, QPixmap::fromSymbianCFbsBitmap(bitmap), mUserData);
+ CleanupStack::PopAndDestroy(bitmap);
+ break;
+ }
}
- mSession.getData(buff);
- data = QString::fromAscii(reinterpret_cast<const char *>(buff.Ptr()),
- buff.Length());
- buff.Close();
+ mSession.Pop(this);
}
- mObserver.asyncRequestCompleated(requestResult, mRequestType, data);
- CleanupStack::PopAndDestroy(&buff);
}
// -----------------------------------------------------------------------------
@@ -111,9 +152,25 @@
//
void HsActivityDbAsyncRequestPrivate::waitActivity(const QVariantHash &condition)
{
- mRequestType = WaitActivity;
iStatus = KRequestPending;
SetActive();
- mDataBuf << condition;
- mSession.sendDataAsync(mRequestType, TIpcArgs(&mDataBuf, &mDataSize), iStatus);
+ mDataSize = condition.find(ActivityApplicationKeyword).value().toInt();
+ TPtrC8 actId(KNullDesC8);
+ TPtrC8 desc(KNullDesC8);
+ mSession.sendDataAsync(mRequestType, TIpcArgs(&mDataSize, &actId, &desc, &mTaskId), iStatus);
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void HsActivityDbAsyncRequestPrivate::getThumbnail(QSize size, QString imagePath, QString mimeType)
+{
+ iStatus = KRequestPending;
+ SetActive();
+ mBitmapId = size.width();
+ mTaskId = size.height();
+ mBitmapPath = XQConversions::qStringToS60Desc(imagePath);
+ mBitmapMimeType = XQConversions::qStringToS60Desc8(mimeType);
+ mSession.sendDataAsync(mRequestType, TIpcArgs(&mBitmapId, &mTaskId, mBitmapPath, mBitmapMimeType), iStatus);
+}
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbclient_p.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbclient_p.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -20,15 +20,18 @@
#include "hsactivityglobals.h"
#include "hsserializer.h"
#include <qvariant.h>
+#include <xqconversions>
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
-HsActivityDbClientPrivate::HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver &observer)
+HsActivityDbClientPrivate::HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver &observer):
+ mObserver(observer)
{
- mAsyncDataHandler = HsActivityDbAsyncRequestPrivate::NewL(observer, *this);
+ mAsyncDataHandler = HsActivityDbAsyncRequestPrivate::newWaitActivityL(
+ observer, *this);
}
// -----------------------------------------------------------------------------
@@ -37,6 +40,7 @@
//
HsActivityDbClientPrivate::~HsActivityDbClientPrivate()
{
+ mAsyncTasks.ResetAndDestroy();
delete mAsyncDataHandler;
Close();
}
@@ -57,7 +61,11 @@
//
int HsActivityDbClientPrivate::addActivity(const QVariantHash &activity)
{
- TRAPD(errNo, execSimpleRequestL(AddActivity, activity);)
+ int errNo(KErrCorrupt);
+ if (activity.end() != activity.find(ActivityApplicationKeyword) &&
+ activity.end() != activity.find(ActivityActivityKeyword)) {
+ TRAP(errNo, execSimpleRequestL(AddActivity, activity);)
+ }
return errNo;
}
@@ -67,7 +75,11 @@
//
int HsActivityDbClientPrivate::updateActivity(const QVariantHash &activity)
{
- TRAPD(errNo, execSimpleRequestL(UpdateActivity, activity);)
+ int errNo(KErrCorrupt);
+ if (activity.end() != activity.find(ActivityApplicationKeyword) &&
+ activity.end() != activity.find(ActivityActivityKeyword)) {
+ TRAP(errNo, execSimpleRequestL(UpdateActivity, activity);)
+ }
return errNo;
}
@@ -77,7 +89,11 @@
//
int HsActivityDbClientPrivate::removeActivity(const QVariantHash &activity)
{
- TRAPD(errNo, execSimpleRequestL(RemoveActivity, activity);)
+ int errNo(KErrCorrupt);
+ if (activity.end() != activity.find(ActivityApplicationKeyword) &&
+ activity.end() != activity.find(ActivityActivityKeyword)) {
+ TRAP(errNo, execSimpleRequestL(RemoveActivity, activity);)
+ }
return errNo;
}
@@ -87,7 +103,10 @@
//
int HsActivityDbClientPrivate::removeApplicationActivities(const QVariantHash &activity)
{
- TRAPD(errNo, execSimpleRequestL(RemoveApplicationActivities, activity);)
+ int errNo(KErrCorrupt);
+ if (activity.end() != activity.find(ActivityApplicationKeyword)) {
+ TRAP(errNo, execSimpleRequestL(RemoveApplicationActivities, activity);)
+ }
return errNo;
}
@@ -127,6 +146,16 @@
//
// -----------------------------------------------------------------------------
//
+int HsActivityDbClientPrivate::getThumbnail(QSize size, QString imagePath, QString mimeType, void *userDdata)
+{
+ TRAPD(errNo, getThumbnailL(size, imagePath, mimeType, userDdata);)
+ return errNo;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
int HsActivityDbClientPrivate::launchActivity(const QVariantHash &activity)
{
TRAPD(errNo, execSimpleRequestL(LaunchActivity, activity);)
@@ -174,7 +203,7 @@
//
void HsActivityDbClientPrivate::connectL()
{
- const int asyncMessageSlots(4);
+ const int asyncMessageSlots(12);
const int maxRetry(4);
TInt retry = maxRetry;
@@ -200,34 +229,17 @@
//
void HsActivityDbClientPrivate::execSimpleRequestL(int function, const QVariantHash &activity)
{
+ TPckgBuf<TInt> appId( activity.find(ActivityApplicationKeyword).value().toInt() );
+ HBufC8 *actId = XQConversions::qStringToS60Desc8(activity.find(ActivityActivityKeyword).value().toString());
+ CleanupStack::PushL(actId);
+ TPckgBuf<TInt> taskId(0);
RBuf8 data;
CleanupClosePushL(data);
data.CreateL(256);
data << activity;
- User::LeaveIfError(SendReceive(function, TIpcArgs(&data)));
+ User::LeaveIfError(SendReceive(function, TIpcArgs(&appId, actId, &data, &taskId)));
CleanupStack::PopAndDestroy(&data);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbClientPrivate::requestedActivityNameL(QString &result,
- const QVariantHash &activity)
-{
- RBuf8 data;
- TPckgBuf<int> sizeBuf;
- CleanupClosePushL(data);
- data.CreateL(256);
- data << activity;
- User::LeaveIfError(SendReceive(RequestedActivityName, TIpcArgs(&data,&sizeBuf)));
- if (sizeBuf() > data.MaxSize()) {
- data.ReAlloc(sizeBuf());
- }
- User::LeaveIfError(SendReceive(GetData, TIpcArgs(&data)));
- result = QString::fromAscii(reinterpret_cast<const char *>(data.Ptr()),
- data.Length());
- CleanupStack::PopAndDestroy(&data);
+ CleanupStack::PopAndDestroy(actId);
}
// -----------------------------------------------------------------------------
@@ -236,15 +248,19 @@
//
void HsActivityDbClientPrivate::activitiesL(QList<QVariantHash>& result)
{
+ TPckgBuf<TInt> appId(0);
+ TPtrC8 actId(KNullDesC8);
+ TPtrC8 desc(KNullDesC8);
+ TPckgBuf<TInt> taskId(0);
+ User::LeaveIfError(SendReceive(Activities,
+ TIpcArgs(&appId, &actId, &desc, &taskId)));
+
+ int sizeBuf(appId());
RBuf8 data;
- TPckgBuf<int> sizeBuf;
CleanupClosePushL(data);
- data.CreateL(256);
- User::LeaveIfError(SendReceive(Activities, TIpcArgs(&data, &sizeBuf)));
- if (sizeBuf() > data.MaxSize()) {
- data.ReAlloc(sizeBuf());
- }
- User::LeaveIfError(SendReceive(GetData, TIpcArgs(&data)));
+ data.Create(sizeBuf);
+ User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &data)));
+
result << data;
CleanupStack::PopAndDestroy(&data);
}
@@ -256,16 +272,19 @@
void HsActivityDbClientPrivate::applicationActivitiesL(QList<QVariantHash>& result,
const QVariantHash & condition)
{
+ TPckgBuf<TInt> appId = condition.find(ActivityApplicationKeyword).value().toInt();
+ TPtrC8 actId(KNullDesC8);
+ TPtrC8 desc(KNullDesC8);
+ TPckgBuf<TInt> taskId(0);
+ User::LeaveIfError(SendReceive(ApplicationActivities,
+ TIpcArgs(&appId, &actId, &desc, &taskId)));
+
+ int sizeBuf(appId());
RBuf8 data;
- TPckgBuf<int> sizeBuf;
CleanupClosePushL(data);
- data.CreateL(256);
- data << condition;
- User::LeaveIfError(SendReceive(ApplicationActivities, TIpcArgs(&data, &sizeBuf)));
- if (sizeBuf() > data.MaxSize()) {
- data.ReAlloc(sizeBuf());
- }
- User::LeaveIfError(SendReceive(GetData, TIpcArgs(&data)));
+ data.Create(sizeBuf);
+ User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &data)));
+
result << data;
CleanupStack::PopAndDestroy(&data);
}
@@ -287,9 +306,20 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivityDbClientPrivate::getData(RBuf8 &data)
+void HsActivityDbClientPrivate::getThumbnailL(QSize size, QString imagePath, QString mimeType, void *userDdata)
{
- SendReceive(GetData, TIpcArgs(&data));
+ HsActivityDbAsyncRequestPrivate::getThumbnailLD(mObserver,
+ *this, size, imagePath, mimeType, userDdata);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void HsActivityDbClientPrivate::getData(int taskId, RBuf8 &data)
+{
+ TPckgBuf<int> requestId(taskId);
+ SendReceive(GetData, TIpcArgs(&requestId, &data));
}
// -----------------------------------------------------------------------------
@@ -307,21 +337,21 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityDbClientPrivate::getThumbnail(QPixmap &dst, const QString & src)
+void HsActivityDbClientPrivate::PushL(HsActivityDbAsyncRequestPrivate * task)
{
- RBuf8 data;
- QVariantHash thumbnailRequest;
- thumbnailRequest.insert(ActivityScreenshotKeyword, src);
- TPckgBuf<int> sizeBuf(0);
- CleanupClosePushL(data);
- data.CreateL(256);
- data << thumbnailRequest;
- User::LeaveIfError(SendReceive(GetThumbnail, TIpcArgs(&data, &sizeBuf)));
- if (sizeBuf() > data.MaxSize()) {
- data.ReAlloc(sizeBuf());
+ (KErrNotFound == mAsyncTasks.Find(task)) ?
+ mAsyncTasks.AppendL(task):
+ User::Leave(KErrAlreadyExists);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void HsActivityDbClientPrivate::Pop(HsActivityDbAsyncRequestPrivate *task)
+{
+ const TInt offset(mAsyncTasks.Find(task));
+ if (KErrNotFound != offset) {
+ mAsyncTasks.Remove(offset);
}
- User::LeaveIfError(SendReceive(GetData, TIpcArgs(&data)));
- dst << data;
- CleanupStack::PopAndDestroy(&data);
- return 0;
}
--- a/activityfw/activitydatabase/hsactivitydbclient/src/hsactivitydbclient.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/src/hsactivitydbclient.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -68,6 +68,24 @@
//
// -----------------------------------------------------------------------------
//
+void HsActivityDbClient::asyncRequestCompleated(int result,
+ int requestType,
+ const QPixmap& pixmap,
+ void* userData)
+{
+ switch (requestType) {
+ case GetThumbnail:
+ if (KErrNone == result) {
+ emit thumbnailRequested(pixmap, userData);
+ }
+ break;
+ }
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
int HsActivityDbClient::addActivity(const QVariantHash &activity)
{
return d_ptr->addActivity(activity);
@@ -141,7 +159,8 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityDbClient::getThumbnail(QPixmap &dst, const QString & src)
+//int HsActivityDbClient::getThumbnail(const QVariantHash &condition)
+int HsActivityDbClient::getThumbnail(QSize size, QString imagePath, QString mimeType, void* userDdata)
{
- return d_ptr->getThumbnail(dst, src);
+ return d_ptr->getThumbnail(size, imagePath, mimeType, userDdata);
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/group/bld.inf Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+hsactivitydbserver.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/group/hsactivitydbserver.mmp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+TARGET hsactivitydbserver.exe
+TARGETTYPE exe
+UID 0 0x200267B4
+
+SYSTEMINCLUDE /epoc32/include
+
+USERINCLUDE ../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 activitygraphicfilescaling.cpp
+SOURCE activitythumbnailtask.cpp
+
+LIBRARY euser.lib
+LIBRARY estor.lib
+LIBRARY edbms.lib
+LIBRARY efsrv.lib
+LIBRARY bafl.lib
+LIBRARY fbscli.lib
+LIBRARY bitmaptransforms.lib
+LIBRARY imageconversion.lib
+
+CAPABILITY ALL -TCB
+EPOCHEAPSIZE 0x100000 0x600000 // 1MB - 6MB
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE_UDEBONLY
+#endif
\ No newline at end of file
--- a/activityfw/activitydatabase/hsactivitydbserver/hsactivitydbserver.pro Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/hsactivitydbserver.pro Fri Apr 30 15:22:08 2010 +0300
@@ -11,46 +11,10 @@
#
# Contributors:
#
-# Description:
+# Description:
#
-TEMPLATE = app
-TARGET = hsactivitydbserver
-
-QT += core \
- gui \
- sql
-
-HEADERS += ../inc/hsactivitydbclientinterface.h \
- inc/hsactivity.h \
- inc/hsactivityserver.h \
- inc/hsactivitystorage.h \
- inc/hsactivitystorage_p.h
-
-SOURCES += src/hsactivityserver.cpp \
- src/hsactivitystorage.cpp \
- src/hsactivitystorage_p.cpp
+TEMPLATE = subdirs
-symbian{
-TARGET.UID3 = 0x200267B4
-HEADERS += ../s60/inc/hsactivityglobals.h \
- ../s60/inc/hsserializer.h \
- s60/inc/hsactivityserver_p.h \
- s60/inc/hsactivitysession_p.h
-
-
-SOURCES += s60/src/main.cpp \
- ../s60/src/hsserializer.cpp \
- s60/src/hsactivityserver_p.cpp \
- s60/src/hsactivitysession_p.cpp
-
-LIBS += -lcone -lavkon -leikcore -leiksrv -lapparc -lws32 -lapgrfx
-
-TARGET.CAPABILITY = ALL -TCB
-
-myrssrules = \
-"hidden = KAppIsHidden;"
-RSS_RULES += myrssrules
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include \"group/bld.inf\""
-}
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitybroadcasttask.h Fri Apr 30 15:22:08 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 ACTIVITYBROADCASTTASK_H
+#define ACTIVITYBROADCASTTASK_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+#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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitydataprovidertask.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef ACTIVITYDATAPROVIDERTASK_H
+#define ACTIVITYDATAPROVIDERTASK_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+#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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitygraphicfilescaling.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description :
+ *
+ */
+#ifndef ACTIVITYGRAPHICFILESSCALING_H
+#define ACTIVITYGRAPHICFILESSCALING_H
+
+#ifndef __E32SVR_H__
+#define __E32SVR_H__
+#endif
+
+
+#ifndef SYMBIAN_ENABLE_PUBLIC_PLATFORM_HEADER_SPLIT
+#define SYMBIAN_ENABLE_PUBLIC_PLATFORM_HEADER_SPLIT
+#endif
+
+#include <bitmaptransforms.h>
+
+class CImageDecoder;
+class CFbsBitmap;
+
+class MImageReadyCallBack
+{
+public:
+ virtual void ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap ) = 0;
+};
+
+class CGraphicsSalingHandler : public CActive
+{
+public:
+
+enum TCurrentOperation{
+ ENone = 0,
+ EConvertBitmapFromFile = 1,
+ EScale = 2
+ };
+
+enum TKindOfScaling
+{
+ EIgnoreAspectRatio = 0,
+ EKeepAspectRatio = 1,
+ EKeepAspectRatioByExpanding = 2,
+};
+
+ ~CGraphicsSalingHandler();
+
+ static CGraphicsSalingHandler* NewL(MImageReadyCallBack &aNotify, RFs &aFs, const TDesC &aFileName, const TDesC8& aMimeType, const TSize &aNewSize, TKindOfScaling aKindOfScaling);
+ static CGraphicsSalingHandler* NewLC(MImageReadyCallBack &aNotify, RFs &aFs, const TDesC &aFileName, const TDesC8& aMimeType, const TSize &aNewSize, TKindOfScaling aKindOfScaling);
+
+protected:
+ void DoCancel();
+ void RunL();
+ TInt RunError(TInt);
+
+private:
+ void ConstructL(RFs &aFs, const TDesC &aFileName, const TDesC8& aMimeType);
+ CGraphicsSalingHandler(MImageReadyCallBack &aNotify, const TSize &aNewSize, TKindOfScaling aKindOfScaling);
+ TSize Scaling();
+
+private:
+ MImageReadyCallBack &mNotify;
+ CImageDecoder *mImageDecoder;
+ CFbsBitmap *mBitmapFromFile;
+ CFbsBitmap *mBitmapOutput;
+ CBitmapScaler *mBitmapScaler;
+ TSize mNewSize;
+ TBool mKindOfScaling;
+
+ TCurrentOperation mCurrentOperation;
+};
+
+#endif // ACTIVITYGRAPHICFILESSCALING_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activityobservertask.h Fri Apr 30 15:22:08 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 ACTIVITYOBSERVERTASK_H
+#define ACTIVITYOBSERVERTASK_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+#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();
+
+private:
+ MActivityTaskStorage& mGlobalStorage;
+ MActivityTaskStorage& mLocalStorage;
+ const RMessage2 mMsg;
+ RBuf8 mData;
+};
+
+#endif // ACTIVITYOBSERVERTASK_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activityqueries.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef ACTIVITYQUERIES_H
+#define ACTIVITYQUERIES_H
+
+
+#include <e32base.h>
+
+_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
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activityserver.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <e32std.h>
+#include <e32base.h>
+#include <f32file.h> // 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<CActivityTask>& 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;
+
+private:
+ RFs mFsSession;
+ CActivityStorage* mStorage;
+ RPointerArray<CActivityTask> mObservers;
+};
+
+#endif // ACTIVITYSERVER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitysession.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <e32std.h>
+#include <e32base.h>
+#include <f32file.h>
+
+#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<CActivityTask>& StorageData() const;
+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<CActivityTask> mRunningTasks;
+};
+
+#endif // ACTIVITYSESSION_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitystorage.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,196 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <e32std.h>
+#include <e32base.h>
+#include <d32dbms.h> // RDbStoreDatabase
+#include <s32file.h> // 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitystorageasynctask.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef ACTIVITYSTORAGEASYNCTASK_H
+#define ACTIVITYSTORAGEASYNCTASK_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+#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);
+
+private:
+ RBuf8 mData;
+};
+
+#endif // ACTIVITYSTORAGEASYNCTASK_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitystoragesynctask.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef ACTIVITYSTORAGESYNCTASK_H
+#define ACTIVITYSTORAGESYNCTASK_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+#include "activitytask.h"
+#include "activitystorage.h"
+
+/**
+ * CActivityStorageSyncTask
+ *
+ */
+class ActivityStorageSyncTask
+ {
+public:
+ /**
+ * Handle synchronous data storage requests
+ * @param dataStorage - data storage
+ * @param msg - request message
+ */
+ static void ExecuteL(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);
+
+ };
+
+#endif // ACTIVITYSTORAGESYNCTASK_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitytask.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef 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;
+};
+
+#endif //ACTIVITYTASK_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitytaskstorage.h Fri Apr 30 15:22:08 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 ACTIVITYTASKSTORAGE_H
+#define ACTIVITYTASKSTORAGE_H
+#include <e32base.h>
+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<CActivityTask>& StorageData() const =0;
+};
+
+#endif //ACTIVITYTASKSTORAGE_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/activitythumbnailtask.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef ACTIVITYTHUMBNAILTASK_H
+#define ACTIVITYTHUMBNAILTASK_H
+
+#ifndef __E32SVR_H__
+#define __E32SVR_H__
+#endif
+
+#include <e32std.h>
+#include <e32base.h>
+#include <f32file.h>
+
+#include "activitytask.h"
+#include "activitytaskstorage.h"
+#include "activitygraphicfilescaling.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& );
+
+private:
+ MActivityTaskStorage& mStorage;
+ const RMessage2 mMsg;
+ CBase* mService;
+ };
+
+#endif // ACTIVITYTHUMBNAILTASK_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivity.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +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 HSACTIVITY_H
-#define HSACTIVITY_H
-
-
-const char ActivityOrganization [] = "nokia";
-
-const char ActivityApplication [] = "hsactivitydbserver";
-
-const char ActivityStorageDriver [] = "QSQLITE";
-
-const char ActivityStorageName [] = "ActivitySQLClient";
-
-const char ActivityStorageProperty [] = "activitydatabase";
-
-const char ActivityDefaultStorage [] = "activitydatabase.db";
-
-const char ActivityTableKeyword [] = ":Table";
-const char ActivityDataKeyword [] = ":Data";
-
-
-
-const char ActivityCreateQuery [] = "CREATE TABLE Activities(" \
- "ApplicationId INTEGER NOT NULL," \
- "ActivityName TEXT NOT NULL," \
- "Data BLOB NOT NULL," \
- "PRIMARY KEY ( ApplicationId, ActivityName ) )";
-
-const char ActivityDropQuery [] = "DROP TABLE :Table";
-
-const char ActivitySelectActivityQuery [] = "SELECT ApplicationId FROM Activities WHERE " \
- "ApplicationId = :ApplicationId AND " \
- "ActivityName = :ActivityName";
-
-const char ActivityUpdateActivityQuery [] = "UPDATE Activities SET Data = :Data WHERE " \
- "ApplicationId = :ApplicationId AND " \
- "ActivityName = :ActivityName";
-
-const char ActivityInsertActivityQuery [] = "INSERT INTO Activities( ApplicationId, ActivityName, Data ) VALUES " \
- "( :ApplicationId, :ActivityName, :Data )";
-
-const char ActivitySelectActiveQuery [] = "SELECT ActivityName FROM Activities WHERE " \
- "ApplicationId = :ApplicationId";
-
-const char ActivityActivitiesQuery [] = "SELECT Data FROM Activities";
-
-const char ActivityApplicationActivitiesQuery [] = "SELECT Data FROM Activities " \
- "WHERE ApplicationId = :ApplicationId";
-
-const char ActivityDeleteActivityQuery [] = "DELETE FROM Activities WHERE " \
- "ApplicationId = :ApplicationId AND " \
- "ActivityName = :ActivityName";
-
-const char ActivityDeleteApplicationActivitiesQuery [] = "DELETE FROM Activities WHERE " \
- "ApplicationId = :ApplicationId";
-
-#endif //HSACTIVITY_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivityserver.h Fri Apr 16 14:45:49 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:
-*
-*/
-
-#ifndef HSACTIVITYSERVER_H
-#define HSACTIVITYSERVER_H
-
-#include "hsactivitydbclientinterface.h"
-
-class HsActivityServerPrivate;
-
-/**
- * Class implemets server functionality to store and retrieve activity
- */
-class HsActivityServer
-{
-public:
- /**
- * Constructor
- * @param storage - reference to initialized activity storage
- */
- HsActivityServer(HsActivityDbClientInterface &storage);
-
- /**
- * Destructor
- */
- ~HsActivityServer();
-
- /**
- * Function establish server and initialize listening proces
- * @return true on succees, false otherwise
- */
- bool start();
-private:
- /**
- * Private server implementation
- */
- HsActivityServerPrivate *d_ptr;
-};
-
-#endif //HSACTIVITYSERVER_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivitystorage.h Fri Apr 16 14:45:49 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:
-*
-*/
-#ifndef HSACTIVITYSTORAGE_H
-#define HSACTIVITYSTORAGE_H
-#include "hsactivitydbclientinterface.h"
-class HsActivityStoragePrivate;
-
-/**
- * Class implements HsActivityDbClientInterface and storage functionality
- */
-class HsActivityStorage: public HsActivityDbClientInterface
-{
-public:
- /**
- * Constructor
- */
- HsActivityStorage();
-
- /**
- * Destructor
- */
- ~HsActivityStorage();
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::addActivity(const QVariantHash&)
- */
- int addActivity(const QVariantHash &activity);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash&)
- */
- int updateActivity(const QVariantHash &activity);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::removeActivity(const QVariantHash &)
- */
- int removeActivity(const QVariantHash &activity);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::removeApplicationActivities(const QVariantHash &)
- */
- int removeApplicationActivities(const QVariantHash &activity);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::activities(QList<QVariantHash> &)
- */
- int activities(QList<QVariantHash>& result);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::applicationActivities(QList<QVariantHash> &, const QVariantHash &)
- */
- int applicationActivities(QList<QVariantHash>& result,
- const QVariantHash &activity);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &)
- */
- int waitActivity(const QVariantHash &activity);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &)
- */
- int launchActivity(const QVariantHash &activity);
-private:
- /**
- * Private storage implementation
- * Own.
- */
- HsActivityStoragePrivate *d_ptr;
-};
-#endif //HSACTIVITYSTORAGE_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivitystorage_p.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +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 HSACTIVITYSTORAGEPRIVATE_H
-#define HSACTIVITYSTORAGEPRIVATE_H
-#include "hsactivitydbclientinterface.h"
-#include <QSqlDatabase>
-
-/**
- * Class implements HsActivityDbClientInterface and storage functionality using
- * database subsystem
- */
-class HsActivityStoragePrivate: public HsActivityDbClientInterface
-{
-public:
- /**
- * Constructor
- */
- HsActivityStoragePrivate();
-
- /**
- * Destructor
- */
- ~HsActivityStoragePrivate();
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::addActivity(const QVariantHash&)
- */
- int addActivity(const QVariantHash &);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash&)
- */
- int updateActivity(const QVariantHash &);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::removeActivity(const QVariantHash &)
- */
- int removeActivity(const QVariantHash &activity);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::removeApplicationActivities(const QVariantHash &)
- */
- int removeApplicationActivities(const QVariantHash &activity);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::requestedActivityName( QString &, const QVariantHash &)
- */
- int requestedActivityName(QString &result,
- const QVariantHash &activity);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::activities(QList<QVariantHash> &)
- */
- int activities(QList<QVariantHash> &);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::applicationActivities(QList<QVariantHash> &, const QVariantHash &)
- */
- int applicationActivities(QList<QVariantHash> &, const QVariantHash &);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &)
- */
- int waitActivity(const QVariantHash &activity);
-
- /**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &)
- */
- int launchActivity(const QVariantHash &activity);
-private:
- /**
- * Function check database structure
- * @return true if structure is valid, false otherwise
- */
- bool checkTables();
-
- /**
- * Function create database structure
- */
- void recreateTables();
-
- /**
- * Function return last SQL query error code
- * @param querty - executed sql query
- * @return SQL query error code
- */
- int getSqlErrorCode(const QSqlQuery &query);
-
- /**
- * Function exeute SQL query
- * @param query - SQL
- * @return true on succees, false otherwise
- */
- bool exec(QSqlQuery &query);
-
- /**
- * Function exeute SQL query
- * @param query - SQL query that has to be executed
- * @return true on succees, false otherwise
- */
- bool exec(const QString &query, const QVariantHash ¶ms);
-
- /**
- * Funciton bind provided filtering rules with prepared SQL query
- * @param query - SQL query
- * @param activity - filtering rules
- * @param additionalData - additional filetering rules
- */
- void bind(QSqlQuery &query,
- const QVariantHash &activity,
- const QVariantHash &additionalData = QVariantHash());
-
- /**
- * Funciton get records that match conditions
- * @param result - output destination
- * @param query - SQL query sting
- * @param conditions - query conditions
- */
- int activities(QList<QVariantHash> &results,
- const QString &query,
- const QVariantHash &conditions);
-
-private:
- /**
- * Connectioin to SQL engine
- */
- QSqlDatabase mConn;
-};
-#endif //HSACTIVITYSTORAGEPRIVATE_H
--- a/activityfw/activitydatabase/hsactivitydbserver/s60/inc/hsactivityserver_p.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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 HSACTIVITYSERVERPRIVATE_H
-#define HSACTIVITYSERVERPRIVATE_H
-
-#include <e32base.h>
-#include "hsactivitydbclientinterface.h"
-
-/**
- * Class implemets server functionality for S60 enviroment
- */
-class HsActivityServerPrivate : public CServer2
-{
-public:
- /**
- * Constructor
- */
- HsActivityServerPrivate(HsActivityDbClientInterface &storage);
-
- /**
- * Destructor
- */
- ~HsActivityServerPrivate();
-
- /**
- * Function establish server and initialize listening proces
- * @return true on succees, false otherwise
- */
- bool start();
-
- /**
- * Function look for active application session and complete pending message
- */
- void notifyL(int applicationId, const QString &activityName);
-
- /**
- * Cancel notification
- */
- void cancelNotify(int applicationId);
-
- /**
- * Function add item to pending messages
- */
- void waitNotification(int applicationId, const RMessage2 &msg);
-private:
- /**
- * Function create new client session to handle its request
- * @param version - client implementation version
- * @param message - request message
- */
- CSession2 *NewSessionL(const TVersion &version,const RMessage2 &message)const;
-
-private:
- /**
- * Reference to initialized storage client
- */
- HsActivityDbClientInterface &mStorage;
-
- QHash<int,RMessage2> mPendingMessage;
-};
-
-#endif //HSACTIVITYSERVERPRIVATE_H
--- a/activityfw/activitydatabase/hsactivitydbserver/s60/inc/hsactivitysession_p.h Fri Apr 16 14:45:49 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:
-*
-*/
-
-#ifndef ACTIVITYSESSIONPRIVATE_H
-#define ACTIVITYSESSIONPRIVATE_H
-#include <e32base.h>
-#include "hsactivitydbclientinterface.h"
-
-/**
- * Class impolements client session for S60 enviroment.
- * Class is responsible for request handling and data translations
- */
-class HsActivitySessionPrivate: public CSession2
-{
-public:
- /**
- * Constructor
- * @param storage - reference to initialized activity storage
- */
- HsActivitySessionPrivate(HsActivityDbClientInterface &storage);
-
- /**
- * Destructor
- */
- ~HsActivitySessionPrivate();
-
- /**
- * Implements interface
- * @see void CSession2::ServiceL(const RMessage2&)
- */
- void ServiceL(const RMessage2 &message);
-
- /**
- * Implements interface
- * @see void CSession2::ServiceError(const RMessage2 &, TInt)
- */
- void ServiceError(const RMessage2 &message, TInt error);
-
- void LaunchActivityL(const RMessage2 &message, const QString &name);
-
- void CancelNotify(RMessage2 &message);
-private:
- /**
- * Function handle data translation and forward request to storage client
- * Function can leave on failure.
- * @param message - request message
- */
- void HandleAddActivityL(const RMessage2 &message);
-
- /**
- * Function handle data translation and forward request to storage client
- * Function can leave on failure.
- * @param message - request message
- */
- void HandleUpdateActivityL(const RMessage2 &message);
-
- /**
- * Function handle data translation and forward request to storage client
- * Function can leave on failure.
- * @param message - request message
- */
- void HandleRemoveActivityL(const RMessage2 &message);
-
- /**
- * Function handle data translation and forward request to storage client
- * Function can leave on failure.
- * @param message - request message
- */
- void HandleRemoveApplicationActivitiesL(const RMessage2 &message);
-
- /**
- * Function handle data translation and forward request to storage client
- * Function can leave on failure.
- * @param message - request message
- */
- void HandleActivitiesL(const RMessage2 &message);
-
- /**
- * Function handle data translation and forward request to storage client
- * Function can leave on failure.
- * @param message - request message
- */
- void HandleApplicationActivitiesL(const RMessage2 &message);
-
- /**
- * Function handle data translation and forward request to server
- * Function can leave on failure.
- * @param message - request message
- */
- void HandleLaunchActivityL(const RMessage2 &message);
-
- /**
- * Function handle data translation and forward request to server
- * Function can leave on failure.
- * @param message - request message
- */
- void HandleWaitActivityL(const RMessage2 &message);
-
- /**
- * Function cancels subscribtion
- * @param message - request message
- */
- void HandleCancelWaitActivity(const RMessage2 &message);
-
- /**
- * Function read thumbail
- * @param message - request message
- */
- void HandleGetThumbnailL(const RMessage2 &message);
-
- /**
- * Function handle data translation and forward request to storage client
- * Function can leave on failure.
- * @param message - request message
- */
- void HandleGetDataL(const RMessage2 &message);
-
- void LaunchActivityL();
-
- void WaitActivityL(const RMessage2 &message);
-
- void GetThumbnailL(const RMessage2 &message);
-
- void CancelNotify();
-
-
- /**
- * Function deserialize data for request message
- * Function can leave on failure.
- */
- void ReadDataL(const RMessage2 &src);
-
- /**
- * Function handle data translation and forward request to storage client
- * Function can leave on failure.
- * @param message - request message
- */
- void LeaveIfNotZero(int errNo);
-private:
- /**
- * Reference to storage client
- */
- HsActivityDbClientInterface &mStorage;
- RBuf8 mData;
- QVariantHash mActivity;
- QList<QVariantHash> mResult;
- QString mName;
- int mAppId;
-};
-#endif // ACTIVITYSESSIONPRIVATE_H
--- a/activityfw/activitydatabase/hsactivitydbserver/s60/src/hsactivityserver_p.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +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: Application entry point
-*
-*/
-#include "hsactivityserver_p.h"
-#include "hsactivitysession_p.h"
-#include "hsactivityglobals.h"
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityServerPrivate::HsActivityServerPrivate(HsActivityDbClientInterface &storage)
- :
- CServer2(EPriorityNormal, ESharableSessions),
- mStorage(storage)
-{
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityServerPrivate::~HsActivityServerPrivate()
-{
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-bool HsActivityServerPrivate::start()
-{
- return (KErrNone == Start(KActivityServerName));
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityServerPrivate::notifyL(int applicationId,
- const QString &activityName)
-{
- if (mPendingMessage.end() != mPendingMessage.find(applicationId)) {
- static_cast<HsActivitySessionPrivate *>(mPendingMessage.find(applicationId).value().Session())
- ->LaunchActivityL(mPendingMessage.find(applicationId).value(), activityName);
- mPendingMessage.erase(mPendingMessage.find(applicationId));
- }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityServerPrivate::waitNotification(int applicationId,
- const RMessage2 &msg)
-{
- if (mPendingMessage.find(applicationId) != mPendingMessage.end()) {
- msg.Kill(EBadMessageNumber);
- }
- mPendingMessage.insert(applicationId,msg);
-}
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityServerPrivate::cancelNotify(int applicationId)
-{
- if (mPendingMessage.end() != mPendingMessage.find(applicationId)) {
- static_cast<HsActivitySessionPrivate *>(mPendingMessage.find(applicationId).value().Session())
- ->CancelNotify(mPendingMessage.find(applicationId).value());
- mPendingMessage.erase(mPendingMessage.find(applicationId));
- }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CSession2 *HsActivityServerPrivate::NewSessionL(const TVersion &,
- const RMessage2&)const
-{
- return new(ELeave) HsActivitySessionPrivate(mStorage);
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/s60/src/hsactivitysession_p.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,330 +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: Application entry point
-*
-*/
-#include "hsactivityserver_p.h"
-#include "hsactivitysession_p.h"
-#include "hsactivityglobals.h"
-#include "hsserializer.h"
-#include <qglobal.h>
-#include <qpixmap.h>
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivitySessionPrivate::HsActivitySessionPrivate(HsActivityDbClientInterface &storage)
- : mStorage(storage), mAppId(KErrNotFound)
-{
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivitySessionPrivate::~HsActivitySessionPrivate()
-{
- CancelNotify();
- mData.Close();
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::ServiceL(const RMessage2 &message)
-{
- mActivity.clear();
- mResult.clear();
- mName.clear();
-
- switch (message.Function()) {
- case AddActivity:
- HandleAddActivityL(message);
- break;
- case UpdateActivity:
- HandleUpdateActivityL(message);
- break;
- case RemoveActivity:
- HandleRemoveActivityL(message);
- break;
- case RemoveApplicationActivities:
- HandleRemoveApplicationActivitiesL(message);
- break;
- case Activities:
- HandleActivitiesL(message);
- break;
- case ApplicationActivities:
- HandleApplicationActivitiesL(message);
- break;
- case LaunchActivity:
- HandleLaunchActivityL(message);
- break;
- case WaitActivity:
- HandleWaitActivityL(message);
- return; //!!!!! This message shouldn't be compleated !!!!!
- case GetThumbnail:
- HandleGetThumbnailL(message);
- break;
- case GetData:
- HandleGetDataL(message);
- break;
- case CancelWait:
- HandleCancelWaitActivity(message);
- break;
- default:
- message.Panic(KErr400, CServer2::EBadMessageNumber);
- }
- message.Complete(KErrNone);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::ServiceError(const RMessage2 &message, TInt error)
-{
- message.Complete(error);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::HandleAddActivityL(const RMessage2 &message)
-{
- ReadDataL(message);
- LeaveIfNotZero(mStorage.addActivity(mActivity));
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::HandleUpdateActivityL(const RMessage2 &message)
-{
- ReadDataL(message);
- LeaveIfNotZero(mStorage.updateActivity(mActivity));
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::HandleRemoveActivityL(const RMessage2 &message)
-{
- ReadDataL(message);
- LeaveIfNotZero(mStorage.removeActivity(mActivity));
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::HandleRemoveApplicationActivitiesL(const RMessage2 &message)
-{
- ReadDataL(message);
- LeaveIfNotZero(mStorage.removeApplicationActivities(mActivity));
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::HandleActivitiesL(const RMessage2 &message)
-{
- int errNo(KErrNone);
- QT_TRYCATCH_LEAVING(errNo = mStorage.activities(mResult));
- LeaveIfNotZero(errNo);
- mData << mResult;
- TPckgC<int> dataSize(mData.Size());
- message.WriteL(1, dataSize);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::HandleApplicationActivitiesL(const RMessage2 &message)
-{
- int errNo(KErrNone);
- ReadDataL(message);
- QT_TRYCATCH_LEAVING(errNo = mStorage.applicationActivities(mResult, mActivity));
- LeaveIfNotZero(errNo);
- mData << mResult;
- TPckgC<int> dataSize(mData.Size());
- message.WriteL(1, dataSize);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::HandleLaunchActivityL(const RMessage2 &message)
-{
- ReadDataL(message);
- LaunchActivityL();
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::HandleWaitActivityL(const RMessage2 &message)
-{
- ReadDataL(message);
- WaitActivityL(message);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::HandleGetThumbnailL(const RMessage2 &message)
-{
- ReadDataL(message);
- GetThumbnailL(message);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::HandleCancelWaitActivity(const RMessage2& /*message*/)
-{
- CancelNotify();
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::HandleGetDataL(const RMessage2 &message)
-{
- message.WriteL(0, mData);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::LaunchActivityL()
-{
- CServer2 *const server(const_cast<CServer2 *>(Server()));
- if (mActivity.end() == mActivity.find(ActivityApplicationKeyword) ||
- mActivity.end() == mActivity.find(ActivityActivityKeyword)) {
- User::Leave(KErrCorrupt);
- }
- static_cast<HsActivityServerPrivate *>
- (server)->notifyL(mActivity.find(ActivityApplicationKeyword).value().toInt(),
- mActivity.find(ActivityActivityKeyword).value().toString());
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::LaunchActivityL(const RMessage2 &message,
- const QString &name)
-{
- if (mData.MaxSize() < name.toAscii().length()) {
- mData.ReAlloc(name.toAscii().length());
- }
- mData.Copy(reinterpret_cast<const TUint8*>(name.toAscii().data()),
- name.toAscii().length());
- TPckgC<int> dataSize(mData.Size());
- message.WriteL(1, dataSize);
- message.Complete(KErrNone);
-}
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::WaitActivityL(const RMessage2 &msg)
-{
- CServer2 *const server(const_cast<CServer2 *>(Server()));
- if (mActivity.end() == mActivity.find(ActivityApplicationKeyword)) {
- User::Leave(KErrCorrupt);
- }
- mAppId = mActivity.find(ActivityApplicationKeyword).value().toInt();
- static_cast<HsActivityServerPrivate *>
- (server)->waitNotification(mAppId, msg);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::GetThumbnailL(const RMessage2 &message)
-{
- if (mActivity.constEnd() == mActivity.constFind(ActivityScreenshotKeyword)) {
- User::Leave(KErrGeneral);
- }
- mData << QPixmap(mActivity.constFind(ActivityScreenshotKeyword).value().toString());
- TPckgC<int> dataSize(mData.Size());
- message.WriteL(1, dataSize);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::CancelNotify()
-{
- if (mAppId != KErrNotFound) {
- CServer2 *const server(const_cast<CServer2 *>(Server()));
- static_cast<HsActivityServerPrivate *>(server)->cancelNotify(mAppId);
- mAppId = KErrNotFound;
- }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::CancelNotify(RMessage2 &message)
-{
- message.Complete(KErrCancel);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::ReadDataL(const RMessage2 &src)
-{
- int srcLength = src.GetDesLength(0);
- User::LeaveIfError(srcLength);
- RBuf8 buffer;
- CleanupClosePushL(buffer);
- buffer.CreateL(srcLength);
- src.ReadL(0, buffer, 0);
- if (buffer.Length() != srcLength) {
- User::Leave(KErrCorrupt);
- }
- mActivity << buffer;
- CleanupStack::PopAndDestroy(&buffer);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivitySessionPrivate::LeaveIfNotZero(int errNo)
-{
- if (KErrNone != errNo) {
- User::LeaveIfError(errNo);
- User::Leave(KErrGeneral);
- }
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/s60/src/main.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +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: Application entry point
-*
-*/
-
-#include <QtCore>
-#include <QApplication>
-#include <qs60mainapplication.h>
-#include <qs60mainappui.h>
-#include <qs60maindocument.h>
-
-#include <eikenv.h>
-#include <apgwgnam.h>
-
-#include "hsactivityserver.h"
-#include "hsactivitystorage.h"
-
-class HsActivityMainAppUi : public QS60MainAppUi
-{
-public:
- TBool FrameworkCallsRendezvous() const {
- return EFalse;
- }
-};
-
-class HsActivityMainDocument : public QS60MainDocument
-{
-public:
- HsActivityMainDocument(CEikApplication &mainApplication):QS60MainDocument(mainApplication) {}
-
- CEikAppUi *CreateAppUiL() {
- return (static_cast <CEikAppUi *>(new(ELeave)HsActivityMainAppUi));
- }
-};
-
-class HsActivityApplication : public QS60MainApplication
-{
-protected:
- CApaDocument *CreateDocumentL() {
- return new(ELeave) HsActivityMainDocument(*this);
- }
-};
-
-CApaApplication *newHsActivityApplication()
-{
- return new HsActivityApplication;
-}
-
-int main(int argc, char *argv[])
-{
- QApplication app(newHsActivityApplication, argc, argv);
- HsActivityStorage storage;
- HsActivityServer server(storage);
- int retVal(KErrGeneral);
- if (server.start()) {
- CEikonEnv *env = CEikonEnv::Static();
- if (env) {
- CApaWindowGroupName *wgName = CApaWindowGroupName::NewLC(env->WsSession());
- wgName->SetHidden(ETrue); // hides us from FSW and protects us from OOM FW etc.
- wgName->SetSystem(ETrue); // Allow only application with PowerManagement cap to shut us down
- RWindowGroup &rootWindowGroup = env->RootWin();
- wgName->SetWindowGroupName(rootWindowGroup);
- rootWindowGroup.SetOrdinalPosition(-1, ECoeWinPriorityNormal); //move to background.
- CleanupStack::PopAndDestroy();
- }
- RProcess::Rendezvous(KErrNone);
- retVal = app.exec();
- } else
- RProcess::Rendezvous(retVal);
- return retVal;
-}
-
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activitybroadcasttask.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "activitybroadcasttask.h"
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void ActivityBroadcastTask::ExecuteL(MActivityTaskStorage& storage,
+ const RMessage2& msg)
+{
+ const RPointerArray<CActivityTask> &tasks(storage.StorageData());
+ for (TInt iter(0); iter < tasks.Count(); ++iter) {
+ (tasks[iter])->BroadcastReceivedL(msg);
+ }
+ msg.Complete(KErrNone);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activitydataprovidertask.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "activitydataprovidertask.h"
+#include "activitycmd.h"
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void ActivityDataProviderTask::ExecuteL(MActivityTaskStorage& storage,
+ const RMessage2& msg)
+{
+ TPckgBuf<void*> requestId;
+ CActivityTask* taskPtr(0);
+ msg.Read(KRequestIdOffset, requestId);
+
+ for (TInt iter(0);iter <storage.StorageData().Count();++iter) {
+ taskPtr = storage.StorageData()[iter];
+ if (taskPtr == requestId()) {//compare requested task address with storage objects
+ ProvideDataL(msg, *taskPtr);
+ storage.Pop(taskPtr);
+ delete taskPtr;
+ return;
+ }
+ }
+ User::Leave(KErrNotFound);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void ActivityDataProviderTask::ProvideDataL(const RMessage2& msg,
+ const CActivityTask& src)
+{
+ msg.WriteL(KResponseDataOffset, src.Data());
+ msg.Complete(KErrNone);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activitygraphicfilescaling.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description :
+ *
+ */
+#include "activitygraphicfilescaling.h"
+#include <imageconversion.h>
+
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+CGraphicsSalingHandler::CGraphicsSalingHandler(MImageReadyCallBack &aNotify,
+ const TSize &aNewSize,
+ TKindOfScaling aKindOfScaling):
+ CActive(EPriorityNormal),
+ mNotify(aNotify),
+ mNewSize(aNewSize),
+ mKindOfScaling(aKindOfScaling),
+ mCurrentOperation(ENone)
+{
+}
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+CGraphicsSalingHandler::~CGraphicsSalingHandler()
+{
+ Cancel();
+ delete mBitmapFromFile;
+ delete mBitmapOutput;
+ delete mImageDecoder;
+ delete mBitmapScaler;
+}
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+CGraphicsSalingHandler* CGraphicsSalingHandler::NewL(MImageReadyCallBack &aNotify,
+ RFs &aFs,
+ const TDesC &aFileName,
+ const TDesC8& aMimeType,
+ const TSize &aNewSize,
+ TKindOfScaling aKindOfScaling)
+{
+ CGraphicsSalingHandler *self = CGraphicsSalingHandler::NewLC(aNotify,
+ aFs,
+ aFileName,
+ aMimeType,
+ aNewSize,
+ aKindOfScaling);
+ CleanupStack::Pop();
+ return self;
+}
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+CGraphicsSalingHandler* CGraphicsSalingHandler::NewLC(MImageReadyCallBack &aNotify,
+ RFs &aFs,
+ const TDesC &aFileName,
+ const TDesC8& aMimeType,
+ const TSize &aNewSize,
+ TKindOfScaling aKindOfScaling)
+{
+ CGraphicsSalingHandler *self = new (ELeave) CGraphicsSalingHandler(aNotify,
+ aNewSize,
+ aKindOfScaling);
+ CleanupStack::PushL(self);
+ self->ConstructL(aFs, aFileName, aMimeType);
+ return self;
+}
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+void CGraphicsSalingHandler::ConstructL(RFs &aFs, const TDesC &aFileName, const TDesC8& aMimeType)
+{
+ CActiveScheduler::Add(this);
+
+ if (aFileName.Length() == 0
+ || aFs.IsValidName(aFileName) == EFalse) {
+ User::Leave(KErrPathNotFound);
+ }
+
+ mBitmapScaler = CBitmapScaler::NewL();
+ mBitmapScaler->SetQualityAlgorithm(CBitmapScaler::EMaximumQuality);
+
+ // convert *.png to bitmap
+ mImageDecoder = CImageDecoder::FileNewL(aFs, aFileName, aMimeType);
+ mBitmapFromFile = new(ELeave)CFbsBitmap();
+ const TFrameInfo frameInfo(mImageDecoder->FrameInfo(0));
+ User::LeaveIfError(mBitmapFromFile->Create(frameInfo.iOverallSizeInPixels,
+ frameInfo.iFrameDisplayMode));
+
+ mImageDecoder->Convert(&iStatus, *mBitmapFromFile, 0);
+ mCurrentOperation = EConvertBitmapFromFile;
+ SetActive();
+}
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+void CGraphicsSalingHandler::DoCancel()
+{
+ switch (mCurrentOperation) {
+ case EConvertBitmapFromFile:
+ mImageDecoder->Cancel();
+ break;
+ case EScale:
+ mBitmapScaler->Cancel();
+ break;
+ }
+ mNotify.ImageReadyCallBack(KErrCancel, 0);
+}
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+void CGraphicsSalingHandler::RunL()
+{
+ if(iStatus.Int()){
+ mNotify.ImageReadyCallBack(iStatus.Int(), 0);
+ return;
+ }
+
+ switch (mCurrentOperation) {
+ case EConvertBitmapFromFile: {
+ delete mImageDecoder;
+ mImageDecoder = 0;
+
+ mBitmapOutput = new (ELeave)CFbsBitmap();
+ User::LeaveIfError(mBitmapOutput->Create(Scaling(), mBitmapFromFile->DisplayMode()));
+ mBitmapScaler->Scale(&iStatus, *mBitmapFromFile, *mBitmapOutput, EFalse);
+ mCurrentOperation = EScale;
+ SetActive();
+ break;
+ }
+ case EScale: {
+ mCurrentOperation = ENone;
+
+ delete mBitmapScaler;
+ mBitmapScaler = 0;
+
+ delete mBitmapFromFile;
+ mBitmapFromFile = 0;
+
+ mNotify.ImageReadyCallBack(iStatus.Int(), mBitmapOutput);
+ break;
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+TSize CGraphicsSalingHandler::Scaling()
+{
+ TSize originalSize = mBitmapFromFile->SizeInPixels();
+ float widthFactor = mNewSize.iWidth / (float)originalSize.iWidth;
+ float heightFactor = mNewSize.iHeight / (float)originalSize.iHeight;
+ TSize retSize(mNewSize);
+ if (mKindOfScaling == CGraphicsSalingHandler::EKeepAspectRatio) {
+ retSize = (widthFactor < heightFactor) ?
+ TSize(mNewSize.iWidth, widthFactor * originalSize.iHeight) :
+ TSize(heightFactor * originalSize.iWidth, mNewSize.iHeight);
+ } else if (mKindOfScaling == CGraphicsSalingHandler::EKeepAspectRatioByExpanding) {
+ retSize = (widthFactor < heightFactor) ?
+ TSize(heightFactor * originalSize.iWidth, mNewSize.iHeight) :
+ TSize(mNewSize.iWidth, widthFactor * originalSize.iHeight);
+ }
+ return retSize;
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+TInt CGraphicsSalingHandler::RunError(TInt aError)
+{
+ mNotify.ImageReadyCallBack(aError, 0);
+ return KErrNone;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activityobservertask.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "activityobservertask.h"
+#include "activitycmd.h"
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CActivityObserverTask::CActivityObserverTask(MActivityTaskStorage& globalStorage,
+ MActivityTaskStorage& localStorage,
+ const RMessage2& msg)
+:
+ mGlobalStorage(globalStorage),
+ mLocalStorage(localStorage),
+ mMsg(msg)
+{
+ // No implementation required
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CActivityObserverTask::~CActivityObserverTask()
+{
+ mData.Close();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CActivityObserverTask::ExecuteLD(MActivityTaskStorage& globalStorage,
+ MActivityTaskStorage& localStorage,
+ const RMessage2& msg)
+{
+ CActivityObserverTask *self = new(ELeave)CActivityObserverTask(globalStorage,
+ localStorage,
+ msg);
+ CleanupStack::PushL(self);
+ globalStorage.PushL(self);
+ CleanupStack::Pop(self);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC8& CActivityObserverTask::Data() const
+{
+ return mData;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CActivityObserverTask::BroadcastReceivedL(const RMessage2& msg)
+{
+ if (WaitActivity == mMsg.Function() &&
+ LaunchActivity == msg.Function()) {
+ TPckgBuf<TInt> observerdId;
+ mMsg.ReadL(KRequestAppIdOffset, observerdId);
+
+ TPckgBuf<TInt> 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;
+ }
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CActivityObserverTask::WriteResponseL()
+{
+ mMsg.WriteL(KResponseDataSizeOffset, TPckgBuf<TInt>(mData.Length()));//write data size
+ mMsg.WriteL(KResponseIdOffset, TPckgBuf<CBase*>(this));//task identyfier
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activityserver.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <fbs.h>
+
+_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<CActivityServer*>(this)->mFsSession,
+ *const_cast<CActivityServer*>(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<CActivityTask>& CActivityServer::StorageData() const
+{
+ return mObservers;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activitysession.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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()
+{
+ mRunningTasks.ResetAndDestroy();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+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(mStorage, message);
+ break;
+
+ case Activities:
+ case ApplicationActivities:
+ CActivityStorageAsyncTask::ExecuteLD(*this, mStorage, message);
+ break;
+
+ case WaitActivity:
+ CActivityObserverTask::ExecuteLD(mTasksStorage, *this, message);
+ break;
+ case GetThumbnail:
+ CActivityThumbnailTask::ExecuteLD(mFileSession, *this, message);
+ break;
+
+ case LaunchActivity:
+ case CancelWait:
+ 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<CActivityTask>& CActivitySession::StorageData() const
+{
+ return mRunningTasks;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activitystorage.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,399 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <bautils.h>
+#include <s32mem.h>
+
+_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);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activitystorageasynctask.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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<TInt> appId;
+ msg.ReadL(KRequestAppIdOffset, appId);
+ dataStorage.ActivitiesL(mData, appId());
+ WriteResponseL(msg);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CActivityStorageAsyncTask::WriteResponseL(const RMessage2& msg)
+{
+ msg.WriteL(KResponseDataSizeOffset, TPckgBuf<TInt>(mData.Length()));//write data size
+ msg.WriteL(KResponseIdOffset, TPckgBuf<CBase*>(this));//task identyfier
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activitystoragesynctask.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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(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);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void ActivityStorageSyncTask::AddActivityL(CActivityStorage& dataStorage, const RMessage2& msg)
+{
+ TPckgBuf<TInt> 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<TInt> 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<TInt> 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<TInt> appId;
+ msg.ReadL(KRequestAppIdOffset, appId);
+ dataStorage.DeleteActivitiesL(appId());
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/activitythumbnailtask.cpp Fri Apr 30 15:22:08 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:
+*
+*/
+
+#include "activitythumbnailtask.h"
+#include "activitycmd.h"
+
+#include <fbs.h>
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+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<int> 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);
+ if(0 >= width() ||
+ 0 >=height() ||
+ 0 >= path.Length() ||
+ 0 >= mime.Length()
+ ) {
+ User::Leave(KErrCorrupt);
+ }
+
+ mService = CGraphicsSalingHandler::NewL(*this,
+ session,
+ path,
+ mime,
+ TSize(width(), height()),
+ CGraphicsSalingHandler::EKeepAspectRatio);
+
+ CleanupStack::PopAndDestroy(&mime);
+ CleanupStack::PopAndDestroy(&path);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CActivityThumbnailTask::ImageReadyCallBack(TInt error,const CFbsBitmap *bitmap)
+{
+ if (KErrNone == error) {
+ mMsg.Write(0, TPckgBuf<int>(const_cast<CFbsBitmap*>(bitmap)->Handle()));
+ mMsg.Write(1, TPckgBuf<void *>(this));
+ mMsg.Complete(error);
+ } else {
+ mMsg.Complete(error);
+ mStorage.Pop(this);
+ delete this;
+ }
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC8& CActivityThumbnailTask::Data() const
+{
+ return KNullDesC8();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CActivityThumbnailTask::BroadcastReceivedL(const RMessage2& )
+{
+}
+
--- a/activityfw/activitydatabase/hsactivitydbserver/src/hsactivityserver.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Application entry point
-*
-*/
-#include "hsactivityserver.h"
-#include "hsactivityserver_p.h"
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityServer::HsActivityServer(HsActivityDbClientInterface &storage)
- :
- d_ptr(new HsActivityServerPrivate(storage))
-{
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityServer::~HsActivityServer()
-{
- delete d_ptr;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-bool HsActivityServer::start()
-{
- return d_ptr->start();
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/hsactivitystorage.cpp Fri Apr 16 14:45:49 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: Application entry point
-*
-*/
-#include "hsactivitystorage.h"
-#include "hsactivitystorage_p.h"
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityStorage::HsActivityStorage()
- :
- d_ptr(new HsActivityStoragePrivate())
-{
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityStorage::~HsActivityStorage()
-{
- delete d_ptr;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStorage::addActivity(const QVariantHash &activity)
-{
- return d_ptr->addActivity(activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStorage::updateActivity(const QVariantHash &activity)
-{
- return d_ptr->updateActivity(activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStorage::removeActivity(const QVariantHash &activity)
-{
- return d_ptr->removeActivity(activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStorage::removeApplicationActivities(const QVariantHash &activity)
-{
- return d_ptr->removeApplicationActivities(activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStorage::activities(QList<QVariantHash>& result)
-{
- return d_ptr->activities(result);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStorage::applicationActivities(QList<QVariantHash>& result,
- const QVariantHash &activity)
-{
- return d_ptr->applicationActivities(result, activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStorage::waitActivity(const QVariantHash &activity)
-{
- return d_ptr->waitActivity(activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStorage::launchActivity(const QVariantHash &activity)
-{
- return d_ptr->launchActivity(activity);
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/hsactivitystorage_p.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,345 +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 <QSqlQuery>
-#include <QSqlError>
-#include <QStringList>
-#include <QSettings>
-#include <QSqlDriver>
-#include <QDebug>
-#include "hsactivitystorage_p.h"
-#include "hsactivity.h"
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityStoragePrivate::HsActivityStoragePrivate()
-{
- // determine database localization
- QSettings settings(ActivityOrganization, ActivityApplication);
- settings.setValue(ActivityStorageProperty, ActivityDefaultStorage);
- if (!settings.contains(ActivityStorageProperty)) {
- settings.setValue(ActivityStorageProperty, ActivityDefaultStorage);
- }
- QString databaseFile = settings.value(ActivityStorageProperty).toString();
-
- if (QSqlDatabase::contains(ActivityStorageName)) {
- mConn = QSqlDatabase::database(ActivityStorageName);
- } else {
- mConn = QSqlDatabase::addDatabase(ActivityStorageDriver, ActivityStorageName);
- mConn.setDatabaseName(databaseFile);
- if (!mConn.open()) {
- qWarning(qPrintable(mConn.lastError().text()));
- return;
- }
- }
- if (!checkTables()) {
- recreateTables();
- }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityStoragePrivate::~HsActivityStoragePrivate()
-{
- mConn.close();
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStoragePrivate::addActivity(const QVariantHash &activity)
-{
- // stream whole entry to bytearray
- QByteArray streamedData;
- QDataStream stream(&streamedData, QIODevice::WriteOnly);
- stream << activity;
-
- //insert data
- QSqlQuery query(mConn);
- query.prepare(ActivitySelectActivityQuery);
- bind(query, activity);
- exec(query);
- if (query.next()) {
- return KErrGeneral;
- }
- query.prepare(ActivityInsertActivityQuery);
- QVariantHash additionalData;
- additionalData.insert(ActivityDataKeyword, streamedData);
- bind(query, activity, additionalData);
- exec(query);
- return 0>=query.numRowsAffected() ? KErrGeneral : getSqlErrorCode(query);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStoragePrivate::updateActivity(const QVariantHash &activity)
-{
- // stream whole entry to bytearray
- QByteArray streamedData;
- QDataStream stream(&streamedData, QIODevice::WriteOnly);
- stream << activity;
-
- // update
- QSqlQuery query(mConn);
- query.prepare(ActivityUpdateActivityQuery);
- QVariantHash additionalData;
- additionalData.insert(ActivityDataKeyword, streamedData);
- bind(query, activity, additionalData);
- exec(query);
- return 0>=query.numRowsAffected() ? KErrGeneral : getSqlErrorCode(query);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStoragePrivate::removeActivity(const QVariantHash &activity)
-{
- return exec(ActivityDeleteActivityQuery, activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStoragePrivate::removeApplicationActivities(const QVariantHash &activity)
-{
- return exec(ActivityDeleteApplicationActivitiesQuery, activity);
-}
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStoragePrivate::requestedActivityName(QString &result,
- const QVariantHash &activity)
-{
- QSqlQuery query(mConn);
- query.prepare(ActivitySelectActiveQuery);
- bind(query, activity);
- int retVal(KErrNone);
- if (exec(query) && query.next()) {
- result = query.value(0).toString();
- } else {
- retVal = KErrNotFound;
- }
- return retVal;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStoragePrivate::activities(QList<QVariantHash>& result)
-{
- return activities(result, ActivityActivitiesQuery, QVariantHash());
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStoragePrivate::applicationActivities(QList<QVariantHash> & result,
- const QVariantHash &condition)
-{
- return activities(result, ActivityApplicationActivitiesQuery, condition);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStoragePrivate::waitActivity(const QVariantHash &)
-{
- return KErrNotSupported;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStoragePrivate::launchActivity(const QVariantHash &)
-{
- return KErrNotSupported;
-}
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-bool HsActivityStoragePrivate::checkTables()
-{
- return (QStringList("Activities") == mConn.tables());
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityStoragePrivate::recreateTables()
-{
- //start sql transaction
- if (!mConn.transaction()) {
- qErrnoWarning(qPrintable(mConn.lastError().text()));
- return;
- }
-
- // drop any existing tables
- QSqlQuery query(mConn);
- foreach(const QString &tableName, mConn.tables()) {
- query.prepare(ActivityDropQuery);
- query.bindValue(ActivityTableKeyword, tableName);
- exec(query);
- }
-
- // create new table
- query.prepare(ActivityCreateQuery);
- exec(query);
-
- //finish sql transaction
- if (!mConn.commit()) {
- qErrnoWarning(qPrintable(mConn.lastError().text()));
- }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStoragePrivate::getSqlErrorCode(const QSqlQuery &query)
-{
- const QSqlError err(query.lastError());
- const QString errStr(err.text());
-
- if (QSqlError ::NoError == err.type()) {
- return 0;
- } else {
- qErrnoWarning(qPrintable(errStr));
- return err.number();
- }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-bool HsActivityStoragePrivate::exec(QSqlQuery &query)
-{
- const bool retVal = query.exec();
- qErrnoWarning(qPrintable(query.lastQuery()));
- if (!retVal) {
- getSqlErrorCode(query);
- }
- return retVal;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-bool HsActivityStoragePrivate::exec(const QString &queryStr, const QVariantHash ¶ms)
-{
- QSqlQuery query(mConn);
- query.prepare(queryStr);
- bind(query, params);
- query.exec();
- return getSqlErrorCode(query);
-
-}
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityStoragePrivate::bind(QSqlQuery &query,
- const QVariantHash &activity,
- const QVariantHash &additionalData)
-{
- const QChar tag(' ');
- QString queryString(query.lastQuery());
- QVariantHash::const_iterator iter;
- int offset(0);
- QStringList tokens;
-
- //explode SQL query to tokens
- do {
- offset = queryString.indexOf(tag, 0);
- if (0 < offset) {
- tokens << queryString.left(offset++);
- queryString = queryString.right(queryString.length() - offset);
- } else {
- if (0 < queryString.length()) {
- tokens << queryString;
- }
- break;
- }
- } while (true);
-
- //current Sql driver doesnt support proper query formating.
- //reuest filtering data has to be binded in right order.
- QStringList::iterator token = tokens.begin();
- //iterate all tokens
- for (; token != tokens.end(); token = tokens.erase(token)) {
- //iterate all provided data and chcek if it match pattern
- for (iter = activity.constBegin();
- iter != activity.constEnd();
- ++iter) {
- if ((*token).contains(iter.key())) {
- query.bindValue(iter.key(), iter.value());
- break;
- }
- }
- for (iter = additionalData.constBegin();
- iter != additionalData.constEnd();
- ++iter) {
- if ((*token).contains(iter.key())) {
- query.bindValue(iter.key(), iter.value());
- break;
- }
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityStoragePrivate::activities(QList<QVariantHash> &results,
- const QString &queryStr,
- const QVariantHash &conditions)
-{
- results.clear();
-
- QSqlQuery query(mConn);
- query.prepare(queryStr);
- bind(query, conditions);
- if (exec(query)) {
- QVariantHash activityEntry;
- while (query.next()) {
- activityEntry.clear();
- QByteArray data(query.value(0).toByteArray());
- QDataStream stream(&data, QIODevice::ReadOnly);
- stream >> activityEntry;
- results.append(activityEntry);
- }
- }
- return getSqlErrorCode(query);
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/main.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/main.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -11,32 +11,53 @@
*
* Contributors:
*
-* Description: Application entry point
+* Description:
*
*/
-#include <QtCore>
-#include <QCoreApplication>
-
-#include "hsactivityserver.h"
-#include "hsactivitystorage.h"
+#include "activityserver.h"
+#include <e32base.h>
-#ifdef Q_OS_SYMBIAN
-#include <coemain.h>
-#include <coedef.h>
-#endif
-
-int main(int argc, char *argv[])
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+LOCAL_C void StartActivityServerL()
{
-#ifdef Q_OS_SYMBIAN
- CCoeEnv::Static()->RootWin().SetOrdinalPosition(0, ECoeWinPriorityNeverAtFront);
-#endif
+ CActiveScheduler* activeScheduler = new( ELeave ) CActiveScheduler;
+ CleanupStack::PushL( activeScheduler );
+ CActiveScheduler::Install( activeScheduler );
+ CActivityServer* serverObject = CActivityServer::NewLC();
+ RProcess::Rendezvous( KErrNone );
+ CActiveScheduler::Start();
+ CleanupStack::PopAndDestroy( serverObject );
+ CleanupStack::PopAndDestroy( activeScheduler );
+}
- QCoreApplication app(argc, argv);
- HsActivityStorage storage;
- HsActivityServer server(storage);
- int retVal(KErrGeneral);
- if (server.start()) {
- retVal = app.exec();
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+LOCAL_C TInt StartActivityServer()
+{
+ __UHEAP_MARK;
+ TInt errNo(KErrNoMemory);
+ CTrapCleanup* cleanupStack = CTrapCleanup::New();
+ if (cleanupStack) {
+ TRAP(errNo, StartActivityServerL());
+ delete cleanupStack;
}
- return retVal;
+ __UHEAP_MARKEND;
+ if (KErrNone != errNo) {
+ RProcess::Rendezvous(errNo);
+ }
+ return errNo;
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt E32Main()
+{
+ return StartActivityServer();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activitydatabase/inc/activitycmd.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,29 @@
+#ifndef ACTIVITYCMD_H
+#define ACTIVITYCMD_H
+
+const TInt KRequestAppIdOffset(0);
+const TInt KRequestActOffset(1);
+const TInt KRequestData(2);
+const TInt KRequestIdOffset(0);
+
+const TInt KResponseDataSizeOffset(0);
+const TInt KResponseIdOffset(3);
+const TInt KResponseDataOffset(1);
+
+
+enum ActivityCmd {
+ AddActivity =0,
+ UpdateActivity,
+ RemoveActivity,
+ RemoveApplicationActivities,
+ Activities,
+ ApplicationActivities,
+ WaitActivity,
+ LaunchActivity,
+ GetThumbnail,
+ GetData,
+ CancelWait
+};
+
+#endif //ACTIVITYCMD_H
+
--- a/activityfw/activitydatabase/inc/hsactivitydbclientinterface.h Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/inc/hsactivitydbclientinterface.h Fri Apr 30 15:22:08 2010 +0300
@@ -17,24 +17,10 @@
#ifndef HSACTIVITYDBCLIENTINTERFACE_H
#define HSACTIVITYDBCLIENTINTERFACE_H
#include <qvariant.h>
-
+#include <activitycmd.h>
/**
* Enumerate supported functions
*/
-enum ClientFunctions {
- AddActivity =0,
- UpdateActivity,
- RemoveActivity,
- RemoveApplicationActivities,
- RequestedActivityName,
- Activities,
- ApplicationActivities,
- WaitActivity,
- LaunchActivity,
- GetThumbnail,
- GetData,
- CancelWait
-};
const char ActivityApplicationKeyword [] = ":ApplicationId";
const char ActivityActivityKeyword [] = ":ActivityName";
--- a/activityfw/activitydatabase/s60/src/hsserializer.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activitydatabase/s60/src/hsserializer.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -15,7 +15,7 @@
*
*/
#include "hsserializer.h"
-
+#include <s32mem.h>
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
@@ -106,10 +106,28 @@
//
QList<QVariantHash>& operator <<(QList<QVariantHash>& dst, const TDesC8 &src)
{
- QByteArray buffer(QByteArray::fromRawData(reinterpret_cast<const char *>(src.Ptr()),
- src.Length()));
-
- QDataStream stream(&buffer, QIODevice::ReadOnly);
- QT_TRYCATCH_LEAVING(stream >> dst);
+ 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;
}
--- a/activityfw/activityserviceplugin/activityclient_p.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activityserviceplugin/activityclient_p.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -26,11 +26,11 @@
#include <QDebug>
#include <QDir>
-ActivityClientPrivate::ActivityClientPrivate(ActivityClient *q) : QObject(q), isconnected(false)
+ActivityClientPrivate::ActivityClientPrivate(ActivityClient *q) : QObject(q), mIsconnected(false)
{
mDataStorage = new ActivityDataStorage();
mServerClient = new HsActivityDbClient();
- isconnected = ( KErrNone == mServerClient->connect());
+ mIsconnected = ( KErrNone == mServerClient->connect());
connect(mServerClient, SIGNAL(activityRequested(QString)), q, SIGNAL(activityRequested(QString)));
}
@@ -42,55 +42,67 @@
bool ActivityClientPrivate::addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters)
{
- if (isconnected) {
- mDataStorage->addActivity(activityId, data);
- QVariantHash activity(parameters);
- RProcess process;
- registerThumbnail(activityId, activity);
- activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
- activity.insert(ActivityActivityKeyword, activityId);
- mServerClient->addActivity(activity);
+ 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<int>(process.SecureId().iId));
+ activity.insert(ActivityActivityKeyword, activityId);
+ int error = mServerClient->addActivity(activity);
+ result = error == KErrNone ? true : false;
+ }
}
// @todo make those operations atomic
- // @todo return real result
- return isconnected;
+ return result;
}
bool ActivityClientPrivate::removeActivity(const QString &activityId)
{
- if (isconnected) {
- mDataStorage->removeActivity(activityId);
- QVariantHash activity;
- RProcess process;
- activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
- activity.insert(ActivityActivityKeyword, activityId);
- mServerClient->removeActivity(activity);
+ bool result(false);
+ if (mIsconnected) {
+ result = mDataStorage->removeActivity(activityId);
+ if ( result ) {
+ QVariantHash activity;
+ RProcess process;
+ activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
+ activity.insert(ActivityActivityKeyword, activityId);
+ int error = mServerClient->removeActivity(activity);
+ result = error == KErrNone ? true : false;
+ if (result) {
+ result = QFile::remove(thumbnailName(activityId));
+ }
+ }
}
// @todo make those operations atomic
- // @todo return real result
- return isconnected;
+ return result;
}
bool ActivityClientPrivate::updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters)
{
- if (isconnected) {
- mDataStorage->updateActivity(activityId, data);
- QVariantHash activity(parameters);
- RProcess process;
- registerThumbnail(activityId, activity);
- activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
- activity.insert(ActivityActivityKeyword, activityId);
- mServerClient->updateActivity(activity);
+ 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<int>(process.SecureId().iId));
+ activity.insert(ActivityActivityKeyword, activityId);
+ int error = mServerClient->updateActivity(activity);
+ result = error == KErrNone ? true : false;
+ }
}
// @todo make those operations atomic
- // @todo return real result
- return isconnected;
+ return result;
}
QList<QVariantHash> ActivityClientPrivate::activities() const
{
QList<QVariantHash> activities;
- if (isconnected) {
+ if (mIsconnected) {
QVariantHash activity;
RProcess process;
activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
@@ -101,13 +113,13 @@
QVariant ActivityClientPrivate::activityData(const QString &activityId) const
{
- return isconnected ? mDataStorage->activityData(activityId) : QVariant();
+ return mIsconnected ? mDataStorage->activityData(activityId) : QVariant();
}
bool ActivityClientPrivate::waitActivity()
{
- bool retVal(isconnected);
- if (isconnected) {
+ bool retVal(mIsconnected);
+ if (mIsconnected) {
RProcess process;
QVariantHash activity;
activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
@@ -138,7 +150,7 @@
void ActivityClientPrivate::registerThumbnail(const QString &name, QVariantHash &activity)
{
- QVariantHash::const_iterator findIterator(activity.constFind(ActivityScreenshotKeyword));
+ QVariantHash::const_iterator findIterator(activity.constFind(ActivityScreenshotKeyword));
if (activity.constEnd() != findIterator &&
findIterator.value().canConvert<QPixmap>()) {
const QString thumbnailManagerName = thumbnailName(name);
@@ -157,3 +169,4 @@
QString::number(qHash(activityId), 16) +
".png");
}
+
--- a/activityfw/activityserviceplugin/activityclient_p.h Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activityserviceplugin/activityclient_p.h Fri Apr 30 15:22:08 2010 +0300
@@ -51,7 +51,7 @@
private:
ActivityDataStorage *mDataStorage;
HsActivityDbClient *mServerClient;
- bool isconnected;
+ bool mIsconnected;
};
#endif // ACTIVITYCLIENT_P_H
--- a/activityfw/activityserviceplugin/activitymanager.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activityserviceplugin/activitymanager.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -41,17 +41,7 @@
d_ptr->launchActivity(applicationId, activityId);
}
-void ActivityManager::removeActivity(int applicationId, const QString &activityId)
-{
- d_ptr->removeActivity(applicationId, activityId);
-}
-
-void ActivityManager::removeApplicationActivities(int applicationId)
+void ActivityManager::getThumbnail(QSize resolution,const QString &thumbnailPath, void *data)
{
- d_ptr->removeApplicationActivities(applicationId);
+ d_ptr->getThumbnail(resolution, thumbnailPath, data);
}
-
-void ActivityManager::getThumbnail(const QString &thumbnailId, void *userData)
-{
- d_ptr->getThumbnail(thumbnailId, userData);
-}
--- a/activityfw/activityserviceplugin/activitymanager.h Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activityserviceplugin/activitymanager.h Fri Apr 30 15:22:08 2010 +0300
@@ -21,6 +21,7 @@
#include <QVariant>
#include <QList>
#include <QPixmap>
+#include <QSize>
class ActivityManagerPrivate;
@@ -37,9 +38,7 @@
QList<QVariantHash> activitiesList();
void launchActivity(const QString &uri);
void launchActivity(int applicationId, const QString &activityId);
- void removeActivity(int applicationId, const QString &activityId);
- void removeApplicationActivities(int applicationId);
- void getThumbnail(const QString &thumbnailId, void * =0);
+ void getThumbnail(QSize resolution,const QString &thumbnailPath, void *data =0);
signals:
void thumbnailReady(QPixmap, void *);
--- a/activityfw/activityserviceplugin/activitymanager_p.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activityserviceplugin/activitymanager_p.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -25,6 +25,10 @@
{
mServerClient = new HsActivityDbClient();
mServerClient->connect();
+ connect(mServerClient,
+ SIGNAL(thumbnailRequested(QPixmap, void *)),
+ q,
+ SIGNAL(thumbnailReady(QPixmap, void *)));
}
ActivityManagerPrivate::~ActivityManagerPrivate()
@@ -46,7 +50,7 @@
if (uriMatcher.indexIn(uri) != -1) {
QStringList list = uriMatcher.capturedTexts();
Q_ASSERT(list.count() == 3);
- launchActivity(list.at(1).toInt(), list.at(2));
+ launchActivity(list.at(1).toUInt(0, 16), list.at(2));
} else {
qWarning("Activity URI parsing error");
}
@@ -66,24 +70,7 @@
}
}
-void ActivityManagerPrivate::removeActivity(int applicationId, const QString &activityId)
-{
- QVariantHash activity;
- activity.insert(ActivityApplicationKeyword, applicationId);
- activity.insert(ActivityActivityKeyword, activityId);
- mServerClient->removeActivity(activity);
-}
-
-void ActivityManagerPrivate::removeApplicationActivities(int applicationId)
+void ActivityManagerPrivate::getThumbnail(QSize resolution,const QString &thumbnailPath, void *data)
{
- QVariantHash activity;
- activity.insert(ActivityApplicationKeyword, applicationId);
- mServerClient->removeApplicationActivities(activity);
+ mServerClient->getThumbnail(resolution, thumbnailPath, "image/png", data);
}
-
-void ActivityManagerPrivate::getThumbnail(const QString &thumbnailId, void *userData)
-{
- QPixmap ico;
- mServerClient->getThumbnail(ico, thumbnailId);
- emit q_ptr->thumbnailReady(ico, userData);
-}
--- a/activityfw/activityserviceplugin/activitymanager_p.h Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/activityserviceplugin/activitymanager_p.h Fri Apr 30 15:22:08 2010 +0300
@@ -20,6 +20,7 @@
#include <QObject>
#include <QVariant>
#include <QList>
+#include <QSize>
#include "applicationlauncher.h"
class ActivityManager;
@@ -38,9 +39,7 @@
QList<QVariantHash> activitiesList();
void launchActivity(const QString &uri);
void launchActivity(int applicationId, const QString &activityId);
- void removeActivity(int applicationId, const QString &activityId);
- void removeApplicationActivities(int applicationId);
- void getThumbnail(const QString &thumbnailId, void *);
+ void getThumbnail(QSize resolution,const QString &thumbnailPath, void *data);
private:
ActivityManager *q_ptr;
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -15,14 +15,13 @@
*
*/
-#include "hbactivityplugininterface.h"
#include "hbactivityplugin.h"
#include <qservicemanager.h>
QTM_USE_NAMESPACE
-HbActivityPlugin::HbActivityPlugin(QObject *parent) : HbActivityPluginInterface(parent), mActivityClient(0)
+HbActivityPlugin::HbActivityPlugin(QObject *parent) : QObject(parent), mActivityClient(0)
{
QServiceManager serviceManager;
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.h Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.h Fri Apr 30 15:22:08 2010 +0300
@@ -18,9 +18,10 @@
#ifndef HBACTIVITYPLUGIN_H
#define HBACTIVITYPLUGIN_H
-#include "hbactivityplugininterface.h"
+#include <QObject>
+#include "hbactivityplugininterface_p.h"
-class HbActivityPlugin : public HbActivityPluginInterface
+class HbActivityPlugin : public QObject, public HbActivityPluginInterface
{
Q_OBJECT
Q_INTERFACES(HbActivityPluginInterface)
@@ -38,6 +39,9 @@
virtual bool waitActivity();
virtual QVariantHash parseCommandLine(const QStringList &commandLineParams);
+signals:
+ void activityRequested(const QString &activityId);
+
private:
QObject *mActivityClient;
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.pro Fri Apr 16 14:45:49 2010 +0300
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.pro Fri Apr 30 15:22:08 2010 +0300
@@ -22,7 +22,7 @@
CONFIG += mobility
MOBILITY = serviceframework
-HEADERS += hbactivityplugininterface.h \
+HEADERS += hbactivityplugininterface_p.h \
hbactivityplugin.h \
SOURCES += hbactivityplugin.cpp \
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugininterface.h Fri Apr 16 14:45:49 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 HBACTIVITYPLUGININTERFACE_H
-#define HBACTIVITYPLUGININTERFACE_H
-
-#include <QtPlugin>
-#include <QObject>
-#include <QVariant>
-#include <QString>
-#include <QList>
-#include <QVariantHash>
-
-class HbActivityPluginInterface : public QObject
-{
- Q_OBJECT
-
-public:
- HbActivityPluginInterface(QObject *parent = 0) : QObject(parent) {}
-
-public:
- virtual bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) = 0;
- virtual bool removeActivity(const QString &activityId) = 0;
- virtual bool updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) = 0;
- virtual QList<QVariantHash> activities() = 0;
- virtual QVariant activityData(const QString &activityId) = 0;
- virtual bool waitActivity() = 0;
- virtual QVariantHash parseCommandLine(const QStringList &commandLineParams) = 0;
-
-signals:
- void activityRequested(const QString &activityId);
-
-};
-
-Q_DECLARE_INTERFACE(HbActivityPluginInterface, "HbActivityPluginInterface/1.0")
-
-#endif // HBACTIVITYPLUGININTERFACE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugininterface_p.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (developer.feedback@nokia.com)
+**
+** This file is part of the HbCore module of the UI Extensions for Mobile.
+**
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this file.
+** Please review the following information to ensure the GNU Lesser General
+** Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at developer.feedback@nokia.com.
+**
+****************************************************************************/
+
+#ifndef HBACTIVITYPLUGININTERFACE_P_H
+#define HBACTIVITYPLUGININTERFACE_P_H
+
+#include <QtPlugin>
+#include <QVariant>
+#include <QString>
+#include <QList>
+#include <QVariantHash>
+
+class HbActivityPluginInterface
+{
+public:
+ virtual ~HbActivityPluginInterface() {}
+
+public:
+ virtual bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) = 0;
+ virtual bool removeActivity(const QString &activityId) = 0;
+ virtual bool updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) = 0;
+ virtual QList<QVariantHash> activities() = 0;
+ virtual QVariant activityData(const QString &activityId) = 0;
+ virtual bool waitActivity() = 0;
+ virtual QVariantHash parseCommandLine(const QStringList &commandLineParams) = 0;
+
+signals:
+ // signal must be re-declared in the plugin implementation
+ void activityRequested(const QString &activityId);
+};
+
+Q_DECLARE_INTERFACE(HbActivityPluginInterface, "HbActivityPluginInterface/1.0")
+
+#endif // HBACTIVITYPLUGININTERFACE_P_H
--- a/contentpublishingsrv/contentharvester/contentharvesterclient/bwins/contentharvesterclientu.def Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-EXPORTS
- ??0RContentHarvesterClient@@QAE@XZ @ 1 NONAME ; RContentHarvesterClient::RContentHarvesterClient(void)
- ?Connect@RContentHarvesterClient@@QAEHXZ @ 2 NONAME ; int RContentHarvesterClient::Connect(void)
- ?Stop@RContentHarvesterClient@@QAEHXZ @ 3 NONAME ; int RContentHarvesterClient::Stop(void)
- ?Update@RContentHarvesterClient@@QAEHXZ @ 4 NONAME ; int RContentHarvesterClient::Update(void)
-
--- a/contentpublishingsrv/contentharvester/contentharvesterclient/eabi/contentharvesterclientu.def Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-EXPORTS
- _ZN23RContentHarvesterClient4StopEv @ 1 NONAME
- _ZN23RContentHarvesterClient6UpdateEv @ 2 NONAME
- _ZN23RContentHarvesterClient7ConnectEv @ 3 NONAME
- _ZN23RContentHarvesterClientC1Ev @ 4 NONAME
- _ZN23RContentHarvesterClientC2Ev @ 5 NONAME
-
--- a/contentpublishingsrv/contentharvester/contentharvesterclient/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for Content Publisher Client
-*
-*/
-
-
-
-PRJ_PLATFORMS
-
-DEFAULT
-
-
-PRJ_EXPORTS
-
-
-PRJ_MMPFILES
-contentharvesterclient.mmp
-
-// End of File
--- a/contentpublishingsrv/contentharvester/contentharvesterclient/group/contentharvesterclient.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Interface to CP Active Data Server
-*
-*/
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET contentharvesterclient.dll
-TARGETTYPE dll
-
-UID 0x1000008D 0x10282E59
-CAPABILITY CAP_GENERAL_DLL
-VENDORID VID_DEFAULT
-
-LANG SC
-
-SOURCEPATH ../src
-SOURCE contentharvesterclient.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../contentharvesterserver/inc
-
-// Default system include paths for application layer modules.
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY estor.lib
-LIBRARY efsrv.lib
-DEBUGLIBRARY flogger.lib
-
-
-//end of file
--- a/contentpublishingsrv/contentharvester/contentharvesterclient/inc/contentharvesterclient.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#ifndef C_CONTENTHARVESTERCLIENT_H
-#define C_CONTENTHARVESTERCLIENT_H
-
-// INCLUDES
-#include <e32base.h>
-
-// FORWARD DECLARATIONS
-
-
-// CLASS DECLARATION
-
-/**
- * @brief Client-side interface to CP Active Data Server
- *
- * This class provides the client-side interface to the active data server session,
- * it just passes requests to the server.
- *
- * @lib contentharvesterclient.lib
- * @since S60 v3.1
- */
-class RContentHarvesterClient : public RSessionBase
- {
-public:
-
- /**
- * Construct the object.
- */
- IMPORT_C RContentHarvesterClient();
-
- /**
- * Connects to the server and create a session.
- * When the server is not running, the function starts the server.
- * @return error code
- */
- IMPORT_C TInt Connect();
-
- /**
- * Triggers updating process of Active Data Server,
- * the function returns right after the server receives the request
- * (it isn't information about the whole update process.)
- * @return error code
- */
- IMPORT_C TInt Update();
-
- /**
- * Triggers stop process on server
- * @return error code
- */
- IMPORT_C TInt Stop();
-
- /**
- * Returns the version number
- * @return the version
- */
- TVersion Version() const;
- };
-
-#endif // C_CONTENTHARVESTERCLIENT_H
-// End of File
--- a/contentpublishingsrv/contentharvester/contentharvesterclient/src/contentharvesterclient.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-#include "contentharvesterclient.h"
-#include "contentharvesterglobals.h"
-
-// Number of message slots to reserve for this client server session.
-const TUint KDefaultMessageSlots( 5);
-
-// Function prototypes
-static TInt StartServer();
-static TInt CreateServerProcess();
-
-// ======== MEMBER FUNCTIONS ========
-
-// -----------------------------------------------------------------------------
-// RContentHarvesterClient::RContentHarvesterClient
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-EXPORT_C RContentHarvesterClient::RContentHarvesterClient()
-:RSessionBase()
- {
- // No implementation required
- }
-
-// -----------------------------------------------------------------------------
-// RContentHarvesterClient::Connect
-// Connect to Content Harvester Server session.
-// exist
-// -----------------------------------------------------------------------------
-//
-EXPORT_C TInt RContentHarvesterClient::Connect()
- {
- TInt error = ::StartServer();
-
- if ( error == KErrNone )
- {
- error = CreateSession( KContentHarvesterName,
- Version(),
- KDefaultMessageSlots );
- }
- return error;
- }
-
-// -----------------------------------------------------------------------------
-// RContentHarvesterClient::Update
-// Client requests to trigger update process
-// -----------------------------------------------------------------------------
-
-EXPORT_C TInt RContentHarvesterClient::Update()
- {
- return SendReceive( EContentHarvesterUpdate );
- }
-
-// -----------------------------------------------------------------------------
-// RContentHarvesterClient::Stop
-// Client requests to trigger stop process
-// -----------------------------------------------------------------------------
-
-EXPORT_C TInt RContentHarvesterClient::Stop()
- {
- return SendReceive( EContentHarvesterStop );
- }
-
-// -----------------------------------------------------------------------------
-// RContentHarvesterClient::Version
-// Version information.
-// -----------------------------------------------------------------------------
-//
-TVersion RContentHarvesterClient::Version() const
- {
- return (TVersion( KContentHarvesterMajorVersionNumber,
- KContentHarvesterMinorVersionNumber,
- KContentHarvesterBuildVersionNumber ) );
- }
-
-// -----------------------------------------------------------------------------
-// StartServer
-// Static method to start the server.
-// -----------------------------------------------------------------------------
-//
-static TInt StartServer()
- {
- TInt result;
-
- TFindServer findServer( KContentHarvesterName );
- TFullName name;
-
- result = findServer.Next( name );
- if ( result != KErrNone )
- {
- // Server not running
- result = CreateServerProcess( );
- }
- return result;
- }
-
-// -----------------------------------------------------------------------------
-// CreateServerProcess
-// Static method to create the server process.
-// -----------------------------------------------------------------------------
-//
-static TInt CreateServerProcess()
- {
- const TUidType serverUid( KNullUid, KNullUid, KServerUid3);
- RProcess server;
- TInt result;
- result = server.Create( KContentHarvesterFilename, KNullDesC, serverUid );
- if ( result == KErrNone )
- {
- TRequestStatus stat = KRequestPending;
- server.Rendezvous( stat );
- if ( stat != KRequestPending )
- {
- server.Kill( 0 ); // abort startup
- }
- else
- {
- server.Resume( ); // logon OK - start the server
- }
-
- User::WaitForRequest( stat ); // wait for start or death
- // we can't use the 'exit reason' if the server panicked as this
- // is the panic 'reason' and may be '0' which cannot be distinguished
- // from KErrNone
- result = (server.ExitType( ) == EExitPanic ) ? KErrGeneral
- : stat.Int( );
- }
- server.Close( );
- return result;
- }
--- a/contentpublishingsrv/contentharvester/contentharvesterserver/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for Content Publisher Server
-*
-*/
-
-
-
-PRJ_PLATFORMS
-
-DEFAULT
-
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
-contentharvesterserver.mmp
-
-
-// End of File
\ No newline at end of file
--- a/contentpublishingsrv/contentharvester/contentharvesterserver/group/contentharvesterserver.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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
-*
-*/
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET contentharvester.exe
-TARGETTYPE exe
-CAPABILITY CAP_SERVER NetworkControl
-VENDORID VID_DEFAULT
-
-UID 0x1000008d 0x10282E5A
-
-LANG SC
-
-SOURCEPATH ../src
-SOURCE contentharvesterserver.cpp
-SOURCE contentharvesterengine.cpp
-SOURCE contentharvestersession.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../../contentpublishingserver/cpserver/inc
-USERINCLUDE ../../../contentpublishingutils/contentpublishingdebug/inc
-USERINCLUDE ../../../contentpublishingutils/pluginvalidator/inc
-
-// Default system include paths for application layer modules.
-MW_LAYER_SYSTEMINCLUDE
-
-
-LIBRARY euser.lib
-LIBRARY efsrv.lib
-LIBRARY ecom.lib
-
-LIBRARY fbscli.lib // to operate with images
-LIBRARY eikcore.lib
-LIBRARY cone.lib
-LIBRARY liwservicehandler.lib
-LIBRARY pluginvalidator.lib
-
-#ifdef CONTENT_PUBLISHER_DEBUG
-LIBRARY cpdebug.lib
-#endif
-
-DEBUGLIBRARY flogger.lib
-
-EPOCHEAPSIZE 0x1000 0x400000
-EPOCSTACKSIZE 0x5000
-
-//end of file
-
--- a/contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterengine.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-* 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: Engine for cp active data server
- *
-*/
-
-
-#ifndef C_CONTENTHARVESTERENGINE_H
-#define C_CONTENTHARVESTERENGINE_H
-
-#include "contentharvesterplugin.h"
-
-// FORWARD DECLARATIONS
-//class CContentHarvesterPlugin;
-class MLiwInterface;
-class CLiwServiceHandler;
-class CPluginValidator;
-
-// CLASS DECLARATION
-
-/**
- * The engine that discovers and manages all installed harvesting plugins.
- *
- * @lib contentharvesterserver.lib
- * @since S60 v3.1
- */
-class CContentHarvesterEngine : public CBase
- {
-
-public:
- // New methods
-
- /**
- * Create a CContentHarvesterEngine object using two phase construction,
- * and return a pointer to the created object.
- * @return pointer to new session
- */
- static CContentHarvesterEngine* NewL();
-
- /**
- * Create a CContentHarvesterEngine object using two phase construction,
- * and return a pointer to the created object.
- * @return pointer to new session
- */
- static CContentHarvesterEngine* NewLC();
-
- /**
- * Destroy the object and release all memory objects.
- */
- virtual ~CContentHarvesterEngine();
-
- /**
- * Pass update request to all registered plugins.
- */
- void Update();
-
-private:
- // New methods
-
- /**
- * Perform the first phase of two phase construction.
- */
- CContentHarvesterEngine();
-
- /**
- * Perform the second phase construction of a CContentHarvesterEngine object.
- */
- void ConstructL();
-
-private:
-
- /**
- * handler to CPS
- * Own
- */
- CLiwServiceHandler* iServiceHandler;
-
- /**
- * interface to CPS
- * Own
- */
- MLiwInterface * iCPSInterface;
-
- /**
- * Plugins
- * Own
- */
- CPluginValidator* iPluginManager;
-
- };
-
-#endif // C_CONTENTHARVESTERENGINE_H
--- a/contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterglobals.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* 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: Globals for cp active data server
- *
-*/
-
-
-#ifndef C_CONTENTHARVESTERGLOBALS_H
-#define C_CONTENTHARVESTERGLOBALS_H
-
-// CONSTANTS
-const TUint KContentHarvesterMajorVersionNumber = 0;
-const TUint KContentHarvesterMinorVersionNumber = 1;
-const TUint KContentHarvesterBuildVersionNumber = 1;
-
-_LIT( KContentHarvesterThreadName, "contentharvester_MainThread" );
-_LIT( KContentHarvesterName, "contentharvester" );
-_LIT( KContentHarvesterFilename, "contentharvester" );
-
-const TUid KServerUid3 =
- {
- 0x10282E5A
- };
-
-// ENUMERATIONS
-// Opcodes used in message passing between client and server
-enum KContentHarvesterRqst
- {
- EContentHarvesterUpdate = 100,
- EContentHarvesterStop
- };
-
-enum KContentHarvesterRsp
- {
- EContentHarvesterUpdateComplete = 200,
- EContentHarvesterStopComplete
- };
-
-#endif // C_CONTENTHARVESTERGLOBALS_H
-// End of File
--- a/contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterpanic.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* 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: Panics for cp active data server
- *
-*/
-
-
-#ifndef __CONTENTHARVESTERPANIC_H_
-#define __CONTENTHARVESTERPANIC_H_
-
-/** Panic Category */
-
-/** Content Harvester panic codes */
-enum TContentHarvesterPanic
- {
- EContentHarvesterBadRequest = 1,
- EContentHarvesterBadDescriptor = 2,
- EContentHarvesterSrvCreateServer = 3,
- EContentHarvesterMainSchedulerError = 4,
- EContentHarvesterCreateTrapCleanup = 5,
- EContentHarvesterSrvSessCreateTimer = 6,
- EContentHarvesterReqAlreadyPending = 7, // A request is already pending
- EContentHarvesterEIkonEnv = 8
- };
-
-#endif // __CONTENTHARVESTERPANIC_H_
--- a/contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterserver.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
-* 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: Content Harvester Server - implemenration of CServer2
- *
-*/
-
-
-#ifndef C_CONTENTHARVESTERSERVER_H
-#define C_CONTENTHARVESTERSERVER_H
-
-#include <eikenv.h>
-#include <eikappui.h>
-#include "contentharvesterpanic.h"
-
-class CContentHarvesterEngine;
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-
-// CLASS DECLARATION
-
-/**
- * CP Active Data Server container.
- * Provides interface for CP Active Data Server maintanace purposes.
- *
- * @lib ???.lib
- * @since Series 60 3.1
- */
-class CContentHarvesterServer : public CServer2
- {
- /**
- * EIkonEnv for the server process.
- *
- * @lib ???.lib
- * @since Series 60 3.1
- */
- class CContentHarvesterEikonEnv : public CEikonEnv
- {
-public:
- void DestroyEnvironment();
- void ConstructL();
- };
-
- /**
- * EikAppUi for the server process.
- *
- * @lib ???.lib
- * @since Series 60 3.1
- */
- class CContentHarvesterAppUi : public CEikAppUi
- {
-public:
- ~CContentHarvesterAppUi();
- void ConstructL();
- };
-
-public:
- // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CContentHarvesterServer* NewLC();
-
- /**
- * Destructor.
- */
- virtual ~CContentHarvesterServer();
-
-public:
- // New functions
-
- /**
- * Return the reference to the engine.
- * @return engine reference
- */
- CContentHarvesterEngine& Engine();
-
- /**
- * Stops server.
- */
- void Stop();
-
- /**
- * First stage startup for the server thread.
- * @return return KErrNone or panics thread
- */
- static TInt ThreadFunction();
-
- /**
- * Panic client.
- * @param aMessage RMessage2
- * @param aPanic panic code
- */
- static void PanicClient( const RMessage2& aMessage,
- TContentHarvesterPanic aPanic );
-
-protected:
- // From CActive
- /**
- * Process any errors.
- * @param aError the leave code reported
- * @return return KErrNone if leave is handled
- */
- TInt RunError( TInt aError );
-
-private:
- // New methods
-
- /**
- * Constructs the server.
- * @param aPriority CServer2 input parameter
- */
- CContentHarvesterServer( TInt aPriority );
-
- /**
- * Perform the second phase construction of a CContentHarvesterServer object.
- */
- void ConstructL();
-
- /**
- * Panic the server.
- * @param param aPanic the panic code
- * @return a updateId of container
- */
- static void PanicServer( TContentHarvesterPanic aPanic );
-
- /**
- * Second stage startup for the server thread.
- */
- static void ThreadFunctionL();
-
-private:
- // From CServer2
-
- /**
- * Create a time server session, and return a pointer to the created object.
- * @param aVersion the client version
- * @param aMessage RMessage2
- * @return pointer to new session
- */
- CSession2* NewSessionL( const TVersion& aVersion,
- const RMessage2& aMessage ) const;
-
-private:
-
- /**
- * instance of engine, where the whole logic is implemented
- * Own.
- */
- CContentHarvesterEngine* iEngine;
-
- };
-
-#endif // C_CONTENTHARVESTERSERVER_H
--- a/contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvestersession.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
-* 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: Engine for content harvester server
- *
-*/
-
-
-#ifndef C_CONTENTHARVESTERSESSION_H
-#define C_CONTENTHARVESTERSESSION_H
-
-// INCLUDES
-#include <e32base.h>
-
-// FORWARD DECLARATIONS
-class CContentHarvesterServer;
-
-// CLASS DECLARATION
-
-/**
- An instance of class CContentHarvesterSession is created for each client
- */
-class CContentHarvesterSession : public CSession2
- {
-
-public:
- // New methods
-
- /**
- * Create a CContentHarvesterSession object using two phase construction,
- * and return a pointer to the created object
- * @param aServer CContentHarvesterServer
- * @return pointer to new session
- */
- static CContentHarvesterSession* NewL( CContentHarvesterServer* aServer );
-
- /**
- * Create a CContentHarvesterSession object using two phase construction,
- * and return a pointer to the created object
- * @param aServer CContentHarvesterServer
- * @return pointer to new session
- */
- static CContentHarvesterSession* NewLC( CContentHarvesterServer* aServer );
-
- /**
- * Destroy the object and release all memory objects
- */
- virtual ~CContentHarvesterSession();
-
-public:
- // From CSession
- /**
- * Called after a service request from client; from class CSession
- * @param aMessage message from client (containing requested operation and any data)
- */
- void ServiceL( const RMessage2& aMessage );
-
-private:
- // New methods
-
- /**
- * Perform the first phase of two phase construction
- * @param aServer CContentHarvesterServer
- */
- CContentHarvesterSession( CContentHarvesterServer* aServer );
-
- /**
- * Perform the second phase construction of a CContentHarvesterSession object
- */
- void ConstructL();
-
-private:
-
- /**
- * CP Active Data Server container
- * Own.
- */
- CContentHarvesterServer* iContentHarvesterServer;
- };
-
-#endif // C_CONTENTHARVESTERSESSION_H
--- a/contentpublishingsrv/contentharvester/contentharvesterserver/src/contentharvesterengine.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
-* 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: Content Harvester Engine
- *
-*/
-
-
-// for CleanupResetAndDestroyPushL
-#include <mmf/common/mmfcontrollerpluginresolver.h>
-#include <contentharvesterplugin.h> // harvesting plugin
-#include <liwservicehandler.h>
-#include <e32property.h>
-
-#include "charvesterpluginvalidator.h"
-#include "contentharvesterpluginuids.hrh"
-#include "cpglobals.h"
-#include "cpdebug.h"
-#include "contentharvesterengine.h"
-
-// LOCAL CONSTANTS
-const TInt KADatFactorySettingsServerPluginUid( 0x102830EF);
-
-
-
-// ================= MEMBER FUNCTIONS =======================
-// -----------------------------------------------------------------------------
-// CContentHarvesterEngine::CContentHarvesterEngine
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CContentHarvesterEngine::CContentHarvesterEngine()
- {
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterEngine::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterEngine::ConstructL()
- {
- CP_DEBUG(_L8("Create Engine" ));
-
- CP_DEBUG(_L8("Start delayed update" ));
- // start updating process
-
- iServiceHandler = CLiwServiceHandler::NewL( );
- // for convinience keep pointers to Service Handler param lists
- CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL( );
- CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL( );
-
- RCriteriaArray criteriaArray;
- CleanupResetAndDestroyPushL( criteriaArray );
-
- // create Liw criteria
- CLiwCriteriaItem* criterion = CLiwCriteriaItem::NewLC( KLiwCmdAsStr,
- KCPInterface, KCPService );
- criterion->SetServiceClass( TUid::Uid( KLiwClassBase ) );
-
- criteriaArray.AppendL( criterion );
- CleanupStack::Pop( criterion );
-
- // attach Liw criteria
- iServiceHandler->AttachL( criteriaArray );
- // get BS Service interface
- iServiceHandler->ExecuteServiceCmdL( *criterion, *inParamList,
- *outParamList );
-
- CleanupStack::PopAndDestroy( &criteriaArray );
-
- TInt pos( 0);
- outParamList->FindFirst( pos, KCPInterface );
- if ( pos != KErrNotFound )
- {
- iCPSInterface = (*outParamList)[pos].Value().AsInterface( );
- }
-
- iPluginManager = CHarvesterPluginValidator::NewL(
- TUid::Uid( KContentHarvesterPluginUid ),
- iCPSInterface );
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterEngine::~CContentHarvesterEngine
-// Destructor.
-// -----------------------------------------------------------------------------
-//
-CContentHarvesterEngine::~CContentHarvesterEngine()
- {
- if ( iCPSInterface )
- {
- iCPSInterface->Close( );
- }
- delete iServiceHandler;
- delete iPluginManager;
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterEngine::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CContentHarvesterEngine* CContentHarvesterEngine::NewL()
- {
- CContentHarvesterEngine* self = CContentHarvesterEngine::NewLC( );
- CleanupStack::Pop( self ) ;
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterEngine::NewLC
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CContentHarvesterEngine* CContentHarvesterEngine::NewLC()
- {
- CContentHarvesterEngine* self = new ( ELeave ) CContentHarvesterEngine();
- CleanupStack::PushL( self );
- self->ConstructL( ) ;
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterEngine::Update
-// Pass request for update to all installed plugins
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterEngine::Update()
- {
- CP_DEBUG(_L8("CContentHarvesterEngine::Update" ));
- CContentHarvesterPlugin* plugin( NULL );
- CContentHarvesterPlugin* fsplugin =
- static_cast<CContentHarvesterPlugin*>
- ( iPluginManager->GetImplementation(
- TUid::Uid( KADatFactorySettingsServerPluginUid) ) );
-
- if (fsplugin)
- {
- TRAP_IGNORE( fsplugin->UpdateL() );
- }
-
- for ( TInt i = 0; i < iPluginManager->GetCount(); i++ )
- {
- plugin = static_cast<CContentHarvesterPlugin*>
- ( iPluginManager->GetImplementation( i ) );
- if( plugin!= fsplugin )
- {
- TRAP_IGNORE( plugin->UpdateL() );
- }
- }
- }
-
-// End of File
-
-
--- a/contentpublishingsrv/contentharvester/contentharvesterserver/src/contentharvesterserver.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,283 +0,0 @@
-/*
-* 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: Content Harvester Server
- *
-*/
-
-
-//#include <eikenv.h>
-//#include <eikappui.h>
-
-#include <fbs.h>
-
-#include "contentharvesterserver.h"
-#include "contentharvestersession.h"
-#include "contentharvesterglobals.h"
-#include "contentharvesterengine.h"
-#include "cpdebug.h"
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterServer::CContentHarvesterServer
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CContentHarvesterServer::CContentHarvesterServer( TInt aPriority ) :
- CServer2(aPriority)
- {
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterServer::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterServer::ConstructL()
- {
- CP_DEBUG( _L8("Start Content Harvester Server" ));
- StartL( KContentHarvesterName );
- iEngine = CContentHarvesterEngine::NewL( );
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterServer::NewL
-// Two-phased constructor.
-// -------------------------------------- ---------------------------------------
-//
-CContentHarvesterServer* CContentHarvesterServer::NewLC()
- {
- CContentHarvesterServer* self = new( ELeave )
- CContentHarvesterServer( EPriorityNormal );
- CleanupStack::PushL( self );
- self->ConstructL( );
- return self;
- }
-
-// Destructor
-CContentHarvesterServer::~CContentHarvesterServer()
- {
- CP_DEBUG( _L8("Destroy Content Harvester Server" ));
- delete iEngine;
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterServer::NewSessionL
-// Create new session.
-// -----------------------------------------------------------------------------
-//
-CSession2* CContentHarvesterServer::NewSessionL( const TVersion& aVersion,
- const RMessage2& /*aMessage*/ ) const
- {
- CP_DEBUG(_L8("CContentHarvesterServer::NewSessionL" ));
- // Check we're the right version
- if ( !User::QueryVersionSupported( TVersion(
- KContentHarvesterMajorVersionNumber,
- KContentHarvesterMinorVersionNumber,
- KContentHarvesterBuildVersionNumber ), aVersion ) )
- {
- User::Leave( KErrNotSupported );
- }
- return CContentHarvesterSession::NewL( ( CContentHarvesterServer* ) this );
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterServer::RunError
-// RunError is called when RunL leaves.
-// -----------------------------------------------------------------------------
-//
-TInt CContentHarvesterServer::RunError( TInt aError )
- {
- CP_DEBUG( _L8("CContentHarvesterServer::RunError " ));
- if ( aError == KErrBadDescriptor )
- {
- PanicClient( Message( ), EContentHarvesterBadDescriptor );
- }
- else
- {
- Message().Complete( aError );
- }
-
- // The leave will result in an early return from CServer::RunL(), skipping
- // the call to request another message. So do that now in order to keep the
- // server running.
- ReStart( );
- // Handled the error fully
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterServer::PanicClient
-// Panic client.
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterServer::PanicClient( const RMessage2& aMessage,
- TContentHarvesterPanic aPanic )
- {
- aMessage.Panic( KContentHarvesterName, aPanic );
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterServer::PanicServer
-// Panic server.
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterServer::PanicServer( TContentHarvesterPanic aPanic )
- {
- User::Panic( KContentHarvesterName, aPanic );
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterServer::ThreadFunctionL
-// Create and start the server.
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterServer::ThreadFunctionL()
- {
- RFbsSession::Connect( );
- // Construct our server
-
- CContentHarvesterServer* server = CContentHarvesterServer::NewLC( );
- CP_DEBUG(_L8("Send Rendezvous" ));
- RProcess::Rendezvous( KErrNone );
-
- CActiveScheduler::Start( );
-
- CleanupStack::PopAndDestroy( server );
-
- RFbsSession::Disconnect( );
- }
-// -----------------------------------------------------------------------------
-// CContentHarvesterServer::ThreadFunctionL
-// Create and start the server.
-// -----------------------------------------------------------------------------
-//
-TInt CContentHarvesterServer::ThreadFunction()
- {
- __UHEAP_MARK;
-
- TFindServer findCountServer( KContentHarvesterName );
- TFullName name;
-
- // Need to check that the server exists.
- if (findCountServer.Next(name) != KErrNone)
- {
- User::RenameThread( KContentHarvesterThreadName );
-
- CTrapCleanup* cleanupStack = CTrapCleanup::New( );
- if ( !(cleanupStack ) )
- {
- PanicServer( EContentHarvesterCreateTrapCleanup );
- }
-
- CContentHarvesterEikonEnv* env = new CContentHarvesterEikonEnv;
- __ASSERT_ALWAYS( env, PanicServer( EContentHarvesterEIkonEnv ) );
-
- CContentHarvesterAppUi* ui = new CContentHarvesterAppUi;
- __ASSERT_ALWAYS( ui, PanicServer( EContentHarvesterEIkonEnv ) );
-
- TRAPD(error, env->ConstructL(); ui->ConstructL());
- __ASSERT_ALWAYS( !error, PanicServer( EContentHarvesterEIkonEnv ) );
-
- TRAPD( err, ThreadFunctionL() );
- if ( err != KErrNone )
- {
- PanicServer( EContentHarvesterSrvCreateServer );
- }
- ui->PrepareToExit( );
- env->DestroyEnvironment( );
-
- delete cleanupStack;
- cleanupStack = NULL;
- }
-
- __UHEAP_MARKEND;
-
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterServer::Engine
-// Getter of engine
-// -----------------------------------------------------------------------------
-//
-CContentHarvesterEngine& CContentHarvesterServer::Engine()
- {
- return *iEngine;
- }
-// -----------------------------------------------------------------------------
-// CContentHarvesterServer::Engine
-// Getter of engine
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterServer::Stop()
- {
- CActiveScheduler::Stop( );
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterEikonEnv::DestroyEnvironment
-//
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterServer::CContentHarvesterEikonEnv::DestroyEnvironment()
- {
- CEikonEnv::DestroyEnvironment( );
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterEikonEnv::ConstructL
-//
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterServer::CContentHarvesterEikonEnv::ConstructL()
- {
- CEikonEnv::ConstructL( EFalse );
- SetAutoForwarding( ETrue );
- User::SetPriorityControl( EFalse );
- }
-// -----------------------------------------------------------------------------
-// CContentHarvesterAppUi::~CContentHarvesterAppUi
-//
-// -----------------------------------------------------------------------------
-//
-CContentHarvesterServer::CContentHarvesterAppUi::~CContentHarvesterAppUi()
- {
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterAppUi::ConstructL
-//
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterServer::CContentHarvesterAppUi::ConstructL()
- {
- CEikAppUi::BaseConstructL( ENoAppResourceFile|ENoScreenFurniture );
- }
-
-// ============================= LOCAL FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// E32Main entry point.
-// Returns: KErrNone
-// -----------------------------------------------------------------------------
-//
-TInt E32Main()
- {
- return CContentHarvesterServer::ThreadFunction( );
- }
-
-// End of File
-
--- a/contentpublishingsrv/contentharvester/contentharvesterserver/src/contentharvestersession.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
-* 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: Content Harvester Server Session
- *
-*/
-
-
-// INCLUDE FILES
-#include "contentharvestersession.h"
-#include "contentharvesterengine.h"
-#include "contentharvesterserver.h"
-#include "contentharvesterglobals.h"
-#include "cpdebug.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterSession::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CContentHarvesterSession* CContentHarvesterSession::NewL(
- CContentHarvesterServer* aServer )
- {
- CContentHarvesterSession* self =
- CContentHarvesterSession::NewLC( aServer );
- CleanupStack::Pop( self ) ;
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterSession::NewLC
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CContentHarvesterSession* CContentHarvesterSession::NewLC(
- CContentHarvesterServer* aServer )
- {
- CContentHarvesterSession* self = new ( ELeave )
- CContentHarvesterSession(aServer);
- CleanupStack::PushL( self );
- self->ConstructL( ) ;
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterSession::~CContentHarvesterSession
-// Destructor.
-// -----------------------------------------------------------------------------
-//
-CContentHarvesterSession::~CContentHarvesterSession()
- {
-
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterSession::ServiceL
-// Handle client requests.
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterSession::ServiceL( const RMessage2& aMessage )
- {
- CP_DEBUG(_L8("CContentHarvesterSession::ServiceL"));
- switch ( aMessage.Function( ) )
- {
- case EContentHarvesterUpdate:
- CP_DEBUG(_L8("Update command"));
- aMessage.Complete( EContentHarvesterUpdateComplete );
- iContentHarvesterServer->Engine().Update( );
- break;
- case EContentHarvesterStop:
- CP_DEBUG(_L8("Stop command"));
- aMessage.Complete( EContentHarvesterStopComplete );
- iContentHarvesterServer->Stop( );
- break;
- default:
- iContentHarvesterServer->PanicClient( aMessage,
- EContentHarvesterBadRequest );
- break;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterSession::CContentHarvesterSession
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CContentHarvesterSession::CContentHarvesterSession(
- CContentHarvesterServer* aServer ) :
- CSession2()
- {
- iContentHarvesterServer = aServer;
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterSession::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CContentHarvesterSession::ConstructL()
- {
- CP_DEBUG(_L8("CContentHarvesterSession::ConstructL"));
- }
-
-// End of File
--- a/contentpublishingsrv/contentharvester/contentharvesterswiplugin/data/chswiplugin.rss Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-#include <ecom/registryinfo.rh>
-#include <contentharvesterpluginuids.hrh>
-
-
-// RESOURCE DEFINITIONS
-// -----------------------------------------------------------------------------
-//
-// REGISTRY_INFO theInfo
-// Declares info for the "all" implementation
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE REGISTRY_INFO theInfo
- {
- // UID for the DLL
- dll_uid = KCHSwiPluginUidDll;
- // Declare array of interface info
- interfaces =
- {
- INTERFACE_INFO
- {
- // UID of interface that is implemented
- interface_uid = KContentHarvesterPluginUid;
- implementations =
- {
- // Info for CCHSwiPlugin
- IMPLEMENTATION_INFO
- {
- implementation_uid = KCHSwiPluginUidImpl;
- version_no = 1;
- display_name = "chswiplugin";
- default_data = "chswiplugin";
- opaque_data = "chswiplugin";
- }
- };
- }
- };
- }
-
-// End of File
--- a/contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* 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:
- *
-*/
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-
-PRJ_MMPFILES
-chswiplugin.mmp
-
-
-// End of File
-
--- a/contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/chswiplugin.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* 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:
- *
-*/
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET chswiplugin.dll
-TARGETTYPE PLUGIN
-UID 0x10009D8D 0x20022E84
-CAPABILITY CAP_ECOM_PLUGIN
-
-LANG SC
-
-VENDORID VID_DEFAULT
-
-SOURCEPATH ../src
-SOURCE chswiplugin.cpp
-
-SOURCEPATH ../data
-START RESOURCE chswiplugin.rss
-HEADER
-TARGET chswiplugin.rsc
-TARGETPATH resource/plugins
-END
-
-USERINCLUDE ../inc
-USERINCLUDE ../../../contentpublishingserver/cpserver/inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-
-LIBRARY ecom.lib
-LIBRARY euser.lib
-
-LIBRARY apgrfx.lib
-LIBRARY apparc.lib
-
-LIBRARY liwservicehandler.lib //AIW Framework
-
-//end of file
--- a/contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-#ifndef C_CCHSWIPLUGIN_H
-#define C_CCHSWIPLUGIN_H
-
-#include <contentharvesterplugin.h>
-#include <apgnotif.h>
-
-class MLiwInterface;
-class CLiwGenericParamList;
-
-/**
- * Active Data plugin for SIS installation events.
- *
- * @since S60 S60 v3.1
- */
-class CCHSwiPlugin: public CContentHarvesterPlugin,
- MApaAppListServObserver
- {
-
-public:
- /**
- * Two-phased constructor.
- * @param aInterface liw interface
- */
- static CCHSwiPlugin* NewL( MLiwInterface* aInterface );
-
- /**
- * Destructor.
- */
- virtual ~CCHSwiPlugin();
-
- /**
- * From CContentHarvesterPlugin.
- * This function updates all data entries which could change when an applicaion is installed
- * or when the MMC is removed/inserted.
- */
- void UpdateL();
-
-private:
- // from MApaAppListServObserver
-
- void HandleAppListEvent( TInt aEvent );
- /**
- * Performs the second phase construction of a CADatSwi object.
- */
- void ConstructL();
-
- /**
- * Default Constructor.
- * @param aActiveSpace An instance of the Active Space Client.
- */
- CCHSwiPlugin( MLiwInterface* aInterface );
-
-
- /**
- * This function removes publishers from database when
- * an applicaion is uninstalled or when the MMC is removed.
- */
- void UpdateWidgetsL();
-
-
- void RemoveWidgetsL( CLiwGenericParamList* aWidgets );
-
- void RemoveWidgetL( const TDesC& aType,
- const TDesC& aContentId );
-
-
-private:
-
- /**
- * An interface to Content Publisher Service
- */
- MLiwInterface* iCPSInterface;
-
-
- /**
- * AppArc session.
- * Own.
- */
- RApaLsSession iApaLsSession;
-
- CApaAppListNotifier* iNotifier; ///< Change notifier. Own.
-
- };
-
-#endif // C_CCHSWIPLUGIN_H
-
--- a/contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiplugin.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-#include "chswiplugin.h"
-
-#include <e32std.h>
-
-#include <ecom/implementationproxy.h>
-#include <contentharvesterpluginuids.hrh>
-#include <liwservicehandler.h>
-#include "cpglobals.h"
-
-_LIT( KHsWidgetPublisher, "hswidgetpublisher");
-_LIT( KHsPublisher, "ai3templatedwidget" );
-_LIT8( KWidgetUid, "widget_uid");
-
-// Map the interface UIDs to implementation factory functions
-// ============================= LOCAL FUNCTIONS ===============================
-
-// Map the interface UIDs to implementation factory functions
-const TImplementationProxy ImplementationTable[] =
- {
- {{KCHSwiPluginUidImpl}, (TProxyNewLPtr)CCHSwiPlugin::NewL},
- };
-
-// ----------------------------------------------------------------------------
-// Exported proxy for instantiation method resolution
-// ----------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
- TInt& aTableCount )
- {
- aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
- return ImplementationTable;
- }
-
-// ============================ MEMBER FUNCTIONS ==============================
-
-// ----------------------------------------------------------------------------
-// CCHSwiPlugin::CCHSwiPlugin
-// Constructor
-// ----------------------------------------------------------------------------
-//
-CCHSwiPlugin::CCHSwiPlugin( MLiwInterface* aInterface )
- {
- iCPSInterface = aInterface;
- }
-
-// ----------------------------------------------------------------------------
-// CADatSwi::ConstructL
-// Symbian 2nd phase constructor can leave.
-// ----------------------------------------------------------------------------
-//
-void CCHSwiPlugin::ConstructL()
- {
- iNotifier = CApaAppListNotifier::NewL( this, CActive::EPriorityStandard );
- User::LeaveIfError( iApaLsSession.Connect() );
- }
-
-// ----------------------------------------------------------------------------
-// CADatSwi::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CCHSwiPlugin* CCHSwiPlugin::NewL( MLiwInterface* aInterface)
- {
- CCHSwiPlugin* self = new (ELeave) CCHSwiPlugin( aInterface );
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
- return self;
- }
-
-// ----------------------------------------------------------------------------
-// CCHSwiPlugin::~CCHSwiPlugin
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CCHSwiPlugin::~CCHSwiPlugin()
- {
- iApaLsSession.Close();
- delete iNotifier;
- }
-
-// ----------------------------------------------------------------------------
-// CCHSwiPlugin::UpdateL
-// (other items were commented in a header).
-// ----------------------------------------------------------------------------
-//
-void CCHSwiPlugin::UpdateL()
- {
- UpdateWidgetsL();
- }
-
-// ----------------------------------------------------------------------------
-// CCHSwiPlugin::HandleAppListEvent
-// (other items were commented in a header).
-// ----------------------------------------------------------------------------
-//
-void CCHSwiPlugin::HandleAppListEvent( TInt /*aEvent*/ )
- {
- TRAP_IGNORE( UpdateWidgetsL() );
- }
-
-// ----------------------------------------------------------------------------
-// CCHSwiPlugin::UpdateWidgetsL
-// MMC watcher callback.
-// ----------------------------------------------------------------------------
-//
-void CCHSwiPlugin::UpdateWidgetsL()
- {
- CLiwGenericParamList* inparam = CLiwGenericParamList::NewLC( );
- CLiwGenericParamList* outparam = CLiwGenericParamList::NewLC( );
- inparam->AppendL( TLiwGenericParam( KType, TLiwVariant( KPublisher ) ) );
- CLiwDefaultMap* filter = CLiwDefaultMap::NewLC();
-
- filter->InsertL( KPublisherId, TLiwVariant( KHsWidgetPublisher ));
- filter->InsertL( KContentType, TLiwVariant( KHsPublisher ));
- inparam->AppendL( TLiwGenericParam( KFilter, TLiwVariant( filter ) ) );
-
- iCPSInterface->ExecuteCmdL( KGetList, *inparam, *outparam );
-
- RemoveWidgetsL( outparam );
-
- CleanupStack::PopAndDestroy( filter );
- CleanupStack::PopAndDestroy( outparam );
- CleanupStack::PopAndDestroy( inparam );
- }
-
-// ----------------------------------------------------------------------------
-// CCHSwiPlugin::RemoveWidgetsL
-// MMC watcher callback.
-// ----------------------------------------------------------------------------
-//
-void CCHSwiPlugin::RemoveWidgetsL( CLiwGenericParamList* aWidgets )
- {
- TInt pos ( 0 );
- aWidgets->FindFirst( pos, KResults );
- if( pos != KErrNotFound )
- {
- TLiwVariant variant = (*aWidgets)[pos].Value();
- variant.PushL();
- CLiwIterable* iterable = variant.AsIterable();
- iterable->Reset();
- if( iterable->NextL( variant ) )
- {
- CLiwDefaultMap *map = CLiwDefaultMap::NewLC();
- variant.Get( *map );
- if ( map->FindL( KDataMap, variant) )
- {
- CLiwDefaultMap *dataMap = CLiwDefaultMap::NewLC();
- variant.Get( *dataMap );
- if ( dataMap->FindL( KWidgetUid, variant ) )
- {
- TApaAppInfo appInfo;
-
- if( KErrNotFound == iApaLsSession.GetAppInfo(
- appInfo, TUid::Uid( variant.AsTInt32() ) ) )
- {
- if( map->FindL( KContentId, variant ) )
- {
- RemoveWidgetL( KPublisher, variant.AsDes() );
- RemoveWidgetL( KCpData, variant.AsDes() );
- }
- }
- }
- CleanupStack::PopAndDestroy( dataMap );
- }
- CleanupStack::PopAndDestroy( map );
- }
- CleanupStack::PopAndDestroy(&variant);
- }
- }
-
-// ----------------------------------------------------------------------------
-// CCHSwiPlugin::RemoveWidgetL
-// MMC watcher callback.
-// ----------------------------------------------------------------------------
-//
-void CCHSwiPlugin::RemoveWidgetL( const TDesC& aType,
- const TDesC& aContentId )
- {
- CLiwGenericParamList* inparam = CLiwGenericParamList::NewLC( );
- CLiwGenericParamList* outparam = CLiwGenericParamList::NewLC( );
- inparam->AppendL( TLiwGenericParam( KType, TLiwVariant( aType ) ) );
- CLiwDefaultMap* filter = CLiwDefaultMap::NewLC();
-
- filter->InsertL( KPublisherId, TLiwVariant( KHsWidgetPublisher ));
- filter->InsertL( KContentType, TLiwVariant( KHsPublisher ));
- filter->InsertL( KContentId, TLiwVariant( aContentId ));
- inparam->AppendL( TLiwGenericParam( KFilter, TLiwVariant( filter ) ) );
-
- iCPSInterface->ExecuteCmdL( KDelete, *inparam, *outparam );
-
- CleanupStack::PopAndDestroy( filter );
- CleanupStack::PopAndDestroy( outparam );
- CleanupStack::PopAndDestroy( inparam );
- }
-
-// End of File
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/data/chfactorysettingsplugin.rss Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* 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 registration for Factory Settings EC harvesting plugin
-*
-*/
-
-
-// INCLUDES
-#include <ecom/registryinfo.rh>
-#include <contentharvesterpluginuids.hrh>
-
-// RESOURCE DEFINITIONS
-// -----------------------------------------------------------------------------
-//
-// REGISTRY_INFO theInfo
-// Declares info for the "all" implementation
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE REGISTRY_INFO theInfo
- {
- // UID for the DLL
- dll_uid = 0x10282E6C;
- // Declare array of interface info
- interfaces =
- {
- INTERFACE_INFO
- {
- // UID of interface that is implemented
- interface_uid = KContentHarvesterPluginUid;
- implementations =
- {
- // Info for CADatFactorySettings
- IMPLEMENTATION_INFO
- {
- implementation_uid = 0x102830EF;
- version_no = 1;
- display_name = "factorysettings";
- default_data = "factorysettings";
- opaque_data = "factorysettings";
- }
- };
- }
- };
- }
-
-// End of File
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Content Publisher Plugin
-*
-*/
-
-
-PRJ_EXPORTS
-
-//XMLs used by this DLL are in main rom dir and are exported by main bld.inf
-PRJ_MMPFILES
-chfactorysettingsplugin.mmp
-
-
-// End of File
\ No newline at end of file
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/group/chfactorysettingsplugin.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
-* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Active Space Facory Settings
-*
-*/
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET chfactorysettingsplugin.dll
-TARGETTYPE PLUGIN
-UID 0x10009D8D 0x10282E6C
-CAPABILITY CAP_ECOM_PLUGIN
-
-LANG SC
-
-VENDORID VID_DEFAULT
-SOURCEPATH ../data
-START RESOURCE chfactorysettingsplugin.rss
-HEADER
-TARGET chfactorysettingsplugin.rsc
-TARGETPATH resource/plugins
-END
-
-SOURCEPATH ../src
-SOURCE chfactorysettingsplugin.cpp
-SOURCE chfactorysettingsinstallnotifier.cpp
-SOURCE chfactsetutils.cpp
-SOURCE chdbstatehandler.cpp
-SOURCE chfactorysettingsdomparser.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../../contentpublishingutils/contentpublishingdebug/inc
-USERINCLUDE ../../../contentpublishingserver/cpserver/inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-
-LIBRARY euser.lib
-LIBRARY estor.lib
-LIBRARY efsrv.lib
-LIBRARY bafl.lib
-LIBRARY ecom.lib
-LIBRARY xmlengineDOM.lib
-//AIW Plugin
-LIBRARY liwservicehandler.lib //AIW Framework
-#ifdef CONTENT_PUBLISHER_DEBUG
-LIBRARY cpdebug.lib
-#endif
-LIBRARY centralrepository.lib
-LIBRARY charconv.lib
-
-DEBUGLIBRARY flogger.lib
-
-// End of file
-
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chdbstatehandler.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +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: Central Repository about DB state change information observer
- *
-*/
-
-
-#ifndef C_CHDBSTATEHANDLER_H
-#define C_CHDBSTATEHANDLER_H
-
-#include <e32base.h> // For CActive, link against: euser.lib
-#include <f32file.h>
-
-
-class CRepository;
-class CCHFactorySettings;
-
-class CCHDbStateHandler :
- public CActive
- {
-public:
- /*
- * Destructor.
- */
- ~CCHDbStateHandler();
-
- /**
- * Two-phased constructor.
- */
- static CCHDbStateHandler* NewL( CCHFactorySettings* aCallback );
-
-private:
- /**
- * Simply constructor.
- */
- CCHDbStateHandler( CCHFactorySettings* aCallback );
-
- /**
- * 2nd phase constructor.
- */
- void ConstructL();
-
-private:
- /**
- * From CActive.
- * Invoke when asynchronous request will be completed.
- *
- * @since S60 S60 v3.1
- */
- void RunL();
-
- /**
- * From CActive.
- * Invoke for canceling asynchronous request.
- *
- * @since S60 S60 v3.1
- */
- void DoCancel();
-
- /**
- * Override to handle leaves from RunL(). Default implementation causes
- * the active scheduler to panic.
- *
- * @since S60 S60 v3.1
- */
- TInt RunError(TInt aError);
-
-private:
- /**
- */
- void ConstructFactorySettingsPathL();
-
- /**
- * Removes parsed Factory Settings files
- */
- void RemoveFactorySettingsParsedFilesL();
-
- /**
- * Handle repository db state.
- * If KSQLDBStateRestored state match then calls HandleRestoredDbStateL
- * remove repository db state KSQLDBStateRestored, add KSQLDBStateNormal.
- */
- void HandleDbStateL();
-
- /**
- * Handle restored db state.
- * Calls RemoveFactorySettingsParsedFilesL and call UpdateL on iCallback
- * member.
- */
- void HandleRestoredDbStateL();
-
-private:
-
- /**
- * Pointer to repository.
- * Own.
- */
- CRepository* iRepository;
-
- /**
- * Interface for notifying need of update after DB restore.
- * Not own.
- */
- CCHFactorySettings* iCallback;
-
- /**
- * File server session.
- */
- RFs iFs;
-
- /**
- * Path of parsed Factory Settings
- */
- TFileName iFSPath;
- };
-
-#endif // C_CHDBSTATEHANDLER_H
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsdomparser.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +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: factory settings functionality for content harvester
-*
-*/
-
-#ifndef CHFACTORYSETTINGSDOMPARSER_H_
-#define CHFACTORYSETTINGSDOMPARSER_H_
-
-// INCLUDES
-#include <e32base.h>
-
-#include <xmlengdomimplementation.h>
-#include <xmlengelement.h>
-#include <badesca.h>
-#include <f32file.h>
-
-class MLiwInterface;
-class CLiwDefaultMap;
-class CLiwContainer;
-class CLiwDefaultList;
-
-class CCHFactorySettingsDOMParser : public CBase
- {
- enum TTypes
- {
- EUndefined,
- EInteger,
- EUInteger,
- EDescriptor8,
- EDescriptor16,
- EMap,
- EList,
- EBool,
- EReal,
- EUid
- };
-
-public:
- // Constructors and destructor
-
- /**
- * Two-phased constructor.
- * @param aInterface Liw Interface.
- * @param aFs file session.
- */
- static CCHFactorySettingsDOMParser* NewL( MLiwInterface* aInterface,
- RFs& aFs );
-
- /**
- * Two-phased constructor.
- * @param aInterface Liw Interface.
- * @param aFs file session.
- */
- static CCHFactorySettingsDOMParser* NewLC( MLiwInterface* aInterface,
- RFs& aFs );
-
- /**
- * Destructor.
- */
- virtual ~CCHFactorySettingsDOMParser();
-
-public: // new functions
-
- /**
- * Restores all factory settings
- *
- * @param aStr Path to file.
- * @param aUnInstall mark indicating add or remove option.
- */
- TInt Restore( const TDesC& aStr, TBool aUnInstall=EFalse );
-
-private:
-
- /**
- * C++ default constructor.
- * @param aFs file session.
- */
- CCHFactorySettingsDOMParser( RFs& aFs );
-
- /**
- * By default Symbian 2nd phase constructor is private.
- * @param aInterface Liw Interface.
- */
- void ConstructL( MLiwInterface* aInterface );
-
-private: // new functions
-
- /**
- * Parse xml files.
- * @param aFilePath Path to file.
- * @param aUnInstall mark indicating add or remove option.
- */
- void ParseFactorySettingsFileL( const TDesC& aFilePath,
- TBool aUnInstall );
-
- /**
- * Converts type from TDesC to TTypes.
- * @param aType type key as attributes.
- */
- TTypes ConvertToType( const TDesC& aType );
-
- /**
- * Removes an item from the database.
- * @param aNode A node.
- * @param aMap CLiwDefaultMap with item.
- */
- void RemoveItemL(
- const TXmlEngElement& aNode,
- CLiwDefaultMap* aMap );
- /**
- * Adds an item do the database.
- * @param aNode An "item" node.
- * @param aContainer container with item.
- * @param aType type of item.
- */
- void AddItemL( const TXmlEngElement& aNode,
- CLiwContainer* aContainer,
- TTypes aType );
-
- /**
- * Extracts deleted attributes from "item" node.
- * @param aNode An "item" node.
- * @param aMap CLiwDefaultMap with item.
- */
- void ExtractDeleteAttributesL(
- const TXmlEngElement& aNode,
- CLiwDefaultMap* aMap );
-
- /**
- * Extracts and adds attributes from "item" node to map.
- * @param aNode An "item" node.
- * @param aMap CLiwDefaultMap with item.
- */
- void ExtractAttributesAndAddL(
- const TXmlEngElement& aNode,
- CLiwDefaultMap* aMap );
-
- /**
- * Extracts and adds attributes from "item" node to list.
- * @param aItem An "item" node.
- * @param aList CLiwDefaultList with item.
- */
- void ExtractAttributesAndAddL(
- const TXmlEngElement& aNode,
- CLiwDefaultList* aList );
-
-private:
- // Data
-
- /**
- * CPS interface
- * Not own
- */
- MLiwInterface* iCPSInterface;
-
- /*
- * File server session.Not Own
- */
- RFs iFs;
-
- };
-
-#endif /* CHFACTORYSETTINGSDOMPARSER_H_ */
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsglobals.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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 T_CHFACTORYSETTINGSGLOBALS_H
-#define T_CHFACTORYSETTINGSGLOBALS_H
-
-//
-const TInt KRootItemId( -1 );
-const TInt KMaxIntString( 10 );
-
-_LIT8( KNullDes8, "" );
-
-// CONSTANTS
-_LIT( KMainDataItem, "cps:data" );
-_LIT( KMainPublisherItem, "cps:publisher" );
-_LIT( KDataItem, "cps:data_item" );
-_LIT8( KDataItem8, "data_item" );
-_LIT( KNoArgumentsString, "-1" );
-_LIT( KAttributeKey, "key" );
-_LIT8( KAttributeKey8, "key" );
-_LIT( KAttributeType, "type" );
-_LIT8( KAttributeType8, "type" );
-_LIT( KAttributeValue, "value" );
-_LIT8( KAttributeValue8, "value" );
-_LIT( KTrue, "true" );
-_LIT( KFalse, "false" );
-
-//Supported Types
-_LIT( KInteger, "integer" );
-_LIT( KUInteger, "uinteger" );
-_LIT( KDescriptor8, "string8" );
-_LIT( KDescriptor16, "string" );
-_LIT( KMap, "map" );
-_LIT( KList, "list" );
-_LIT( KBool, "bool" );
-_LIT( KReal, "float" );
-_LIT( KUid, "uid" );
-
-#endif // T_CHFACTORYSETTINGSGLOBALS_H
-// End of file
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsinstallnotifier.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Sis package installation event listener
- *
-*/
-
-
-#ifndef C_CCHFACTORYSETTINGSINSTALLNOTIFIER_H
-#define C_CCHFACTORYSETTINGSINSTALLNOTIFIER_H
-
-#include <e32base.h>
-#include <e32property.h>
-
-class CCHFactorySettings;
-
-/**
- * Central Repository notifier.
- *
- * @since S60 S60 v3.1
- */
-class CCHFactorySettingsInstallNotifier : public CActive
- {
- /**
- * Enum defining the purpouse of the installation event.
- */
- enum TInstOp
- {
- EInstOpNone = 0x00000000,
- EInstOpInstall = 0x00000001,
- EInstOpUninstall = 0x00000002,
- EInstOpRestore = 0x00000004
- };
-
- /**
- * Enum defining the exit status of the installation event.
- */
- enum TInstOpStatus
- {
- EInstOpStatusNone = 0x00000000,
- EInstOpStatusSuccess = 0x00000100,
- EInstOpStatusAborted = 0x00000200
- };
-
-public:
-
- /**
- * Creates an instance of CCHFactorySettingsInstallNotifier implementation.
- * @param aCallBack Reference to notifier interface.
- * @param aCategory Package uid.
- * @param aKey Key for central repository.
- */
- static CCHFactorySettingsInstallNotifier* NewL(
- CCHFactorySettings* aCallback, TUid aCategory, TUint aKey );
-
- /**
- * Destructor.
- */
- virtual ~CCHFactorySettingsInstallNotifier();
-
-private:
- /**
- * Constructor.
- * @param aCallBack Reference to notifier interface.
- * @param aCategory Package uid.
- * @param aKey Key for central repository.
- */
- CCHFactorySettingsInstallNotifier( CCHFactorySettings* aCallback,
- TUid aCategory, TUint aKey );
-
- /**
- * Symbian 2nd phase constructor.
- */
- void ConstructL();
-
- /**
- * From CActive.
- */
- void DoCancel();
-
- /**
- * From CActive.
- */
- void RunL();
-
- /**
- * From CActive.
- */
- TInt RunError( TInt aError );
-
-private:
- /**
- * User side interface to Publish & Subscribe.
- * Own.
- */
- RProperty iProperty;
-
- /**
- * Interface for notifying changes in SWI.
- * Not own.
- */
- CCHFactorySettings* iCallback;
-
- /**
- * Category uid.
- * Own.
- */
- TUid iCategory;
-
- /**
- * Key identifier.
- * Own.
- */
- TUint iKey;
-
- };
-
-#endif // C_CCHFACTORYSETTINGSINSTALLNOTIFIER_H
-// End of File
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsplugin.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
-* 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_CCHFACTORYSETTINGS_H
-#define C_CCHFACTORYSETTINGS_H
-
-#include <contentharvesterplugin.h>
-#include <f32file.h>
-#include <badesca.h>
-
-class MLiwInterface;
-class CCHFactorySettingsInstallNotifier;
-class CFileMan;
-class CCHDbStateHandler;
-class CCHFactorySettingsDOMParser; // mw
-
-class CCHFactorySettings : public CContentHarvesterPlugin
-
- {
-public:
- // Constructors and destructor
-
- /**
- * Two-phased constructor.
- * @param aStorage instance of AS storage DB
- */
- static CCHFactorySettings* NewL( MLiwInterface* aInterface );
- static CCHFactorySettings* NewLC( MLiwInterface* aInterface );
- /**
- * C++ destructor
- */
- ~CCHFactorySettings();
-private:
-
- /**
- * C++ default constructor.
- */
- CCHFactorySettings();
-
- /**
- * By default Symbian 2nd phase constructor is private.
- */
- void ConstructL( MLiwInterface* aInterface );
- /**
- * CreateStorageL.
- */
- void CreateStorageL();
- /**
- * AddNewL.
- */
- void AddNewL();
- /**
- * UnInstallL.
- */
- void UnInstallL();
- /**
- * CheckDrivesL.
- */
- void CheckDrivesL();
-
-public:
- // from CADatServerPlugin
- /**
- * This function updates all information in CPS related to FactorySettings
- */
- void UpdateL();
-
-private:
- /**
- * Data base state handler
- */
- CCHDbStateHandler* iDBStateHandler;
-
- /**
- * Sis installation notifier
- */
- CCHFactorySettingsInstallNotifier* iInstallNotifier;
-
- /**
- *List containing xml files that should be installed from all drives
- */
- CDesCArrayFlat* iFileNewList;
-
- /**
- * File server session
- */
- RFs iFs;
-
- /**
- * File manager used for files copying
- */
- CFileMan* iFileMan;
-
- /**
- * An interface to Content Publisher Service
- */
- MLiwInterface* iCPSInterface;
-
- /**
- * Pointer to a parser object
- */
- CCHFactorySettingsDOMParser* iParser; //
-
- /**
- * Descriptor containing a path to a directory with files to parse
- */
- RBuf iFilePath;
-
- };
-
-#endif // C_CCHFACTORYSETTINGS_H
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactsetutils.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +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: Utils methods.
- *
-*/
-
-
-#ifndef FACTSETCHUTILS_H
-#define FACTSETCHUTILS_H
-
-// INCLUDES
-#include <e32base.h>
-
-// CLASS DECLARATION
-class CGECODefaultObject;
-class MXCFWNode;
-
-/**
- * Common utils methods.
- *
- * @lib aspafactorysettings.lib
- * @since Series 60 3.1
- */
-class FactSetCHUtils
- {
-public:
- // New functions
-
- /**
- * Extracts a TUint from the given string.
- * @since Series 60 3.1
- * @param aStr A string defining the uint.
- * @return TUint Object.
- */
- static TUint Str2Uint( const TDesC& aStr );
-
- /**
- * Extracts a TInt from the given string.
- * @since Series 60 3.1
- * @param aStr A string defining the int.
- * @return TInt Object.
- */
- static TInt Str2Int( const TDesC& aStr );
-
- /**
- * Extracts a TBool from the given string.
- * @since Series 60 3.1
- * @param aStr A string defining the bool.
- * @return TBool Object.
- */
- static TBool Str2Bool( const TDesC& aStr );
-
- /**
- * Extracts a TUid from the given string.
- * @since Series 60 3.1
- * @param aStr A string defining the uid.
- * @return Uid Object.
- */
- static TUid Str2Uid( const TDesC& aStr );
-
- /**
- * Creates HBufC8* from the given string.
- * @since Series 60 3.1
- * @param aStr A string to convert to HBufC8*.
- * @return HBufC8* Pointer.
- */
- static HBufC8* Str2Str8LC( const TDesC& aStr );
-
- /**
- * Extracts a TReal from the given string.
- * @since Series 60 3.1
- * @param aStr A string defining the real value.
- * @return Real Object.
- */
- static TReal Str2Real( const TDesC& aStr );
-
- /**
- * Extracts a TInt from the given string.
- * @since Series 60 3.1
- * @param aStr A string defining the real value.
- * @return Real Object.
- */
- static TInt32 Str2Int32( const TDesC& aStr );
-
-private:
-
- /**
- * Extracts an integer from the given hex string.
- * @since Series 60 3.1
- * @param aStr A hex string containg an integer number.
- * @return Integer value of the number.
- */
- static TUint StrHex2Uint( const TDesC& aStr );
-
- /**
- * Extracts an integer from the given string.
- * @since Series 60 3.1
- * @param aStr A string containg an integer number.
- * @return Integer value of the number.
- */
- static TUint StrDec2Uint( const TDesC& aStr );
-
- /**
- * Handles bad argument passed into utility function
- * @since Series 60 3.1
- * @param aCategory describes bad argument
- * @param aArgument bad argument
- * @param aReason bad argument code
- */
- static void BadArgument( const TDesC& aCategory, const TDesC& aArgument,
- TInt aReason );
- static void BadArgumentL( const TDesC& aCategory, const TDesC& aArgument,
- TInt aReason );
-
- /**
- * Handles bad argument passed into utility function
- * @since Series 60 3.1
- * @param aCategory describes bad argument
- * @param aArgument bad argument
- * @param aReason bad argument code
- */
- static void BadArgument( const TDesC& aCategory, TInt aArgument,
- TInt aReason );
-
- /**
- * Handles bad argument passed into utility function
- * @since Series 60 3.1
- * @param aCategory describes bad argument
- * @param aReason bad argument code
- */
- static void BadArgument( const TDesC& aCategory, TInt aReason );
-
- };
-
-#endif // FACTSETCHUTILS_H
-// End of File
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/src/chdbstatehandler.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +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: Central Repository about DB state change information observer
- *
-*/
-
-#include <centralrepository.h>
-#include <f32file.h>
-#include "cpserverdef.h"
-#include "chdbstatehandler.h"
-#include "chfactorysettingsplugin.h"
-
-
-_LIT( KParsedDir, "parsed\\fs\\" );
-_LIT( KDriveC, "C:" );
-
-
-// ============================ MEMBER FUNCTIONS =============================
-
-// -----------------------------------------------------------------------------
-// CCHDbStateHandler::CCHDbStateHandler()
-//
-// -----------------------------------------------------------------------------
-//
-CCHDbStateHandler::CCHDbStateHandler( CCHFactorySettings* aCallback ) :
- CActive( EPriorityStandard ), // Standard priority
- iCallback( aCallback )
- {
- }
-
-// -----------------------------------------------------------------------------
-// CCHDbStateHandler::NewL()
-// Two-phased constructor
-// -----------------------------------------------------------------------------
-//
-CCHDbStateHandler* CCHDbStateHandler::NewL(
- CCHFactorySettings* aCallback )
- {
- CCHDbStateHandler* self = new (ELeave) CCHDbStateHandler( aCallback );
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CCHDbStateHandler::NewL()
-// Constructor
-// -----------------------------------------------------------------------------
-//
-void CCHDbStateHandler::ConstructL()
- {
- User::LeaveIfError( iFs.Connect() );
- ConstructFactorySettingsPathL();
- iRepository = CRepository::NewL( KServerUid );
- HandleDbStateL();
- CActiveScheduler::Add(this); // Add to scheduler
- iRepository->NotifyRequest( KCPStorageUid, iStatus );
- iStatus = KRequestPending;
- SetActive();
- }
-
-// -----------------------------------------------------------------------------
-// CCHDbStateHandler::NewL()
-//
-// -----------------------------------------------------------------------------
-//
-CCHDbStateHandler::~CCHDbStateHandler()
- {
- Cancel(); // Cancel any request, if outstanding
- delete iRepository;
- iFs.Close();
- }
-
-// -----------------------------------------------------------------------------
-// CCHDbStateHandler::NewL()
-//
-// -----------------------------------------------------------------------------
-//
-void CCHDbStateHandler::DoCancel()
- {
- iRepository->NotifyCancel( KCPStorageUid );
- }
-
-// -----------------------------------------------------------------------------
-// CCHDbStateHandler::RunL()
-//
-// -----------------------------------------------------------------------------
-//
-void CCHDbStateHandler::RunL()
- {
- // status contais information about event type
- if (iStatus.Int() >= KErrNone)
- {
- HandleDbStateL();
- iRepository->NotifyRequest( KCPStorageUid, iStatus );
- iStatus = KRequestPending;
- SetActive();
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCHDbStateHandler::RunError()
-//
-// -----------------------------------------------------------------------------
-//
-TInt CCHDbStateHandler::RunError(TInt aError)
- {
- return aError;
- }
-
-// -----------------------------------------------------------------------------
-// CCHDbStateHandler::ConstructFactorySettingsPathL()
-//
-// -----------------------------------------------------------------------------
-//
-void CCHDbStateHandler::ConstructFactorySettingsPathL()
- {
- TFileName privatePath;
- User::LeaveIfError( iFs.PrivatePath( privatePath ) );
- iFSPath.Append( KDriveC );
- iFSPath.Append( privatePath );
- iFSPath.Append( KParsedDir );
- }
-
-// -----------------------------------------------------------------------------
-// CCHDbStateHandler::RemoveFactorySettingsParsedFilesL()
-//
-// -----------------------------------------------------------------------------
-//
-void CCHDbStateHandler::RemoveFactorySettingsParsedFilesL()
- {
- CFileMan* fileManager = CFileMan::NewL( iFs );
- CleanupStack::PushL( fileManager );
- fileManager->Delete( iFSPath, CFileMan::ERecurse );
- CleanupStack::PopAndDestroy( fileManager );
- }
-
-// -----------------------------------------------------------------------------
-// CCHDbStateHandler::HandleDbStateL()
-//
-// -----------------------------------------------------------------------------
-//
-void CCHDbStateHandler::HandleDbStateL()
- {
- TInt value( 0 );
- if( iRepository->Get( KCPStorageUid, value ) == KErrNone )
- {
- if( value & KSQLDBStateRestored )
- {
- HandleRestoredDbStateL();
- value ^= KSQLDBStateRestored;
- value |= KSQLDBStateNormal;
- iRepository->Set( KCPStorageUid, value );
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCHDbStateHandler::HandleRestoredStateL()
-//
-// -----------------------------------------------------------------------------
-//
-void CCHDbStateHandler::HandleRestoredDbStateL()
- {
- RemoveFactorySettingsParsedFilesL();
- iCallback->UpdateL();
- }
-
-
-//End file
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactorysettingsdomparser.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,484 +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: factory settings for content harvester
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <driveinfo.h>
-#include <xmlengnodelist.h>
-#include <xmlengdomparser.h>
-#include <xmlengdocument.h>
-#include <utf.h>
-#include <liwservicehandler.h>
-#include "chfactorysettingsdomparser.h"
-#include "chfactorysettingsglobals.h"
-#include "chfactsetutils.h"
-#include "cpdebug.h"
-
-// CONSTANTS
-_LIT8( KMainDataItem8, "data" );
-_LIT8( KMainPublisherItem8, "publisher" );
-_LIT8( KType, "type" );
-_LIT8( KItem, "item" );
-_LIT8( KData, "data" );
-_LIT8( KAdd, "Add" );
-_LIT8( KDelete, "Delete" );
-_LIT8( KCpData, "cp_data" );
-_LIT8( KPublisher, "publisher" );
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::CCHFactorySettingsDOMParser
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CCHFactorySettingsDOMParser::CCHFactorySettingsDOMParser( RFs& aFs ):
- iFs( aFs )
- {
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CCHFactorySettingsDOMParser::ConstructL( MLiwInterface* aInterface )
- {
- iCPSInterface = aInterface;
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CCHFactorySettingsDOMParser* CCHFactorySettingsDOMParser::NewL(
- MLiwInterface* aInterface, RFs& aFs )
- {
- CCHFactorySettingsDOMParser* self = NewLC( aInterface, aFs );
- CleanupStack::Pop( self );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::NewLC
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CCHFactorySettingsDOMParser* CCHFactorySettingsDOMParser::NewLC(
- MLiwInterface* aInterface, RFs& aFs )
- {
- CCHFactorySettingsDOMParser* self = new( ELeave ) CCHFactorySettingsDOMParser( aFs );
- CleanupStack::PushL( self );
- self->ConstructL( aInterface );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::~CCHFactorySettingsDOMParser
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CCHFactorySettingsDOMParser::~CCHFactorySettingsDOMParser()
- {
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::Restore
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TInt CCHFactorySettingsDOMParser::Restore( const TDesC& aStr, TBool aUnInstall )
- {
- TRAPD( err, ParseFactorySettingsFileL( aStr, aUnInstall ) );
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::ParseFactorySettingsFileL
-// -----------------------------------------------------------------------------
-//
-void CCHFactorySettingsDOMParser::ParseFactorySettingsFileL(
- const TDesC& aFilePath, TBool aUnInstall )
- {
- RXmlEngDOMImplementation domImpl;
- CleanupClosePushL( domImpl );
- domImpl.OpenL();
-
- RXmlEngDOMParser parser;
- CleanupClosePushL( parser );
- User::LeaveIfError( parser.Open( domImpl ) );
-
- RXmlEngDocument doc = parser.ParseFileL( aFilePath );
- CleanupClosePushL( doc );
-
- TXmlEngElement docElement = doc.AsElement(); // cast node to element node
-
- TXmlEngElement element = docElement.FirstChild().AsElement();
-
- RXmlEngNodeList<TXmlEngElement> elementList;
- CleanupClosePushL( elementList );
-
- element.GetChildElements( elementList );// to remove
-
- while( elementList.HasNext() )
- {
- element = elementList.Next();
- TPtrC8 typeIdentifier( element.Name() );
- if( !( typeIdentifier.CompareC( KMainDataItem8 ) ) ||
- !( typeIdentifier.CompareC( KMainPublisherItem8 ) ) )
- {
- CLiwGenericParamList* inparam = CLiwGenericParamList::NewLC();
- CLiwGenericParamList* outparam = CLiwGenericParamList::NewLC();
- CLiwDefaultMap* map = CLiwDefaultMap::NewLC();
-
- if( !( typeIdentifier.CompareC( KMainDataItem8 ) ) )
- {
- TLiwGenericParam item_type( KType, TLiwVariant( KCpData ));
- inparam->AppendL( item_type );
- }
- else
- {
- TLiwGenericParam item_type( KType, TLiwVariant( KPublisher ));
- inparam->AppendL( item_type );
- }
-
- if( aUnInstall )
- {
- // remove
- RemoveItemL(element, map);
- TLiwGenericParam item( KData, TLiwVariant( map ));
- inparam->AppendL( item );
- iCPSInterface->ExecuteCmdL( KDelete, *inparam, *outparam );
- }
- else
- {
- // add
- AddItemL( element, map, EMap );
- TLiwGenericParam item( KItem, TLiwVariant( map ));
- inparam->AppendL( item );
- iCPSInterface->ExecuteCmdL( KAdd, *inparam, *outparam );
- }
-
- CleanupStack::PopAndDestroy( map );
- CleanupStack::PopAndDestroy( outparam );
- CleanupStack::PopAndDestroy( inparam );
- }
- }
-
- CleanupStack::PopAndDestroy( &elementList );
- CleanupStack::PopAndDestroy( &doc );
- CleanupStack::PopAndDestroy( &parser );
- CleanupStack::PopAndDestroy( &domImpl );
-
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::AddItemL
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CCHFactorySettingsDOMParser::AddItemL( const TXmlEngElement& aNode,
- CLiwContainer* aContainer, TTypes aType )
- {
- RXmlEngNodeList<TXmlEngElement> children;
- CleanupClosePushL( children );
- aNode.GetChildElements( children );
-
- while( children.HasNext() )
- {
- TXmlEngElement node = children.Next();
- TPtrC8 typeIdentifier( node.Name() );
- if( !( typeIdentifier.CompareC( KDataItem8 ) ) )
- {
- switch ( aType )
- {
- case EMap:
- ExtractAttributesAndAddL( node,
- static_cast<CLiwDefaultMap*>(aContainer) );
- break;
- case EList:
- ExtractAttributesAndAddL( node,
- static_cast<CLiwDefaultList*>( aContainer ) );
- break;
- default:
- {
- User::Panic( _L("Wrong Type" ),1 );
- }
- }
- }
- }
-
- CleanupStack::PopAndDestroy( &children );
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::RemoveItemL
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CCHFactorySettingsDOMParser::RemoveItemL( const TXmlEngElement& aNode,
- CLiwDefaultMap* aMap )
- {
- CP_DEBUG(_L8("CCHFactorySettingsDOMParser::RemoveItemL" ));
- RXmlEngNodeList<TXmlEngElement> children;
- CleanupClosePushL( children );
-
- aNode.GetChildElements( children );
-
- while( children.HasNext() )
- {
- TXmlEngElement node = children.Next();
- TPtrC8 typeIdentifier( node.Name() );
- if( !( typeIdentifier.CompareC( KDataItem8 ) ) )
- {
- ExtractDeleteAttributesL( node, aMap );
- }
- }
- CleanupStack::PopAndDestroy( &children );
- }
-
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::ExtractDeleteAttributesL
-// -----------------------------------------------------------------------------
-//
-void CCHFactorySettingsDOMParser::ExtractDeleteAttributesL(
- const TXmlEngElement& aNode,
- CLiwDefaultMap* aMap )
- {
- CP_DEBUG(_L8("CCHFactorySettingsDOMParser::ExtractDeleteAttributesL" ));
-
- TPtrC8 key = aNode.AttributeValueL(KAttributeKey8);
- TPtrC8 value = aNode.AttributeValueL(KAttributeValue8);
- HBufC* type = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
- aNode.AttributeValueL(KAttributeType8));
- CleanupStack::PushL( type );
-
- if ( key.Compare( KNullDesC8 ) != 0
- && type->Compare( KNullDesC ) != 0
- && value.Compare( KNullDesC8 ) != 0 )
- {
- HBufC* value16 = NULL;
- switch ( ConvertToType( *type ) )
- {
- case EDescriptor8:
- aMap->InsertL( key, value );
- break;
- case EDescriptor16:
- value16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L( value );
- CleanupStack::PushL( value16 );
- aMap->InsertL( key, *value16 );
- CleanupStack::PopAndDestroy( value16 );
- break;
- default:
- {
- //wrong type - ignore
- }
- }
- }
- CleanupStack::PopAndDestroy( type );
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::ExtractAttributesAndAddL
-// -----------------------------------------------------------------------------
-//
-void CCHFactorySettingsDOMParser::ExtractAttributesAndAddL(
- const TXmlEngElement& aNode, CLiwDefaultMap* aMap )
- {
- CP_DEBUG(_L8("CCHFactorySettingsDOMParser::ExtractAttributesAndAddL" ));
- TPtrC8 key = aNode.AttributeValueL(KAttributeKey8);
- HBufC* type = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
- aNode.AttributeValueL(KAttributeType8));
- CleanupStack::PushL( type );
-
- if ( key.Compare( KNullDesC8 ) != 0
- && type->Compare( KNullDesC ) != 0 )
- {
- HBufC* value = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
- aNode.AttributeValueL(KAttributeValue8));
- CleanupStack::PushL( value );
- TTypes typeCheck = ConvertToType( *type );
- //check if value exist
- //it is not needed in case of Map and List
- if ( value->Compare( KNullDesC ) != 0
- || typeCheck == EMap
- || typeCheck == EList )
- {
- HBufC8* bufV = NULL;
- CLiwDefaultMap* nestedMap = NULL;
- CLiwDefaultList* nestedList = NULL;
-
- switch ( typeCheck )
- {
- case EInteger:
- aMap->InsertL( key, FactSetCHUtils::Str2Int32( *value ) );
- break;
- case EUInteger:
- aMap->InsertL( key, FactSetCHUtils::Str2Uint( *value ) );
- break;
- case EDescriptor8:
- bufV = FactSetCHUtils::Str2Str8LC( *value );
- aMap->InsertL( key, *bufV );
- CleanupStack::PopAndDestroy( bufV );
- break;
- case EDescriptor16:
- aMap->InsertL( key, *value );
- break;
- case EMap:
- nestedMap = CLiwDefaultMap::NewLC();
- AddItemL( aNode, nestedMap, EMap );
- aMap->InsertL( key, nestedMap );
- CleanupStack::PopAndDestroy( nestedMap );
- break;
- case EList:
- nestedList = CLiwDefaultList::NewLC();
- AddItemL( aNode, nestedList, EList );
- aMap->InsertL( key, nestedList );
- CleanupStack::PopAndDestroy( nestedList );
- break;
- case EBool:
- aMap->InsertL( key, FactSetCHUtils::Str2Bool( *value ) );
- break;
- case EReal:
- aMap->InsertL( key, FactSetCHUtils::Str2Real( *value ) );
- break;
- case EUid:
- aMap->InsertL( key, FactSetCHUtils::Str2Uid( *value ) );
- break;
- default:
- {
- //wrong type - ignore
- }
- }
- }
- CleanupStack::PopAndDestroy( value );
- }
- CleanupStack::PopAndDestroy( type );
- }
-
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::ExtractAttributesAndAddL
-// -----------------------------------------------------------------------------
-//
-void CCHFactorySettingsDOMParser::ExtractAttributesAndAddL(
- const TXmlEngElement& aNode, CLiwDefaultList* aList )
- {
- CP_DEBUG( _L8( "CCHFactorySettingsDOMParser::ExtractAttributesAndAddL" ) );
-
- HBufC* type = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
- aNode.AttributeValueL(KAttributeType8));
- CleanupStack::PushL( type );
-
- if( type->Compare( KNullDesC ) != 0 )
- {
- HBufC* value = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
- aNode.AttributeValueL(KAttributeValue8));
- CleanupStack::PushL( value );
- TTypes typeCheck = ConvertToType( *type );
- //check if value exist
- //it is not needed in case of Map and List
- if( value->Compare( KNullDesC ) != 0
- || typeCheck == EMap
- || typeCheck == EList )
- {
- HBufC8* bufV = NULL;
- CLiwDefaultMap* nestedMap = NULL;
- CLiwDefaultList* nestedList = NULL;
-
- switch( typeCheck )
- {
- case EInteger:
- aList->AppendL( FactSetCHUtils::Str2Int32( *value ) );
- break;
- case EUInteger:
- aList->AppendL( FactSetCHUtils::Str2Uint( *value ) );
- break;
- case EDescriptor8:
- bufV = FactSetCHUtils::Str2Str8LC( *value );
- aList->AppendL( *bufV );
- CleanupStack::PopAndDestroy( bufV );
- break;
- case EDescriptor16:
- aList->AppendL( value );
- break;
- case EMap:
- nestedMap = CLiwDefaultMap::NewLC();
- AddItemL( aNode, nestedMap, EMap );
- aList->AppendL( nestedMap );
- CleanupStack::PopAndDestroy( nestedMap );
- break;
- case EList:
- nestedList = CLiwDefaultList::NewLC();
- AddItemL( aNode, nestedList, EList );
- aList->AppendL( nestedList );
- CleanupStack::PopAndDestroy( nestedList );
- break;
- case EBool:
- aList->AppendL( FactSetCHUtils::Str2Bool( *value ) );
- break;
- case EReal:
- aList->AppendL( FactSetCHUtils::Str2Real( *value ) );
- break;
- case EUid:
- aList->AppendL( FactSetCHUtils::Str2Uid( *value ) );
- break;
- default:
- {
- //wrong type - ignore
- }
- }
- }
- CleanupStack::PopAndDestroy( value );
- }
- CleanupStack::PopAndDestroy( type );
- }
-
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsDOMParser::ConvertToType
-// -----------------------------------------------------------------------------
-//
-CCHFactorySettingsDOMParser::TTypes CCHFactorySettingsDOMParser::ConvertToType(
- const TDesC& aType )
- {
- CP_DEBUG(_L8("CCHFactorySettingsDOMParser::ConvertToType" ));
- if ( !aType.Compare( KInteger ) )
- return EInteger;
- if ( !aType.Compare( KUInteger ) )
- return EUInteger;
- if ( !aType.Compare( KDescriptor8 ) )
- return EDescriptor8;
- if ( !aType.Compare( KDescriptor16 ) )
- return EDescriptor16;
- if ( !aType.Compare( KMap ) )
- return EMap;
- if ( !aType.Compare( KList ) )
- return EList;
- if ( !aType.Compare( KBool ) )
- return EBool;
- if ( !aType.Compare( KReal ) )
- return EReal;
- if ( !aType.Compare( KUid ) )
- return EUid;
- return EUndefined;
- }
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactorysettingsinstallnotifier.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Sis package installation event listener
- *
-*/
-
-
-#include <sacls.h>
-#include "chfactorysettingsinstallnotifier.h"
-#include "chfactorysettingsplugin.h"
-#include "cpdebug.h"
-
-// ============================ MEMBER FUNCTIONS =============================
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsInstallNotifier::CCHFactorySettingsInstallNotifier
-// C++ default constructor
-// -----------------------------------------------------------------------------
-//
-CCHFactorySettingsInstallNotifier::CCHFactorySettingsInstallNotifier(
- CCHFactorySettings* aCallback, TUid aCategory, TUint aKey ) :
- CActive(EPriorityNormal)
- {
- CActiveScheduler::Add( this );
-
- iCallback = aCallback;
- iCategory = aCategory;
- iKey = aKey;
- // Prepare automatically
- iProperty.Attach( iCategory, iKey );
- SetActive( );
- iProperty.Subscribe( iStatus );
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettingsInstallNotifier::ConstructL
-// S2nd phase constructor.
-// -----------------------------------------------------------------------------
-//
-void CCHFactorySettingsInstallNotifier::ConstructL()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-// CCHFactorySettingsInstallNotifier::NewL
-// ---------------------------------------------------------------------------
-//
-CCHFactorySettingsInstallNotifier* CCHFactorySettingsInstallNotifier::NewL(
- CCHFactorySettings* aCallback, TUid aCategory, TUint aKey )
- {
- CCHFactorySettingsInstallNotifier* self =
- new (ELeave) CCHFactorySettingsInstallNotifier( aCallback,
- aCategory, aKey );
- CleanupStack::PushL( self );
- self->ConstructL( );
- CleanupStack::Pop( self );
-
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CCHFactorySettingsInstallNotifier::~CCHFactorySettingsInstallNotifier
-// ---------------------------------------------------------------------------
-//
-CCHFactorySettingsInstallNotifier::~CCHFactorySettingsInstallNotifier()
- {
- Cancel( );
- iProperty.Close( );
- }
-
-// ---------------------------------------------------------------------------
-// CCHFactorySettingsInstallNotifier::DoCancel
-// ---------------------------------------------------------------------------
-//
-void CCHFactorySettingsInstallNotifier::DoCancel()
- {
- iProperty.Cancel( );
- }
-
-// ---------------------------------------------------------------------------
-// CCHFactorySettingsInstallNotifier::RunError
-// ---------------------------------------------------------------------------
-//
-TInt CCHFactorySettingsInstallNotifier::RunError( TInt /*aError*/)
- {
-
- // No need to do anything
- return KErrNone;
- }
-
-// ---------------------------------------------------------------------------
-// CCHFactorySettingsInstallNotifier::RunL
-// ---------------------------------------------------------------------------
-//
-void CCHFactorySettingsInstallNotifier::RunL()
- {
- CP_DEBUG(_L8("CCHFactorySettingsInstallNotifier::RunL" ));
- // Re-issue request before notifying
- SetActive( );
- iProperty.Subscribe( iStatus );
-
- TInt status;
- User::LeaveIfError( iProperty.Get( KUidSystemCategory,
- KSAUidSoftwareInstallKeyValue, status ) );
-
- if ( (status & EInstOpInstall )||(status & EInstOpUninstall ) )
- {
- iCallback->UpdateL( );
- }
-
- }
-// End of File
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactorysettingsplugin.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,337 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-// INCLUDE FILES
-
-#include <ecom/implementationproxy.h>
-#include <sacls.h>
-
-#include "chfactorysettingsinstallnotifier.h"
-#include "cpdebug.h"
-#include "chdbstatehandler.h"
-#include "chfactorysettingsdomparser.h"
-#include "chfactorysettingsplugin.h"
-
-// LOCAL CONSTANTS AND MACROS
-const TInt KADatFactorySettingsServerPluginUid( 0x102830EF);
-// Dynamically loaded data storage handler
-
-const TInt KDefaultGranularity = 5;
-
-_LIT( KDirFSNew, "import\\fs\\" );
-_LIT( KParsedDir, "parsed\\fs\\" );
-_LIT( KParsed, "parsed\\" );
-_LIT( KFs, "fs\\" );
-
-_LIT( KDriveC, "C:" );
-_LIT( KColen, ":" );
-
-// Map the interface UIDs to implementation factory functions
-const TImplementationProxy ImplementationTable[] =
- {
- {
- {
- KADatFactorySettingsServerPluginUid
- }, ( TProxyNewLPtr )CCHFactorySettings::NewL
- }
- };
-
-// ----------------------------------------------------------------------------
-// ImplementationGroupProxy
-// Exported proxy for instantiation method resolution
-// ----------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy*
-ImplementationGroupProxy( TInt& aTableCount )
- {
- aTableCount = sizeof( ImplementationTable ) /
- sizeof( TImplementationProxy );
- return ImplementationTable;
- }
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettings::CCHFactorySettings
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CCHFactorySettings::CCHFactorySettings()
- {
-
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettings::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CCHFactorySettings::ConstructL( MLiwInterface* aInterface )
- {
- CP_DEBUG(_L8("CCHFactorySettings::ConstructL" ));
- iCPSInterface = aInterface;
- iFileNewList = new (ELeave) CDesCArrayFlat(KDefaultGranularity);
- User::LeaveIfError( iFs.Connect( ) );
- iInstallNotifier = CCHFactorySettingsInstallNotifier::NewL( this,
- KUidSystemCategory, KSAUidSoftwareInstallKeyValue );
-
- iParser = CCHFactorySettingsDOMParser::NewL( iCPSInterface, iFs ); // mw
-
- iFileMan = CFileMan::NewL( iFs );
- iFilePath.CreateL( KMaxPath );
-
- iFs.CreatePrivatePath( EDriveC );
- User::LeaveIfError( iFs.PrivatePath( iFilePath ) );
-
- //create "parsed" directory if it doesn't exist yet;
- RBuf filePath;
- filePath.CreateL( KMaxPath );
- filePath.Append( KDriveC );
- filePath.Append( iFilePath );
- filePath.Append( KParsed );
- iFs.MkDir( filePath );
- filePath.Append( KFs );
- iFs.MkDir( filePath );
- filePath.Close( );
- iDBStateHandler = CCHDbStateHandler::NewL( this );
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettings::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CCHFactorySettings* CCHFactorySettings::NewL( MLiwInterface* aInterface )
- {
- CCHFactorySettings* self = NewLC( aInterface );
- CleanupStack::Pop( self );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CCHFactorySettings::NewLC
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CCHFactorySettings* CCHFactorySettings::NewLC( MLiwInterface* aInterface )
- {
- CCHFactorySettings* self = new( ELeave ) CCHFactorySettings();
- CleanupStack::PushL( self );
- self->ConstructL( aInterface );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CCHFactorySettings::~CCHFactorySettings()
- {
- delete iFileNewList;
- delete iInstallNotifier;
- delete iFileMan;
- delete iParser;
- iFs.Close( );
- iFilePath.Close( );
- delete iDBStateHandler;
- }
-
-// ----------------------------------------------------------------------------
-// CCHFactorySettings::UpdateL
-//
-// ----------------------------------------------------------------------------
-//
-void CCHFactorySettings::UpdateL()
- {
- CP_DEBUG(_L8("CCHFactorySettings::UpdateL" ));
- CheckDrivesL( ); // fill in list with file names from all drives
- AddNewL( ); // if any of them isn't added to db then add
- UnInstallL( ); // if any of files from any drive was removed remove data
- // from DB
-
- }
-
-// ----------------------------------------------------------------------------
-// CCHFactorySettings::AddNewL
-// Add new entries after sis intallation.
-// ----------------------------------------------------------------------------
-//
-void CCHFactorySettings::AddNewL()
- {
- CP_DEBUG(_L8("CCHFactorySettings::AddNewL" ));
- CDir* fileListInstalled= NULL;
- RBuf filePath;
- filePath.CreateL( KMaxPath );
- CleanupClosePushL( filePath );
- filePath.Append( KDriveC );
- filePath.Append( iFilePath );
- filePath.Append( KParsedDir );
- iFs.GetDir( filePath, KEntryAttMaskSupported, ESortByName,
- fileListInstalled );
- CleanupStack::PushL( fileListInstalled );
-
- for ( TInt i(0); i<iFileNewList->Count( ); i++ )
- {
- TBool parse(ETrue);
- TPtrC fileNewName =
- (*iFileNewList)[i].Mid( (*iFileNewList)[i].LocateReverse( '\\' ) + 1 );
- TInt count = fileListInstalled->Count( );
- for ( TInt j(0); j< count; j++ )
- {
- TPtrC existingFile = (*fileListInstalled)[j].iName;
- if ( fileNewName.Compare( existingFile ) )
- {
- parse = ETrue;
- }
- else
- {
- parse = EFalse;
- break;
- }
- }
- if ( parse )
- {
- //file wasn't found in afterinstallation dir
- //so should be copied and entries install
- TBool fileOpened(ETrue);
- iFs.IsFileOpen( (*iFileNewList)[i], fileOpened );
-
- if ( !fileOpened )
- {
- TInt error = iParser->Restore( (*iFileNewList)[i], EFalse );
- if ( error == KErrNone )
- {
- iFileMan->Copy( (*iFileNewList)[i], filePath );
- }
- }
-
- }
- }
- CleanupStack::PopAndDestroy( fileListInstalled );
- CleanupStack::PopAndDestroy( &filePath );
- }
-
-// ----------------------------------------------------------------------------
-// CCHFactorySettings::UnInstallL
-// Removes entries after uninstallation.
-// ----------------------------------------------------------------------------
-//
-void CCHFactorySettings::UnInstallL()
- {
- CP_DEBUG(_L8("CCHFactorySettings::UnInstallL" ));
- TBool found(EFalse);
- CDir* fileListInstalled= NULL;
- RBuf filePath;
- filePath.CreateL( KMaxPath );
- CleanupClosePushL( filePath );
- filePath.Append( KDriveC );
- filePath.Append( iFilePath );
- filePath.Append( KParsedDir );
- iFs.GetDir( filePath, KEntryAttMaskSupported, ESortByName,
- fileListInstalled );
- CleanupStack::PushL( fileListInstalled );
-
- for ( TInt i(0); i<fileListInstalled->Count( ); i++ )
- {
- TPtrC fileInstalledName = (*fileListInstalled)[i].iName;
- found = EFalse;
- for ( TInt j(0); j<iFileNewList->Count( ); j++ )
- {
- TPtrC fileNewPath = (*iFileNewList)[j];
- TPtrC fileNewName =
- (*iFileNewList)[j].Mid( (*iFileNewList)[j].LocateReverse( '\\' ) + 1 );
- if ( fileInstalledName.Compare( fileNewName )==0 )
- {
- if ( !(*fileListInstalled)[i].IsDir( ) )
- {
- found = ETrue;
- break;
- }
- }
- }
- if ( !found ) //this file should be removed also entries from database
- {
- filePath.Zero( );
- filePath.Append( KDriveC );
- filePath.Append( iFilePath );
- filePath.Append( KParsedDir );
- filePath.Append( fileInstalledName );
-
- iParser->Restore( filePath, ETrue );
- iFileMan->Delete( filePath );
- }
- }
- CleanupStack::PopAndDestroy( fileListInstalled );
- CleanupStack::PopAndDestroy( &filePath );
- }
-
-// ----------------------------------------------------------------------------
-// CCHFactorySettings::CheckDrivesL
-//
-// ----------------------------------------------------------------------------
-//
-void CCHFactorySettings::CheckDrivesL()
- {
- CP_DEBUG(_L8("CCHFactorySettings::CheckDrivesL" ));
- iFileNewList->Reset( );
- TDriveList driveList;
- TChar driveLetter;
- User::LeaveIfError( iFs.DriveList( driveList ) );
- for ( TInt driveNumber=EDriveA; driveNumber <= EDriveZ; driveNumber++ )
- {
- if ( driveList[driveNumber] )
- {
- User::LeaveIfError( iFs.DriveToChar( driveNumber, driveLetter ) );
- RBuf filePath;
- filePath.CreateL( KMaxPath );
- CleanupClosePushL( filePath );
- filePath.Append( driveLetter );
- filePath.Append( KColen );
- filePath.Append( iFilePath );
- filePath.Append( KDirFSNew );
- CDir* fileList;
- iFs.GetDir( filePath, KEntryAttMaskSupported, ESortByName,
- fileList );
- CleanupStack::PopAndDestroy( &filePath );
- if ( fileList )
- {
- CleanupStack::PushL( fileList );
- for ( TInt i(0); i<fileList->Count( ); i++ )
- {
- RBuf fullFileName;
- fullFileName.CreateL( KMaxPath );
- CleanupClosePushL( fullFileName );
- fullFileName.Append( driveLetter );
- fullFileName.Append( KColen );
- fullFileName.Append( iFilePath );
- fullFileName.Append( KDirFSNew ) ;
- fullFileName.Append( (*fileList)[i].iName );
- if ( !(*fileList)[i].IsDir( ) )
- {
- //check if already exist
- iFileNewList->AppendL( fullFileName );
- }
- CleanupStack::PopAndDestroy( &fullFileName );
- }
- CleanupStack::PopAndDestroy( fileList );
- }
- }
- }
- }
-
-// end of file
--- a/contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactsetutils.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,225 +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: Utils methods.
- *
-*/
-
-
-// INCLUDE FILES
-
-#include "chfactsetutils.h"
-#include "chfactorysettingsglobals.h"
-#include "cpdebug.h"
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::StrDec2Int
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TUint FactSetCHUtils::StrDec2Uint( const TDesC& aStr )
- {
- CP_DEBUG(_L8("FactSetCHUtils::StrDec2Uint" ));
- TLex lexer(aStr);
- TInt ret;
- if ( lexer.Val( ret ) )
- {
- _LIT(KDesc, "Int");
- BadArgument( KDesc, aStr, KErrArgument ) ;
- }
- return ret;
- }
-
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::Str2Uint
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TUint FactSetCHUtils::Str2Uint( const TDesC& aStr )
- {
- TUint ret(Str2Int( aStr ) );
- return ret;
- }
-
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::Str2Bool
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TBool FactSetCHUtils::Str2Bool( const TDesC& aStr )
- {
- CP_DEBUG(_L8("FactSetCHUtils::Str2Bool" ));
- TBool ret;
- if ( !aStr.Compare( KTrue ) )
- {
- ret = ETrue;
- }
- else if ( !aStr.Compare( KFalse ) )
- {
- ret = EFalse;
- }
- else
- ret = (Str2Int( aStr ) );
- return ret;
- }
-
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::Str2Int
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TInt FactSetCHUtils::Str2Int( const TDesC& aStr )
- {
- CP_DEBUG(_L8("FactSetCHUtils::Str2Int" ));
- // if a string starts from '0x' then convert aStr from hex to int.
- // else send aStr to the StrDec2Uint
- _LIT(KHexStart,"0x");
-
- TInt position(aStr.Find( KHexStart ) );
- TInt ret(KErrArgument);
- if ( position == 0 )
- {
- // is hex
- TPtrC string(aStr.Mid( KHexStart().Length( ) ) );
-
- ret = StrHex2Uint( string );
- }
- else
- {
- ret = StrDec2Uint( aStr );
- }
- return ret;
- }
-
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::StrHex2UintL
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TUint FactSetCHUtils::StrHex2Uint( const TDesC& aStr )
- {
- CP_DEBUG(_L8("FactSetCHUtils::StrHex2Uint" ));
- TLex lexer(aStr);
- TUint ret;
- if ( lexer.Val( ret, EHex ) )
- {
- _LIT(KDesc, "Hex");
- BadArgument( KDesc, aStr, KErrArgument );
- }
- return ret;
- }
-
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::Str2Str8L
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-HBufC8* FactSetCHUtils::Str2Str8LC( const TDesC& aStr )
- {
- CP_DEBUG(_L8("FactSetCHUtils::Str2Str8LC" ));
- HBufC8* ret = HBufC8::NewLC( aStr.Length( ) );
- ret->Des().Copy( aStr );
- return ret;
- }
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::Str2UidL
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TUid FactSetCHUtils::Str2Uid( const TDesC& aStr )
- {
- return TUid( TUid::Uid( Str2Uint( aStr ) ) );
- }
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::Str2UidL
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TReal FactSetCHUtils::Str2Real( const TDesC& aStr )
- {
- CP_DEBUG(_L8("FactSetCHUtils::Str2Real" ));
- TLex lexer(aStr);
- TReal ret;
- if ( lexer.Val( ret ) )
- {
- _LIT(KDesc, "Real");
- BadArgument( KDesc, aStr, KErrArgument );
- }
- return ret;
- }
-
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::Str2IntL
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TInt32 FactSetCHUtils::Str2Int32( const TDesC& aStr )
- {
- TInt32 ret(Str2Int( aStr ) );
- return ret;
- }
-
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::BadArgument
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void FactSetCHUtils::BadArgument( const TDesC& aCategory,
- const TDesC& aArgument, TInt aReason )
- {
- TRAP_IGNORE( BadArgumentL(aCategory, aArgument, aReason) );
- }
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::BadArgumentL
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void FactSetCHUtils::BadArgumentL( const TDesC& aCategory,
- const TDesC& aArgument, TInt aReason )
- {
- CP_DEBUG(_L8("FactSetCHUtils::BadArgumentL" ));
- _LIT(K2Dot,":");
- HBufC* buf = HBufC::NewLC( aCategory.Length( ) + aArgument.Length( )
- + K2Dot().Length( ) );
- TPtr ptr(buf->Des( ) );
- ptr.Copy( aCategory );
- ptr.Append( K2Dot );
- ptr.Append( aArgument );
- BadArgument( ptr, aReason );
- CleanupStack::PopAndDestroy( buf );
- }
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::BadArgument
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void FactSetCHUtils::BadArgument( const TDesC& aCategory, TInt aArgument,
- TInt aReason )
- {
- TBuf<KMaxIntString> buf;
- buf.Num( aArgument );
- BadArgument( aCategory, buf, aReason );
- }
-// -----------------------------------------------------------------------------
-// FactSetCHUtils::BadArgument
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void FactSetCHUtils::BadArgument( const TDesC& aCategory, TInt aReason )
- {
- User::Panic( aCategory, aReason );
- }
-
-// End of File
--- a/contentpublishingsrv/contentharvester/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build info for the Content Publisher subsystem
-*
-*/
-
-#include <platform_paths.hrh>
-PRJ_PLATFORMS
-WINSCW ARMV5
-//DEFAULT
-
-PRJ_EXPORTS
-
-
-PRJ_MMPFILES
-
-#include "../contentharvesterclient/group/bld.inf"
-#include "../contentharvesterserver/group/bld.inf"
-#include "../factorysettingsplugin/group/bld.inf"
-#include "../contentharvesterswiplugin/group/bld.inf"
-
-PRJ_EXPORTS
-
-
-#ifdef _MATRIX_MENU_INCLUDE_TEST_CONTENT
-#include "../internal/group/bld.inf"
-#endif
-// End of file
Binary file contentpublishingsrv/contentpublishingserver/cpserver/data/20016b7b.txt has changed
--- a/contentpublishingsrv/contentpublishingserver/cpserver/data/backup_registration.xml Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<?xml version="1.0" standalone="yes"?>
-<backup_registration version="1.0">
- <proxy_data_manager sid = "0x10202BE9" />
- <proxy_data_manager sid = "0x10281e17" />
- <restore requires_reboot = "no"/>
-</backup_registration>
\ No newline at end of file
--- a/contentpublishingsrv/contentpublishingserver/cpserver/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for Content Publisher Server
-*
-*/
-
-
-
-PRJ_PLATFORMS
-
-DEFAULT
-
-
-PRJ_EXPORTS
-../data/backup_registration.xml z:/private/20016b7b/backup_registration.xml
-
-// Cenrep
-../data/20016b7b.txt z:/private/10202be9/20016b7b.txt
-
-../inc/cpglobals.h |../../../../inc/cpglobals.h
-../inc/cpserverdef.h |../../../../inc/cpserverdef.h
-
-PRJ_MMPFILES
-cpserver.mmp
-
-// End of File
\ No newline at end of file
--- a/contentpublishingsrv/contentpublishingserver/cpserver/group/cpserver.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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
-*
-*/
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET cpserver.exe
-TARGETTYPE exe
-CAPABILITY CAP_SERVER
-
-UID 0 0x20016B7B
-
-SOURCEPATH ../src
-SOURCE cpserver.cpp
-SOURCE cpserversession.cpp
-SOURCE cpserverdatamanager.cpp
-SOURCE cpserveractionmanager.cpp
-SOURCE cpnotificationhandler.cpp
-SOURCE cpserverburlistener.cpp
-SOURCE cpactionhandlerthread.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../cpsqlitestorage/inc
-USERINCLUDE ../../../contentpublishingutils/contentpublishingdebug/inc
-USERINCLUDE ../../../contentpublishingutils/contentpublishingmap/inc
-
-// Default system include paths for application layer modules.
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY efsrv.lib
-LIBRARY ecom.lib
-LIBRARY liwservicehandler.lib
-LIBRARY eikcore.lib
-LIBRARY cone.lib
-LIBRARY estor.lib
-LIBRARY cputils.lib
-LIBRARY cpstorage.lib
-LIBRARY inetprotutil.lib
-#ifdef CONTENT_PUBLISHER_DEBUG
-LIBRARY cpdebug.lib
-#endif
-
-
-//end of file
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpactionhandlerthread.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +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 CPACTIONHANDLERTHREAD_H_
-#define CPACTIONHANDLERTHREAD_H_
-
-#include <e32base.h>
-#include <eikenv.h>
-#include <eikappui.h>
-
-class MLiwInterface;
-class CLiwGenericParamList;
-class CCPActionManager;
-
-/**
- * The function to be passed as an argument to RThread::Create.
- *
- * It just calls CCPActionHandlerThread::ThreadFunction. The only
- * reason this declaration is in the header file is to let
- * CCPActionHandlerThread declare friendship with this funcion.
- *
- * @param aParam pointer to CCPActionHandlerThread object
- * @return error code
- */
-TInt CPExecutionThreadFunction( TAny* aParam );
-
-/**
- * Action handler thread.
- *
- * Provides easy-to-use interface for executing plugin actions
- * in a separate thread.
- * @since S60 5.0
- */
-class CCPActionHandlerThread: public CBase
- {
- friend TInt CPExecutionThreadFunction( TAny* );
-
-public:
-
- /**
- * Creates new instance of CCPActionHandlerThread.
- *
- * @return new instance of CCPActionHandlerThread
- */
- static CCPActionHandlerThread* NewL();
-
- /**
- * Creates new instance of CCPActionHandlerThread.
- *
- * @return new instance of CCPActionHandlerThread
- */
- static CCPActionHandlerThread* NewLC();
-
- /**
- * Destructor.
- * Stops the action execution thread.
- */
- ~CCPActionHandlerThread();
-
- /**
- * Executes an action handler action in the action execution thread.
- *
- * @param aActionParams action parameters
- */
- void ExecuteL( const CLiwGenericParamList& aActionParams );
-
- /**
- * Starts the action execution thread.
- *
- * Creates a new instance of action execution thread
- * provided it is not running already.
- */
- void StartExecutionThreadIfNeededL();
-
- /**
- * Checks whether action execution thread is alive.
- *
- * @return ETrue if the thread is alive, EFalse otherwise.
- */
- TBool ExecutionThreadRunning();
-
-private:
- /**
- * Constructor.
- */
- CCPActionHandlerThread();
-
- /**
- * 2nd phase constructor.
- */
- void ConstructL();
-
- /**
- * This function is run is a separate thread. It creates
- * CServerEikonEnv and CServerAppUi objects, which provide
- * a trap cleanup and an active scheduler for the thread and
- * then starts the active scheduler.
- *
- * @return error code
- */
- TInt ThreadFunction();
-
-private: // internal data types
-
- /**
- * EIkonEnv for the server process.
- */
- class CServerEikonEnv : public CEikonEnv
- {
- public:
- void DestroyEnvironment();
- void ConstructL();
- };
-
- /**
- * EikAppUi for the server process.
- */
- class CServerAppUi : public CEikAppUi
- {
- public:
- ~CServerAppUi();
- void ConstructL();
- };
-
- /**
- * A simple active object for executin actions.
- * Objects of this class are created and destroyed
- * by action execution thread.
- */
- class CActionExecutorAO: public CActive
- {
- public:
- /**
- * Factory method.
- */
- static CActionExecutorAO* NewL();
- /**
- * Factory method.
- */
- static CActionExecutorAO* NewLC();
- /**
- * Destructor.
- */
- ~CActionExecutorAO();
- /**
- * The RunL method which is run whever an action needs
- * to be executed in the action execution thread.
- * It just executes the action using the parameters
- * supplied with a call to SetActionParams. If that
- * parameters are NULL, it stops the active scheduler
- * thus terminating action execution thread.
- */
- void RunL();
- /**
- * A dummy cancel method required by Symbian.
- */
- void DoCancel();
- /**
- * Returns a pointer to this active object's iStatus
- * member variable.
- */
- TRequestStatus* RequestStatus();
- /**
- * TODO
- * Sets paramters of the action to be executed in RunL.
- * This method is supposed to be called from the main CPS thread.
- * @param aActionParams action parameters
- */
- void SetActionParams( const CLiwGenericParamList* aActionParams );
- private:
- /**
- * Constructor.
- */
- CActionExecutorAO();
- /**
- * 2nd phase constructor.
- */
- void ConstructL();
- private:
- /**
- * Parameters of the action to be executed in RunL.
- * Not own.
- */
- const CLiwGenericParamList* iActionParams;
- /**
- * Action manager instance.
- * Own.
- */
- CCPActionManager* iActionManager;
- };
-
-private: // data
- /**
- * Handle to the action execution thread.
- * Own.
- */
- RThread iActionExecThread;
-
- /**
- * Active object created in the action execution thread.
- * Own.
- */
- CActionExecutorAO *iActionExecutorAO;
-
- /**
- * ETrue if action execution thread was started at least once.
- */
- TBool iActionExecThreadStarted;
-
- /**
- * A counter for naming action execution thread.
- *
- * Every action execution thread has a number appended to its name.
- * When the thread dies (i.e. as a result of panic in a plugin), a
- * new instance of that thread is started with the number in the name
- * increased by one.
- */
- TUint iThreadNum;
- };
-
-#endif /* CPACTIONHANDLERTHREAD_H_ */
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpglobals.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +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: Global definitions
- *
-*/
-
-
-#ifndef CPCLIENTGLOBALS_H
-#define CPCLIENTGLOBALS_H
-
-/** Data types for CP content */
-enum TDataTypes
- {
- ECPHardcodedText = 1, // 0001
- ECPResourceText = 2, // 0010
- ECPFilepathImage = 4, // 0100
- ECPResourceIcon = 8 // 1000
- };
-
-enum TCPGetListOrder
- {
- ECPRecent = 1, // 0001
- ECPPublisher = 2, // 0010
- ECPContent = 4, // 0100
- ECPContentId = 8 // 1000
- };
-
-enum TFlag
- {
- EActivate = 1, // 0001
- };
-
-const TInt KNameArgumentsLimit = 5;
-const TInt KThreadNameLimit = 64;
-
-_LIT( KService, "CP Service" );
-
-_LIT8( KCPInterface, "IDataSource" );
-_LIT8( KCPContentInterface, "IContentPublishing" );
-_LIT8( KCPService, "Service.ContentPublishing" );
-_LIT8( KCommand, "cmd" );
-
-//Supported Commands
-_LIT8( KGetList, "GetList" );
-_LIT8( KAdd, "Add" );
-_LIT8( KDelete, "Delete" );
-_LIT8( KRequestNotification, "RequestNotification" );
-_LIT8( KExecuteAction, "ExecuteAction" );
-_LIT8( KCmdCancel, "Cancel" );
-_LIT8( KActivate, "Activate" );
-_LIT8( KActivateTrigger, "activate" );
-_LIT8( KDeactivateTrigger, "deactivate" );
-
-// Input arguments
-_LIT8( KType, "type" );
-_LIT8( KAction, "action" );
-_LIT8( KItem, "item" );
-_LIT8( KFilter, "filter" );
-_LIT8( KData, "data" );
-_LIT8( KSortOrder, "sort_order" );
-_LIT8( KItemId, "item_id" );
-_LIT8( KByPublisher, "by_publisher" );
-_LIT8( KByEntryIds, "by_entryids" );
-_LIT8( KPublisherId, "publisher" );
-_LIT8( KContentType, "content_type" );
-_LIT8( KContentId, "content_id" );
-_LIT8( KExpirationDate, "expiration_date" );
-_LIT8( KActivatePublisher, "activate" );
-_LIT8( KIds, "ids" );
-_LIT8( KId, "id" );
-_LIT8( KFlag, "flag");
-_LIT8( KAccessList, "ACL" );
-_LIT8( KACLRead, "read");
-_LIT8( KACLWrite, "write");
-_LIT8( KACLDelete, "delete");
-_LIT8( KUIDs, "UID" );
-_LIT8( KCapability, "Capability" );
-_LIT( KAll, "all");
-_LIT( KSortPublisher, "publisher");
-_LIT( KSortContentType, "content_type");
-_LIT( KSortContentId, "content_id");
-_LIT( KSortRecent, "recent");
-_LIT( KOperationAdd, "add" );
-_LIT( KOperationUpdate, "update" );
-_LIT( KOperationDelete, "delete" );
-_LIT( KOperationExecute, "execute" );
-_LIT8( KDataType, "data_type" );
-_LIT8( KOperation, "operation" );
-_LIT8( KActionTrigger, "action_trigger" );
-_LIT8( KActionTrigger16, "action_trigger16" );
-_LIT8( KHardcodedText, "harcoded_text" );
-_LIT8( KResourceText, "resource_text" );
-_LIT8( KFilepathImage, "filepath_image" );
-_LIT8( KIdMask, "id_mask" );
-_LIT8( KResourceIcon, "resource_icon" );
-_LIT8( KIdIcon, "id_icon" );
-_LIT8( KIdText, "id_text" );
-_LIT( KCpData, "cp_data" );
-_LIT( KPublisher, "publisher" );
-_LIT8( KChangeInfo, "change_info" );
-
-_LIT8( KPublisher_Uid, "publisher_Uid" );
-
-// Argument in Action
-_LIT8( KActionHandlerInterface, "IDataAction" );
-_LIT8( KActionHandlerService, "Service.ActionHandler" );
-_LIT8( KCmdExecute, "Execute" );
-_LIT8( KPluginUid, "plugin_id" );
-_LIT8( KDataForActionHandler, "data" );
-
-_LIT8( KLaunchMethod, "launch_method" );
-_LIT8( KApplicationUid, "application_uid" );
-_LIT8( KDocumentName, "document_name" );
-_LIT8( KViewId, "view_id" );
-_LIT8( KMessageUid, "message_uid" );
-
-// Output
-_LIT8( KResults, "results" );
-_LIT8( KListMap, "list_map" );
-_LIT8( KStatus, "status" );
-_LIT8( KDataMap, "data_map" );
-_LIT8( KActionMap, "action_map" );
-_LIT8( KKey, "key" );
-
-_LIT8( KTransactionID, "TransactionID" );
-_LIT8( KErrorCode, "ErrorCode" );
-
-#endif /*CPCLIENTGLOBALS_H*/
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpnotificationhandler.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,207 +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: Class used by session to handle asynchronous requests
- *
-*/
-
-
-#ifndef C_CPNOTIFICATIONHANDLER_H
-#define C_CPNOTIFICATIONHANDLER_H
-
-#include <e32base.h>
-#include <e32hashtab.h>
-
-class CLiwGenericParamList;
-class CLiwDefaultList;
-class CLiwDefaultMap;
-class CCPLiwMap;
-
-/**
- * Internal class for handling asynchronous request
- * for notifications. Used by server session object.
- *
- * @since S60 v5.0
- */
-class CCPNotificationHandler : public CBase
- {
-public:
-
- /**
- * Two-phased constructor.
- */
- static CCPNotificationHandler* NewL( RPointerArray<CLiwDefaultList>&
- aNotifications );
-
- /**
- * Two-phased constructor.
- */
- static CCPNotificationHandler* NewLC( RPointerArray<CLiwDefaultList>&
- aNotifications );
-
- /**
- * Destructor.
- */
- virtual ~CCPNotificationHandler();
-
- /**
- * Save message from client and initialize needed members
- */
- void SaveMessageL( const RMessage2& aMessage );
-
- /**
- * Adds observer
- */
- void AddObserverL( const RMessage2& aMessage );
-
- /**
- * Removes observer
- */
- void RemoveObserverL( const RMessage2& aMessage );
-
- /**
- * Invoked in order to send notification
- * @param List of changes to send
- */
- void SendNotificationL( CLiwDefaultList* aListOfMaps );
-
- /**
- * Getter
- * @return pointer to current notification
- */
- const CLiwGenericParamList* GetPointerToChangeInfoList();
-
- /**
- * Resets internal stare
- */
- void Reset();
-
- /**
- * Completes iMessage with provided error
- * @param Error Code
- */
- void ErrorComplete( TInt aErrCode );
-
-private:
-
- /**
- * C++ default constructor.
- */
- CCPNotificationHandler();
-
- /**
- * By default Symbian 2nd phase constructor is private.
- */
- void ConstructL( RPointerArray<CLiwDefaultList>& aNotifications );
-
- /**
- * Invoked in order to send notification
- * @param List of changes to send
- * @since Series 60 5.0
- */
- TBool SendChangeInfoListL( const CLiwDefaultList* aListOfMaps );
-
- /**
- * Compares argument to stored filter
- * @param aMap Information about change
- * @param aFilter filter to compare with
- * @return ETrue if argument matches filter
- */
- TBool IsProperForFilterL( const CLiwDefaultMap& aMap,
- const CCPLiwMap& aFilter );
-
- /**
- * Extracts parameter from LIW Map
- *
- * @param aMap Source Map
- * @param aProperty Key of parameter to extract
- * @param aResult Target for value
- */
- void GetPropertyL( const CLiwDefaultMap& aMap, const TDesC8& aProperty,
- RBuf& aResult );
-
- /**
- * Checks if IDs are the same
- *
- * @param aMap Map with notifications
- * @param aFilter filter to compare with
- * @return ETrue if ID are identical
- */
- TBool CheckIdL( const CLiwDefaultMap& aMap, const CCPLiwMap& aFilter );
-
- /**
- * Checks if Properties like publisher,content type
- * and content id are the same
- *
- * @param aMap Map with notifications
- * @param aFilter filter to compare with
- * @return ETrue if Parameters are identical
- */
- TBool CheckPropertiesL( const CLiwDefaultMap& aMap,
- const CCPLiwMap& aFilter );
-
- /**
- * Checks if operation types are the same
- *
- * @param aMap Map with notifications
- * @param aFilter filter to compare with
- * @return ETrue if operation types are the same
- */
- TBool CheckOperationTypeL( const CLiwDefaultMap& aMap,
- const CCPLiwMap& aFilter );
-
- /**
- * Checks if registry types are the same
- *
- * @param aMap Map with notifications
- * @param aFilter filter to compare with
- * @return ETrue if registry types are the same
- */
- TBool CheckRegistryTypeL( const CLiwDefaultMap& aMap,
- const CCPLiwMap& aFilter );
-
-private:
- // data
-
- /*
- * Own.
- * ETrue if message is ready to send notification
- */
- TBool iIsReadyToSend;
-
- /*
- * Own.
- * List of waiting notifications.
- */
- RPointerArray<CLiwDefaultList> iNotifications;
-
- /*
- * Not own.
- * Message from client
- */
- RMessage2 iMessage;
-
- /*
- * Own.
- * Notification to send.
- */
- CLiwGenericParamList* iChangeInfoList;
-
- /*
- * Own.
- * Filters
- */
- RHashMap< TInt32, CCPLiwMap*> iFilters;
- };
-
-#endif // C_CPNOTIFICATIONHANDLER_H
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserver.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,227 +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: Content Publisher Server - Main class
-*
-*/
-
-
-#ifndef C_CCPSERVER_H
-#define C_CCPSERVER_H
-
-// INCLUDES
-#include <e32base.h>
-#include "cpserverdef.h"
-#include "cpserverburlistener.h"
-
-#ifdef CONTENT_PUBLISHER_DEBUG
-class CCPDebug;
-#endif
-
-class CCPDataManager;
-class CCPActionHandlerThread;
-class CCPServer;
-
-struct TPointersForSession
- {
- CCPServer* iServer;
- CCPDataManager* iDataManager;
- CCPActionHandlerThread* iActionHandlerThread;
- };
-
-// CLASS DECLARATION
-/**
- * Content Publisher Server implementation
- *
- * @since Series 60 5.0
- */
-class CCPServer : public CPolicyServer, public MBURListenerCallback
- {
-public:
- // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CCPServer* NewLC();
-
- /**
- * Destructor.
- */
- virtual ~CCPServer();
-
-public:
- // New functions
-
- /**
- * Stops server.
- */
- void Stop();
-
- /**
- * Panic client.
- * @param aMessage RMessage2
- * @param aPanic panic code
- */
- static void PanicClient( const RMessage2& aMessage,
- TCPServerPanic aPanic );
-
- /**
- * start server
- * @return aErr Error code.
- */
- static TInt ThreadStart();
-
- /**
- * Decrements session counter
- */
- void RemoveSession();
-
- /**
- * Increments session counter
- */
- void AddSession();
-
- /**
- * HandleBUREventL is called when Backup and Restore state has been changed.
- *
- * @since S60 v3.1
- * @param aStatus Current Backup and Restore status.
- */
- void HandleBUREventL( TBURStatus aStatus );
-
- /**
- * Get Lock
- *
- * @return ETrue if Backup or Restore are running
- */
- TBool GetLock();
-
- /**
- * Returns notifications array
- */
- RPointerArray<CLiwDefaultList>& GetNotifications( );
-
-private:
- // From CActive
-
- /**
- * Process any errors.
- * @param aError the leave code reported
- * @return KErrNone if leave is handled
- */
- TInt RunError( TInt aError );
-
-private:
- // New methods
-
- /**
- * Constructs the server.
- * @param aPriority CServer2 input parameter
- */
- CCPServer( TInt aPriority );
-
- /**
- * Perform the second phase construction of a CCPServer object.
- */
- void ConstructL();
-
- /**
- * Panic the server.
- * @param param aPanic the panic code
- * @return a updateId of container
- */
- static void PanicServer( TCPServerPanic aPanic );
-
- /**
- * Send notification
- * @param Map containing ids of item
- */
- void AppendNotificationL( CCPLiwMap* aMap );
-
-
-private:
- // From CServer2
-
- /**
- * Create a time server session, and return a pointer to the created object.
- * @param aVersion the client version
- * @param aMessage RMessage2
- * @return pointer to new session
- */
- CSession2* NewSessionL( const TVersion& /*aVersion*/,
- const RMessage2& /*aMessage*/) const;
-
- /**
- * create and run server
- */
- static void CreateAndRunServerL();
-
-
- /**
- * Publishers deactivation
- */
- void DeactivatePublishersL();
-
-
- /**
- * Resets Activate flag and update item in the DB
- */
- void ResetAndUpdateFlagL( CCPLiwMap* aMap );
-
-private:
- //data
-
- /*
- * Manager to send and receive data beetween server and storage
- * Own.
- */
- CCPDataManager* iDataManager;
-
- /*
- * Manager to prepare and execute action
- * Own.
- */
- CCPActionHandlerThread* iActionHandlerThread;
-
- /*
- * Count of sessions
- * Own.
- */
- TInt iCountSession;
-
- /**
- * Notifier for Backup and Restore changes.
- * Own.
- */
- CCPServerBURListener* iBURListener;
-
-#ifdef CONTENT_PUBLISHER_DEBUG
- CCPDebug* iDebug;
-#endif
-
- /*
- * Own.
- * True if database is lock
- */
- TBool iBURLock;
-
- /*
- * Own.
- * List of waiting notifications about publisher
- * activation during startup
- */
- RPointerArray<CLiwDefaultList> iNotifications;
- };
-
-#endif // C_CCPSERVER_H
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserveractionmanager.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Used by sessions for handling execute action requests
- *
-*/
-
-
-#ifndef C_CPACTION_MANAGER_H
-#define C_CPACTION_MANAGER_H
-
-#include <e32base.h>
-// FORWARD DECLARATIONS
-#ifdef CONTENT_PUBLISHER_DEBUG
-class CCPDebug;
-#endif
-class CLiwServiceHandler;
-class MLiwInterface;
-class CLiwDefaultMap;
-
-/**
- * Used to execute action using Action Handler Service
- *
- * @since S60 5.0
- */
-class CCPActionManager : public CBase
- {
-public:
-
- /**
- * C++ destructor
- */
- ~CCPActionManager();
-
- /**
- * Two-phased constructor.
- */
- static CCPActionManager* NewL();
-
- /**
- * Two-phased constructor.
- */
- static CCPActionManager* NewLC();
-
- /**
- * Executes action
- * @param Action to be executed
- */
- void ExecuteL( const CLiwGenericParamList& aList );
-
-private:
- // methods
-
- /**
- * Standard C++ constructor.
- */
- CCPActionManager();
-
- /**
- * Standard 2nd phase constructor.
- */
- void ConstructL();
-
- /**
- * Loads interface
- * @param interface loaded from service
- */
- void PrepareServiceL( MLiwInterface*& aInterface );
-
- /**
- * Prepares data to execute command
- * @param paramList from server
- * @param target list to execute action
- */
- void PrepareInputListL( const CLiwGenericParamList& aList,
- CLiwGenericParamList& aTarget );
-
- /**
- * Extracts and adds attributes from aMap to aTarget.
- * @since Series 60 3.2
- * @param aMap CLiwDefaultMap with action.
- * @param aTarget CLiwGenericParamList with Uid and Map.
- */
- void ExtractUidAndMapL( const CLiwDefaultMap& aMap,
- CLiwGenericParamList& aTarget );
-
-private:
- // data
-
- /*
- * Own.
- * Handler to service
- */
- CLiwServiceHandler* iServiceHandler;
-
- /*
- * Own.
- * Interface to CPS service
- */
- MLiwInterface* iInterface;
-
-#ifdef CONTENT_PUBLISHER_DEBUG
- CCPDebug* iDebug;
-#endif
- };
-
-#endif // C_CPACTION_MANAGER_H
-// end of file
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverburlistener.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
-* 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: Backup and restore events listener.
- *
-*/
-
-
-#ifndef C_CPSERVERBURLISTENER_H
-#define C_CPSERVERBURLISTENER_H
-
-#include <e32base.h>
-#include <e32property.h>
-
-/**
- * Interface for observing Backup and Restore events.
- *
- * @since S60 S60 v3.1
- */
-class MBURListenerCallback
- {
-
-public:
- /**
- * Enum defining the status of Backup and Restore.
- */
- enum TBURStatus
- {
- EBURStatusNone,
- EBURStatusBackup,
- EBURStatusRestore
- };
-
- /**
- * HandleBUREventL is called when Backup and Restore state has been changed.
- * @param aStatus Current Backup and Restore status.
- */
- virtual void HandleBUREventL( TBURStatus aStatus ) = 0;
-
- };
-
-/**
- * Central Repository observer for Backup and Restore.
- *
- * @since S60 S60 v3.1
- */
-NONSHARABLE_CLASS(CCPServerBURListener) : public CActive
- {
-
-public:
-
- /**
- * Creates an instance of CCPServerBURListener implementation.
- * @param aCallBack Pointer to observer interface.
- */
- static CCPServerBURListener* NewL( MBURListenerCallback* aCallback );
-
- /**
- * Destructor.
- */
- virtual ~CCPServerBURListener();
-
- /**
- * @return EFalse if the device as a whole is not engaged in a backup or restore .
- */
- TBool CheckBUR();
-
-private:
- /**
- * Constructor.
- * @param aCallBack Pointer to observer interface.
- */
- CCPServerBURListener( MBURListenerCallback* aCallback );
-
- /**
- * Symbian 2nd phase constructor.
- */
- void ConstructL();
-
- /**
- * From CActive.
- */
- void DoCancel();
-
- /**
- * From CActive.
- */
- void RunL();
-
- /**
- * From CActive.
- */
- TInt RunError( TInt aError );
-
-private:
- /**
- * User side interface to Publish & Subscribe.
- */
- RProperty iProperty;
-
- /**
- * Interface for notifying changes in Backup and Restore.
- * Not own.
- */
- MBURListenerCallback* iCallback;
-
- };
-
-#endif // C_CPSERVERBURLISTENER_H
-// End of File
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdatamanager.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Used by sessions for handling data related requests
- *
-*/
-
-
-#ifndef C_CPDATA_MANAGER_H
-#define C_CPDATA_MANAGER_H
-
-#include <e32base.h>
-#include "cpstorage.h"
-
-// FORWARD DECLARATIONS
-#ifdef CONTENT_PUBLISHER_DEBUG
-class CCPDebug;
-#endif
-class CLiwMap;
-class CCPLiwMap;
-class CCpStorage;
-class CCPServerSession;
-class CCPNotificationHandler;
-class TLiwVariant;
-
-/**
- * Content publisher data manager.
- *
- * Used to add, modify and remove data and actions.
- * @since S60 v5.0
- */
-class CCPDataManager : public CBase, MCPChangeNotifier
- {
-public:
- // exported
-
- /**
- * C++ destructor
- */
- ~CCPDataManager();
-
- /**
- * Two-phased constructor.
- */
- static CCPDataManager* NewL( TBool aTBool = EFalse );
-
- /**
- * Two-phased constructor.
- */
- static CCPDataManager* NewLC( TBool aTBool = EFalse );
-
- /**
- * Add a new data to database
- *
- * @param aData Data to be added.
- * @return Id of a newly created data item
- */
- TUint AddDataL( CCPLiwMap& aMap );
-
- /**
- * Fetches data from database
- * @param aInParamList filter and sorting criteria
- * @param aOutParamList results
- */
- void GetListL( const CCPLiwMap& aMa, CLiwGenericParamList& aOutParamList );
- /**
- * Fetches action from database
- * @param aInParamList filter and sorting criteria
- * @param aOutParamList results
- * @param aNotificationList change info list (for notifications)
- * @return KErrNotFound if data was not found
- */
- TInt GetActionL( const CCPLiwMap& aMa,
- CLiwGenericParamList& aOutParamList,
- CLiwDefaultList* aNotificationList = NULL );
-
- /**
- * Fetches all activated publishers
- * @param aInParamList filter and sorting criteria
- * @param aOutParamList results
- */
- void GetActivePublishersL( CLiwGenericParamList* aResultList );
-
- /**
- * Removes data from database
- * @param aInParamList filter criteria
- */
- void RemoveDataL( const CCPLiwMap& aMa );
-
- /**
- * Adds observer to database
- * @param new observer
- */
- void AddObserverL( CCPNotificationHandler* aNotificationHandler );
-
- /**
- * Removes observer from database
- * @param aNotificationHandler observer to remove
- */
- void RemoveObserver( CCPNotificationHandler* aNotificationHandler );
-
- // from MCPChangeNotifier
- /**
- * @param Map containing change information
- * @return
- */
- void HandleChangeL( CLiwDefaultList* aListOfMaps );
-
- /**
- * Close database
- * @return
- */
- void CloseDatabase();
- /**
- * Open database
- * @return
- */
- void OpenDatabaseL();
-
-private:
- // methods
-
- /**
- * Standard C++ constructor.
- */
- CCPDataManager();
-
- /**
- * Standard 2nd phase constructor.
- */
- void ConstructL( TBool aTBool );
-
- /**
- * Fetches action bound to provided trigger.
- *
- * @param aOutParamList of all actions
- * @param aMap for found action
- * @param aTrigger
- */
- void ExtractTriggerL( CLiwGenericParamList& aOutParamList,
- const CLiwDefaultMap* aMap, const TDesC8& aTrigger );
- /**
- * Sends notifications to observers stored in iNotificationsArray
- *
- * @param List of change information
- * @param index od data item
- */
- void SendNotificationL( CLiwDefaultList* aListOfMaps, TInt aIndex );
-
- /**
- * Exctracts action from input parameters
- *
- * @param aParam for data
- * @param aAction for action
- */
- void ExtractActionL( const TLiwGenericParam* aParam, RBuf8& aAction );
-
- /**
- * Fills aOutParamList with parameters for action.
- *
- * @param aOutParamList parsed list of items
- * @param aParamList list of items from data base
- * @param aActionTrigger action trigger
- */
- void FillActionParamListL(
- CLiwGenericParamList & aOutParamList,
- const TLiwGenericParam* aParam,
- RBuf8 & aActionTrigger);
-
- /**
- * Creates map for GetList request - publisher, content_type
- * and content_id are copied from aMap to returned map
- * @param aMap - input map
- * @return input map for GetList request
- */
- CCPLiwMap* CreateMapForGetlistLC( const CCPLiwMap& aMap );
-
-
- /**
- * Gets Flag for specified item from DB and returns activate
- * info
- * @param aMap - input map
- * @return activate flag
- */
- TBool GetActivateInfoL( const CCPLiwMap* aMap );
-
- /**
- * Builds change info list
- * @param aMap - map containing parameters needed to build change info list
- * @param aParam - param from getlist result
- * @param aChangeInfoList - output list containing change info list sent
- * as notification
- */
- void BuildChangeInfoL(
- const CCPLiwMap* aMap,
- const TLiwGenericParam* aParam,
- CLiwDefaultList* aChangeInfoList );
- /**
- * Builds change info list when query to database returned nothing
- * @param aMap - map containing parameters needed to build change info list
- * @param aChangeInfoList - output list containing change info list sent
- * as notification
- */
- void BuildDefaultChangeInfoL(
- const CCPLiwMap* aMap,
- CLiwDefaultList* aChangeInfoList );
-
-
- /**
- * Copies variant from in to out map if entry with provided key exists
- * @param aKey a key
- * @param aInMap input map
- * @param aOutMap output map
- */
- void CopyVariantL(const TDesC8& aKey, const CLiwMap* aInMap,
- CLiwDefaultMap* aOutMap );
-
- /**
- * Copies variant from in map for key KActionTrigger to out map with key KActionTrigger16
- * and formated type(from TDesC8 to TDesC)
- * @param aInMap input map
- * @param aOutMap output map
- */
- void CopyActionTrigger16L( const CLiwMap* aInMap,
- CLiwDefaultMap* aOutMap );
-
-private:
- // data
-
- /*
- * Storage database
- * Own.
- */
- CCpStorage* iStorage;
-
- /*
- * Array of registered notification handlers.
- * Own.
- */
- RPointerArray<CCPNotificationHandler> iNotificationsArray;
-
-#ifdef CONTENT_PUBLISHER_DEBUG
- CCPDebug* iDebug;
-#endif
- };
-
-#endif // C_CPDATA_MANAGER_H
-// end of file
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdef.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Globals for Content Publisher server
- *
-*/
-
-
-#ifndef C_CPSERVERDEF_H
-#define C_CPSERVERDEF_H
-
-// CONSTANTS
-const TUint KCPServerMajorVersionNumber = 0;
-const TUint KCPServerMinorVersionNumber = 1;
-const TUint KCPServerBuildVersionNumber = 1;
-
-// ENUMERATIONS
-// Opcodes used in message passing between client and server
-enum TCpServerRqst
- {
- ECpServerAddData = 1,
- ECpServerRemoveData = 2,
- ECpServerGetListSize = 10,
- ECpServerGetListData = 11,
- ECpServerRegisterObserver = 20,
- ECpServerUnRegisterObserver = 21,
- ECpServerGetChangeInfoData = 22,
- ECpServerAddObserver = 23,
- ECpServerRemoveObserver = 24,
- ECpServerExecuteAction = 30,
- ECpServerInternal = 100
- };
-
-_LIT( KCPServerThreadName, "cpserver_MainThread" );
-_LIT( KCPServerName, "cpserver" );
-_LIT( KCPServerFilename, "cpserver" );
-_LIT( KActiveDes, "1" );
-_LIT( KInActiveDes, "0" );
-_LIT( KColon, ":" );
-_LIT( KSemiColon, ";" );
-
-_LIT( KCPServerPluginThreadName, "CPS plugin command execution thread %d" );
-const TInt KCPServerPluginThreadMinHeapSize = 0x400; // 1kB
-const TInt KCPServerPluginThreadMaxHeapSize = 0x100000; // 1MB
-
-const TUid KServerUid3 =
- {
- 0x20016B7B
- };
-
-/** Panic Category */
-
-/** Active Data Server panic codes */
-enum TCPServerPanic
- {
- ECPServerBadRequest = 1,
- ECPServerBadDescriptor = 2,
- ECPServerSrvCreateServer = 3
- };
-
-const TUint KDescriptorPosition( 0);
-const TUint KReturnPosition( 1);
-const TUint KInfoPosition( 2);
-const TUint KTransactionPosition( 3);
-const TBool KActive( ETrue );
-const TBool KInActive( EFalse );
-
-// Uid of CP Server
-const TUid KServerUid = { 0x20016B7B };
-// Uid of cpstorage
-const TUint32 KCPStorageUid = { 0x20016B7C };
-//Values of KSQLDBStateKey key
-const TInt KSQLDBStateNormal = 0x00000001;
-const TInt KSQLDBStateRestored = 0x00000002;//KSQLDBStateNormal << 1
-// const ITnt NextState = LastState << 1;
-
-
-
-#endif // C_CPSERVERDEF_H
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserversession.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,242 +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: Server Session
- *
-*/
-
-
-#ifndef C_CCPSERVERSESSION_H
-#define C_CCPSERVERSESSION_H
-
-// INCLUDES
-#include <e32base.h>
-
-// FORWARD DECLARATIONS
-#ifdef CONTENT_PUBLISHER_DEBUG
-class CCPDebug;
-#endif
-class CLiwGenericParamList;
-class CLiwDefaultMap;
-class CLiwDefaultList;
-class CCPServer;
-class CCPDataManager;
-class CCPLiwMap;
-class CCPActionHandlerThread;
-class CCPNotificationHandler;
-struct TPointersForSession;
-
-// CLASS DECLARATION
-/**
- * Server side session representation
- *
- * @since Series 60 5.0
- */
-class CCPServerSession : public CSession2
- {
-
-public:
- // New methods
-
- /**
- * Two-phased constructor.
- */
- static CCPServerSession* NewL( TPointersForSession& aPasser );
-
- /**
- * Two-phased constructor.
- */
- static CCPServerSession* NewLC( TPointersForSession& aPasser );
-
- /**
- * Destroy the object and release all memory objects
- */
- virtual ~CCPServerSession();
-
-public:
- // From CSession
-
- /**
- * Called after a service request from client
- * @param aMessage message from client (containing requested operation
- * and any data)
- */
- void ServiceL( const RMessage2& aMessage );
-
- /**
- * Selects correct function from message
- * @param aMessage message from client (containing requested operation
- * and any data)
- */
- void DispatchMessageL( const RMessage2& aMessage, TBool& aPanicedClient );
-
-private:
- // New methods
-
- /**
- * Standard C++ constructor.
- */
- CCPServerSession();
-
- /**
- * Perform the second phase construction of a CCPServerSession object
- */
- void ConstructL( TPointersForSession& aPasser );
-
- /**
- * Add Data request
- * @param Message from client
- */
- void AddDataL( const RMessage2& aMessage );
-
- /**
- * Get data request - first phase
- * @param Message from client
- */
- void GetListSizeL( const RMessage2& aMessage );
-
- /**
- * Get data request - second phase
- * @param Message from client
- */
- void GetListDataL( const RMessage2& aMessage );
-
- /**
- * Remove data request
- * @param Message from client
- */
- void RemoveDataL( const RMessage2& aMessage );
-
- /**
- * Executes action request
- * @param Message from client
- */
- void ExecuteActionL( const RMessage2& aMessage );
-
- /**
- * Executes action request
- * @param aActionParams list with actions
- */
- void ExecuteL( const CLiwGenericParamList& aActionParams );
-
- /**
- * Register for notification request
- * @param Message from client
- */
- void RegisterObserverL( const RMessage2& aMessage );
-
- /**
- * Adds new observer
- * @param Message from client
- */
- void AddObserverL( const RMessage2& aMessage );
-
- /**
- * Removes observer
- * @param Message from client
- */
- void RemoveObserverL( const RMessage2& aMessage );
-
- /**
- * Unregister from notification request
- * @param Message from client
- */
- void UnregisterObserverL();
-
- /**
- * Send information about change in database to client
- * @param Message from client
- */
- void GetChangeInfoDataL( const RMessage2& aMessage );
-
- /**
- * Converts CLiwGenericParamList to descriptor and
- * sends to client
- * @param Message to complete
- * @param Parameters for message
- */
- void ExternalizeAndWriteToClientL( const RMessage2& aMessage,
- const CLiwGenericParamList* outParamList );
-
- /**
- * Unpacks message from client to map
- * @param Message to complete
- * @return CCPLiwMap with data from client
- */
- CCPLiwMap* UnpackFromClientLC( const RMessage2& aMessage );
-
- /**
- * Send notification
- * @param aNotificationList
- */
- void SendNotificationL( CCPLiwMap* aMap,
- CLiwDefaultList* aNotificationList );
-
- /**
- * Get and Execute Activate or Deactivate action from the DB
- * @param Map containing ids of item
- */
- void GetAndExecuteActionL( CCPLiwMap* aMap, CLiwDefaultList* aNotificationList,
- TBool aInsertTrigger = EFalse );
-
- /**
- * Get Server Lock
- * @return ETrue if aMessege cannot be processed
- * because Backup or Restore is running
- **/
- TBool GetServerLock( const RMessage2& aMessage );
-
-private:
-
- /*
- * Own.
- * Handler for asynchronous request for notifications
- */
- CCPNotificationHandler* iNotificationHandler;
-
- /*
- * Not own.
- * True if message is register
- */
- TBool isRegister;
-
- /*
- * Not own.
- * Pointer to Content Publisher Server
- */
- CCPServer* iServer;
-
- /*
- * Not own.
- * Manager to send and receive data beetween server and storage
- */
- CCPDataManager* iDataManager;
-
- /*
- * Own.
- * List write to message with getList function
- */
- CLiwGenericParamList* iParamList;
-
- /*
- * Not Own.
- * Manager to prepare and execute action
- */
- CCPActionHandlerThread* iActionHandlerThread;
-
-#ifdef CONTENT_PUBLISHER_DEBUG
- CCPDebug* iDebug;
-#endif
- };
-
-#endif // C_CCPSERVERSESSION_H
--- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpactionhandlerthread.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,410 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "cpactionhandlerthread.h"
-#include "cpserverdef.h"
-#include "cpserveractionmanager.h"
-#include "cpglobals.h"
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CPExecutionThreadFunction( TAny* aParam )
- {
- ASSERT( aParam );
- CCPActionHandlerThread* actionHandlerThread =
- reinterpret_cast<CCPActionHandlerThread*>( aParam );
- return actionHandlerThread->ThreadFunction();
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPActionHandlerThread* CCPActionHandlerThread::NewL()
- {
- CCPActionHandlerThread* self = NewLC();
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPActionHandlerThread* CCPActionHandlerThread::NewLC()
- {
- CCPActionHandlerThread* self = new ( ELeave ) CCPActionHandlerThread;
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPActionHandlerThread::~CCPActionHandlerThread()
- {
- if ( ExecutionThreadRunning() && iActionExecutorAO )
- {
- // stop action execution thread
-
- // request notification when action execution thread terminates
- TRequestStatus exitStatus;
- iActionExecThread.Logon( exitStatus );
-
- // passing NULL as action parameters will cause the action executor to
- // stop active scheduler in command execution thread
- iActionExecutorAO->SetActionParams( NULL );
- // ask action executor to execute the action
- TRequestStatus* actionExecutorAOStatus =
- iActionExecutorAO->RequestStatus();
- iActionExecThread.RequestComplete( actionExecutorAOStatus, KErrNone );
-
- // wait for the action execution thread to terminate
- User::WaitForRequest( exitStatus );
- }
- iActionExecThread.Close();
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPActionHandlerThread::ExecuteL(
- const CLiwGenericParamList& aActionParams )
- {
- StartExecutionThreadIfNeededL();
-
- ASSERT( iActionExecutorAO );
- iActionExecutorAO->SetActionParams( &aActionParams );
-
- // create rendezvous so that we are notified when action
- // execution finishes
- TRequestStatus actionExecutionStatus = KRequestPending;
- iActionExecThread.Rendezvous( actionExecutionStatus );
-
- // request action execution by completing request for the AO running
- // in the action execution thread
- TRequestStatus* actionExecutorAOStatus =
- iActionExecutorAO->RequestStatus();
- iActionExecThread.RequestComplete( actionExecutorAOStatus, KErrNone );
-
- // wait until action execution finishes
- User::WaitForRequest( actionExecutionStatus );
-
- TInt err = actionExecutionStatus.Int();
- // please note that checking actionExecutionStatus is not a reliable way of
- // determining whether everything is OK because if plugin panics with
- // reason (panic number) KErrNone, actionExecutionStatus will contain KErrNone
- if ( !ExecutionThreadRunning() )
- {
- // action execution thread died,
- // iActionExecutorAO pointer is no longer valid
- iActionExecutorAO = NULL;
- if ( err >= 0 )
- {
- err = KErrDied;
- }
- }
- else
- {
- iActionExecutorAO->SetActionParams( NULL );
- }
-
- User::LeaveIfError( err );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
- void CCPActionHandlerThread::StartExecutionThreadIfNeededL()
- {
- if ( !ExecutionThreadRunning() )
- {
- TBuf<KThreadNameLimit> threadName;
- if ( iActionExecThreadStarted )
- {
- iActionExecThread.Close();
- }
-
- // create action execution thread
- threadName.Format( KCPServerPluginThreadName, ++iThreadNum );
- TInt err = iActionExecThread.Create( threadName,
- CPExecutionThreadFunction,
- KDefaultStackSize,
- KCPServerPluginThreadMinHeapSize,
- KCPServerPluginThreadMaxHeapSize,
- reinterpret_cast<TAny*>( this ) );
- User::LeaveIfError( err );
-
- // create rendezvous so that we are notified when the thread
- // has started
- TRequestStatus threadStatus;
- iActionExecThread.Rendezvous( threadStatus );
-
- // start the action execution thread
- iActionExecThread.Resume();
-
- // wait for the thread to start
- User::WaitForRequest( threadStatus );
-
- User::LeaveIfError( threadStatus.Int() );
-
- iActionExecThreadStarted = ETrue;
- ASSERT( ExecutionThreadRunning() );
- }
- }
-
-// ---------------------------------------------------------------------------
-// RThread::ExitType() returns EExitPending if the thread is alive or has not
-// been started yet. There is a member variable, iActionExecThreadStarted
-// which tells if the thread was started or not. Combining the information
-// from the member variable and RThread::ExitType() allows us to determine if
-// the thread is running (alive).
-// ---------------------------------------------------------------------------
-//
- TBool CCPActionHandlerThread::ExecutionThreadRunning()
- {
- TBool actionExecThreadDidNotDie =
- iActionExecThread.ExitType() == EExitPending;
-
- TBool threadRunning =
- iActionExecThreadStarted && actionExecThreadDidNotDie;
-
- // if the thread is alive, it must have created an active object for
- // executing actions in plugins; verify that it is the case
- ASSERT( !threadRunning || ( threadRunning && iActionExecutorAO ));
-
- return threadRunning;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
- CCPActionHandlerThread::CCPActionHandlerThread()
- {
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPActionHandlerThread::ConstructL()
- {
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CCPActionHandlerThread::ThreadFunction()
- {
- __UHEAP_MARK;
-
- CServerEikonEnv* env = new CServerEikonEnv;
- if ( !env )
- {
- return KErrNoMemory;
- }
- CServerAppUi* ui = new CServerAppUi;
- if ( !ui )
- {
- delete env;
- return KErrNoMemory;
- }
-
- TRAPD( err,
- env->ConstructL();
- env->DisableExitChecks( ETrue );
- ui->ConstructL();
-
- iActionExecutorAO = CActionExecutorAO::NewL();
-
- // notify the main thread that action execution thread
- // has successfully started
- RThread::Rendezvous( KErrNone );
-
- CActiveScheduler::Start();
- );
-
- delete iActionExecutorAO;
- iActionExecutorAO = NULL;
-
- ui->PrepareToExit();
- env->DestroyEnvironment();
-
- __UHEAP_MARKEND;
-
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterEikonEnv::DestroyEnvironment
-//
-// -----------------------------------------------------------------------------
-//
-void CCPActionHandlerThread::CServerEikonEnv::DestroyEnvironment()
- {
- CEikonEnv::DestroyEnvironment( );
- }
-
-// -----------------------------------------------------------------------------
-// CContentHarvesterEikonEnv::ConstructL
-//
-// -----------------------------------------------------------------------------
-//
-void CCPActionHandlerThread::CServerEikonEnv::ConstructL()
- {
- CEikonEnv::ConstructL( EFalse );
- SetAutoForwarding( ETrue );
- User::SetPriorityControl( EFalse );
- }
-// -----------------------------------------------------------------------------
-// CContentHarvesterAppUi::~CContentHarvesterAppUi
-//
-// -----------------------------------------------------------------------------
-//
-CCPActionHandlerThread::CServerAppUi::~CServerAppUi()
- {
- }
-
-// ---------------------------------------------------------------------------
-// CContentHarvesterAppUi::ConstructL
-//
-// ---------------------------------------------------------------------------
-//
-void CCPActionHandlerThread::CServerAppUi::ConstructL()
- {
- CEikAppUi::BaseConstructL( ENoAppResourceFile | ENoScreenFurniture );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPActionHandlerThread::CActionExecutorAO*
-CCPActionHandlerThread::CActionExecutorAO::NewL()
- {
- CActionExecutorAO* self = NewLC();
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPActionHandlerThread::CActionExecutorAO*
-CCPActionHandlerThread::CActionExecutorAO::NewLC()
- {
- CActionExecutorAO* self = new ( ELeave ) CActionExecutorAO();
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPActionHandlerThread::CActionExecutorAO::~CActionExecutorAO()
- {
- delete iActionManager;
- }
-
-// ---------------------------------------------------------------------------
-// Any code executed in this method must not leave!
-// This way we avoid implementing RunError while making sure that
-// Rendezvous will always be called
-// ---------------------------------------------------------------------------
-//
-void CCPActionHandlerThread::CActionExecutorAO::RunL()
- {
- if( iActionParams )
- {
- // execute action
- TRAPD( err, iActionManager->ExecuteL( *iActionParams ) );
-
- // notify the main thread that action execution has finished
- RThread::Rendezvous( err );
-
- // wait until another action execution is requested
- iStatus = KRequestPending;
- SetActive();
- }
- else
- {
- CActiveScheduler::Stop();
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPActionHandlerThread::CActionExecutorAO::DoCancel()
- {
- TRequestStatus* myRequestStatus = &iStatus;
- User::RequestComplete( myRequestStatus, KErrCancel );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TRequestStatus* CCPActionHandlerThread::CActionExecutorAO::RequestStatus()
- {
- return &iStatus;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPActionHandlerThread::CActionExecutorAO::SetActionParams(
- const CLiwGenericParamList* aActionParams )
- {
- iActionParams = aActionParams;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPActionHandlerThread::CActionExecutorAO::CActionExecutorAO()
- : CActive( CActive::EPriorityLow )
- {
- CActiveScheduler::Add( this );
-
- // wait until action execution is requested
- iStatus = KRequestPending;
- SetActive();
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPActionHandlerThread::CActionExecutorAO::ConstructL()
- {
- iActionManager = CCPActionManager::NewL();
- }
--- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,520 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ?Description
-
- *
-*/
-
-
-#include <liwcommon.h>
-#include <s32mem.h>
-
-#include "cpnotificationhandler.h"
-#include "cpdebug.h"
-#include "cpliwmap.h"
-#include "cpglobals.h"
-#include "cpserverdef.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPNotificationHandler::CCPNotificationHandler()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPNotificationHandler::ConstructL( RPointerArray<CLiwDefaultList>&
- aNotifications)
- {
- iChangeInfoList = CLiwGenericParamList::NewL( );
- for ( TInt i(0); i< aNotifications.Count( ); i++ )
- {
- iNotifications.AppendL(aNotifications[i]);
- aNotifications[i]->IncRef();
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPNotificationHandler* CCPNotificationHandler::NewL(
- RPointerArray<CLiwDefaultList>& aNotifications )
- {
- CCPNotificationHandler* self = CCPNotificationHandler::NewLC(
- aNotifications );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPNotificationHandler* CCPNotificationHandler::NewLC(
- RPointerArray<CLiwDefaultList>& aNotifications )
- {
- CCPNotificationHandler* self = new( ELeave ) CCPNotificationHandler;
- CleanupStack::PushL( self );
- self->ConstructL( aNotifications );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPNotificationHandler::~CCPNotificationHandler()
- {
- THashMapIter<TInt32, CCPLiwMap*> iter( iFilters );
-
- const TInt32* transaction = iter.NextKey();
- while( transaction )
- {
- CCPLiwMap** filter = iFilters.Find( *transaction );// leaves if not found
- if ( filter )
- {
- (*filter)->Reset();
- (*filter)->Close();
- }
- transaction = iter.NextKey( );
- }
- iFilters.Close();
- Reset( );
- for ( TInt i(0); i< iNotifications.Count( ); i++ )
- {
- iNotifications[i]->Close( );
- }
- iNotifications.Close( );
- delete iChangeInfoList;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPNotificationHandler::SaveMessageL( const RMessage2& aMessage )
- {
- iIsReadyToSend = ETrue;
- iMessage = aMessage;
-
- TInt32 transactionId = aMessage.Int3();
- if ( transactionId != KErrAlreadyExists )
- {
- TInt deslen = aMessage.GetDesLengthL( KDescriptorPosition );
- if( deslen > 0 )
- {
- HBufC8* buffer = HBufC8::NewLC( deslen );
- TPtr8 tempDes = buffer->Des( );
- aMessage.Read( KDescriptorPosition, tempDes );
- RDesReadStream datastrm( *buffer);
- CleanupClosePushL( datastrm );
- CCPLiwMap* filterMap = CCPLiwMap::NewL( datastrm );
- CleanupStack::PushL( filterMap );
- iFilters.InsertL( transactionId, filterMap );
- CleanupStack::Pop( filterMap );
- CleanupStack::PopAndDestroy( &datastrm );
- CleanupStack::PopAndDestroy( buffer );
- }
- }
- if ( iNotifications.Count( ) )
- {
- SendNotificationL( NULL );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPNotificationHandler::AddObserverL( const RMessage2& aMessage )
- {
- TInt32 transactionId = aMessage.Int3();
- TInt deslen = aMessage.GetDesLength( KDescriptorPosition );
- if( deslen > 0 )
- {
- HBufC8* buffer = HBufC8::NewLC( deslen );
- TPtr8 tempDes = buffer->Des( );
- aMessage.Read( KDescriptorPosition, tempDes );
- RDesReadStream datastrm( *buffer);
- CleanupClosePushL( datastrm );
- CCPLiwMap* filterMap = CCPLiwMap::NewL( datastrm );
- CleanupStack::PushL( filterMap );
- iFilters.InsertL( transactionId, filterMap );
- CleanupStack::Pop( filterMap );
- CleanupStack::PopAndDestroy( &datastrm );
- CleanupStack::PopAndDestroy( buffer );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPNotificationHandler::RemoveObserverL( const RMessage2& aMessage )
- {
- TInt32 transactionId = aMessage.Int3();
- CCPLiwMap* filter = iFilters.FindL( transactionId );// leaves if not found
- filter->Reset();
- filter->Close();
- iFilters.Remove( transactionId );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-TBool CCPNotificationHandler::IsProperForFilterL( const CLiwDefaultMap& aMap,
- const CCPLiwMap& aFilter )
- {
- CP_DEBUG( _L8("CCPNotificationHandler::IsProperForFilter()") );
- TBool result( EFalse );
- if( CheckRegistryTypeL( aMap, aFilter ) &&
- CheckOperationTypeL( aMap, aFilter ) )
- {
- if( CheckIdL( aMap, aFilter ) )
- {
- result= ETrue;
- }
- else if( CheckPropertiesL( aMap, aFilter ) )
- {
- result = ETrue;
- }
- }
- return result;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPNotificationHandler::SendNotificationL( CLiwDefaultList* aListOfMaps )
- {
- CP_DEBUG( _L8("CCPNotificationHandler::SendNotificationL()") );
- if ( iIsReadyToSend )
- {
- //notification can be send
- if ( iNotifications.Count( ) )
- {
- //at least one notification is waiting to be sent
- TBool sent;
- sent = SendChangeInfoListL( iNotifications[0] );
- iNotifications[0]->Close( );
- iNotifications.Remove( 0 );
- if ( !sent )
- {
- //if notification from array wasn't sent because it didn't
- //match the filter, try to send the next one
- SendNotificationL( NULL );
- }
- else
- {
- //message was send
- iIsReadyToSend = EFalse;
- }
- }
- else
- {
- //no notification is waiting, so send the new one
- if ( aListOfMaps && SendChangeInfoListL( aListOfMaps ) )
- {
- iIsReadyToSend = EFalse;
- }
- }
- }
- else
- {
- //notification cannot be sent in this moment
- aListOfMaps->IncRef( );
- iNotifications.AppendL( aListOfMaps );
- }
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-
-const CLiwGenericParamList* CCPNotificationHandler::GetPointerToChangeInfoList()
- {
- return iChangeInfoList;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPNotificationHandler::Reset()
- {
- iIsReadyToSend = EFalse;
- iChangeInfoList->Reset( );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPNotificationHandler::ErrorComplete( TInt aErrCode )
- {
- if( iIsReadyToSend && iMessage.IsNull() == EFalse )
- {
- iMessage.Complete( aErrCode );
- iIsReadyToSend = EFalse;
- }
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-TBool CCPNotificationHandler::SendChangeInfoListL(
- const CLiwDefaultList* aListOfMaps )
- {
- CP_DEBUG( _L8("CCPNotificationHandler::SendChangeInfoListL()") );
- iChangeInfoList->Reset( );
- TBool sent(EFalse);
- //for every observer in session
- THashMapIter<TInt32, CCPLiwMap*> iter( iFilters );
- const CCPLiwMap*const* filter = iter.NextValue( );
- while( filter )
- {
-
- CLiwDefaultList* listOfMatchingMaps = CLiwDefaultList::NewLC( );
-
- //for every item in the input list
- for ( TInt j = 0; j < aListOfMaps->Count( ); j++ )
- {
- CLiwDefaultMap* map = CLiwDefaultMap::NewLC( );
- TLiwVariant variant;
- variant.PushL( );
- aListOfMaps->AtL( j, variant );
- variant.Get( *map );
- if ( IsProperForFilterL( *map, **filter ) )
- {
- listOfMatchingMaps->AppendL( TLiwVariant( map ) );
- }
- CleanupStack::PopAndDestroy( &variant );
- CleanupStack::PopAndDestroy( map );
- }
- if ( listOfMatchingMaps->Count( ) )
- {
- //append transaction id
- listOfMatchingMaps->AppendL( TLiwVariant( *iter.CurrentKey() ));
- iChangeInfoList->AppendL( TLiwGenericParam( KChangeInfo,
- TLiwVariant( listOfMatchingMaps ) ) );
- }
- CleanupStack::PopAndDestroy( listOfMatchingMaps );
- filter = iter.NextValue( );
- }
-
- if( iChangeInfoList->Count( ) )
- {
- TPckgBuf<TInt> sizeDes( iChangeInfoList->Size( ) );
- TInt err = iMessage.Write( KReturnPosition, sizeDes );
- iMessage.Complete( err );
- sent = ETrue;
- }
- return sent;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPNotificationHandler::GetPropertyL( const CLiwDefaultMap& aMap,
- const TDesC8& aProperty, RBuf& aResult )
- {
- TLiwVariant value;
- value.PushL( );
- if ( aMap.FindL( aProperty, value ) )
- {
- TPtrC result( KNullDesC );
- value.Get( result );
- aResult.CreateL( result );
- }
- CleanupStack::PopAndDestroy( &value );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-TBool CCPNotificationHandler::CheckIdL( const CLiwDefaultMap& aMap,
- const CCPLiwMap& aFilter )
- {
- TBool result = EFalse;
- TInt32 id( 0);
- if ( aFilter.GetProperty( KId, id ) )
- {
- TLiwVariant value;
- value.PushL( );
- if ( aMap.FindL( KId, value ) )
- {
- TUint idToCompare( 0);
- if ( value.Get( idToCompare ) )
- {
- if ( id == idToCompare )
- {
- result = ETrue;
- }
- }
- }
- CleanupStack::PopAndDestroy( &value );
- }
- return result;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-TBool CCPNotificationHandler::CheckPropertiesL( const CLiwDefaultMap& aMap,
- const CCPLiwMap& aFilter )
- {
- TBool result( EFalse );
- TBool publisherName( ETrue );
- TBool contentType( ETrue );
- TBool contentId( ETrue );
- RBuf publisher;
- publisher.CleanupClosePushL();
-
- if ( aFilter.GetPropertyL( KPublisherId, publisher ) )
- {
- if ( publisher != KAll )
- {
- RBuf str2compare;
- str2compare.CleanupClosePushL();
- GetPropertyL( aMap, KPublisherId, str2compare );
- if ( publisher!=str2compare )
- {
- publisherName = EFalse;
- }
- CleanupStack::PopAndDestroy( &str2compare );
- }
- }
- RBuf content;
- content.CleanupClosePushL();
- if ( aFilter.GetPropertyL( KContentType, content ) )
- {
- if ( content != KAll )
- {
- RBuf str2compare;
- str2compare.CleanupClosePushL();
- GetPropertyL( aMap, KContentType, str2compare );
- if ( content!=str2compare )
- {
- contentType = EFalse;
- }
- CleanupStack::PopAndDestroy( &str2compare );
- }
- }
- RBuf content_id;
- content_id.CleanupClosePushL();
- if ( (publisher != KAll)||(content != KAll) )
- {
- if ( aFilter.GetPropertyL( KContentId, content_id ) )
- {
- if ( content_id != KAll )
- {
- RBuf str2compare;
- str2compare.CleanupClosePushL();
- GetPropertyL( aMap, KContentId, str2compare );
- if ( content_id!=str2compare )
- {
- contentId = EFalse;
- }
- CleanupStack::PopAndDestroy( &str2compare );
- }
- }
- }
- if ( publisherName && contentType && contentId )
- {
- result = ETrue;
- }
- CleanupStack::PopAndDestroy( &content_id );
- CleanupStack::PopAndDestroy( &content );
- CleanupStack::PopAndDestroy( &publisher );
- return result;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-TBool CCPNotificationHandler::CheckOperationTypeL( const CLiwDefaultMap& aMap,
- const CCPLiwMap& aFilter )
- {
- TBool result = ETrue;
- RBuf operation;
- operation.CleanupClosePushL();
- if ( aFilter.GetPropertyL( KOperation, operation ) )
- {
- result = EFalse;
- TLiwVariant value;
- value.PushL( );
- if ( aMap.FindL( KOperation, value ) )
- {
- TPtrC operationToCompare( KNullDesC );
- if ( value.Get( operationToCompare ) )
- {
- if ( operation.Find( operationToCompare ) != KErrNotFound )
- {
- result = ETrue;
- }
- }
- }
- CleanupStack::PopAndDestroy( &value );
- }
- CleanupStack::PopAndDestroy( &operation );
- return result;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-TBool CCPNotificationHandler::CheckRegistryTypeL( const CLiwDefaultMap& aMap,
- const CCPLiwMap& aFilter )
- {
- TBool result = ETrue;
- RBuf type;
- type.CleanupClosePushL();
- if ( aFilter.GetPropertyL( KType, type ) )
- {
- result = EFalse;
- TLiwVariant value;
- value.PushL( );
- if ( aMap.FindL( KType, value ) )
- {
- TPtrC typeToCompare( KNullDesC );
- if ( value.Get( typeToCompare ) )
- {
- if ( type.Find( typeToCompare ) != KErrNotFound )
- {
- result = ETrue;
- }
- }
- }
- CleanupStack::PopAndDestroy( &value );
- }
- CleanupStack::PopAndDestroy( &type );
- return result;
- }
--- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserver.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,393 +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: Content publisher Server
-*
-*/
-
-
-#include <liwcommon.h>
-#include <ecom/ecom.h>
-#include <fbs.h>
-
-#include "cpublisherregistrymap.h"
-#include "cpserver.h"
-#include "cpglobals.h"
-#include "cpdebug.h"
-#include "cpserversession.h"
-#include "cpserverdatamanager.h"
-#include "cpactionhandlerthread.h"
-
-
-// Policy Server
-// ============================================================================
-const TUint KServerPolicyRangeCount = 3;
-const TInt KServerPolicyRanges[KServerPolicyRangeCount] =
- {
- 0, // range 0 -- ECpServerExecuteAction - 1
- ECpServerGetListSize, // range ECpServerGetListSize -- ECpServerExecuteAction - 1
- ECpServerExecuteAction
- // range ECpServerExecuteAction -- inf
- };
-
-const TUint8 KServerPolicyElementsIndex[KServerPolicyRangeCount] =
- {
- 0, // applies to 0th range
- 1, // applies to 1st range
- CPolicyServer::EAlwaysPass
- };
-
-const CPolicyServer::TPolicyElement KServerPolicyElements[] =
- {
- {
- _INIT_SECURITY_POLICY_C1(ECapability_None), CPolicyServer::EFailClient
- },
- {
- _INIT_SECURITY_POLICY_C1(ECapability_None), CPolicyServer::EFailClient
- }
- };
-
-const CPolicyServer::TPolicy KServerPolicy =
- {
- CPolicyServer::EAlwaysPass, // specifies all connect attempts should pass
- KServerPolicyRangeCount,
- KServerPolicyRanges,
- KServerPolicyElementsIndex,
- KServerPolicyElements
- };
-// ============================================================================
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CCPServer::CCPServer
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CCPServer::CCPServer( TInt aPriority ) :
- CPolicyServer( aPriority, KServerPolicy, EUnsharableSessions)
- {
- }
-
-// -----------------------------------------------------------------------------
-// CCPServer::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CCPServer::ConstructL()
- {
- CP_DEBUG( _L8("CCPServer::ConstructL()" ) );
- StartL(KCPServerName);
- iBURListener = CCPServerBURListener::NewL(this);
- iCountSession = 0;
- iBURLock = iBURListener->CheckBUR();
- iDataManager = CCPDataManager::NewL(iBURLock);
- iActionHandlerThread = CCPActionHandlerThread::NewL();
- if (!iBURLock)
- {
- TRAP_IGNORE( DeactivatePublishersL() );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCPServer::NewL
-// Two-phased constructor.
-// -------------------------------------- ---------------------------------------
-//
-CCPServer* CCPServer::NewLC()
- {
- CP_DEBUG( _L8("CCPServer::NewLC()" ) );
- CCPServer* self = new( ELeave ) CCPServer( EPriorityNormal );
- CleanupStack::PushL( self );
- self->ConstructL( );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CCPServer::~CCPServer()
-// Destructor.
-// -------------------------------------- ---------------------------------------
-//
-CCPServer::~CCPServer()
- {
- CP_DEBUG( _L8("CCPServer::~CCPServer()" ) );
- for ( TInt i(0); i< iNotifications.Count( ); i++ )
- {
- iNotifications[i]->Close( );
- }
- iNotifications.Close( );
- delete iDataManager;
- delete iActionHandlerThread;
- delete iBURListener;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPServer::RemoveSession()
- {
- CP_DEBUG( _L8("CCPServer::RemoveSession()" ) );
- iCountSession--;
- if ( !iCountSession )
- {
- Stop( );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPServer::AddSession()
- {
- CP_DEBUG( _L8("CCPServer::AddSession()" ) );
- iCountSession++;
- }
-
-// ---------------------------------------------------------------------------
-// CCPServer::HandleBUREventL
-// ---------------------------------------------------------------------------
-//
-void CCPServer::HandleBUREventL( TBURStatus aStatus )
- {
- CP_DEBUG( _L8("CCPServer::HandleBUREventL()" ) );
- if ( (aStatus == EBURStatusBackup ) || (aStatus == EBURStatusRestore ) )
- {
- iBURLock = ETrue;
- iDataManager->CloseDatabase( );
- }
- else
- {
- iDataManager->OpenDatabaseL( );
- iBURLock = EFalse;
- }
- }
-
-// ---------------------------------------------------------------------------
-// CCPServer::GetLock
-// ---------------------------------------------------------------------------
-//
-TBool CCPServer::GetLock()
- {
- return iBURLock;
- }
-
-// -----------------------------------------------------------------------------
-// CCPServer::GetNotifications
-// -----------------------------------------------------------------------------
-//
-RPointerArray<CLiwDefaultList>& CCPServer::GetNotifications( )
- {
- return iNotifications;
- }
-
-
-// -----------------------------------------------------------------------------
-// CCPServer::NewSessionL
-// Create new session.
-// -----------------------------------------------------------------------------
-//
-CSession2* CCPServer::NewSessionL( const TVersion& /*aVersion*/,
- const RMessage2& /*aMessage*/) const
- {
- CP_DEBUG( _L8("CCPServer::NewSessionL()" ) );
- TPointersForSession passer;
- passer.iDataManager = iDataManager;
- passer.iServer = const_cast<CCPServer*>(this);
- passer.iActionHandlerThread = iActionHandlerThread;
- return CCPServerSession::NewL( passer );
- }
-
-// -----------------------------------------------------------------------------
-// CCPServer::RunError
-// RunError is called when RunL leaves.
-// -----------------------------------------------------------------------------
-//
-TInt CCPServer::RunError( TInt /*aError*/)
- {
- ReStart( );
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CCPServer::PanicClient
-// Panic client.
-// -----------------------------------------------------------------------------
-//
-void CCPServer::PanicClient( const RMessage2& aMessage, TCPServerPanic aPanic )
- {
- aMessage.Panic( KCPServerName, aPanic );
- }
-
-// -----------------------------------------------------------------------------
-// CCPServer::PanicServer
-// Panic server.
-// -----------------------------------------------------------------------------
-//
-void CCPServer::PanicServer( TCPServerPanic aPanic )
- {
- User::Panic( KCPServerName, aPanic );
- }
-
-
-// -----------------------------------------------------------------------------
-// CCPServer::SendNotificationL
-// -----------------------------------------------------------------------------
-//
-void CCPServer::AppendNotificationL( CCPLiwMap* aMap )
- {
- aMap->InsertL( KType, TLiwVariant( KPublisher ) );
- aMap->InsertL( KOperation, TLiwVariant( KOperationUpdate ) );
- CLiwDefaultList* list = CLiwDefaultList::NewLC( );
- list->AppendL( TLiwVariant( aMap ) );
- iNotifications.AppendL( list );
- CleanupStack::Pop( list );
- }
-
-// -----------------------------------------------------------------------------
-// CCPServer::Stop
-// Stop serwer
-// -----------------------------------------------------------------------------
-//
-void CCPServer::Stop()
- {
- CP_DEBUG( _L8("CCPServer::Stop()" ) );
- CActiveScheduler::Stop( );
- }
-
-// -----------------------------------------------------------------------------
-// CCPServer::ThreadStart(void)
-// Starts server.
-// -----------------------------------------------------------------------------
-//
-TInt CCPServer::ThreadStart( void )
- {
- __UHEAP_MARK;
- // Create the server, if one with this name does not already exist.
- TFindServer findCountServer( KCPServerName );
- TFullName name;
-
- CTrapCleanup* trapCleanup = CTrapCleanup::New();
- if ( !trapCleanup )
- {
- PanicServer( ECPServerSrvCreateServer );
- }
- CActiveScheduler* activeScheduler = new CActiveScheduler;
- if ( !activeScheduler )
- {
- PanicServer( ECPServerSrvCreateServer );
- }
- CActiveScheduler::Install( activeScheduler );
-
- // Need to check that the server exists.
- if ( findCountServer.Next( name ) != KErrNone )
- {
- User::RenameThread( KCPServerName );
-
- TRAPD( err, CreateAndRunServerL() );
- if ( err != KErrNone )
- {
- PanicServer( ECPServerSrvCreateServer );
- }
- }
-
- delete activeScheduler;
- delete trapCleanup;
- __UHEAP_MARKEND;
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CCPServer::CreateAndRunServerL(void)
-// Creates and runs server.
-// -----------------------------------------------------------------------------
-//
-void CCPServer::CreateAndRunServerL( void )
- {
- // Construct server
- //
- CCPServer* server = CCPServer::NewLC( );
- // Initialisation complete, now signal the client
- //
- RProcess::Rendezvous( KErrNone );
- CActiveScheduler::Start( );
- CleanupStack::PopAndDestroy( server );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPServer::DeactivatePublishersL()
- {
- CLiwGenericParamList* publishers = CLiwGenericParamList::NewLC( );
- CCPLiwMap* map = CPublisherRegistryMap::NewLC( );
- iDataManager->GetActivePublishersL( publishers );
- TInt pos( 0 );
- while( pos != KErrNotFound )
- {
- publishers->FindFirst( pos, KListMap );
-
- if( pos != KErrNotFound )
- {
- TLiwVariant variant = ( *publishers )[pos++].Value( );
- map->Reset( );
- variant.Get( *map );
-
- // update flag value in the database
- TRAP_IGNORE( ResetAndUpdateFlagL( map ) );
-
- //append update notification
- TRAP_IGNORE( AppendNotificationL( map ) );
-
- variant.Reset( );
- }
- }
- CleanupStack::PopAndDestroy( map );
- CleanupStack::PopAndDestroy( publishers );
- }
-
-// -----------------------------------------------------------------------------
-// CCPServer::ResetAndUpdateFlagL
-// Resets Activate flag and update item in the DB
-// -----------------------------------------------------------------------------
-//
-void CCPServer::ResetAndUpdateFlagL( CCPLiwMap* aMap )
- {
- TInt32 flag(0);
- if( !aMap->GetProperty( KFlag, flag ))
- {
- User::Leave(KErrNotFound);
- }
- aMap->Remove( KFlag );
- flag &= 0xFFFFFFFE;
- aMap->InsertL( KFlag, TLiwVariant( flag ) );
- iDataManager->AddDataL( *aMap );
- }
-
-// ============================= LOCAL FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// E32Main entry point.
-// Returns: KErrNone
-// -----------------------------------------------------------------------------
-//
-TInt E32Main()
- {
- return CCPServer::ThreadStart( );
- }
-
-// End of File
--- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserveractionmanager.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include <liwcommon.h>
-#include <liwservicehandler.h>
-#include <s32mem.h>
-
-#include "cpserveractionmanager.h"
-#include "cpdebug.h"
-#include "cpglobals.h"
-
-using namespace LIW;
-
-// ---------------------------------------------------------------------------
-// C++ destructor
-// ---------------------------------------------------------------------------
-//
-CCPActionManager::~CCPActionManager()
- {
- if ( iInterface )
- {
- iInterface->Close( );
- }
- delete iServiceHandler;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPActionManager* CCPActionManager::NewL()
- {
- CCPActionManager* self = CCPActionManager::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPActionManager* CCPActionManager::NewLC()
- {
- CCPActionManager* self = new( ELeave ) CCPActionManager;
- CleanupStack::PushL( self );
- self->ConstructL( );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// C++ constructor.
-// ---------------------------------------------------------------------------
-//
-CCPActionManager::CCPActionManager()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-// Standard 2nd phase constructor.
-// ---------------------------------------------------------------------------
-//
-void CCPActionManager::ConstructL()
- {
- CP_DEBUG( _L8("CCPActionManager::ConstructL()") );
- iServiceHandler = CLiwServiceHandler::NewL( );
- }
-
-// -----------------------------------------------------------------------------
-// CCPActionManager::ExecuteL
-// --------------- --------------------------------------------------------------
-//
-void CCPActionManager::ExecuteL( const CLiwGenericParamList& aList )
- {
- CP_DEBUG( _L8("CCPActionManager::ExecuteL()") );
- if ( !iInterface )
- {
- PrepareServiceL( iInterface );
- }
- CLiwGenericParamList* inparam = CLiwGenericParamList::NewLC( );
- CLiwGenericParamList* outparam = CLiwGenericParamList::NewLC( );
- PrepareInputListL( aList, *inparam );
-
- iInterface->ExecuteCmdL( KCmdExecute, *inparam, *outparam ) ;
- TInt pos(0);
- outparam->FindFirst( pos, EGenericParamError );
- if ( pos != KErrNotFound )
- {
- User::LeaveIfError( ( *outparam )[pos].Value().AsTInt32( ) );
- }
- else
- {
- User::Leave( KErrNotFound );
- }
- CleanupStack::PopAndDestroy( outparam );
- CleanupStack::PopAndDestroy( inparam );
- }
-
-// -----------------------------------------------------------------------------
-// CCPActionManager::ExecuteL
-// --------------- --------------------------------------------------------------
-//
-void CCPActionManager::PrepareServiceL( MLiwInterface*& aInterface )
- {
- CP_DEBUG( _L8("CCPActionManager::PrepareServiceL()") );
- CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL( ) );
- CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL( ) );
- CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL( 1,
- KActionHandlerInterface, KActionHandlerService );
- CleanupStack::PushL( crit );
- crit->SetServiceClass( TUid::Uid( KLiwClassBase ) );
- RCriteriaArray array;
- CleanupClosePushL( array );
- array.AppendL( crit );
- iServiceHandler->AttachL( array );
- iServiceHandler->ExecuteServiceCmdL( *crit, *inparam, *outparam );
- CleanupStack::PopAndDestroy( &array );
- CleanupStack::PopAndDestroy( crit );
- TInt pos = 0;
- outparam->FindFirst( pos, KActionHandlerInterface );
- if ( pos != KErrNotFound )
- {
- aInterface = ( *outparam )[pos].Value().AsInterface( );
- }
- else
- {
- User::Leave( KErrNotFound );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCPActionManager::PrepareInputListL
-// --------------- --------------------------------------------------------------
-//
-void CCPActionManager::PrepareInputListL( const CLiwGenericParamList& aList,
- CLiwGenericParamList& aTarget )
- {
- CP_DEBUG( _L8("CCPActionManager::PrepareInputListL()") );
- const TLiwGenericParam* param= NULL;
- TInt pos( 0);
- param = aList.FindFirst( pos, KListMap, EVariantTypeMap );
- if ( param && pos !=KErrNotFound )
- {
- CLiwDefaultMap* map = CLiwDefaultMap::NewLC( );
- param->Value().Get( *map );
- ExtractUidAndMapL( *map, aTarget );
- CleanupStack::PopAndDestroy( map );
- }
- else
- {
- User::Leave( KErrNotFound );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCPActionManager::ExtractUidAndMapL
-// --------------- --------------------------------------------------------------
-//
-void CCPActionManager::ExtractUidAndMapL( const CLiwDefaultMap& aMap,
- CLiwGenericParamList& aTarget )
- {
- CP_DEBUG( _L8("CCPActionManager::ExtractUidAndMapL()") );
- TLiwVariant variant;
- variant.PushL( );
- if ( aMap.FindL( KActionMap, variant ) )
- {
- CLiwDefaultMap* map = CLiwDefaultMap::NewLC( );
- variant.Get( *map );
- if ( map->FindL( KDataForActionHandler, variant ) )
- {
- TLiwGenericParam param( KDataForActionHandler, variant);
- aTarget.AppendL( param );
- }
- if ( map->FindL( KPluginUid, variant ) )
- {
- TLiwGenericParam param( KPluginUid, variant);
- aTarget.AppendL( param );
- }
- CleanupStack::PopAndDestroy( map );
- }
-
- CleanupStack::PopAndDestroy( &variant );
- }
-
--- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserverburlistener.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
-* 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: Backup and restore events listener.
- *
-*/
-
-
-#include <connect/sbdefs.h>
-
-#include "cpserverburlistener.h"
-#include "cpdebug.h"
-// conn - "Declaration of Types and Constants for Secure Backup and Restore" namespace, see sbdefs.h
-using namespace conn;
-
-// ============================ MEMBER FUNCTIONS =============================
-
-// -----------------------------------------------------------------------------
-// CSpaceDataStorageBURListener::CSpaceDataStorageBURListener
-// C++ default constructor
-// -----------------------------------------------------------------------------
-//
-CCPServerBURListener::CCPServerBURListener( MBURListenerCallback* aCallback ) :
- CActive(EPriorityNormal)
- {
- CActiveScheduler::Add( this );
- iCallback = aCallback;
-
- // Prepare automatically
- iProperty.Attach( KUidSystemCategory, KUidBackupRestoreKey );
- SetActive( );
- iProperty.Subscribe( iStatus );
- }
-
-// -----------------------------------------------------------------------------
-// CSpaceDataStorageBURListener::ConstructL
-// S2nd phase constructor.
-// -----------------------------------------------------------------------------
-//
-void CCPServerBURListener::ConstructL()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-// CSpaceDataStorageBURListener::NewL
-// ---------------------------------------------------------------------------
-//
-CCPServerBURListener* CCPServerBURListener::NewL(
- MBURListenerCallback* aCallback )
- {
- CCPServerBURListener* self = new (ELeave)
- CCPServerBURListener( aCallback );
- CleanupStack::PushL( self );
- self->ConstructL( );
- CleanupStack::Pop( self );
-
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CSpaceDataStorageBURListener::~CSpaceDataStorageBURListener
-// ---------------------------------------------------------------------------
-//
-CCPServerBURListener::~CCPServerBURListener()
- {
- Cancel( );
- iProperty.Close( );
- }
-
-// ---------------------------------------------------------------------------
-// CSpaceDataStorageBURListener::DoCancel
-// ---------------------------------------------------------------------------
-//
-void CCPServerBURListener::DoCancel()
- {
- iProperty.Cancel( );
- }
-
-// ---------------------------------------------------------------------------
-// CSpaceDataStorageBURListener::RunError
-// ---------------------------------------------------------------------------
-//
-TInt CCPServerBURListener::RunError( TInt /*aError*/)
- {
- // No need to do anything
- return KErrNone;
- }
-
-// ---------------------------------------------------------------------------
-// CCPServerBURListener::CheckStatus
-// ---------------------------------------------------------------------------
-//
-TBool CCPServerBURListener::CheckBUR()
- {
- TInt pnsStatus;
- TInt err;
- err = iProperty.Get( KUidSystemCategory, KUidBackupRestoreKey, pnsStatus );
- if ( pnsStatus < EBURBackupFull && err >= KErrNone )
- {
- return EFalse;
- }
- else
- {
- return ETrue;
- }
- }
-
-// ---------------------------------------------------------------------------
-// CSpaceDataStorageBURListener::RunL
-// ---------------------------------------------------------------------------
-//
-void CCPServerBURListener::RunL()
- {
- CP_DEBUG( _L8("CCPServerBURListener::RunL()") );
- // Re-issue request before notifying
- SetActive( );
- iProperty.Subscribe( iStatus );
-
- TInt pnsStatus;
- User::LeaveIfError( iProperty.Get( KUidSystemCategory,
- KUidBackupRestoreKey, pnsStatus ) );
-
- MBURListenerCallback::TBURStatus
- burStatus(MBURListenerCallback::EBURStatusNone);
- if ( pnsStatus & (EBURBackupFull | EBURBackupPartial ) )
- {
- burStatus = MBURListenerCallback::EBURStatusBackup;
- }
- else if ( pnsStatus & (EBURRestoreFull | EBURRestorePartial ) )
- {
- burStatus = MBURListenerCallback::EBURStatusRestore;
- }
-
- iCallback->HandleBUREventL( burStatus );
- }
-
-// End of File
--- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserverdatamanager.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,545 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include <liwcommon.h>
-#include <s32mem.h>
-#include <escapeutils.h>
-
-#include "cpserverdatamanager.h"
-#include "ccontentmap.h"
-#include "cpublisherregistrymap.h"
-#include "cpstorage.h"
-#include "cpdebug.h"
-#include "cpstoragefactory.h"
-#include "cpglobals.h"
-#include "cpserversession.h"
-#include "cpnotificationhandler.h"
-
-using namespace LIW;
-
-// ---------------------------------------------------------------------------
-// C++ destructor
-// ---------------------------------------------------------------------------
-//
-CCPDataManager::~CCPDataManager()
- {
- iNotificationsArray.Close( );
- delete iStorage;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPDataManager* CCPDataManager::NewL( TBool aBool )
- {
- CCPDataManager* self = CCPDataManager::NewLC( aBool );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPDataManager* CCPDataManager::NewLC( TBool aBool )
- {
- CCPDataManager* self = new( ELeave ) CCPDataManager;
- CleanupStack::PushL( self );
- self->ConstructL( aBool );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// C++ constructor.
-// ---------------------------------------------------------------------------
-//
-CCPDataManager::CCPDataManager()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-// Standard 2nd phase constructor.
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::ConstructL( TBool aBool )
- {
- CP_DEBUG( _L8("CCPDataManager::ConstructL()") );
- if ( !aBool )
- {
- iStorage = StorageFactory::NewDatabaseL( );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TUint CCPDataManager::AddDataL( CCPLiwMap& aMap )
- {
- CP_DEBUG( _L8("CCPDataManager::AddDataL()") );
- __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) );
-
- CCPLiwMap* getlistmap = CreateMapForGetlistLC( aMap );
-
- TBool activateMap = aMap.GetActivateInfo();
- TBool activateDB ( EFalse );
- TBool activateSupport =aMap.ActivateActionSupport( );
-
- if( activateSupport )
- {
- activateDB = GetActivateInfoL( getlistmap );
- }
-
- TInt id = iStorage->AddL( &aMap );
-
- if( activateSupport )
- {
- if ( activateMap && !activateDB )
- {
- // append action trigger for activate
- aMap.InsertL( KActionTrigger, TLiwVariant( KActivateTrigger ) );
- }
- if ( !activateMap && activateDB )
- {
- // append action trigger for deactivate
- aMap.InsertL( KActionTrigger, TLiwVariant( KDeactivateTrigger ) );
- }
- //remove flag from map ( needed because map will be used in getlist
- //operation )
- aMap.Remove( KFlag );
- }
-
- CleanupStack::PopAndDestroy( getlistmap );
-
- return id;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::GetListL( const CCPLiwMap& aMap,
- CLiwGenericParamList& aOutParamList )
- {
- CP_DEBUG( _L8("CCPDataManager::GetListL()") );
- __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) );
- iStorage->GetListL( &aMap, aOutParamList );
- }
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CCPDataManager::GetActionL( const CCPLiwMap& aMap,
- CLiwGenericParamList& aOutParamList, CLiwDefaultList* aNotificationList )
- {
- CP_DEBUG( _L8("CCPDataManager::GetActionL()") );
- __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) );
-
- CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC( );
- TInt result( KErrNone );
- TRAP( result, iStorage->GetListL( &aMap, *paramList ) );
- RBuf8 actionTrigger;
- actionTrigger.CleanupClosePushL();
-
- if ( aMap.GetPropertyL( KActionTrigger, actionTrigger ) )
- {
- const TLiwGenericParam* param;
- TInt pos( 0);
-
- param = paramList->FindFirst( pos, KListMap );
- //at least one param should be valid to preceed
- if ( !param || pos == KErrNotFound )
- {
- BuildDefaultChangeInfoL(&aMap, aNotificationList);
- }
-
- //iteration through paramList items
- while ( param && pos != KErrNotFound )
- {
- BuildChangeInfoL( &aMap, param, aNotificationList );
- FillActionParamListL( aOutParamList, param, actionTrigger );
- param = paramList->FindNext( pos, KListMap );
- }
- }
- else
- {
- User::Leave( KErrNotFound );
- }
- CleanupStack::PopAndDestroy( &actionTrigger );
- CleanupStack::PopAndDestroy( paramList );
- return result;
- }
-
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::FillActionParamListL(
- CLiwGenericParamList& aOutParamList,
- const TLiwGenericParam* aParam,
- RBuf8 & aActionTrigger)
- {
- CP_DEBUG( _L8("CCPDataManager::FillActionParamListL()") );
- __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) );
-
- RBuf8 actionBinaries;
- actionBinaries.CleanupClosePushL();
- ExtractActionL( aParam, actionBinaries );
-
- RDesReadStream str(actionBinaries);
- CleanupClosePushL( str );
- CLiwDefaultMap* actionMap = CLiwDefaultMap::NewLC( str );
- ExtractTriggerL( aOutParamList, actionMap, aActionTrigger );
-
- CleanupStack::PopAndDestroy( actionMap );
- CleanupStack::PopAndDestroy( &str );
- CleanupStack::PopAndDestroy( &actionBinaries );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::GetActivePublishersL( CLiwGenericParamList* aResultList )
- {
- CCPLiwMap *map = CPublisherRegistryMap::NewLC();
- map->InsertL( KFlag, TLiwVariant( TUint( 0 | EActivate ) ) );
- iStorage->GetListL( map, *aResultList );
- CleanupStack::PopAndDestroy(map);
- }
-
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::ExtractTriggerL( CLiwGenericParamList& aOutParamList,
- const CLiwDefaultMap* aMap, const TDesC8& aTrigger )
- {
- CP_DEBUG( _L8("CCPDataManager::GetActionL()") );
- CLiwDefaultMap* targetMap = CLiwDefaultMap::NewLC( );
- TLiwVariant variant;
- variant.PushL( );
- if ( aMap->FindL( aTrigger, variant ) )
- {
- targetMap->InsertL( KActionMap, variant );
- }
- else
- {
- User::Leave( KErrNotFound );
- }
-
- TLiwGenericParam result( KListMap, TLiwVariant( targetMap ));
- aOutParamList.AppendL( result );
- CleanupStack::PopAndDestroy( &variant );
- CleanupStack::PopAndDestroy( targetMap );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::RemoveDataL( const CCPLiwMap& aMap )
- {
- CP_DEBUG( _L8("CCPDataManager::RemoveData()") );
- __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) );
- iStorage->RemoveL( &aMap );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::AddObserverL(
- CCPNotificationHandler* aNotificationHandler )
- {
- CP_DEBUG( _L8("CCPDataManager::AddObserverL()") );
- __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) );
- iNotificationsArray.AppendL( aNotificationHandler );
- if ( iNotificationsArray.Count( ) == 1 )
- {
- iStorage->SetCallback( this );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::RemoveObserver(
- CCPNotificationHandler* aNotificationHandler )
- {
- CP_DEBUG( _L8("CCPDataManager::RemoveObserver()") );
- TInt index = iNotificationsArray.Find( aNotificationHandler );
- __ASSERT_DEBUG( index >= 0 , User::Panic( _L("cpserver"), 0 ) );
- iNotificationsArray.Remove( index );
- if ( iNotificationsArray.Count( ) == 0 )
- {
- iStorage->SetCallback( 0 );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::HandleChangeL( CLiwDefaultList* aListOfMaps )
- {
- CP_DEBUG( _L8("CCPDataManager::HandleChangeL()") );
- //for every session
- for ( TInt i = 0; i<iNotificationsArray.Count( ); i++ )
- {
- TRAPD(error, SendNotificationL(aListOfMaps, i));
- if ( error )
- {
- iNotificationsArray[i]->ErrorComplete( error );
- }
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::CloseDatabase()
- {
- CP_DEBUG( _L8("CCPDataManager::CloseDatabase()") );
- delete iStorage;
- iStorage = NULL;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::OpenDatabaseL()
- {
- CP_DEBUG( _L8("CCPDataManager::OpenDatabaseL()") );
- if ( !iStorage )
- {
- iStorage = StorageFactory::NewDatabaseL( );
-
- // Restore storage observers
- if ( iNotificationsArray.Count() > 0 )
- {
- iStorage->SetCallback( this );
- }
- }
- }
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::SendNotificationL( CLiwDefaultList* aListOfMaps,
- TInt aIndex )
- {
- CP_DEBUG( _L8("CCPDataManager::SendNotificationL()") );
- iNotificationsArray[aIndex]->SendNotificationL( aListOfMaps );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDataManager::ExtractActionL( const TLiwGenericParam* aParam, RBuf8& aAction )
- {
- CP_DEBUG( _L8("CCPDataManager::ExtractActionL()") );
- CLiwDefaultMap* map = CLiwDefaultMap::NewLC( );
- if ( !aParam->Value().Get( *map ) )
- {
- User::Leave( KErrArgument );
- }
-
- TLiwVariant variant; variant.PushL( );
- TPtrC8 tempBuf( KNullDesC8 );
- if ( map->FindL( KActionMap, variant )
- && variant.Get( tempBuf ) )
- {
- aAction.CreateL( tempBuf );
- }
- else
- {
- User::Leave( KErrArgument );
- }
-
- CleanupStack::PopAndDestroy( &variant );
- CleanupStack::PopAndDestroy( map );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CCPLiwMap* CCPDataManager::CreateMapForGetlistLC( const CCPLiwMap& aMap )
- {
- CCPLiwMap *resultmap = CPublisherRegistryMap::NewLC();
- RBuf publisher;
- publisher.CleanupClosePushL();
- RBuf content_type;
- content_type.CleanupClosePushL();
- RBuf content_id;
- content_id.CleanupClosePushL();
- aMap.GetPropertyL( KContentType, content_type );
- aMap.GetPropertyL( KContentId, content_id );
- aMap.GetPropertyL( KPublisherId, publisher );
- resultmap->InsertL( KPublisherId, TLiwVariant( publisher ));
- resultmap->InsertL( KContentId, TLiwVariant( content_id ));
- resultmap->InsertL( KContentType, TLiwVariant( content_type ));
- CleanupStack::PopAndDestroy( &content_id );
- CleanupStack::PopAndDestroy( &content_type );
- CleanupStack::PopAndDestroy( &publisher );
- return resultmap;
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-TBool CCPDataManager::GetActivateInfoL( const CCPLiwMap* aMap )
- {
- TBool result( EFalse );
- CLiwGenericParamList* outList = CLiwGenericParamList::NewLC();
- TRAPD(err,GetListL(*aMap,*outList));
- if (err == KErrNone)
- {
- TInt pos( 0 );
- outList->FindFirst( pos, KListMap );
- if( pos != KErrNotFound )
- {
- TLiwVariant variant = (*outList)[pos].Value();
- CLiwDefaultMap *map = CLiwDefaultMap::NewLC();
- variant.Get( *map );
- if (map->FindL( KFlag, variant ))
- {
- TUint flag;
- variant.Get( flag );
- result = flag & EActivate;
- }
- CleanupStack::PopAndDestroy( map );
- variant.Reset();
- }
- }
- CleanupStack::PopAndDestroy( outList );
- return result;
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPDataManager::BuildChangeInfoL( const CCPLiwMap* aMap,
- const TLiwGenericParam* aParam,
- CLiwDefaultList* aChangeInfoList )
- {
- TLiwVariant resultVar = aParam->Value();
- resultVar.PushL();
- CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC();
- CLiwDefaultMap* resultMap = CLiwDefaultMap::NewLC();
- resultVar.Get( *resultMap );
-
- CopyVariantL(KId, resultMap, changeInfoMap );
- CopyVariantL(KPublisherId, resultMap, changeInfoMap );
- CopyVariantL(KContentType, resultMap, changeInfoMap );
- CopyVariantL(KContentId, resultMap, changeInfoMap );
- CopyVariantL(KFlag, resultMap, changeInfoMap );
- CopyVariantL(KType, aMap, changeInfoMap );
- CopyVariantL(KActionTrigger, aMap, changeInfoMap );
- CopyActionTrigger16L( aMap, changeInfoMap );
-
- changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) );
-
- aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) );
- CleanupStack::PopAndDestroy( resultMap );
- CleanupStack::PopAndDestroy( changeInfoMap );
- CleanupStack::PopAndDestroy( &resultVar );
- }
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPDataManager::BuildDefaultChangeInfoL( const CCPLiwMap* aMap,
- CLiwDefaultList* aChangeInfoList )
- {
- CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC();
-
- CopyVariantL(KId, aMap, changeInfoMap );
- CopyVariantL(KPublisherId, aMap, changeInfoMap );
- CopyVariantL(KContentType, aMap, changeInfoMap );
- CopyVariantL(KContentId, aMap, changeInfoMap );
- CopyVariantL(KFlag, aMap, changeInfoMap );
- CopyVariantL(KType, aMap, changeInfoMap );
- CopyVariantL(KActionTrigger, aMap, changeInfoMap );
- CopyActionTrigger16L( aMap, changeInfoMap );
-
- changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) );
-
- aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) );
- CleanupStack::PopAndDestroy( changeInfoMap );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPDataManager::CopyVariantL(const TDesC8& aKey,
- const CLiwMap* aInMap, CLiwDefaultMap* aOutMap )
- {
- TLiwVariant variant;
- variant.PushL();
- if ( aInMap->FindL( aKey, variant ) )
- {
- aOutMap->InsertL( aKey, variant );
- }
- CleanupStack::PopAndDestroy( &variant );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPDataManager::CopyActionTrigger16L(
- const CLiwMap* aInMap, CLiwDefaultMap* aOutMap )
- {
- TLiwVariant variant;
- variant.PushL();
- if ( aInMap->FindL( KActionTrigger(), variant ) )
- {
-
- TPtrC8 result8( KNullDesC8 );
- if( variant.Get( result8 ) )
- {
- RBuf actionTrigger;
- actionTrigger.CleanupClosePushL();
- actionTrigger.Assign(
- EscapeUtils::ConvertToUnicodeFromUtf8L( result8 ) );
-
- variant.Reset();
- variant.Set( actionTrigger );
- CleanupStack::PopAndDestroy( &actionTrigger );
- }
-
- aOutMap->InsertL( KActionTrigger16(), variant );
- }
- CleanupStack::PopAndDestroy( &variant );
- }
-
--- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,483 +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: Content Publisher Server Session
- *
-*/
-
-
-// INCLUDE FILES
-#include <s32mem.h>
-// for CleanupResetAndDestroyPushL
-#include <mmf/common/mmfcontrollerpluginresolver.h>
-#include <liwgenericparam.h>
-
-#include "cpserversession.h"
-#include "cpliwmap.h"
-#include "cpublisherregistrymap.h"
-#include "cpsecuritypolicy.h"
-#include "cpserverdef.h"
-#include "cpdebug.h"
-#include "cpserver.h"
-#include "cpserverdatamanager.h"
-#include "cpactionhandlerthread.h"
-#include "cpnotificationhandler.h"
-
-
-using namespace LIW;
-
-// ================= MEMBER FUNCTIONS =======================
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CCPServerSession* CCPServerSession::NewL( TPointersForSession& aPasser )
- {
- CCPServerSession* self = CCPServerSession::NewLC( aPasser );
- CleanupStack::Pop( self ) ;
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::NewLC
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CCPServerSession* CCPServerSession::NewLC( TPointersForSession& aPasser )
- {
- CCPServerSession* self = new ( ELeave ) CCPServerSession();
- CleanupStack::PushL( self );
- self->ConstructL( aPasser ) ;
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::~CCPServerSession
-// Destructor.
-// -----------------------------------------------------------------------------
-//
-CCPServerSession::~CCPServerSession()
- {
- if ( isRegister && iNotificationHandler )
- {
- //remove notification handler from an array of sessions in data manager
- if ( iDataManager )
- {
- iDataManager->RemoveObserver( iNotificationHandler );
- }
- iNotificationHandler->ErrorComplete( KErrCancel );
- }
- if ( iServer )
- {
- iServer->RemoveSession( );
- }
- delete iNotificationHandler;
- delete iParamList;
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::CCPServerSession
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CCPServerSession::CCPServerSession() :
- CSession2()
- {
-
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CCPServerSession::ConstructL( TPointersForSession& aPasser )
- {
- CP_DEBUG( _L8("CCPServerSession::ConstructL()") );
- iDataManager = aPasser.iDataManager;
- iServer = aPasser.iServer;
- iActionHandlerThread = aPasser.iActionHandlerThread;
- iServer->AddSession( );
- isRegister = EFalse;
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::ServiceL
-// Handle client requests.
-// -----------------------------------------------------------------------------
-//
-void CCPServerSession::ServiceL( const RMessage2& aMessage )
- {
- CP_DEBUG( _L8("CCPServerSession::ServiceL()" ) );
- TBool serverLocked = GetServerLock( aMessage );
- if ( serverLocked )
- {
- aMessage.Complete( KErrLocked );
- }
- else
- {
- TInt err(KErrNone);
- TBool panicedClient(EFalse);
- TRAP( err , DispatchMessageL( aMessage, panicedClient ) );
- if ( (!(aMessage.Function( ) == ECpServerRegisterObserver )
- || err == KErrInUse) && !panicedClient )
- {
- aMessage.Complete( err );
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::ServiceL
-// Handle client requests.
-// -----------------------------------------------------------------------------
-//
-void CCPServerSession::DispatchMessageL( const RMessage2& aMessage, TBool& aPanicedClient )
- {
- CP_DEBUG( _L8("CCPServerSession::DispatchMessageL()" ) );
- switch ( aMessage.Function( ) )
- {
- case ECpServerAddData:
- AddDataL( aMessage );
- break;
- case ECpServerGetListSize:
- GetListSizeL( aMessage );
- break;
- case ECpServerGetListData:
- GetListDataL( aMessage );
- break;
- case ECpServerRemoveData:
- RemoveDataL( aMessage );
- break;
- case ECpServerRegisterObserver:
- RegisterObserverL( aMessage );
- break;
- case ECpServerAddObserver:
- AddObserverL( aMessage );
- break;
- case ECpServerRemoveObserver:
- RemoveObserverL( aMessage );
- break;
- case ECpServerUnRegisterObserver:
- UnregisterObserverL( );
- break;
- case ECpServerGetChangeInfoData:
- GetChangeInfoDataL( aMessage );
- break;
- case ECpServerExecuteAction:
- ExecuteActionL( aMessage );
- break;
- default:
- iServer->PanicClient( aMessage, ECPServerBadRequest );
- aPanicedClient = ETrue;
- break;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::AddDataL
-// --------------- --------------------------------------------------------------
-//
-void CCPServerSession::AddDataL( const RMessage2& aMessage )
- {
- CP_DEBUG( _L8("CCPServerSession::AddDataL()" ) );
- CCPLiwMap* map = UnpackFromClientLC( aMessage );
- map->SetSecurityL( aMessage );
- TBool activateSupport = map->ActivateActionSupport( );
- TUint id( 0 );
- id = iDataManager->AddDataL( *map );
- TPckg<TUint> idData(id);
- aMessage.WriteL( KReturnPosition, idData );
- if(activateSupport)
- {
- CLiwDefaultList* list = CLiwDefaultList::NewLC( );
- // execute activation or deactivation action for publisher
- TRAP_IGNORE( GetAndExecuteActionL( map, list ) );
- TRAP_IGNORE( SendNotificationL( map, list ) );
- CleanupStack::PopAndDestroy( list );
- }
- CleanupStack::PopAndDestroy( map );
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::GetListL
-// --------------- --------------------------------------------------------------
-//
-void CCPServerSession::GetListSizeL( const RMessage2& aMessage )
- {
- CP_DEBUG( _L8("CCPServerSession::GetListSizeL()" ) );
- CCPLiwMap* map = UnpackFromClientLC( aMessage );
- map->SetSecurityL( aMessage );
- delete iParamList;
- iParamList = NULL;
- iParamList = CLiwGenericParamList::NewL( );
- iDataManager->GetListL( *map, *iParamList );
- TPckg<TInt> sizeDes(iParamList->Size( ) );
- aMessage.WriteL( KReturnPosition, sizeDes );
- CleanupStack::PopAndDestroy( map );
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::GetListDataL
-// --------------- --------------------------------------------------------------
-//
-void CCPServerSession::GetListDataL( const RMessage2& aMessage )
- {
- CP_DEBUG( _L8("CCPServerSession::GetListDataL()" ) );
- if( iParamList )
- {
- ExternalizeAndWriteToClientL( aMessage, iParamList );
- delete iParamList;
- }
- iParamList = NULL;
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::RemoveDataL
-// --------------- --------------------------------------------------------------
-//
-void CCPServerSession::RemoveDataL( const RMessage2& aMessage )
- {
- CP_DEBUG( _L8("CCPServerSession::RemoveDataL()" ) );
- CCPLiwMap* map = UnpackFromClientLC( aMessage );
- map->SetSecurityL( aMessage );
- iDataManager->RemoveDataL( *map );
- CleanupStack::PopAndDestroy( map );
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::ExecuteActionL
-// --------------- --------------------------------------------------------------
-//
-void CCPServerSession::ExecuteActionL( const RMessage2& aMessage )
- {
- TInt error(KErrNone);
- CP_DEBUG( _L8("CCPServerSession::ExecuteActionSizeL()" ) );
- CCPLiwMap* map = UnpackFromClientLC( aMessage );
- CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC( );
- CLiwDefaultList* list = CLiwDefaultList::NewLC();
- error = iDataManager->GetActionL( *map, *paramList, list );
- //we notify apart from action execution result. So in fact
- //notification means there was an attempt to execute action
- iDataManager->HandleChangeL( list );
- User::LeaveIfError( error );
- ExecuteL( *paramList );
- CleanupStack::PopAndDestroy( list );
- CleanupStack::PopAndDestroy( paramList );
- CleanupStack::PopAndDestroy( map );
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::ExecuteL
-// --------------- --------------------------------------------------------------
-//
-void CCPServerSession::ExecuteL(
- const CLiwGenericParamList& aActionParams )
- {
- for ( TInt i = 0; i < aActionParams.Count(); i++ )
- {
- TLiwGenericParam param;
- param.PushL();
- aActionParams.AtL( i, param );
- CLiwGenericParamList* singleAction = CLiwGenericParamList::NewLC();
- singleAction->AppendL( param );
- TRAP_IGNORE( iActionHandlerThread->ExecuteL( *singleAction ) );
- CleanupStack::PopAndDestroy( singleAction );
- CleanupStack::PopAndDestroy( ¶m );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::RegisterObserverL
-// --------------- --------------------------------------------------------------
-//
-void CCPServerSession::RegisterObserverL( const RMessage2& aMessage )
- {
- CP_DEBUG( _L8("CCPServerSession::RegisterObserverL()" ) );
- if ( !isRegister )
- {
- if (aMessage.Int3() != KErrAlreadyExists &&
- aMessage.GetDesLength( KDescriptorPosition) < KErrNone )
- {
- iServer->PanicClient( aMessage, ECPServerBadRequest );
- User::Leave( KErrGeneral );
- }
- if ( !iNotificationHandler )
- {
- iNotificationHandler = CCPNotificationHandler::NewL(
- iServer->GetNotifications());
- iDataManager->AddObserverL( iNotificationHandler );
- }
- iNotificationHandler->SaveMessageL( aMessage );
- isRegister = ETrue;
- }
- else
- {
- User::Leave( KErrInUse );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::AddObserverL
-// --------------- --------------------------------------------------------------
-//
-void CCPServerSession::AddObserverL( const RMessage2& aMessage )
- {
- CP_DEBUG( _L8("CCPServerSession::AddObserverL()" ) );
- if( iNotificationHandler )
- {
- iNotificationHandler->AddObserverL( aMessage );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::RemoveObserverL
-// --------------- --------------------------------------------------------------
-//
-void CCPServerSession::RemoveObserverL( const RMessage2& aMessage )
- {
- CP_DEBUG( _L8("CCPServerSession::RemoveObserverL()" ) );
- if( iNotificationHandler )
- {
- iNotificationHandler->RemoveObserverL( aMessage );
- }
- }
-
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::UnregisterObserverL
-// --------------- --------------------------------------------------------------
-//
-void CCPServerSession::UnregisterObserverL()
- {
- CP_DEBUG( _L8("CCPServerSession::UnregisterObserverL()" ) );
- if ( isRegister )
- {
- //remove notification handler from an array of sessions in data manager
- iDataManager->RemoveObserver( iNotificationHandler );
- //reset filter for this session
- iNotificationHandler->ErrorComplete( KErrCancel );
- delete iNotificationHandler;
- iNotificationHandler = NULL;
- isRegister = EFalse;
- }
- else
- {
- User::Leave( KErrNotFound );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::GetChangeInfoDataL
-// -----------------------------------------------------------------------------
-//
-void CCPServerSession::GetChangeInfoDataL( const RMessage2& aMessage )
- {
- CP_DEBUG( _L8("CCPServerSession::GetChangeInfoData()" ) );
- if( iNotificationHandler )
- {
- isRegister = EFalse;
- ExternalizeAndWriteToClientL( aMessage,
- iNotificationHandler->GetPointerToChangeInfoList( ) );
- iNotificationHandler->Reset( );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::ExternalizeAndWriteToClient
-// -----------------------------------------------------------------------------
-//
-void CCPServerSession::ExternalizeAndWriteToClientL(
- const RMessage2& aMessage, const CLiwGenericParamList* outParamList )
- {
- CP_DEBUG( _L8("CCPServerSession::ExternalizeAndWriteToClientL()" ) );
- HBufC8* buf = HBufC8::NewLC( outParamList->Size( ) );
- TPtr8 des = buf->Des( );
- RDesWriteStream writeStream(des);
- CleanupClosePushL( writeStream );
- outParamList->ExternalizeL( writeStream );
- writeStream.CommitL( );
- aMessage.WriteL( KDescriptorPosition, des );
- CleanupStack::PopAndDestroy( &writeStream );
- CleanupStack::PopAndDestroy( buf );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CCPLiwMap* CCPServerSession::UnpackFromClientLC( const RMessage2& aMessage )
- {
- CP_DEBUG( _L8("CCPServerSession::UnpackFromClientLC()") );
- TInt deslen = aMessage.GetDesLengthL( KDescriptorPosition );
- HBufC8* buffer = HBufC8::NewLC( deslen );
- TPtr8 tempDes = buffer->Des( );
- aMessage.Read( KDescriptorPosition, tempDes );
- RDesReadStream datastrm( *buffer);
- CleanupClosePushL( datastrm );
- CCPLiwMap* inParamList = CCPLiwMap::NewL( datastrm );
- CleanupStack::PopAndDestroy( &datastrm );
- CleanupStack::PopAndDestroy( buffer );
- inParamList->PushL( );
- return inParamList;
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::SendNotificationL
-// -----------------------------------------------------------------------------
-//
-void CCPServerSession::SendNotificationL( CCPLiwMap* aMap,
- CLiwDefaultList* aNotificationList )
- {
- RBuf8 trigger;
- trigger.CleanupClosePushL();
- aMap->GetPropertyL( KActionTrigger, trigger );
- if( ( trigger == KActivateTrigger ) || ( trigger == KDeactivateTrigger ) )
- {
- iDataManager->HandleChangeL( aNotificationList );
- }
- CleanupStack::PopAndDestroy( &trigger );
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::GetAndExecuteActionL
-// --------------- --------------------------------------------------------------
-//
-void CCPServerSession::GetAndExecuteActionL( CCPLiwMap* aMap,
- CLiwDefaultList* aNotificationList, TBool aInsertTrigger )
- {
- if (aInsertTrigger)
- {
- aMap->InsertL( KActionTrigger, TLiwVariant( KActivateTrigger ) );
- }
- CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC();
- iDataManager->GetActionL( *aMap, *paramList, aNotificationList );
- iActionHandlerThread->ExecuteL( *paramList );
- CleanupStack::PopAndDestroy( paramList );
- }
-
-// -----------------------------------------------------------------------------
-// CCPServerSession::GetServerLock
-// --------------- --------------------------------------------------------------
-//
-TBool CCPServerSession::GetServerLock( const RMessage2& aMessage )
- {
- // Allways allow to unregister
- return ( (aMessage.Function() != ECpServerUnRegisterObserver)
- && iServer->GetLock() );
-
- }
-// End of File
--- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/bwins/cpstorageu.def Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
- ?NewDatabaseL@StorageFactory@@SAPAVCCpStorage@@XZ @ 1 NONAME ; class CCpStorage * StorageFactory::NewDatabaseL(void)
-
--- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/eabi/cpstorageu.def Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
- _ZN14StorageFactory12NewDatabaseLEv @ 1 NONAME
-
--- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for Content Publisher Storage
-*
-*/
-
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
-cpstorage.mmp
--- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/group/cpstorage.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET cpstorage.dll
-TARGETTYPE dll
-UID 0x1000008d 0x20016B7C
-
-CAPABILITY CAP_GENERAL_DLL
-
-SOURCEPATH ../src
-SOURCE cpstorageengine.cpp
-SOURCE cpstoragefactory.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../cpserver/inc
-USERINCLUDE ../../../contentpublishingutils/contentpublishingdebug/inc
-USERINCLUDE ../../../contentpublishingutils/contentpublishingmap/inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY estor.lib
-LIBRARY sqldb.lib
-LIBRARY efsrv.lib
-LIBRARY cputils.lib
-LIBRARY liwservicehandler.lib
-LIBRARY centralrepository.lib
-
-#ifdef CONTENT_PUBLISHER_DEBUG
-LIBRARY cpdebug.lib
-#endif
-
-
--- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpssqlcommands.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +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 C_CPSSQL_H
-#define C_CPSSQL_H
-#ifdef CONTENT_PUBLISHER_STORAGE_MT
-_LIT( KCPpathdatabase, "c:\\cpdatastorage.sq" );
-#endif
-
-_LIT( KCPdatabase, "[20016B7B]cpdatastorage.sq" );
-_LIT( KCPdatabaseDrive, "C:" );
-_LIT8( KMdsSqlDbaConfig,
- "cache_size=10000; page_size=4096; encoding=\"UTF-8\";" );
-
-//Create Tables
-_LIT( KSQLCreateMainTable,
- "CREATE TABLE CP_MAIN_TABLE( Id INTEGER PRIMARY KEY ,\
- Publisher TEXT NOT NULL,\
- Content_type TEXT NOT NULL,\
- Content_id TEXT NOT NULL,\
- Expiration_date BIGINT NOT NULL,\
- Data BLOB, \
- Action BLOB, \
- UNIQUE( Publisher, Content_type, Content_id ));" );
-
-_LIT( KSQLCreatePublisherTable,
- "CREATE TABLE CP_PUBLISHER_TABLE( Id INTEGER PRIMARY KEY ,\
- Publisher TEXT NOT NULL,\
- Content_type TEXT NOT NULL,\
- Content_id TEXT NOT NULL, \
- Data BLOB, \
- UNIQUE( Publisher, Content_type, Content_id ));" );
-
-//Create Indexes
-_LIT( KSQLIndexOnMain_Publisher,
- "CREATE INDEX Main_PublisherIndex ON CP_MAIN_TABLE(Publisher);" );
-_LIT( KSQLIndexOnMain_Content_type,
- "CREATE INDEX Main_Content_typeIndex ON CP_MAIN_TABLE(Content_type);" );
-
-_LIT( KSQLIndexOnPub_Content_type,
- "CREATE INDEX Pub_Content_typeIndex ON CP_PUBLISHER_TABLE(Content_type);" );
-_LIT( KSQLIndexOnPub_Content_type_Content_id,
- "CREATE INDEX Pub_Content_type_Content_Id_Index ON CP_PUBLISHER_TABLE(Content_type,Content_id);" );
-
-//Insert Data
-//Update Data
-_LIT( KSQLUpdateComplete,
- "UPDATE CP_MAIN_TABLE SET \
- Data = :Data, Action = :Action WHERE Id = :Id " );
-
-_LIT( KSQLUpdateData,
- "UPDATE CP_MAIN_TABLE SET \
- Data = :Data WHERE Id = :Id " );
-
-_LIT( KSQLUpdateAction,
- "UPDATE CP_MAIN_TABLE SET \
- Action = :Action WHERE Id = :Id " );
-
-_LIT( KSQLInsert,
- "INSERT INTO CP_MAIN_TABLE (Publisher,Content_type,Content_id,Expiration_date,Data,Action) VALUES ( \
- :Publisher,\
- :Content_type,\
- :Content_id,\
- :Expiration_date,\
- :Data,\
- :Action )" );
-
-//Delete Data
-_LIT( KSQLDelete, "DELETE FROM CP_MAIN_TABLE WHERE " );
-
-//Get Data
-_LIT( KSQLGetLastInsertId, "SELECT last_insert_rowid() " );
-_LIT( KSQLGetList,
- "SELECT Id,Publisher,Content_type,Content_id,Expiration_date,Data,Action FROM CP_MAIN_TABLE WHERE " );
-_LIT( KSQLGetIds,
- "SELECT Id,Publisher,Content_type,Content_id FROM CP_MAIN_TABLE WHERE " );
-_LIT( KSQLGetAction, "SELECT Id, Action FROM CP_MAIN_TABLE WHERE " );
-_LIT( KSQLGetPublisher, "Publisher = :Publisher" );
-_LIT( KSQLGetContentType, "Content_type = :Content_type" );
-_LIT( KSQLGetContentId, "Content_id = :Content_id" );
-_LIT( KSQLGetId, "Id = :Id" );
-_LIT( KAnd, " AND " );
-
-_LIT( KSQLFetchId,
- "SELECT Id FROM CP_MAIN_TABLE WHERE Publisher =:Publisher AND Content_type=:Content_type AND Content_id =:Content_id" );
-_LIT( KSQLFetchIds,
- "SELECT Publisher,Content_type,Content_id FROM CP_MAIN_TABLE WHERE Id =:Id" );
-
-_LIT( KSQLPublisher, ":Publisher" );
-_LIT( KSQLContent_type, ":Content_type" );
-_LIT( KSQLContent_id, ":Content_id" );
-_LIT( KSQLExpiration_date, ":Expiration_date" );
-_LIT( KSQLData, ":Data" );
-_LIT( KSQLAction, ":Action" );
-_LIT( KSQLId, ":Id" );
-
-_LIT( KSQLOrderRecent, " ORDER BY Id DESC" );
-_LIT( KSQLOrderPublisher, " ORDER BY Publisher" );
-_LIT( KSQLOrderContent, " ORDER BY Content_type" );
-
-_LIT( KColumnId, "Id" );
-_LIT( KColumnPublisher, "Publisher" );
-_LIT( KColumnContent_type, "Content_type" );
-_LIT( KColumnContent_id, "Content_id" );
-_LIT( KColumnExpiration_date, "Expiration_date" );
-_LIT( KColumnData, "Data" );
-_LIT( KColumnAction, "Action" );
-
-_LIT8( KList, "List" );
-
-#endif //C_CPSSQL_H
--- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpssqlconstants.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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 C_CPSSQLCONSTS_H
-#define C_CPSSQLCONSTS_H
-#ifdef CONTENT_PUBLISHER_STORAGE_MT
-_LIT( KCPpathdatabase, "c:\\cpdatastorage.sq" );
-#endif
-
-_LIT( KCPdatabase, "[20016B7B]cpdatastorage.sq" );
-_LIT( KCPdatabaseDrive, "C:" );
-_LIT8( KMdsSqlDbaConfig,
- "cache_size=10000; page_size=4096; encoding=\"UTF-8\";" );
-
-//Create Tables
-_LIT( KSQLCreateMainTable,
- "CREATE TABLE CP_MAIN_TABLE( Id INTEGER PRIMARY KEY ,\
- Publisher TEXT NOT NULL,\
- Content_type TEXT NOT NULL,\
- Content_id TEXT NOT NULL,\
- Expiration_date BIGINT NOT NULL,\
- Access_List BLOB,\
- Data BLOB, \
- Action BLOB, \
- UNIQUE( Publisher, Content_type, Content_id ));" );
-
-_LIT( KSQLCreatePublisherTable,
- "CREATE TABLE CP_PUBLISHER_TABLE( Id INTEGER PRIMARY KEY ,\
- Publisher TEXT NOT NULL,\
- Content_type TEXT NOT NULL,\
- Content_id TEXT NOT NULL, \
- Flag INTEGER NOT NULL, \
- Access_List BLOB,\
- Data BLOB, \
- Action BLOB, \
- UNIQUE( Publisher, Content_type, Content_id ));" );
-
-//Create Indexes
-_LIT( KSQLIndexOnMain_Publisher,
- "CREATE INDEX Main_PublisherIndex ON CP_MAIN_TABLE(Publisher);" );
-_LIT( KSQLIndexOnMain_Content_type,
- "CREATE INDEX Main_Content_typeIndex ON CP_MAIN_TABLE(Content_type);" );
-
-_LIT( KSQLIndexOnPub_Content_type,
- "CREATE INDEX Pub_Content_typeIndex ON CP_PUBLISHER_TABLE(Content_type);" );
-_LIT( KSQLIndexOnPub_Content_type_Content_id,
- "CREATE INDEX Pub_Content_type_Content_Id_Index ON CP_PUBLISHER_TABLE(Content_type,Content_id);" );
-
-#endif //C_CPSSQLCONSTS_H
--- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpstorage.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +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 C_CPSTORAGE_H
-#define C_CPSTORAGE_H
-
-// FORWARD DECLARATIONS
-class CLiwMap;
-class CLiwGenericParamList;
-class CLiwDefaultList;
-
-/**
- * Callback Interface for observing changes in Content Publisher Database
- *
- * @since S60 v5.0
- */
-class MCPChangeNotifier
- {
-public:
-
- /**
- * This method should be implemented by subscriber for changes in
- * database
- *
- * @param Map containing change information
- * @param Id of changed entry
- * @return
- */
- virtual void HandleChangeL( CLiwDefaultList* aListOfMaps ) = 0;
-
- };
-
-/**
- * Interface for CPS database implementations
- *
- */
-class CCpStorage : public CBase
- {
-public:
-
- /**
- * Fetches data from database
- *
- * @param aMap Filtering and sorting criteria
- * @param aList Target for results
- */
- virtual void GetListL( const CLiwMap* aMap,
- CLiwGenericParamList& aList ) = 0;
- /**
- * Adds or Updates data & action to database
- * @param Map containing data item
- * @return id of added entry
- */
- virtual TInt32 AddL( const CLiwMap* aMap ) = 0;
-
- /**
- * Removes data item from database
- * @param Filtering and sorting criteria
- */
- virtual void RemoveL( const CLiwMap* aMap ) = 0;
-
- /**
- * Set database observer
- * @param Callback pointer
- */
- virtual void SetCallback( MCPChangeNotifier* aCallback ) = 0;
-
- };
-
-#endif //C_CPSTORAGE_H
--- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpstorageengine.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +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: Database implementation
- *
-*/
-
-
-#ifndef C_CPSTORAGE_ENGINE_H
-#define C_CPSTORAGE_ENGINE_H
-
-#include <e32cons.h>
-#include <sqldb.h>
-#include "cpstorage.h"
-
-// FORWARD DECLARATIONS
-#ifdef CONTENT_PUBLISHER_DEBUG
-class CCPDebug;
-#endif
-class MCPChangeNotifier;
-class CRepository;
-
-// CLASS DECLARATION
-/**
- * SQLite based databse for Content Publisher
- *
- * @lib cpstorage.dll
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CCpStorageEngine ): public CCpStorage
- {
-public:
-
- /**
- * Two-phased constructor.
- */
- static CCpStorageEngine* NewL();
-
- /**
- * Two-phased constructor.
- */
- static CCpStorageEngine* NewLC();
-
- /**
- * Destructor.
- */
- ~CCpStorageEngine();
-
- //from CCpStorage
-
- /**
- * Fetches data from database
- *
- * @param aMap Filtering and sorting criteria
- * @param aList Target for results
- */
- void GetListL( const CLiwMap* aMap, CLiwGenericParamList& aList );
-
- /**
- * Adds or Updates data & action to database
- * @param Map containing data item
- * @return id of added entry
- */
- TInt32 AddL( const CLiwMap* aMap );
-
- /**
- * Remove data item from database
- * @param Filtering and sorting criteria
- */
- void RemoveL( const CLiwMap* aMap );
-
- /**
- * Set database observer
- * @param Callback pointer
- */
- void SetCallback( MCPChangeNotifier* aCallback );
-
-private:
-
- /**
- * Perform the second phase construction of a CCpStorageEngine object.
- */
- void ConstructL();
-
- /**
- * C++ default constructor.
- */
- CCpStorageEngine();
-
- /**
- * Creates database tables.
- */
- void CreateTablesL();
-
- /**
- * Creates new database.
- * If Db is created for the first time,
- * set repository db state into KSQLDBStateNormal
- */
- void CreateNewDbL();
-
- /**
- * Deletes database.
- * Called when opening Db try return KSqlErrCorrupt error.
- * Removes KSQLDBStateNormal state and set KSQLDBStateRestored into
- * repository db state.
- */
- void DeleteCorruptedDbL();
-
-private:
-
- /**
- * Database.
- * Own.
- */
- RSqlDatabase iSqlDb;
-
- /**
- * Callback pointer.
- * Not own.
- */
- MCPChangeNotifier* iCallback;
-
- /**
- * Repository keeps information about Db state.
- * Own.
- */
- CRepository* iRepository;
-
-#ifdef CONTENT_PUBLISHER_DEBUG
- CCPDebug* iDebug;
-#endif
- };
-
-#endif //C_CPSTORAGE_ENGINE_H
--- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpstoragefactory.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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 C_CPSTORAGE_FACTORY_H
-#define C_CPSTORAGE_FACTORY_H
-
-#include <e32base.h>
-
-// FORWARD DECLARATIONS
-class CCpStorage;
-
-// CLASS DECLARATION
-/**
- * Class with one static method used by CPS Server to
- * instantiate storage database.
- *
- * @since S60 v5.0
- */
-class StorageFactory
- {
-public:
- IMPORT_C static CCpStorage* NewDatabaseL();
- };
-
-#endif //C_CPSTORAGE_FACTORY_H
--- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstorageengine.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include "cpstorageengine.h"
-#include "cpliwmap.h"
-#include "ccontentmap.h"
-#include "cpdebug.h"
-#include "cpssqlconstants.h"
-#include "cpserverdef.h"
-#include <centralrepository.h>
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::CCpStorageEngine()
-//
-// ---------------------------------------------------------------------------
-//
-CCpStorageEngine::CCpStorageEngine()
- {
- }
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::ConstructL()
-//
-// ---------------------------------------------------------------------------
-//
-void CCpStorageEngine::ConstructL()
- {
-#ifdef CONTENT_PUBLISHER_DEBUG
- if(!CCPDebug::Enable())
- {
- iDebug = CCPDebug::NewL( KCPDebugFileName2 );
- }
-#endif
- CP_DEBUG( _L8("CCpStorageEngine::ConstructL()") );
-
- iRepository = CRepository::NewL( KServerUid );
- TBool createNew( EFalse );
- TInt err = iSqlDb.Open( KCPdatabase, &KMdsSqlDbaConfig );
- if( err == KSqlErrCorrupt )
- {
- DeleteCorruptedDbL();
- createNew = ETrue;
- }
- else if( err/* == KErrNotFound */)
- {
- createNew = ETrue;
- }
-
- if ( createNew )
- {
- CreateNewDbL();
- }
- }
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::NewL()
-//
-// ---------------------------------------------------------------------------
-//
-CCpStorageEngine* CCpStorageEngine::NewL()
- {
- CCpStorageEngine* self = CCpStorageEngine::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::NewLC()
-//
-// ---------------------------------------------------------------------------
-//
-CCpStorageEngine* CCpStorageEngine::NewLC()
- {
- CCpStorageEngine* self = new (ELeave) CCpStorageEngine();
- CleanupStack::PushL( self );
- self->ConstructL( );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::~CCpStorageEngine()
-//
-// ---------------------------------------------------------------------------
-//
-CCpStorageEngine::~CCpStorageEngine()
- {
- CP_DEBUG( _L8("CCpStorageEngine::~CCpStorageEngine()") );
- iSqlDb.Close( );
- delete iRepository;
-#ifdef CONTENT_PUBLISHER_DEBUG
- delete iDebug;
-#endif
- }
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::CreateTablesL
-//
-// ---------------------------------------------------------------------------
-//
-void CCpStorageEngine::CreateTablesL()
- {
- CP_DEBUG( _L8("CCpStorageEngine::CreateTablesL()") );
-
- //Main Table
- User::LeaveIfError( iSqlDb.Exec( KSQLCreateMainTable ) );
- User::LeaveIfError( iSqlDb.Exec( KSQLIndexOnMain_Publisher ) );
- User::LeaveIfError( iSqlDb.Exec( KSQLIndexOnMain_Content_type ) );
- //Publisher Table
- User::LeaveIfError( iSqlDb.Exec( KSQLCreatePublisherTable ) );
- User::LeaveIfError( iSqlDb.Exec( KSQLIndexOnPub_Content_type ) );
- User::LeaveIfError( iSqlDb.Exec( KSQLIndexOnPub_Content_type_Content_id ) );
- }
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::GetListL
-//
-// ---------------------------------------------------------------------------
-//
-void CCpStorageEngine::GetListL( const CLiwMap* aMap,
- CLiwGenericParamList& aList )
- {
- CP_DEBUG( _L8("CCpStorageEngine::GetListL()") );
- const CCPLiwMap* map = static_cast<const CCPLiwMap*>(aMap);
- RArray<TInt32> itemsToDelete;
- TUint numberOfItems = map->GetListL( iSqlDb, &aList, itemsToDelete );
- //delete outdated items
- CContentMap* removeItemMap = CContentMap::NewLC( );
- for ( TInt i = 0; i<itemsToDelete.Count( ); i++ )
- {
- removeItemMap->InsertL( KId, TLiwVariant( itemsToDelete[i] ) );
- removeItemMap->InsertL( KType, TLiwVariant( KCpData ) );
- RemoveL( removeItemMap );
- removeItemMap->Remove( KId );
- }
- CleanupStack::PopAndDestroy( removeItemMap );
- itemsToDelete.Reset( );
-
- if ( numberOfItems == 0 )
- {
- User::Leave( KErrNotFound );
- }
- }
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::AddL
-//
-// ---------------------------------------------------------------------------
-//
-TInt32 CCpStorageEngine::AddL( const CLiwMap* aMap )
- {
- CP_DEBUG( _L8("CCpStorageEngine::AddL()") );
- TInt32 id(0);
- const CCPLiwMap* map = static_cast<const CCPLiwMap*>(aMap);
- if ( iCallback )
- {
- CLiwDefaultList* listOfMaps = CLiwDefaultList::NewLC( );
- id = map->AddL( iSqlDb, listOfMaps );
- iCallback->HandleChangeL( listOfMaps );
- CleanupStack::PopAndDestroy( listOfMaps ) ;
- }
- else
- {
- id = map->AddL( iSqlDb );
- }
- return id;
- }
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::RemoveL
-//
-// ---------------------------------------------------------------------------
-//
-void CCpStorageEngine::RemoveL( const CLiwMap* aMap )
- {
- CP_DEBUG( _L8("CCpStorageEngine::RemoveL()") );
- const CCPLiwMap* map = static_cast<const CCPLiwMap*>(aMap);
- if ( iCallback )
- {
- CLiwDefaultList* listOfMaps = CLiwDefaultList::NewLC( );
- map->RemoveL( iSqlDb, listOfMaps );
- iCallback->HandleChangeL( listOfMaps );
- CleanupStack::PopAndDestroy( listOfMaps ) ;
- }
- else
- {
- map->RemoveL( iSqlDb );
- }
- }
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::SetCallback()
-//
-// ---------------------------------------------------------------------------
-//
-void CCpStorageEngine::SetCallback( MCPChangeNotifier* aCallback )
- {
- iCallback = aCallback;
- }
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::DeleteCorruptedDbL()
-//
-// ---------------------------------------------------------------------------
-//
-void CCpStorageEngine::DeleteCorruptedDbL()
- {
- User::LeaveIfError( iSqlDb.Delete( KCPdatabase ) );
- TInt value( 0 );
- if( !iRepository->Get( KCPStorageUid, value ) )
- {
- value ^= KSQLDBStateNormal;
- value |= KSQLDBStateRestored;
- }
- else
- {
- value = KSQLDBStateRestored;
- }
- iRepository->Set( KCPStorageUid, value );
- }
-
-// ---------------------------------------------------------------------------
-// CCpStorageEngine::CreateNewDbL()
-//
-// ---------------------------------------------------------------------------
-//
-void CCpStorageEngine::CreateNewDbL()
- {
- TSecureId id( KServerUid ); // Uid of CP Server - only this process has access rights
- TSecurityPolicy defaultPolicy;
- TSecurityPolicy securityPolicy(id);
- RSqlSecurityPolicy sqlSecurityPolicy;
- CleanupClosePushL( sqlSecurityPolicy );
- User::LeaveIfError( sqlSecurityPolicy.Create( defaultPolicy ) );
- User::LeaveIfError( sqlSecurityPolicy.SetDbPolicy(
- RSqlSecurityPolicy::ESchemaPolicy, securityPolicy ) );
-#ifdef CONTENT_PUBLISHER_STORAGE_MT
- iSqlDb.CreateL( KCPpathdatabase, &KMdsSqlDbaConfig );
-#else
- iSqlDb.CreateL( KCPdatabase, sqlSecurityPolicy, &KMdsSqlDbaConfig );
-#endif
- CleanupStack::PopAndDestroy( &sqlSecurityPolicy );
- CreateTablesL( );
-
- TInt value( 0 );
- if( iRepository->Get( KCPStorageUid, value ) == KErrNotFound )
- {
- value = KSQLDBStateNormal;
- iRepository->Set( KCPStorageUid, value );
- }
- }
-
--- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstoragefactory.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include "cpstoragefactory.h"
-#include "cpstorageengine.h"
-
-EXPORT_C CCpStorage* StorageFactory::NewDatabaseL()
- {
- return CCpStorageEngine::NewL();
- }
--- a/contentpublishingsrv/contentpublishingserver/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
-#include "../cpsqlitestorage/group/bld.inf"
-#include "../cpserver/group/bld.inf"
-
-
-// End of file
--- a/contentpublishingsrv/contentpublishingsrv.pro Fri Apr 16 14:45:49 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:
-#
-
-TEMPLATE = subdirs
-
-BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include \"group/bld.inf\""
-
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/bwins/cpdebugu.def Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-EXPORTS
- ?Data@CCPDebug@@CAPAUDebugData@@XZ @ 1 NONAME ; struct DebugData * CCPDebug::Data(void)
- ?Enable@CCPDebug@@SAHXZ @ 2 NONAME ; int CCPDebug::Enable(void)
- ?EnableLogging@CCPDebug@@SAXH@Z @ 3 NONAME ; void CCPDebug::EnableLogging(int)
- ?NewL@CCPDebug@@SAPAV1@ABVTDesC16@@@Z @ 4 NONAME ; class CCPDebug * CCPDebug::NewL(class TDesC16 const &)
- ?NewLC@CCPDebug@@SAPAV1@ABVTDesC16@@@Z @ 5 NONAME ; class CCPDebug * CCPDebug::NewLC(class TDesC16 const &)
- ?Printf@CCPDebug@@SAXV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 6 NONAME ; void CCPDebug::Printf(class TRefByValue<class TDesC8 const >, ...)
-
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/eabi/cpdebugu.def Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-EXPORTS
- _ZN8CCPDebug13EnableLoggingEi @ 1 NONAME
- _ZN8CCPDebug4DataEv @ 2 NONAME
- _ZN8CCPDebug4NewLERK7TDesC16 @ 3 NONAME
- _ZN8CCPDebug5NewLCERK7TDesC16 @ 4 NONAME
- _ZN8CCPDebug6EnableEv @ 5 NONAME
- _ZN8CCPDebug6PrintfE11TRefByValueIK6TDesC8Ez @ 6 NONAME
-
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for Content Publisher Debug
-*
-*/
-
-
-
-PRJ_PLATFORMS
-
-DEFAULT
-
-
-PRJ_EXPORTS
-
-
-PRJ_MMPFILES
-cpdebug.mmp
-
-
-// End of File
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group/cpdebug.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Project definition macros to log
-*
-*/
-
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET cpdebug.dll
-TARGETTYPE dll
-UID 0x1000018d 0x04066666
-
-CAPABILITY CAP_GENERAL_DLL
-VENDORID VID_DEFAULT
-
-LANG SC
-
-SOURCEPATH ../src
-
-SOURCE cpdebug.cpp
-
-USERINCLUDE ../inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY estor.lib
-LIBRARY efsrv.lib
-
-//end of file
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/inc/cpdebug.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
-* 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: Debug printing to a log file
- *
-*/
-
-#ifndef C_CP_DEBUG_H
-#define C_CP_DEBUG_H
-
-// INCLUDES
-
-#include <e32base.h>
-#ifdef CONTENT_PUBLISHER_DEBUG
-#include <f32file.h>
-
-_LIT(KCPDebugDirName, "contentpublisher" );
-_LIT(KCPDebugFileName, "c:\\contentpublisher.txt" );
-_LIT(KCPDebugFileName2, "c:\\server.txt" );
-
-/**
- * Content publisher debug
- *
- *
- * @lib cpdebug.lib
- * @since S60 v3.2
- */
-NONSHARABLE_CLASS( CCPDebug ): public CBase
- {
-public:
-
- IMPORT_C static CCPDebug* NewLC( const TDesC& aFile );
-
- IMPORT_C static CCPDebug* NewL( const TDesC& aFile );
-
- virtual ~CCPDebug();
-
- /**
- * Determines whether CCPDebug is exist .
- */
- IMPORT_C static TBool Enable();
-
- /**
- * Enables or disables Printf message logging to a file.
- * @param aEnable Set to true to enable logging, false to disable.
- */
- IMPORT_C static void EnableLogging(TBool aEnable);
-
- /**
- * Print debug text to the file (c:\\contentpublisher.txt).
- *
- */
- IMPORT_C static void Printf(TRefByValue<const TDesC8> aFormat, ...);
-
-private:
-
- CCPDebug();
-
- void ConstructL( const TDesC& aFile );
-
- /**
- * Returns a pointer to the thread-local data struct.
- */
- IMPORT_C static struct DebugData* Data();
-
-private: // data
-
- /**
- * Thread local storage for this DLL, as we cannot declare static
- * global variables in Symbian.
- */
- struct DebugData* iData;
-
- };
-
-#define CP_DEBUG(s) CCPDebug::Printf(s)
-
-/**
- * Thread local storage space. Writable static data is not supported in
- * Symbian, so static data is stored in this struct.
- */
-struct DebugData
- {
- RFile iLogFile;
- RFs iFs;
- TBool iLogEnabled;
- TTime iFirstUpdateTime;
- RBuf iFileName;
- };
-
-#else
-
-#define CP_DEBUG(s)
-
-#endif
-
-#endif // C_CP_DEBUG_H
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/src/cpdebug.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-/*
-* Copyright (c) Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 "cpdebug.h"
-
-const TUint KMemDataSize( 100 );
-const TUint KBufMaxSize( 512 );
-const TUint KThousand( 1000 );
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPDebug::ConstructL( const TDesC& aFile )
- {
- iData = new (ELeave) DebugData();
- iData->iLogEnabled = EFalse;
- iData->iFirstUpdateTime.UniversalTime( );
- iData->iFileName.Create( aFile.Length( ) );
- iData->iFileName = aFile;
- Dll::SetTls( iData );
- User::LeaveIfError( iData->iFs.Connect( ) );
- EnableLogging( ETrue );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CCPDebug* CCPDebug::NewL( const TDesC& aFile )
- {
- CCPDebug* self = NewLC( aFile );
- CleanupStack::Pop(self);
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CCPDebug* CCPDebug::NewLC( const TDesC& aFile )
- {
- CCPDebug* self = new (ELeave) CCPDebug();
- CleanupStack::PushL(self);
- self->ConstructL( aFile );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPDebug::CCPDebug()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPDebug::~CCPDebug()
- {
- if ( iData )
- {
- iData->iFileName.Close( );
- iData->iLogFile.Close( );
- iData->iFs.Close( );
- }
- Dll::FreeTls( );
- delete iData;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C TBool CCPDebug::Enable()
- {
- DebugData* data = Data();
- if(!data)
- {
- return false;
- }
- else
- {
- return true;
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C void CCPDebug::EnableLogging(TBool aEnable)
- {
- DebugData* data = Data();
- if(aEnable && !data->iLogEnabled)
- {
- if( data->iLogFile.Replace(data->iFs, data->iFileName, EFileWrite) == KErrNone )
- {
- data->iLogEnabled = ETrue;
- Printf(_L8("CCPDebug::EnableLogging()"));
- }
- }
- else if(!aEnable && data->iLogEnabled)
- {
- data->iLogFile.Close();
- data->iLogEnabled = EFalse;
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C void CCPDebug::Printf(TRefByValue<const TDesC8> aFormat, ...)
- {
- DebugData* data = Data();
- if(!data || !data->iLogEnabled)
- {
- return;
- }
- TTime now;
- now.UniversalTime();
- TInt32 elapsed = (TInt32)(now.MicroSecondsFrom(data->iFirstUpdateTime).Int64() / KThousand);
-
- TBuf8<KMemDataSize> memData;
- memData.Format(_L8("% 2d,%03d "), elapsed / KThousand, elapsed % KThousand);
-
- TBuf8<KBufMaxSize> buf;
- VA_LIST list;
- VA_START(list, aFormat);
- buf.FormatList(aFormat, list);
- VA_END(list);
- buf.Insert(0, memData);
- buf.Append(_L8("\n"));
-
- data->iLogFile.Write(buf);
- data->iLogFile.Flush();
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C DebugData* CCPDebug::Data()
- {
- return static_cast<DebugData*>(Dll::Tls());
- }
-
-// End of File
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/bwins/cputilsu.def Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-EXPORTS
- ?GetProperty@CCPLiwMap@@QBEHABVTDesC8@@AAJ@Z @ 1 NONAME ; int CCPLiwMap::GetProperty(class TDesC8 const &, long &) const
- ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf16@@@Z @ 2 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf16 &) const
- ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf8@@@Z @ 3 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf8 &) const
- ?IsValidForActionL@CCPLiwMap@@QBEXXZ @ 4 NONAME ; void CCPLiwMap::IsValidForActionL(void) const
- ?IsValidForNotificationL@CCPLiwMap@@QBEXXZ @ 5 NONAME ; void CCPLiwMap::IsValidForNotificationL(void) const
- ?NewL@CCPLiwMap@@SAPAV1@AAVRDesReadStream@@@Z @ 6 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class RDesReadStream &)
- ?NewL@CCPLiwMap@@SAPAV1@ABVCLiwGenericParamList@@@Z @ 7 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class CLiwGenericParamList const &)
- ?NewL@CContentMap@@SAPAV1@XZ @ 8 NONAME ; class CContentMap * CContentMap::NewL(void)
- ?NewL@CPublisherRegistryMap@@SAPAV1@XZ @ 9 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewL(void)
- ?NewLC@CContentMap@@SAPAV1@XZ @ 10 NONAME ; class CContentMap * CContentMap::NewLC(void)
- ?NewLC@CPublisherRegistryMap@@SAPAV1@XZ @ 11 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewLC(void)
- ?PackForServerLC@CCPLiwMap@@QBEPAVHBufC8@@XZ @ 12 NONAME ; class HBufC8 * CCPLiwMap::PackForServerLC(void) const
- ?Reset@CCPLiwMap@@QBEXXZ @ 13 NONAME ; void CCPLiwMap::Reset(void) const
- ?SetSecurityL@CCPLiwMap@@QAEXABVRMessage2@@@Z @ 14 NONAME ; void CCPLiwMap::SetSecurityL(class RMessage2 const &)
-
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/eabi/cputilsu.def Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-EXPORTS
- _ZN11CContentMap4NewLEv @ 1 NONAME
- _ZN11CContentMap5NewLCEv @ 2 NONAME
- _ZN21CPublisherRegistryMap4NewLEv @ 3 NONAME
- _ZN21CPublisherRegistryMap5NewLCEv @ 4 NONAME
- _ZN9CCPLiwMap12SetSecurityLERK9RMessage2 @ 5 NONAME
- _ZN9CCPLiwMap4NewLER14RDesReadStream @ 6 NONAME
- _ZN9CCPLiwMap4NewLERK20CLiwGenericParamList @ 7 NONAME
- _ZNK9CCPLiwMap11GetPropertyERK6TDesC8Rl @ 8 NONAME
- _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R5RBuf8 @ 9 NONAME
- _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R6RBuf16 @ 10 NONAME
- _ZNK9CCPLiwMap15PackForServerLCEv @ 11 NONAME
- _ZNK9CCPLiwMap17IsValidForActionLEv @ 12 NONAME
- _ZNK9CCPLiwMap23IsValidForNotificationLEv @ 13 NONAME
- _ZNK9CCPLiwMap5ResetEv @ 14 NONAME
- _ZTI9CCPLiwMap @ 15 NONAME ; #<TI>#
- _ZTV9CCPLiwMap @ 16 NONAME ; #<VT>#
-
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for Content Publisher Map
-*
-*/
-
-// Macro definitions
-#include <platform_paths.hrh>
-
-
-PRJ_PLATFORMS
-
-DEFAULT
-
-PRJ_EXPORTS
-../inc/ccontentmap.h |../../../../inc/ccontentmap.h
-../inc/cpliwmap.h |../../../../inc/cpliwmap.h
-../inc/cpublisherregistrymap.h |../../../../inc/cpublisherregistrymap.h
-
-PRJ_MMPFILES
-cputils.mmp
-
-
-// End of File
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/group/cputils.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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
-*
-*/
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET cputils.dll
-TARGETTYPE dll
-
-UID 0x1000008D 0x20016B7F
-
-CAPABILITY CAP_GENERAL_DLL
-VENDORID VID_DEFAULT
-
-LANG SC
-
-SOURCEPATH ../src
-SOURCE cpliwmap.cpp
-SOURCE ccontentmap.cpp
-SOURCE cpublisherregistrymap.cpp
-SOURCE cpsecuritypolicy.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../contentpublishingdebug/inc
-USERINCLUDE ../../../contentpublishingserver/cpserver/inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY estor.lib
-LIBRARY efsrv.lib
-LIBRARY sqldb.lib
-LIBRARY bafl.lib
-LIBRARY liwservicehandler.lib inetprotutil.lib
-
-#ifdef CONTENT_PUBLISHER_DEBUG
-LIBRARY cpdebug.lib
-#endif
-
-//end of file
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/ccontentmap.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +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: CContentMap - class used in Content Publisher
- *
-*/
-
-#ifndef C_CONTENTMAP_H
-#define C_CONTENTMAP_H
-
-#include "cpliwmap.h"
-
-// CLASS DECLARATION
-/**
- * Map which contains ids and serialized data stored by
- * Content Publisher
- *
- * @lib cputils.dll
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CContentMap ): public CCPLiwMap
- {
-public:
-
- /**
- * Two-phased constructor.
- */
- IMPORT_C static CContentMap* NewL( );
-
- /**
- * Two-phased constructor.
- */
- IMPORT_C static CContentMap* NewLC( );
-
- /**
- * Destructor.
- */
- virtual ~CContentMap();
-
-
-private:
-
- /**
- * Adds to database current content
- *
- * @param aSqlDb handle to database
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- *
- * @return id of added entry
- */
- TInt32 AddL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList = NULL ) const;
-
- /**
- * Fetches entries from database
- *
- * @param aSqlDb handle to database
- * @param aList target list for enntries
- * @param aItemsToDelete ids of entries for removal -
- * they were found to be expired
- *
- * @return number of fetched entries
- */
- TUint GetListL( RSqlDatabase aSqlDb,
- CLiwGenericParamList* aList,
- RArray<TInt32>& aItemsToDelete ) const;
-
- /**
- * Removes entries from database
- *
- * @param aSqlDb handle to database
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- */
- void RemoveL( RSqlDatabase aSqlDb ,
- CLiwDefaultList* aNotificationList = 0 ) const;
-
- /**
- * Saves results from query to SQLite Server
- *
- * @param aStmt handle to SQL statement
- * @param aList target list for enntries
- * @param aItemsToDelete ids of entries for removal -
- * they were found to be expired
- */
- void SaveQueryResultsL( RSqlStatement& aStmt ,
- CLiwGenericParamList& aList,
- RArray<TInt32>& aItemsToDelete ) const;
-
- /**
- * Prepares SQL query for Add operation
- *
- * @param aSqlDb handle to database
- * @param aStmt handle to SQL statement
- * @param aQuery SQL query
- *
- */
- void PrepareStmtforAddL(RSqlDatabase aSqlDb,
- RSqlStatement& aStmt ,
- const TDesC& aQuery ) const;
-
- /**
- * Prepares SQL query for Update operation
- *
- * @param aSqlDb handle to database
- * @param aStmt handle to SQL statement
- * @param aId id of entry to update
- *
- */
- void PrepareStmtforUpdateL( RSqlDatabase aSqlDb,
- RSqlStatement& aStmt,
- TInt32 aId ) const;
-
- /**
- * Updates entry in database
- *
- * @param aSqlDb handle to database
- * @param aId id entry to update
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- */
- void UpdateL( RSqlDatabase aSqlDb, TInt32 aId,
- CLiwDefaultList* aNotificationList ) const;
-
- /**
- * Performs actuall add operation
- *
- * @param aSqlDb handle to database
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- *
- * @return id of added entry
- */
- TInt32 AddToDbL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList ) const;
-
- /**
- * Appends sorting criteria as strings to SQL query according to aSort
- *
- * @param aQuery SQL query
- * @param aSort sort filter as TInt
- */
- void AppendSortL( RBuf& aQuery, const TCPSortOrder& aSort ) const;
-
- /**
- * Checks expiration time
- * @param aExpirationTime time to checking with current time
- * @return true if aExpirationTime is correct
- */
- TBool IsOutdated( const TTime aExpirationTime ) const;
-
- /**
- * Check if data map is set
- *
- * @return ETrue if ContentType was set, EFalse if not
- */
- void IsDataMapL() const;
-
- /**
- * Gets expiration time from own data
- * @param aResult expiration date
- * @return ETrue if expiration date is find, EFalse if not
- */
- TBool GetExpirationDateL( TTime& aResult ) const;
-
- /**
- * Check if IDs are valid for Delete operation
- *
- */
- void IsValidForDeleteL() const;
-
- /**
- * Check if IDs are valid for GetList operation
- */
- void IsValidForGetListL() const ;
-
- /**
- *
- * @return ETrue if supported, EFalse if not
- */
- TBool ActivateActionSupport( ) const;
-
- /**
- *
- * @return ETrue if activate flag is set, EFalse if not
- */
- TBool GetActivateInfo( ) const;
-
-
-private:
-
- /**
- * C++ default constructor.
- */
- CContentMap();
-
- /**
- * Perform the second phase construction of a CContentMap object.
- */
- void ConstructL();
-
- };
-
-#endif // C_CONTENTMAP_H
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpliwmap.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,620 +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: CCPLiwMap - class used in Content Publisher
- *
-*/
-
-#ifndef C_CPLIWIDSMAP_H
-#define C_CPLIWIDSMAP_H
-
-#include <liwvariant.h>
-#include <sqldb.h>
-#include "cpglobals.h"
-
-class RDesReadStream;
-class CCPSecurityPolicy;
-
-// CLASS DECLARATION
-/**
- * Base Map class for Publisher Registry and Content
- *
- * @lib cputils.dll
- * @since S60 v5.0
- */
-class CCPLiwMap : public CLiwMap
- {
-
-protected:
-
- /**
- * Enum defining the properties of filter.
- */
- enum TCPProperties
- {
- EPublisher = 1,
- EContentType = 2,
- EContentId = 4,
- EFlag = 8,
- };
-
- /**
- * Enum defining the sort ordering.
- */
- enum TCPSortOrder
- {
- ECPRecent = 1, // 0001
- ECPPublisher = 2, // 0010
- ECPContent = 4, // 0100
- ECPContentId = 8 // 1000
- };
-
-public:
-
- friend class CCpStorageEngine;
-
- /**
- * Two-phased constructor.
- */
- IMPORT_C static CCPLiwMap* NewL( RDesReadStream& aStream );
-
- /**
- * Two-phased constructor.
- */
- IMPORT_C static CCPLiwMap* NewL( const CLiwGenericParamList& aList );
-
- /**
- * Used by client to serialize this object
- *
- * @return object serialized to binary
- */
- IMPORT_C HBufC8* PackForServerLC() const;
-
- /**
- * Reset map
- */
- IMPORT_C void Reset( ) const;
-
- /**
- * Leaves when Add data operation is not possible due
- * to missing of some parameter
- */
- virtual void IsValidForAddL( ) const;
-
- /**
- * Leaves when Execute Action operation is not possible due
- * to missing of some parameter
- */
- IMPORT_C void IsValidForActionL( ) const;
-
- /**
- * Leaves when RequestNotification operation is not possible due
- * to missing of some parameter
- */
- IMPORT_C void IsValidForNotificationL( ) const;
-
- /**
- * Fetches value for property(key) from internal map
- *
- * @param aProperty name of the property ( key )
- * @param aResult target descriptor for fetching operation
- * @return ETrue is property found or EFalse if not
- */
- IMPORT_C TBool GetPropertyL( const TDesC8& aProperty,
- RBuf& aResult ) const;
-
- /**
- * Fetches value for property(key) from internal map
- *
- * @param aProperty name of the property ( key )
- * @param aResult target binary for fetching operation
- * @return ETrue is property found or EFalse if not
- */
- IMPORT_C TBool GetPropertyL( const TDesC8& aProperty,
- RBuf8& aResult ) const;
-
- /**
- * Fetches value for property(key) from internal map
- *
- * @param aProperty name of the property ( key )
- * @param aResult target integer for fetching operation
- * @return ETrue is property found or EFalse if not
- */
- IMPORT_C TBool GetProperty( const TDesC8& aProperty,
- TInt32& aResult ) const;
-
-
- /**
- * Setter for security policy
- *
- * @param aPolicy security policy
- */
- IMPORT_C void SetSecurityL( const RMessage2& aMessage );
-
- /**
- * Destructor.
- */
- virtual ~CCPLiwMap();
-
- /**
- * Check if IDs are valid for Delete operation
- */
- virtual void IsValidForDeleteL() const =0;
-
- /**
- * Check if IDs are valid for GetList operation
- */
- virtual void IsValidForGetListL() const =0;
-
- /**
- *
- * @return ETrue if supported, EFalse if not
- */
- virtual TBool ActivateActionSupport( ) const = 0;
-
- /**
- *
- * @return ETrue if activate flag is set, EFalse if not
- */
- virtual TBool GetActivateInfo( ) const = 0;
-
-
-public:
-
- // from base class CLiwMap
- /**
- * Inserts a key-value pair element to the map collection. If
- * the specified key already exists, it will be removed from
- * the collection and the new key-value pair will be added to the
- * map.
- *
- * @param aKey the key to be stored
- * @param aValue the value associated with the key to be stored
- */
- void InsertL( const TDesC8& aKey, const TLiwVariant& aValue );
-
- /**
- * Finds a value stored in the map collection based on the key.
- *
- * @param aKey the key to be searched
- * @param aFndValue the value associated with the found key
- * @return false if there is no key stored; true otherwise
- */
- TBool FindL( const TDesC8& aKey, TLiwVariant& aValue ) const;
-
- /**
- * Returns the number of key-value pair stored in the map collection.
- *
- * @return the number of key-value pair stored in the map collection
- */
- TInt Count() const;
-
- /**
- * Returns the key stored at a specified index.
- *
- * @param aIndex the index of the key to be found
- * @param aFndKey the key found at the passed index
- *
- * @return true if a key-value entry is found at the passed index;
- * false otherwise
- */
- TBool AtL( TInt aIndex, TDes8& aFndKey ) const;
-
- /**
- * Removes a key from the map collection.
- *
- * @param aKey the key to be removed from the map
- */
- void Remove( const TDesC8& aKey );
-
- /**
- * Returns the size of the collection. The size is
- * calculated based on the total numer of key-value elements
- * and the size of each pair in the collection
- *
- * @return the size of the collection
- */
- TInt Size() const;
-
- /**
- * The container managed data values can be serialized to an output
- * stream.
- *
- * @param aOutputStream the output stream to which the data will be streamed
- */
- void ExternalizeL( RWriteStream& aOutputStream ) const;
-
-protected:
-
- /**
- * Adds to database current content
- *
- * @param aSqlDb handle to database
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- *
- * @return id of added entry
- */
- virtual TInt32 AddL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList = 0 ) const= 0;
-
- /**
- * Fetches entries from database
- *
- * @param aSqlDb handle to database
- * @param aList target list for enntries
- * @param aItemsToDelete ids of entries for removal -
- * they were found to be expired
- *
- * @return number of fetched entries
- */
- virtual TUint GetListL( RSqlDatabase aSqlDb, CLiwGenericParamList* aList,
- RArray<TInt32>& aItemsToDelete ) const = 0;
-
- /**
- * Removes entries from database
- *
- * @param aSqlDb handle to database
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- */
- virtual void RemoveL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList = 0 ) const = 0;
-
- /**
- * Saves results from query to SQLite Server
- *
- * @param aStmt handle to SQL statement
- * @param aList target list for enntries
- * @param aItemsToDelete ids of entries for removal -
- * they were found to be expired
- */
- virtual void SaveQueryResultsL( RSqlStatement& aStmt,
- CLiwGenericParamList& aList, RArray<TInt32>& aItemsToDelete ) const = 0;
-
- /**
- * Updates entry in database
- *
- * @param aSqlDb handle to database
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- */
- virtual void UpdateL( RSqlDatabase aSqlDb, TInt32 aId,
- CLiwDefaultList* aNotificationList = 0 ) const = 0;
-
- /**
- * Performs actuall add operation
- *
- * @param aSqlDb handle to database
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- *
- * @return id of added entry
- */
- virtual TInt32 AddToDbL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList = 0 ) const = 0;
-
- /**
- * Checks if operation value is proper
- *
- * @param aValue contains operation value
- */
- void IsProperOperationL( const TLiwVariant& aValue ) const;
-
-
- /**
- * Appends GetList filter as strings to SQL query according to aFilter
- *
- * @param aQuery SQL query
- * @param aFilter as enum
- *
- */
- void AppendGetListFilterL( RBuf& aQuery, TUint& aFilter ) const;
-
- /**
- * Appends Remove filter as strings to SQL query according to aFilter
- *
- * @param aQuery SQL query
- * @param aFilter as enum
- *
- */
- void AppendRemoveFilterL( RBuf& aQuery, TUint& aFilter ) const;
-
-
- /**
- * Appends filter as strings to SQL query according to aFilter
- *
- * @param aQuery SQL query
- * @param aFilter as enum
- *
- */
- virtual void AppendFilterL( RBuf& aQuery, TUint& aFilter ) const;
-
- /**
- * Prepares SQL query for Add operation
- *
- * @param aSqlDb handle to database
- * @param aStmt handle to SQL statement
- * @param aQuery SQL query
- *
- */
- virtual void PrepareStmtforAddL( RSqlDatabase aSqlDb,
- RSqlStatement& aStmt, const TDesC& aQuery ) const;
- /**
- * Appends sorting criteria as strings to SQL query according to aSort
- *
- * @param aQuery SQL query
- * @param aSort sort filter as TInt
- *
- */
- virtual void AppendSortL( RBuf& aQuery,
- const TCPSortOrder& aSort ) const = 0;
-
- /**
- * Fills change info map with proper values
- *aStmt
- * @param aStmt handle to SQL statement
- * @param aChangeInfoMap map that will be filed
- *
- */
- virtual void FillChangeInfoMapL( RSqlStatement& aStmt,
- CLiwDefaultMap* aMap ) const;
-
-protected:
-
- /**
- * Sets all parameters according to provided list
- * @param aItemMap map with parameters
- */
- void SetL( const CLiwGenericParamList& aInParamList );
-
- /**
- * Check Get properties
- *
- * @return logical sum of TCPProperties of the object
- */
- TUint GetFilterL() const;
-
- /**
- * Check and return sort order
- *
- * @return Sort Criteria
- */
- TCPSortOrder GetSortL() const;
-
- /**
- * Check if Publisher name is set
- *
- * @return ETrue if Publisher name was set, EFalse if not
- */
- TBool IsPublisherNameL() const;
-
- /**
- * Check if ContentType is set
- *
- * @return ETrue if ContentType was set, EFalse if not
- */
- TBool IsContentTypeL() const;
-
- /**
- * Check if ContentId is set
- *
- * @return ETrue if ContentId was set, EFalse if not
- */
- TBool IsContentIdL() const;
-
- /**
- * Check if ActionTrigger is set
- *
- * @return ETrue if ActionTrigger was set, EFalse if not
- */
- TBool IsTriggerL( ) const;
-
- /**
- * Check if Flag is present
- *
- * @return ETrue if ContentId was set, EFalse if not
- */
- TBool IsFlag( ) const;
-
- /**
- * Checks if Id property is present in internal map
- *
- */
- TBool IsId() const;
-
- /**
- * Checks if property(key) is present in internal map
- *
- */
- TBool PropertyExists( const TDesC8& aProperty ) const;
-
-
- /**
- * Fetches entries from database
- *
- * @param aSqlDb handle to database
- * @param aQuery aQuery SQL query
- * @param aList target list for enntries
- * @param aItemsToDelete ids of entries for removal -
- * they were found to be expired
- *
- * @return number of fetched entries
- */
- TUint GetListL( RSqlDatabase aSqlDb, const TDesC& aQuery,
- CLiwGenericParamList* aList, RArray<TInt32>& aItemsToDelete ) const;
-
- /**
- * Removes entries from database
- *
- * @param aSqlDb handle to database
- * @param aQuery SQL query
- *
- */
- void RemoveL( RSqlDatabase aSqlDb, const TDesC& aQuery ) const;
-
- /**
- * Fetches Ids (Publisher, ContentType, ContentId) from database
- *
- * @param aId id entry in database
- * @param aQuery SQL query
- * @param aMap map to insert Ids
- * @param aSqlDb handle to database
- *
- */
- void FetchIdsL( TInt32 aId, const TDesC& aQuery, CLiwDefaultMap* aMap,
- RSqlDatabase aSqlDb ) const;
-
- /**
- * Fetches Id from database
- *
- * @param aSqlDb handle to database
- * @param aQuery SQL query
- * @param aId id entry from database
- *
- */
- void FetchIdL( RSqlDatabase aSqlDb,
- const TDesC& aQuery, TInt32& aId ) const;
-
- /**
- * Gets Ids (Id, Publisher, ContentType, ContentId)
- * of removed entries from database
- *
- * @param aSqlDb handle to database
- * @param aQuery SQL query
- * @param aList List with ids
- *
- */
- void GetIdsOfRemovedEntriesL( RSqlDatabase aSqlDb, const TDesC& aQuery,
- CLiwDefaultList* aList ) const;
-
- /**
- * Saves Ids (Id, Publisher, ContentType, ContentId) from database
- *
- * @param aSqlDb handle to database
- * @param aList List with ids
- *
- */
- void SaveQueryResultsIdsL( RSqlStatement& aStmt,
- CLiwDefaultList* aList ) const;
-
- /**
- * Contructs SQL query to select entry
- * @param aQuery SQL query
- *
- */
- void ConstructSelectIdL( RBuf& aQuery ) const;
-
- /**
- * Contructs SQL query to select entries for GetList
- * @param aQuery SQL query
- *
- */
- void ConstructGetListSelectL( RBuf& aQuery, TBool aGet = ETrue ) const;
-
- /**
- * Contructs SQL query to select entries for Remove
- * @param aQuery SQL query
- *
- */
- void ConstructRemoveSelectL( RBuf& aQuery, TBool aGet = ETrue ) const;
-
- /**
- * Binds value to query
- * @param aQuery SQL query
- * @param aSqlDb handle to database
- *
- */
- void BindValueL( const RBuf& aQuery, RSqlStatement& aStmt ) const;
-
- /**
- * Checks if GetList for all items should be done
- * @param aFilter flag describing which ids are set
- * @return ETrue if getlist for all items shold be done, EFalse if not
- */
- TBool IsGetListAllL( TUint aFilter ) const;
-
- /**
- * Removes attributes with "All" value from map
- * @param aFilter filter bit will be reset if any attribute == "all"
- */
- void RemoveAllAttributeL( TUint& aFilter ) const;
-
- /**
- * Leaves if publisher, content type od content_id is not descriptor type.
- */
- void CheckIdentifiersL() const;
-
- /**
- * Leaves if aParameterIndex is negative-error value
- * or in case of binding error.
- */
- void BindTextL(RSqlStatement& aStmt, TInt aParameterIndex,
- const TDesC& aParameterText) const;
-
- /**
- * Leaves if aParameterIndex is negative-error value
- * or in case of binding error.
- */
- void BindBinaryL(RSqlStatement& aStmt, TInt aParameterIndex,
- const TDesC8& aParameterText) const;
-
- /**
- * Leaves if aParameterIndex is negative-error value
- * or in case of binding error.
- */
- void BindInt64L(RSqlStatement& aStmt, TInt aParameterIndex,
- TInt64 aParameterValue) const;
-
- /**
- * Leaves if aParameterIndex is negative-error value
- * or in case of binding error.
- */
- void BindIntL(RSqlStatement& aStmt, TInt aParameterIndex,
- TInt aParameterValue) const;
-
- /**
- * Leaves if column index return value is negative.
- * @return result of RSqlStatement::ColumnIndex
- */
- TInt ColumnIndexL( RSqlStatement& aStmt, const TDesC& aColumnName ) const;
-protected:
-
- /**
- * C++ default constructor.
- */
- CCPLiwMap();
-
- /**
- * Perform the second phase construction of a CCPLiwMap object.
- */
- void ConstructL();
-
-protected:
- // data
-
- /*
- * The underlying generic parameter list
- * Own.
- */
- CLiwGenericParamList* iMap;
-
- /*
- * Class used for security
- *Own.
- */
- const CCPSecurityPolicy* iPolicy;
-
- };
-
-#endif // C_CPLIWIDSMAP_H
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpsecuritypolicy.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +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: Class used by session to handle access control list
- * Version : %version: ou1s60ui#4.1.1 % << Don't touch! Updated by Synergy at check-out.
- *
-*/
-
-
-#ifndef C_CPSECURITYPOLICY_H
-#define C_CPSECURITYPOLICY_H
-
-#include <e32base.h>
-
-class CLiwDefaultMap;
-
-/**
- * Internal class for Security related activities
- *
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CCPSecurityPolicy ): public CBase
- {
-public:
-
- enum TACLPolicy
- {
- ERead,
- EWrite,
- EDelete
- };
-
- /**
- * Two-phased constructor.
- */
- static CCPSecurityPolicy* NewL( const RMessage2& aMessage );
-
- /**
- * Two-phased constructor.
- */
- static CCPSecurityPolicy* NewLC( const RMessage2& aMessage );
-
- /**
- * Destructor.
- */
- virtual ~CCPSecurityPolicy();
-
- /**
- * Sets default ACL map and serializes it
- *
- * @param aPolicy target for ACL binary
- */
- void GetDefaultSecurityL( RBuf8& aResult ) const ;
-
- /**
- * Checks if access for client (iMessage)
- * should be granted or not
- *
- * @param aBinary serialized ACL map
- * @param aPolicy secururity policy to check
- * @return ETrue if security check is ok,
- * EFalse if not
- */
- TBool CheckSecurityL( TPtrC8& aBinary , TACLPolicy aPolicy ) const;
-
- /**
- * Performs actuall security check
- * should be granted or not
- *
- * @param aMap ACL map
- * @return ETrue if security check is ok,
- * EFalse if not
- */
- TInt DoCheckSecurityL( const CLiwMap* aMap ) const;
-
- /**
- * Performs security check based on client UIDs
- *
- * @param aList list of uids which have access
- *
- * @return access granted or not
- */
- TBool CheckUids( const TDesC& aList ) const ;
-
- /**
- * Performs security check based on client Capabilities
- *
- * @param aList list of capabilities which client must have
- *
- * @return access granted or not
- */
- TBool CheckCapabilities( const TDesC& aList ) const;
-
- /**
- * Exctracts from list next token( UID or Capability )
- *
- * @param aList list as desciptor
- * @param aResult single token extracted from list
- * @param aPos position of the reuired token
- */
- void ExctractNextToken( const TDesC& aList,
- TPtrC& aResult , TInt& aPos ) const;
- /**
- * Converts capability given as descriptor to enum
- *
- * @param aCapability descriptor to convert
- *
- * @return Capablity as enum
- */
- TCapability GetCapability( const TDesC& aCapability ) const;
-
-private:
-
- /**
- * C++ default constructor.
- */
- CCPSecurityPolicy( const RMessage2& aMessage );
-
- /**
- * By default Symbian 2nd phase constructor is private.
- */
- void ConstructL();
-
-private:
- // data
-
- /*
- * Not own.
- * Message from client
- */
- const RMessage2& iMessage;
-
- };
-
-#endif // C_CPSECURITYPOLICY_H
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpssqlcommands.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +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:
- * Version : %version: ou1s60ui#7.1.1 % << Don't touch! Updated by Synergy at check-out.
- *
-*/
-
-
-#ifndef C_CPSSQL_H
-#define C_CPSSQL_H
-
-//Insert Data
-//Update Data
-
-
-_LIT( KSQLUpdate, "UPDATE CP_MAIN_TABLE SET " );
-_LIT( KSQLUpdateData, "Data = :Data " );
-_LIT( KSQLUpdateAction, "Action = :Action " );
-_LIT( KSQLUpdateExpirationDate, "Expiration_date = :Expiration_date " );
-_LIT( KSQLUpdateFlag, "Flag = :Flag " );
-_LIT( KSQLUpdateWhere, "WHERE Id = :Id " );
-_LIT( KComma, ", " );
-
-_LIT( KSQLUpdateRegistry, "UPDATE CP_PUBLISHER_TABLE SET " );
-
-_LIT( KSQLInsert,
- "INSERT INTO CP_MAIN_TABLE (Publisher,Content_type,Content_id,Expiration_date,Access_List,Data,Action) VALUES ( \
- :Publisher,\
- :Content_type,\
- :Content_id,\
- :Expiration_date,\
- :Access_List,\
- :Data,\
- :Action )" );
-
-_LIT( KSQLInsertToRegistry,
- "INSERT INTO CP_PUBLISHER_TABLE (Publisher,Content_type,Content_id,Flag,Access_List,Data,Action) VALUES ( \
- :Publisher,\
- :Content_type,\
- :Content_id,\
- :Flag,\
- :Access_List,\
- :Data,\
- :Action )" );
-
-//Delete Data
-_LIT( KSQLDelete, "DELETE FROM CP_MAIN_TABLE" );
-_LIT( KSQLDeleteFromRegistry, "DELETE FROM CP_PUBLISHER_TABLE" );
-
-//Get Data
-_LIT( KSQLGetLastInsertId, "SELECT last_insert_rowid() ");
-
-_LIT( KSQLGetList,
- "SELECT Id,Publisher,Content_type,Content_id,Expiration_date,Access_List,Data,Action FROM CP_MAIN_TABLE");
-_LIT( KSQLGetIds,
- "SELECT Id,Publisher,Content_type,Content_id,Access_List FROM CP_MAIN_TABLE");
-_LIT( KSQLGetIdsRegistry,
- "SELECT Id,Publisher,Content_type,Content_id,Access_List,Flag FROM CP_PUBLISHER_TABLE" );
-_LIT( KSQLGetAction,
- "SELECT Action FROM CP_MAIN_TABLE WHERE ");
-
-_LIT( KSQLGetListFromRegistry,
- "SELECT Id,Publisher,Content_type,Content_id,Access_List,Flag,Data,Action FROM CP_PUBLISHER_TABLE");
-_LIT( KSQLGetIdsFromRegistry,
- "SELECT Id,Publisher,Content_type,Content_id FROM CP_PUBLISHER_TABLE");
-_LIT( KSQLGetActionFromRegistry,
- "SELECT Id,Action FROM CP_PUBLISHER_TABLE WHERE ");
-
-_LIT( KSQLGetFlag ,"Flag <> 0");
-_LIT( KSQLGetPublisher ,"Publisher = :Publisher");
-_LIT( KSQLGetContentType ,"Content_type = :Content_type");
-_LIT( KSQLGetContentId ,"Content_id = :Content_id");
-_LIT( KSQLGetId ,"Id = :Id");
-_LIT( KAnd," AND ");
-
-_LIT( KSQLFetchId,
- "SELECT Id FROM CP_MAIN_TABLE WHERE Publisher =:Publisher AND Content_type=:Content_type AND Content_id =:Content_id");
-_LIT( KSQLFetchIds,
- "SELECT Publisher,Content_type,Content_id,Access_List FROM CP_MAIN_TABLE WHERE Id =:Id");
-
-_LIT( KSQLFetchIdFromRegistry,
- "SELECT Id FROM CP_PUBLISHER_TABLE WHERE Publisher =:Publisher AND Content_type=:Content_type AND Content_id =:Content_id" );
-_LIT( KSQLFetchIdsFromRegistry,
- "SELECT Publisher,Content_type,Content_id,Access_List FROM CP_PUBLISHER_TABLE WHERE Id =:Id" );
-
-_LIT( KSQLPublisher, ":Publisher" );
-_LIT( KSQLContent_type, ":Content_type" );
-_LIT( KSQLContent_id, ":Content_id" );
-_LIT( KSQLExpiration_date, ":Expiration_date" );
-_LIT( KSQLFlag, ":Flag" );
-_LIT( KSQLData, ":Data" );
-_LIT( KSQLAction, ":Action" );
-_LIT( KSQLAccessList, ":Access_List" );
-_LIT( KSQLId, ":Id" );
-
-_LIT( KSQLOrderRecent, " ORDER BY Id DESC" );
-_LIT( KSQLOrderPublisher, " ORDER BY Publisher" );
-_LIT( KSQLOrderContent, " ORDER BY Content_type" );
-_LIT( KSQLOrderContentId, " ORDER BY Content_id" );
-
-_LIT( KColumnId, "Id" );
-_LIT( KColumnPublisher, "Publisher" );
-_LIT( KColumnContent_type, "Content_type" );
-_LIT( KColumnContent_id, "Content_id" );
-_LIT( KColumnAccessList, "Access_List" );
-_LIT( KColumnExpiration_date, "Expiration_date" );
-_LIT( KColumnFlag, "Flag" );
-_LIT( KColumnData, "Data" );
-_LIT( KColumnAction, "Action" );
-
-_LIT( KWhere, " WHERE ");
-
-_LIT8( KList, "List" );
-
-#endif //C_CPSSQL_H
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpublisherregistrymap.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,204 +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: CPublisherRegistryMap - class used in Content Publisher
- *
-*/
-
-#ifndef C_CPUBLISHERREGISTRYMAP_H
-#define C_CPUBLISHERREGISTRYMAP_H
-
-#include "cpliwmap.h"
-
-// CLASS DECLARATION
-/**
- * Map which contains Publisher Registry information
- *
- * @lib cputils.dll
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CPublisherRegistryMap ): public CCPLiwMap
- {
-public:
-
- /**
- * Two-phased constructor.
- */
- IMPORT_C static CPublisherRegistryMap* NewL( );
-
- /**
- * Two-phased constructor.
- */
- IMPORT_C static CPublisherRegistryMap* NewLC( );
-
- /**
- * Destructor.
- */
- virtual ~CPublisherRegistryMap();
-
-private:
-
- /**
- * Adds to database current content
- *
- * @param aSqlDb handle to database
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- *
- * @return id of added entry
- */
- TInt32 AddL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList = 0 ) const;
-
- /**
- * Fetches entries from database
- *
- * @param aSqlDb handle to database
- * @param aList target list for enntries
- * @param aItemsToDelete ids of entries for removal -
- * they were found to be expired
- *
- * @return number of fetched entries
- */
- TUint GetListL( RSqlDatabase aSqlDb,
- CLiwGenericParamList* aList,
- RArray<TInt32>& aItemsToDelete ) const;
- /**
- *
- */
- void RemoveL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList = 0 ) const;
-
- /**
- * Removes entries from database
- *
- * @param aSqlDb handle to database
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- */
- void SaveQueryResultsL( RSqlStatement& aStmt ,
- CLiwGenericParamList& aList,
- RArray<TInt32>& aItemsToDelete )const;
-
- /**
- * Performs actuall add operation
- *
- * @param aSqlDb handle to database
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- *
- * @return id of added entry
- */
- TInt32 AddToDbL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList ) const;
-
- /**
- * Appends filter as strings to SQL query according to aFilter
- *
- * @param aQuery SQL query
- * @param aFilter as enum
- *
- */
- void AppendFilterL( RBuf& aQuery, TUint& aFilter ) const;
-
- /**
- * Appends sorting criteria as strings to SQL query according to aSort
- *
- * @param aQuery SQL query
- * @param aSort sort filter as TInt
- */
- void AppendSortL( RBuf& aQuery, const TCPSortOrder& aSort ) const;
-
- /**
- * Prepares SQL query for Add operation
- *
- * @param aSqlDb handle to database
- * @param aStmt handle to SQL statement
- * @param aQuery SQL query
- *
- */
- void PrepareStmtforAddL(RSqlDatabase aSqlDb,
- RSqlStatement& aStmt ,
- const TDesC& aQuery ) const;
-
- /**
- * Prepares SQL query for Update operation
- *
- * @param aSqlDb handle to database
- * @param aStmt handle to SQL statement
- * @param aId id of entry to update
- *
- */
- void PrepareStmtforUpdateL( RSqlDatabase aSqlDb,
- RSqlStatement& aStmt,
- TInt32 aId ) const;
-
- /**
- * Updates entry in database
- *
- * @param aSqlDb handle to database
- * @param aId id entry to update
- * @param aNotificationList list of notifications to fill in when
- * something was actually changed in dataabse
- */
- void UpdateL( RSqlDatabase aSqlDb, TInt32 aId,
- CLiwDefaultList* aNotificationList = 0 ) const;
-
- /**
- * Check if IDs are valid for Delete operation
- *
- */
- void IsValidForDeleteL() const;
-
- /**
- * Check if IDs are valid for GetList operation
- */
- void IsValidForGetListL() const ;
-
- /**
- *
- * @return ETrue if supported, EFalse if not
- */
- TBool ActivateActionSupport( ) const;
-
- /**
- *
- * @return ETrue if activate flag is set, EFalse if not
- */
- TBool GetActivateInfo( ) const;
-
- /**
- * Fills change info map with proper values
- *aStmt
- * @param aStmt handle to SQL statement
- * @param aChangeInfoMap map that will be filed
- *
- */
- void FillChangeInfoMapL( RSqlStatement& aStmt,
- CLiwDefaultMap* aMap ) const;
-
-private:
-
- /**
- * C++ default constructor.
- */
- CPublisherRegistryMap();
-
- /**
- * Perform the second phase construction of a CPublisherRegistryMap object.
- */
- void ConstructL();
-
- };
-
-#endif // C_CPUBLISHERREGISTRYMAP_H
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/ccontentmap.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,563 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ?Description
- *
-*/
-
-
-#include <liwcommon.h>
-
-#include "ccontentmap.h"
-#include "cpglobals.h"
-#include "cpdebug.h"
-#include "cpssqlcommands.h"
-#include "cpsecuritypolicy.h"
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-
-CContentMap::CContentMap()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentMap::ConstructL()
- {
- CCPLiwMap::ConstructL( );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CContentMap* CContentMap::NewL( )
- {
- CContentMap* self = CContentMap::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CContentMap* CContentMap::NewLC( )
- {
- CContentMap* self = new (ELeave) CContentMap();
- self->PushL();
- self->ConstructL( );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CContentMap::~CContentMap()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt32 CContentMap::AddL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList ) const
- {
- CP_DEBUG( _L8("CContentMap::AddL") );
- TInt32 id( 0);
- if ( !GetProperty( KId, id ) )
- {
- FetchIdL( aSqlDb, KSQLFetchId, id );
- }
- if ( id )
- {
- UpdateL( aSqlDb, id, aNotificationList );
- }
- else
- {
- id = AddToDbL( aSqlDb, aNotificationList );
- }
- return id;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TUint CContentMap::GetListL( RSqlDatabase aSqlDb,
- CLiwGenericParamList* aList, RArray<TInt32>& aItemsToDelete ) const
- {
- CP_DEBUG( _L8("CContentMap::GetListL") );
- aItemsToDelete.Reset( );
- return CCPLiwMap::GetListL( aSqlDb, KSQLGetList, aList, aItemsToDelete );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentMap::RemoveL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList ) const
- {
- CP_DEBUG( _L8("CContentMap::RemoveL") );
- //get ids of items to be deleted
- GetIdsOfRemovedEntriesL( aSqlDb, KSQLGetIds, aNotificationList );
- CCPLiwMap::RemoveL( aSqlDb, KSQLDelete );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentMap::SaveQueryResultsL( RSqlStatement& aStmt,
- CLiwGenericParamList& aList, RArray<TInt32>& aItemsToDelete ) const
- {
- CP_DEBUG( _L8("CContentMap::SaveQueryResultsL") );
- TInt idIndex = ColumnIndexL( aStmt, KColumnId );
- TInt publisherIndex = ColumnIndexL( aStmt, KColumnPublisher );
- TInt contentIndex = ColumnIndexL( aStmt, KColumnContent_type );
- TInt content_idIndex = ColumnIndexL( aStmt, KColumnContent_id );
- TInt expiration_dateIndex = ColumnIndexL( aStmt, KColumnExpiration_date );
- TInt acl_Index = ColumnIndexL( aStmt, KColumnAccessList );
- TInt data_Index = ColumnIndexL( aStmt, KColumnData );
- TInt action_Index = ColumnIndexL( aStmt, KColumnAction );
-
- TBool aclCheckFailed( EFalse );
- while ( aStmt.Next( ) == KSqlAtRow )
- {
- TBool securityOk( EFalse );
- if( iPolicy )
- {
- TPtrC8 acl;
- User::LeaveIfError( aStmt.ColumnBinary( acl_Index, acl ) );
- securityOk = iPolicy->CheckSecurityL( acl ,
- CCPSecurityPolicy::ERead );
- if ( !securityOk )
- {
- aclCheckFailed = ETrue;
- }
- }
- if ( !iPolicy || securityOk )
- {
- TInt32 id = aStmt.ColumnInt( idIndex ) ;
- TPtrC publisher;
- User::LeaveIfError( aStmt.ColumnText( publisherIndex,
- publisher ) );
- TPtrC content_type;
- User::LeaveIfError( aStmt.ColumnText( contentIndex,
- content_type ) );
- TPtrC content_id;
- User::LeaveIfError( aStmt.ColumnText( content_idIndex,
- content_id ) );
- CLiwDefaultMap* targetMap = CLiwDefaultMap::NewLC( );
- targetMap->InsertL( KId, TLiwVariant( id ) );
- targetMap->InsertL( KPublisherId, TLiwVariant( publisher ) );
- targetMap->InsertL( KContentType, TLiwVariant(content_type ) );
- targetMap->InsertL( KContentId, TLiwVariant( content_id ) );
-
- TInt64 expiration_date;
- expiration_date = aStmt.ColumnInt64( expiration_dateIndex );
- if ( ( expiration_date )
- &&(IsOutdated( TTime( expiration_date ) )) )
- {
- // add id of item to be deleted to aItemsToDelete array
- // do not continue getlist operation
- aItemsToDelete.AppendL( id );
- }//if
- else
- {
- // continue getlist operation
- TPtrC8 data;
- User::LeaveIfError( aStmt.ColumnBinary( data_Index, data ) );
- TPtrC8 action;
- User::LeaveIfError( aStmt.ColumnBinary( action_Index, action ) );
- if( data.Ptr() )
- {
- targetMap->InsertL( KDataMap , TLiwVariant( data ) );
- }
- if( action.Ptr() )
- {
- targetMap->InsertL( KActionMap , TLiwVariant( action ) );
- }
- TLiwGenericParam result( KListMap, TLiwVariant( targetMap ));
- aList.AppendL( result );
- }//else
- CleanupStack::PopAndDestroy( targetMap );
- }// if
- }//while
- //leave only if ACL security check for all items failed
- if ( aclCheckFailed && !aList.Count())
- {
- User::Leave( KErrPermissionDenied );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentMap::PrepareStmtforAddL( RSqlDatabase aSqlDb,
- RSqlStatement& aStmt, const TDesC& aQuery ) const
- {
- CP_DEBUG( _L8("CContentMap::PrepareStmtforAddL") );
- CCPLiwMap::PrepareStmtforAddL( aSqlDb, aStmt, aQuery );
- TTime expiration_date( NULL);
- GetExpirationDateL( expiration_date );
- TInt expiration_dateIndex = aStmt.ParameterIndex( KSQLExpiration_date );
- if ( expiration_dateIndex != KErrNotFound )
- {
- BindInt64L( aStmt, expiration_dateIndex, expiration_date.Int64() );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentMap::PrepareStmtforUpdateL( RSqlDatabase aSqlDb,
- RSqlStatement& aStmt, TInt32 aId ) const
- {
- CP_DEBUG( _L8("CContentMap::PrepareStmtforUpdateL") );
- TTime expiration_date;
- TBool isExpirationDate = GetExpirationDateL( expiration_date );
- TBool isParameter(EFalse);
- RBuf query;
- query.CleanupClosePushL();
- query.CreateL( KSQLUpdate().Length( ) );
- query.Append( KSQLUpdate );
- RBuf8 data;
- data.CleanupClosePushL();
- RBuf8 action;
- action.CleanupClosePushL();
- if ( GetPropertyL( KDataMap, data ) )
- {
- query.ReAllocL( query.Length( ) + KSQLUpdateData().Length( ) );
- query.Append( KSQLUpdateData );
- isParameter = ETrue;
- }
- if ( GetPropertyL( KActionMap, action ) )
- {
- if ( isParameter )
- {
- query.ReAllocL( query.Length( ) + KComma().Length( ) );
- query.Append( KComma );
- }
- query.ReAllocL( query.Length( ) + KSQLUpdateAction().Length( ) );
- query.Append( KSQLUpdateAction );
- isParameter = ETrue;
- }
- if ( isExpirationDate )
- {
- if ( isParameter )
- {
- query.ReAllocL( query.Length( ) + KComma().Length( ) );
- query.Append( KComma );
- }
- query.ReAllocL( query.Length( ) + KSQLUpdateExpirationDate().Length( ) );
- query.Append( KSQLUpdateExpirationDate );
- isParameter = ETrue;
- }
- if ( !isParameter ) User::Leave( KErrPathNotFound );
- query.ReAllocL( query.Length( ) + KSQLUpdateWhere().Length( ) );
- query.Append( KSQLUpdateWhere );
-
- User::LeaveIfError( aStmt.Prepare( aSqlDb, query ) );
- TInt dataId = aStmt.ParameterIndex( KSQLId );
- BindIntL( aStmt, dataId, aId );
-
- if ( data.Length( ) )
- {
- TInt dataIndex = aStmt.ParameterIndex( KSQLData );
- BindBinaryL( aStmt, dataIndex, data );
- }
- if ( action.Length( ) )
- {
- TInt actionIndex = aStmt.ParameterIndex( KSQLAction );
- BindBinaryL( aStmt, actionIndex, action );
- }
- if ( isExpirationDate )
- {
- TInt expiration_dateIndex =
- aStmt.ParameterIndex( KSQLExpiration_date );
- BindInt64L( aStmt, expiration_dateIndex,
- expiration_date.Int64( ) );
-
- }
- CleanupStack::PopAndDestroy( &action );
- CleanupStack::PopAndDestroy( &data );
- CleanupStack::PopAndDestroy( &query );
- }
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentMap::UpdateL( RSqlDatabase aSqlDb, TInt32 aId,
- CLiwDefaultList* aNotificationList ) const
- {
- CP_DEBUG( _L8("CContentMap::UpdateL") );
- RSqlStatement stmt;
- CleanupClosePushL( stmt );
- CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC( );
- FetchIdsL( aId, KSQLFetchIds, changeInfoMap, aSqlDb );
- if ( aNotificationList )
- {
- changeInfoMap->InsertL( KType, TLiwVariant( KCpData ) );
- aNotificationList->AppendL( TLiwVariant( changeInfoMap ) );
- }
- CleanupStack::PopAndDestroy( changeInfoMap );
- PrepareStmtforUpdateL( aSqlDb, stmt, aId );
- if ( stmt.Exec( ) <= 0 )
- {
- User::Leave( KErrNotFound );
- }
- CleanupStack::PopAndDestroy( &stmt );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt32 CContentMap::AddToDbL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList ) const
- {
- CP_DEBUG( _L8("CContentMap::AddToDbL") );
- RSqlStatement stmt;
- CleanupClosePushL( stmt );
- PrepareStmtforAddL( aSqlDb, stmt, KSQLInsert );
-
- TInt dataIndex = stmt.ParameterIndex( KSQLData );
- TInt actionIndex = stmt.ParameterIndex( KSQLAction );
- TInt aclIndex = stmt.ParameterIndex( KSQLAccessList );
-
- RBuf8 data;
- data.CleanupClosePushL();
- GetPropertyL( KDataMap, data ) ;
- BindBinaryL( stmt, dataIndex, data );
-
- RBuf8 action;
- action.CleanupClosePushL();
- GetPropertyL( KActionMap, action ) ;
- BindBinaryL( stmt, actionIndex, action );
-
- RBuf8 acl;
- acl.CleanupClosePushL();
- if( !GetPropertyL( KAccessList , acl ) )
- {
- iPolicy->GetDefaultSecurityL( acl );
- }
-
- BindBinaryL( stmt, aclIndex, acl );
- if ( stmt.Exec( ) <= 0 )
- {
- User::Leave( KErrGeneral );
- }
-
- TSqlScalarFullSelectQuery id_query(aSqlDb);
- TInt32 ret( 0);
- ret = id_query.SelectIntL( KSQLGetLastInsertId );
-
- if ( aNotificationList )
- {
- RBuf publisher;
- publisher.CleanupClosePushL();
- RBuf contentType;
- contentType.CleanupClosePushL();
- RBuf contentId;
- contentId.CleanupClosePushL();
- GetPropertyL( KPublisherId, publisher ) ;
- GetPropertyL( KContentType, contentType );
- GetPropertyL( KContentId, contentId );
- CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC( );
- changeInfoMap->InsertL( KId, TLiwVariant( ret ) );
- changeInfoMap->InsertL( KType, TLiwVariant( KCpData ) );
- changeInfoMap->InsertL( KPublisherId, TLiwVariant( publisher ) );
- changeInfoMap->InsertL( KContentType, TLiwVariant( contentType ) );
- changeInfoMap->InsertL( KContentId, TLiwVariant( contentId ) );
- changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationAdd ) );
- aNotificationList->AppendL( TLiwVariant( changeInfoMap ) );
- CleanupStack::PopAndDestroy( changeInfoMap ) ;
- CleanupStack::PopAndDestroy( &contentId ) ;
- CleanupStack::PopAndDestroy( &contentType ) ;
- CleanupStack::PopAndDestroy( &publisher ) ;
- }
-
- CleanupStack::PopAndDestroy( &acl ) ;
- CleanupStack::PopAndDestroy( &action ) ;
- CleanupStack::PopAndDestroy( &data ) ;
- CleanupStack::PopAndDestroy( &stmt ) ;
- return ret;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentMap::AppendSortL( RBuf& aQuery, const TCPSortOrder& aSort ) const
- {
- CP_DEBUG( _L8("CContentMap::AppendSortL") );
- switch ( aSort )
- {
- case ECPPublisher:
- aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderPublisher().Length( ) );
- aQuery.Append( KSQLOrderPublisher );
- break;
- case ECPContent:
- aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderContent().Length( ) );
- aQuery.Append( KSQLOrderContent );
- break;
- default:
- aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderRecent().Length( ) );
- aQuery.Append( KSQLOrderRecent );
- break;
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CContentMap::IsOutdated( const TTime aExpirationTime ) const
- {
- CP_DEBUG( _L8("CContentMap::IsOutdated") );
- TBool result(EFalse);
- TTime currentTime(0);
- currentTime.HomeTime( );
- if ( currentTime>aExpirationTime )
- {
- result = ETrue;
- }
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentMap::IsDataMapL() const
- {
- TInt pos( 0 );
- const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, KDataMap );
- if ( pos != KErrNotFound )
- {
- if( paramForValue->Value().TypeId() != LIW::EVariantTypeDesC8 )
- {
- User::Leave( KErrBadName );
- }
- }
- else
- {
- User::Leave( KErrPathNotFound );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CContentMap::GetExpirationDateL( TTime& aResult ) const
- {
- CP_DEBUG( _L8("CContentMap::GetExpirationDateL") );
- TInt pos( 0);
- TBool result(EFalse);
- const TLiwGenericParam* param= NULL;
- param = iMap->FindFirst( pos, KExpirationDate );
- if ( KErrNotFound != pos )
- {
- if ( !param->Value().Get( aResult ) )
- User::Leave( KErrArgument );
- result = ETrue;
- }
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentMap::IsValidForDeleteL() const
- {
- CP_DEBUG( _L8("CContentMap::IsValidFilterL") );
- TInt err( KErrNone );
- TInt32 id( 0 );
- if( GetProperty( KId, id ) && ( id < 1 ) )
- {
- err = KErrArgument;
- }
- else if( !IsId() && PropertyExists( KId ) )
- {
- err = KErrBadName;
- }
-
- if( err == KErrNone && !IsId( ) && !( IsPublisherNameL( )
- || IsContentTypeL( ) || IsContentIdL() ) )
- {
- err = KErrPathNotFound;
- }
-
- if( err != KErrNone )
- {
- User::Leave( err );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentMap::IsValidForGetListL() const
- {
- CP_DEBUG( _L8("CContentMap::IsValidForGetListL") );
- TInt err( KErrNone );
- TInt32 id( 0 );
- if( GetProperty( KId, id ) && ( id < 1 ) )
- {
- err = KErrArgument;
- }
- else if( !IsId() && PropertyExists( KId ) )
- {
- err = KErrBadName;
- }
-
- if( err != KErrNone )
- {
- User::Leave( err );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CContentMap::ActivateActionSupport( ) const
- {
- return EFalse;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CContentMap::GetActivateInfo( ) const
- {
- return EFalse;
- }
-
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpliwmap.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1270 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ?Description
- *
-*/
-
-
-#include <s32mem.h>
-#include <liwgenericparam.h>
-#include <escapeutils.h>
-#include <badesca.h>
-
-#include "cpliwmap.h"
-#include "cpdebug.h"
-#include "cpssqlcommands.h"
-#include "ccontentmap.h"
-#include "cpublisherregistrymap.h"
-#include "cpsecuritypolicy.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CCPLiwMap* CCPLiwMap::NewL( RDesReadStream& aStream )
- {
- CLiwGenericParamList* list = CLiwGenericParamList::NewLC( aStream );
- CCPLiwMap* map = CCPLiwMap::NewL( *list );
- CleanupStack::PopAndDestroy( list );
- return map;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CCPLiwMap* CCPLiwMap::NewL( const CLiwGenericParamList& aList )
- {
- CP_DEBUG( _L8("CCPLiwMap::NewL") );
- const TLiwGenericParam* param = NULL;
- TInt pos( 0 );
- param = aList.FindFirst( pos, KType );
- CCPLiwMap* map( NULL );
- if( param && pos !=KErrNotFound )
- {
- RBuf typeBuf;
- typeBuf.CleanupClosePushL();
- TPtrC type( KNullDesC );
- if( !param->Value().Get( type ) )
- {
- TPtrC8 type8( KNullDesC8 );
- if( !param->Value().Get( type8 ) )
- {
- User::Leave( KErrBadName );
- }
- typeBuf.Assign( EscapeUtils::ConvertToUnicodeFromUtf8L( type8 ) );
- }
- else
- {
- typeBuf.CreateL( type );
- }
- if( typeBuf.Find( KCpData () ) != KErrNotFound )
- {
- map = CContentMap::NewLC();
- }
- else if ( typeBuf.Find( KPublisher () ) != KErrNotFound )
- {
- map = CPublisherRegistryMap::NewLC();
- }
- else User::Leave( KErrArgument );
- map->SetL( aList );
- CleanupStack::Pop( map );
- CleanupStack::PopAndDestroy( &typeBuf );
- }
- else
- {
- User::Leave( KErrPathNotFound );
- }
- return map;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C HBufC8* CCPLiwMap::PackForServerLC() const
- {
- CP_DEBUG( _L8("CCPLiwMap::PackForServerLC") );
- HBufC8* datadesc = HBufC8::NewLC( Size() );
- TPtr8 ptr = datadesc->Des();
- RDesWriteStream datastrm( ptr );
- CleanupClosePushL(datastrm);
- ExternalizeL(datastrm);
- datastrm.CommitL();
- CleanupStack::PopAndDestroy(&datastrm);
- return datadesc;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C void CCPLiwMap::Reset( ) const
- {
- iMap->Reset();
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::IsValidForAddL( ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::IsValidForAddL") );
- TInt err( KErrNone );
- TInt32 id( 0 );
- if( GetProperty( KId, id ) && ( id < 1 ) )
- {
- err = KErrArgument;
- }
- else if( !IsId() && PropertyExists( KId ) )
- {
- err = KErrBadName;
- }
-
- CheckIdentifiersL();
-
- if( err == KErrNone && !IsId() && !( IsPublisherNameL()
- && IsContentTypeL() && IsContentIdL() ) )
- {
- err = KErrPathNotFound;
- }
-
- if( err != KErrNone )
- {
- User::Leave( err );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C void CCPLiwMap::IsValidForActionL( )const
- {
- CP_DEBUG( _L8("CCPLiwMap::IsValidForActionL") );
- CCPLiwMap::IsValidForNotificationL();
- if( !IsTriggerL() ) User::Leave( KErrPathNotFound );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C void CCPLiwMap::IsValidForNotificationL( ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::IsValidForAddL") );
- TInt err( KErrNone );
- TInt32 id( 0 );
- if( GetProperty( KId, id ) && ( id < 1 ) )
- {
- err = KErrArgument;
- }
- else if( !IsId() && PropertyExists( KId ) )
- {
- err = KErrBadName;
- }
-
- CheckIdentifiersL();
-
- if( err == KErrNone && !IsId() && !IsPublisherNameL()
- && !IsContentTypeL() && !IsContentIdL() )
- {
- err = KErrPathNotFound;
- }
-
- if( err != KErrNone )
- {
- User::Leave( err );
- }
- }
-
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C TBool CCPLiwMap::GetPropertyL( const TDesC8& aProperty ,
- RBuf& aResult ) const
- {
- //change name
- CP_DEBUG( _L8("CCPLiwMap::GetProperty - TPtrC") );
- TBool result( EFalse );
- TInt pos( 0 );
- TPtrC result16( KNullDesC);
- TPtrC8 result8( KNullDesC8);
- const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, aProperty );
- if ( pos != KErrNotFound )
- {
- if( paramForValue->Value().Get( result16 ) )
- {
- aResult.CreateL( result16 );
- result = ETrue;
- }
- else if( paramForValue->Value().Get( result8 ) )
- {
- aResult.Assign( EscapeUtils::ConvertToUnicodeFromUtf8L( result8 ) );
- result = ETrue;
- }
- else
- {
- User::Leave( KErrBadName );
- }
- }
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C TBool CCPLiwMap::GetPropertyL( const TDesC8& aProperty ,
- RBuf8& aResult ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::GetProperty - TPtrC8") );
- TBool result( EFalse );
- TInt pos( 0 );
- TPtrC8 result8( KNullDesC8 );
- TPtrC result16( KNullDesC );
- const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, aProperty );
- if ( pos != KErrNotFound )
- {
- if( paramForValue->Value().Get( result8 ) )
- {
- aResult.CreateL( result8 );
- result = ETrue;
- }
- else if( paramForValue->Value().Get( result16 ) )
- {
- aResult.Assign( EscapeUtils::ConvertFromUnicodeToUtf8L( result16 ) );
- result = ETrue;
- }
- else
- {
- User::Leave( KErrBadName );
- }
- }
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C TBool CCPLiwMap::GetProperty( const TDesC8& aProperty ,
- TInt32& aResult ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::GetProperty - TInt32") );
- TBool result( EFalse );
- TInt pos( 0 );
- const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, aProperty );
- if ( pos != KErrNotFound )
- {
- if( paramForValue->Value().Get( aResult ) )
- {
- result = ETrue;
- }
- }
- return result;
- }
-
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C void CCPLiwMap::SetSecurityL( const RMessage2& aMessage )
- {
- delete iPolicy;
- iPolicy = NULL;
- iPolicy = CCPSecurityPolicy::NewL( aMessage );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPLiwMap::~CCPLiwMap()
- {
- delete iMap;
- delete iPolicy;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPLiwMap::CCPLiwMap()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::InsertL( const TDesC8& aKey, const TLiwVariant& aValue )
- {
- CP_DEBUG( _L8("CCPLiwMap::InsertL") );
- Remove( aKey );
- TLiwGenericParam mp;
- mp.SetNameAndValueL( aKey, aValue );
- iMap->AppendL( mp );
- mp.Reset( );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPLiwMap::FindL( const TDesC8& aKey, TLiwVariant& aValue ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::FindL") );
- TInt pos = 0;
- TBool result(EFalse);
- const TLiwGenericParam* tempParam = iMap->FindFirst( pos, aKey );
- if ( tempParam )
- {
- aValue.SetL( tempParam->Value( ) );
- result = ETrue;
- }
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CCPLiwMap::Count() const
- {
- return iMap->Count( );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPLiwMap::AtL( TInt aIndex, TDes8& aKey ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::AtL") );
- TBool result(EFalse);
- if ( 0 <= aIndex && aIndex < iMap->Count( ) )
- {
- aKey = ((*iMap)[aIndex]).Name( );
- result = ETrue;
- }
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::Remove( const TDesC8& aKey )
- {
- CP_DEBUG( _L8("CCPLiwMap::Remove") );
- TInt pos = 0;
- iMap->FindFirst( pos, aKey );
- if ( pos != KErrNotFound )
- {
- iMap->Remove( aKey );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CCPLiwMap::Size() const
- {
- return iMap->Size( );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::ExternalizeL( RWriteStream& aStream ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::ExternalizeL") );
- iMap->ExternalizeL( aStream );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::FillChangeInfoMapL( RSqlStatement& aStmt,
- CLiwDefaultMap* aMap )const
- {
- TInt idIndex = ColumnIndexL( aStmt, KColumnId );
- TInt publisherIndex = ColumnIndexL( aStmt, KColumnPublisher );
- TInt contentIndex = ColumnIndexL( aStmt, KColumnContent_type );
- TInt content_idIndex = ColumnIndexL( aStmt, KColumnContent_id );
- TInt acl_Index = ColumnIndexL( aStmt, KColumnAccessList );
-
- TInt32 id = aStmt.ColumnInt( idIndex ) ;
- TPtrC publisher;
- User::LeaveIfError(aStmt.ColumnText( publisherIndex,publisher) );
- TPtrC content_type;
- User::LeaveIfError(aStmt.ColumnText( contentIndex,content_type ) );
- TPtrC content_id;
- User::LeaveIfError(aStmt.ColumnText( content_idIndex,content_id) );
- aMap->InsertL( KId, TLiwVariant( id ) );
- aMap->InsertL( KPublisherId, TLiwVariant( publisher ) );
- aMap->InsertL( KContentType, TLiwVariant( content_type ) );
- aMap->InsertL( KContentId, TLiwVariant( content_id ) );
- aMap->InsertL( KOperation, TLiwVariant( KOperationDelete ) );
- RBuf type;
- type.CleanupClosePushL();
- if( GetPropertyL( KType, type ) )
- {
- aMap->InsertL( KType , TLiwVariant( type ) );
- }
- CleanupStack::PopAndDestroy( &type );
- }
-
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::SetL( const CLiwGenericParamList& aInParamList )
- {
-
- CP_DEBUG( _L8("CCPLiwMap::SetL") );
- for ( TInt i = 0; i < aInParamList.Count( ); i++ )
- {
- const TLiwGenericParam& param = aInParamList[i];
- if ( param.Value().TypeId( ) == LIW::EVariantTypeMap )
- {
- const CLiwMap* map = param.Value().AsMap( );
- for ( TInt i = 0; i <map->Count( ); i++ )
- {
- TBuf8<128> key;
- map->AtL( i, key );
- TLiwVariant value;
- value.PushL( );
- map->FindL( key, value );
- if ( key == KOperation )
- {
- IsProperOperationL( value );
- }
- RBuf8 datadesc;
- datadesc.CleanupClosePushL();
- if ( value.TypeId( ) == LIW::EVariantTypeMap )
- {
- const CLiwMap* internalMap = value.AsMap( );
- datadesc.CreateL( internalMap->Size( ) );
- RDesWriteStream datastrm(datadesc);
- CleanupClosePushL( datastrm );
- internalMap->ExternalizeL( datastrm );
- datastrm.CommitL( );
- CleanupStack::PopAndDestroy( &datastrm );
- value.Reset( );
- value.Set( datadesc );
- }
- TLiwGenericParam data( key, value);
- iMap->AppendL( data );
- CleanupStack::PopAndDestroy( &datadesc );
- CleanupStack::PopAndDestroy( &value );
- }
- }
- else
- {
- iMap->AppendL( param );
- }
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::IsProperOperationL( const TLiwVariant& aValue ) const
- {
- CP_DEBUG( _L8("CContentMap::IsProperOperationL") );
- TPtrC valDesc( KNullDesC );
- TPtrC8 valDesc8( KNullDesC8 );
- RBuf desc;
- desc.CleanupClosePushL();
-
- if( aValue.Get( valDesc ) == EFalse )
- {
- if( aValue.Get( valDesc8 ) != EFalse )
- {
- desc.Assign( EscapeUtils::ConvertToUnicodeFromUtf8L( valDesc8 ) );
- valDesc.Set( desc );
- }
- else
- {
- User::Leave( KErrBadName );
- }
- }
-
- TLex input( valDesc );
-
- CDesC16Array* array = new (ELeave) CDesC16ArrayFlat(4);
- CleanupStack::PushL( array );
-
- TLexMark startMark;
- input.Mark( startMark );
- TBool notEmpty = EFalse;
- while ( !input.Eos() )
- {
- if( input.Peek() == ':')
- {
- array->AppendL( input.MarkedToken( startMark ) );
- input.Inc();
- input.Mark( startMark );
- }
- input.Inc();
- notEmpty = ETrue;
- }
- if ( notEmpty )
- {
- array->AppendL( input.MarkedToken( startMark ) );
- }
-
- for( TInt i= 0; i < array->MdcaCount(); i++ )
- {
- TPtrC operValue( array->MdcaPoint(i) );
-
- if( operValue.Compare( KOperationAdd ) &&
- operValue.Compare( KOperationUpdate ) &&
- operValue.Compare( KOperationDelete ) &&
- operValue.Compare( KOperationExecute ) )
- {
- User::Leave( KErrArgument );
- }
- }
- CleanupStack::PopAndDestroy( array );
- CleanupStack::PopAndDestroy( &desc );
- }
-
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::AppendGetListFilterL( RBuf& aQuery, TUint& aFilter ) const
- {
- CP_DEBUG( _L8("CContentMap::AppendGetListFilterL") );
- if( !IsGetListAllL( aFilter ) )
- {
- AppendFilterL( aQuery, aFilter );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::AppendRemoveFilterL( RBuf& aQuery, TUint& aFilter ) const
- {
- CP_DEBUG( _L8("CContentMap::AppendRemoveFilterL") );
- AppendFilterL( aQuery, aFilter );
- }
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::AppendFilterL( RBuf& aQuery, TUint& aFilter ) const
- {
- CP_DEBUG( _L8("CContentMap::AppendFilterL") );
-
- TBool nextFilter( EFalse );
-
- RemoveAllAttributeL( aFilter ); //remove "all" attribute from publisher,
- //cont_type or cont_id
-
- aQuery.ReAllocL( aQuery.Length( ) + KWhere().Length( ) );
- aQuery.Append( KWhere );
-
- if( aFilter & EContentType )
- {
- aQuery.ReAllocL( aQuery.Length( ) + KSQLGetContentType().Length( ) );
- aQuery.Append( KSQLGetContentType );
- nextFilter = ETrue;
- }
- if( aFilter & EPublisher )
- {
- if( nextFilter )
- {
- aQuery.ReAllocL( aQuery.Length( ) + KAnd().Length( ) +
- KSQLGetPublisher().Length( ) );
- aQuery.Append( KAnd );
- aQuery.Append( KSQLGetPublisher );
- }
- else
- {
- aQuery.ReAllocL( aQuery.Length( ) +
- KSQLGetPublisher().Length( ) );
- aQuery.Append( KSQLGetPublisher );
- }
- nextFilter = ETrue;
- }
- if( aFilter & EContentId )
- {
- if( nextFilter )
- {
- aQuery.ReAllocL( aQuery.Length( ) +
- KAnd().Length( ) + KSQLGetContentId().Length( ) );
- aQuery.Append( KAnd );
- aQuery.Append( KSQLGetContentId );
- }
- else
- {
- aQuery.ReAllocL( aQuery.Length( ) + KSQLGetContentId().Length( ) );
- aQuery.Append( KSQLGetContentId );
- }
- nextFilter = ETrue;
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::PrepareStmtforAddL( RSqlDatabase aSqlDb,
- RSqlStatement& aStmt, const TDesC& aQuery ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::PrepareStmtforAddL") );
- RBuf publisher;
- publisher.CleanupClosePushL();
- RBuf content_type;
- content_type.CleanupClosePushL();
- RBuf content_id;
- content_id.CleanupClosePushL();
- if ( GetPropertyL( KPublisherId, publisher )
- && GetPropertyL( KContentType, content_type )
- && GetPropertyL( KContentId, content_id ) )
- {
- User::LeaveIfError( aStmt.Prepare( aSqlDb, aQuery ) );
- TInt publisherIndex = aStmt.ParameterIndex( KSQLPublisher );
- TInt content_typeIndex = aStmt.ParameterIndex( KSQLContent_type );
- TInt content_idIndex = aStmt.ParameterIndex( KSQLContent_id );
-
- BindTextL( aStmt, publisherIndex, publisher );
- BindTextL( aStmt, content_typeIndex, content_type );
- BindTextL( aStmt, content_idIndex, content_id );
- }
- else
- {
- User::Leave( KErrArgument );
- }
- CleanupStack::PopAndDestroy( &content_id );
- CleanupStack::PopAndDestroy( &content_type );
- CleanupStack::PopAndDestroy( &publisher );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TUint CCPLiwMap::GetFilterL( )const
- {
- CP_DEBUG( _L8("CCPLiwMap::GetFilterL") );
- TUint result (0);
- if(IsPublisherNameL())
- {
- result |= EPublisher;
- }
- if(IsContentTypeL())
- {
- result |= EContentType;
- }
- if(IsContentIdL())
- {
- result |= EContentId;
- }
- if(IsFlag())
- {
- result |= EFlag;
- }
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPLiwMap::TCPSortOrder CCPLiwMap::GetSortL() const
- {
- CP_DEBUG( _L8("CCPLiwMap::GetSortL") );
- TCPSortOrder result(ECPRecent);
- RBuf sort;
- sort.CleanupClosePushL();
- if ( GetPropertyL( KSortOrder, sort ) )
- {
- if ( !sort.Compare( KSortRecent ) )
- {
- result = ECPRecent;
- }
- else if ( !sort.Compare( KSortPublisher ) )
- {
- result = ECPPublisher;
- }
- else if ( !sort.Compare( KSortContentType ) )
- {
- result = ECPContent;
- }
- else if ( !sort.Compare( KSortContentId ) )
- {
- result = ECPContentId;
- }
- }
- CleanupStack::PopAndDestroy( &sort );
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPLiwMap::IsPublisherNameL() const
- {
- TBool result( EFalse );
- RBuf buffer;
- buffer.CleanupClosePushL();
- result = GetPropertyL( KPublisherId, buffer );
- if( result && buffer.Length() == KErrNone )
- {
- User::Leave( KErrArgument );
- }
- CleanupStack::PopAndDestroy( &buffer );
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPLiwMap::IsContentTypeL() const
- {
- TBool result( EFalse );
- RBuf buffer;
- buffer.CleanupClosePushL();
- result = GetPropertyL( KContentType, buffer );
- if( result && buffer.Length() == KErrNone )
- {
- User::Leave( KErrArgument );
- }
- CleanupStack::PopAndDestroy( &buffer );
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPLiwMap::IsContentIdL() const
- {
- TBool result( EFalse );
- RBuf buffer;
- buffer.CleanupClosePushL();
- result = GetPropertyL( KContentId, buffer );
- if( result && buffer.Length() == KErrNone )
- {
- User::Leave( KErrArgument );
- }
- CleanupStack::PopAndDestroy( &buffer );
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPLiwMap::IsTriggerL( ) const
- {
- TBool result( EFalse );
- RBuf8 buffer;
- buffer.CleanupClosePushL();
- result = GetPropertyL( KActionTrigger, buffer );
- CleanupStack::PopAndDestroy( &buffer );
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPLiwMap::IsFlag( ) const
- {
- TInt32 buffer( 0 );
- return GetProperty( KFlag, buffer );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPLiwMap::IsId() const
- {
- TInt32 id( 0);
- return GetProperty( KId, id );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPLiwMap::PropertyExists( const TDesC8& aProperty ) const
- {
- TBool result( EFalse );
- TInt pos( 0 );
- iMap->FindFirst( pos, aProperty );
- if ( pos != KErrNotFound )
- {
- result = ETrue;
- }
- return result;
- }
-
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TUint CCPLiwMap::GetListL( RSqlDatabase aSqlDb, const TDesC& aQuery,
- CLiwGenericParamList* aList, RArray<TInt32>& aItemsToDelete ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::GetListL") );
- RBuf sqlquery;
- sqlquery.CleanupClosePushL();
- sqlquery.CreateL( aQuery );
- TInt32 id( 0);
- if ( GetProperty( KId, id ) )
- {
- ConstructSelectIdL( sqlquery );
- }
- else
- {
- ConstructGetListSelectL( sqlquery );
- }
- RSqlStatement stmt;
- CleanupClosePushL( stmt );
- User::LeaveIfError( stmt.Prepare( aSqlDb, sqlquery ) );
- BindValueL( sqlquery, stmt );
- SaveQueryResultsL( stmt, *aList, aItemsToDelete );
- CleanupStack::PopAndDestroy( &stmt ) ;
- CleanupStack::PopAndDestroy( &sqlquery );
- return aList->Count( );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::RemoveL( RSqlDatabase aSqlDb, const TDesC& aQuery ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::RemoveL") );
- RBuf sqlquery;
- sqlquery.CleanupClosePushL();
- sqlquery.CreateL( aQuery );
- TInt32 id( 0);
- if ( GetProperty( KId, id ) )
- {
- ConstructSelectIdL( sqlquery );
- }
- else
- {
- ConstructRemoveSelectL( sqlquery, EFalse );
- }
-
- RSqlStatement stmt;
- CleanupClosePushL( stmt );
- User::LeaveIfError( stmt.Prepare( aSqlDb, sqlquery ) );
-
- BindValueL( sqlquery, stmt );
- if ( stmt.Exec( ) <= 0 )
- {
- User::Leave( KErrNotFound );
- }
- CleanupStack::PopAndDestroy( &stmt ) ;
- CleanupStack::PopAndDestroy( &sqlquery );
- }
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::FetchIdsL( TInt32 aId, const TDesC& aQuery,
- CLiwDefaultMap* aMap, RSqlDatabase aSqlDb ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::FetchIdsL") );
- RSqlStatement stmt;
- CleanupClosePushL( stmt );
- //prepare statment for "Get Ids" (Publisher, ContentType,ContentId)
- User::LeaveIfError( stmt.Prepare( aSqlDb, aQuery ) );
- TInt idIndex = stmt.ParameterIndex( KSQLId );
- User::LeaveIfError( stmt.BindInt( idIndex, aId ) );
-
- TInt publisherIndex = ColumnIndexL( stmt, KColumnPublisher );
- TInt contentTypeIndex = ColumnIndexL( stmt, KColumnContent_type );
- TInt contentIdIndex = ColumnIndexL( stmt, KColumnContent_id );
- TInt acl_Index = ColumnIndexL( stmt, KColumnAccessList );
-
- if ( stmt.Next( ) == KSqlAtRow )
- {
- if( iPolicy )
- {
- TPtrC8 acl;
- User::LeaveIfError( stmt.ColumnBinary( acl_Index, acl ) );
- if( !iPolicy->CheckSecurityL( acl , CCPSecurityPolicy::EWrite ) )
- {
- User::Leave( KErrPermissionDenied );
- }
- }
- TPtrC publisher;
- User::LeaveIfError( stmt.ColumnText( publisherIndex, publisher ) );
- TPtrC content_type;
- User::LeaveIfError( stmt.ColumnText( contentTypeIndex, content_type ) );
- TPtrC content_id;
- User::LeaveIfError( stmt.ColumnText( contentIdIndex, content_id ) );
- aMap->InsertL( KId, TLiwVariant( aId ) );
- aMap->InsertL( KPublisherId, TLiwVariant( publisher ) );
- aMap->InsertL( KContentType, TLiwVariant( content_type ) );
- aMap->InsertL( KContentId, TLiwVariant( content_id ) );
- aMap->InsertL( KOperation, TLiwVariant( KOperationUpdate ) );
- }
- CleanupStack::PopAndDestroy( &stmt ) ;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::FetchIdL( RSqlDatabase aSqlDb, const TDesC& aQuery,
- TInt32& aId ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::FetchIdL") );
- aId = 0;
- RSqlStatement stmt;
- CleanupClosePushL( stmt );
- PrepareStmtforAddL( aSqlDb, stmt, aQuery );
- TInt idIndex = ColumnIndexL( stmt, KColumnId );
- if ( stmt.Next( ) == KSqlAtRow )
- {
- aId = stmt.ColumnInt( idIndex );
- }
- CleanupStack::PopAndDestroy( &stmt ) ;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::GetIdsOfRemovedEntriesL( RSqlDatabase aSqlDb,
- const TDesC& aQuery, CLiwDefaultList* aList ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::GetIdsOfRemovedEntriesL") );
- RBuf sqlquery;
- sqlquery.CleanupClosePushL();
- sqlquery.CreateL( aQuery );
- TInt32 id( 0);
- if ( GetProperty( KId, id ) )
- {
- ConstructSelectIdL( sqlquery );
- }
- else
- {
- ConstructRemoveSelectL( sqlquery );
- }
- RSqlStatement stmt;
- CleanupClosePushL( stmt );
- User::LeaveIfError( stmt.Prepare( aSqlDb, sqlquery ) );
- BindValueL( sqlquery, stmt );
- SaveQueryResultsIdsL( stmt, aList );
- if( aList && aList->Count()==0 )
- {
- User::Leave( KErrNotFound );
- }
- CleanupStack::PopAndDestroy( &stmt ) ;
- CleanupStack::PopAndDestroy( &sqlquery );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::SaveQueryResultsIdsL( RSqlStatement& aStmt,
- CLiwDefaultList* aList ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::SaveQueryResultsIdsL") );
- TInt acl_Index = ColumnIndexL( aStmt, KColumnAccessList );
-
- while ( aStmt.Next( ) == KSqlAtRow )
- {
- if( iPolicy )
- {
- TPtrC8 acl;
- User::LeaveIfError( aStmt.ColumnBinary( acl_Index, acl ) );
- if ( !iPolicy->CheckSecurityL( acl ,
- CCPSecurityPolicy::EDelete ) )
- {
- User::Leave( KErrPermissionDenied );
- }
- }
- if ( aList )
- {
- CLiwDefaultMap* targetMap = CLiwDefaultMap::NewLC( );
- FillChangeInfoMapL( aStmt, targetMap );
- aList->AppendL( TLiwVariant( targetMap ) );
- CleanupStack::PopAndDestroy( targetMap );
- }
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::ConstructSelectIdL( RBuf& aQuery ) const
- {
- aQuery.ReAllocL( aQuery.Length( ) + KSQLGetId().Length( ) +
- KWhere().Length() );
- aQuery.Append( KWhere );
- aQuery.Append( KSQLGetId );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::ConstructGetListSelectL( RBuf& aQuery, TBool aGet ) const
- {
- TUint filter = GetFilterL( );
- AppendGetListFilterL( aQuery, filter );
- if ( aGet )
- {
- AppendSortL( aQuery, GetSortL( ) );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::ConstructRemoveSelectL( RBuf& aQuery, TBool aGet ) const
- {
- TUint filter = GetFilterL( );
- AppendRemoveFilterL( aQuery, filter );
- if ( aGet )
- {
- AppendSortL( aQuery, GetSortL( ) );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::BindValueL( const RBuf& aQuery, RSqlStatement& aStmt ) const
- {
- CP_DEBUG( _L8("CCPLiwMap::BindValueL") );
- if ( aQuery.Find( KSQLGetPublisher ) != KErrNotFound )
- {
- TInt param = aStmt.ParameterIndex( KSQLPublisher );
- RBuf publisher;
- publisher.CleanupClosePushL();
- User::LeaveIfError( GetPropertyL( KPublisherId, publisher ));
- BindTextL( aStmt, param, publisher );
- CleanupStack::PopAndDestroy( &publisher );
- }
- if ( aQuery.Find( KSQLGetContentType ) != KErrNotFound )
- {
- TInt param = aStmt.ParameterIndex( KSQLContent_type );
- RBuf content_type;
- content_type.CleanupClosePushL();
- User::LeaveIfError( GetPropertyL( KContentType, content_type ));
- BindTextL( aStmt, param, content_type );
- CleanupStack::PopAndDestroy( &content_type );
- }
- if ( aQuery.Find( KSQLGetContentId ) != KErrNotFound )
- {
- TInt param = aStmt.ParameterIndex( KSQLContent_id );
- RBuf content_id;
- content_id.CleanupClosePushL();
- User::LeaveIfError( GetPropertyL( KContentId, content_id ));
- BindTextL( aStmt, param, content_id );
- CleanupStack::PopAndDestroy( &content_id );
- }
- if ( aQuery.Find( KSQLGetId ) != KErrNotFound )
- {
- TInt param = aStmt.ParameterIndex( KSQLId );
- TInt32 id( 0);
- User::LeaveIfError( GetProperty( KId, id ));
- BindIntL( aStmt, param, id );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPLiwMap::IsGetListAllL( TUint aFilter ) const
- {
- TBool result( EFalse );
- if ( !( aFilter & EContentType ) &&
- !( aFilter & EContentId ) &&
- !( aFilter & EPublisher ) )
- {
- result = ETrue;
- }
- else if ( ( aFilter & EContentType ) &&
- ( aFilter & EContentId ) &&
- ( aFilter & EPublisher ) )
- {
- RBuf publisher;
- publisher.CleanupClosePushL();
- RBuf content_type;
- content_type.CleanupClosePushL();
- RBuf content_id;
- content_id.CleanupClosePushL();
- GetPropertyL( KPublisherId, publisher );
- GetPropertyL( KContentType, content_type );
- GetPropertyL( KContentId, content_id );
-
- if( ( publisher == KAll ) &&
- ( content_type == KAll ) &&
- ( content_id == KAll) )
- {
- result = ETrue;
- }
- CleanupStack::PopAndDestroy( &content_id );
- CleanupStack::PopAndDestroy( &content_type );
- CleanupStack::PopAndDestroy( &publisher );
- }
- return result;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::RemoveAllAttributeL( TUint& aFilter ) const
- {
- RBuf publisher;
- publisher.CleanupClosePushL();
- RBuf content_type;
- content_type.CleanupClosePushL();
- RBuf content_id;
- content_id.CleanupClosePushL();
- GetPropertyL( KPublisherId, publisher );
- GetPropertyL( KContentType, content_type );
- GetPropertyL( KContentId, content_id );
-
- if( publisher == KAll )
- {
- iMap->Remove( KPublisherId );
- aFilter = aFilter & ~EPublisher;
- }
- if( content_type == KAll )
- {
- iMap->Remove( KContentType );
- aFilter = aFilter & ~EContentType;
- }
- if( content_id == KAll )
- {
- iMap->Remove( KContentId );
- aFilter = aFilter & ~EContentId;
- }
-
- CleanupStack::PopAndDestroy( &content_id );
- CleanupStack::PopAndDestroy( &content_type );
- CleanupStack::PopAndDestroy( &publisher );
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::ConstructL()
- {
- iMap = CLiwGenericParamList::NewL( );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::CheckIdentifiersL() const
- {
- IsPublisherNameL();
- IsContentTypeL();
- IsContentIdL();
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::BindTextL(RSqlStatement& aStmt, TInt aParameterIndex,
- const TDesC& aParameterText) const
- {
- User::LeaveIfError( aParameterIndex );
- User::LeaveIfError( aStmt.BindText( aParameterIndex, aParameterText ) );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::BindBinaryL(RSqlStatement& aStmt, TInt aParameterIndex,
- const TDesC8& aParameterData) const
- {
- User::LeaveIfError(aParameterIndex);
- User::LeaveIfError(aStmt.BindBinary(aParameterIndex, aParameterData));
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::BindInt64L(RSqlStatement& aStmt, TInt aParameterIndex,
- TInt64 aParameterValue) const
- {
- User::LeaveIfError(aParameterIndex);
- User::LeaveIfError(aStmt.BindInt64(aParameterIndex, aParameterValue));
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPLiwMap::BindIntL(RSqlStatement& aStmt, TInt aParameterIndex,
- TInt aParameterValue) const
- {
- User::LeaveIfError(aParameterIndex);
- User::LeaveIfError(aStmt.BindInt(aParameterIndex, aParameterValue));
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CCPLiwMap::ColumnIndexL(RSqlStatement& aStmt, const TDesC& aColumnName )
- const
- {
- TInt ret( aStmt.ColumnIndex( aColumnName ) );
- User::LeaveIfError( ret );
- return ret;
- }
-
-
-
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpsecuritypolicy.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,372 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ?Description
- * Version : %version: ou1s60ui#5.1.2 % << Don't touch! Updated by Synergy at check-out.
- *
-*/
-
-
-#include <s32mem.h>
-#include <liwcommon.h>
-#include <e32std.h>
-
-#include "cpsecuritypolicy.h"
-#include "cpdebug.h"
-#include "cpglobals.h"
-
-_LIT( KHex, "0x" );
-_LIT( KTCB, "TCB" );
-_LIT( KLocalServices, "LocalServices" );
-_LIT( KLocation, "Location" );
-_LIT( KNetworkServices, "NetworkServices" );
-_LIT( KReadUserData, "ReadUserData" );
-_LIT( KUserEnvironment, "UserEnvironment" );
-_LIT( KWriteUserData, "WriteUserData" );
-_LIT( KAllFiles, "AllFiles" );
-_LIT( KCommDD, "CommDD" );
-_LIT( KDiskAdmin, "DiskAdmin" );
-_LIT( KDrm, "Drm" );
-_LIT( KMultimediaDD, "MultimediaDD" );
-_LIT( KNetworkControl, "NetworkControl" );
-_LIT( KPowerMgmt, "PowerMgmt" );
-_LIT( KProtServ, "ProtServ" );
-_LIT( KReadDeviceData, "ReadDeviceData" );
-_LIT( KSurroundingsDD, "SurroundingsDD" );
-_LIT( KSwEvent, "SwEvent" );
-_LIT( KTrustedUI, "TrustedUI" );
-_LIT( KWriteDeviceData, "WriteDeviceData" );
-
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPSecurityPolicy::CCPSecurityPolicy( const RMessage2& aMessage ):
- iMessage( aMessage )
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPSecurityPolicy::ConstructL()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPSecurityPolicy* CCPSecurityPolicy::NewL( const RMessage2& aMessage )
- {
- CCPSecurityPolicy* self = CCPSecurityPolicy::NewLC( aMessage );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPSecurityPolicy* CCPSecurityPolicy::NewLC( const RMessage2& aMessage )
- {
- CCPSecurityPolicy* self = new( ELeave ) CCPSecurityPolicy( aMessage );
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPSecurityPolicy::~CCPSecurityPolicy()
- {
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPSecurityPolicy::GetDefaultSecurityL( RBuf8& aResult ) const
- {
- CLiwDefaultMap* aclMap = CLiwDefaultMap::NewLC();
- CLiwDefaultMap* writeMap = CLiwDefaultMap::NewLC();
- CLiwDefaultMap* deleteMap = CLiwDefaultMap::NewLC();
-
- TUint32 publisherUid = iMessage.SecureId();
-
- TBuf<10> uidString;
- uidString.Append( KHex );
- uidString.AppendNumFixedWidth(publisherUid,EHex,8);
-
- writeMap->InsertL( KUIDs, TLiwVariant( uidString ) );
- deleteMap->InsertL( KUIDs, TLiwVariant( uidString ) );
-
- aclMap->InsertL( KACLWrite, TLiwVariant( writeMap ) );
- aclMap->InsertL( KACLDelete, TLiwVariant( deleteMap ) );
-
- //externalize
- aResult.CreateL( aclMap->Size() );
- RDesWriteStream strm( aResult );
- CleanupClosePushL( strm );
- aclMap->ExternalizeL( strm );
- strm.CommitL( );
-
- CleanupStack::PopAndDestroy( &strm );
- CleanupStack::PopAndDestroy( deleteMap );
- CleanupStack::PopAndDestroy( writeMap );
- CleanupStack::PopAndDestroy( aclMap );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPSecurityPolicy::CheckSecurityL( TPtrC8& aBinary,
- TACLPolicy aPolicy ) const
- {
- TBool error( ETrue );
- RDesReadStream datastrm( aBinary );
- CleanupClosePushL( datastrm );
- CLiwDefaultMap* map = CLiwDefaultMap::NewLC( datastrm );
- TLiwVariant variant;
- variant.PushL();
- switch( aPolicy )
- {
- case ERead:
- if( map->FindL( KACLRead, variant ) )
- {
- error = DoCheckSecurityL( variant.AsMap() );
- }
- break;
- case EWrite:
- if( map->FindL( KACLWrite, variant ) )
- {
- error = DoCheckSecurityL( variant.AsMap() );
- }
- break;
- case EDelete:
- if( map->FindL( KACLDelete, variant ) )
- {
- error = DoCheckSecurityL( variant.AsMap() );
- }
- break;
- default:
- User::Leave( KErrNotSupported );
- }
- CleanupStack::PopAndDestroy( &variant );
- CleanupStack::PopAndDestroy( map );
- CleanupStack::PopAndDestroy( &datastrm );
- return error;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPSecurityPolicy::DoCheckSecurityL( const CLiwMap* aMap ) const
- {
- TLiwVariant variant;
- variant.PushL();
- TBool denyAccess( ETrue );
- if( aMap->FindL( KUIDs, variant ) )
- {
- TPtrC uidList( KNullDesC );
- if( variant.Get( uidList) )
- {
- denyAccess = CheckUids( uidList );
- }
- }
- if( denyAccess && aMap->FindL( KCapability, variant ) )
- {
- TPtrC capList( KNullDesC );
- if( variant.Get( capList ) )
- {
- denyAccess = CheckCapabilities( capList );
- }
- }
- CleanupStack::PopAndDestroy( &variant );
- return !denyAccess;
- }
-
- // ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPSecurityPolicy::CheckUids( const TDesC& aList ) const
- {
- TInt i( 1 );
- TBool denyAccess( ETrue );
- TPtrC singleUid( KNullDesC );
- while( i )
- {
- ExctractNextToken( aList , singleUid, i );
- TLex converter( singleUid );
- converter.Inc( KHex().Length() );
- TUint32 aclUid( 0 );
- converter.Val( aclUid , EHex );
- if( iMessage.SecureId().iId == aclUid )
- {
- denyAccess = EFalse;
- break;
- }
- ++i;
- }
- return denyAccess;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CCPSecurityPolicy::CheckCapabilities( const TDesC& aList ) const
- {
- TInt i( 1 );
- TBool denyAccess( EFalse );
- TPtrC singleCap( KNullDesC );
- while( i )
- {
- ExctractNextToken( aList , singleCap, i );
- if( !iMessage.HasCapability( GetCapability( singleCap ) ) )
- {
- denyAccess = ETrue;
- break;
- }
- ++i;
- }
- return denyAccess;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPSecurityPolicy::ExctractNextToken( const TDesC& aList,
- TPtrC& aResult , TInt& aPos ) const
- {
- TPtrC buf( aList );
- for( TInt x(0); x < aPos; x++ )
- {
- TInt pos = buf.Locate(':');
- if( pos!= KErrNotFound )
- {
- aResult.Set( buf.Left( pos ) );
- buf.Set( buf.Right( buf.Length() - pos - 1 ) );
- }
- else
- {
- aResult.Set( buf );
- aPos = -1;
- break;
- }
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TCapability CCPSecurityPolicy::GetCapability( const TDesC& aCapability ) const
- {
- TCapability ret( ECapability_None );
- if( aCapability == KTCB )
- {
- ret = ECapabilityTCB;
- }
- else if( aCapability == KLocalServices )
- {
- ret = ECapabilityLocalServices;
- }
- else if( aCapability == KLocation )
- {
- ret = ECapabilityLocation;
- }
- else if( aCapability == KNetworkServices )
- {
- ret = ECapabilityNetworkServices;
- }
- else if( aCapability == KReadUserData )
- {
- ret = ECapabilityReadUserData;
- }
- else if( aCapability == KUserEnvironment )
- {
- ret = ECapabilityUserEnvironment;
- }
- else if( aCapability == KWriteUserData )
- {
- ret = ECapabilityWriteUserData;
- }
- else if( aCapability == KAllFiles )
- {
- ret = ECapabilityAllFiles;
- }
- else if( aCapability == KDiskAdmin )
- {
- ret = ECapabilityDiskAdmin;
- }
- else if( aCapability == KCommDD )
- {
- ret = ECapabilityCommDD;
- }
- else if( aCapability == KDrm )
- {
- ret = ECapabilityDRM;
- }
- else if( aCapability == KMultimediaDD )
- {
- ret = ECapabilityMultimediaDD;
- }
- else if( aCapability == KNetworkControl )
- {
- ret = ECapabilityNetworkControl;
- }
- else if( aCapability == KPowerMgmt )
- {
- ret = ECapabilityPowerMgmt;
- }
- else if( aCapability == KProtServ )
- {
- ret = ECapabilityProtServ;
- }
- else if( aCapability == KReadDeviceData )
- {
- ret = ECapabilityReadDeviceData;
- }
- else if( aCapability == KSurroundingsDD )
- {
- ret = ECapabilitySurroundingsDD;
- }
- else if( aCapability == KSwEvent )
- {
- ret = ECapabilitySwEvent;
- }
- else if( aCapability == KTrustedUI )
- {
- ret = ECapabilityTrustedUI;
- }
- else if( aCapability == KWriteDeviceData )
- {
- ret = ECapabilityWriteDeviceData;
- }
- else ret = ECapability_None;
- return ret;
- }
-
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpublisherregistrymap.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,550 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ?Description
- *
-*/
-
-
-#include <liwcommon.h>
-
-#include "cpserverdef.h"
-#include "cpublisherregistrymap.h"
-#include "cpglobals.h"
-#include "cpdebug.h"
-#include "cpssqlcommands.h"
-#include "cpsecuritypolicy.h"
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-
-CPublisherRegistryMap::CPublisherRegistryMap()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CPublisherRegistryMap::ConstructL()
- {
- CCPLiwMap::ConstructL( );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CPublisherRegistryMap* CPublisherRegistryMap::NewL( )
- {
- CPublisherRegistryMap* self = CPublisherRegistryMap::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CPublisherRegistryMap* CPublisherRegistryMap::NewLC( )
- {
- CPublisherRegistryMap* self = new (ELeave) CPublisherRegistryMap();
- self->PushL();
- self->ConstructL( );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CPublisherRegistryMap::~CPublisherRegistryMap()
- {
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt32 CPublisherRegistryMap::AddL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList ) const
- {
- CP_DEBUG( _L8("CPublisherRegistryMap::AddL") );
- TInt32 id( 0);
- if ( !GetProperty( KId, id ) )
- {
- FetchIdL( aSqlDb, KSQLFetchIdFromRegistry, id );
- }
- if ( id )
- {
- UpdateL( aSqlDb, id , aNotificationList );
- }
- else
- {
- id = AddToDbL( aSqlDb , aNotificationList );
- }
- return id;
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TUint CPublisherRegistryMap::GetListL( RSqlDatabase aSqlDb,
- CLiwGenericParamList* aList, RArray<TInt32>& aItemsToDelete ) const
- {
- CP_DEBUG( _L8("CPublisherRegistryMap::GetListL") );
- aItemsToDelete.Reset( ); //no items to delete
- return CCPLiwMap::GetListL( aSqlDb, KSQLGetListFromRegistry, aList,
- aItemsToDelete );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CPublisherRegistryMap::RemoveL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList ) const
- {
- CP_DEBUG( _L8("CContentMap::RemoveL") );
- //get ids of items to be deleted
- GetIdsOfRemovedEntriesL( aSqlDb, KSQLGetIdsRegistry, aNotificationList );
- CCPLiwMap::RemoveL( aSqlDb, KSQLDeleteFromRegistry );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CPublisherRegistryMap::SaveQueryResultsL( RSqlStatement& aStmt,
- CLiwGenericParamList& aList, RArray<TInt32>& /*aItemsToDelete*/) const
- {
- CP_DEBUG( _L8("CPublisherRegistryMap::SaveQueryResultsL") );
- TInt idIndex = ColumnIndexL( aStmt, KColumnId );
- TInt publisherIndex = ColumnIndexL( aStmt, KColumnPublisher );
- TInt contentIndex = ColumnIndexL( aStmt, KColumnContent_type );
- TInt content_idIndex = ColumnIndexL( aStmt, KColumnContent_id );
- TInt flagIndex = ColumnIndexL( aStmt, KColumnFlag );
- TInt acl_Index = ColumnIndexL( aStmt, KColumnAccessList );
- TInt data_Index = ColumnIndexL( aStmt, KColumnData );
- TInt action_Index = ColumnIndexL( aStmt, KColumnAction );
-
- TBool aclCheckFailed( EFalse );
- while ( aStmt.Next( ) == KSqlAtRow )
- {
- TBool securityOk(EFalse);
- if( iPolicy )
- {
- TPtrC8 acl;
- User::LeaveIfError( aStmt.ColumnBinary( acl_Index, acl ) );
- securityOk = iPolicy->CheckSecurityL( acl ,
- CCPSecurityPolicy::ERead );
- if ( !securityOk )
- {
- aclCheckFailed = ETrue;
- }
- }
-
- if( !iPolicy || securityOk )
- {
- TInt32 id = aStmt.ColumnInt( idIndex ) ;
- TPtrC publisher;
- User::LeaveIfError( aStmt.ColumnText( publisherIndex,
- publisher ) );
- TPtrC content_type;
- User::LeaveIfError( aStmt.ColumnText( contentIndex,
- content_type ) );
- TPtrC content_id;
- User::LeaveIfError( aStmt.ColumnText( content_idIndex,
- content_id ));
- TInt32 flag_db = aStmt.ColumnInt( flagIndex );
- TInt32 flag_map(0);
-
- TUint filter = GetFilterL();
- GetProperty( KFlag, flag_map );
-
- if (!(filter & EFlag) || ( (flag_db & flag_map)==flag_map))
- {
- CLiwDefaultMap* targetMap = CLiwDefaultMap::NewLC();
- targetMap->InsertL( KId , TLiwVariant( id ) );
- targetMap->InsertL( KPublisherId , TLiwVariant( publisher ) );
- targetMap->InsertL( KContentType , TLiwVariant( content_type ) );
- targetMap->InsertL( KContentId , TLiwVariant( content_id ) );
- targetMap->InsertL( KFlag , TLiwVariant( flag_db ) );
- TPtrC8 data;
- User::LeaveIfError( aStmt.ColumnBinary( data_Index, data ) );
- TPtrC8 action;
- User::LeaveIfError( aStmt.ColumnBinary( action_Index, action ) );
- if( data.Ptr() )
- {
- targetMap->InsertL( KDataMap , TLiwVariant( data ) );
- }
- if( action.Ptr() )
- {
- targetMap->InsertL( KActionMap , TLiwVariant( action ) );
- }
- TLiwGenericParam result( KListMap, TLiwVariant( targetMap ));
- aList.AppendL( result );
- CleanupStack::PopAndDestroy( targetMap );
- }
- }//if
- }//while
- //leave only if ACL security check for all items failed
- if ( aclCheckFailed && !aList.Count())
- {
- User::Leave( KErrPermissionDenied );
- }
- }
-
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt32 CPublisherRegistryMap::AddToDbL( RSqlDatabase aSqlDb,
- CLiwDefaultList* aNotificationList ) const
- {
- CP_DEBUG( _L8("CPublisherRegistryMap::AddToDbL") );
- RSqlStatement stmt;
- CleanupClosePushL( stmt );
- PrepareStmtforAddL( aSqlDb, stmt, KSQLInsertToRegistry );
-
- TInt dataIndex = stmt.ParameterIndex( KSQLData );
- TInt actionIndex = stmt.ParameterIndex( KSQLAction );
- TInt aclIndex = stmt.ParameterIndex( KSQLAccessList );
-
- RBuf8 data;
- data.CleanupClosePushL();
- GetPropertyL( KDataMap, data ) ;
- BindBinaryL( stmt, dataIndex, data );
- RBuf8 action;
- action.CleanupClosePushL();
- GetPropertyL( KActionMap, action ) ;
- BindBinaryL( stmt, actionIndex, action );
-
- RBuf8 acl;
- acl.CleanupClosePushL();
- if( !GetPropertyL( KAccessList , acl ) )
- {
- iPolicy->GetDefaultSecurityL( acl );
- }
- BindBinaryL( stmt, aclIndex, acl );
-
- if ( stmt.Exec( ) <= 0 )
- {
- User::Leave( KErrGeneral );
- }
-
- TSqlScalarFullSelectQuery id_query(aSqlDb);
- TInt32 ret( 0);
- ret = id_query.SelectIntL( KSQLGetLastInsertId );
-
- if ( aNotificationList )
- {
- RBuf publisher;
- publisher.CleanupClosePushL();
- RBuf contentType;
- contentType.CleanupClosePushL();
- RBuf contentId;
- contentId.CleanupClosePushL();
- GetPropertyL( KPublisherId, publisher ) ;
- GetPropertyL( KContentType, contentType );
- GetPropertyL( KContentId, contentId );
- CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC( );
- changeInfoMap->InsertL( KId, TLiwVariant( ret ) );
- changeInfoMap->InsertL( KType, TLiwVariant( KPublisher ) );
- changeInfoMap->InsertL( KPublisherId, TLiwVariant( publisher ) );
- changeInfoMap->InsertL( KContentType, TLiwVariant( contentType ) );
- changeInfoMap->InsertL( KContentId, TLiwVariant( contentId ) );
- changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationAdd ) );
- TInt32 flag( 0 );
- GetProperty( KFlag, flag );
- changeInfoMap->InsertL( KFlag, TLiwVariant( flag ) );
- aNotificationList->AppendL( TLiwVariant( changeInfoMap ) );
- CleanupStack::PopAndDestroy( changeInfoMap ) ;
- CleanupStack::PopAndDestroy( &contentId ) ;
- CleanupStack::PopAndDestroy( &contentType ) ;
- CleanupStack::PopAndDestroy( &publisher ) ;
- }
-
- CleanupStack::PopAndDestroy( &acl );
- CleanupStack::PopAndDestroy( &action );
- CleanupStack::PopAndDestroy( &data );
- CleanupStack::PopAndDestroy( &stmt ) ;
-
- return ret;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CPublisherRegistryMap::AppendFilterL( RBuf& aQuery,
- TUint& aFilter ) const
- {
- CP_DEBUG( _L8("CPublisherRegistryMap::AppendFilterL") );
- if( aFilter & EFlag )
- {
- aQuery.ReAllocL( aQuery.Length() + KSQLGetFlag().Length() +
- KWhere().Length() );
- aQuery.Append( KWhere );
- aQuery.Append( KSQLGetFlag );
- }
- else
- {
- CCPLiwMap::AppendFilterL( aQuery, aFilter );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CPublisherRegistryMap::AppendSortL( RBuf& aQuery,
- const TCPSortOrder& aSort ) const
- {
- CP_DEBUG( _L8("CPublisherRegistryMap::AppendSortL") );
- switch ( aSort )
- {
- case ECPContentId:
- aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderContentId().Length( ) );
- aQuery.Append( KSQLOrderContentId );
- break;
- case ECPContent:
- aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderContent().Length( ) );
- aQuery.Append( KSQLOrderContent );
- break;
- case ECPPublisher:
- aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderPublisher().Length( ) );
- aQuery.Append( KSQLOrderPublisher );
- break;
- default:
- aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderRecent().Length( ) );
- aQuery.Append( KSQLOrderRecent );
- break;
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CPublisherRegistryMap::PrepareStmtforAddL( RSqlDatabase aSqlDb,
- RSqlStatement& aStmt ,
- const TDesC& aQuery ) const
- {
- CP_DEBUG( _L8("CPublisherRegistryMap::PrepareStmtforAddL") );
- CCPLiwMap::PrepareStmtforAddL( aSqlDb,aStmt,aQuery);
- TInt32 flag( 0x00000000 );
- GetProperty( KFlag, flag );
- TInt flagIndex = aStmt.ParameterIndex( KSQLFlag );
- if (flagIndex != KErrNotFound)
- {
- BindIntL( aStmt, flagIndex , flag );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CPublisherRegistryMap::PrepareStmtforUpdateL( RSqlDatabase aSqlDb,
- RSqlStatement& aStmt, TInt32 aId ) const
- {
- CP_DEBUG( _L8("CPublisherRegistryMap::PrepareStmtforUpdateL") );
- TInt32 flag;
- TBool isFlagInfo = GetProperty( KFlag, flag );
-
- TBool isParameter(EFalse);
- RBuf query;
- query.CleanupClosePushL();
- query.CreateL( KSQLUpdateRegistry().Length( ) );
- query.Append( KSQLUpdateRegistry );
- RBuf8 data;
- data.CleanupClosePushL();
- if ( GetPropertyL( KDataMap, data ) )
- {
- query.ReAllocL( query.Length( ) + KSQLUpdateData().Length( ) );
- query.Append( KSQLUpdateData );
- isParameter = ETrue;
- }
- RBuf8 action;
- action.CleanupClosePushL();
- if ( GetPropertyL( KActionMap, action ) )
- {
- if ( isParameter )
- {
- query.ReAllocL( query.Length( ) + KComma().Length( ) );
- query.Append( KComma );
- }
- query.ReAllocL( query.Length( ) + KSQLUpdateAction().Length( ) );
- query.Append( KSQLUpdateAction );
- isParameter = ETrue;
- }
- if( isFlagInfo )
- {
- if(isParameter)
- {
- query.ReAllocL( query.Length() + KComma().Length());
- query.Append( KComma );
- }
- query.ReAllocL( query.Length() + KSQLUpdateFlag().Length());
- query.Append( KSQLUpdateFlag );
- isParameter = ETrue;
- }
- if( !isParameter ) User::Leave( KErrPathNotFound );
- query.ReAllocL( query.Length( ) + KSQLUpdateWhere().Length( ) );
- query.Append( KSQLUpdateWhere );
- User::LeaveIfError( aStmt.Prepare( aSqlDb, query ) );
- TInt dataId = aStmt.ParameterIndex( KSQLId );
- BindIntL( aStmt, dataId, aId );
-
- if ( data.Length( ) )
- {
- TInt dataIndex = aStmt.ParameterIndex( KSQLData );
- BindBinaryL( aStmt,dataIndex, data );
- }
- if ( action.Length( ) )
- {
- TInt actionIndex = aStmt.ParameterIndex( KSQLAction );
- BindBinaryL( aStmt, actionIndex, action );
- }
- if( isFlagInfo )
- {
- TInt flagIndex = aStmt.ParameterIndex( KSQLFlag );
- BindIntL( aStmt, flagIndex , flag );
- }
- CleanupStack::PopAndDestroy( &action );
- CleanupStack::PopAndDestroy( &data );
- CleanupStack::PopAndDestroy( &query );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CPublisherRegistryMap::UpdateL( RSqlDatabase aSqlDb, TInt32 aId,
- CLiwDefaultList* aNotificationList) const
- {
- CP_DEBUG( _L8("CPublisherRegistryMap::UpdateL") );
- RSqlStatement stmt;
- CleanupClosePushL( stmt );
- CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC( );
- FetchIdsL( aId, KSQLFetchIdsFromRegistry, changeInfoMap, aSqlDb );
- if ( aNotificationList )
- {
- changeInfoMap->InsertL( KType, TLiwVariant( KPublisher ) );
- TInt32 flag( 0 );
- GetProperty( KFlag, flag );
- changeInfoMap->InsertL( KFlag, TLiwVariant( flag ) );
- aNotificationList->AppendL( TLiwVariant( changeInfoMap ) );
- }
- CleanupStack::PopAndDestroy( changeInfoMap ) ;
- PrepareStmtforUpdateL( aSqlDb, stmt, aId );
- if ( stmt.Exec( ) <= 0 )
- {
- User::Leave( KErrNotFound );
- }
- CleanupStack::PopAndDestroy( &stmt ) ;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CPublisherRegistryMap::IsValidForDeleteL() const
- {
- TInt err( KErrNone );
- TInt32 id( 0 );
- if( GetProperty( KId, id ) && ( id < 1 ) )
- {
- err = KErrArgument;
- }
- else if( !IsId() && PropertyExists( KId ) )
- {
- err = KErrBadName;
- }
-
- if( err == KErrNone && !IsFlag() && !IsId( ) && !( IsPublisherNameL( )
- || IsContentTypeL( ) || IsContentIdL() ) )
- {
- err = KErrPathNotFound;
- }
-
- if( err != KErrNone )
- {
- User::Leave( err );
- }
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CPublisherRegistryMap::IsValidForGetListL() const
- {
- TInt err( KErrNone );
- TInt32 id( 0 );
- if( GetProperty( KId, id ) && ( id < 1 ) )
- {
- err = KErrArgument;
- }
- else if( !IsId() && PropertyExists( KId ) )
- {
- err = KErrBadName;
- }
-
- if( err != KErrNone )
- {
- User::Leave( err );
- }
- }
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CPublisherRegistryMap::ActivateActionSupport( ) const
- {
- return ETrue;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TBool CPublisherRegistryMap::GetActivateInfo( ) const
- {
- TInt32 flag;
- GetProperty( KFlag, flag );
- TBool activate = flag & EActivate;
- return activate;
- }
-
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CPublisherRegistryMap::FillChangeInfoMapL( RSqlStatement& aStmt,
- CLiwDefaultMap* aMap )const
- {
- CCPLiwMap::FillChangeInfoMapL(aStmt, aMap);
- TInt flagIndex = ColumnIndexL( aStmt, KColumnFlag );
- TInt32 flag_db = aStmt.ColumnInt( flagIndex );
- aMap->InsertL( KFlag , TLiwVariant( flag_db ) );
- }
-
--- a/contentpublishingsrv/contentpublishingutils/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for Content Publisher Utils
-*
-*/
-
-
-
-PRJ_PLATFORMS
-
-DEFAULT
-
-
-PRJ_EXPORTS
-../contentpublishingdebug/inc/cpdebug.h |../../../inc/cpdebug.h
-
-
-PRJ_MMPFILES
-#include "../contentpublishingmap/group/bld.inf"
-#include "../pluginvalidator/group/bld.inf"
-
-// End of File
--- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/bwins/pluginvalidatoru.def Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-EXPORTS
- ?GetCount@CPluginValidator@@QAEHXZ @ 1 NONAME ; int CPluginValidator::GetCount(void)
- ?GetImplementation@CPluginValidator@@QAEPAXH@Z @ 2 NONAME ; void * CPluginValidator::GetImplementation(int)
- ?GetImplementation@CPluginValidator@@QAEPAXVTUid@@@Z @ 3 NONAME ; void * CPluginValidator::GetImplementation(class TUid)
- ?NewL@CPluginValidator@@SAPAV1@VTUid@@PAX@Z @ 4 NONAME ; class CPluginValidator * CPluginValidator::NewL(class TUid, void *)
- ?NewLC@CPluginValidator@@SAPAV1@VTUid@@PAX@Z @ 5 NONAME ; class CPluginValidator * CPluginValidator::NewLC(class TUid, void *)
- ?NewL@CHarvesterPluginValidator@@SAPAV1@VTUid@@PAX@Z @ 6 NONAME ; class CHarvesterPluginValidator * CHarvesterPluginValidator::NewL(class TUid, void *)
- ?NewLC@CHarvesterPluginValidator@@SAPAV1@VTUid@@PAX@Z @ 7 NONAME ; class CHarvesterPluginValidator * CHarvesterPluginValidator::NewLC(class TUid, void *)
-
--- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/eabi/pluginvalidatoru.def Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-EXPORTS
- _ZN16CPluginValidator17GetImplementationE4TUid @ 1 NONAME
- _ZN16CPluginValidator17GetImplementationEi @ 2 NONAME
- _ZN16CPluginValidator4NewLE4TUidPv @ 3 NONAME
- _ZN16CPluginValidator5NewLCE4TUidPv @ 4 NONAME
- _ZN16CPluginValidator8GetCountEv @ 5 NONAME
- _ZN25CHarvesterPluginValidator4NewLE4TUidPv @ 6 NONAME
- _ZN25CHarvesterPluginValidator5NewLCE4TUidPv @ 7 NONAME
-
--- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for Content Publisher Debug
-*
-*/
-
-// Macro definitions
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-
-DEFAULT
-
-PRJ_EXPORTS
-../inc/cpluginvalidator.h |../../../../inc/cpluginvalidator.h
-
-PRJ_MMPFILES
-pluginvalidator.mmp
-
-
-// End of File
--- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/group/pluginvalidator.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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
-*
-*/
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET pluginvalidator.dll
-TARGETTYPE dll
-
-UID 0x1000008D 0x2001CB6C
-
-CAPABILITY CAP_GENERAL_DLL
-VENDORID VID_DEFAULT
-
-LANG SC
-
-SOURCEPATH ../src
-SOURCE cpluginvalidator.cpp
-SOURCE cblacklisthandler.cpp
-SOURCE charvesterpluginvalidator.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY ecom.lib
-LIBRARY estor.lib
-LIBRARY centralrepository.lib
-//end of file
--- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/cblacklisthandler.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
-* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 CBLACKLISTHANDLER_H_
-#define CBLACKLISTHANDLER_H_
-
-//INCLUDES
-#include <e32base.h>
-
-//FORWARD DECLARATIONS
-class CRepository;
-
-/*
- * Blacklist Handler
- */
-NONSHARABLE_CLASS( CBlacklistHandler ): public CBase
- {
-public:
-
- /**
- * Two-phased constructor.
- *
- */
- static CBlacklistHandler* NewL( );
-
- /**
- * Two-phased constructor.
- *
- */
- static CBlacklistHandler* NewLC( );
-
- /**
- * Desctructor.
- */
- ~CBlacklistHandler();
-
- /*
- * Appends plugin UID to blacklist
- * @param aUid uid of the plugin
- */
- void AppendL( TUid aUid );
-
- /*
- * Removes plugin UID from blacklist
- * @param aUid uid of the plugin
- */
- void RemoveL( TUid aUid );
-
- /*
- * Checks if plugin with provided UID is on the blacklist
- * @param aUid uid of the plugin
- */
- TBool IsPresentL( TUid aUid );
-
- /*
- * Copies blacklist unofficial blacklist to official
- * if flag is set to EFalse and official to unofficial if flag = ETrue
- * @param aUnofficialToOfficial flag indicating which blacklist
- * should be copied
- */
- void CopyBlacklistL( TBool aOfficialToUnofficial );
-
-private:
-
- /**
- * C++ default constructor.
- */
- CBlacklistHandler( );
-
- /**
- * Perform the second phase construction of a CPluginValidator object.
- */
- void ConstructL();
-
- /*
- * Gets blacklist array from CPS
- */
- void GetArrayL( RArray<TUid>& aArray, TBool aOfficial );
-
- /*
- * Stores blacklist array in CPS
- */
- void StoreArrayL( const RArray<TUid>& aArray, TBool aOfficial );
-
-private:
-
- /**
- * Provides access to repository
- * Own
- */
- CRepository* iRepository;
- };
-
-#endif /* CBLACKLISTHANDLER_H_ */
--- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/charvesterpluginvalidator.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
-* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 CHARVESTERPLUGINVALIDATOR_H
-#define CHARVESTERPLUGINVALIDATOR_H
-
-// INCLUDES
-#include <e32base.h>
-#include <e32hashtab.h>
-#include "cpluginvalidator.h"
-
-// FORWARD DECLARATIONS
-class CBlacklistHandler;
-
-//CONSTS
-//PubSub Category AI plug-in registry API
-const TUid KPSUidActiveIdle2 = {0x102750F0}; // ActiveIdle2 SID
-// Indicates that all the CPS Harvester plugins have been updated
-const TUint KActiveIdleCpsPluginsUpdated = 0x0000000C;
-enum EPSActiveIdleCpsPluginsUpdated
- {
- EPSAiPluginsNotUpdated = 0,
- EPSAiPluginsUpdated
- };
-
-/**
- * Class used to maintain required ECOM plugins implementations
- *
- *
- * @lib cpclient.dll
- * @since S60 v 5.0
- */
-NONSHARABLE_CLASS( CHarvesterPluginValidator ): public CPluginValidator
- {
-public:
-
- /**
- * Two-phased constructor.
- *
- */
- IMPORT_C static CHarvesterPluginValidator* NewL( TUid aUid,
- TAny *aParameter = NULL );
-
- /**
- * Two-phased constructor.
- *
- */
- IMPORT_C static CHarvesterPluginValidator* NewLC( TUid aUid,
- TAny *aParameter = NULL );
-
- /**
- * Desctructor.
- */
- ~CHarvesterPluginValidator();
-
-
-private:
-
- /**
- * C++ default constructor.
- */
- CHarvesterPluginValidator( TUid aUid, TAny *aParameter );
-
- /**
- * Perform the second phase construction of a CPluginValidator object.
- */
- void ConstructL();
-
- /**
- * Loads or destroys plugins
- */
- void ManagePluginsL();
-
- /**
- * Loads ECOM plugins
- */
- void LoadPluginL( TPluginInfo& aPluginInfo );
-
-
-private:
-
- /**
- * Blacklist Handler
- * Own
- */
- CBlacklistHandler* iBlacklist;
-
- /*
- * Startup flag
- *
- */
- TBool iStartup;
-
- /*
- * Property indicating the status of load operation
- * Own
- */
- RProperty iInProgressProperty;
- };
-
-#endif // CHARVESTERPLUGINVALIDATOR_H
--- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/cpluginvalidator.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,195 +0,0 @@
-/*
-* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 CPLUGINVALIDATOR_H
-#define CPLUGINVALIDATOR_H
-
-// INCLUDES
-#include <e32base.h>
-#include <e32hashtab.h>
-#include <ecom/implementationinformation.h>
-
-// FORWARD DECLARATIONS
-class REComSession;
-
-/**
- * Class containing information regarding a plugin
- *
- *
- * @lib cpclient.dll
- * @since S60 v 5.0
- */
-NONSHARABLE_CLASS( TPluginInfo )
- {
-public:
- TAny* iPlugin; // not own
- TUid iImplementationUid;
- TInt iVersion;
- TUid iDtor_ID_Key;
- };
-
-/**
- * Class used to maintain required ECOM plugins implementations
- *
- *
- * @lib cpclient.dll
- * @since S60 v 5.0
- */
-NONSHARABLE_CLASS( CPluginValidator ): public CActive
- {
-public:
-
- /**
- * Two-phased constructor.
- *
- */
- IMPORT_C static CPluginValidator* NewL( TUid aUid,
- TAny *aParameter = NULL );
-
- /**
- * Two-phased constructor.
- *
- */
- IMPORT_C static CPluginValidator* NewLC( TUid aUid,
- TAny *aParameter = NULL );
-
- /**
- * Gets plugin with provided UID
- *
- * @param aUid required plugin
- * @return pointer to plugin implementation
- */
- IMPORT_C TAny* GetImplementation( TUid aUid );
-
- /**
- * Gets plugin with provided index
- *
- * @param aIndex index of plugin
- * @return pointer to plugin implementation
- */
- IMPORT_C TAny* GetImplementation( TInt aIndex );
-
- /**
- * Gets number of plugins
- *
- * @return number of plugins
- */
- IMPORT_C TInt GetCount();
-
- /**
- * Desctructor.
- */
- virtual ~CPluginValidator();
-
-protected:
-
- /**
- * From CActive, RunL.
- * Handles the active object’s request completion event
- */
- void RunL();
-
- /**
- * From CActive, DoCancel.
- * Implements cancellation of an outstanding request.
- */
- void DoCancel();
-
- /**
- * From CActive, RunError.
- * Method called when leave occured in RunL
- */
- TInt RunError( TInt aError );
-
-protected:
-
- /**
- * C++ default constructor.
- */
- CPluginValidator( TUid aUid, TAny *aParameter );
-
- /**
- * Perform the second phase construction of a CPluginValidator object.
- */
- void ConstructL();
-
- /*
- * Checks if plugin is present in an array
- */
- TBool PresentInArrayL( TPluginInfo aPluginInfo,
- const RImplInfoPtrArray& aInfoArray );
-
- /*
- *
- */
- void DestroyPlugin( TInt aIndex );
-
- /**
- * Cleans plugins table;
- */
- void CleanPluginsTable();
-
- /**
- * Loads or destroys plugins
- */
- virtual void ManagePluginsL();
-
- /**
- * Loads ECOM plugins
- */
- virtual void LoadPluginL( TPluginInfo& aPluginInfo );
-
-protected:
-
- /**
- * ECOM handler
- * Own.
- */
- REComSession* iSession;
-
- /**
- * Array containing plugins
- * Own.
- */
- RArray<TPluginInfo> iPluginArray;
-
- /**
- * UID of the interface
- */
- const TUid iUid;
-
- /**
- * Parameter to pass to the object creation method.
- */
- TAny* iParameter;
- };
-
-// ==================== LOCAL FUNCTIONS ====================
-
-/**
-* Identity function to search in an array of TPluginInfo.
-* @param aLeft Search term.
-* @param aRight Array item.
-* @return ETrue if ID-s match.
-*/
-LOCAL_C TBool UidMatch( const TPluginInfo& aLeft, const TPluginInfo& aRight )
- {
- return aLeft.iImplementationUid == aRight.iImplementationUid;
- }
-
-#endif // CPLUGINVALIDATOR_H
--- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/cblacklisthandler.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,227 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 <liwcommon.h>
-#include <s32mem.h>
-#include "cpserverdef.h"
-
-#include "cpglobals.h"
-#include "cblacklisthandler.h"
-#include "centralrepository.h"
-
-
-//CONST
-const TUint32 KOfficialBlacklistCRKey = { 0x1028000A };
-const TUint32 KOfficialBlacklistSizeCRKey = { 0x1028000B };
-const TUint32 KUnofficialBlacklistCRKey = { 0x1028000C };
-const TUint32 KUnoficialBlacklistSizeCRKey = { 0x1028000D };
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-CBlacklistHandler* CBlacklistHandler::NewL( )
- {
- CBlacklistHandler* self = CBlacklistHandler::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-CBlacklistHandler* CBlacklistHandler::NewLC( )
- {
- CBlacklistHandler* self = new( ELeave ) CBlacklistHandler( );
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-CBlacklistHandler::~CBlacklistHandler()
- {
- delete iRepository;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-CBlacklistHandler::CBlacklistHandler( )
- {
-
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CBlacklistHandler::ConstructL()
- {
- iRepository = CRepository::NewL( KServerUid );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CBlacklistHandler::AppendL( TUid aUid )
- {
- RArray<TUid> blacklist;
- CleanupClosePushL( blacklist );
- GetArrayL( blacklist, EFalse ); //unofficial blacklist
- blacklist.AppendL( aUid );
- StoreArrayL( blacklist, EFalse );//unofficial blacklist
- CleanupStack::PopAndDestroy( &blacklist );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CBlacklistHandler::RemoveL( TUid aUid )
- {
- RArray<TUid> blacklist;
- CleanupClosePushL( blacklist );
- GetArrayL( blacklist, EFalse );//from unofficial blacklist
- TInt index = blacklist.Find( aUid );
- if ( index != KErrNotFound )
- {
- blacklist.Remove( index );
- }
- StoreArrayL( blacklist, EFalse );//unofficial blacklist
- CleanupStack::PopAndDestroy( &blacklist );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-TBool CBlacklistHandler::IsPresentL( TUid aUid )
- {
- TBool result(EFalse);
- RArray<TUid> blacklist;
- CleanupClosePushL( blacklist );
- GetArrayL( blacklist, ETrue );// from official blacklist
- TInt index = blacklist.Find( aUid );
- if ( index != KErrNotFound )
- {
- result = ETrue;
- }
- CleanupStack::PopAndDestroy( &blacklist );
- return result;
- }
-
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CBlacklistHandler::GetArrayL( RArray<TUid>& aArray, TBool aOfficial )
- {
- TInt32 repositoryKey( NULL );
- TInt32 repositorySize( NULL );
- if( aOfficial )
- {
- repositorySize = KOfficialBlacklistSizeCRKey;
- repositoryKey = KOfficialBlacklistCRKey;
- }
- else
- {
- repositorySize = KUnoficialBlacklistSizeCRKey;
- repositoryKey = KUnofficialBlacklistCRKey;
- }
-
- TInt size(-1);
- if ( KErrNone == iRepository->Get( repositorySize, size ) )
- {
- RBuf8 serializedBlacklist;
- serializedBlacklist.Create( size );
- CleanupClosePushL( serializedBlacklist );
- if ( KErrNone == iRepository->Get( repositoryKey, serializedBlacklist ) )
- {
- RDesReadStream stream( serializedBlacklist );
- CleanupClosePushL( stream );
- TUint16 count = stream.ReadUint16L();
- for ( TInt i = 0; i < count; i++ )
- {
- aArray.AppendL(TUid::Uid(stream.ReadInt32L()));
- }
- CleanupStack::PopAndDestroy( &stream );
- }
- CleanupStack::PopAndDestroy( &serializedBlacklist );
- }
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CBlacklistHandler::StoreArrayL( const RArray<TUid>& aArray,
- TBool aOfficial )
- {
- TInt32 repositoryKey( NULL );
- TInt32 repositorySize( NULL );
- if( aOfficial )
- {
- repositorySize = KOfficialBlacklistSizeCRKey;
- repositoryKey = KOfficialBlacklistCRKey;
- }
- else
- {
- repositorySize = KUnoficialBlacklistSizeCRKey;
- repositoryKey = KUnofficialBlacklistCRKey;
- }
-
- RBuf8 serializedBlacklist;
- serializedBlacklist.Create( aArray.Count() * sizeof(TInt32) +
- sizeof(TUint16) );
- CleanupClosePushL( serializedBlacklist );
- RDesWriteStream stream( serializedBlacklist );
- CleanupClosePushL( stream );
- stream.WriteUint16L( aArray.Count() );
- for ( TInt i = 0; i< aArray.Count(); i++ )
- {
- stream.WriteInt32L( aArray[i].iUid );
- }
- stream.CommitL();
- if ( KErrNone == iRepository->Set( repositoryKey, serializedBlacklist ) )
- {
- iRepository->Set( repositorySize, serializedBlacklist.Size() );
- }
- CleanupStack::PopAndDestroy( &stream );
- CleanupStack::PopAndDestroy( &serializedBlacklist );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CBlacklistHandler::CopyBlacklistL( TBool aOfficialToUnofficial )
- {
- RArray<TUid> blacklist;
- CleanupClosePushL( blacklist );
- GetArrayL( blacklist, aOfficialToUnofficial );
- StoreArrayL( blacklist, !aOfficialToUnofficial );
- CleanupStack::PopAndDestroy( &blacklist );
- }
-
--- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 <e32property.h>
-#include <ecom/ecom.h>
-#include <mmf/common/mmfcontrollerpluginresolver.h>
-#include <contentharvesterplugin.h> // harvesting plugin
-
-#include "charvesterpluginvalidator.h"
-#include "cblacklisthandler.h"
-
-const TUint32 KInProgressPropertyKey = { 0x1028000E };
-const TUint32 KHarvesterUid = { 0x10282E5A };
-
-// ======== MEMBER FUNCTIONS ========
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-EXPORT_C CHarvesterPluginValidator* CHarvesterPluginValidator::NewL( TUid aUid,
- TAny *aParameter )
- {
- CHarvesterPluginValidator* self =
- CHarvesterPluginValidator::NewLC( aUid , aParameter );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-EXPORT_C CHarvesterPluginValidator* CHarvesterPluginValidator::NewLC( TUid aUid,
- TAny *aParameter )
- {
- CHarvesterPluginValidator* self = new( ELeave )
- CHarvesterPluginValidator( aUid, aParameter );
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-
-
-// ---------------------------------------------------------------------------
-// destructor
-// ---------------------------------------------------------------------------
-CHarvesterPluginValidator::~CHarvesterPluginValidator()
- {
- iInProgressProperty.Close( );
- delete iBlacklist;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-CHarvesterPluginValidator::CHarvesterPluginValidator( TUid aUid, TAny* aParameter ):
- CPluginValidator(aUid, aParameter),
- iStartup( ETrue )
- {
-
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CHarvesterPluginValidator::ConstructL()
- {
- iBlacklist = CBlacklistHandler::NewL( );
- CPluginValidator::ConstructL();
- }
-
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CHarvesterPluginValidator::ManagePluginsL()
- {
- TInt errorCode = iInProgressProperty.Define( TUid::Uid( KHarvesterUid ),
- KInProgressPropertyKey, RProperty::EInt );
-
- if ( KErrAlreadyExists == errorCode )
- {
- TInt value(-1);
- iInProgressProperty.Get( TUid::Uid( KHarvesterUid ),
- KInProgressPropertyKey, value);
- if ( value == 1 )
- {
- // property value == inprogress
- // there was a panic in the previous startup
- // so we make unofficial blacklist official
- iBlacklist->CopyBlacklistL( EFalse );
- }
- }
- else
- {
- User::LeaveIfError( errorCode );
- }
- // copy blacklisted plugins to unoffical blacklist at startup
- iBlacklist->CopyBlacklistL( ETrue );
-
- // set property value to 1 (which means "in progress")
- iInProgressProperty.Set( TUid::Uid( KHarvesterUid ),
- KInProgressPropertyKey, 1 );
-
- CPluginValidator::ManagePluginsL();
-
- if ( iStartup )
- {
- RProperty::Set( KPSUidActiveIdle2,
- KActiveIdleCpsPluginsUpdated , EPSAiPluginsUpdated );
- iStartup = EFalse;
- }
- // set property value to 0 (which means "finished")
- iInProgressProperty.Set( TUid::Uid( KHarvesterUid ),
- KInProgressPropertyKey, 0 );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CHarvesterPluginValidator::LoadPluginL( TPluginInfo& aPluginInfo )
- {
- if ( !iBlacklist->IsPresentL( aPluginInfo.iImplementationUid ) )
- {
- //first we append UID to the blacklist
- iBlacklist->AppendL( aPluginInfo.iImplementationUid );
- TAny* plug ( NULL );
- TInt err( KErrNone );
- TRAP( err, plug = REComSession::CreateImplementationL(
- aPluginInfo.iImplementationUid,
- aPluginInfo.iDtor_ID_Key, iParameter ) );
- if( err==KErrNone && plug )
- {
- TRAP_IGNORE(
- CleanupStack::PushL( plug );
- aPluginInfo.iPlugin = plug;
- iPluginArray.AppendL( aPluginInfo );
- CleanupStack::Pop( plug );
- static_cast<CContentHarvesterPlugin*>( plug )->UpdateL()
- );
- }
- //no panic during load so we can remove UID from blacklist
- iBlacklist->RemoveL( aPluginInfo.iImplementationUid );
- }
- }
-
-
-
-
--- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/cpluginvalidator.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,269 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 <ecom/ecom.h>
-#include <mmf/common/mmfcontrollerpluginresolver.h>
-#include "cpluginvalidator.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-EXPORT_C CPluginValidator* CPluginValidator::NewL( TUid aUid,
- TAny *aParameter )
- {
- CPluginValidator* self = CPluginValidator::NewLC( aUid , aParameter );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-EXPORT_C CPluginValidator* CPluginValidator::NewLC( TUid aUid,
- TAny *aParameter )
- {
- CPluginValidator* self = new( ELeave ) CPluginValidator( aUid,
- aParameter );
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-EXPORT_C TAny* CPluginValidator::GetImplementation( TUid aUid )
- {
- TPluginInfo pluginInfo;
- pluginInfo.iImplementationUid = aUid;
- TInt index = iPluginArray.Find( pluginInfo,
- TIdentityRelation< TPluginInfo >(UidMatch) );
- return GetImplementation( index );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-EXPORT_C TAny* CPluginValidator::GetImplementation( TInt aIndex )
- {
- TAny* ret( NULL );
- if (( aIndex != KErrNotFound ) && ( aIndex < iPluginArray.Count() ))
- {
- ret= iPluginArray[aIndex].iPlugin;
- }
- return ret;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-EXPORT_C TInt CPluginValidator::GetCount( )
- {
- return iPluginArray.Count();
- }
-
-// ---------------------------------------------------------------------------
-// destructor
-// ---------------------------------------------------------------------------
-CPluginValidator::~CPluginValidator()
- {
- Cancel();
- CleanPluginsTable();
- iPluginArray.Close( );
- if( iSession )
- {
- iSession->Close();
- }
- REComSession::FinalClose( );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CPluginValidator::RunL()
- {
- ManagePluginsL();
- iSession->NotifyOnChange( iStatus );
- SetActive();
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CPluginValidator::DoCancel()
- {
- iSession->CancelNotifyOnChange( iStatus );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-TInt CPluginValidator::RunError( TInt /*aError*/)
- {
- return KErrNone;
- }
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-CPluginValidator::CPluginValidator( TUid aUid, TAny* aParameter ):
- CActive(EPriorityStandard),
- iUid( aUid ),
- iParameter( aParameter )
- {
-
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CPluginValidator::ConstructL()
- {
- iSession = &REComSession::OpenL();
- ManagePluginsL();
- iSession->NotifyOnChange( iStatus );
- CActiveScheduler::Add( this );
- SetActive();
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-TBool CPluginValidator::PresentInArrayL( TPluginInfo aPluginInfo,
- const RImplInfoPtrArray& aInfoArray )
- {
- TBool result(EFalse);
- for ( TInt i = 0; i< aInfoArray.Count(); i++ )
- {
- if ( aPluginInfo.iImplementationUid.iUid ==
- aInfoArray[i]->ImplementationUid().iUid)
- {
- result = ETrue;
- break;
- }
- }
- return result;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CPluginValidator::DestroyPlugin( TInt aIndex )
- {
- CBase* plugin = static_cast<CBase*>( iPluginArray[aIndex].iPlugin );
- delete plugin;
- REComSession::DestroyedImplementation(
- iPluginArray[aIndex].iDtor_ID_Key );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CPluginValidator::CleanPluginsTable()
- {
- for ( TInt i = 0; i < iPluginArray.Count(); i++ )
- {
- DestroyPlugin( i );
- }
- }
-
-
-
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CPluginValidator::ManagePluginsL()
- {
- // Read info about all implementations into infoArray
- RImplInfoPtrArray infoArray;
- CleanupResetAndDestroyPushL( infoArray );
-
- REComSession::ListImplementationsL( iUid , infoArray );
- TPluginInfo pluginInfo;
- //Load new plugins
- for ( TInt i = 0; i < infoArray.Count( ); i++ )
- {
- pluginInfo.iImplementationUid = infoArray[i]->ImplementationUid( );
- pluginInfo.iVersion = infoArray[i]->Version();
-
- TInt index = iPluginArray.Find( pluginInfo,
- TIdentityRelation< TPluginInfo >(UidMatch) );
-
- if ( index == KErrNotFound )
- {
- //plugin wasn't present, we load it now
- LoadPluginL( pluginInfo );
- }
- else if ( pluginInfo.iVersion > iPluginArray[index].iVersion )
- {
- //plugin was present but it is a newer version,
- //remove old and load a new one
- DestroyPlugin( index );
- iPluginArray.Remove( index );
- LoadPluginL( pluginInfo );
- }
- }
- //Remove old plugins
- for ( TInt i = iPluginArray.Count() - 1 ; i >= 0; i-- )
- {
- pluginInfo = iPluginArray[i];
- if ( !PresentInArrayL( pluginInfo, infoArray ) )
- {
- DestroyPlugin( i );
- iPluginArray.Remove( i );
- }
- }
- CleanupStack::PopAndDestroy( &infoArray );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CPluginValidator::LoadPluginL( TPluginInfo& aPluginInfo )
- {
- TAny* plug ( NULL );
- TInt err( KErrNone );
- TRAP( err, plug = REComSession::CreateImplementationL(
- aPluginInfo.iImplementationUid,
- aPluginInfo.iDtor_ID_Key, iParameter ) );
- if( err==KErrNone && plug )
- {
- CleanupStack::PushL( plug );
- aPluginInfo.iPlugin = plug;
- iPluginArray.AppendL( aPluginInfo );
- CleanupStack::Pop( plug );
- }
- }
-
--- a/contentpublishingsrv/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build info file for the Content Publisher
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-../rom/contentpublishingservice.iby CORE_MW_LAYER_IBY_EXPORT_PATH(contentpublishingservice.iby)
-
-PRJ_MMPFILES
-#ifdef CONTENT_PUBLISHER_DEBUG
-#include "../contentpublishingutils/contentpublishingdebug/group/bld.inf"
-#endif
-
-#include "../contentpublishingutils/group/bld.inf"
-#include "../contentpublishingserver/group/bld.inf"
-#include "../contentharvester/group/bld.inf"
-
-PRJ_TESTMMPFILES
-
-PRJ_TESTEXPORTS
-
-// End of file
--- a/contentpublishingsrv/rom/contentpublishingservice.iby Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* 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: IBY file for the content publishing
-*
-*/
-
-
-#ifndef CONTENTPUBLISHINGSERVICE_IBY
-#define CONTENTPUBLISHINGSERVICE_IBY
-
-file=ABI_DIR\BUILD_DIR\cpserver.exe SHARED_LIB_DIR\cpserver.exe
-file=ABI_DIR\BUILD_DIR\cpstorage.dll SHARED_LIB_DIR\cpstorage.dll
-file=ABI_DIR\BUILD_DIR\cputils.dll SHARED_LIB_DIR\cputils.dll
-file=ABI_DIR\BUILD_DIR\contentharvesterclient.dll SHARED_LIB_DIR\contentharvesterclient.dll
-file=ABI_DIR\BUILD_DIR\contentharvester.exe SHARED_LIB_DIR\contentharvester.exe
-file=ABI_DIR\BUILD_DIR\pluginvalidator.dll SHARED_LIB_DIR\pluginvalidator.dll
-
-ECOM_PLUGIN(chswiplugin.dll,chswiplugin.rsc)
-ECOM_PLUGIN(chfactorysettingsplugin.dll,chfactorysettingsplugin.rsc)
-
-#ifdef CONTENT_PUBLISHER_DEBUG
-file=ABI_DIR\BUILD_DIR\cpdebug.dll SHARED_LIB_DIR\cpdebug.dll
-#endif // CONTENT_PUBLISHER_DEBUG
-
-data=\epoc32\data\z\private\20016b7b\backup_registration.xml private\20016b7b\backup_registration.xml
-data=\epoc32\data\z\private\10202be9\20016b7b.txt private\10202be9\20016b7b.txt
-
-#endif // CONTENTPUBLISHING_IBY
-
-// End of File
\ No newline at end of file
--- a/contentstorage/bwins/camenuu.def Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/bwins/camenuu.def Fri Apr 30 15:22:08 2010 +0300
@@ -1,24 +1,24 @@
EXPORTS
- ?Find@CCaSrvMmcHistory@@QAEHI@Z @ 1 NONAME ; int CCaSrvMmcHistory::Find(unsigned int)
- ?GetApaAppInfo@CCaSrvEngUtils@@QBEHVTUid@@AAVTApaAppInfo@@@Z @ 2 NONAME ; int CCaSrvEngUtils::GetApaAppInfo(class TUid, class TApaAppInfo &) const
- ?GetAppInfo@CCaSrvEngUtils@@QBEHABVCCaInnerEntry@@AAVTApaAppInfo@@@Z @ 3 NONAME ; int CCaSrvEngUtils::GetAppInfo(class CCaInnerEntry const &, class TApaAppInfo &) const
- ?GetEntriesIdsL@CCaStorageProxy@@QAEXPBVCCaInnerQuery@@AAV?$RArray@H@@@Z @ 4 NONAME ; void CCaStorageProxy::GetEntriesIdsL(class CCaInnerQuery const *, class RArray<int> &)
- ?GetEntriesL@CCaStorageProxy@@QAEXPBVCCaInnerQuery@@AAV?$RPointerArray@VCCaInnerEntry@@@@@Z @ 5 NONAME ; void CCaStorageProxy::GetEntriesL(class CCaInnerQuery const *, class RPointerArray<class CCaInnerEntry> &)
- ?InsertL@CCaSrvMmcHistory@@QAEXI@Z @ 6 NONAME ; void CCaSrvMmcHistory::InsertL(unsigned int)
- ?LoadL@CCaSrvMmcHistory@@QAEXAAVRFs@@ABVTDesC16@@@Z @ 7 NONAME ; void CCaSrvMmcHistory::LoadL(class RFs &, class TDesC16 const &)
- ?NewL@CCaInstallNotifier@@SAPAV1@AAVMCaInstallListener@@W4TNotificationType@1@@Z @ 8 NONAME ; class CCaInstallNotifier * CCaInstallNotifier::NewL(class MCaInstallListener &, enum CCaInstallNotifier::TNotificationType)
- ?OrganizeL@CCaStorageProxy@@QAEXABV?$RArray@H@@VTCaOperationParams@@@Z @ 9 NONAME ; void CCaStorageProxy::OrganizeL(class RArray<int> const &, class TCaOperationParams)
- ?RemoveL@CCaStorageProxy@@QAEXABV?$RArray@H@@@Z @ 10 NONAME ; void CCaStorageProxy::RemoveL(class RArray<int> const &)
- ?RunCaServer@@YAHXZ @ 11 NONAME ; int RunCaServer(void)
- ?SaveL@CCaSrvMmcHistory@@QAEXAAVRFs@@ABVTDesC16@@@Z @ 12 NONAME ; void CCaSrvMmcHistory::SaveL(class RFs &, class TDesC16 const &)
- ?TouchL@CCaStorageProxy@@QAEXPAVCCaInnerEntry@@@Z @ 13 NONAME ; void CCaStorageProxy::TouchL(class CCaInnerEntry *)
- ?GetLocalizationsL@CCaStorageProxy@@QAEXAAV?$RPointerArray@VCCaLocalizationEntry@@@@@Z @ 14 NONAME ; void CCaStorageProxy::GetLocalizationsL(class RPointerArray<class CCaLocalizationEntry> &)
- ?LocalizeEntryL@CCaStorageProxy@@QAEXAAVCCaLocalizationEntry@@@Z @ 15 NONAME ; void CCaStorageProxy::LocalizeEntryL(class CCaLocalizationEntry &)
- ?DbPropertyL@CCaStorageProxy@@QAEXABVTDesC16@@AAVTDes16@@@Z @ 16 NONAME ; void CCaStorageProxy::DbPropertyL(class TDesC16 const &, class TDes16 &)
- ?SetDBPropertyL@CCaStorageProxy@@QAEXABVTDesC16@@0@Z @ 17 NONAME ; void CCaStorageProxy::SetDBPropertyL(class TDesC16 const &, class TDesC16 const &)
- ?AddL@CCaStorageProxy@@QAEXPAVCCaInnerEntry@@H@Z @ 18 NONAME ; void CCaStorageProxy::AddL(class CCaInnerEntry *, int)
+ ?SaveL@CCaSrvMmcHistory@@QAEXAAVRFs@@ABVTDesC16@@@Z @ 1 NONAME ; void CCaSrvMmcHistory::SaveL(class RFs &, class TDesC16 const &)
+ ?GetAppInfo@CCaSrvEngUtils@@QBEHABVCCaInnerEntry@@AAVTApaAppInfo@@@Z @ 2 NONAME ; int CCaSrvEngUtils::GetAppInfo(class CCaInnerEntry const &, class TApaAppInfo &) const
+ ?GetApaAppInfo@CCaSrvEngUtils@@QBEHVTUid@@AAVTApaAppInfo@@@Z @ 3 NONAME ; int CCaSrvEngUtils::GetApaAppInfo(class TUid, class TApaAppInfo &) const
+ ?RemoveL@CCaStorageProxy@@QAEXABV?$RArray@H@@@Z @ 4 NONAME ; void CCaStorageProxy::RemoveL(class RArray<int> const &)
+ ?LocalizeEntryL@CCaStorageProxy@@QAEXAAVCCaLocalizationEntry@@@Z @ 5 NONAME ; void CCaStorageProxy::LocalizeEntryL(class CCaLocalizationEntry &)
+ ?DbPropertyL@CCaStorageProxy@@QAEXABVTDesC16@@AAVTDes16@@@Z @ 6 NONAME ; void CCaStorageProxy::DbPropertyL(class TDesC16 const &, class TDes16 &)
+ ?SetDBPropertyL@CCaStorageProxy@@QAEXABVTDesC16@@0@Z @ 7 NONAME ; void CCaStorageProxy::SetDBPropertyL(class TDesC16 const &, class TDesC16 const &)
+ ?LoadDataBaseFromRomL@CCaStorageProxy@@QAEXXZ @ 8 NONAME ; void CCaStorageProxy::LoadDataBaseFromRomL(void)
+ ?Find@CCaSrvMmcHistory@@QAEHI@Z @ 9 NONAME ; int CCaSrvMmcHistory::Find(unsigned int)
+ ?AddL@CCaStorageProxy@@QAEXPAVCCaInnerEntry@@HW4TItemAppearance@@@Z @ 10 NONAME ; void CCaStorageProxy::AddL(class CCaInnerEntry *, int, enum TItemAppearance)
+ ?NewL@CCaMmcWatcher@@SAPAV1@AAVRFs@@PAVMMmcWatcherCallback@@@Z @ 11 NONAME ; class CCaMmcWatcher * CCaMmcWatcher::NewL(class RFs &, class MMmcWatcherCallback *)
+ ?GetEntriesL@CCaStorageProxy@@QAEXPBVCCaInnerQuery@@AAV?$RPointerArray@VCCaInnerEntry@@@@@Z @ 12 NONAME ; void CCaStorageProxy::GetEntriesL(class CCaInnerQuery const *, class RPointerArray<class CCaInnerEntry> &)
+ ?NewL@CCaInstallNotifier@@SAPAV1@AAVMCaInstallListener@@W4TNotificationType@1@@Z @ 13 NONAME ; class CCaInstallNotifier * CCaInstallNotifier::NewL(class MCaInstallListener &, enum CCaInstallNotifier::TNotificationType)
+ ?InsertL@CCaSrvMmcHistory@@QAEXI@Z @ 14 NONAME ; void CCaSrvMmcHistory::InsertL(unsigned int)
+ ?NewLC@CCaMmcWatcher@@SAPAV1@AAVRFs@@PAVMMmcWatcherCallback@@@Z @ 15 NONAME ; class CCaMmcWatcher * CCaMmcWatcher::NewLC(class RFs &, class MMmcWatcherCallback *)
+ ?TouchL@CCaStorageProxy@@QAEXPAVCCaInnerEntry@@@Z @ 16 NONAME ; void CCaStorageProxy::TouchL(class CCaInnerEntry *)
+ ?LoadL@CCaSrvMmcHistory@@QAEXAAVRFs@@ABVTDesC16@@@Z @ 17 NONAME ; void CCaSrvMmcHistory::LoadL(class RFs &, class TDesC16 const &)
+ ?OrganizeL@CCaStorageProxy@@QAEXABV?$RArray@H@@VTCaOperationParams@@@Z @ 18 NONAME ; void CCaStorageProxy::OrganizeL(class RArray<int> const &, class TCaOperationParams)
?CustomSortL@CCaStorageProxy@@QAEXABV?$RArray@H@@H@Z @ 19 NONAME ; void CCaStorageProxy::CustomSortL(class RArray<int> const &, int)
- ?LoadDataBaseFromRomL@CCaStorageProxy@@QAEXXZ @ 20 NONAME ; void CCaStorageProxy::LoadDataBaseFromRomL(void)
- ?NewL@CCaMmcWatcher@@SAPAV1@AAVRFs@@PAVMMmcWatcherCallback@@@Z @ 21 NONAME ; class CCaMmcWatcher * CCaMmcWatcher::NewL(class RFs &, class MMmcWatcherCallback *)
- ?NewLC@CCaMmcWatcher@@SAPAV1@AAVRFs@@PAVMMmcWatcherCallback@@@Z @ 22 NONAME ; class CCaMmcWatcher * CCaMmcWatcher::NewLC(class RFs &, class MMmcWatcherCallback *)
+ ?GetLocalizationsL@CCaStorageProxy@@QAEXAAV?$RPointerArray@VCCaLocalizationEntry@@@@@Z @ 20 NONAME ; void CCaStorageProxy::GetLocalizationsL(class RPointerArray<class CCaLocalizationEntry> &)
+ ?RunCaServer@@YAHXZ @ 21 NONAME ; int RunCaServer(void)
+ ?GetEntriesIdsL@CCaStorageProxy@@QAEXPBVCCaInnerQuery@@AAV?$RArray@H@@@Z @ 22 NONAME ; void CCaStorageProxy::GetEntriesIdsL(class CCaInnerQuery const *, class RArray<int> &)
--- a/contentstorage/bwins/cautilsu.def Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/bwins/cautilsu.def Fri Apr 30 15:22:08 2010 +0300
@@ -29,71 +29,71 @@
?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 &)
- ?SetFileNameL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 31 NONAME ; void CCaInnerIconDescription::SetFileNameL(class TDesC16 const &)
- ?SetParentId@CCaInnerNotifierFilter@@QAEXH@Z @ 32 NONAME ; void CCaInnerNotifierFilter::SetParentId(int)
- ?SetFlagsOn@CCaInnerQuery@@QAEXI@Z @ 33 NONAME ; void CCaInnerQuery::SetFlagsOn(unsigned int)
- ?SetTypeNames@CCaInnerNotifierFilter@@QAEXPAVCDesC16ArrayFlat@@@Z @ 34 NONAME ; void CCaInnerNotifierFilter::SetTypeNames(class CDesC16ArrayFlat *)
- ?NewLC@CCaLocalizationEntry@@SAPAV1@XZ @ 35 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewLC(void)
- ?NewL@CCaInnerNotifierFilter@@SAPAV1@W4TNotifierType@1@@Z @ 36 NONAME ; class CCaInnerNotifierFilter * CCaInnerNotifierFilter::NewL(enum CCaInnerNotifierFilter::TNotifierType)
- ?GetTableName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 37 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetTableName(void) const
- ?GetFlagsOff@CCaInnerQuery@@QBEIXZ @ 38 NONAME ; unsigned int CCaInnerQuery::GetFlagsOff(void) const
- ?InternalizeL@CCaInnerEntry@@QAEXAAVRReadStream@@@Z @ 39 NONAME ; void CCaInnerEntry::InternalizeL(class RReadStream &)
- ?GetAttributeName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 40 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetAttributeName(void) const
- ?AddAttributeL@CCaInnerQuery@@QAEXABVTDesC16@@0@Z @ 41 NONAME ; void CCaInnerQuery::AddAttributeL(class TDesC16 const &, 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 &)
- ?Exist@RCaEntryAttrArray@@QAEHABVTDesC16@@@Z @ 43 NONAME ; int RCaEntryAttrArray::Exist(class TDesC16 const &)
- ?AddAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@0@Z @ 44 NONAME ; void CCaInnerEntry::AddAttributeL(class TDesC16 const &, class TDesC16 const &)
- ?GetParentId@CCaInnerQuery@@QBEHXZ @ 45 NONAME ; int CCaInnerQuery::GetParentId(void) const
- ?SetDescriptionL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 46 NONAME ; void CCaInnerEntry::SetDescriptionL(class TDesC16 const &)
- ?SetEntryRole@CCaInnerNotifierFilter@@QAEXW4TEntryRole@@@Z @ 47 NONAME ; void CCaInnerNotifierFilter::SetEntryRole(enum TEntryRole)
- ?GetFlagsOn@CCaInnerQuery@@QBEIXZ @ 48 NONAME ; unsigned int CCaInnerQuery::GetFlagsOn(void) const
- ?GetIconId@CCaInnerEntry@@QBEHXZ @ 49 NONAME ; int CCaInnerEntry::GetIconId(void) const
- ?SetIconDataL@CCaInnerEntry@@QAEXABVTDesC16@@00@Z @ 50 NONAME ; void CCaInnerEntry::SetIconDataL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &)
- ?GetEntryRole@CCaInnerNotifierFilter@@QBE?AW4TEntryRole@@XZ @ 51 NONAME ; enum TEntryRole CCaInnerNotifierFilter::GetEntryRole(void) const
- ?GetId@CCaInnerEntry@@QBEHXZ @ 52 NONAME ; int CCaInnerEntry::GetId(void) const
- ?SetEntryTypeNames@CCaInnerQuery@@QAEXPAVCDesC16ArrayFlat@@@Z @ 53 NONAME ; void CCaInnerQuery::SetEntryTypeNames(class CDesC16ArrayFlat *)
- ?GetNotifierType@CCaInnerNotifierFilter@@QBE?AW4TNotifierType@1@XZ @ 54 NONAME ; enum CCaInnerNotifierFilter::TNotifierType CCaInnerNotifierFilter::GetNotifierType(void) const
- ?ExternalizeL@CCaInnerEntry@@QBEXAAVRWriteStream@@@Z @ 55 NONAME ; void CCaInnerEntry::ExternalizeL(class RWriteStream &) const
- ?SetRole@CCaInnerQuery@@QAEXH@Z @ 56 NONAME ; void CCaInnerQuery::SetRole(int)
- ?NewL@CCaLocalizationEntry@@SAPAV1@XZ @ 57 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewL(void)
- ?InternalizeL@CCaInnerNotifierFilter@@QAEXAAVRReadStream@@@Z @ 58 NONAME ; void CCaInnerNotifierFilter::InternalizeL(class RReadStream &)
- ?InternalizeL@RCaIdsArray@@QAEXAAVRReadStream@@@Z @ 59 NONAME ; void RCaIdsArray::InternalizeL(class RReadStream &)
- ?MarshalDataLC@RCaIdsArray@@QBEPAVHBufC8@@XZ @ 60 NONAME ; class HBufC8 * RCaIdsArray::MarshalDataLC(void) const
- ?GetEntryTypeNames@CCaInnerQuery@@QBEPBVCDesC16ArrayFlat@@XZ @ 61 NONAME ; class CDesC16ArrayFlat const * CCaInnerQuery::GetEntryTypeNames(void) const
- ?SetValueL@CCaEntryAttribute@@QAEXABVTDesC16@@@Z @ 62 NONAME ; void CCaEntryAttribute::SetValueL(class TDesC16 const &)
- ?SetSkinIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 63 NONAME ; void CCaInnerIconDescription::SetSkinIdL(class TDesC16 const &)
- ?ExternalizeL@CCaInnerQuery@@QBEXAAVRWriteStream@@@Z @ 64 NONAME ; void CCaInnerQuery::ExternalizeL(class RWriteStream &) const
- ?GetLocalizedString@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 65 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetLocalizedString(void) const
- ?InternalizeL@CCaInnerQuery@@QAEXAAVRReadStream@@@Z @ 66 NONAME ; void CCaInnerQuery::InternalizeL(class RReadStream &)
- ?NewLC@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 67 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewLC(class TDesC16 const &)
- ?GetTypeNames@CCaInnerNotifierFilter@@QBEPAVCDesC16ArrayFlat@@XZ @ 68 NONAME ; class CDesC16ArrayFlat * CCaInnerNotifierFilter::GetTypeNames(void) const
- ?NewL@CCaInnerEntry@@SAPAV1@XZ @ 69 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewL(void)
- ?SetRole@CCaInnerEntry@@QAEXI@Z @ 70 NONAME ; void CCaInnerEntry::SetRole(unsigned int)
- ?NewLC@CCaInnerEntry@@SAPAV1@XZ @ 71 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewLC(void)
- ?SetTableNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 72 NONAME ; void CCaLocalizationEntry::SetTableNameL(class TDesC16 const &)
- ?GetAttributes@CCaInnerEntry@@QBEABVRCaEntryAttrArray@@XZ @ 73 NONAME ; class RCaEntryAttrArray const & CCaInnerEntry::GetAttributes(void) const
- ?GetRowId@CCaLocalizationEntry@@QBEHXZ @ 74 NONAME ; int CCaLocalizationEntry::GetRowId(void) const
- ?NewLC@CCaInnerIconDescription@@SAPAV1@XZ @ 75 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewLC(void)
- ?SetIdsL@CCaInnerQuery@@QAEXABV?$RArray@H@@@Z @ 76 NONAME ; void CCaInnerQuery::SetIdsL(class RArray<int> const &)
- ?SetFlagsOff@CCaInnerQuery@@QAEXI@Z @ 77 NONAME ; void CCaInnerQuery::SetFlagsOff(unsigned int)
- ?Icon@CCaInnerEntry@@QBEPBVCCaInnerIconDescription@@XZ @ 78 NONAME ; class CCaInnerIconDescription const * CCaInnerEntry::Icon(void) const
- ?SetApplicationIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 79 NONAME ; void CCaInnerIconDescription::SetApplicationIdL(class TDesC16 const &)
- ?RemoveAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 80 NONAME ; void CCaInnerEntry::RemoveAttributeL(class TDesC16 const &)
- ?GetRole@CCaInnerEntry@@QBEIXZ @ 81 NONAME ; unsigned int CCaInnerEntry::GetRole(void) const
- ?GetIds@CCaInnerQuery@@QBEABV?$RArray@H@@XZ @ 82 NONAME ; class RArray<int> const & CCaInnerQuery::GetIds(void) const
- ?ExternalizeL@RCaEntriesArray@@QBEXAAVRWriteStream@@@Z @ 83 NONAME ; void RCaEntriesArray::ExternalizeL(class RWriteStream &) const
- ?NewL@CCaInnerQuery@@SAPAV1@XZ @ 84 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewL(void)
- ?SetUid@CCaInnerQuery@@QAEXI@Z @ 85 NONAME ; void CCaInnerQuery::SetUid(unsigned int)
- ?GetDescription@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 86 NONAME ; class RBuf16 const & CCaInnerEntry::GetDescription(void) const
- ?GetRole@CCaInnerQuery@@QBEHXZ @ 87 NONAME ; int CCaInnerQuery::GetRole(void) const
- ?GetEntryTypeName@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 88 NONAME ; class RBuf16 const & CCaInnerEntry::GetEntryTypeName(void) const
- ?NewLC@CCaInnerQuery@@SAPAV1@XZ @ 89 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewLC(void)
- ?SetTextL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 90 NONAME ; void CCaInnerEntry::SetTextL(class TDesC16 const &)
- ?SetParentId@CCaInnerQuery@@QAEXH@Z @ 91 NONAME ; void CCaInnerQuery::SetParentId(int)
- ?GetIds@CCaInnerNotifierFilter@@QBE?AV?$RArray@H@@XZ @ 92 NONAME ; class RArray<int> CCaInnerNotifierFilter::GetIds(void) const
- ?SetStringIdL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 93 NONAME ; void CCaLocalizationEntry::SetStringIdL(class TDesC16 const &)
- ?SetTextId@CCaLocalizationEntry@@QAEXI@Z @ 94 NONAME ; void CCaLocalizationEntry::SetTextId(unsigned int)
- ?RemoveAttribute@RCaEntryAttrArray@@QAEXABVTDesC16@@@Z @ 95 NONAME ; void RCaEntryAttrArray::RemoveAttribute(class TDesC16 const &)
- ?Find@RCaEntryAttrArray@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 96 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TPtrC16 &)
- ?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 97 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TPtrC16 &)
+ ?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 &)
+ ?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<int> 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<int> 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<int> 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 &)
--- a/contentstorage/caclient/inc/caentry_p.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/inc/caentry_p.h Fri Apr 30 15:22:08 2010 +0300
@@ -68,50 +68,22 @@
private:
- /*!
- * Points to the CaEntry instance that uses
- * this private implementation.
- */
CaEntry *const m_q;
- /*!
- *
- */
int mId;
- /*!
- *
- */
QString mText;
- /*!
- *
- */
QString mDescription;
- /*!
- *
- */
CaIconDescription mIconDescription;
- /*!
- *
- */
EntryFlags mFlags;
- /*!
- *
- */
QString mEntryTypeName;
- /*!
- *
- */
QMap<QString, QString> mAttributes;
- /*!
- *
- */
EntryRole mEntryRole;
};
--- a/contentstorage/caclient/inc/caiconcache.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/inc/caiconcache.h Fri Apr 30 15:22:08 2010 +0300
@@ -53,11 +53,11 @@
private:
static QSharedPointer<CaIconCache> mInstance;
- QCache<QString,HbIcon> mCache; //own
+ QCache<QString,HbIcon> mCache;
- QSharedPointer<CaService> mService;//not own
+ QSharedPointer<CaService> mService;
- CaNotifier *mNotifier;//own
+ CaNotifier *mNotifier;
friend class QtSharedPointer::ExternalRefCount<CaIconCache>;
};
--- a/contentstorage/caclient/inc/caicondescription_p.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/inc/caicondescription_p.h Fri Apr 30 15:22:08 2010 +0300
@@ -45,29 +45,14 @@
private:
- /*!
- * Points to the CaEntry instance that uses this private implementation.
- */
CaIconDescription *const m_q;
- /*!
- *
- */
int mId;
- /*!
- *
- */
QString mFilename;
- /*!
- *
- */
QString mSkinId;
- /*!
- *
- */
QString mApplicationId;
};
--- a/contentstorage/caclient/inc/canotifier_p.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/inc/canotifier_p.h Fri Apr 30 15:22:08 2010 +0300
@@ -21,6 +21,7 @@
class CaClientNotifierProxy;
class CaNotifier;
class CaNotifierFilter;
+class CaObserver;
class CaNotifierPrivate
{
@@ -33,7 +34,8 @@
GroupContentChangedNotifierType
};
- CaNotifierPrivate(const CaNotifierFilter ¬ifierFilter);
+ CaNotifierPrivate(const CaNotifierFilter ¬ifierFilter,
+ CaClientNotifierProxy *notifierProxy);
~CaNotifierPrivate();
int registerNotifier(NotifierType notifierType);
@@ -41,24 +43,14 @@
void makeConnect();
- void makeDisconnect();
-
private:
- /*!
- * Points to the CaNotifier instance that uses
- * this private implementation.
- */
const CaNotifier *m_q;
- /*!
- * Own.
- */
const CaNotifierFilter *mNotifierFilter;
- /*!
- * Own.
- */
+ const CaObserver *mObserver;
+
CaClientNotifierProxy *mNotifierProxy;
friend class CaNotifier;
--- a/contentstorage/caclient/inc/canotifierfilter_p.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/inc/canotifierfilter_p.h Fri Apr 30 15:22:08 2010 +0300
@@ -57,10 +57,6 @@
private:
- /*!
- * Points to the CaNotifierFilter instance that uses
- * this private implementation.
- */
CaNotifierFilter *const m_q;
};
--- a/contentstorage/caclient/inc/caquery_p.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/inc/caquery_p.h Fri Apr 30 15:22:08 2010 +0300
@@ -66,9 +66,6 @@
private:
- /**
- * Points to the CaQuery instance that uses this private implementation.
- */
CaQuery *const m_q;
EntryRoles mEntryRoles;
--- a/contentstorage/caclient/inc/caservice_p.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/inc/caservice_p.h Fri Apr 30 15:22:08 2010 +0300
@@ -26,6 +26,7 @@
class CaQuery;
class CaService;
class CaNotifier;
+class CaClientNotifierProxy;
class CaServicePrivate
{
@@ -66,19 +67,12 @@
private:
- /**
- * Points to the CaService instance that uses this private implementation.
- */
CaService *const m_q;
- /**
- * Proxy to communicate with Symbian server.
- */
CaClientProxy *mProxy;
+
+ CaClientNotifierProxy *mNotifierProxy;
- /**
- * code of error caused by last operation.
- */
mutable ErrorCode mErrorCode;
};
--- a/contentstorage/caclient/s60/inc/caclientnotifierproxy.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/s60/inc/caclientnotifierproxy.h Fri Apr 30 15:22:08 2010 +0300
@@ -30,44 +30,7 @@
class CaEntry;
class CaNotifierFilter;
-/**
- * IDataObserver
- *
- */
-class IDataObserver
-{
-public:
- /**
- * Method invoked when entry is changed.
- * @param entryId entry id.
- * @param changeType change type.
- */
- virtual void entryChanged(TInt entryId,
- TChangeType changeType) const = 0;
-
- /**
- * Method invoked when entry is changed.
- * @param entry entry.
- * @param changeType change type.
- */
- virtual void entryChanged(const CCaInnerEntry &entry,
- TChangeType changeType) const = 0;
-
- /**
- * Method invoked when entry was changed.
- * @param entryId entry id.
- */
- virtual void entryTouched(TInt id) const = 0;
-
- /**
- * Method invoked when entry was changed.
- * @param groupId group id.
- */
- virtual void groupContentChanged(TInt groupId) const = 0;
-};
-
-class CACLIENT_EXPORT CaClientNotifierProxy: public QObject,
- public IDataObserver
+class CACLIENT_EXPORT CaClientNotifierProxy: public QObject
{
Q_OBJECT
@@ -85,33 +48,6 @@
~CaClientNotifierProxy();
/**
- * Method invoked when entry is changed.
- * @param entryId entry id.
- * @param changeType change type.
- */
- virtual void entryChanged(TInt entryId, TChangeType changeType) const;
-
- /**
- * Method invoked when entry is changed.
- * @param entry entry.
- * @param changeType change type.
- */
- virtual void entryChanged(const CCaInnerEntry &entry,
- TChangeType changeType) const;
-
- /**
- * Method invoked when entry was changed.
- * @param entryId entry id.
- */
- virtual void entryTouched(TInt entryId) const;
-
- /**
- * Method invoked when entry was changed.
- * @param groupId group id.
- */
- virtual void groupContentChanged(TInt groupId) const;
-
- /**
* Method for registering notifier
*
* @param notifierFilter notifierFilter used to register notifier.
@@ -121,7 +57,7 @@
int registerNotifier(
const CaNotifierFilter *notifierFilter,
CaNotifierPrivate::NotifierType notifierType,
- const CaClientNotifierProxy *notifierProxy);
+ const IDataObserver *observer);
/**
* Method for unregistering notifier.
@@ -133,13 +69,11 @@
const CaNotifierFilter ¬ifierFilter,
CaNotifierPrivate::NotifierType notifierType);
-signals:
-
- void signalEntryChanged(int entryId, ChangeType changeType) const;
- void signalEntryChanged(const CaEntry &entry,
- ChangeType changeType) const;
- void signalEntryTouched(int id) const;
- void signalGroupContentChanged(int groupId) const;
+ /**
+ * Reconnect all sessions when server was terminated
+ *
+ */
+ void connectSessions();
private:
/**
@@ -181,7 +115,6 @@
Q_DISABLE_COPY(CaClientNotifierProxy)
friend class CaClientProxy;
- friend class CaClientObserver;
};
--- a/contentstorage/caclient/s60/inc/caclientnotifiersession.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/s60/inc/caclientnotifiersession.h Fri Apr 30 15:22:08 2010 +0300
@@ -74,6 +74,13 @@
void Close();
/**
+ * Reconnect all subsession
+ *
+ * @since S60 v 5.0
+ */
+ void ConnectAllL();
+
+ /**
* Registers a notifier.
* @param innerNotifierFilter pointer to inner (symbian style) filter.
* @param notifierFilter notifier filter address
@@ -84,7 +91,7 @@
*/
TInt RegisterNotifier(CCaInnerNotifierFilter *innerNotifierFilter,
const TAny* notifierFilter,
- const CaClientNotifierProxy* notifierProxy);
+ const IDataObserver* notifierProxy);
/**
* Unregisters a notifier.
@@ -135,7 +142,7 @@
*/
void RegisterNotifierL(CCaInnerNotifierFilter* innerNotifierFilter,
const TAny* notifierFilter,
- const CaClientNotifierProxy *notifierProxy);
+ const IDataObserver *notifierProxy);
/*
* GetSizeL method
--- a/contentstorage/caclient/s60/inc/caclientsubsession.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/s60/inc/caclientsubsession.h Fri Apr 30 15:22:08 2010 +0300
@@ -58,17 +58,12 @@
/**
* Sends request for getting change information.
*/
- void GetChangeInfoAndNotifyObserverL() const;
+ void GetChangeInfoL() const;
-private:
/**
* Notify observer.
- * @param aEntry pointer to inner entry.
- * @param aChangeType change type.
*/
- void NotifyObserver(
- CCaInnerEntry* aEntry,
- TChangeType aChangeType ) const;
+ void NotifyObserver() const;
private:
/**
@@ -95,6 +90,16 @@
* Own.
*/
TPckgBuf<TInt>* iMessageSize;
+
+ /**
+ * Own.
+ */
+ mutable CCaInnerEntry* iChangedEntry;
+
+ /**
+ * Own.
+ */
+ mutable TChangeType iChangedEntryType;
};
#endif /* CACLIENTSUBSESSION_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/s60/inc/caobserver.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description : Content Arsenal client session
+ *
+ */
+
+#ifndef CAOBSERVER_H_
+#define CAOBSERVER_H_
+
+#include <QObject>
+
+#include "cadef.h"
+#include "cadefs.h"
+
+
+class CCaInnerEntry;
+class CaEntry;
+
+/**
+ * IDataObserver
+ *
+ */
+class IDataObserver
+{
+public:
+ /**
+ * Method invoked when entry is changed.
+ * @param entryId entry id.
+ * @param changeType change type.
+ */
+ virtual void entryChanged(TInt entryId,
+ TChangeType changeType) const = 0;
+
+ /**
+ * Method invoked when entry is changed.
+ * @param entry entry.
+ * @param changeType change type.
+ */
+ virtual void entryChanged(const CCaInnerEntry &entry,
+ TChangeType changeType) const = 0;
+
+ /**
+ * Method invoked when entry was changed.
+ * @param entryId entry id.
+ */
+ virtual void entryTouched(TInt id) const = 0;
+
+ /**
+ * Method invoked when entry was changed.
+ * @param groupId group id.
+ */
+ virtual void groupContentChanged(TInt groupId) const = 0;
+};
+
+
+
+class CaObserver: public QObject, public IDataObserver
+{
+ Q_OBJECT
+public:
+ /**
+ * Constructor.
+ * @param parent pointer to parent. Defaults to NULL.
+ */
+ CaObserver(QObject *parent = 0);
+
+ /**
+ * Destructor.
+ */
+ ~CaObserver();
+
+ /**
+ * Method invoked when entry is changed.
+ * @param entryId entry id.
+ * @param changeType change type.
+ */
+ void entryChanged(TInt entryId,
+ TChangeType changeType) const;
+
+ /**
+ * Method invoked when entry is changed.
+ * @param entry entry.
+ * @param changeType change type.
+ */
+ void entryChanged(const CCaInnerEntry &entry,
+ TChangeType changeType) const;
+
+ /**
+ * Method invoked when entry was changed.
+ * @param entryId entry id.
+ */
+ void entryTouched(TInt id) const ;
+
+ /**
+ * Method invoked when entry was changed.
+ * @param groupId group id.
+ */
+ void groupContentChanged(TInt groupId) const;
+
+signals:
+
+ void signalEntryChanged(int entryId, ChangeType changeType) const;
+ void signalEntryChanged(const CaEntry &entry,
+ ChangeType changeType) const;
+ void signalEntryTouched(int id) const;
+ void signalGroupContentChanged(int groupId) const;
+};
+
+
+#endif /* CAOBSERVER_H_ */
--- a/contentstorage/caclient/s60/src/caclientnotifier.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/s60/src/caclientnotifier.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -76,11 +76,12 @@
TInt error = iStatus.Int();
if( error == KErrNone )
{
- TRAP( error, iSubsession->GetChangeInfoAndNotifyObserverL() );
+ TRAP( error, iSubsession->GetChangeInfoL() );
if( error == KErrNone )
{
iSubsession->RegisterForNotificationsL( iStatus );
SetActive();
+ iSubsession->NotifyObserver();
}
}
}
--- a/contentstorage/caclient/s60/src/caclientnotifierproxy.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/s60/src/caclientnotifierproxy.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -17,6 +17,7 @@
#include <QDebug>
#include "caclientnotifierproxy.h"
+#include "caobserver.h"
#include "caentry.h"
#include "cainnerentry.h"
#include "caobjectadapter.h"
@@ -38,63 +39,10 @@
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
-void CaClientNotifierProxy::entryChanged(TInt entryId,
- TChangeType changeType) const
-{
- qDebug() << "CaClientProxy::entryChanged entryId:"
- << entryId << "changeType:" << changeType;
-
- int entryChangedId(entryId);
- ChangeType entryChangeType(AddChangeType);
- CaObjectAdapter::convert(changeType, entryChangeType);
-
- emit signalEntryChanged(entryChangedId, entryChangeType);
-}
-
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
-void CaClientNotifierProxy::entryChanged(const CCaInnerEntry &entry,
- TChangeType changeType) const
-{
- qDebug() << "CaClientProxy::entryChanged changeType:" << changeType;
-
- CaEntry *caEntry = new CaEntry(static_cast<EntryRole>(entry.GetRole()));
- ChangeType entryChangeType(AddChangeType);
- CaObjectAdapter::convert(entry, *caEntry);
- CaObjectAdapter::convert(changeType, entryChangeType);
-
- emit signalEntryChanged(*caEntry, entryChangeType);
-}
-
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
-void CaClientNotifierProxy::entryTouched(TInt id) const
-{
- qDebug() << "CaClientProxy::entryTouched id:" << id;
- emit signalEntryTouched(id);
-}
-
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
-void CaClientNotifierProxy::groupContentChanged(TInt groupId) const
-{
- qDebug() << "CaClientProxy::groupContentChanged groupId:" << groupId;
-
- int groupChangedId(groupId);
-
- emit signalGroupContentChanged(groupChangedId);
-}
-
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
int CaClientNotifierProxy::registerNotifier(
const CaNotifierFilter *notifierFilter,
CaNotifierPrivate::NotifierType notifierType,
- const CaClientNotifierProxy *notifierProxy)
+ const IDataObserver *observer)
{
qDebug() << "CaClientProxy::registerNotifier notifierType:"
<< notifierType;
@@ -123,7 +71,7 @@
}
if (!error) {
error = session->RegisterNotifier(innerNotifierFilter,
- notifierFilter, notifierProxy);
+ notifierFilter, observer);
}
}
@@ -164,6 +112,16 @@
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
+void CaClientNotifierProxy::connectSessions()
+{
+ for (int i = 0; i < mSessions.Count(); i++) {
+ TRAP_IGNORE(mSessions[i].ConnectAllL());
+ }
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
RCaClientNotifierSession *CaClientNotifierProxy::findSession()
{
RCaClientNotifierSession *session(NULL);
--- a/contentstorage/caclient/s60/src/caclientnotifiersession.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/s60/src/caclientnotifiersession.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -102,10 +102,27 @@
//
// -----------------------------------------------------------------------------
//
+void RCaClientNotifierSession::ConnectAllL()
+{
+ if( !CreateSession(KCaSrvName, Version(), KDefaultMessageSlots) )
+ {
+ RHashMap<TKey, RCaClientSubSession*>::TIter iter(iSubsessions);
+ while(iter.NextValue())
+ {
+ (*iter.CurrentValue())->CreateL();
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+//
+//
+// -----------------------------------------------------------------------------
+//
TInt RCaClientNotifierSession::RegisterNotifier(
CCaInnerNotifierFilter* innerNotifierFilter,
const TAny* notifierFilter,
- const CaClientNotifierProxy* notifierProxy)
+ const IDataObserver* notifierProxy)
{
TRAPD(error, RegisterNotifierL(innerNotifierFilter,
notifierFilter,
@@ -121,7 +138,7 @@
void RCaClientNotifierSession::RegisterNotifierL(
CCaInnerNotifierFilter* innerNotifierFilter,
const TAny* notifierFilter,
- const CaClientNotifierProxy *notifierProxy)
+ const IDataObserver *notifierProxy)
{
RCaClientSubSession* subsession = new RCaClientSubSession(this,
notifierProxy, innerNotifierFilter);
--- a/contentstorage/caclient/s60/src/caclientsubsession.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/s60/src/caclientsubsession.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -22,7 +22,7 @@
#include "casrvdef.h"
#include "cainnerentry.h"
#include "caclientproxy.h"
-#include "caclientnotifierproxy.h"
+#include "caobserver.h"
#include "cautils.h"
// -----------------------------------------------------------------------------
@@ -34,7 +34,8 @@
const CCaInnerNotifierFilter *aInnerNotifierFilter ) :
RSubSessionBase(), iSession( aSession ), iObserver( aObserver ),
iInnerNotifierFilter( aInnerNotifierFilter ),
- iNotifier( NULL ), iMessageSize( NULL )
+ iNotifier( NULL ), iMessageSize( NULL ), iChangedEntry( NULL ),
+ iChangedEntryType( EAddChangeType )
{
}
@@ -44,10 +45,21 @@
// -----------------------------------------------------------------------------
void RCaClientSubSession::CreateL()
{
+ if( iNotifier )
+ {
+ delete iNotifier;
+ iNotifier = NULL;
+ }
+ if( iMessageSize )
+ {
+ delete iMessageSize;
+ iMessageSize = NULL;
+ }
iMessageSize = new ( ELeave ) TPckgBuf<TInt> ();
User::LeaveIfError( CreateSubSession( *iSession,
static_cast<TInt>( EContentArsenalNotifierOpen ) ) );
iNotifier = CCaClientNotifier::NewL( this );
+ iChangedEntry = CCaInnerEntry::NewL();
}
// -----------------------------------------------------------------------------
@@ -55,6 +67,8 @@
// -----------------------------------------------------------------------------
void RCaClientSubSession::Close()
{
+ delete iChangedEntry;
+ iChangedEntry = NULL;
delete iMessageSize;
iMessageSize = NULL;
delete iNotifier;
@@ -88,30 +102,28 @@
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
-void RCaClientSubSession::NotifyObserver(
- CCaInnerEntry* aEntry,
- TChangeType aChangeType ) const
+void RCaClientSubSession::NotifyObserver() const
{
switch( iInnerNotifierFilter->GetNotifierType() )
{
case CCaInnerNotifierFilter::EEntryChangedWithId:
{
- iObserver->entryChanged( aEntry->GetId(), aChangeType );
+ iObserver->entryChanged( iChangedEntry->GetId(), iChangedEntryType );
break;
}
case CCaInnerNotifierFilter::EEntryChangedWithEntry:
{
- iObserver->entryChanged( *aEntry, aChangeType );
+ iObserver->entryChanged( *iChangedEntry, iChangedEntryType );
break;
}
case CCaInnerNotifierFilter::EEntryTouched:
{
- iObserver->entryTouched( aEntry->GetId() );
+ iObserver->entryTouched( iChangedEntry->GetId() );
break;
}
case CCaInnerNotifierFilter::EGroupContentChanged:
{
- iObserver->groupContentChanged( aEntry->GetId() );
+ iObserver->groupContentChanged( iChangedEntry->GetId() );
break;
}
default:
@@ -124,7 +136,7 @@
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
-void RCaClientSubSession::GetChangeInfoAndNotifyObserverL() const
+void RCaClientSubSession::GetChangeInfoL() const
{
TIpcArgs args;
RBuf8 outbuf;
@@ -137,14 +149,11 @@
EContentArsenalGetChangeInfo, args );
if( error == KErrNone )
{
- CCaInnerEntry* entry = CCaInnerEntry::NewLC();
RDesReadStream stream( outbuf );
CleanupClosePushL( stream );
- entry->InternalizeL( stream );
+ iChangedEntry->InternalizeL( stream );
CleanupStack::PopAndDestroy( &stream );
- TChangeType changeType = changeTypePckg();
- NotifyObserver( entry, changeType );
- CleanupStack::PopAndDestroy( entry );
+ iChangedEntryType = changeTypePckg();
}
CleanupStack::PopAndDestroy( &outbuf );
}
--- a/contentstorage/caclient/s60/src/camenuiconmifutility.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/s60/src/camenuiconmifutility.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -31,28 +31,25 @@
{
CFbsBitmap *bitamp(0);
CFbsBitmap *mask(0);
-
- if ( AknIconUtils::IsMifFile(fileName)) {
- // SVG icon
- // SVG always has only one icon
- TInt bitmapIndex = 0;
- TInt maskIndex = 1;
- AknIconUtils::ValidateLogicalAppIconId( fileName,
- bitmapIndex, maskIndex );
- AknIconUtils::CreateIconLC( bitamp, mask, fileName,
+ TInt bitmapIndex = 0;
+ TInt maskIndex = 1;
+ // it will change bitmap ids if it is mif (checking inside)
+ AknIconUtils::ValidateLogicalAppIconId( fileName,
bitmapIndex, maskIndex );
- }
+ AknIconUtils::CreateIconLC( bitamp, mask, fileName,
+ bitmapIndex, maskIndex );
- AknIconUtils::DisableCompression(bitamp);
- AknIconUtils::SetSize(bitamp, TSize(size.width(), size.height()),
- EAspectRatioPreservedAndUnusedSpaceRemoved);
+ if (AknIconUtils::IsMifFile(fileName)) {
+ AknIconUtils::DisableCompression(bitamp);
+ AknIconUtils::SetSize(bitamp, TSize(size.width(), size.height()),
+ EAspectRatioPreservedAndUnusedSpaceRemoved);
- AknIconUtils::DisableCompression(mask);
- AknIconUtils::SetSize(mask, TSize(size.width(), size.height()),
- EAspectRatioPreservedAndUnusedSpaceRemoved);
-
- CaBitmapAdapter::fromBitmapAndMaskToPixmapL(bitamp, mask, pixmap);
+ CaBitmapAdapter::fromBitmapAndMaskToPixmapL(bitamp, mask, pixmap);
+ } else {
+ CaBitmapAdapter::fromBitmapAndMaskToPixmapL(bitamp, mask, pixmap);
+ pixmap.scaled(size);
+ }
// bitmap and icon, AknsUtils::CreateIconLC doesn't specify the order
CleanupStack::Pop(2);
--- a/contentstorage/caclient/s60/src/camenuiconutility.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/s60/src/camenuiconutility.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -122,13 +122,15 @@
if (err2 == KErrNone) {
QString fileName = XQConversions::s60DescToQString(
fileNameFromApparc->Des());
- if (fileName.contains(QString(".mif"))) {
+ if (fileName.contains(QString(".mif")) || fileName.contains(QString(".mbm"))) {
TPtr ptr(fileNameFromApparc->Des());
CaMenuIconMifUtility::GetPixmapByFilenameL(ptr,size,pixmap);
pixmap = pixmap.scaled(size, Qt::KeepAspectRatioByExpanding);
icon = HbIcon(QIcon(pixmap));
+ } else {
+ icon = HbIcon(fileName);
}
}
CleanupStack::Pop(fileNameFromApparc);
--- a/contentstorage/caclient/s60/src/caobjectadapter.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/s60/src/caobjectadapter.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -287,6 +287,9 @@
case KErrArgument:
error = BadArgumentErrorCode;
break;
+ case KErrServerTerminated:
+ error = ServerTerminated;
+ break;
default:
error = UnknownErrorCode;
break;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/s60/src/caobserver.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include <QDebug>
+#include "caobserver.h"
+#include "caobjectadapter.h"
+#include "cainnerentry.h"
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaObserver::CaObserver(QObject *parent) :
+ QObject(parent)
+{
+}
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaObserver::~CaObserver()
+{
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaObserver::entryChanged(TInt entryId,
+ TChangeType changeType) const
+{
+ qDebug() << "CaClientProxy::entryChanged entryId:"
+ << entryId << "changeType:" << changeType;
+
+ int entryChangedId(entryId);
+ ChangeType entryChangeType(AddChangeType);
+ CaObjectAdapter::convert(changeType, entryChangeType);
+
+ emit signalEntryChanged(entryChangedId, entryChangeType);
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaObserver::entryChanged(const CCaInnerEntry &entry,
+ TChangeType changeType) const
+{
+ qDebug() << "CaClientProxy::entryChanged changeType:" << changeType;
+
+ CaEntry *caEntry = new CaEntry(static_cast<EntryRole>(entry.GetRole()));
+ ChangeType entryChangeType(AddChangeType);
+ CaObjectAdapter::convert(entry, *caEntry);
+ CaObjectAdapter::convert(changeType, entryChangeType);
+
+
+ emit signalEntryChanged(*caEntry, entryChangeType);
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaObserver::entryTouched(TInt id) const
+{
+ qDebug() << "CaClientProxy::entryTouched id:" << id;
+ emit signalEntryTouched(id);
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaObserver::groupContentChanged(TInt groupId) const
+{
+ qDebug() << "CaClientProxy::groupContentChanged groupId:" << groupId;
+
+ int groupChangedId(groupId);
+
+ emit signalGroupContentChanged(groupChangedId);
+}
+
--- a/contentstorage/caclient/src/caentry.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/src/caentry.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -30,38 +30,44 @@
// ======== MEMBER FUNCTIONS ========
/*!
- * \class CaEntry
- *
- * \brief This abstract class describes particular entry.
- *
- * To create instance of CaEntry object, you have to use service's object's
- * createEntry() method.
- *
- * \example
- * \code
- * QSharedPointer<CaService> service = CaService::instance();
- * // default you create item (ItemEntryRole)
- * CaEntry entry;
- * // to create CaEntry invoking setText() and setEntryTypeName() methods
- * is obligatoried
- * entry.setText("Text");
- * entry.setEntryTypeName("TypeName");
- * CaEntry * resultEntry = service->createEntry(entry);
- * ...
- * delete resultEntry;
- * ...
- *
- * // if you want create group, you should use entry role parametr
- * CaEntry entryGroup(GroupEntryRole);
- * ...
- * resultEntry = service->createEntry(entryGroup);
- *
- * \endcode
+ \class CaEntry
+ \brief This abstract class describes particular entry.
+ To create instance of CaEntry object, you have to use service's object's
+ createEntry() method.
+ \example
+ \code
+ QSharedPointer<CaService> service = CaService::instance();
+ // default you create item (ItemEntryRole)
+ CaEntry entry;
+ // to create CaEntry invoking setText() and setEntryTypeName() methods
+ is obligatoried
+ entry.setText("Text");
+ entry.setEntryTypeName("TypeName");
+ CaEntry * resultEntry = service->createEntry(entry);
+ ...
+ delete resultEntry;
+ ...
+ // if you want create group, you should use entry role parametr
+ CaEntry entryGroup(GroupEntryRole);
+ ...
+ resultEntry = service->createEntry(entryGroup);
+ \endcode
*/
/*!
- * Constructor.
- * \param entryRole entry's role.
+ \var CaEntryPrivate::m_q
+ Points to the CaEntry instance that uses
+ this private implementation.
+ */
+
+/*!
+ \var CaEntryPrivate::mId
+ Id.
+ */
+
+/*!
+ Constructor.
+ \param entryRole entry's role.
*/
CaEntry::CaEntry(EntryRole entryRole) :
m_d(new CaEntryPrivate(this))
@@ -70,13 +76,12 @@
}
/*!
- * Copy constructor.
- * \param entry const reference to CaEntry.
- *
- * \code
- * ...
- * CaEntry * copyEntry( *resultEntry );
- * \endcode
+ Copy constructor.
+ \param entry const reference to CaEntry.
+ \code
+ ...
+ CaEntry * copyEntry( *resultEntry );
+ \endcode
*/
CaEntry::CaEntry(const CaEntry &entry) :
m_d(new CaEntryPrivate(this))
--- a/contentstorage/caclient/src/caiconcache.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/src/caiconcache.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -29,13 +29,25 @@
QSharedPointer<CaIconCache> CaIconCache::mInstance(0);
/*!
- * \class CaIconCache
- *
- * \brief This class provides icon caching mechanism
- *
- * Class implements singleton design patern. Use cache() method
- * to get an instance of CaIconCache
- *
+ \class CaIconCache
+ \brief This class provides icon caching mechanism
+ Class implements singleton design patern. Use cache() method
+ to get an instance of CaIconCache
+ */
+
+/*!
+ \var CaIconCache::mCache
+ Own.
+ */
+
+/*!
+ \var CaIconCache::mService
+ Not own.
+ */
+
+/*!
+ \var CaIconCache::mNotifier
+ Own.
*/
/*!
--- a/contentstorage/caclient/src/caicondescription.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/src/caicondescription.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -59,6 +59,16 @@
*/
/*!
+ \var CaIconDescriptionPrivate::m_q
+ Points to the CaEntry instance that uses this private implementation.
+ */
+
+/*!
+ \var CaIconDescriptionPrivate::mId
+ Id.
+ */
+
+/*!
Default constructor.
*/
CaIconDescription::CaIconDescription() :
--- a/contentstorage/caclient/src/canotifier.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/src/canotifier.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -19,6 +19,7 @@
#include "canotifier_p.h"
#include "canotifierfilter.h"
#include "caclientnotifierproxy.h"
+#include "caobserver.h"
/*!
\class CaNotifier.
@@ -89,6 +90,22 @@
*/
/*!
+ \var CaNotifierPrivate::m_q
+ Points to the CaNotifier instance that uses
+ this private implementation.
+ */
+
+/*!
+ \var CaNotifierPrivate::mNotifierFilter
+ Own.
+ */
+
+/*!
+ \var CaNotifierPrivate::mNotifierProxy
+ Not own.
+ */
+
+/*!
Constructor.
\param entryPrivate pointer to private implementation.
*/
@@ -104,7 +121,14 @@
*/
CaNotifier::~CaNotifier()
{
- m_d->makeDisconnect();
+ m_d->unregisterNotifier(
+ CaNotifierPrivate::EntryChangedWithIdNotifierType);
+ m_d->unregisterNotifier(
+ CaNotifierPrivate::EntryChangedWithEntryNotifierType);
+ m_d->unregisterNotifier(
+ CaNotifierPrivate::EntryTouchedNotifierType);
+ m_d->unregisterNotifier(
+ CaNotifierPrivate::GroupContentChangedNotifierType);
delete m_d;
}
@@ -193,11 +217,13 @@
\param notifierFilter descrbies entries to observe.
*/
CaNotifierPrivate::CaNotifierPrivate(
- const CaNotifierFilter ¬ifierFilter) :
+ const CaNotifierFilter ¬ifierFilter,
+ CaClientNotifierProxy *notifierProxy) :
m_q(NULL),
- mNotifierFilter(NULL),
- mNotifierProxy(NULL)
+ mNotifierFilter(NULL),
+ mObserver(NULL)
{
+ mNotifierProxy = notifierProxy;
mNotifierFilter = new CaNotifierFilter(notifierFilter);
}
@@ -217,7 +243,6 @@
GroupContentChangedNotifierType);
}
delete mNotifierFilter;
- delete mNotifierProxy;
}
/*!
Registers notifier
@@ -229,7 +254,7 @@
return mNotifierProxy->registerNotifier(
mNotifierFilter,
notifierType,
- mNotifierProxy);
+ mObserver);
}
return 0;
}
@@ -251,48 +276,23 @@
void CaNotifierPrivate::makeConnect()
{
if (m_q) {
- if (!mNotifierProxy) {
- mNotifierProxy = new CaClientNotifierProxy();
- }
- m_q->connect(mNotifierProxy,
+ mObserver = new CaObserver();
+ m_q->connect(mObserver,
SIGNAL(signalEntryChanged(int,ChangeType)),
m_q,
SIGNAL(entryChanged(int,ChangeType)));
- m_q->connect(mNotifierProxy,
+ m_q->connect(mObserver,
SIGNAL(signalEntryChanged(const CaEntry &,ChangeType)),
m_q,
SIGNAL(entryChanged(const CaEntry &,ChangeType)));
- m_q->connect(mNotifierProxy,
+ m_q->connect(mObserver,
SIGNAL(signalEntryTouched(int)),
m_q,
SIGNAL(entryTouched(int)));
- m_q->connect(mNotifierProxy,
+ m_q->connect(mObserver,
SIGNAL(signalGroupContentChanged(int)),
m_q,
SIGNAL(groupContentChanged(int)));
}
}
-/*!
- Disconnects this Notifier
- */
-void CaNotifierPrivate::makeDisconnect()
-{
- if (m_q && mNotifierProxy) {
- m_q->disconnect(mNotifierProxy,
- SIGNAL(signalEntryChanged(int,ChangeType)),
- m_q,
- SIGNAL(entryChanged(int,ChangeType)));
- m_q->disconnect(mNotifierProxy,
- SIGNAL(signalEntryChanged(const CaEntry &,ChangeType)),
- m_q,
- SIGNAL(entryChanged(const CaEntry &,ChangeType)));
- m_q->disconnect(mNotifierProxy,
- SIGNAL(signalEntryTouched(int)),
- m_q,
- SIGNAL(entryTouched(int)));
- m_q->disconnect(mNotifierProxy,
- SIGNAL(signalGroupContentChanged(int)),
- m_q,
- SIGNAL(groupContentChanged(int)));
- }
-}
+
--- a/contentstorage/caclient/src/canotifierfilter.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/src/canotifierfilter.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -20,6 +20,12 @@
#include "caquery.h"
/*!
+ \var CaNotifierFilterPrivate::m_q
+ Points to the CaNotifierFilter instance that uses
+ this private implementation.
+ */
+
+/*!
Constructor.
\param pointer to CaNotifierFilter - public notifier implementation class.
*/
--- a/contentstorage/caclient/src/caquery.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/src/caquery.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -54,6 +54,11 @@
*/
/*!
+ \var CaQueryPrivate::m_q
+ Points to the CaQuery instance that uses this private implementation.
+ */
+
+/*!
Default constructor.
*/
CaQuery::CaQuery() :
--- a/contentstorage/caclient/src/caservice.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/src/caservice.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -29,6 +29,7 @@
#include "cadefs.h"
#include "caclientproxy.h"
+#include "caclientnotifierproxy.h"
#include "caobjectadapter.h"
#include "caclienttest_global.h"
@@ -53,6 +54,26 @@
*/
+/*!
+ \var CaServicePrivate::m_q
+ Points to the CaService instance that uses this private implementation.
+ */
+
+/*!
+ \var CaServicePrivate::mProxy
+ Proxy to communicate with Symbian server.
+ */
+
+/*!
+ \var CaServicePrivate::mErrorCode
+ code of error caused by last operation.
+ */
+
+/*!
+ \var CaServicePrivate::mNotifierProxy
+ Proxy to client notifier.
+ */
+
// Initialization of a static member variable.
QWeakPointer<CaService> CaService::m_instance = QWeakPointer<CaService>();
/*!
@@ -574,22 +595,6 @@
}
/*!
- Performs touch operation on entry.
- \param entry to be touched
- \retval boolean with result of operation
- */
-bool CaServicePrivate::touch(const CaEntry &entry)
-{
- qDebug() << "CaServicePrivate::touch" << "entryId: " << entry.id();
-
- mErrorCode = mProxy->touch(entry);
-
- qDebug() << "CaServicePrivate::touch mErrorCode:" << mErrorCode;
-
- return (mErrorCode == NoErrorCode);
-}
-
-/*!
Place entries in a given group at the end.
\param groupId id of a group.
\param entryId id of entry to append.
@@ -933,7 +938,8 @@
\param servicePublic pointer to public service
*/
CaServicePrivate::CaServicePrivate(CaService *servicePublic) :
- m_q(servicePublic), mProxy(new CaClientProxy)
+ m_q(servicePublic), mProxy(new CaClientProxy),
+ mNotifierProxy(NULL)
{
const ErrorCode connectionResult = mProxy->connect();
@@ -949,6 +955,7 @@
CaServicePrivate::~CaServicePrivate()
{
delete mProxy;
+ delete mNotifierProxy;
}
/*!
@@ -972,6 +979,15 @@
if (mErrorCode == NoErrorCode
&& entryIdList.count() != resultList.count()) {
mErrorCode = NotFoundErrorCode;
+ }//one line with else if
+ else if (mErrorCode == ServerTerminated) {
+ if (!mProxy->connect()) {
+ if (mNotifierProxy) {
+ mNotifierProxy->connectSessions();
+ }
+ resultList.clear();
+ mErrorCode = mProxy->getData(entryIdList, resultList);
+ }
}
CACLIENTTEST_FUNC_EXIT("CaServicePrivate::getEntries");
@@ -991,7 +1007,15 @@
QList< QSharedPointer<CaEntry> > resultList;
mErrorCode = mProxy->getData(query, resultList);
-
+ if (mErrorCode == ServerTerminated) {
+ if (!mProxy->connect()) {
+ if (mNotifierProxy) {
+ mNotifierProxy->connectSessions();
+ }
+ resultList.clear();
+ mErrorCode = mProxy->getData(query, resultList);
+ }
+ }
qDebug() << "CaServicePrivate::getEntries mErrorCode:" << mErrorCode;
return resultList;
@@ -1008,6 +1032,15 @@
QList<int> resultList;
mErrorCode = mProxy->getEntryIds(query, resultList);
+ if (mErrorCode == ServerTerminated) {
+ if (!mProxy->connect()) {
+ if (mNotifierProxy) {
+ mNotifierProxy->connectSessions();
+ }
+ resultList.clear();
+ mErrorCode = mProxy->getEntryIds(query, resultList);
+ }
+ }
CACLIENTTEST_FUNC_EXIT("CaItemModelList::getEntryIds");
qDebug() << "CaServicePrivate::getEntryIds mErrorCode:" << mErrorCode;
return resultList;
@@ -1035,6 +1068,15 @@
addDataResult =
mProxy->addData(*entryClone, *newEntry);
+ if (addDataResult == ServerTerminated) {
+ if (!mProxy->connect()) {
+ if (mNotifierProxy) {
+ mNotifierProxy->connectSessions();
+ }
+ addDataResult =
+ mProxy->addData(*entryClone, *newEntry);
+ }
+ }
// return empty pointer if nothing was added
if (addDataResult != NoErrorCode) {
@@ -1051,6 +1093,30 @@
}
/*!
+ Performs touch operation on entry.
+ \param entry to be touched
+ \retval boolean with result of operation
+ */
+bool CaServicePrivate::touch(const CaEntry &entry)
+{
+ qDebug() << "CaServicePrivate::touch" << "entryId: " << entry.id();
+
+ mErrorCode = mProxy->touch(entry);
+ if (mErrorCode == ServerTerminated) {
+ if (!mProxy->connect()) {
+ if (mNotifierProxy) {
+ mNotifierProxy->connectSessions();
+ }
+ mErrorCode = mProxy->touch(entry);
+ }
+ }
+
+ qDebug() << "CaServicePrivate::touch mErrorCode:" << mErrorCode;
+
+ return (mErrorCode == NoErrorCode);
+}
+
+/*!
Update entry.
\param entry entry const reference of entry to update
\retval true if operation was successful
@@ -1069,6 +1135,14 @@
QScopedPointer<CaEntry> updatedEntry(new CaEntry(entry.role()));
updateEntryResult = mProxy->addData(entry, *updatedEntry);
+ if (updateEntryResult == ServerTerminated) {
+ if (!mProxy->connect()) {
+ if (mNotifierProxy) {
+ mNotifierProxy->connectSessions();
+ }
+ updateEntryResult = mProxy->addData(entry, *updatedEntry);
+ }
+ }
} catch (const std::bad_alloc &) {
updateEntryResult = OutOfMemoryErrorCode;
@@ -1097,6 +1171,14 @@
CACLIENTTEST_FUNC_ENTRY("CaServicePrivate::removeEntries");
mErrorCode = mProxy->removeData(entryIdList);
+ if (mErrorCode == ServerTerminated) {
+ if (!mProxy->connect()) {
+ if (mNotifierProxy) {
+ mNotifierProxy->connectSessions();
+ }
+ mErrorCode = mProxy->removeData(entryIdList);
+ }
+ }
qDebug() << "CaServicePrivate::removeEntries mErrorCode:" << mErrorCode;
@@ -1123,8 +1205,17 @@
CACLIENTTEST_FUNC_ENTRY("CaServicePrivate::insertEntriesIntoGroup");
- mErrorCode = mProxy->insertEntriesIntoGroup(groupId, entryIdList, beforeEntryId);
-
+ mErrorCode = mProxy->insertEntriesIntoGroup(groupId,
+ entryIdList, beforeEntryId);
+ if (mErrorCode == ServerTerminated) {
+ if (!mProxy->connect()) {
+ if (mNotifierProxy) {
+ mNotifierProxy->connectSessions();
+ }
+ mErrorCode = mProxy->insertEntriesIntoGroup(groupId,
+ entryIdList, beforeEntryId);
+ }
+ }
qDebug() << "CaServicePrivate::insertEntriesIntoGroup mErrorCode:"
<< mErrorCode;
@@ -1150,6 +1241,14 @@
CACLIENTTEST_FUNC_ENTRY("CaServicePrivate::removeEntriesFromGroup");
mErrorCode = mProxy->removeEntriesFromGroup(groupId, entryIdList);
+ if (mErrorCode == ServerTerminated) {
+ if (!mProxy->connect()) {
+ if (mNotifierProxy) {
+ mNotifierProxy->connectSessions();
+ }
+ mErrorCode = mProxy->removeEntriesFromGroup(groupId, entryIdList);
+ }
+ }
qDebug() << "CaServicePrivate::removeEntriesFromGroup mErrorCode:"
<< mErrorCode;
@@ -1250,7 +1349,10 @@
*/
CaNotifier *CaServicePrivate::createNotifier(const CaNotifierFilter &filter)
{
- return new CaNotifier(new CaNotifierPrivate(filter));
+ if (!mNotifierProxy) {
+ mNotifierProxy = new CaClientNotifierProxy();
+ }
+ return new CaNotifier(new CaNotifierPrivate(filter, mNotifierProxy));
}
/*!
@@ -1265,7 +1367,14 @@
CACLIENTTEST_FUNC_ENTRY("CaServicePrivate::customSort");
mErrorCode = mProxy->customSort(entryIdList, groupId);
-
+ if (mErrorCode == ServerTerminated) {
+ if (!mProxy->connect()) {
+ if (mNotifierProxy) {
+ mNotifierProxy->connectSessions();
+ }
+ mErrorCode = mProxy->customSort(entryIdList, groupId);
+ }
+ }
CACLIENTTEST_FUNC_EXIT("CaServicePrivate::customSort");
return (mErrorCode == NoErrorCode);
--- a/contentstorage/caclient/stub/inc/caclientnotifierproxy.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/stub/inc/caclientnotifierproxy.h Fri Apr 30 15:22:08 2010 +0300
@@ -27,42 +27,9 @@
class CaEntry;
class CaNotifierFilter;
-
-/**
- * IDataObserver
- *
- */
-class IDataObserver
-{
-public:
- /**
- * Method invoked when entry is changed.
- * @param entryId entry id.
- * @param changeType change type.
- */
- virtual void entryChanged(int entryId,
- ChangeType changeType) const = 0;
+class CaObserver;
- /**
- * Method invoked when entry is changed.
- * @param entry entry.
- * @param changeType change type.
- */
- virtual void entryChanged(const CaEntry &entry,
- ChangeType changeType) const = 0;
- /**
- * Method invoked when entry was changed.
- * @param entryId entry id.
- */
- virtual void entryTouched(int id) const = 0;
-
- /**
- * Method invoked when entry was changed.
- * @param groupId group id.
- */
- virtual void groupContentChanged(int groupId) const = 0;
-};
class CACLIENT_EXPORT CaClientNotifierProxy: public QObject
@@ -83,33 +50,6 @@
~CaClientNotifierProxy();
/**
- * Method invoked when entry is changed.
- * @param entryId entry id.
- * @param changeType change type.
- */
- virtual void entryChanged(int entryId, ChangeType changeType) const;
-
- /**
- * Method invoked when entry is changed.
- * @param entry entry.
- * @param changeType change type.
- */
- virtual void entryChanged(const CaEntry &entry,
- ChangeType changeType) const;
-
- /**
- * Method invoked when entry was changed.
- * @param entryId entry id.
- */
- virtual void entryTouched(int id) const;
-
- /**
- * Method invoked when entry was changed.
- * @param groupId group id.
- */
- virtual void groupContentChanged(int groupId) const;
-
- /**
* Method for registering notifier
*
* @param notifierFilter notifierFilter used to register notifier.
@@ -119,7 +59,7 @@
int registerNotifier(
const CaNotifierFilter *notifierFilter,
CaNotifierPrivate::NotifierType notifierType,
- const CaClientNotifierProxy *notifierProxy);
+ const CaObserver *observer);
/**
* Method for unregistering notifier.
@@ -131,19 +71,15 @@
const CaNotifierFilter ¬ifierFilter,
CaNotifierPrivate::NotifierType notifierType);
-signals:
- void signalEntryChanged(int entryId, ChangeType changeType) const;
- void signalEntryChanged(const CaEntry &entry,
- ChangeType changeType) const;
- void signalEntryTouched(int id) const;
- void signalGroupContentChanged(int groupId) const;
+ /**
+ * Reconnect all sessions when server was terminated
+ *
+ */
+ void connectSessions();
private:
- // Mutex to serialize registering/unregistering for notifications.
- QMutex mMutex;
-
Q_DISABLE_COPY(CaClientNotifierProxy)
};
--- a/contentstorage/caclient/stub/inc/canotifiers.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/stub/inc/canotifiers.h Fri Apr 30 15:22:08 2010 +0300
@@ -24,14 +24,14 @@
#include "canotifier_p.h"
class CaNotifierFilter;
-class CaClientNotifierProxy;
+class CaObserver;
class CaNotifiers
{
public:
static int addNotifier(const CaNotifierFilter *notifierFilter,
CaNotifierPrivate::NotifierType notifierType,
- const CaClientNotifierProxy *notifierProxy);
+ const CaObserver *notifierProxy);
static void removeNotifier(const CaNotifierFilter *notifierFilter,
CaNotifierPrivate::NotifierType notifierType);
@@ -53,7 +53,7 @@
private:
typedef QPair<const CaNotifierFilter *,
CaNotifierPrivate::NotifierType> NotifierKey;
- typedef QHash<NotifierKey, const CaClientNotifierProxy *> NotifierHash;
+ typedef QHash<NotifierKey, const CaObserver *> NotifierHash;
private:
static NotifierHash mNotifiers;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/stub/inc/caobserver.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description : Content Arsenal client session
+ *
+ */
+
+#ifndef CAOBSERVER_H_
+#define CAOBSERVER_H_
+
+#include <QObject>
+#include <QMutex>
+
+#include "cadefs.h"
+
+
+class CaEntry;
+
+
+class CaObserver: public QObject
+{
+ Q_OBJECT
+public:
+ /**
+ * Constructor.
+ * @param parent pointer to parent. Defaults to NULL.
+ */
+ CaObserver(QObject *parent = 0);
+
+ /**
+ * Destructor.
+ */
+ ~CaObserver();
+
+ /**
+ * Method invoked when entry is changed.
+ * @param entryId entry id.
+ * @param changeType change type.
+ */
+ void entryChanged(int entryId,
+ ChangeType changeType) const;
+
+ /**
+ * Method invoked when entry is changed.
+ * @param entry entry.
+ * @param changeType change type.
+ */
+ void entryChanged(const CaEntry &entry,
+ ChangeType changeType) const;
+
+ /**
+ * Method invoked when entry was changed.
+ * @param entryId entry id.
+ */
+ void entryTouched(int id) const;
+
+ /**
+ * Method invoked when entry was changed.
+ * @param groupId group id.
+ */
+ void groupContentChanged(int groupId) const;
+
+signals:
+
+ void signalEntryChanged(int entryId, ChangeType changeType) const;
+ void signalEntryChanged(const CaEntry &entry,
+ ChangeType changeType) const;
+ void signalEntryTouched(int id) const;
+ void signalGroupContentChanged(int groupId) const;
+};
+
+
+#endif /* CAOBSERVER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/stub/inc/hswidgetcomponentdescriptor.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef HSWIDGETCOMPONENTDESCRIPTION_H
+#define HSWIDGETCOMPONENTDESCRIPTION_H
+
+
+#include <QDataStream>
+#include <QMetaType>
+
+class HsWidgetComponentDescriptor
+{
+public:
+ QString installationPath;
+ QString uri;
+ QString title;
+ QString description;
+ QString iconUri;
+ QString hidden;
+ QString serviceXml;
+ QString version;
+ bool isValid();
+};
+
+Q_DECLARE_METATYPE(HsWidgetComponentDescriptor)
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/stub/inc/hswidgetcomponentparser.h Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,39 @@
+#ifndef HSWIDGETCOMPONENTPARSER_H
+#define HSWIDGETCOMPONENTPARSER_H
+
+#include <QObject>
+#include <QXmlStreamReader>
+#include "hswidgetcomponentdescriptor.h"
+
+class HsWidgetComponentParser : public QObject
+{
+ Q_OBJECT
+
+public:
+ HsWidgetComponentParser(const QString &aComponentManifest, QObject *parent=0);
+ ~HsWidgetComponentParser();
+ HsWidgetComponentDescriptor widgetComponentDescriptor();
+ bool error();
+private:
+ void parseFile(const QString &aComponentManifest);
+ void parseWidgetManifestTag();
+ void parseWidgetProviderTag();
+
+ void parseVersion1_0();
+
+ void parseUri();
+ void parseIcon();
+ void parseTitle();
+ void parseDescription();
+ void parseHidden();
+ void parseServiceXml();
+
+
+ bool isWidgetTagValid();
+private:
+ QXmlStreamReader mParser;
+ HsWidgetComponentDescriptor mComponentDescriptor;
+ bool mError;
+};
+
+#endif // HSWIDGETCOMPONENTPARSER_H
--- a/contentstorage/caclient/stub/src/caclientnotifierproxy.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/stub/src/caclientnotifierproxy.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -40,55 +40,14 @@
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
-void CaClientNotifierProxy::entryChanged(int entryId,
- ChangeType changeType) const
-{
- qDebug() << "CaClientProxy::entryChanged entryId:"
- << entryId << "changeType:" << changeType;
- emit signalEntryChanged(entryId, changeType);
-}
-
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
-void CaClientNotifierProxy::entryChanged(const CaEntry &entry,
- ChangeType changeType) const
-{
- qDebug() << "CaClientProxy::entryChanged changeType:" << changeType;
- CaEntry *caEntry = new CaEntry(entry);
- emit signalEntryChanged(*caEntry, changeType);
-}
-
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
-void CaClientNotifierProxy::entryTouched(int id) const
-{
- qDebug() << "CaClientProxy::entryTouched id:" << id;
- emit signalEntryTouched(id);
-}
-
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
-void CaClientNotifierProxy::groupContentChanged(int groupId) const
-{
- qDebug() << "CaClientProxy::groupContentChanged groupId:" << groupId;
- emit signalGroupContentChanged(groupId);
-}
-
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
int CaClientNotifierProxy::registerNotifier(
const CaNotifierFilter *notifierFilter,
CaNotifierPrivate::NotifierType notifierType,
- const CaClientNotifierProxy *notifierProxy)
+ const CaObserver *observer)
{
qDebug() << "CaClientProxy::registerNotifier notifierType:"
<< notifierType;
- QMutexLocker locker(&mMutex);
- return CaNotifiers::addNotifier(notifierFilter, notifierType, notifierProxy);
+ return CaNotifiers::addNotifier(notifierFilter, notifierType, observer);
}
//----------------------------------------------------------------------------
@@ -100,7 +59,16 @@
{
qDebug() << "CaClientProxy::unregisterNotifier notifierType:"
<< notifierType;
- QMutexLocker locker(&mMutex);
CaNotifiers::removeNotifier(¬ifierFilter, notifierType);
}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaClientNotifierProxy::connectSessions()
+{
+ qDebug() << "Nothing to do on windows";
+}
+
+
--- a/contentstorage/caclient/stub/src/canotifiers.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/stub/src/canotifiers.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -19,13 +19,14 @@
#include <QStringList>
#include "canotifiers.h"
+#include "caobserver.h"
#include "caclientnotifierproxy.h"
CaNotifiers::NotifierHash CaNotifiers::mNotifiers;
int CaNotifiers::addNotifier(const CaNotifierFilter *notifierFilter,
CaNotifierPrivate::NotifierType notifierType,
- const CaClientNotifierProxy *notifierProxy)
+ const CaObserver *notifierProxy)
{
NotifierKey key = NotifierKey(notifierFilter, notifierType);
if (!mNotifiers.contains(key)) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/stub/src/caobserver.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include <QDebug>
+#include "caobserver.h"
+#include "caobjectadapter.h"
+#include "caentry.h"
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaObserver::CaObserver(QObject *parent) :
+ QObject(parent)
+{
+}
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaObserver::~CaObserver()
+{
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaObserver::entryChanged(int entryId,
+ ChangeType changeType) const
+{
+ qDebug() << "CaClientProxy::entryChanged entryId:"
+ << entryId << "changeType:" << changeType;
+ emit signalEntryChanged(entryId, changeType);
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaObserver::entryChanged(const CaEntry &entry,
+ ChangeType changeType) const
+{
+ qDebug() << "CaClientProxy::entryChanged changeType:" << changeType;
+ CaEntry *caEntry = new CaEntry(entry);
+ emit signalEntryChanged(*caEntry, changeType);
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaObserver::entryTouched(int id) const
+{
+ qDebug() << "CaClientProxy::entryTouched id:" << id;
+ emit signalEntryTouched(id);
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaObserver::groupContentChanged(int groupId) const
+{
+ qDebug() << "CaClientProxy::groupContentChanged groupId:" << groupId;
+
+ emit signalGroupContentChanged(groupId);
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/stub/src/hswidgetcomponentdescriptor.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "hswidgetcomponentdescriptor.h"
+
+bool HsWidgetComponentDescriptor::isValid()
+{
+ bool ret(false);
+ if (version == "1.0") {
+ ret = !(uri.isEmpty() || serviceXml.isEmpty() || title.isEmpty());
+ } else if (version.isEmpty()) {
+ ret = !(uri.isEmpty() || title.isEmpty());
+ }
+ return ret;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/stub/src/hswidgetcomponentparser.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,190 @@
+#include "hswidgetcomponentparser.h"
+#include <QFile>
+
+const char WIDGETPROVIDER[] = "widgetprovider";
+const char WIDGET[] = "widget";
+const char WIDGETMANIFEST[] = "hswidgetmanifest";
+
+const char URI[] = "uri";
+const char TITLE[] = "title";
+const char ICONURI[] = "iconuri";
+const char ICON[] = "icon";
+const char DESCRIPTION[] = "description";
+const char HIDDEN[] = "hidden";
+const char SERVICEXML[] = "servicexml";
+const char VERSION[] = "version";
+const char VERSION_1_0[] = "1.0";
+
+
+
+HsWidgetComponentParser::HsWidgetComponentParser(const QString &aComponentManifest, QObject *parent)
+ : QObject(parent),mError(false)
+{
+ parseFile(aComponentManifest);
+}
+
+HsWidgetComponentParser::~HsWidgetComponentParser()
+{
+
+}
+
+HsWidgetComponentDescriptor HsWidgetComponentParser::widgetComponentDescriptor()
+{
+ return mComponentDescriptor;
+}
+
+bool HsWidgetComponentParser::error()
+{
+ return mError;
+}
+
+void HsWidgetComponentParser::parseFile(const QString &aComponentManifest)
+{
+ QFile file(aComponentManifest);
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ mError = false;
+ return;
+ }
+ mParser.setDevice(&file);
+ if (mParser.readNextStartElement()) {
+ if (mParser.name() == WIDGETMANIFEST){
+ parseWidgetManifestTag();
+ } else if(mParser.name() == WIDGETPROVIDER){
+ parseWidgetProviderTag();
+ } else {
+ mParser.raiseError(QObject::tr("Malformed manifest"));
+ }
+ } else {
+ mParser.raiseError(QObject::tr("Malformed manifest"));
+ }
+ mError = mParser.error();
+
+}
+
+void HsWidgetComponentParser::parseWidgetManifestTag()
+{
+ Q_ASSERT(mParser.isStartElement() && mParser.name() == WIDGETMANIFEST);
+
+ /* Detect version */
+ if (mParser.attributes().hasAttribute(VERSION)) {
+ QStringRef version = mParser.attributes().value(VERSION);
+ mComponentDescriptor.version = version.toString();
+ if (version == VERSION_1_0) {
+ parseVersion1_0();
+ }
+ } else {
+ // newest is default
+ parseVersion1_0();
+ mComponentDescriptor.version = VERSION_1_0;
+ }
+}
+
+void HsWidgetComponentParser::parseWidgetProviderTag()
+{
+ Q_ASSERT(mParser.isStartElement() && mParser.name() == WIDGETPROVIDER);
+ if (!mParser.readNextStartElement() || mParser.name() != WIDGET) {
+ mParser.raiseError(QObject::tr("Malformed manifest"));
+ return;
+ }
+
+ // everything is in attributes
+ QXmlStreamAttributes attrs = mParser.attributes();
+ foreach (QXmlStreamAttribute attr, attrs) {
+ QStringRef name = attr.name();
+ if (name == URI) {
+ mComponentDescriptor.uri = attr.value().toString();
+ } else if (name == ICONURI) {
+ mComponentDescriptor.iconUri = attr.value().toString();
+ } else if (name == TITLE) {
+ mComponentDescriptor.title = attr.value().toString();
+ } else if (name == DESCRIPTION) {
+ mComponentDescriptor.description = attr.value().toString();
+ } else if (name == HIDDEN) {
+ mComponentDescriptor.hidden = attr.value().toString();
+ }
+ }
+
+}
+void HsWidgetComponentParser::parseVersion1_0()
+{
+ Q_ASSERT(mParser.isStartElement() && mParser.name() == WIDGETMANIFEST);
+ /* We'll parse the XML until we reach </hswidgetmanifest> tag, end of cml or have an error. */
+ while( !(mParser.tokenType() == QXmlStreamReader::EndElement && mParser.name() == WIDGETMANIFEST) &&
+ !mParser.hasError() && !mParser.atEnd()) {
+
+ mParser.readNext();
+ if (mParser.tokenType() != QXmlStreamReader::StartElement) {
+ continue;
+ }
+ /* Read next start element.*/
+ QStringRef tag = mParser.name();
+ if(tag == URI) {
+ parseUri();
+ } else if (tag == ICON) {
+ parseIcon();
+ } else if (tag == TITLE) {
+ parseTitle();
+ } else if (tag == DESCRIPTION) {
+ parseDescription();
+ } else if (tag == HIDDEN) {
+ parseHidden();
+ } else if (tag == SERVICEXML) {
+ parseServiceXml();
+ }
+ }
+}
+
+
+void HsWidgetComponentParser::parseUri()
+{
+ mParser.readNext();
+ if(mParser.tokenType() != QXmlStreamReader::Characters) {
+ return;
+ }
+ mComponentDescriptor.uri = mParser.text().toString();
+}
+void HsWidgetComponentParser::parseIcon()
+{
+ mParser.readNext();
+ if(mParser.tokenType() != QXmlStreamReader::Characters) {
+ return;
+ }
+ mComponentDescriptor.iconUri = mParser.text().toString();
+}
+void HsWidgetComponentParser::parseTitle()
+{
+ mParser.readNext();
+ if(mParser.tokenType() != QXmlStreamReader::Characters) {
+ return;
+ }
+ mComponentDescriptor.title = mParser.text().toString();
+}
+void HsWidgetComponentParser::parseDescription()
+{
+ mParser.readNext();
+ if(mParser.tokenType() != QXmlStreamReader::Characters) {
+ return;
+ }
+ mComponentDescriptor.description = mParser.text().toString();
+}
+void HsWidgetComponentParser::parseHidden()
+{
+ mParser.readNext();
+ if(mParser.tokenType() != QXmlStreamReader::Characters) {
+ return;
+ }
+ mComponentDescriptor.hidden = mParser.text().toString();
+}
+void HsWidgetComponentParser::parseServiceXml()
+{
+ mParser.readNext();
+ if(mParser.tokenType() != QXmlStreamReader::Characters) {
+ return;
+ }
+ mComponentDescriptor.serviceXml = mParser.text().toString();
+}
+
+bool HsWidgetComponentParser::isWidgetTagValid()
+{
+ return true;
+}
--- a/contentstorage/caclient/stub/src/hswidgetregistryservice.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/caclient/stub/src/hswidgetregistryservice.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -21,15 +21,9 @@
#include "hswidgetregistryservice.h"
#include "hswidgetregistryservice_p.h"
-#include "hswidgetprovidermanifest.h"
+#include "hswidgetcomponentdescriptor.h"
+#include "hswidgetcomponentparser.h"
-const char POSTERURI[] = "homescreen.nokia.com/widget/poster/";
-const char POSTERWIDGETNAME[] = "name";
-const char POSTERWIDGETID[] = "posterwidgetid";
-const char PUBLISHER[] = "publisher";
-const char TEMPLATETYPE[] = "templatetype";
-const char CONTENTID[] = "contentid";
-const char CONTENTTYPE[] = "contenttype";
/*!
?Qt_style_documentation
@@ -161,7 +155,6 @@
const QString &manifestFilePath)
{
QList<HsWidgetToken> widgets;
- HsWidgetProviderManifest manifest;
QStringList filters("*.manifest");
QDir dir(manifestFilePath);
QStringList manifestDir = dir.entryList(filters, QDir::Files);
@@ -169,12 +162,30 @@
if (!manifestDir.isEmpty()) {
// ?
QString fileName = manifestDir.first();
+ HsWidgetComponentParser componentParser(dir.absoluteFilePath(fileName));
+ if ( !componentParser.error() ) {
+ HsWidgetToken widgetToken;
+ HsWidgetComponentDescriptor widgetDescriptor = componentParser.widgetComponentDescriptor();
+ widgetToken.mUri = widgetDescriptor.uri;
+ widgetToken.mLibrary = manifestFilePath + "/" + widgetDescriptor.uri + ".dll";
+ widgetToken.mTitle = widgetDescriptor.title;
+ if (widgetDescriptor.iconUri.length() > 0 ) {
+ widgetToken.mIconUri = manifestFilePath + "/" + widgetDescriptor.iconUri;
+ }
+ widgetToken.mDescription = widgetDescriptor.description;
+ int widgetUid = dir.dirName().toUInt(0, 16);
+ widgetToken.mUid = widgetUid;
+ widgets << widgetToken;
+ qDebug() << "HsWidgetRegistryServicePrivate::readManifestFile - " \
+ "widget added: " << fileName;
+ }
+#if 0
if (fileName != "hsposterwidgetprovider.manifest") {
// Directory differs from the poster widget's directory
// which is not supported for the time being.
- manifest.loadFromXml(dir.absoluteFilePath(fileName));
- widgets = manifest.widgets();
+// manifest.loadFromXml(dir.absoluteFilePath(fileName));
+// widgets = manifest.widgets();
int widgetUid = dir.dirName().toUInt(0, 16);
// ?
@@ -190,6 +201,7 @@
qDebug() << "HsWidgetRegistryServicePrivate::readManifestFile - " \
"widget added: " << fileName;
}
+#endif
}
return widgets;
}
--- a/contentstorage/cahandler/tapp/src/catapphandler.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/cahandler/tapp/src/catapphandler.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -70,7 +70,7 @@
// e.g. QUrl url ("application://101F7AE7?");
QUrl url(QString::fromUtf16(attribute.Ptr(), attribute.Length()));
- QScopedPointer<XQAiwRequest> request(mAiwMgr->create(url, true));
+ QScopedPointer<XQAiwRequest> request(mAiwMgr->create(url, false));
if (!request.isNull()) {
bool res = request->send();
if (!res) {
--- a/contentstorage/casrv/caappscanner/inc/casrvappscanner.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/caappscanner/inc/casrvappscanner.h Fri Apr 30 15:22:08 2010 +0300
@@ -157,7 +157,7 @@
* @result id of download collection
*/
TInt GetCollectionDownloadIdL();
-
+
/**
* Gets collectionId of all collection
* @result id of all collection
@@ -169,7 +169,7 @@
* @param aEntryId application entry id.
*/
void AddEntryToDownloadedCollectionL( TInt aEntryId );
-
+
/**
* Add application entry to predefined collection
* @param aEntry application entry.
@@ -177,14 +177,14 @@
*/
void AddEntryToPredefinedCollectionL( CCaInnerEntry* aEntry,
TBool aUpdate = EFalse );
-
+
/**
* Create predefined collection
* @param aGroupName group name.
* @result id of new created collection
*/
TInt CreatePredefinedCollectionL( const TDesC& aGroupName );
-
+
/**
* Add collection to all collection.
* @param aCollectionId collection id to add.
@@ -200,20 +200,20 @@
TBool HandleLockDeleteFlagUpdateL( CCaInnerEntry* aItem );
/**
- * Updates application's missing attribute.
+ * Updates application's missing and visible flags.
* Add new menu item referring to this application.
* @param aItem menu item.
- * @return ETrue if missing flag was updated
+ * @return ETrue if flags were updated
*/
- TBool HandleMissingFlagUpdate( CCaInnerEntry* aItem );
+ TBool HandleMissingVisibleFlagsUpdate( CCaInnerEntry* aItem );
/**
- * Updates hidden flag.
+ * Updates visible flag.
* @param aItem menu item.
* @param aUid Application's uid.
- * @return ETrue if hidden flag was updated
+ * @return ETrue if visible flag was updated
*/
- TBool HandleHiddenFlagUpdateL( CCaInnerEntry* aItem );
+ TBool HandleVisibleFlagUpdate( CCaInnerEntry* aItem );
/**
* Updates used flag.
@@ -221,7 +221,7 @@
* @param aUid Application's uid.
* @return ETrue if used flag was updated
*/
- TBool HandleUsedFlagUpdateL( CCaInnerEntry* aItem );
+ TBool HandleUsedFlagUpdate( CCaInnerEntry* aItem );
/**
* Updates mmc attribute.
* @param aItem menu item.
@@ -328,11 +328,16 @@
void RemoveAppL( CCaInnerEntry* aAppEntry );
/**
- * Adds flag objects(only one flag at time).
+ * Set "missing" flag.
* @param aEntry entry.
- * @param aFlag menu item's flag.
*/
- void AddObjectFlagL( CCaInnerEntry* aEntry, const TInt& aFlag );
+ void SetMissingFlagL( CCaInnerEntry* aEntry );
+
+ /**
+ * Set "visible" flag.
+ * @param aEntry entry.
+ */
+ void ClearVisibleFlagL( CCaInnerEntry* aEntry );
/**
* Check currently inserted MMC card, update and save MMC history.
@@ -410,12 +415,12 @@
* Notifys storage abaut updated apps
*/
void InstallationNotifyL();
-
+
/**
* Make not empty collections with not hidden apps visible.
*/
void MakeNotEmptyCollectionsVisibleL();
-
+
/**
* Make collection visible if has visible entry.
* @param aEntry application entry
--- a/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -222,33 +222,38 @@
void CCaSrvAppScanner::UpdateAppEntryL( CCaInnerEntry* aEntry, TUint aMmcId )
{
TBool toUpdate = HandleMmcAttrUpdateL( aEntry, aMmcId );
- toUpdate = HandleHiddenFlagUpdateL( aEntry ) || toUpdate;
- toUpdate = HandleMissingFlagUpdate( aEntry ) || toUpdate;
+ TBool missingVisibleFlagChanged =
+ HandleMissingVisibleFlagsUpdate( aEntry );
+ toUpdate = missingVisibleFlagChanged || toUpdate;
toUpdate = HandleLockDeleteFlagUpdateL( aEntry ) || toUpdate;
toUpdate = SetApaAppInfoL( aEntry ) || toUpdate;
-
+
if( iInstalledPackages.Find( aEntry->GetUid() ) != KErrNotFound )
{
AddEntryToDownloadedCollectionL( aEntry->GetId() );
- toUpdate = HandleUsedFlagUpdateL( aEntry ) || toUpdate;
+ toUpdate = HandleUsedFlagUpdate( aEntry ) || toUpdate;
+ AddEntryToPredefinedCollectionL( aEntry, ETrue );
}
if( toUpdate )
{
//update app in storage
- iCaStorageProxy.AddL( aEntry );
+ TItemAppearance itemAppearanceChange = EItemAppearanceNotChanged;
+ if( missingVisibleFlagChanged )
+ {
+ itemAppearanceChange = EItemAppeared;
+ }
+ iCaStorageProxy.AddL( aEntry, EFalse, itemAppearanceChange );
RemoveFromInstalledPackages( aEntry->GetUid() );
- AddEntryToPredefinedCollectionL( aEntry, ETrue );
}
}
// ---------------------------------------------------------
-// CCaSrvAppScanner::HandleHiddenFlagUpdateL
+//
// ---------------------------------------------------------
//
-TBool CCaSrvAppScanner::HandleHiddenFlagUpdateL( CCaInnerEntry* aItem )
+TBool CCaSrvAppScanner::HandleVisibleFlagUpdate( CCaInnerEntry* aItem )
{
TBool toChange( EFalse );
- TBool itemHidden = ( 0 == ( aItem->GetFlags() & EVisible ) );
- if( itemHidden )
+ if( !( aItem->GetFlags() & EVisible ) )
{
aItem->SetFlags( aItem->GetFlags() | EVisible );
toChange = ETrue;
@@ -257,20 +262,18 @@
}
// ---------------------------------------------------------
-// CCaSrvAppScanner::HandleUsedFlagUpdateL
+//
// ---------------------------------------------------------
//
-TBool CCaSrvAppScanner::HandleUsedFlagUpdateL( CCaInnerEntry* aItem )
+TBool CCaSrvAppScanner::HandleUsedFlagUpdate( CCaInnerEntry* aItem )
{
+ TBool changed( EFalse );
if( aItem->GetFlags() & EUsed )
{
aItem->SetFlags( aItem->GetFlags() & ~EUsed );
- return ETrue;
+ changed = ETrue;
}
- else
- {
- return EFalse;
- }
+ return changed;
}
// ---------------------------------------------------------
@@ -391,18 +394,17 @@
// CCaSrvAppScanner::HandleMissingFlagUpdateL
// ---------------------------------------------------------
//
-TBool CCaSrvAppScanner::HandleMissingFlagUpdate( CCaInnerEntry* aItem )
+TBool CCaSrvAppScanner::HandleMissingVisibleFlagsUpdate( CCaInnerEntry* aItem )
{
- if( aItem->GetFlags() & EMissing )
+ TBool ret( EFalse );
+ if( aItem->GetFlags() & EMissing ||
+ !( aItem->GetFlags() & EVisible ) )
{
- //application found so we unset "missing" flag
- aItem->SetFlags( aItem->GetFlags() & ~EMissing );
- return ETrue;
+ //application found so we unset "missing" and set "visible" flags
+ aItem->SetFlags( aItem->GetFlags() & ~EMissing | EVisible );
+ ret = ETrue;
}
- else
- {
- return EFalse;
- }
+ return ret;
}
// ---------------------------------------------------------
@@ -449,17 +451,20 @@
appEntry, TIdentityRelation<CCaInnerEntry>( UidMatch ) );
if ( index != KErrNotFound )
- { // hs app already in storage - ensure it is hidden and remove from resultArray
- if ( ( aArray[index]->GetFlags() & EVisible ) != 0 )
+ {
+ // hs app already in storage - ensure it is hidden
+ // and remove from resultArray
+ if ( aArray[index]->GetFlags() & EVisible )
{
aArray[index]->SetFlags( aArray[index]->GetFlags() & ~EVisible);
- iCaStorageProxy.AddL( aArray[index] );
+ iCaStorageProxy.AddL( aArray[index], EFalse, EItemDisappeared );
}
delete aArray[index];
aArray.Remove( index );
}
else
- { // if not found add as not visible to the storage
+ {
+ // if not found add as not visible to the storage
appEntry->SetEntryTypeNameL( KCaTypeApp );
appEntry->SetFlags( 0 );
appEntry->SetRole( EItemEntryRole );
@@ -556,7 +561,7 @@
typenameArray->AppendL( KCaTypeMenuCollections );
getAllCollectionIdQuery->SetEntryTypeNames( typenameArray );
CleanupStack::Pop( typenameArray );
-
+
RArray<TInt> idArray;
CleanupClosePushL( idArray );
iCaStorageProxy.GetEntriesIdsL( getAllCollectionIdQuery,
@@ -676,8 +681,8 @@
RPointerArray<CCaInnerEntry> resultArray;
CleanupResetAndDestroyPushL( resultArray );
GetCaAppEntriesL( aAppUid, resultArray );
- if( resultArray.Count() )
- {
+ if( resultArray.Count() && ( resultArray[0]->GetFlags() & EVisible ) )
+ {//TODO: this only for icons. This functionality should be change
iCaStorageProxy.AddL( resultArray[0] );
}
CleanupStack::PopAndDestroy( &resultArray );
@@ -715,10 +720,10 @@
{
// appgroup_name is defined for this app. Find or create folder.
CCaInnerQuery *innerQuery = CCaInnerQuery::NewLC();
- innerQuery->SetRole( CCaInnerQuery::Group );
+ innerQuery->SetRole( CCaInnerQuery::Group );
innerQuery->AddAttributeL( KCaAppGroupName,
capability().iGroupName );
-
+
// get entries by attributes
RPointerArray<CCaInnerEntry> resultArrayItems;
CleanupResetAndDestroyPushL( resultArrayItems );
@@ -730,10 +735,10 @@
entryIds.AppendL( entryId );
TCaOperationParams organizeParams;
organizeParams.iBeforeEntryId = 0;
-
+
if( resultArrayItems.Count() )
{
- // collection with appgroup_name exist - add entry
+ // collection with appgroup_name exist - add entry
// to this collection
organizeParams.iGroupId = resultArrayItems[0]->GetId();
}
@@ -742,29 +747,29 @@
// create new collection
TInt predefinedCollectionId = CreatePredefinedCollectionL(
capability().iGroupName );
-
+
organizeParams.iGroupId = predefinedCollectionId;
- // add new collection to all collection
+ // add new collection to all collection
AddCollectionToAllCollectionL( predefinedCollectionId );
-
+
if( aUpdate )
{
organizeParams.iOperationType = TCaOperationParams::EAppend;
iCaStorageProxy.OrganizeL( entryIds, organizeParams );
}
}
-
+
if( !aUpdate )
{
organizeParams.iOperationType = TCaOperationParams::EAppend;
iCaStorageProxy.OrganizeL( entryIds, organizeParams );
}
-
+
CleanupStack::PopAndDestroy( &entryIds );
CleanupStack::PopAndDestroy( &resultArrayItems );
CleanupStack::PopAndDestroy( innerQuery );
- }
+ }
}
// ---------------------------------------------------------
@@ -787,7 +792,7 @@
// Get new collection Id
TInt newCollectionId = innerEntry->GetId();
CleanupStack::PopAndDestroy( innerEntry );
-
+
return newCollectionId;
}
@@ -800,7 +805,7 @@
RArray<TInt> entryIds;
CleanupClosePushL( entryIds );
entryIds.AppendL( aCollectionId );
-
+
TCaOperationParams organizeParams;
organizeParams.iBeforeEntryId = 0;
organizeParams.iOperationType = TCaOperationParams::EAppend;
@@ -862,9 +867,9 @@
HandleMmcAttrUpdateL( appEntry, aCurrentMmcId );
iCaStorageProxy.AddL( appEntry );
-
+
AddEntryToPredefinedCollectionL( appEntry );
-
+
if( iInstalledPackages.Find( aUid ) != KErrNotFound )
{
AddEntryToDownloadedCollectionL( appEntry->GetId() );
@@ -920,7 +925,7 @@
aEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueJava );
aEntry->AddAttributeL( KCaAttrAppSettingsPlugin, KCaAttrJavaAppSettingsPluginValue );
}
- else if (appTypeUid == KCWRTApplicationTypeUid)
+ else if (appTypeUid == KCWRTApplicationTypeUid)
{
aEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueCWRT );
aEntry->AddAttributeL( KCaAttrAppWidgetUri, KCaAttrAppWidgetUriCWRTValue );
@@ -948,34 +953,32 @@
for( TInt i = 0; i < aCaEntries.Count(); i++ )
{
const TInt id = aCaEntries[i]->GetId();
- TUint mmcId = 0;
RBuf attrVal;
attrVal.CleanupClosePushL();
attrVal.CreateL( KCaMaxAttrValueLen );
if( aCaEntries[i]->FindAttribute( KCaAttrMmcId(), attrVal ) )
{
+ TUint mmcId = 0;
MenuUtils::GetTUint( attrVal, mmcId );
- if( mmcId && KErrNotFound != iMmcHistory->Find( mmcId )
- && mmcId != CurrentMmcId() )
+ if( ( mmcId && KErrNotFound != iMmcHistory->Find( mmcId )
+ && mmcId != CurrentMmcId() ) ||
+ ( attrVal == KCaMassStorage() &&
+ IsDriveInUse( DriveInfo::EDefaultMassStorage ) ) )
{
- // This item is on an MMC which is currently in the MMC history.
+ // This item is on an MMC which is currently
+ // in the MMC history or on a mass storage in use.
// Set it "missing" but keep it.
- AddObjectFlagL( aCaEntries[i], EMissing );
- }
- else if ( attrVal == KCaMassStorage()
- && IsDriveInUse( DriveInfo::EDefaultMassStorage ) )
- {
- AddObjectFlagL( aCaEntries[i], EMissing );
+ SetMissingFlagL( aCaEntries[i] );
}
else
{
- //RemoveAppL( aCaEntries[i] );
- AddObjectFlagL( aCaEntries[i], EMissing );
+ aCaEntries[i]->RemoveAttributeL(KCaAttrMmcId());
+ ClearVisibleFlagL( aCaEntries[i] );
}
}
else
{
- AddObjectFlagL( aCaEntries[i], EMissing );
+ ClearVisibleFlagL( aCaEntries[i] );
}
CleanupStack::PopAndDestroy( &attrVal );
}
@@ -995,17 +998,28 @@
}
// ---------------------------------------------------------
-// CCaSrvAppScanner::AddObjectFlagL
+//
// ---------------------------------------------------------
//
-void CCaSrvAppScanner::AddObjectFlagL(
- CCaInnerEntry* aEntry, const TInt& aFlags )
+void CCaSrvAppScanner::SetMissingFlagL( CCaInnerEntry* aEntry )
{
- TBool itemFlagPresent = ( 0 != ( aEntry->GetFlags() & aFlags ) );
- if( !itemFlagPresent )
+ if( !( aEntry->GetFlags() & EMissing ) )
{
- aEntry->SetFlags( aEntry->GetFlags() | aFlags );
- iCaStorageProxy.AddL( aEntry );
+ aEntry->SetFlags( aEntry->GetFlags() | EMissing );
+ iCaStorageProxy.AddL( aEntry, EFalse, EItemDisappeared );
+ }
+ }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+void CCaSrvAppScanner::ClearVisibleFlagL( CCaInnerEntry* aEntry )
+ {
+ if( aEntry->GetFlags() & EVisible )
+ {
+ aEntry->SetFlags( aEntry->GetFlags() & ~EVisible & ~EMissing & ~EUsed );
+ iCaStorageProxy.AddL( aEntry, EFalse, EItemDisappeared );
}
}
@@ -1181,16 +1195,17 @@
if( resultEntriesArray.Count() )
{
// set collection visible if hidden
- if( HandleHiddenFlagUpdateL( aEntry ) )
+ if( HandleVisibleFlagUpdate( aEntry ) )
{
// update here this collection
- iCaStorageProxy.AddL( aEntry, ETrue );
+ iCaStorageProxy.AddL( aEntry );
}
}
CleanupStack::PopAndDestroy( visibleEntriesQuery );
CleanupStack::PopAndDestroy( &resultEntriesArray );
}
+
// ==================== MEMBER FUNCTIONS ====================
// ---------------------------------------------------------
--- a/contentstorage/casrv/calocalizerscanner/calocalizerscanner.pro Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/calocalizerscanner/calocalizerscanner.pro Fri Apr 30 15:22:08 2010 +0300
@@ -16,6 +16,8 @@
include(./../../../common.pri)
+CONFIG += symbian_i18n hb
+
TRANSLATIONS=contentstorage.ts
symbian: {
@@ -56,7 +58,6 @@
-lcautils \
-lcamenu
}
-CONFIG += symbian_i18n
exportResources(./*.qm, resource/qt/translations)
--- a/contentstorage/casrv/calocalizerscanner/inc/calocalizerscannerproxy.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/calocalizerscanner/inc/calocalizerscannerproxy.h Fri Apr 30 15:22:08 2010 +0300
@@ -21,16 +21,14 @@
// INCLUDES
#include <e32std.h>
#include <e32base.h>
-#include <driveinfo.h>
-#include <QObject>
+#include "hbtextresolversymbian.h"
#include "castorage_global.h"
// FORWARD DECLARATIONS
class CCaLocalizationEntry;
-class QTranslator;
class CCaStorageProxy;
-
+class CCaInnerEntry;
/**
* CCaLocalizerScannerProxy
@@ -39,7 +37,6 @@
class CCaLocalizerScannerProxy : public CBase
{
-//CA_STORAGE_TEST_FRIEND_CLASS (TestCaLocalizerScanner)
public:
@@ -59,11 +56,7 @@
*/
~CCaLocalizerScannerProxy( );
- /**
- * Performs whole localization of database, can be called at any moment
- */
- void PerformL( );
-
+
private:
/**
@@ -83,36 +76,23 @@
void UpdateLocalNamesL( );
/**
- * Load translations to mTranslator
- * @param aFilename file name with translations
- * @return success or failure
- */
- TBool LoadTranslator( QString aFilename );
-
- /**
* Gets localization rows from database as table of CCaLocalizationEntries
* @param aLocals pointers to localization entries
*/
void GetLocalizationRowsL( RPointerArray<CCaLocalizationEntry>& aLocals );
- /**
- * Converts descriptor to const char*
- * @param aDescriptor descriptor with text to convert
- * @return pointer to const char containing text
- */
- const char* DescriptorToStringL( const TDesC& aDescriptor );
-
+ const TDesC& GetEntryText(
+ RPointerArray<CCaInnerEntry> aEntries, TInt aId );
/*
* Not own
*/
CCaStorageProxy* iStorageProxy;
/*
- * Own
- */
- QTranslator* iTranslator;
+ * Owned
+ */
+ HbTextResolverSymbian* iResolver;
- //CA_STORAGE_TEST_FRIEND_CLASS (TestCaLocalizerScanner)
};
#endif // CALOCALSCANNERPROXY_H
--- a/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -26,8 +26,10 @@
#include "calocalizerscannerproxy.h"
#include "castorageproxy.h"
#include "cadef.h"
+#include "cainnerquery.h"
+#include "cainnerentry.h"
-const char* KEmptyString = "";
+_LIT(KPathLoc,"z:/resource/qt/translations");
// ---------------------------------------------------------------------------
// CCaLocalizerScannerProxy::NewL
@@ -65,8 +67,13 @@
//
void CCaLocalizerScannerProxy::ConstructL()
{
- iTranslator = new ( ELeave ) QTranslator();
- PerformL();
+ TBuf<KCaMaxAttrNameLen> filenameDsc;
+ iStorageProxy->DbPropertyL( KCaDbPropQMfile, filenameDsc );
+ iResolver = new (ELeave) HbTextResolverSymbian;
+ iResolver->Init(filenameDsc, KPathLoc);
+ UpdateLocalNamesL();
+ delete iResolver;
+ iResolver = NULL;
}
// ---------------------------------------------------------------------------
@@ -88,46 +95,10 @@
//
CCaLocalizerScannerProxy::~CCaLocalizerScannerProxy()
{
- delete iTranslator;
- }
-
-// ---------------------------------------------------------------------------
-// CCaLocalizerScannerProxy::PerformL
-// ---------------------------------------------------------------------------
-//
-void CCaLocalizerScannerProxy::PerformL()
- {
- QString locale = QLocale::system().name();
- QString filename = QString( "contentstorage_" ) + locale;
- LoadTranslator( filename );
- TPtrC ptrLocale( reinterpret_cast<const TText*>( locale.constData() ) );
- TBuf<KCaMaxAttrNameLen> propertyValue;
- // trap is here to assure deletion of qtranslator in case code leaves
- iStorageProxy->DbPropertyL( KCaDbPropLanguage, propertyValue );
- if( ptrLocale.CompareC( propertyValue ) )
- {
- // language is changed - update locale names
- UpdateLocalNamesL();
- // remember info about new language in db
- iStorageProxy->SetDBPropertyL( KCaDbPropLanguage, ptrLocale );
- }
- }
-
-// ---------------------------------------------------------------------------
-// CCaLocalizerScannerProxy::LoadTranslator
-// ---------------------------------------------------------------------------
-//
-TBool CCaLocalizerScannerProxy::LoadTranslator( QString filename )
- {
- TBool loaded( false );
- // load from rom or testbase
- loaded = iTranslator->load( filename, QString( "z:/resource/qt/translations" ) );
- if( !loaded )
- {
- loaded = iTranslator->load( filename, QString( "c:/resource/qt/translations" ) );
- }
-
- return loaded;
+ if (iResolver)
+ {
+ delete iResolver;
+ }
}
// ---------------------------------------------------------------------------
@@ -151,47 +122,63 @@
{
RPointerArray<CCaLocalizationEntry> locals;
CleanupResetAndDestroyPushL( locals );
+ RPointerArray<CCaInnerEntry> entries;
+ CleanupResetAndDestroyPushL( entries );
+ RArray<TInt> ids;
+ CleanupClosePushL( ids );
+
GetLocalizationRowsL( locals );
- QString locName;
- RBuf localizedName;
- CleanupClosePushL( localizedName );
- localizedName.CreateL( KCaMaxAttrValueLen );
-
- for( TInt i = 0; i < locals.Count(); i++ )
+
+ TInt locCount = locals.Count();
+ for( TInt idx = 0; idx < locCount; idx++ )
+ {
+ ids.Append( locals[idx]->GetRowId() );
+ }
+ CCaInnerQuery* query = CCaInnerQuery::NewLC();
+ query->SetIdsL( ids );
+ iStorageProxy->GetEntriesL( query, entries );
+ CleanupStack::PopAndDestroy( query );
+
+ HBufC16* localizedName;
+ for( TInt i = 0; i < locCount; i++ )
{
- const char* temp = DescriptorToStringL( locals[i]->GetStringId() );
- // first string is a contex, probably to put in database in future
- locName = iTranslator->translate( KEmptyString, temp, KEmptyString );
- localizedName = reinterpret_cast<const TText*> ( locName.constData() );
- if (localizedName.Compare(KNullDesC))
- {
- locals[i]->SetLocalizedStringL( localizedName );
- }
- else
- {
- locals[i]->SetLocalizedStringL( locals[i]->GetStringId() );
- }
- iStorageProxy->LocalizeEntryL( *( locals[i] ) );
- delete[] temp;
+ localizedName = iResolver->LoadLC( locals[i]->GetStringId() );
+ if( localizedName->Compare(
+ GetEntryText( entries, locals[i]->GetRowId() ) ) )
+ // translation different than text
+ {
+ locals[i]->SetLocalizedStringL( *localizedName );
+ iStorageProxy->LocalizeEntryL( *( locals[i] ) );
+ }
+ else if( !localizedName->Compare(KNullDesC) )
+ // no translation, string id as text
+ {
+ locals[i]->SetLocalizedStringL( locals[i]->GetStringId() );
+ iStorageProxy->LocalizeEntryL( *( locals[i] ) );
+ }
+ CleanupStack::PopAndDestroy( localizedName );
}
- CleanupStack::PopAndDestroy( &localizedName );
+
+ CleanupStack::PopAndDestroy( &ids );
+ CleanupStack::PopAndDestroy( &entries );
CleanupStack::PopAndDestroy( &locals );
}
+
// ---------------------------------------------------------------------------
-// CCaLocalizerScannerProxy::DescriptorToStringL
+// CCaLocalizerScannerProxy::LocalGetEntryById
// ---------------------------------------------------------------------------
//
-const char* CCaLocalizerScannerProxy::DescriptorToStringL(
- const TDesC& aDescriptor )
+const TDesC& CCaLocalizerScannerProxy::GetEntryText(
+ RPointerArray<CCaInnerEntry> aEntries, TInt aId )
{
- TInt length = aDescriptor.Length();
- HBufC8* buffer = HBufC8::NewLC( length );
- buffer->Des().Copy( aDescriptor );
- char* str = new ( ELeave ) char[length + 1];
- Mem::Copy( str, buffer->Ptr(), length );
- str[length] = '\0';
- CleanupStack::PopAndDestroy( buffer );
- return str;
+ TInt entriesCount = aEntries.Count();
+ for( TInt i=0; i < entriesCount; i++ )
+ {
+ if( aEntries[i]->GetId() == aId )
+ {
+ return aEntries[i]->GetText();
+ }
+ }
+ return KNullDesC();
}
-
--- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h Fri Apr 30 15:22:08 2010 +0300
@@ -69,7 +69,7 @@
* MMC id setter
* @param aMmcId MMC id
*/
- void SetMmcId( TUint aMmcId );
+ void SetMmcIdL( const TDesC& aMmcId );
/*
* PackageUid setter
@@ -112,13 +112,13 @@
* @param aLibrary widget library
*/
void SetPathL( const TDesC& aPath );
-
+
/*
* Path getter
* @return widget library
*/
TPtrC GetPath( ) const;
-
+
/*
* Missing flag setter
* @param aMissing flag
@@ -135,8 +135,8 @@
* Used flag setter
* @param aUsed flag
*/
- void SetUsed( TBool aUsed );
-
+ void SetUsed( TBool aUsed );
+
/*
* Content arsenal entry id getter
* @return CA entry id
@@ -147,7 +147,7 @@
* MMC id getter
* @return CA entry id
*/
- TUint GetMmcId( ) const;
+ TPtrC GetMmcId( ) const;
/*
* Library getter
@@ -189,14 +189,21 @@
* 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;
+
/*
* Entry getter
* @return entry representing widget
*/
CCaInnerEntry* GetEntryLC( ) const;
-
+
/*
* Modification time setter
* @param aModificationTime
@@ -207,7 +214,22 @@
* Modification time getter
* @return widget Modification time
*/
- TPtrC GetModificationTime( ) const;
+ TPtrC GetModificationTime() const;
+
+ /*
+ * Remove MMC id.
+ */
+ void RemoveMmcId();
+ /*
+ * Set service fw xml filename
+ * @param aServiceXml Service xml filename
+ */
+ void SetServiceXmlL(const TDesC& aServiceXml);
+ /*
+ * Get service fw xml filename
+ * @return Service xml filename
+ */
+ TPtrC GetServiceXml() const;
private:
@@ -254,7 +276,7 @@
/*
* MMC id
*/
- TUint iMmcId;
+ RBuf iMmcId;
/*
* Widget title. Own
@@ -280,7 +302,7 @@
* Widget library. Own
*/
RBuf iPath;
-
+
/*
* Widget library. Own
*/
@@ -290,11 +312,15 @@
* Widgets flags.
*/
TInt iFlags;
-
+
/*
* Modification time.
*/
RBuf iModificationTime;
+ /*
+ * Service fw xml file
+ */
+ RBuf iServiceXml;
};
typedef RPointerArray<CCaWidgetDescription> RWidgetArray;
--- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerparser.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerparser.h Fri Apr 30 15:22:08 2010 +0300
@@ -168,6 +168,13 @@
* @param aWidget widget to set value
*/
void SetMmcIdL( CCaWidgetDescription * aWidget );
+
+ 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:
@@ -207,6 +214,8 @@
* Own.
*/
RXmlEngDOMImplementation iDomImpl;
+
+ CCaWidgetDescription* iWidgetDescriptor;
};
--- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h Fri Apr 30 15:22:08 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -46,64 +46,70 @@
/**
* Two-phased constructor.
*/
- static CCaWidgetStorageHandler* NewL( CCaStorageProxy* aStorage,
+ static CCaWidgetStorageHandler* NewL( CCaStorageProxy* aStorage,
RFs& aFs );
- static CCaWidgetStorageHandler* NewLC( CCaStorageProxy* aStorage,
+ static CCaWidgetStorageHandler* NewLC( CCaStorageProxy* aStorage,
RFs& aFs );
/**
* Destructor.
*/
virtual ~CCaWidgetStorageHandler();
-
+
/**
* Synchronizes widgets
* @param aWidgets widgets to synchronize
*/
- void SynchronizeL( const RWidgetArray& aWidgets );
+ void SynchronizeL( const RWidgetArray& aWidgets );
-
+
private:
/**
* Adds widget to storage.
- * @param aWidget widget to be added
+ * @param aWidget widget to be added
*/
- void AddL( const CCaWidgetDescription* aWidget );
+ void AddL( const CCaWidgetDescription* aWidget );
/**
* Updates widget in storage.
- * @param aWidget widget to be updated
+ * @param aWidget widget to be updated
*/
- void UpdateL( const CCaWidgetDescription* aWidget, TUint aEntryId );
-
+ void UpdateL( const CCaWidgetDescription* aWidget, TUint aEntryId );
+
/**
* Add/Updates widgets in DB
* @param aWidgets widgets to add
*/
void AddWidgetsL( const RWidgetArray& aWidgets );
-
+
/**
* Removes widgets from DB
*/
void RemoveWidgetsL( ) ;
-
+
/**
* Fetch widgets from content storage
*/
- void FetchWidgetsL( );
+ void FetchWidgetsL( );
/**
* Add widget to download collection
* @param aEntry entry containing widget information
*/
void AddWidgetToDownloadCollectionL( const CCaInnerEntry* aEntry );
-
+
/**
- * Sets missing flag for an entry
- * @param aWidget widget
+ * Set missing flag for an entry.
+ * @param aWidget widget.
*/
- void SetMissingFlagL( const CCaWidgetDescription * aWidget );
+ void SetMissingFlagL( const CCaWidgetDescription * aWidget );
+
+ /**
+ * Clear missing flag for an entry.
+ * @param aWidget widget.
+ */
+ void ClearVisibleFlagL( const CCaWidgetDescription* aWidget );
private:
@@ -117,30 +123,36 @@
*/
void ConstructL( );
+ /**
+ * Check if mass storage is not in use.
+ * @return true if mass storage is not in use.
+ */
+ TBool MassStorageNotInUse();
+
private:
- // Data
+ // Data
/*
* Content Storage. Not Own
*/
CCaStorageProxy* iStorage;
-
+
/*
* File server. Not own
*/
RFs iFs;
-
+
/*
* Widgets. Own.
*/
RWidgetArray iWidgets;
-
+
/*
* Indexes updated during last add operation. Own.
*/
RArray<TInt> iUpdatedIndexes;
-
-
+
+
};
#endif // C_WIDGETSTORAGEHANDLER_H
--- a/contentstorage/casrv/cawidgetscanner/inc/widgetscannerutils.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/inc/widgetscannerutils.h Fri Apr 30 15:22:08 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -27,6 +27,7 @@
_LIT(KAttrWidgetPath, "widget:path");
_LIT(KAttrWidgetLibrary, "widget:library");
_LIT(KAttrWidgetUri, "widget:uri");
+_LIT(KAttrWidgetServiceXml, "widget:servicexml");
_LIT(KSlash, "/");
_LIT(KDllExt, ".dll");
_LIT(KNoLibrary, "NoLibrary");
@@ -38,7 +39,7 @@
*
* @since Series Series60 5.x
*/
-class WidgetScannerUtils
+class WidgetScannerUtils
{
public:
@@ -52,11 +53,11 @@
const DriveInfo::TDefaultDrives& aDefaultDrive);
/**
- * Returns current MMC id
- * @param aFs file server session reference
- * @return current mmc id
- */
- static TUint CurrentMmcId( RFs& aFs );
+ * Returns current MMC id.
+ * @param aFs file server session reference.
+ * @param aMmcId mmc id reference.
+ */
+ static void CurrentMmcId( const RFs& aFs, TDes& aMmcId );
};
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -36,7 +36,7 @@
// -----------------------------------------------------------------------------
//
CCaWidgetDescription::CCaWidgetDescription() :
- iEntryId(KNoId), iFlags(EVisible)
+ iEntryId(KNoId), iMmcId()
{
}
@@ -78,21 +78,13 @@
iUri.CreateL( KCaMaxAttrValueLen );
aEntry->FindAttribute( KAttrWidgetUri, iUri );
//mmc id
- TBuf<KUidChars> mmcId;
- if( aEntry->FindAttribute( KCaAttrMmcId, mmcId ) )
- {
- TLex mmcLex( mmcId );
- User::LeaveIfError( mmcLex.Val( iMmcId, EHex ));
- }
- if( aEntry->GetFlags() & EMissing )
- {
- iFlags = iFlags | EMissing;
- }
- if( aEntry->GetFlags() & EUsed )
- {
- iFlags = iFlags | EUsed;
- }
+ iMmcId.CreateL(KMassStorageIdLength);
+ aEntry->FindAttribute( KCaAttrMmcId, iMmcId );
+ //service xml
+ iServiceXml.CreateL( KCaMaxAttrValueLen );
+ aEntry->FindAttribute( KAttrWidgetServiceXml,iServiceXml );
+ iFlags = aEntry->GetFlags();
iModificationTime.CreateL(KCaMaxAttrValueLen);
aEntry->FindAttribute( KCaAttrInstallationTime, iModificationTime );
}
@@ -148,6 +140,8 @@
iLibrary.Close();
iPath.Close();
iModificationTime.Close();
+ iMmcId.Close();
+ iServiceXml.Close();
}
// ----------------------------------------------------------------------------
@@ -157,7 +151,7 @@
TBool CCaWidgetDescription::Compare(
const CCaWidgetDescription& aFirst,const CCaWidgetDescription& aSecond)
{
- if( aFirst.GetLibraryName() == aSecond.GetLibraryName() )
+ if( aFirst.GetUri() == aSecond.GetUri() )
{
return ETrue;
}
@@ -179,7 +173,8 @@
aToCompare.GetIconUri() == GetIconUri() &&
aToCompare.GetTitle() == GetTitle() &&
aToCompare.GetLibrary() != KNoLibrary &&
- aToCompare.GetModificationTime() == GetModificationTime()
+ aToCompare.GetModificationTime() == GetModificationTime() &&
+ aToCompare.GetServiceXml() == GetServiceXml()
)
{
return ETrue;
@@ -194,9 +189,10 @@
//
// -----------------------------------------------------------------------------
//
-void CCaWidgetDescription::SetMmcId( TUint aMmcId )
+void CCaWidgetDescription::SetMmcIdL( const TDesC& aMmcId )
{
- iMmcId = aMmcId;
+ iMmcId.Close();
+ iMmcId.CreateL( aMmcId );
}
// -----------------------------------------------------------------------------
@@ -323,7 +319,7 @@
//
// -----------------------------------------------------------------------------
//
-TUint CCaWidgetDescription::GetMmcId( ) const
+TPtrC CCaWidgetDescription::GetMmcId( ) const
{
return iMmcId;
}
@@ -425,6 +421,16 @@
return iFlags & EUsed;
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TBool CCaWidgetDescription::IsVisible( ) const
+ {
+ return iFlags & EVisible;
+ }
+
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
@@ -434,10 +440,7 @@
CCaInnerEntry* entry = CCaInnerEntry::NewLC();
entry->SetEntryTypeNameL( KCaTypeWidget );
entry->SetRole( EItemEntryRole );
- if ( iFlags & EVisible )
- {
- entry->SetFlags( EVisible );
- }
+ entry->SetFlags( iFlags );
if ( iPackageUid )
{
TBuf<KMaxUidName> uidDesc;
@@ -448,11 +451,9 @@
{
entry->SetId( iEntryId );
}
- if ( iMmcId )
+ if ( iMmcId != KNullDesC )
{
- TBuf<KMaxUidName> mmcId;
- mmcId.AppendNum( iMmcId, EHex);
- entry->AddAttributeL( KCaAttrMmcId, mmcId );
+ entry->AddAttributeL( KCaAttrMmcId, iMmcId );
}
if ( iLibrary != KNullDesC )
{
@@ -498,7 +499,10 @@
{
entry->AddAttributeL( KCaAttrInstallationTime, iModificationTime );
}
-
+ if ( iServiceXml != KNullDesC )
+ {
+ entry->AddAttributeL( KAttrWidgetServiceXml, iServiceXml);
+ }
return entry;
}
@@ -521,4 +525,30 @@
}
return libraryName;
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CCaWidgetDescription::RemoveMmcId( )
+ {
+ iMmcId.Close();
+ }
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CCaWidgetDescription::SetServiceXmlL(const TDesC& aServiceXml)
+ {
+ iServiceXml.Close();
+ iServiceXml.CreateL( aServiceXml );
+ }
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TPtrC CCaWidgetDescription::GetServiceXml() const
+ {
+ return iServiceXml;
+ }
// End of File
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -24,6 +24,7 @@
#include <xmlengdocument.h>
#include <utf.h>
+#include "cadef.h"
#include "cawidgetscannerparser.h"
#include "widgetscannerutils.h"
@@ -46,7 +47,11 @@
_LIT8(KDescription, "description" );
_LIT8(KHidden, "hidden" );
_LIT8(KIconUri, "iconuri" );
+_LIT8(KWidgetProvider, "widgetprovider");
+_LIT8(KWidgetManifest, "hswidgetmanifest");
+_LIT8(KIcon, "icon");
+_LIT8(KServiceXml, "servicexml");
// ============================ MEMBER FUNCTIONS ===============================
@@ -105,6 +110,7 @@
//
CCaWidgetScannerParser::~CCaWidgetScannerParser()
{
+ delete iWidgetDescriptor;
iImportPath.Close();
iWidgets.ResetAndDestroy();
iDomImpl.Close();
@@ -200,23 +206,102 @@
User::LeaveIfError(parser.Open(iDomImpl));
RXmlEngDocument doc = parser.ParseFileL(aFilePath, KChunkSize);
CleanupClosePushL(doc);
- TXmlEngElement docElement = doc.AsElement();
- TXmlEngElement element;
- RXmlEngNodeList<TXmlEngElement> elementList;
- CleanupClosePushL(elementList);
+ TXmlEngElement docElement = doc.DocumentElement();
+
+ if (docElement.Name() == KWidgetProvider) {
+ TXmlEngElement element;
+ RXmlEngNodeList<TXmlEngElement> elementList;
+ CleanupClosePushL(elementList);
+ docElement.GetElementsByTagNameL(elementList, KWidget);
- element = docElement.FirstChild().AsElement();
- element.GetElementsByTagNameL(elementList, KWidget);
+ while (elementList.HasNext())
+ {
+ element = elementList.Next();
+ if ( element.HasAttributes() )
+ {
+ ParseWidgetL( aFilePath, element, aPackageUid );
+ }
+ }
+ CleanupStack::PopAndDestroy(&elementList);
+ } else if (docElement.Name() == KWidgetManifest) {
+
+ delete iWidgetDescriptor;
+ iWidgetDescriptor = NULL;
+ iWidgetDescriptor = CCaWidgetDescription::NewL();
+ iWidgetDescriptor->SetPackageUidL(aPackageUid);
+ iWidgetDescriptor->SetVisible(ETrue);
+
+
+ SetMmcIdL( iWidgetDescriptor );
- while (elementList.HasNext())
- {
- element = elementList.Next();
- if ( element.HasAttributes() )
+ RXmlEngNodeList<TXmlEngElement> 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);
+
+ //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 );
+
+ TInt index = iWidgets.Find( iWidgetDescriptor, CCaWidgetDescription::Compare );
+ if ( index != KErrNotFound )
{
- ParseWidgetL( aFilePath, element, aPackageUid );
+ delete iWidgets[index];
+ iWidgets.Remove( index );
}
- }
- CleanupStack::PopAndDestroy(&elementList);
+ iWidgets.AppendL( iWidgetDescriptor );//ownership transfer
+ iWidgetDescriptor = NULL;
+ }
+
CleanupStack::PopAndDestroy(&doc);
CleanupStack::PopAndDestroy(&parser);
}
@@ -364,6 +449,10 @@
{
aWidget->SetVisible( EFalse );
}
+ else
+ {
+ aWidget->SetVisible( ETrue );
+ }
CleanupStack::PopAndDestroy( hidden );
}
@@ -403,9 +492,21 @@
User::LeaveIfError( DriveInfo::GetDefaultDrive(
DriveInfo::EDefaultRemovableMassStorage, removableDrive ) );
+ TChar massStorageDrive;
+ User::LeaveIfError( DriveInfo::GetDefaultDrive(
+ DriveInfo::EDefaultMassStorage, massStorageDrive ) );
if( iCurrentDriveLetter == removableDrive )
{
- widget->SetMmcId( WidgetScannerUtils::CurrentMmcId( iFs ) );
+ RBuf mmcId;
+ mmcId.CreateL(KMassStorageIdLength);
+ mmcId.CleanupClosePushL();
+ WidgetScannerUtils::CurrentMmcId( iFs, mmcId );
+ widget->SetMmcIdL( mmcId );
+ CleanupStack::PopAndDestroy( &mmcId );
+ }
+ else if( iCurrentDriveLetter == massStorageDrive )
+ {
+ widget->SetMmcIdL( KCaMassStorage );
}
}
@@ -429,7 +530,8 @@
//
HBufC* CCaWidgetScannerParser::FullPathLC( )
{
- HBufC* result = HBufC16::NewLC( iImportPath.Length() + KDriveLetterLength );
+ HBufC* result =
+ HBufC16::NewLC( iImportPath.Length() + KDriveLetterLength );
TPtr modifier( result->Des() );
modifier.Append( iCurrentDriveLetter );
modifier.Append( KColen );
@@ -454,4 +556,79 @@
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)
+ {
+ if (aElement.Text().Length())
+ {
+ HBufC *utf16 =
+ CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() );
+ CleanupStack::PushL( utf16 );
+ iWidgetDescriptor->SetTitleL( *utf16 );
+ CleanupStack::PopAndDestroy( utf16 );
+ }
+ }
+void CCaWidgetScannerParser::ParseIconL(TXmlEngElement & aElement,
+ const TDesC & aPackageUid )
+ {
+ 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 );
+ }
+
+void CCaWidgetScannerParser::ParseDescriptionL(TXmlEngElement & aElement)
+ {
+ HBufC *desc =
+ CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() );
+ CleanupStack::PushL( desc );
+
+ if( desc->Compare( KNullDesC ) != 0 )
+ {
+ iWidgetDescriptor->SetDescriptionL( *desc );
+ }
+ CleanupStack::PopAndDestroy( desc );
+ }
+void CCaWidgetScannerParser::ParseHiddenL( TXmlEngElement& aElement )
+ {
+ if( aElement.Text().Compare( _L8("true") ) == 0 )
+ {
+ iWidgetDescriptor->SetVisible( EFalse );
+ }
+
+ }
+void CCaWidgetScannerParser::ParseServiceXmlL( TXmlEngElement& aElement )
+ {
+ HBufC *serviceXml = CnvUtfConverter::ConvertToUnicodeFromUtf8L( aElement.Text() );
+ CleanupStack::PushL( serviceXml );
+
+ if (serviceXml->Compare(KNullDesC) != 0)
+ {
+ iWidgetDescriptor->SetServiceXmlL( *serviceXml );
+ }
+ CleanupStack::PopAndDestroy( serviceXml );
+ }
// End of File
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
- * Description:
+ * Description:
*
*/
// INCLUDE FILES
@@ -88,9 +88,9 @@
}
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
-//
+//
void CCaWidgetStorageHandler::SynchronizeL( const RWidgetArray& aWidgets )
{
FetchWidgetsL();
@@ -99,14 +99,14 @@
}
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
-//
+//
void CCaWidgetStorageHandler::AddL( const CCaWidgetDescription* aWidget )
{
CCaInnerEntry* entry = aWidget->GetEntryLC();
iStorage->AddL( entry );
- if( ( entry->GetFlags() & ERemovable ) != 0 )
+ if( entry->GetFlags() & ERemovable )
{
AddWidgetToDownloadCollectionL( entry );
}
@@ -114,24 +114,26 @@
}
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
-//
+//
void CCaWidgetStorageHandler::UpdateL( const CCaWidgetDescription* aWidget,
TUint aEntryId )
{
CCaInnerEntry* entry = aWidget->GetEntryLC();
entry->SetId( aEntryId );
- if( !aWidget->IsMissing() && ( aWidget->GetLibrary() != KNoLibrary ) )
+ if( !aWidget->IsMissing() && aWidget->IsUsed() )
{
entry->SetFlags( entry->GetFlags() & ~EUsed );
}
- else if(aWidget->IsUsed())
+ TItemAppearance itemAppearanceChange = EItemAppearanceNotChanged;
+ if( ( entry->GetFlags() & EMissing ) ||
+ !( entry->GetFlags() & EVisible ) )
{
- entry->SetFlags( entry->GetFlags() | EUsed );
+ itemAppearanceChange = EItemAppeared;
}
- entry->SetFlags( entry->GetFlags() & ~EMissing );
- iStorage->AddL( entry );
+ entry->SetFlags( entry->GetFlags() & ~EMissing | EVisible );
+ iStorage->AddL( entry, EFalse, itemAppearanceChange );
if( !aWidget->IsMissing() )
{
AddWidgetToDownloadCollectionL( entry );
@@ -140,23 +142,24 @@
}
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
-//
+//
void CCaWidgetStorageHandler::AddWidgetsL( const RWidgetArray& aWidgets )
{
iUpdatedIndexes.Reset();
for( TInt i = 0; i < aWidgets.Count(); i++ )
{
- TInt index = iWidgets.Find(
+ TInt index = iWidgets.Find(
aWidgets[i], CCaWidgetDescription::Compare );
if( index != KErrNotFound )
{
- if( !iWidgets[index]->Compare( *aWidgets[i] ) ||
+ 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() );
UpdateL( aWidgets[i], iWidgets[index]->GetEntryId() );
}
iUpdatedIndexes.AppendL( index );
@@ -169,33 +172,48 @@
}
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
-//
+//
void CCaWidgetStorageHandler::RemoveWidgetsL()
{
for( TInt i = 0; i < iWidgets.Count(); i++ )
{
if( iUpdatedIndexes.Find( i ) == KErrNotFound )
{
- if( iWidgets[i]->GetMmcId() &&
- ( iWidgets[i]->GetMmcId() !=
- WidgetScannerUtils::CurrentMmcId( iFs ) ) )
+ if( iWidgets[i]->GetMmcId() != KNullDesC )
{
- SetMissingFlagL( iWidgets[i] );
+ RBuf currentMmcId;
+ currentMmcId.CreateL( KMassStorageIdLength );
+ currentMmcId.CleanupClosePushL();
+ WidgetScannerUtils::CurrentMmcId( iFs, currentMmcId );
+ if( iWidgets[i]->GetMmcId() == currentMmcId ||
+ ( iWidgets[i]->GetMmcId() == KCaMassStorage() &&
+ MassStorageNotInUse() ) )
+ {
+ //item was uninstalled so we remove its mmc id
+ iWidgets[i]->RemoveMmcId();
+ ClearVisibleFlagL( iWidgets[i] );
+ }
+ else
+ {
+ SetMissingFlagL( iWidgets[i] );
+ }
+ CleanupStack::PopAndDestroy(¤tMmcId);
}
else
{
- SetMissingFlagL( iWidgets[i] );
+ //item was uninstalled so we remove its mmc id
+ ClearVisibleFlagL( iWidgets[i] );
}
}
}
}
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
-//
+//
void CCaWidgetStorageHandler::AddWidgetToDownloadCollectionL(
const CCaInnerEntry* aEntry )
{
@@ -228,9 +246,9 @@
}
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
-//
+//
void CCaWidgetStorageHandler::FetchWidgetsL()
{
CCaInnerQuery* query = CCaInnerQuery::NewLC();
@@ -257,20 +275,60 @@
}
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
-//
+//
void CCaWidgetStorageHandler::SetMissingFlagL(
const CCaWidgetDescription* aWidget )
{
- CCaInnerEntry* entry = aWidget->GetEntryLC();
- entry->SetFlags( entry->GetFlags() | EMissing );
- if( aWidget->IsUsed() )
+ if( !aWidget->IsMissing() )
{
- entry->SetFlags( entry->GetFlags() | EUsed );
+ CCaInnerEntry* entry = aWidget->GetEntryLC();
+ entry->SetFlags( entry->GetFlags() | EMissing );
+ if( aWidget->IsUsed() )
+ {
+ entry->SetFlags( entry->GetFlags() | EUsed );
+ }
+ iStorage->AddL( entry, EFalse, EItemDisappeared );
+ CleanupStack::PopAndDestroy( entry );
}
- iStorage->AddL( entry );
- CleanupStack::PopAndDestroy( entry );
}
-// End of File
+// ----------------------------------------------------------------------------
+//
+// ----------------------------------------------------------------------------
+//
+void CCaWidgetStorageHandler::ClearVisibleFlagL(
+ const CCaWidgetDescription* aWidget )
+ {
+ if( aWidget->IsVisible() )
+ {
+ CCaInnerEntry* entry = aWidget->GetEntryLC();
+ entry->SetFlags( entry->GetFlags() & ~EVisible & ~EMissing & ~EUsed );
+ iStorage->AddL( entry, EFalse, EItemDisappeared );
+ CleanupStack::PopAndDestroy( entry );
+ }
+ }
+
+// ----------------------------------------------------------------------------
+//
+// ----------------------------------------------------------------------------
+//
+TBool CCaWidgetStorageHandler::MassStorageNotInUse()
+ {
+ TBool massStorageNotInUse( ETrue );
+ TInt drive;
+ if( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ) ==
+ KErrNone )
+ {
+ TUint status;
+ if( DriveInfo::GetDriveStatus( iFs, drive, status ) == KErrNone &&
+ ( status & DriveInfo::EDriveInUse ) )
+ {
+ massStorageNotInUse = EFalse;
+ }
+ }
+ return massStorageNotInUse;
+ }
+
+// End of File
--- a/contentstorage/casrv/cawidgetscanner/src/widgetscannerutils.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/widgetscannerutils.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -21,11 +21,11 @@
#include "cadef.h"
// -----------------------------------------------------------------------------
-//
+//
// -----------------------------------------------------------------------------
//
TBool WidgetScannerUtils::IsFileOnDrive(const TDesC& aFileName,
- const DriveInfo::TDefaultDrives& aDefaultDrive)
+ const DriveInfo::TDefaultDrives& aDefaultDrive)
{
if (aFileName.Length()) {
TInt drive;
@@ -43,12 +43,11 @@
// -----------------------------------------------------------------------------
-//
+//
// -----------------------------------------------------------------------------
//
-TUint WidgetScannerUtils::CurrentMmcId( RFs& aFs )
+void WidgetScannerUtils::CurrentMmcId( const RFs& aFs, TDes& aMmcId )
{
- TUint mmcId = 0;
TInt mmcDrive;
if ( DriveInfo::GetDefaultDrive(
DriveInfo::EDefaultRemovableMassStorage, mmcDrive ) == KErrNone )
@@ -56,10 +55,10 @@
TVolumeInfo volumeInfo;
if( aFs.Volume( volumeInfo, mmcDrive ) == KErrNone )
{
- mmcId = volumeInfo.iUniqueID;
+ aMmcId.Zero();
+ aMmcId.AppendNum( volumeInfo.iUniqueID );
}
}
- return mmcId;
}
-// End of File
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/castorage/conf/castoragedb.confml Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<confml:configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:confml="http://www.s60.com/xml/confml/2" xsi:schemaLocation="http://www.s60.com/xml/confml/2 http://www.s60.com/xml/confml/1#//confml2" name="Content storage database settings">
+ <confml:feature ref="CaStorageDbSetting" name="Content storage database settings">
+ <confml:setting ref="Collections" mapKey="Name" mapValue="Name" name="Collections" type="sequence">
+ <confml:setting ref="Name" name="Name (English)" type="string"/>
+ <confml:setting ref="GroupName" name="Collection Group Name" type="string"/>
+ <confml:setting ref="Flags" name="Flags(0 to lock collection)" type="int"/>
+ <confml:setting ref="LocName" name="Localzied Name (from TS file)" type="string"/>
+ <confml:setting ref="Icon" name="Collection Icon" type="string"/>
+ </confml:setting>
+ <confml:setting ref="Items" name="Items" type="sequence" >
+ <confml:setting ref="Type" name="Item type" type="string">
+ <confml:option name="application" value="application"/>
+ <confml:option name="url" value="url"/>
+ <confml:option name="widget" value="widget"/>
+ </confml:setting>
+ <confml:setting ref="Name" name="Item name" type="string"/>
+ <confml:setting ref="Destination" name="Url/Uid/Widget Uri" type="string"/>
+ <confml:setting ref="Icon" name="Item icon (skin or file)" type="string"/>
+ <confml:setting ref="Col_Name" name="In collection " type="selection">
+ <confml:option map="CaStorageDbSetting/Collections"/>
+ </confml:setting>
+ </confml:setting>
+ </confml:feature>
+ <confml:data>
+ <confml:CaStorageDbSetting>
+ <confml:Collections extensionPolicy="replace"><confml:Name>Favorites</confml:Name><confml:GroupName>Favorites</confml:GroupName><confml:Flags>4</confml:Flags><confml:LocName></confml:LocName><confml:Icon>qtg_large_applications_user</confml:Icon></confml:Collections>
+ <confml:Collections><confml:Name>Office</confml:Name><confml:GroupName>Office</confml:GroupName><confml:Flags>4</confml:Flags><confml:LocName>txt_applib_dblist_office</confml:LocName><confml:Icon>qtg_large_applications_user</confml:Icon></confml:Collections>
+ <confml:Collections><confml:Name>Multimedia</confml:Name><confml:GroupName>Multimedia</confml:GroupName><confml:Flags>4</confml:Flags><confml:LocName></confml:LocName><confml:Icon>qtg_large_applications_user</confml:Icon></confml:Collections>
+ <confml:Collections><confml:Name>Utils</confml:Name><confml:GroupName>Utils</confml:GroupName><confml:Flags>4</confml:Flags><confml:LocName></confml:LocName><confml:Icon>qtg_large_applications_user</confml:Icon></confml:Collections>
+ <confml:Collections><confml:Name>Games</confml:Name><confml:GroupName>Games</confml:GroupName><confml:Flags>4</confml:Flags><confml:LocName>txt_applib_dblist_games</confml:LocName><confml:Icon>qtg_large_applications_user</confml:Icon></confml:Collections>
+ <confml:Items extensionPolicy="append"><confml:Type>application</confml:Type><confml:Name>calendar</confml:Name><confml:Destination>268458241</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Camera</confml:Name><confml:Destination>270501242</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Contacts</confml:Name><confml:Destination>537014009</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Email</confml:Name><confml:Destination>537023930</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>FM Radio</confml:Name><confml:Destination>270530934</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Internet</confml:Name><confml:Destination>222222222</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Maps</confml:Name><confml:Destination>222222222</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Messaging</confml:Name><confml:Destination>537001593</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Music</confml:Name><confml:Destination>270564450</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Photos (camera)</confml:Name><confml:Destination>536913858</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Settings</confml:Name><confml:Destination>268458220</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Videos (video camera)</confml:Name><confml:Destination>222222222</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>calendar</confml:Name><confml:Destination>268458241</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Office']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Phonebook</confml:Name><confml:Destination>537014009</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Office']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Themes</confml:Name><confml:Destination>268458546</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Multimedia']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Paint Cursor</confml:Name><confml:Destination>537001564</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Multimedia']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Videoplayer</confml:Name><confml:Destination>537006590</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Multimedia']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>ControlPanel</confml:Name><confml:Destination>537026521</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Utils']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Bluetooth</confml:Name><confml:Destination>268458321</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Utils']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>SW update</confml:Name><confml:Destination>537001519</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Utils']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>eshell</confml:Name><confml:Destination>270498535</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Utils']"></confml:Col_Name></confml:Items>
+ <confml:Items><confml:Type>application</confml:Type><confml:Name>Conn. mgr.</confml:Name><confml:Destination>270501072</confml:Destination><confml:Icon></confml:Icon><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Utils']"></confml:Col_Name></confml:Items>
+ </confml:CaStorageDbSetting>
+ </confml:data>
+
+</confml:configuration>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/castorage/conf/castoragedb.implml Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<container xmlns="http://www.symbianfoundation.org/xml/implml/1">
+ <tag name="target" value="rofs2"/>
+ <tag name="target" value="rofs3"/>
+
+
+ <!--
+ Override the setting refs so that modifying HomeScreenDbSettings
+ causes the execution of both the TemplateML and CommandML
+ implementations. Otherwise the TemplateML implementation would be
+ executed only if the settings have been changed, and the CommandML
+ implementation would be executed every time.
+ -->
+ <settingRefsOverride>
+ <settingRef value="CaStorageDbSetting"/>
+ </settingRefsOverride>
+
+ <!-- TemplateML implementation to create the .sql files -->
+ <templateml xmlns="http://www.s60.com/xml/templateml/1">
+ <!-- just to create empty folder, maybe it could be done better-->
+ <output dir="content/private/20022F90" file="castorage.db" encoding="UTF-8"></output>
+ <output dir="temp/castoragedb/" file="castoragedb_create.sql" encoding="UTF-8">
+ <template file="castoragedb_templates/castoragedb_create.sql"/>
+ </output>
+ <output dir="temp/castoragedb/" file="castoragedb_variant.sql" encoding="UTF-8">
+ <template file="castoragedb_templates/castoragedb_variant.sql"/>
+ </output>
+ </templateml>
+
+ <!-- CommandML implementation to create the database using the .sql files -->
+ <commandml xmlns="http://www.s60.com/xml/commandml/1">
+ <command executable="sqlite3" shell="true" cwd="%CONE_OUT_ABSOLUTE%/temp/castoragedb">
+ <argument value='%CONE_OUT_ABSOLUTE%/content/private/20022F90/castorage.db ".read castoragedb_create.sql"'/>
+ </command>
+ <command executable="sqlite3" shell="true" cwd="%CONE_OUT_ABSOLUTE%/temp/castoragedb">
+ <argument value='%CONE_OUT_ABSOLUTE%/content/private/20022F90/castorage.db ".genfkey --exec"'/>
+ </command>
+ <command executable="sqlite3" shell="true" cwd="%CONE_OUT_ABSOLUTE%/temp/castoragedb">
+ <argument value='%CONE_OUT_ABSOLUTE%/content/private/20022F90/castorage.db ".read castoragedb_variant.sql"'/>
+ </command>
+ </commandml>
+
+
+</container>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/castorage/conf/castoragedb_templates/castoragedb_variant.sql Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,31 @@
+SELECT "------------------------------------" AS " ";
+SELECT "castoragedb_variant - BEGIN" AS " ";
+
+{% for col in range(feat_tree.CaStorageDbSetting.Collections._value|length) -%}
+ {%- set Name = feat_tree.CaStorageDbSetting.Collections.Name._value[col] or '' -%}
+ {%- set GroupName = feat_tree.CaStorageDbSetting.Collections.GroupName._value[col] or '' -%}
+ {%- set Flags = feat_tree.CaStorageDbSetting.Collections.Flags._value[col] or '' -%}
+ {%- set LocName = feat_tree.CaStorageDbSetting.Collections.LocName._value[col] or ''-%}
+ {%- set Icon = feat_tree.CaStorageDbSetting.Collections.Icon._value[col] or '' -%}
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS {% if LocName -%}, COL_LOCNAME{%- endif %}{% if Icon -%}, ICON{%- endif %})
+VALUES ( '{{Name}}', '{{GroupName}}', {{Flags}} {% if LocName -%}, "{{LocName}}"{%- endif %}{% if Icon -%}, "{{Icon}}"{%- endif %});
+
+{% endfor %}
+
+{% for index in range(feat_tree.CaStorageDbSetting.Items._value|length) -%}
+ {%- set Type = feat_tree.CaStorageDbSetting.Items.Type._value[index] or '' -%}
+ {%- set Name = feat_tree.CaStorageDbSetting.Items.Name._value[index] or '' -%}
+ {%- set Icon = feat_tree.CaStorageDbSetting.Items.Icon._value[index] or '' -%}
+ {%- set Destination = feat_tree.CaStorageDbSetting.Items.Destination._value[index] or '' -%}
+ {%- set Collection = feat_tree.CaStorageDbSetting.Items.Col_Name._value[index] or '' -%}
+{% if Type == "application" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
+ VALUES ("{{Type}}", '{{Name}}', {{Destination}}, '{{Collection}}' );{%- endif %}
+{% if Type == "url" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, ICON, COLLECTION_NAME)
+ VALUES ("{{Type}}", '{{Name}}', "{{Destination}}", "{{Icon}}", '{{Collection}}' ); {%- endif %}
+{% if Type == "widget" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON, URI, COLLECTION_NAME )
+ VALUES ("{{Type}}", '{{Name}}', "{{Icon}}", "{{Destination}}", '{{Collection}}' ); {%- endif %}
+{% endfor %}
+
+SELECT "castoragedb_variant - END" AS " ";
+SELECT "------------------------------------" AS " ";
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/castorage/conf/readme.txt Fri Apr 30 15:22:08 2010 +0300
@@ -0,0 +1,16 @@
+Preconditions:
+- sqlite3 visible in system PATH
+
+run:
+bldmake bldfiles
+abld export
+
+
+if it is first time in platfrom run also
+X:\epoc32\rom\config>cone generate -c convert.confml -o \epoc32\rom\config
+it is just to get it included in S60 root confml
+
+Now you can start Carbide.Ct. Check videos about CT before.
+
+Based on overrided configuration imaker will generated castoragedb in ROFS2/ROFS3
+Check "Views" to change configuration.
\ No newline at end of file
Binary file contentstorage/castorage/data/castorage.db has changed
--- a/contentstorage/castorage/data/castoragedb_create.sql Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/castorage/data/castoragedb_create.sql Fri Apr 30 15:22:08 2010 +0300
@@ -90,7 +90,8 @@
"" AS "COLLECTION_NAME",
"" AS "COL_LOCNAME",
"" AS "COL_APP_GROUP_NAME",
- "" AS "ICON";
+ "" AS "ICON",
+ "" AS "FLAGS";
SELECT " CREATE TRIGGER collection_insert" AS " ";
CREATE TRIGGER collection_insert INSTEAD OF INSERT ON COLLECTION
@@ -103,7 +104,7 @@
(IC_FILENAME IS NULL OR (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
-- INSERT ENTRY
INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_FLAGS, EN_ICON_ID )
- VALUES ( new.COLLECTION_NAME , 2, "collection", 4, (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON ));
+ VALUES ( new.COLLECTION_NAME , 2, "collection", new.FLAGS, (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON ));
-- LOCALIZATION
INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_ROW_ID )
VALUES ( 'CA_ENTRY', 'EN_TEXT', new.COL_LOCNAME, ( SELECT last_insert_rowid() ) );
@@ -177,7 +178,7 @@
"" AS "LIBRARY",
"" AS "LONG_NAME",
"" AS "URI",
- "" AS "COLLECTION_NAME" ;
+ "" AS "COLLECTION_NAME";
SELECT " CREATE TRIGGER insert_widget_to_collection" AS " ";
CREATE TRIGGER item_to_collection_insert_widget INSTEAD OF INSERT ON WIDGET_TO_COLLECTION WHEN new.ITEM_TYPE="widget"
@@ -214,7 +215,7 @@
INSERT INTO CA_DB_PROPERTIES ( DB_PROPERTY, DB_VALUE )
VALUES ( 'Language', '' );
INSERT INTO CA_DB_PROPERTIES ( DB_PROPERTY, DB_VALUE )
-VALUES ( 'QMfile', 'db_textmap_' );
+VALUES ( 'QMfile', 'contentstorage_' );
-- insert neccessary items
SELECT "INSERT menucollections ENTRY" AS " ";
--- a/contentstorage/castorage/data/castoragedb_variant.sql Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/castorage/data/castoragedb_variant.sql Fri Apr 30 15:22:08 2010 +0300
@@ -4,13 +4,13 @@
-- insert additional items
-INSERT INTO COLLECTION (COLLECTION_NAME, COL_LOCNAME, COL_APP_GROUP_NAME ,ICON) VALUES ( 'Office', "txt_applib_dblist_office", 'Office', "qtg_large_applications_user");
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_LOCNAME, COL_APP_GROUP_NAME ,ICON, FLAGS) VALUES ( 'Office', "txt_applib_dblist_office", 'Office', "qtg_large_applications_user", 4 );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
VALUES ("application", 'calendar', 268458241, 'Office' );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
VALUES ("application", 'Phonebook', 537014009, 'Office' );
-INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME ,ICON) VALUES ( 'Multimedia', 'Multimedia' , "qtg_large_applications_user" );
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME ,ICON, FLAGS) VALUES ( 'Multimedia', 'Multimedia' , "qtg_large_applications_user", 4 );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
VALUES ("application", 'Themes', 268458546, 'Multimedia' );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
@@ -18,7 +18,7 @@
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
VALUES ("application", 'Videoplayer', 537006590, 'Multimedia' );
-INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME ,ICON) VALUES ( 'Utils', 'Utils', "qtg_large_applications_user" );
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME ,ICON, FLAGS) VALUES ( 'Utils', 'Utils', "qtg_large_applications_user", 4 );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
VALUES ("application", 'ControlPanel', 537026521, 'Utils' );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
@@ -30,7 +30,7 @@
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
VALUES ("application", 'Conn. mgr.', 270501072, 'Utils' );
-INSERT INTO COLLECTION (COLLECTION_NAME, COL_LOCNAME, COL_APP_GROUP_NAME ,ICON) VALUES ( 'Games', "txt_applib_dblist_games", 'Games',"qtg_large_applications_user" );
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_LOCNAME, COL_APP_GROUP_NAME ,ICON) VALUES ( 'Games', "txt_applib_dblist_games", 'Games',"qtg_large_applications_user", 4 );
SELECT "castoragedb_variant - END" AS " ";
SELECT "------------------------------------" AS " ";
--- a/contentstorage/castorage/data/castoragedb_variant_test.sql Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/castorage/data/castoragedb_variant_test.sql Fri Apr 30 15:22:08 2010 +0300
@@ -5,18 +5,17 @@
-- insert collection
-INSERT INTO COLLECTION (COLLECTION_NAME, ICON) VALUES ( 'Favorites', "qtg_large_applications_user" );
+INSERT INTO COLLECTION (COLLECTION_NAME, ICON) VALUES ( 'Test Apps', "qtg_large_applications_user" );
-- insert example urls
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ICON,ITEM_DEST, COLLECTION_NAME)
- VALUES ("url", 'Facebook', 'c:\data\Images\kqticaicons\facebook.png', "http://www.facebook.com/", 'Favorites' );
- INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ICON,ITEM_DEST, COLLECTION_NAME)
- VALUES ("url", 'Google', 'c:\data\Images\kqticaicons\google.png', "http://www.google.com/", 'Favorites' );
+ INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON, ITEM_DEST, COLLECTION_NAME)
+ VALUES ("url", 'Facebook', 'c:\data\Images\kqticaicons\facebook.png', "http://www.facebook.com/", 'Test Apps' );
+ INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON,ITEM_DEST, COLLECTION_NAME)
+ VALUES ("url", 'Google', 'c:\data\Images\kqticaicons\google.png', "http://www.google.com/", 'Test Apps' );
-- insert example widgets
- INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ICON, PACKAGE_UID, LIBRARY, LONG_NAME, URI, COLLECTION_NAME)
- VALUES ("widget", 'aClock', 'Z:\private\20022F35\import\widgetregistry\20022F6C\tclock.png', '20022f43', 'Z:\private\20022F35\import\widgetregistry\20022F43\hsclockwidgetprovider.dll', 'Clock', 'homescreen.nokia.com/widget/clock', 'Office' );
-
+ INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME,ICON, PACKAGE_UID, LIBRARY, LONG_NAME, URI, COLLECTION_NAME)
+ VALUES ("widget", 'Clock', 'Z:\private\20022F35\import\widgetregistry\20022F6C\tclock.png', '20022f6c', 'Z:\private\20022F35\import\widgetregistry\20022F6C\hsclockwidgetplugin', 'Clock', 'hsclockwidgetplugin', 'Test Apps' );
SELECT "castoragedb_variant test - END" AS " ";
\ No newline at end of file
--- a/contentstorage/eabi/camenuu.def Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/eabi/camenuu.def Fri Apr 30 15:22:08 2010 +0300
@@ -1,26 +1,26 @@
EXPORTS
_Z11RunCaServerv @ 1 NONAME
- _ZN15CCaStorageProxy11CustomSortLERK6RArrayIiEi @ 2 NONAME
- _ZN15CCaStorageProxy11DbPropertyLERK7TDesC16R6TDes16 @ 3 NONAME
- _ZN15CCaStorageProxy11GetEntriesLEPK13CCaInnerQueryR13RPointerArrayI13CCaInnerEntryE @ 4 NONAME
- _ZN15CCaStorageProxy14GetEntriesIdsLEPK13CCaInnerQueryR6RArrayIiE @ 5 NONAME
- _ZN15CCaStorageProxy14LocalizeEntryLER20CCaLocalizationEntry @ 6 NONAME
- _ZN15CCaStorageProxy14SetDBPropertyLERK7TDesC16S2_ @ 7 NONAME
- _ZN15CCaStorageProxy17GetLocalizationsLER13RPointerArrayI20CCaLocalizationEntryE @ 8 NONAME
- _ZN15CCaStorageProxy20LoadDataBaseFromRomLEv @ 9 NONAME
- _ZN15CCaStorageProxy4AddLEP13CCaInnerEntryi @ 10 NONAME
- _ZN15CCaStorageProxy6TouchLEP13CCaInnerEntry @ 11 NONAME
- _ZN15CCaStorageProxy7RemoveLERK6RArrayIiE @ 12 NONAME
- _ZN15CCaStorageProxy9OrganizeLERK6RArrayIiE18TCaOperationParams @ 13 NONAME
- _ZN16CCaSrvMmcHistory4FindEj @ 14 NONAME
- _ZN16CCaSrvMmcHistory5LoadLER3RFsRK7TDesC16 @ 15 NONAME
- _ZN16CCaSrvMmcHistory5SaveLER3RFsRK7TDesC16 @ 16 NONAME
- _ZN16CCaSrvMmcHistory7InsertLEj @ 17 NONAME
- _ZN18CCaInstallNotifier4NewLER18MCaInstallListenerNS_17TNotificationTypeE @ 18 NONAME
- _ZNK14CCaSrvEngUtils10GetAppInfoERK13CCaInnerEntryR11TApaAppInfo @ 19 NONAME
- _ZNK14CCaSrvEngUtils13GetApaAppInfoE4TUidR11TApaAppInfo @ 20 NONAME
- _ZTI15CCaStorageProxy @ 21 NONAME
- _ZTV15CCaStorageProxy @ 22 NONAME
- _ZN13CCaMmcWatcher4NewLER3RFsP19MMmcWatcherCallback @ 23 NONAME
- _ZN13CCaMmcWatcher5NewLCER3RFsP19MMmcWatcherCallback @ 24 NONAME
+ _ZN13CCaMmcWatcher4NewLER3RFsP19MMmcWatcherCallback @ 2 NONAME
+ _ZN13CCaMmcWatcher5NewLCER3RFsP19MMmcWatcherCallback @ 3 NONAME
+ _ZN15CCaStorageProxy11CustomSortLERK6RArrayIiEi @ 4 NONAME
+ _ZN15CCaStorageProxy11DbPropertyLERK7TDesC16R6TDes16 @ 5 NONAME
+ _ZN15CCaStorageProxy11GetEntriesLEPK13CCaInnerQueryR13RPointerArrayI13CCaInnerEntryE @ 6 NONAME
+ _ZN15CCaStorageProxy14GetEntriesIdsLEPK13CCaInnerQueryR6RArrayIiE @ 7 NONAME
+ _ZN15CCaStorageProxy14LocalizeEntryLER20CCaLocalizationEntry @ 8 NONAME
+ _ZN15CCaStorageProxy14SetDBPropertyLERK7TDesC16S2_ @ 9 NONAME
+ _ZN15CCaStorageProxy17GetLocalizationsLER13RPointerArrayI20CCaLocalizationEntryE @ 10 NONAME
+ _ZN15CCaStorageProxy20LoadDataBaseFromRomLEv @ 11 NONAME
+ _ZN15CCaStorageProxy4AddLEP13CCaInnerEntryi15TItemAppearance @ 12 NONAME
+ _ZN15CCaStorageProxy6TouchLEP13CCaInnerEntry @ 13 NONAME
+ _ZN15CCaStorageProxy7RemoveLERK6RArrayIiE @ 14 NONAME
+ _ZN15CCaStorageProxy9OrganizeLERK6RArrayIiE18TCaOperationParams @ 15 NONAME
+ _ZN16CCaSrvMmcHistory4FindEj @ 16 NONAME
+ _ZN16CCaSrvMmcHistory5LoadLER3RFsRK7TDesC16 @ 17 NONAME
+ _ZN16CCaSrvMmcHistory5SaveLER3RFsRK7TDesC16 @ 18 NONAME
+ _ZN16CCaSrvMmcHistory7InsertLEj @ 19 NONAME
+ _ZN18CCaInstallNotifier4NewLER18MCaInstallListenerNS_17TNotificationTypeE @ 20 NONAME
+ _ZNK14CCaSrvEngUtils10GetAppInfoERK13CCaInnerEntryR11TApaAppInfo @ 21 NONAME
+ _ZNK14CCaSrvEngUtils13GetApaAppInfoE4TUidR11TApaAppInfo @ 22 NONAME
+ _ZTI15CCaStorageProxy @ 23 NONAME
+ _ZTV15CCaStorageProxy @ 24 NONAME
--- a/contentstorage/eabi/cautilsu.def Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/eabi/cautilsu.def Fri Apr 30 15:22:08 2010 +0300
@@ -4,96 +4,96 @@
_ZN13CCaInnerEntry12SetIconDataLERK7TDesC16S2_S2_ @ 3 NONAME
_ZN13CCaInnerEntry13AddAttributeLERK7TDesC16S2_ @ 4 NONAME
_ZN13CCaInnerEntry13FindAttributeERK7TDesC16R6TDes16 @ 5 NONAME
- _ZN13CCaInnerEntry15SetDescriptionLERK7TDesC16 @ 6 NONAME
- _ZN13CCaInnerEntry16RemoveAttributeLERK7TDesC16 @ 7 NONAME
- _ZN13CCaInnerEntry17SetEntryTypeNameLERK7TDesC16 @ 8 NONAME
- _ZN13CCaInnerEntry4NewLEv @ 9 NONAME
- _ZN13CCaInnerEntry5NewLCEv @ 10 NONAME
- _ZN13CCaInnerEntry5SetIdEj @ 11 NONAME
- _ZN13CCaInnerEntry6SetUidEl @ 12 NONAME
- _ZN13CCaInnerEntry7SetRoleEj @ 13 NONAME
- _ZN13CCaInnerEntry8SetFlagsEj @ 14 NONAME
- _ZN13CCaInnerEntry8SetTextLERK7TDesC16 @ 15 NONAME
- _ZN13CCaInnerEntry9SetIconIdEi @ 16 NONAME
- _ZN13CCaInnerQuery10SetFlagsOnEj @ 17 NONAME
- _ZN13CCaInnerQuery11SetFlagsOffEj @ 18 NONAME
- _ZN13CCaInnerQuery11SetParentIdEi @ 19 NONAME
- _ZN13CCaInnerQuery12InternalizeLER11RReadStream @ 20 NONAME
- _ZN13CCaInnerQuery13AddAttributeLERK7TDesC16S2_ @ 21 NONAME
- _ZN13CCaInnerQuery17SetEntryTypeNamesEP16CDesC16ArrayFlat @ 22 NONAME
- _ZN13CCaInnerQuery4NewLEv @ 23 NONAME
- _ZN13CCaInnerQuery5NewLCEv @ 24 NONAME
- _ZN13CCaInnerQuery6SetUidEj @ 25 NONAME
- _ZN13CCaInnerQuery7SetIdsLERK6RArrayIiE @ 26 NONAME
- _ZN13CCaInnerQuery7SetRoleEi @ 27 NONAME
- _ZN13CCaInnerQuery7SetSortENS_14TSortAttributeE @ 28 NONAME
- _ZN13CCaInnerQuery8SetCountEj @ 29 NONAME
- _ZN15RCaEntriesArray12InternalizeLER11RReadStream @ 30 NONAME
- _ZN17CCaEntryAttribute4NewLERK7TDesC16 @ 31 NONAME
- _ZN17CCaEntryAttribute5NewLCERK7TDesC16 @ 32 NONAME
- _ZN17CCaEntryAttribute9SetValueLERK7TDesC16 @ 33 NONAME
- _ZN17RCaEntryAttrArray15RemoveAttributeERK7TDesC16 @ 34 NONAME
- _ZN17RCaEntryAttrArray4FindERK7TDesC16R6TDes16 @ 35 NONAME
- _ZN17RCaEntryAttrArray5ExistERK7TDesC16 @ 36 NONAME
- _ZN20CCaLocalizationEntry12SetStringIdLERK7TDesC16 @ 37 NONAME
- _ZN20CCaLocalizationEntry13SetTableNameLERK7TDesC16 @ 38 NONAME
- _ZN20CCaLocalizationEntry17SetAttributeNameLERK7TDesC16 @ 39 NONAME
- _ZN20CCaLocalizationEntry19SetLocalizedStringLERK7TDesC16 @ 40 NONAME
- _ZN20CCaLocalizationEntry4NewLEv @ 41 NONAME
- _ZN20CCaLocalizationEntry5NewLCEv @ 42 NONAME
- _ZN20CCaLocalizationEntry8SetRowIdEj @ 43 NONAME
- _ZN20CCaLocalizationEntry9SetTextIdEj @ 44 NONAME
- _ZN22CCaInnerNotifierFilter11SetParentIdEi @ 45 NONAME
- _ZN22CCaInnerNotifierFilter12InternalizeLER11RReadStream @ 46 NONAME
- _ZN22CCaInnerNotifierFilter12SetEntryRoleE10TEntryRole @ 47 NONAME
- _ZN22CCaInnerNotifierFilter12SetTypeNamesEP16CDesC16ArrayFlat @ 48 NONAME
- _ZN22CCaInnerNotifierFilter4NewLENS_13TNotifierTypeE @ 49 NONAME
- _ZN22CCaInnerNotifierFilter5NewLCENS_13TNotifierTypeE @ 50 NONAME
- _ZN22CCaInnerNotifierFilter7SetIdsLERK6RArrayIiE @ 51 NONAME
- _ZN23CCaInnerIconDescription10SetSkinIdLERK7TDesC16 @ 52 NONAME
- _ZN23CCaInnerIconDescription12SetFileNameLERK7TDesC16 @ 53 NONAME
- _ZN23CCaInnerIconDescription17SetApplicationIdLERK7TDesC16 @ 54 NONAME
- _ZN23CCaInnerIconDescription4NewLEv @ 55 NONAME
- _ZN23CCaInnerIconDescription5NewLCEv @ 56 NONAME
- _ZN23CCaInnerIconDescription5SetIdEi @ 57 NONAME
- _ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 58 NONAME
- _ZNK11RCaIdsArray12ExternalizeLER12RWriteStream @ 59 NONAME
- _ZNK11RCaIdsArray13MarshalDataLCEv @ 60 NONAME
- _ZNK13CCaInnerEntry12ExternalizeLER12RWriteStream @ 61 NONAME
- _ZNK13CCaInnerEntry13GetAttributesEv @ 62 NONAME
- _ZNK13CCaInnerEntry14GetDescriptionEv @ 63 NONAME
- _ZNK13CCaInnerEntry16GetEntryTypeNameEv @ 64 NONAME
- _ZNK13CCaInnerEntry4IconEv @ 65 NONAME
- _ZNK13CCaInnerEntry5GetIdEv @ 66 NONAME
- _ZNK13CCaInnerEntry6GetUidEv @ 67 NONAME
- _ZNK13CCaInnerEntry7GetRoleEv @ 68 NONAME
- _ZNK13CCaInnerEntry7GetTextEv @ 69 NONAME
- _ZNK13CCaInnerEntry8GetFlagsEv @ 70 NONAME
- _ZNK13CCaInnerEntry9GetIconIdEv @ 71 NONAME
- _ZNK13CCaInnerQuery10GetFlagsOnEv @ 72 NONAME
- _ZNK13CCaInnerQuery11GetFlagsOffEv @ 73 NONAME
- _ZNK13CCaInnerQuery11GetParentIdEv @ 74 NONAME
- _ZNK13CCaInnerQuery12ExternalizeLER12RWriteStream @ 75 NONAME
- _ZNK13CCaInnerQuery13GetAttributesEv @ 76 NONAME
- _ZNK13CCaInnerQuery17GetEntryTypeNamesEv @ 77 NONAME
- _ZNK13CCaInnerQuery6GetIdsEv @ 78 NONAME
- _ZNK13CCaInnerQuery6GetUidEv @ 79 NONAME
- _ZNK13CCaInnerQuery7GetRoleEv @ 80 NONAME
- _ZNK13CCaInnerQuery7GetSortEv @ 81 NONAME
- _ZNK13CCaInnerQuery8GetCountEv @ 82 NONAME
- _ZNK15RCaEntriesArray12ExternalizeLER12RWriteStream @ 83 NONAME
- _ZNK20CCaLocalizationEntry11GetStringIdEv @ 84 NONAME
- _ZNK20CCaLocalizationEntry12GetTableNameEv @ 85 NONAME
- _ZNK20CCaLocalizationEntry16GetAttributeNameEv @ 86 NONAME
- _ZNK20CCaLocalizationEntry18GetLocalizedStringEv @ 87 NONAME
- _ZNK20CCaLocalizationEntry8GetRowIdEv @ 88 NONAME
- _ZNK20CCaLocalizationEntry9GetTextIdEv @ 89 NONAME
- _ZNK22CCaInnerNotifierFilter11GetParentIdEv @ 90 NONAME
- _ZNK22CCaInnerNotifierFilter12ExternalizeLER12RWriteStream @ 91 NONAME
- _ZNK22CCaInnerNotifierFilter12GetEntryRoleEv @ 92 NONAME
- _ZNK22CCaInnerNotifierFilter12GetTypeNamesEv @ 93 NONAME
- _ZNK22CCaInnerNotifierFilter15GetNotifierTypeEv @ 94 NONAME
- _ZNK22CCaInnerNotifierFilter6GetIdsEv @ 95 NONAME
- _ZN13CCaInnerEntry13FindAttributeERK7TDesC16R7TPtrC16 @ 96 NONAME
- _ZN17RCaEntryAttrArray4FindERK7TDesC16R7TPtrC16 @ 97 NONAME
+ _ZN13CCaInnerEntry13FindAttributeERK7TDesC16R7TPtrC16 @ 6 NONAME
+ _ZN13CCaInnerEntry15SetDescriptionLERK7TDesC16 @ 7 NONAME
+ _ZN13CCaInnerEntry16RemoveAttributeLERK7TDesC16 @ 8 NONAME
+ _ZN13CCaInnerEntry17SetEntryTypeNameLERK7TDesC16 @ 9 NONAME
+ _ZN13CCaInnerEntry4NewLEv @ 10 NONAME
+ _ZN13CCaInnerEntry5NewLCEv @ 11 NONAME
+ _ZN13CCaInnerEntry5SetIdEj @ 12 NONAME
+ _ZN13CCaInnerEntry6SetUidEl @ 13 NONAME
+ _ZN13CCaInnerEntry7SetRoleEj @ 14 NONAME
+ _ZN13CCaInnerEntry8SetFlagsEj @ 15 NONAME
+ _ZN13CCaInnerEntry8SetTextLERK7TDesC16 @ 16 NONAME
+ _ZN13CCaInnerEntry9SetIconIdEi @ 17 NONAME
+ _ZN13CCaInnerQuery10SetFlagsOnEj @ 18 NONAME
+ _ZN13CCaInnerQuery11SetFlagsOffEj @ 19 NONAME
+ _ZN13CCaInnerQuery11SetParentIdEi @ 20 NONAME
+ _ZN13CCaInnerQuery12InternalizeLER11RReadStream @ 21 NONAME
+ _ZN13CCaInnerQuery13AddAttributeLERK7TDesC16S2_ @ 22 NONAME
+ _ZN13CCaInnerQuery17SetEntryTypeNamesEP16CDesC16ArrayFlat @ 23 NONAME
+ _ZN13CCaInnerQuery4NewLEv @ 24 NONAME
+ _ZN13CCaInnerQuery5NewLCEv @ 25 NONAME
+ _ZN13CCaInnerQuery6SetUidEj @ 26 NONAME
+ _ZN13CCaInnerQuery7SetIdsLERK6RArrayIiE @ 27 NONAME
+ _ZN13CCaInnerQuery7SetRoleEi @ 28 NONAME
+ _ZN13CCaInnerQuery7SetSortENS_14TSortAttributeE @ 29 NONAME
+ _ZN13CCaInnerQuery8SetCountEj @ 30 NONAME
+ _ZN15RCaEntriesArray12InternalizeLER11RReadStream @ 31 NONAME
+ _ZN17CCaEntryAttribute4NewLERK7TDesC16 @ 32 NONAME
+ _ZN17CCaEntryAttribute5NewLCERK7TDesC16 @ 33 NONAME
+ _ZN17CCaEntryAttribute9SetValueLERK7TDesC16 @ 34 NONAME
+ _ZN17RCaEntryAttrArray15RemoveAttributeERK7TDesC16 @ 35 NONAME
+ _ZN17RCaEntryAttrArray4FindERK7TDesC16R6TDes16 @ 36 NONAME
+ _ZN17RCaEntryAttrArray4FindERK7TDesC16R7TPtrC16 @ 37 NONAME
+ _ZN17RCaEntryAttrArray5ExistERK7TDesC16 @ 38 NONAME
+ _ZN20CCaLocalizationEntry12SetStringIdLERK7TDesC16 @ 39 NONAME
+ _ZN20CCaLocalizationEntry13SetTableNameLERK7TDesC16 @ 40 NONAME
+ _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
--- a/contentstorage/group/group.pro Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/group/group.pro Fri Apr 30 15:22:08 2010 +0300
@@ -18,6 +18,10 @@
#Exporting ibys
BLD_INF_RULES.prj_exports += \
+ "../castorage/conf/castoragedb.confml APP_LAYER_CONFML(castoragedb.confml)" \
+ "../castorage/conf/castoragedb.implml APP_LAYER_CONFML(castoragedb.implml)" \
+ "../castorage/data/castoragedb_create.sql APP_LAYER_CONFML(castoragedb_templates/castoragedb_create.sql)" \
+ "../castorage/conf/castoragedb_templates/castoragedb_variant.sql APP_LAYER_CONFML(castoragedb_templates/castoragedb_variant.sql)" \
"$${LITERAL_HASH}ifndef CONTENT_ARSENAL_STORAGE_UT" \
"../castorage/data/castorage.db z:/private/20022F90/castorage.db" \
"$${LITERAL_HASH}else " \
--- a/contentstorage/inc/cadef.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/inc/cadef.h Fri Apr 30 15:22:08 2010 +0300
@@ -12,7 +12,7 @@
* Contributors:
*
* Description: Definition of different constants
- * Version : %version: 10.1.12 % << Don't touch! Updated by Synergy at check-out.
+ * Version : %version: ou1s60ui#10.1.14 % << Don't touch! Updated by Synergy at check-out.
*
*/
@@ -24,7 +24,7 @@
// database version
-_LIT( KCaDbVersion, "00001" );
+_LIT( KCaDbVersion, "00001" );
@@ -56,6 +56,14 @@
ENative = 32,
EMissing = 64
};
+
+enum TItemAppearance
+ {
+ EItemAppearanceNotChanged,
+ EItemDisappeared,
+ EItemAppeared
+ };
+
// Ca - Application
_LIT( KCaTypeMenuCollections, "menucollections" );
@@ -82,6 +90,8 @@
_LIT( KCaAttrJavaAppSettingsPluginValue,
"/resource/qt/plugins/appsettings/javaapplicationsettingsview.qtplugin");
_LIT( KCaAttrAppWidgetUri, "widget:uri");
+_LIT( KCaAttrAppWidgetServiceXml, "widget:servicexml");
+
_LIT( KCaAttrAppWidgetUriCWRTValue, "wrtwidgetuiplugin");
_LIT( KCaAttrAppWidgetParamWebAppId, "widgetparam:webAppId");
@@ -96,13 +106,15 @@
_LIT( KCaAttrMmcId, "mmc_id" );
_LIT( KCaMassStorage, "mass_storage" );
_LIT( KCaMmcHistoryFname, "mmchistory" );
+// max(KCaMassStorage.Length(), KUidChars)
+const TInt KMassStorageIdLength = 12;
//Ca constants
// ---------------------------------------------------------
// CONSTANTS
-
+
const TUid KSatUid =
{
0x101F4CE0
@@ -113,14 +125,14 @@
0x20022F35
};
-const TUid KMidletApplicationTypeUid =
+const TUid KMidletApplicationTypeUid =
{
- 0x10210E26
+ 0x10210E26
};
-const TUid KCWRTApplicationTypeUid =
+const TUid KCWRTApplicationTypeUid =
{
- 0x200267DC
+ 0x200267DC
};
const TInt KCenRepBufferSize = 255;
@@ -150,7 +162,7 @@
_LIT( KCaDbPropVersion, "Version" ); /// db version
_LIT( KCaDbPropLanguage, "Language" ); // language of ca strings in db
-_LIT( KCaDbPropQMfile, "QMfile" ); // prefix of qm file used in translation
+_LIT( KCaDbPropQMfile, "QMfile" ); // prefix of qm file used in translation
--- a/contentstorage/srvinc/castorageproxy.h Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/srvinc/castorageproxy.h Fri Apr 30 15:22:08 2010 +0300
@@ -18,6 +18,7 @@
#ifndef CASTORAGEPROXY_H
#define CASTORAGEPROXY_H
+#include "cadef.h"
#include "caoperationparams.h"
@@ -84,12 +85,15 @@
/**
* Adds or Updates data to storage.
- * In case when data is added the input aEntry serves
+ * In case when data is added the input aEntry serves.
* also as an output entry.
* @param aEntry Entry data.
- * @param aUpdate is entry updated by a client
+ * @param aUpdate is entry updated by a client.
+ * @param aItemAppearanceChange a type of change of the item.
*/
- IMPORT_C void AddL( CCaInnerEntry* aEntry, TBool aUpdate = EFalse );
+ IMPORT_C void AddL( CCaInnerEntry* aEntry,
+ TBool aUpdate = EFalse,
+ TItemAppearance aItemAppearanceChange = EItemAppearanceNotChanged );
/**
* Removes entries from storage.
--- a/contentstorage/srvsrc/castorageproxy.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/contentstorage/srvsrc/castorageproxy.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -22,7 +22,6 @@
#include "cainnerquery.h"
#include "caarraycleanup.inl"
#include "calocalizationentry.h"
-#include "cadef.h"
#include "casrvsession.h"
@@ -101,11 +100,14 @@
//
// ---------------------------------------------------------------------------
//
-EXPORT_C void CCaStorageProxy::AddL( CCaInnerEntry* aEntry, TBool aUpdate )
+EXPORT_C void CCaStorageProxy::AddL( CCaInnerEntry* aEntry,
+ TBool aUpdate,
+ TItemAppearance aItemAppearanceChange )
{
TChangeType changeType = EAddChangeType;
RArray<TInt> parentArray;
CleanupClosePushL( parentArray );
+
if( aEntry->GetId() > 0 )
{
changeType = EUpdateChangeType;
@@ -115,6 +117,16 @@
iStorage->GetParentsIdsL( id, parentArray );
CleanupStack::PopAndDestroy( &id );
}
+
+ if( aItemAppearanceChange==EItemDisappeared )
+ {
+ changeType = ERemoveChangeType;
+ }
+ else if( aItemAppearanceChange==EItemAppeared )
+ {
+ changeType = EAddChangeType;
+ }
+
iStorage->AddL( aEntry, aUpdate );
for( TInt i = 0; i < iHandlerNotifier.Count(); i++ )
{
--- a/homescreensrv.pro Fri Apr 16 14:45:49 2010 +0300
+++ b/homescreensrv.pro Fri Apr 30 15:22:08 2010 +0300
@@ -19,9 +19,7 @@
SUBDIRS += appfoundation \
hswidgetmodel \
contentstorage \
- contentpublishingsrv \
homescreensrv_plat \
- screensavermodel \
tsrc
symbian:SUBDIRS += activityfw
symbian:SUBDIRS += hsappkeyhandler
--- a/homescreensrv_plat/action_handler_plugin_api/action_handler_plugin_api.metaxml Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" ?>
-<api id="dd7bc6a5b4986d0faed4b28c5d16dcb2" dataversion="2.0">
-<name>action_handler_plugin_api</name>
-<description>Action Handler Plug-in API</description>
-<type>c++</type>
-<collection>contentpublishingsrv</collection>
-<libs>
-</libs>
-<release category="platform" sinceversion="0"/>
-<attributes>
-<htmldocprovided>no</htmldocprovided>
-<adaptation>no</adaptation>
-</attributes>
-</api>
--- a/homescreensrv_plat/action_handler_plugin_api/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: File that exports the files belonging to : sapi_actionhandler
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-../inc/ahpluginuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(ahpluginuids.hrh)
-../inc/ahplugin.h MW_LAYER_PLATFORM_EXPORT_PATH(ahplugin.h)
-
-
-
-
--- a/homescreensrv_plat/action_handler_plugin_api/inc/ahplugin.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* 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: Plugin Interface
- *
-*/
-
-#ifndef C_ACTION_HANDLER_PLUGIN_H
-#define C_ACTION_HANDLER_PLUGIN_H
-
-#include <e32base.h>
-
-class CLiwMap;
-
-/**
- * Action handler interface for ECOM plugins
- */
-class CAHPlugin : public CBase
- {
-
-public:
-
- /**
- * Method called by Action Handler in order to handle an action.
- * Must be implemented by plugin provider.
- *
- * @param aMap an action object to be executed
- * @return Error code
- */
- virtual TInt ExecuteActionL( const CLiwMap* aMap ) = 0;
-
- };
-
-#endif // C_ACTION_HANDLER_PLUGIN_H
--- a/homescreensrv_plat/action_handler_plugin_api/inc/ahpluginuids.hrh Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-/*
-* 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: UID used in Action Handler rss plug-ins files
- *
-*/
-
-
-#ifndef AH_PLUGINUID__HRH_
-#define AH_PLUGINUID__HRH_
-
-#define KAHPluginInterfaceUid 0x10282E5E
-
-#endif /*ASPAPLUGINUID__HRH_*/
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/conf/ah_plugin_api.cfg Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-[StifSettings]
-CheckHeapBalance= off
-[EndStifSettings]
-
-##############################################################
-# Test
-##############################################################
-
-[Test]
-title Test_CAHPluginExecuteActionL
-create ahpluginapitest ahs
-ahs Test_CAHPluginExecuteActionL
-delete ahs
-[Endtest]
\ No newline at end of file
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/data/ahapi.bat Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-rem /*
-rem * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-rem * All rights reserved.
-rem * This component and the accompanying materials are made available
-rem * under the terms of "Eclipse Public License v1.0"
-rem * which accompanies this distribution, and is available
-rem * at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem *
-rem * Initial Contributors:
-rem * Nokia Corporation - initial contribution.
-rem *
-rem * Contributors:
-rem *
-rem * Description:
-rem *
-rem */
-
-md c:\data\stif\ah_results\
-ATSInterface.exe -testmodule TestScripter -config c:\testframework\ah_plugin_api.cfg
\ No newline at end of file
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/group/ah_plugin_api.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <platform_paths.hrh>
-
-TARGET ahpluginapitest.dll
-TARGETTYPE dll
-UID 0x1000af5a 0x016660F6
-
-CAPABILITY ALL -TCB
-
-SOURCEPATH ../src
-SOURCE ahpluginapitest.cpp
-SOURCE ahpluginapitestblocks.cpp
-SOURCE ahtestplugin.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY ecom.lib
-LIBRARY stiftestinterface.lib
-LIBRARY liwservicehandler.lib
-LIBRARY eikcore.lib
-LIBRARY cone.lib
-
-LANG SC
-
-EPOCALLOWDLLDATA
-
-// End of File
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/group/ah_plugin_api.pkg Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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:
-;
-; obrtester.pkg
-;
-;Language - standard language definitions
-&EN
-
-; standard SIS file header
-#{"ahapitest"},(0x016660F6),1,0,0
-
-;Localised Vendor name
-%{"Vendor-EN"}
-
-;Unique Vendor name
-:"Vendor"
-
-;Supports Series 60 v 3.0
-[0x101F7961], 0, 0, 0, {"Series60ProductID"}
-
-;Files to install
-
- "\epoc32\release\armv5\urel\ahpluginapitest.dll" - "!:\sys\bin\ahpluginapitest.dll"
- "..\init\ah_plugin_api.ini" -"!:\testframework\ah_plugin_api.ini"
- "..\conf\ah_plugin_api.cfg" -"!:\testframework\ah_plugin_api.cfg"
- "..\data\ahapi.bat" -"!:\ahapi.bat"
-
-
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/group/bld.inf Fri Apr 16 14:45:49 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:
-*
-*/
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-../init/ah_plugin_api.ini c:/testframework/ah_plugin_api.ini
-../conf/ah_plugin_api.cfg c:/testframework/ah_plugin_api.cfg
-../data/ahapi.bat c:/ahapi.bat
-
-PRJ_MMPFILES
-
-PRJ_TESTMMPFILES
-ah_plugin_api.mmp
-
-// End of File
\ No newline at end of file
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/group/createsis.bat Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-rem
-rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-rem All rights reserved.
-rem This component and the accompanying materials are made available
-rem under the terms of "Eclipse Public License v1.0"
-rem which accompanies this distribution, and is available
-rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem
-rem Initial Contributors:
-rem Nokia Corporation - initial contribution.
-rem
-rem Contributors:
-rem
-rem Description:
-rem
-
-makesis ah_plugin_api.pkg
-signsis ah_plugin_api.sis ah_plugin_api.sisx rd.cer rd-key.pem
-pause
\ No newline at end of file
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/group/rd-key.pem Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4
-6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh
-7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB
-gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX
-pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB
-yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j
-KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003
-iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3
-2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+
-9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0
-aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO
-TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8
-mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ=
------END RSA PRIVATE KEY-----
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/group/rd.cer Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD
-ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z
-NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl
-cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT
-rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa
-gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI
-f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL
-BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud
-IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD
-ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd
-IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE
-IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G
-CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9
-Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT
-7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR
------END CERTIFICATE-----
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/inc/ahpluginapitest.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +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 TESTCLASS_H
-#define TESTCLASS_H
-
-// INCLUDES
-
-
-#include <StifParser.h>
-#include <Stiftestinterface.h>
-#include <StifLogger.h>
-#include <TestScripterInternal.h>
-#include <StifTestModule.h>
-
-// DATA TYPES
-//enum ?declaration
-//typedef ?declaration
-//extern ?data_type;
-
-// CLASS DECLARATION
-
-/**
-* CtestClass test class for STIF Test Framework TestScripter.
-* ?other_description_lines
-*
-* @lib ?library
-* @since ?Series60_version
-*/
-NONSHARABLE_CLASS(CAHPluginApiTest) : public CScriptBase
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CAHPluginApiTest* NewL( CTestModuleIf& aTestModuleIf );
-
- /**
- * Destructor.
- */
- virtual ~CAHPluginApiTest();
-
- public: // New functions
-
- /**
- * ?member_description.
- * @since ?Series60_version
- * @param ?arg1 ?description
- * @return ?description
- */
- //?type ?member_function( ?type ?arg1 );
-
- public: // Functions from base classes
-
- /**
- * From CScriptBase Runs a script line.
- * @since ?Series60_version
- * @param aItem Script line containing method name and parameters
- * @return Symbian OS error code
- */
- virtual TInt RunMethodL( CStifItemParser& aItem );
-
- protected: // New functions
-
- /**
- * ?member_description.
- * @since ?Series60_version
- * @param ?arg1 ?description
- * @return ?description
- */
- //?type ?member_function( ?type ?arg1 );
-
- protected: // Functions from base classes
-
- /**
- * From ?base_class ?member_description
- */
- //?type ?member_function();
-
- private:
-
- /**
- * C++ default constructor.
- */
- CAHPluginApiTest( CTestModuleIf& aTestModuleIf );
-
- /**
- * By default Symbian 2nd phase constructor is private.
- */
- void ConstructL();
-
- /**
- * Test methods are listed below.
- */
- TInt Test_CAHPluginExecuteActionL(CStifItemParser& /*aItem*/ );
-
- public: // Data
- // ?one_line_short_description_of_data
- //?data_declaration;
-
- protected: // Data
- // ?one_line_short_description_of_data
- //?data_declaration;
-
-
- };
-
-#endif // TESTCLASS_H
-
-// End of File
\ No newline at end of file
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/inc/ahtestplugin.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
-* 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: Action Handler test Plugin
- *
-*/
-
-
-#ifndef C_AH_TEST_PLUGIN_H
-#define C_AH_TEST_PLUGIN_H
-
-#include <e32base.h>
-#include <ahplugin.h>
-
-
-// FORWARD DECLARATION
-class CLiwMap;
-class TLiwVariant;
-class CEikonEnv;
-
-
-/**
- * Exemplary Action Handler Plugin.
- * Class extends the CAHPlugin in order to be able to be used
- * as a plugin for action handler.
- *
- * @lib exemplaryactionhandler
- * @since S60 S60 v5.0
- */
-class CActionHandlerTestPlugin : public CAHPlugin
- {
-
-public:
-
- /**
- * Standard Symbian 2 phase constructor
- */
- static CActionHandlerTestPlugin* NewL();
-
- /**
- * Standard Symbian 2 phase constructor
- */
- static CActionHandlerTestPlugin* NewLC();
-
- /**
- * Standard C++ destructor.
- */
- ~CActionHandlerTestPlugin ();
-
- /**
- * Executes provided action
- *
- * @return status code
- */
- TInt ExecuteActionL( const CLiwMap* aMap );
-private:
- /**
- * Standard Symbian 2nd phase constructor.
- */
- void ConstructL();
-
-private:
-
- /**
- * Extract Variant
- */
- TInt ExtractVariantL( const CLiwMap* aMap,
- TLiwVariant& aVariant,
- const TDesC8& aMapName );
-
- };
-
-#endif /* C_AH_TEST_PLUGIN_H */
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/init/ah_plugin_api.ini Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-#
-# This is STIFTestFramework initialization file
-# Comment lines start with '#'-character.
-# See STIF TestFramework users guide.doc for instructions
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set following test engine settings:
-# - Set Test Reporting mode. TestReportMode's possible values are:
-# + 'Summary': Summary of the tested test cases.
-# + 'Environment': Hardware and software info.
-# + 'TestCases': Test case report.
-# + 'FullReport': Set of all above ones.
-# + Example 'TestReportMode= Summary TestCases'
-#
-# - CreateTestReport setting controls report creation mode
-# + YES, Test report will created.
-# + NO, No Test report.
-#
-# - File path indicates the base path of the test report.
-# - File name indicates the name of the test report.
-#
-# - File format indicates the type of the test report.
-# + TXT, Test report file will be txt type, for example 'TestReport.txt'.
-# + HTML, Test report will be html type, for example 'TestReport.html'.
-#
-# - File output indicates output source of the test report.
-# + FILE, Test report logging to file.
-# + RDEBUG, Test report logging to using rdebug.
-#
-# - File Creation Mode indicates test report overwriting if file exist.
-# + OVERWRITE, Overwrites if the Test report file exist.
-# + APPEND, Continue logging after the old Test report information if
-# report exist.
-# - Sets a device reset module's dll name(Reboot).
-# + If Nokia specific reset module is not available or it is not correct one
-# StifHWResetStub module may use as a template for user specific reset
-# module.
-
-[Engine_Defaults]
-
-TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment',
- 'TestCases' or 'FullReport'
-
-CreateTestReport= YES # Possible values: YES or NO
-
-TestReportFilePath= C:\data\stif\ah_results\
-TestReportFileName= Utils
-
-TestReportFormat= HTML # Possible values: TXT or HTML
-TestReportOutput= FILE # Possible values: FILE or RDEBUG
-TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
-
-DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
-
-[End_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Module configurations start
-# Modules are added between module tags
-# tags. Module name is specified after ModuleName= tag, like
-# ModuleName= XXXXXXXXX
-# Modules might have initialisation file, specified as
-# IniFile= c:\testframework\YYYYYY
-# Modules might have several configuration files, like
-# TestCaseFile= c:\testframework\NormalCases.txt
-# TestCaseFile= c:\testframework\SmokeCases.txt
-# TestCaseFile= c:\testframework\ManualCases.txt
-
-# (TestCaseFile is synonym for old term ConfigFile)
-
-# Following case specifies demo module settings. Demo module
-# does not read any settings from file, so tags
-# IniFile and TestCaseFile are not used.
-# In the simplest case it is enough to specify only the
-# name of the test module when adding new test module
-
-#[New_Module]
-#ModuleName= dom_test2
-#[End_Module]
-
-
-# Load testmoduleXXX, optionally with initialization file and/or test case files
-[New_Module]
-ModuleName= testscripter
-
-#TestModuleXXX used initialization file
-#IniFile= c:\testframework\init.txt
-
-#TestModuleXXX used configuration file(s)
-
-TestCaseFile= c:\testframework\ah_plugin_api.cfg
-
-
-[End_Module]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set STIFTestFramework logging overwrite parameters for Logger.
-# Hardware and emulator environment logging path and styles can
-# be configured from here to overwrite the Logger's implemented values.
-#
-# Settings description:
-# - Indicates option for creation log directory/directories. If log directory/directories
-# is/are not created by user they will make by software.
-# + YES, Create log directory/directories if not allready exist.
-# + NO, Log directory/directories not created. Only created one is used.
-#
-# - Overwrite emulator path setting.
-# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined
-# Logger's path 'D:\\LOGS\\Module\\' with those definition the path
-# will be 'C:\LOGS\TestFramework\LOGS\Module\'
-#
-# - Overwrite emulator's logging format.
-# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
-# + HTML, Log file(s) will be html type(s), for example 'Module.html'.
-#
-# - Overwrited emulator logging output source.
-# + FILE, Logging to file(s).
-# + RDEBUG, Logging to using rdebug(s).
-#
-# - Overwrite hardware path setting (Same description as above in emulator path).
-# - Overwrite hardware's logging format(Same description as above in emulator format).
-# - Overwrite hardware's logging output source(Same description as above in emulator output).
-#
-# - File Creation Mode indicates file overwriting if file exist.
-# + OVERWRITE, Overwrites if file(s) exist.
-# + APPEND, Continue logging after the old logging information if file(s) exist.
-#
-# - Will thread id include to the log filename.
-# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
-# + NO, No thread id to log file(s), Example filename 'Module.txt'.
-#
-# - Will time stamps include the to log file.
-# + YES, Time stamp added to each line in log file(s). Time stamp is
-# for example'12.Nov.2003 115958 LOGGING INFO'
-# + NO, No time stamp(s).
-#
-# - Will line breaks include to the log file.
-# + YES, Each logging event includes line break and next log event is in own line.
-# + NO, No line break(s).
-#
-# - Will event ranking include to the log file.
-# + YES, Event ranking number added to each line in log file(s). Ranking number
-# depends on environment's tics, for example(includes time stamp also)
-# '012 12.Nov.2003 115958 LOGGING INFO'
-# + NO, No event ranking.
-#
-
-[Logger_Defaults]
-
-#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
-
-#CreateLogDirectories= YES # Possible values: YES or NO
-
-#EmulatorBasePath= C:\LOGS\TestFramework\
-#EmulatorFormat= HTML # Possible values: TXT or HTML
-#EmulatorOutput= FILE # Possible values: FILE or RDEBUG
-
-#HardwareBasePath= D:\LOGS\TestFramework\
-#HardwareFormat= HTML # Possible values: TXT or HTML
-#HardwareOutput= FILE # Possible values: FILE or RDEBUG
-
-#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
-
-#ThreadIdToLogFile= YES # Possible values: YES or NO
-#WithTimeStamp= YES # Possible values: YES or NO
-#WithLineBreak= YES # Possible values: YES or NO
-#WithEventRanking= YES # Possible values: YES or NO
-
-[End_Logger_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-# End of file
\ No newline at end of file
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/src/ahpluginapitest.cpp Fri Apr 16 14:45:49 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:
-*
-*/
-// INCLUDE FILES
-
-#include <ecom/ecom.h>
-#include <Stiftestinterface.h>
-#include "ahpluginapitest.h"
-#include "ahtestplugin.h"
-#include <LiwVariant.h>
-_LIT8( KTitle , "title" );
-_LIT8( KMessage, "message" );
-// ============================ MEMBER FUNCTIONS ===============================
-
-
-TInt CAHPluginApiTest::Test_CAHPluginExecuteActionL(CStifItemParser& )
- {
- TInt result (KErrGeneral);
- CLiwDefaultMap* map = CLiwDefaultMap::NewLC( );
- map->InsertL( KTitle, _L8("title") );
- map->InsertL( KMessage, _L8("message") );
- CActionHandlerTestPlugin* plugin = CActionHandlerTestPlugin::NewLC();
- result = plugin->ExecuteActionL( map );
- CleanupStack::PopAndDestroy( plugin );
- CleanupStack::PopAndDestroy( map );
- return result;
- }
-
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/src/ahpluginapitestblocks.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +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 FILES
-#include <e32svr.h>
-#include <StifParser.h>
-#include <Stiftestinterface.h>
-#include "ahpluginapitest.h"
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CClientServiceTester::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CAHPluginApiTest::CAHPluginApiTest(
- CTestModuleIf& aTestModuleIf ):
- CScriptBase( aTestModuleIf )
- {
- TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksMem );
- }
-
-// -----------------------------------------------------------------------------
-// CClientServiceTester::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CAHPluginApiTest::ConstructL()
- {
- }
-
-// -----------------------------------------------------------------------------
-// CClientServiceTester::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CAHPluginApiTest* CAHPluginApiTest::NewL(
- CTestModuleIf& aTestModuleIf )
- {
- CAHPluginApiTest* self = new (ELeave) CAHPluginApiTest( aTestModuleIf );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop();
-
- return self;
- }
-
-// Destructor
-CAHPluginApiTest::~CAHPluginApiTest()
- {
- }
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-
-// -----------------------------------------------------------------------------
-// LibEntryL is a polymorphic Dll entry point.
-// Returns: CScriptBase: New CScriptBase derived object
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CScriptBase* LibEntryL(
- CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
- {
-
- return ( CScriptBase* ) CAHPluginApiTest::NewL( aTestModuleIf );
-
- }
-
-// -----------------------------------------------------------------------------
-// E32Dll is a DLL entry point function.
-// Returns: KErrNone
-// -----------------------------------------------------------------------------
-//
-#ifndef EKA2 // Hide Dll entry point to EKA2
-GLDEF_C TInt E32Dll(
- TDllReason /*aReason*/) // Reason code
- {
- return(KErrNone);
-
- }
-#endif // EKA2
-
-// -----------------------------------------------------------------------------
-// CMCSAPITest::RunMethodL
-// Run specified method. Contains also table of test mothods and their names.
-// -----------------------------------------------------------------------------
-//
-TInt CAHPluginApiTest::RunMethodL(
- CStifItemParser& aItem )
- {
-
- static TStifFunctionInfo const KFunctions[] =
- {
-
- ENTRY( "Test_CAHPluginExecuteActionL", CAHPluginApiTest::Test_CAHPluginExecuteActionL ),
- };
-
- const TInt count = sizeof( KFunctions ) /
- sizeof( TStifFunctionInfo );
-
- return RunInternalL( KFunctions, count, aItem );
-
- }
-
-// End of File
--- a/homescreensrv_plat/action_handler_plugin_api/tsrc/src/ahtestplugin.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
-* 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: Exemplary Action Handler Plugin
-*
-*/
-
-
-
-#include <e32def.h>
-#include <e32uid.h>
-#include <LiwVariant.h>
-
-#include "ahtestplugin.h"
-
-_LIT8( KTitle , "title" );
-_LIT8( KMessage, "message" );
-
-// ======== MEMBER FUNCTIONS ========
-
-// ----------------------------------------------------------------------------
-// Symbian 2nd phase constructor can leave.
-// ----------------------------------------------------------------------------
-//
-void CActionHandlerTestPlugin::ConstructL()
- {
- }
-
-// ----------------------------------------------------------------------------
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CActionHandlerTestPlugin* CActionHandlerTestPlugin::NewL()
- {
- CActionHandlerTestPlugin* self = CActionHandlerTestPlugin::NewLC();
- CleanupStack::Pop( self );
- return self;
- }
-
-// ----------------------------------------------------------------------------
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CActionHandlerTestPlugin* CActionHandlerTestPlugin::NewLC()
- {
- CActionHandlerTestPlugin* self = new( ELeave ) CActionHandlerTestPlugin;
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-
-// ---------------------------------------------------------------------------
-// destructor
-// ---------------------------------------------------------------------------
-CActionHandlerTestPlugin::~CActionHandlerTestPlugin()
- {
- }
-
-// ---------------------------------------------------------------------------
-// Executes provided action
-// ---------------------------------------------------------------------------
-//
-TInt CActionHandlerTestPlugin::ExecuteActionL( const CLiwMap* aMap )
- {
- TInt errCode( KErrNotFound );
- TLiwVariant variant;
- variant.PushL();
- errCode = ExtractVariantL( aMap, variant, KTitle );
- if( errCode == KErrNone )
- {
- errCode = ExtractVariantL( aMap, variant, KMessage );
- }
- CleanupStack::PopAndDestroy( &variant );
- return errCode;
- }
-
-
-// ---------------------------------------------------------------------------
-// Extract variant
-// ---------------------------------------------------------------------------
-//
-TInt CActionHandlerTestPlugin::ExtractVariantL( const CLiwMap* aMap,
- TLiwVariant& aVariant,
- const TDesC8& aMapName )
-
- {
- TInt errCode( KErrNone );
-
- if ( !aMap->FindL( aMapName, aVariant ) )
- {
- errCode = KErrNotFound;
- }
-
- return errCode;
- }
-
-// End of file
--- a/homescreensrv_plat/content_harvester_plugin_api/content_harvester_plugin_api.metaxml Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" ?>
-<api id="2d512d96eac8f6d0172599b67f17c686" dataversion="2.0">
-<name>content_harvester_plugin_api</name>
-<description>Content harvester plugin API </description>
-<type>c++</type>
-<collection>contentpublishingsrv</collection>
-<libs>
-</libs>
-<release category="platform" sinceversion="0"/>
-<attributes>
-<htmldocprovided>no</htmldocprovided>
-<adaptation>no</adaptation>
-</attributes>
-</api>
--- a/homescreensrv_plat/content_harvester_plugin_api/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: File that exports the files belonging to : ContentHarvester
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-../inc/contentharvesterpluginuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(contentharvesterpluginuids.hrh)
-../inc/contentharvesterplugin.h MW_LAYER_PLATFORM_EXPORT_PATH(contentharvesterplugin.h)
-
-
-
-
--- a/homescreensrv_plat/content_harvester_plugin_api/inc/contentharvesterplugin.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* 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: Plugin interface
- *
-*/
-
-
-#ifndef C_CONTENTHARVESTERPLUGIN_H
-#define C_CONTENTHARVESTERPLUGIN_H
-
-#include <e32base.h>
-
-// CLASS DECLARATION
-/**
- * The interface class for all Content Harvester plugins.
- * Plugins are responsible for updating and synchronization with CPS.
- *
- */
-class CContentHarvesterPlugin : public CBase
- {
-public:
-
- /**
- * Method called by Content Harvester in order to invoke Update operation.
- * Must be implemented by plugin provider.
- */
- virtual void UpdateL() = 0;
-
- };
-
-#endif // C_CONTENTHARVESTERPLUGIN_H
--- a/homescreensrv_plat/content_harvester_plugin_api/inc/contentharvesterpluginuids.hrh Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* 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: UID used in Content Harvester rss plug-ins files
- *
-*/
-
-
-#ifndef CONTENTHARVESTERPLUGINUID_HRH_
-#define CONTENTHARVESTERPLUGINUID_HRH_
-
-#define KContentHarvesterPluginUid 0x10282E5B // interface uid
-#define KCHSwiPluginUidDll 0x20022E84 // SwiPlugin DLL UID
-#define KCHSwiPluginUidImpl 0x20022E85 // SwiPlugin Impl UID
-
-#endif /*CONTENTHARVESTERPLUGINUID_HRH_*/
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/conf/cps_plugin_api.cfg Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-[StifSettings]
-CheckHeapBalance= off
-[EndStifSettings]
-
-##############################################################
-# Test
-##############################################################
-
-[Test]
-title Test_CContentHarvesterPluginUpdateL
-create cpspluginapitest cps
-cps Test_CContentHarvesterPluginUpdateL
-delete cps
-[Endtest]
\ No newline at end of file
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/data/chpapi.bat Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-rem /*
-rem * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-rem * All rights reserved.
-rem * This component and the accompanying materials are made available
-rem * under the terms of "Eclipse Public License v1.0"
-rem * which accompanies this distribution, and is available
-rem * at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem *
-rem * Initial Contributors:
-rem * Nokia Corporation - initial contribution.
-rem *
-rem * Contributors:
-rem *
-rem * Description:
-rem *
-rem */
-md c:\data\stif\chp_results\
-ATSInterface.exe -testmodule TestScripter -config c:\testframework\cps_plugin_api.cfg
\ No newline at end of file
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/bld.inf Fri Apr 16 14:45:49 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:
-*
-*/
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-../init/cps_plugin_api.ini c:/testframework/cps_plugin_api.ini
-../conf/cps_plugin_api.cfg c:/testframework/cps_plugin_api.cfg
-../data/chpapi.bat c:/chpapi.bat
-
-PRJ_MMPFILES
-
-PRJ_TESTMMPFILES
-cps_plugin_api.mmp
-
-// End of File
\ No newline at end of file
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/cps_plugin_api.mmp Fri Apr 16 14:45:49 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:
-*
-*/
-#include <platform_paths.hrh>
-
-TARGET cpspluginapitest.dll
-TARGETTYPE dll
-UID 0x1000af5a 0x016660A6
-
-CAPABILITY ALL -TCB
-
-SOURCEPATH ../src
-SOURCE cpspluginapitest.cpp
-SOURCE cpspluginapitestblocks.cpp
-SOURCE cpstestplugin.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY ecom.lib
-LIBRARY stiftestinterface.lib
-
-LANG SC
-
-EPOCALLOWDLLDATA
-
-// End of File
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/cps_plugin_api.pkg Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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:
-;
-; obrtester.pkg
-;
-;Language - standard language definitions
-&EN
-
-; standard SIS file header
-#{"cpsapitest"},(0x016660A6),1,0,0
-
-;Localised Vendor name
-%{"Vendor-EN"}
-
-;Unique Vendor name
-:"Vendor"
-
-;Supports Series 60 v 3.0
-[0x101F7961], 0, 0, 0, {"Series60ProductID"}
-
-;Files to install
-
- "\epoc32\release\armv5\urel\cpspluginapitest.dll" - "!:\sys\bin\cpspluginapitest.dll"
- "..\init\cps_plugin_api.ini" -"!:\testframework\cps_plugin_api.ini"
- "..\conf\cps_plugin_api.cfg" -"!:\testframework\cps_plugin_api.cfg"
- "..\data\chpapi.bat" -"!:\chpapi.bat"
-
-
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/createsis.bat Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-rem
-rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-rem All rights reserved.
-rem This component and the accompanying materials are made available
-rem under the terms of "Eclipse Public License v1.0"
-rem which accompanies this distribution, and is available
-rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem
-rem Initial Contributors:
-rem Nokia Corporation - initial contribution.
-rem
-rem Contributors:
-rem
-rem Description:
-rem
-
-makesis cps_plugin_api.pkg
-signsis cps_plugin_api.sis cps_plugin_api.sisx rd.cer rd-key.pem
-pause
\ No newline at end of file
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/rd-key.pem Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4
-6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh
-7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB
-gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX
-pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB
-yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j
-KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003
-iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3
-2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+
-9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0
-aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO
-TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8
-mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ=
------END RSA PRIVATE KEY-----
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/rd.cer Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD
-ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z
-NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl
-cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT
-rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa
-gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI
-f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL
-BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud
-IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD
-ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd
-IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE
-IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G
-CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9
-Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT
-7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR
------END CERTIFICATE-----
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/inc/cpspluginapitest.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +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 TESTCLASS_H
-#define TESTCLASS_H
-
-// INCLUDES
-
-
-#include <StifParser.h>
-#include <Stiftestinterface.h>
-#include <StifLogger.h>
-#include <TestScripterInternal.h>
-#include <StifTestModule.h>
-
-// DATA TYPES
-//enum ?declaration
-//typedef ?declaration
-//extern ?data_type;
-
-// CLASS DECLARATION
-
-/**
-* CtestClass test class for STIF Test Framework TestScripter.
-* ?other_description_lines
-*
-* @lib ?library
-* @since ?Series60_version
-*/
-NONSHARABLE_CLASS(CCPSPluginApiTest) : public CScriptBase
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CCPSPluginApiTest* NewL( CTestModuleIf& aTestModuleIf );
-
- /**
- * Destructor.
- */
- virtual ~CCPSPluginApiTest();
-
- public: // New functions
-
- /**
- * ?member_description.
- * @since ?Series60_version
- * @param ?arg1 ?description
- * @return ?description
- */
- //?type ?member_function( ?type ?arg1 );
-
- public: // Functions from base classes
-
- /**
- * From CScriptBase Runs a script line.
- * @since ?Series60_version
- * @param aItem Script line containing method name and parameters
- * @return Symbian OS error code
- */
- virtual TInt RunMethodL( CStifItemParser& aItem );
-
- protected: // New functions
-
- /**
- * ?member_description.
- * @since ?Series60_version
- * @param ?arg1 ?description
- * @return ?description
- */
- //?type ?member_function( ?type ?arg1 );
-
- protected: // Functions from base classes
-
- /**
- * From ?base_class ?member_description
- */
- //?type ?member_function();
-
- private:
-
- /**
- * C++ default constructor.
- */
- CCPSPluginApiTest( CTestModuleIf& aTestModuleIf );
-
- /**
- * By default Symbian 2nd phase constructor is private.
- */
- void ConstructL();
-
- /**
- * Test methods are listed below.
- */
- TInt Test_CContentHarvesterPluginUpdateL(CStifItemParser& /*aItem*/ );
-
- public: // Data
- // ?one_line_short_description_of_data
- //?data_declaration;
-
- protected: // Data
- // ?one_line_short_description_of_data
- //?data_declaration;
-
-
- };
-
-#endif // TESTCLASS_H
-
-// End of File
\ No newline at end of file
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/inc/cpstestplugin.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* 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: Action Handler test Plugin
- *
-*/
-
-
-#ifndef C_CPS_TEST_PLUGIN_H
-#define C_CPS_TEST_PLUGIN_H
-
-#include <e32base.h>
-#include <contentharvesterplugin.h>
-
-
-// FORWARD DECLARATION
-
-/**
- * Exemplary CPS Plugin.
- *
- * @lib exemplaryactionhandler
- * @since S60 S60 v5.0
- */
-class CCPSTestPlugin : public CContentHarvesterPlugin
- {
-
-public:
-
- /**
- * Standard Symbian 2 phase constructor
- */
- static CCPSTestPlugin* NewL();
-
- /**
- * Standard Symbian 2 phase constructor
- */
- static CCPSTestPlugin* NewLC();
-
- /**
- * Standard C++ destructor.
- */
- ~CCPSTestPlugin ();
-
- /**
- * Executes provided action
- *
- * @return status code
- */
- void UpdateL();
-private:
- /**
- * Standard Symbian 2nd phase constructor.
- */
- void ConstructL();
-
-public:
-
- TInt iInt;
-
-
- };
-
-#endif /* C_CPS_TEST_PLUGIN_H */
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/init/cps_plugin_api.ini Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-#
-# This is STIFTestFramework initialization file
-# Comment lines start with '#'-character.
-# See STIF TestFramework users guide.doc for instructions
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set following test engine settings:
-# - Set Test Reporting mode. TestReportMode's possible values are:
-# + 'Summary': Summary of the tested test cases.
-# + 'Environment': Hardware and software info.
-# + 'TestCases': Test case report.
-# + 'FullReport': Set of all above ones.
-# + Example 'TestReportMode= Summary TestCases'
-#
-# - CreateTestReport setting controls report creation mode
-# + YES, Test report will created.
-# + NO, No Test report.
-#
-# - File path indicates the base path of the test report.
-# - File name indicates the name of the test report.
-#
-# - File format indicates the type of the test report.
-# + TXT, Test report file will be txt type, for example 'TestReport.txt'.
-# + HTML, Test report will be html type, for example 'TestReport.html'.
-#
-# - File output indicates output source of the test report.
-# + FILE, Test report logging to file.
-# + RDEBUG, Test report logging to using rdebug.
-#
-# - File Creation Mode indicates test report overwriting if file exist.
-# + OVERWRITE, Overwrites if the Test report file exist.
-# + APPEND, Continue logging after the old Test report information if
-# report exist.
-# - Sets a device reset module's dll name(Reboot).
-# + If Nokia specific reset module is not available or it is not correct one
-# StifHWResetStub module may use as a template for user specific reset
-# module.
-
-[Engine_Defaults]
-
-TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment',
- 'TestCases' or 'FullReport'
-
-CreateTestReport= YES # Possible values: YES or NO
-
-TestReportFilePath= C:\data\stif\chp_results\
-TestReportFileName= Utils
-
-TestReportFormat= HTML # Possible values: TXT or HTML
-TestReportOutput= FILE # Possible values: FILE or RDEBUG
-TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
-
-DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
-
-[End_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Module configurations start
-# Modules are added between module tags
-# tags. Module name is specified after ModuleName= tag, like
-# ModuleName= XXXXXXXXX
-# Modules might have initialisation file, specified as
-# IniFile= c:\testframework\YYYYYY
-# Modules might have several configuration files, like
-# TestCaseFile= c:\testframework\NormalCases.txt
-# TestCaseFile= c:\testframework\SmokeCases.txt
-# TestCaseFile= c:\testframework\ManualCases.txt
-
-# (TestCaseFile is synonym for old term ConfigFile)
-
-# Following case specifies demo module settings. Demo module
-# does not read any settings from file, so tags
-# IniFile and TestCaseFile are not used.
-# In the simplest case it is enough to specify only the
-# name of the test module when adding new test module
-
-#[New_Module]
-#ModuleName= dom_test2
-#[End_Module]
-
-
-# Load testmoduleXXX, optionally with initialization file and/or test case files
-[New_Module]
-ModuleName= testscripter
-
-#TestModuleXXX used initialization file
-#IniFile= c:\testframework\init.txt
-
-#TestModuleXXX used configuration file(s)
-
-TestCaseFile= c:\testframework\cps_plugin_api.cfg
-
-
-[End_Module]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set STIFTestFramework logging overwrite parameters for Logger.
-# Hardware and emulator environment logging path and styles can
-# be configured from here to overwrite the Logger's implemented values.
-#
-# Settings description:
-# - Indicates option for creation log directory/directories. If log directory/directories
-# is/are not created by user they will make by software.
-# + YES, Create log directory/directories if not allready exist.
-# + NO, Log directory/directories not created. Only created one is used.
-#
-# - Overwrite emulator path setting.
-# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined
-# Logger's path 'D:\\LOGS\\Module\\' with those definition the path
-# will be 'C:\LOGS\TestFramework\LOGS\Module\'
-#
-# - Overwrite emulator's logging format.
-# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
-# + HTML, Log file(s) will be html type(s), for example 'Module.html'.
-#
-# - Overwrited emulator logging output source.
-# + FILE, Logging to file(s).
-# + RDEBUG, Logging to using rdebug(s).
-#
-# - Overwrite hardware path setting (Same description as above in emulator path).
-# - Overwrite hardware's logging format(Same description as above in emulator format).
-# - Overwrite hardware's logging output source(Same description as above in emulator output).
-#
-# - File Creation Mode indicates file overwriting if file exist.
-# + OVERWRITE, Overwrites if file(s) exist.
-# + APPEND, Continue logging after the old logging information if file(s) exist.
-#
-# - Will thread id include to the log filename.
-# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
-# + NO, No thread id to log file(s), Example filename 'Module.txt'.
-#
-# - Will time stamps include the to log file.
-# + YES, Time stamp added to each line in log file(s). Time stamp is
-# for example'12.Nov.2003 115958 LOGGING INFO'
-# + NO, No time stamp(s).
-#
-# - Will line breaks include to the log file.
-# + YES, Each logging event includes line break and next log event is in own line.
-# + NO, No line break(s).
-#
-# - Will event ranking include to the log file.
-# + YES, Event ranking number added to each line in log file(s). Ranking number
-# depends on environment's tics, for example(includes time stamp also)
-# '012 12.Nov.2003 115958 LOGGING INFO'
-# + NO, No event ranking.
-#
-
-[Logger_Defaults]
-
-#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
-
-#CreateLogDirectories= YES # Possible values: YES or NO
-
-#EmulatorBasePath= C:\LOGS\TestFramework\
-#EmulatorFormat= HTML # Possible values: TXT or HTML
-#EmulatorOutput= FILE # Possible values: FILE or RDEBUG
-
-#HardwareBasePath= D:\LOGS\TestFramework\
-#HardwareFormat= HTML # Possible values: TXT or HTML
-#HardwareOutput= FILE # Possible values: FILE or RDEBUG
-
-#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
-
-#ThreadIdToLogFile= YES # Possible values: YES or NO
-#WithTimeStamp= YES # Possible values: YES or NO
-#WithLineBreak= YES # Possible values: YES or NO
-#WithEventRanking= YES # Possible values: YES or NO
-
-[End_Logger_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-# End of file
\ No newline at end of file
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/src/cpspluginapitest.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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 FILES
-
-#include <ecom/ecom.h>
-#include <Stiftestinterface.h>
-#include "cpspluginapitest.h"
-#include "cpstestplugin.h"
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-
-TInt CCPSPluginApiTest::Test_CContentHarvesterPluginUpdateL(CStifItemParser& )
- {
- TInt result (KErrGeneral);
- CCPSTestPlugin* plugin = CCPSTestPlugin::NewLC();
- if( plugin->iInt == KErrNotFound )
- {
- plugin->UpdateL();
- result = plugin->iInt;
- }
- CleanupStack::PopAndDestroy( plugin );
- return result;
- }
-
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/src/cpspluginapitestblocks.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +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 FILES
-#include <e32svr.h>
-#include <StifParser.h>
-#include <Stiftestinterface.h>
-#include "cpspluginapitest.h"
-
-// ============================ MEMBER FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-// CClientServiceTester::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CCPSPluginApiTest::CCPSPluginApiTest(
- CTestModuleIf& aTestModuleIf ):
- CScriptBase( aTestModuleIf )
- {
- TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksMem );
- }
-
-// -----------------------------------------------------------------------------
-// CClientServiceTester::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CCPSPluginApiTest::ConstructL()
- {
- }
-
-// -----------------------------------------------------------------------------
-// CClientServiceTester::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CCPSPluginApiTest* CCPSPluginApiTest::NewL(
- CTestModuleIf& aTestModuleIf )
- {
- CCPSPluginApiTest* self = new (ELeave) CCPSPluginApiTest( aTestModuleIf );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop();
-
- return self;
- }
-
-// Destructor
-CCPSPluginApiTest::~CCPSPluginApiTest()
- {
- }
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-
-// -----------------------------------------------------------------------------
-// LibEntryL is a polymorphic Dll entry point.
-// Returns: CScriptBase: New CScriptBase derived object
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CScriptBase* LibEntryL(
- CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
- {
-
- return ( CScriptBase* ) CCPSPluginApiTest::NewL( aTestModuleIf );
-
- }
-
-// -----------------------------------------------------------------------------
-// E32Dll is a DLL entry point function.
-// Returns: KErrNone
-// -----------------------------------------------------------------------------
-//
-#ifndef EKA2 // Hide Dll entry point to EKA2
-GLDEF_C TInt E32Dll(
- TDllReason /*aReason*/) // Reason code
- {
- return(KErrNone);
-
- }
-#endif // EKA2
-// -----------------------------------------------------------------------------
-// CMCSAPITest::RunMethodL
-// Run specified method. Contains also table of test mothods and their names.
-// -----------------------------------------------------------------------------
-//
-TInt CCPSPluginApiTest::RunMethodL(
- CStifItemParser& aItem )
- {
-
- static TStifFunctionInfo const KFunctions[] =
- {
-
- ENTRY( "Test_CContentHarvesterPluginUpdateL",CCPSPluginApiTest::Test_CContentHarvesterPluginUpdateL ),
- };
-
- const TInt count = sizeof( KFunctions ) /
- sizeof( TStifFunctionInfo );
-
- return RunInternalL( KFunctions, count, aItem );
-
- }
-
-// End of File
--- a/homescreensrv_plat/content_harvester_plugin_api/tsrc/src/cpstestplugin.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
-* 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: Exemplary Action Handler Plugin
-*
-*/
-
-
-
-
-#include "cpstestplugin.h"
-
-
-// ======== MEMBER FUNCTIONS ========
-
-// ----------------------------------------------------------------------------
-// Symbian 2nd phase constructor can leave.
-// ----------------------------------------------------------------------------
-//
-void CCPSTestPlugin::ConstructL()
- {
- iInt = KErrNotFound;
- }
-
-// ----------------------------------------------------------------------------
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CCPSTestPlugin* CCPSTestPlugin::NewL()
- {
- CCPSTestPlugin* self = CCPSTestPlugin::NewLC();
- CleanupStack::Pop( self );
- return self;
- }
-
-// ----------------------------------------------------------------------------
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CCPSTestPlugin* CCPSTestPlugin::NewLC()
- {
- CCPSTestPlugin* self = new( ELeave ) CCPSTestPlugin;
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-
-// ---------------------------------------------------------------------------
-// destructor
-// ---------------------------------------------------------------------------
-CCPSTestPlugin::~CCPSTestPlugin()
- {
- }
-
-// ---------------------------------------------------------------------------
-// Executes provided action
-// ---------------------------------------------------------------------------
-//
-void CCPSTestPlugin::UpdateL()
- {
- iInt = KErrNone;
- }
-
-
--- a/homescreensrv_plat/contentstorage_api/cadefs.h Fri Apr 16 14:45:49 2010 +0300
+++ b/homescreensrv_plat/contentstorage_api/cadefs.h Fri Apr 30 15:22:08 2010 +0300
@@ -66,6 +66,7 @@
NotFoundErrorCode,
OutOfMemoryErrorCode,
BadArgumentErrorCode,
+ ServerTerminated,
UnknownErrorCode
};
--- a/homescreensrv_plat/contentstorage_api/caquery.h Fri Apr 16 14:45:49 2010 +0300
+++ b/homescreensrv_plat/contentstorage_api/caquery.h Fri Apr 30 15:22:08 2010 +0300
@@ -18,7 +18,7 @@
#ifndef CAQUERY_H
#define CAQUERY_H
-#include <QStringList.h>
+#include <QStringList>
#include "caclient_global.h"
#include "cadefs.h"
--- a/homescreensrv_plat/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Includes all the Domain API specific bld.inf files, which
-* export files.
-*
-*/
-
-
-
-
-#include "../action_handler_plugin_api/group/bld.inf"
-#include "../content_harvester_plugin_api/group/bld.inf"
-#include "../sapi_contentpublishing/group/bld.inf"
-#include "../sapi_actionhandler/group/bld.inf"
--- a/homescreensrv_plat/homescreen_information_api/inc/homescreendomainpskeys.h Fri Apr 16 14:45:49 2010 +0300
+++ b/homescreensrv_plat/homescreen_information_api/inc/homescreendomainpskeys.h Fri Apr 30 15:22:08 2010 +0300
@@ -19,7 +19,7 @@
#define HOMESCREEN_DOMAIN_PS_KEYS_H
/**
- * P&S Key path for all Home Screen state information keys provided by this API.
+ * P&S Key path for all Home Screen information keys provided by this API.
*/
const char HsStatePSKeyPath[] = "/homescreen";
@@ -32,6 +32,18 @@
const char HsStatePSKeySubPath[] = "state";
/**
+ * 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.
+ */
+const TUint KHsCategoryStateKey = 0x1;
+
+/**
* Home screen state.
*/
enum EPSHsState
--- a/homescreensrv_plat/homescreensrv_plat.pro Fri Apr 16 14:45:49 2010 +0300
+++ b/homescreensrv_plat/homescreensrv_plat.pro Fri Apr 30 15:22:08 2010 +0300
@@ -29,4 +29,3 @@
}
-BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include \"group/bld.inf\""
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/data/actionhandlerplugins.rss Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: App for Action handler
-*
-*/
-
-
-#include <ecom/registryinfo.rh>
-#include "ahpluginuids.hrh"
-
-// ---------------------------------------------------------------------------
-// theInfo
-// Declares info for implementations
-// ---------------------------------------------------------------------------
-//
-RESOURCE REGISTRY_INFO theInfo
- {
- // UID for the DLL
- dll_uid = 0x10282E64;
- // Declare array of interface info
- interfaces =
- {
- INTERFACE_INFO
- {
- // UID of interface that is implemented
- interface_uid = KAHPluginInterfaceUid;
- implementations =
- {
- // Info for App Handler
- IMPLEMENTATION_INFO
- {
- implementation_uid = 0x10282E5F;
- version_no = 1;
- display_name = "Implementation 1";
- default_data = "1";
- opaque_data = "";
- },
- // Info for Tel Handler
- IMPLEMENTATION_INFO
- {
- implementation_uid = 0x10282E61;
- version_no = 1;
- display_name = "Implementation 2";
- default_data = "2";
- opaque_data = "";
- },
- // Info for HelpLauncher
- IMPLEMENTATION_INFO
- {
- implementation_uid = 0x2001B285;
- version_no = 1;
- display_name = "Implementation 3";
- default_data = "3";
- opaque_data = "";
- }
- };
- }
- };
- }
-
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/group/ahplugins.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Active Space Action Handler Plugins
-*
-*/
-
-// To get the APP_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET actionhandlerplugins.dll
-TARGETTYPE PLUGIN
-UID 0x10009D8D 0x10282E64
-
-CAPABILITY CAP_ECOM_PLUGIN
-
-SOURCEPATH ../src
-SOURCE Proxy.cpp
-SOURCE ahpapplauncher.cpp
-SOURCE ahtelkeyhandler.cpp
-SOURCE ahhelplauncher.cpp
-
-
-SOURCEPATH ../data
-
-USERINCLUDE .
-USERINCLUDE ../inc
-USERINCLUDE ../../inc
-
-APP_LAYER_SYSTEMINCLUDE
-
-start resource actionhandlerplugins.rss
-HEADER
-TARGET actionhandlerplugins.rsc
-TARGETPATH resource/plugins
-END
-
-LIBRARY euser.lib
-LIBRARY ECom.lib
-LIBRARY cone.lib
-LIBRARY liwservicehandler.lib //LIW Framework
-LIBRARY servicehandler.lib //AIW Framework
-LIBRARY aiwdialdata.lib
-LIBRARY apgrfx.lib
-LIBRARY apparc.lib
-LIBRARY sendui.lib
-LIBRARY hlplch.lib
-LIBRARY ws32.lib
-
-
-// End of File
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Active Space Action Handler Plugins
-*
-*/
-
-
-
-PRJ_EXPORTS
-
-
-PRJ_MMPFILES
-ahplugins.mmp
-
-
-
-//End of file
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahhelplauncher.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
-* 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 Component
- *
-*/
-
-
-#ifndef C_ACTION_HANDLER_HELPLAUNCHER_H
-#define C_ACTION_HANDLER_HELPLAUNCHER_H
-
-#include "ahplugin.h"
-// FORWARD DECLARATION
-class CLiwMap;
-
-/**
- * Action Handler Help Launcher Plugin
- *
- *
- * @lib ?library
- * @since S60 v3.0
- */
-class CAHHelpLauncher : public CAHPlugin
- {
-
-public:
-
- /**
- * Two phase contruction
- */
- static CAHHelpLauncher* NewL();
-
- /**
- * Two phase contruction
- */
- static CAHHelpLauncher* NewLC();
-
- /**
- * Destructor
- */
- ~CAHHelpLauncher();
-
- /**
- * Executes provided action
- *
- * @return status code
- */
-
- TInt ExecuteActionL( const CLiwMap* aMap );
-private:
-
- /**
- * 2nd phase contructor
- */
- void ConstructL();
-
- TInt ExtractDesL( const CLiwMap* aMap, RBuf& aString,
- const TDesC8& aMapName );
-
- TInt ExtractUidL( const CLiwMap* aMap, TUid& aUid,
- const TDesC8& aMapName );
-
- };
-
-#endif // C_ACTION_HANDLER_HELPLAUNCHER_H
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahpapplauncher.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
-* 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 Component
- *
-*/
-
-
-#ifndef C_ACTION_HANDLER_APPLAUNCHER_H
-#define C_ACTION_HANDLER_APPLAUNCHER_H
-#include <apadef.h>
-#include "ahplugin.h"
-// FORWARD DECLARATION
-class CEikonEnv;
-class CLiwMap;
-class TLiwVariant;
-class TVwsViewId;
-
-/**
- * Application Launcher Plugin
- *
- *
- * @lib ?library
- * @since S60 ?S60_version *** for example, S60 v3.0
- */
-class CAHAppLauncher : public CAHPlugin
- {
-
-public:
-
- /**
- * Two phase contruction
- */
- static CAHAppLauncher* NewL();
-
- /**
- * Two phase contruction
- */
- static CAHAppLauncher* NewLC();
-
- /**
- * Destructor
- */
- ~CAHAppLauncher();
-
- /**
- * Executes provided action
- *
- * @return status code
- */
- TInt ExecuteActionL( const CLiwMap* aMap );
-private:
-
- TInt ExecuteTypeLaunchL( const CLiwMap* aMap );
- TInt ExecuteCommmandLineL( const CLiwMap* aMap );
- TInt ExecuteApaMessageL( const CLiwMap* aMap );
- TInt ExecuteActivateViewL( const CLiwMap* aMap );
- TInt StartDocumentL( const CLiwMap* aMap );
- TInt StartAppL( const CLiwMap* aMap );
-
- TInt ExtractDesL( const CLiwMap* aMap, RBuf& aString,
- const TDesC8& aMapName );
-
- TInt ExtractDes8L( const CLiwMap* aMap, RBuf8& aString,
- const TDesC8& aMapName );
-
- TInt ExtractUidL( const CLiwMap* aMap, TUid& aUid,
- const TDesC8& aMapName );
-
- TInt ExtractViewIdL( const CLiwMap* aMap, TVwsViewId& aViewId );
-
- TApaCommand GetCommandL( const CLiwMap* aMap );
-
- /**
- * 2nd phase contructor
- */
- void ConstructL();
-
-private:
- //data
-
- /**
- * A static CEikonEnv
- */
- CEikonEnv* iEnv;
- };
-
-#endif // C_ACTION_HANDLER_APPLAUNCHER_H
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahtelkeyhandler.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* 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 Component
- *
-*/
-
-
-#ifndef C_ACTIVE_SPACE_TELKEYHANDLER_H
-#define C_ACTIVE_SPACE_TELKEYHANDLER_H
-
-#include <e32base.h>
-#include "ahplugin.h"
-// FORWARD DECLARATIONS
-class CAiwServiceHandler;
-
-/**
- * ActiveSpace Telephony Key Handler Plugin
- *
- * @lib ?library
- * @since S60 ?S60_version *** for example, S60 v3.0
- */
-class CAHTelKeyHandler : public CAHPlugin
- {
-
-public:
-
- static CAHTelKeyHandler* NewL();
-
- static CAHTelKeyHandler* NewLC();
-
- ~CAHTelKeyHandler();
-
- /**
- * Executes provided action
- *
- * @return status code
- */
- TInt ExecuteActionL( const CLiwMap* aMap );
-
-private:
-
- void ConstructL();
-
-private:
-
- CAiwServiceHandler* iServiceHandler;
-
- };
-
-#endif // C_ACTIVE_SPACE_TELKEYHANDLER_H
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/Proxy.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Action Handler Plugins' Implementation Proxy
- *
-*/
-
-
-#include <e32std.h>
-#include <ecom/implementationproxy.h>
-#include "ahpapplauncher.h"
-#include "ahtelkeyhandler.h"
-#include "ahhelplauncher.h"
-
-// Map the interface UIDs to implementation factory functions
-const TImplementationProxy ImplementationTable[] =
- {
- IMPLEMENTATION_PROXY_ENTRY( 0x10282E5F, CAHAppLauncher::NewL ),
- IMPLEMENTATION_PROXY_ENTRY( 0x10282E61, CAHTelKeyHandler::NewL ),
- IMPLEMENTATION_PROXY_ENTRY( 0x2001B285, CAHHelpLauncher::NewL ),
-};
-
-// Exported proxy for instantiation method resolution
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
- TInt& aTableCount )
- {
- aTableCount =
- sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
-
- return ImplementationTable;
- }
-
-// end of file
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahhelplauncher.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/*
-* 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: App for Action handler
- *
-*/
-
-
-#include <eikenv.h>
-#include <hlplch.h> // help launcher
-#include <liwvariant.h>
-
-#include "ahproperties.hrh"
-#include "ahhelplauncher.h"
-
-// ----------------------------------------------------------------------------
-// Symbian 2nd phase constructor can leave.
-// ----------------------------------------------------------------------------
-//
-void CAHHelpLauncher::ConstructL()
- {
- }
-
-// ----------------------------------------------------------------------------
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CAHHelpLauncher* CAHHelpLauncher::NewL()
- {
- CAHHelpLauncher* self = CAHHelpLauncher::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ----------------------------------------------------------------------------
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CAHHelpLauncher* CAHHelpLauncher::NewLC()
- {
- CAHHelpLauncher* self = new( ELeave ) CAHHelpLauncher;
- CleanupStack::PushL( self );
- self->ConstructL( );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// destructor
-// ---------------------------------------------------------------------------
-CAHHelpLauncher::~CAHHelpLauncher()
- {
-
- }
-
-TInt CAHHelpLauncher::ExecuteActionL( const CLiwMap* aMap )
- {
- TInt errCode(KErrArgument);
- TUid appUid= TUid::Null( );
-
- RBuf helpString;
- CleanupClosePushL( helpString );
-
- if ( !ExtractUidL( aMap, appUid, KHelpUid )
- && !ExtractDesL( aMap, helpString, KHelpTopic ) )
- {
- CArrayFixFlat<TCoeHelpContext>* array =
- new (ELeave) CArrayFixFlat<TCoeHelpContext>(1);
- CleanupStack::PushL( array );
- array->AppendL( TCoeHelpContext( appUid, helpString ) );
- CleanupStack::Pop( array );
- HlpLauncher::LaunchHelpApplicationL( CCoeEnv::Static()->WsSession( ), array );
- errCode = KErrNone;
- }
- CleanupStack::PopAndDestroy( &helpString );
-
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CAHHelpLauncher::ExtractDesL( const CLiwMap* aMap,
- RBuf& aString, const TDesC8& aMapName )
- {
- TInt errCode(KErrNotFound);
- TLiwVariant variant;
- variant.PushL( );
- TPtrC tempString( KNullDesC );
- if ( aMap->FindL( aMapName, variant ) )
- {
- variant.Get( tempString );
- aString.ReAllocL( tempString.Length( ) );
- aString.Append( tempString );
- errCode = KErrNone;
- }
- CleanupStack::PopAndDestroy( &variant );
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CAHHelpLauncher::ExtractUidL( const CLiwMap* aMap, TUid& aUid,
- const TDesC8& aMapName )
- {
- TInt errCode(KErrNotFound);
- TInt32 temp( 0);
- TLiwVariant variant;
- variant.PushL( );
- if ( aMap->FindL( aMapName, variant ) )
- {
- variant.Get( temp );
- aUid = TUid::Uid( temp );
- errCode = KErrNone;
- }
- CleanupStack::PopAndDestroy( &variant );
- return errCode;
- }
-// End of file
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahpapplauncher.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,436 +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: App for Action handler
- *
-*/
-
-
-#include <apgcli.h>
-#include <apacmdln.h>
-#include <apgtask.h>
-#include <vwsdef.h>
-#include <eikenv.h>
-#include <eikappui.h>
-#include <liwvariant.h>
-
-#include "ahproperties.hrh"
-#include "ahpapplauncher.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-// ----------------------------------------------------------------------------
-// Symbian 2nd phase constructor can leave.
-// ----------------------------------------------------------------------------
-//
-void CAHAppLauncher::ConstructL()
- {
- iEnv = CEikonEnv::Static( );
- }
-
-// ----------------------------------------------------------------------------
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CAHAppLauncher* CAHAppLauncher::NewL()
- {
- CAHAppLauncher* self = CAHAppLauncher::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ----------------------------------------------------------------------------
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CAHAppLauncher* CAHAppLauncher::NewLC()
- {
- CAHAppLauncher* self = new( ELeave ) CAHAppLauncher;
- CleanupStack::PushL( self );
- self->ConstructL( );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// destructor
-// ---------------------------------------------------------------------------
-CAHAppLauncher::~CAHAppLauncher()
- {
- }
-
-// ---------------------------------------------------------------------------
-// Executes provided action
-// ---------------------------------------------------------------------------
-//
-TInt CAHAppLauncher::ExecuteTypeLaunchL( const CLiwMap* aMap )
- {
- TInt errCode(KErrArgument);
- RBuf launchMethod;
- CleanupClosePushL( launchMethod );
-
- if ( !ExtractDesL( aMap, launchMethod, KLaunchMethod ) )
- {
- if ( !launchMethod.CompareF( KLaunchMethodValueCmdLine ) )
- {
- errCode = ExecuteCommmandLineL( aMap );
- }
- else if ( !launchMethod.CompareF( KLaunchMethodValueMessageWithDoc )
- || !launchMethod.CompareF( KLaunchMethodValueMessageWithTail ) )
- {
- errCode = ExecuteApaMessageL( aMap );
- }
- }
-
- CleanupStack::PopAndDestroy( &launchMethod );
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-// Executes provided command line action
-// ---------------------------------------------------------------------------
-//
-TInt CAHAppLauncher::ExecuteCommmandLineL( const CLiwMap* aMap )
- {
- TInt errCode(KErrArgument);
- TUid appUid= TUid::Null( );
-
- if ( !ExtractUidL( aMap, appUid, KApplicationUid ) )
- {
- RApaLsSession appSession;
- CleanupClosePushL( appSession );
- User::LeaveIfError( appSession.Connect( ) );
-
- CApaCommandLine* cmd = CApaCommandLine::NewLC( );
- cmd->SetCommandL( GetCommandL( aMap ) );
- RBuf documentNameValue;
- CleanupClosePushL( documentNameValue );
- if( !ExtractDesL( aMap, documentNameValue, KDocumentName ) )
- {
- cmd->SetDocumentNameL( documentNameValue );
- }
- TApaAppInfo appInfo;
- appSession.GetAppInfo( appInfo, appUid );
- cmd->SetExecutableNameL( appInfo.iFullName );
- errCode = appSession.StartApp( *cmd );
-
- CleanupStack::PopAndDestroy( &documentNameValue );
- CleanupStack::PopAndDestroy( cmd );
- CleanupStack::PopAndDestroy( &appSession );
- }
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-// Executes provided apa message action
-// ---------------------------------------------------------------------------
-//
-TInt CAHAppLauncher::ExecuteApaMessageL( const CLiwMap* aMap )
- {
- TInt errCode(KErrArgument);
- TUid appUid= TUid::Null( );
- if ( !ExtractUidL( aMap, appUid, KApplicationUid ) )
- {
- TApaTaskList taskList( iEnv->WsSession() );
- TApaTask task = taskList.FindApp( appUid );
- if ( task.Exists( ) )
- {
- TUid messageUid= TUid::Null( );
-
- RBuf8 additionalData;
- CleanupClosePushL( additionalData );
- if ( !ExtractUidL( aMap, messageUid, KMessageUid )
- && !ExtractDes8L( aMap, additionalData, KAdditionalData ) )
- {
- errCode = task.SendMessage( messageUid, additionalData );
- }
- CleanupStack::PopAndDestroy( &additionalData );
- }
- else
- { // app not yet running
- RBuf launchMethod;
- CleanupClosePushL( launchMethod );
- if ( !ExtractDesL( aMap, launchMethod, KLaunchMethod ) )
- {
- if ( !launchMethod.CompareF( KLaunchMethodValueMessageWithDoc ) )
- {
- errCode = StartDocumentL( aMap ) ;
- }
- else if ( !launchMethod.CompareF( KLaunchMethodValueMessageWithTail ) )
- {
- errCode = StartAppL( aMap );
- }
- }
- CleanupStack::PopAndDestroy( &launchMethod );
- }
- }
- return errCode;
-
- }
-// ---------------------------------------------------------------------------
-// Start document
-// ---------------------------------------------------------------------------
-//
-TInt CAHAppLauncher::StartDocumentL( const CLiwMap* aMap )
- {
- TInt errCode(KErrArgument);
- TUid appUid= TUid::Null( );
- RBuf documentNameValue;
- CleanupClosePushL( documentNameValue );
- if ( !ExtractUidL( aMap, appUid, KApplicationUid )
- && !ExtractDesL( aMap, documentNameValue, KDocumentName ) )
- {
- RApaLsSession appArcSession;
- CleanupClosePushL( appArcSession );
- User::LeaveIfError( appArcSession.Connect( ) );
- TThreadId id;
- errCode = appArcSession.StartDocument( documentNameValue, appUid, id );
- CleanupStack::PopAndDestroy( &appArcSession );
- }
- CleanupStack::PopAndDestroy( &documentNameValue );
- return errCode;
- }
-// ---------------------------------------------------------------------------
-// Starts application
-// ---------------------------------------------------------------------------
-//
-TInt CAHAppLauncher::StartAppL( const CLiwMap* aMap )
- {
- TInt errCode(KErrArgument);
- TUid appUid= TUid::Null( );
- RBuf8 additionalData;
- CleanupClosePushL( additionalData );
- if ( !ExtractUidL( aMap, appUid, KApplicationUid )
- && !ExtractDes8L( aMap, additionalData, KAdditionalData ) )
- {
- RApaLsSession appArcSession;
- CleanupClosePushL( appArcSession );
- User::LeaveIfError( appArcSession.Connect( ) );
- TApaAppInfo appInfo;
- errCode = appArcSession.GetAppInfo( appInfo, appUid );
- if ( errCode == KErrNone )
- {
- CApaCommandLine* cmdLine = CApaCommandLine::NewLC( );
- cmdLine->SetExecutableNameL( appInfo.iFullName );
- cmdLine->SetCommandL( EApaCommandRun );
- cmdLine->SetTailEndL( additionalData );
-
- errCode = appArcSession.StartApp( *cmdLine );
- CleanupStack::PopAndDestroy( cmdLine );
- }
- CleanupStack::PopAndDestroy( &appArcSession );
- }
- CleanupStack::PopAndDestroy( &additionalData );
- return errCode;
- }
-// ----------------------------------------------------------------------------
-// Executes provided action - activate view
-// ----------------------------------------------------------------------------
-//
-TInt CAHAppLauncher::ExecuteActivateViewL( const CLiwMap* aMap )
- {
- TInt errCode(KErrGeneral);
- if ( iEnv )
- {
- CCoeAppUi* appui = iEnv-> EikAppUi( );
- if ( appui )
- {
- TUid messageUid= TUid::Null( );
- TVwsViewId viewId;
- if ( !ExtractViewIdL( aMap, viewId ) )
- {
- RBuf8 additionalData;
- CleanupClosePushL( additionalData );
- if ( !ExtractUidL( aMap, messageUid, KMessageUid )
- && !ExtractDes8L( aMap, additionalData, KAdditionalData ) )
- {
- appui->ActivateViewL( viewId, messageUid, additionalData );
- }
- else
- {
- appui->ActivateViewL( viewId );
- }
- errCode = KErrNone;
- CleanupStack::PopAndDestroy( &additionalData );
- }
- }
- }
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-// Executes provided action
-// ---------------------------------------------------------------------------
-//
-TInt CAHAppLauncher::ExecuteActionL( const CLiwMap* aMap )
- {
- TInt errCode(KErrNotFound);
- RBuf type;
- CleanupClosePushL( type );
- errCode = ExtractDesL( aMap, type, KType );
-
- if ( errCode == KErrNone )
- {
- if ( !type.CompareF( KActionValueLaunchApplication ) )
- {
- errCode = ExecuteTypeLaunchL( aMap );
- }
- else if ( !type.CompareF( KActionValueViewActivation ) )
- {
- errCode = ExecuteActivateViewL( aMap );
- }
- }
- CleanupStack::PopAndDestroy( &type );
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CAHAppLauncher::ExtractDesL( const CLiwMap* aMap,
- RBuf& aString, const TDesC8& aMapName )
- {
- TInt errCode(KErrNotFound);
- TLiwVariant variant;
- variant.PushL( );
- TPtrC tempString( KNullDesC );
- if ( aMap->FindL( aMapName, variant ) )
- {
- if ( variant.Get( tempString ) )
- {
- aString.ReAllocL( tempString.Length( ) );
- aString.Append( tempString );
- errCode = KErrNone;
- }
- else
- {
- errCode = KErrCorrupt;
- }
- }
- CleanupStack::PopAndDestroy( &variant );
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CAHAppLauncher::ExtractDes8L( const CLiwMap* aMap,
- RBuf8& aString, const TDesC8& aMapName )
- {
- TInt errCode(KErrNotFound);
- TLiwVariant variant;
- variant.PushL( );
- TPtrC8 tempString( KNullDesC8 );
- if ( aMap->FindL( aMapName, variant ) )
- {
- if ( variant.Get( tempString ) )
- {
- aString.ReAllocL( tempString.Length( ) );
- aString.Append( tempString );
- errCode = KErrNone;
- }
- else
- {
- errCode = KErrCorrupt;
- }
- }
- CleanupStack::PopAndDestroy( &variant );
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CAHAppLauncher::ExtractUidL( const CLiwMap* aMap, TUid& aUid,
- const TDesC8& aMapName )
-
- {
- TInt errCode(KErrNotFound);
- TInt32 temp;
- TLiwVariant variant;
- variant.PushL( );
- if ( aMap->FindL( aMapName, variant ) )
- {
- if ( variant.Get( temp ) )
- {
- aUid = TUid::Uid( temp );
- errCode = KErrNone;
- }
- else
- {
- errCode = KErrCorrupt;
- }
- }
- CleanupStack::PopAndDestroy( &variant );
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CAHAppLauncher::ExtractViewIdL( const CLiwMap* aMap, TVwsViewId& aViewId )
-
- {
- TInt errCode(KErrNotFound);
- TLiwVariant variant;
- if ( aMap->FindL( KViewId, variant ) )
- {
- if ( variant.Get( aViewId.iViewUid.iUid ) )
- {
- variant.Reset( );
- if ( aMap->FindL( KViewAppUid, variant ) )
- {
- if ( variant.Get( aViewId.iAppUid.iUid ) )
- {
- variant.Reset( );
- errCode = KErrNone;
- }
- else
- {
- errCode = KErrCorrupt;
- }
- }
- }
- else
- {
- errCode = KErrCorrupt;
- }
- }
-
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TApaCommand CAHAppLauncher::GetCommandL( const CLiwMap* aMap )
- {
- TApaCommand command(EApaCommandOpen);
- RBuf appCommand;
- CleanupClosePushL( appCommand );
- if ( ExtractDesL( aMap, appCommand, KApaCommand ) == KErrNone )
- {
- if( appCommand.Compare( KApaCommandBackground ) == KErrNone )
- {
- command = EApaCommandBackground;
- }
- }
- CleanupStack::PopAndDestroy( &appCommand );
- return command;
- }
-
-// End of file
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahtelkeyhandler.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include <AiwServiceHandler.h> // AIW
-#include <aiwdialdata.h> //include\oem
-#include <liwvariant.h>
-
-#include "ahtelkeyhandler.h"
-#include "ahproperties.hrh"
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// 2nd phase constructor may leave
-// ---------------------------------------------------------------------------
-void CAHTelKeyHandler::ConstructL()
- {
- iServiceHandler = CAiwServiceHandler::NewL( );
- TAiwServiceCommands serviceCommand = KAiwCmdCall;
-
- //service command used as criteria item ID
- _LIT8( KStar, "*" );
- CAiwCriteriaItem* criteria = CAiwCriteriaItem::NewLC( serviceCommand,
- serviceCommand, KStar );
-
- RCriteriaArray interest;
- CleanupClosePushL( interest );
- // We are using a base service.
- TUid base( KNullUid);
- base.iUid = KAiwClassBase;
- criteria->SetServiceClass( base );
- User::LeaveIfError( interest.Append( criteria ) );
- iServiceHandler->AttachL( interest );
- CleanupStack::PopAndDestroy( &interest );
- CleanupStack::PopAndDestroy( criteria );
- }
-
-// ---------------------------------------------------------------------------
-// Two-phased constructor
-// ---------------------------------------------------------------------------
-CAHTelKeyHandler* CAHTelKeyHandler::NewL()
- {
- CAHTelKeyHandler* self = CAHTelKeyHandler::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// Two-phased constructor
-// ---------------------------------------------------------------------------
-CAHTelKeyHandler* CAHTelKeyHandler::NewLC()
- {
- CAHTelKeyHandler* self = new( ELeave ) CAHTelKeyHandler;
- CleanupStack::PushL( self );
- self->ConstructL( );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// destructor
-// ---------------------------------------------------------------------------
-CAHTelKeyHandler::~CAHTelKeyHandler()
- {
- delete iServiceHandler;
- }
-
-// ---------------------------------------------------------------------------
-// Executes provided action
-// ---------------------------------------------------------------------------
-//
-TInt CAHTelKeyHandler::ExecuteActionL( const CLiwMap* aMap )
- {
- TInt errCode(KErrArgument);
- TLiwVariant variantNumber;
- variantNumber.PushL( );
- if ( aMap->FindL( KNumber, variantNumber ) )
- {
- TPtrC number( KNullDesC );
- if ( variantNumber.Get( number ) )
- {
- CAiwDialData* dialData = CAiwDialData::NewLC( );
- dialData->SetCallType( CAiwDialData::EAIWVoice );
- dialData->SetPhoneNumberL( number );
- dialData->SetWindowGroup( AIWDialData::KAiwGoToIdle );
- // Attach the interest to the AIW framework.
-
- // Set parameters for the AIW call
- CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC( );
- CAiwGenericParamList& paramListOut =
- iServiceHandler->OutParamListL( );
-
- dialData->FillInParamListL( *paramList );
- iServiceHandler->ExecuteServiceCmdL( KAiwCmdCall, *paramList,
- paramListOut, 0, NULL );
- errCode = KErrNone;
- paramListOut.Reset( );
- CleanupStack::PopAndDestroy( paramList );
- CleanupStack::PopAndDestroy( dialData );
- }
- }
- CleanupStack::PopAndDestroy( &variantNumber );
- return errCode;
- }
-//End of file
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/data/actionhandlerservice.rss Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* Copyright (c) 8000 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Resource file
-*
-*/
-
-
-#include <ecom/registryinfov2.rh>
-#include <liwcommon.hrh>
-
-RESOURCE REGISTRY_INFO theInfo
- {
- resource_format_version = RESOURCE_FORMAT_VERSION_2;
- dll_uid = 0x2000E538;
- interfaces =
- {
- INTERFACE_INFO
- {
- // Base service class
- interface_uid = KLiwClassBase;
- implementations =
- {
- IMPLEMENTATION_INFO
- {
- implementation_uid = 0x2000E539;
- version_no = 1;
- display_name = "Action Handler Service Provider";
- default_data = "Service.ActionHandler";
- opaque_data = "IDataAction";
- }
- };
- }
- };
- }
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/group/actionhandlerservice.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* 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: Project definition file for Action Handler Service
-*
-*/
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET actionhandlerservice.dll
-TARGETTYPE PLUGIN
-UID 0x10009D8D 0x2000E538
-
-CAPABILITY CAP_ECOM_PLUGIN
-VENDORID VID_DEFAULT
-
-SOURCEPATH ../src
-SOURCE actionhandlerservice.cpp
-SOURCE actionhandlerinterface.cpp
-
-SOURCEPATH ../data
-START RESOURCE actionhandlerservice.rss
-TARGET actionhandlerservice.rsc
-TARGETPATH /resource/plugins
-END // RESOURCE
-
-USERINCLUDE .
-USERINCLUDE ../inc
-USERINCLUDE ../../inc
-USERINCLUDE ../../../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY liwservicehandler.lib
-LIBRARY estor.lib
-LIBRARY ECom.lib
-LIBRARY pluginvalidator.lib
\ No newline at end of file
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* 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: Build information file for project ?myapp
-*
-*/
-
-
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
-actionhandlerservice.mmp
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/inc/actionhandlerinterface.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#ifndef C_ACTIONHANDLERINTERFACE_H
-#define C_ACTIONHANDLERINTERFACE_H
-
-#include <liwcommon.h>
-
-class CPluginValidator;
-class CLiwMap;
-
-/**
- * Class implements Action Handler Service Interface
- *
- * Action Handler itself is a component which enables
- * to execute different kind of actions.
- *
- * @since S60 v3.2
- */
-class CActionHandlerInterface : public CBase, public MLiwInterface
- {
-public:
-
- static CActionHandlerInterface* NewL();
-
- static CActionHandlerInterface* NewLC();
-
- ~CActionHandlerInterface();
-
- // from base class MLiwInterface
-
- /**
- * The consumer application should call this method to execute a service
- * command directly on the interface.
- *
- * @param aCmdName the name of the service command to invoke
- * @param aInParamList the input parameter list, can be empty list
- * @param [in,out] aOutParamList the output parameter list, can be empty.
- * @param aCmdOptions Options for the command
- * @param aCallback callback to be registered by consumer application
- *
- */
- void ExecuteCmdL( const TDesC8& aCmdName,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions,
- MLiwNotifyCallback* aCallback );
-
- /**
- * The consumer application should call this method if there
- * are no more service commands to be executed on the interface.
- *
- */
- virtual void Close();
-
-private:
-
- CActionHandlerInterface();
-
- void ConstructL();
-
- /**
- * Get uid of the required plugin from aInParamList
- *
- * @since S60 v3.2
- * @param aInParamList param received from service client
- * @param aUid source for the extracted uid of the plugin
- * @return errCode
- */
- TInt ExtractUid( const CLiwGenericParamList& aInParamList, TUid& aUid );
-
- /**
- * Get map from aInParamList
- *
- * @since S60 v3.2
- * @param aInParamList param received from service client
- * @param aMap source for the exctracted map
- * @return errCode
- */
- TInt ExtractMap( const CLiwGenericParamList& aInParamList, CLiwMap* aMap );
-
- TInt32 ErrCodeConversion( TInt code );
-
- void ExecuteActionL( const TUid aUid, const CLiwMap* aMap );
-
-private:
-
- // data
- CPluginValidator* iPluginManager;
-
- };
-
-#endif // C_ACTIONHANDLERINTERFACE_H
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/inc/actionhandlerservice.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#ifndef C_ACTIONHANDLERSERVICE_H
-#define C_ACTIONHANDLERSERVICE_H
-
-/**
- * Class implements Action Handler Service Provider
- *
- * Action Handler itself is a component which enables
- * to execute different kind of actions.
- *
- * @since S60 v3.2
- */
-class CActionHandlerService : public CLiwServiceIfBase
- {
-public:
-
- static CActionHandlerService* NewL();
-
- ~CActionHandlerService();
-
- // from base class CLiwServiceIfBase
-
- /**
- * From CLiwServiceIfBase.
- * Called by the LIW framework to initialise necessary information
- * from the Service Handler. This method is called when the consumer makes
- * the attach operation.
- *
- * @since S60 v3.2
- * @param aFrameworkCallback Framework provided callback
- * @param aInterest List of criteria items which invoked the provider.
- */
- void InitialiseL( MLiwNotifyCallback& aFrameworkCallback,
- const RCriteriaArray& aInterest );
-
- /**
- * Executes generic service commands included in criteria.
- *
- * @param aCmdId Command to be executed.
- * @param aInParamList Input parameters, can be an empty list.
- * @param aOutParamList Output parameters, can be an empty list.
- * @param aCmdOptions Options for the command
- * @param aCallback Callback for asynchronous command handling,
- * @leave KErrArgument Callback is missing when required.
- * @leave KErrNotSupported No provider supports service.
- */
- virtual void HandleServiceCmdL( const TInt& aCmdId,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions = 0,
- const MLiwNotifyCallback* aCallback = NULL );
-
-private:
-
- CActionHandlerService();
-
- TInt32 ErrCodeConversion( TInt code );
-
-private:
- // data
-
-
- };
-
-#endif // C_ACTIONHANDLERSERVICE_H
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/inc/serviceerrno.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Top level service provider error codes.
- * %created_by: smatasah %
- * %date_created: Wed Jan 27 16:21:04 2010 %
- *
-*/
-/**********************************************************************
- *
- * Header %name: serviceerrno.h %
- * Instance: bh1sapi_1
- * Description: Top level service provider error codes.
- * %created_by: smatasah %
- * %date_created: Wed Jan 27 16:21:04 2010 %
- *
- **********************************************************************/
-#ifndef SERVICEERRNO_H
-#define SERVICEERRNO_H
-
-#define SERRBASE 1000
-
-enum SapiErrors
- {
-
- SErrNone ,
-
- SErrInvalidServiceArgument = SERRBASE,
- SErrUnknownArgumentName ,
- SErrBadArgumentType ,
- SErrMissingArgument ,
- SErrServiceNotSupported ,
- SErrServiceInUse ,
- SErrServiceNotReady ,
- SErrNoMemory ,
- SErrHardwareNotAvailable ,
- SErrServerBusy ,
- SErrEntryExists ,
- SErrAccessDenied ,
- SErrNotFound ,
- SErrUnknownFormat ,
- SErrGeneralError ,
- SErrCancelSuccess,
- SErrServiceTimedOut
-
- };
-
-#endif
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/src/actionhandlerinterface.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,245 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include "ahplugin.h"
-#include "cpluginvalidator.h"
-#include "actionhandlerinterface.h"
-#include "ahplugindefs.h"
-#include "serviceerrno.h"
-
-using namespace LIW;
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CActionHandlerInterface::CActionHandlerInterface()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CActionHandlerInterface::ConstructL()
- {
- iPluginManager = CPluginValidator::NewL(
- TUid::Uid( KAHPluginInterfaceUid ) );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CActionHandlerInterface* CActionHandlerInterface::NewL()
- {
- CActionHandlerInterface* self = CActionHandlerInterface::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CActionHandlerInterface* CActionHandlerInterface::NewLC()
- {
- CActionHandlerInterface* self = new( ELeave ) CActionHandlerInterface;
- CleanupStack::PushL( self );
- self->ConstructL( );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CActionHandlerInterface::~CActionHandlerInterface()
- {
- delete iPluginManager;
- }
-
-// ---------------------------------------------------------------------------
-// Executes the SAPI as per params
-// ---------------------------------------------------------------------------
-//
-void CActionHandlerInterface::ExecuteCmdL( const TDesC8& aCmdName,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions,
- MLiwNotifyCallback* aCallback )
- {
- TInt errCode(KErrNotSupported);
- aOutParamList.AppendL( TLiwGenericParam( EGenericParamError,
- TLiwVariant( ErrCodeConversion( KErrNone ) ) ) );
- // Check the command name;Cmd name should be Execute
- if ( !aCmdName.Compare( KExecute ) && !aCallback && !aCmdOptions )
- {
- TUid pluginUid= TUid::Null( );
- CLiwDefaultMap* map = CLiwDefaultMap::NewLC( );
- //extract command params
- if ( !ExtractUid( aInParamList, pluginUid ) &&!ExtractMap(
- aInParamList, map ) )
- {
- TRAP(errCode, ExecuteActionL( pluginUid, map ));
- }
- else
- {
- errCode = KErrNotSupported;
- }
- CleanupStack::PopAndDestroy( map );
- }
- if ( errCode != KErrNone )
- {
- aOutParamList.Reset( );
- aOutParamList.AppendL( TLiwGenericParam( EGenericParamError,
- TLiwVariant( ErrCodeConversion( errCode ) ) ) );
- }
- }
-
-// ---------------------------------------------------------------------------
-// Closes the interface
-// ---------------------------------------------------------------------------
-//
-void CActionHandlerInterface::Close()
- {
- delete this;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CActionHandlerInterface::ExtractUid(
- const CLiwGenericParamList& aInParamList, TUid& aUid )
-
- {
- TInt errCode(KErrArgument);
- const TLiwGenericParam* param= NULL;
- TInt pos( 0);
- param = aInParamList.FindFirst( pos, KPluginUid );
- if ( param && pos !=KErrNotFound )
- {
- //get plugin uid
- if ( param->Value().Get( aUid ) )
- {
- errCode = KErrNone;
- }
- else
- {
- TUint plugin( 0 );
- if ( param->Value().Get( plugin ) )
- {
- aUid = TUid::Uid( plugin );
- errCode = KErrNone;
- }
- }
- }
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-// Extract Map
-// ---------------------------------------------------------------------------
-//
-TInt CActionHandlerInterface::ExtractMap(
- const CLiwGenericParamList& aInParamList, CLiwMap* aMap )
- {
- TInt errCode(KErrArgument);
- const TLiwGenericParam* param= NULL;
- TInt pos( 0);
- param = aInParamList.FindFirst( pos, KMap );
- if ( param && pos !=KErrNotFound )
- {
- //get action type
- if ( param->Value().Get( *aMap ) )
- {
- errCode = KErrNone;
- }
- }
- return errCode;
- }
-
-// ---------------------------------------------------------------------------
-// ErrCode Conversion
-// ---------------------------------------------------------------------------
-//
-TInt32 CActionHandlerInterface::ErrCodeConversion( TInt code )
- {
- TInt32 err;
- switch ( code )
- {
- case KErrNone:
- err= SErrNone;
- break;
-
- case KErrNotFound:
- err= SErrNotFound;
- break;
-
- case KErrNoMemory:
- err = SErrNoMemory;
- break;
-
- case KErrInUse:
- err = SErrServiceInUse;
- break;
-
- case KErrNotSupported:
- err = SErrServiceNotSupported;
- break;
-
- case KErrBadName:
- err = SErrBadArgumentType;
- break;
-
- case KErrArgument:
- err = SErrInvalidServiceArgument;
- break;
-
- default:
- err = SErrGeneralError;
- break;
- }
-
- return err;
-
- }
-
-// ---------------------------------------------------------------------------
-// CActionHandlerInterface::ExecuteActionL
-// Gets required plugin and triggers action execution
-// ---------------------------------------------------------------------------
-//
-void CActionHandlerInterface::ExecuteActionL( const TUid aUid,
- const CLiwMap* aMap )
- {
- __ASSERT_DEBUG( aMap , User::Panic( _L("actionhandlerinterface"), 0 ) );
- CAHPlugin* pluginInstance =
- static_cast<CAHPlugin*>( iPluginManager->GetImplementation( aUid ) );
-
- if ( pluginInstance )
- {
- User::LeaveIfError( pluginInstance->ExecuteActionL( aMap ) );
- }
- else
- {
- User::Leave( KErrNotFound );
- }
- }
-
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/src/actionhandlerservice.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include <ecom/implementationproxy.h>
-#include <liwcommon.h>
-#include <liwserviceifbase.h>
-
-#include "ahplugindefs.h"
-#include "actionhandlerservice.h"
-#include "serviceerrno.h"
-
-#include "actionhandlerinterface.h"
-
-const TInt implUid( 0x2000E539);
-
-using namespace LIW;
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CActionHandlerService::CActionHandlerService()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CActionHandlerService* CActionHandlerService::NewL()
- {
- return new(ELeave) CActionHandlerService();
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CActionHandlerService::~CActionHandlerService()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CActionHandlerService::InitialiseL(
- MLiwNotifyCallback& /*aFrameworkCallback*/, const RCriteriaArray& /*aInterest*/)
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CActionHandlerService::HandleServiceCmdL( const TInt& aCmdId,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions,
- const MLiwNotifyCallback* aCallback )
-
- {
- TInt errCode( KErrNotSupported );
- // Check the command name;Cmd name should be Execute
- if ( aCmdId == KLiwCmdAsStr && !aCallback && !aCmdOptions )
- {
- TInt pos = 0;
- TPtrC8 cmdName;
- const TLiwGenericParam* cmd= NULL;
- cmd = aInParamList.FindFirst( pos, KCommand );
- if ( cmd && pos != KErrNotFound )
- {
- cmdName.Set( cmd->Value().AsData( ) );
- if ( !cmdName.CompareF( KActionHandlerInterface ) )
- {
- //Create interface pointer and return the output param
- CActionHandlerInterface* ifp =
- CActionHandlerInterface::NewLC( );
- aOutParamList.AppendL( TLiwGenericParam(
- KActionHandlerInterface, TLiwVariant( ifp ) ) );
- CleanupStack::Pop( ifp );
- errCode = KErrNone;
- }
- }
- else
- {
- errCode = KErrArgument;
- }
- }
- if ( errCode != KErrNone )
- {
- aOutParamList.AppendL( TLiwGenericParam( EGenericParamError,
- TLiwVariant( ErrCodeConversion( errCode ) ) ) );
- }
- }
-
-// ---------------------------------------------------------------------------
-// ErrCode Conversion
-// ---------------------------------------------------------------------------
-//
-TInt32 CActionHandlerService::ErrCodeConversion( TInt code )
- {
- TInt32 err;
- switch ( code )
- {
-
- case KErrNotFound:
- err= SErrNotFound;
- break;
-
- case KErrNoMemory:
- err = SErrNoMemory;
- break;
-
- case KErrNotSupported:
- err = SErrServiceNotSupported;
- break;
-
- case KErrArgument:
- err = SErrInvalidServiceArgument;
- break;
-
- default:
- err = SErrGeneralError;
- break;
- }
-
- return err;
-
- }
-
-// ---------------------------------------------------------
-// Map the interface UIDs to implementation factory functions
-// ---------------------------------------------------------
-//
-const TImplementationProxy ImplementationTable[] =
- {
- IMPLEMENTATION_PROXY_ENTRY( implUid,CActionHandlerService::NewL)
- };
-
-// ---------------------------------------------------------
-// Exported proxy for instantiation method resolution
-// ---------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
- {
- aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
- return ImplementationTable;
- }
--- a/homescreensrv_plat/sapi_actionhandler/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for project
-*
-*/
-
-#include <platform_paths.hrh>
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-../rom/actionhandler.iby CORE_MW_LAYER_IBY_EXPORT_PATH(actionhandler.iby)
-
-PRJ_MMPFILES
-#include "../actionhandlerplugins/group/bld.inf"
-#include "../actionhandlerservice/group/bld.inf"
-
-
-
--- a/homescreensrv_plat/sapi_actionhandler/inc/ahplugindefs.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* 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: Plugin Interface definistions / plugins uids
- *
-*/
-
-
-
-#ifndef C_ACTION_HANDLER_PLUGINDEFS_H
-#define C_ACTION_HANDLER_PLUGINDEFS_H
-
-#include "ahpluginuids.hrh"
-
-_LIT8( KActionHandlerInterface, "IDataAction" );
-_LIT8( KCommand, "cmd" );
-
-// UID of this interface
-const TInt32 KAHPluginInterface =
- {
- KAHPluginInterfaceUid
- }; //{0x10089990};
-
-//Supported Commands
-_LIT8( KExecute, "Execute" );
-
-// Input arguments
-_LIT8( KPluginUid, "plugin_id" );
-_LIT8( KMap, "data" );
-
-#endif //C_ACTION_HANDLER_PLUGINDEFS_H
-//End of file
--- a/homescreensrv_plat/sapi_actionhandler/inc/ahproperties.hrh Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* 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: Resource headers for Action handler
- *
-*/
-
-
-#ifndef T_ACTIONHANDLERPROPERTIES_HRH
-#define T_ACTIONHANDLERPROPERTIES_HRH
-
-const TUid KServerUid =
- {
- 0x20016B7B
- };
-
-/** Publisher activate*/
-enum TPublisherActivate
- {
- ECPDeActivate = 0,
- ECPActivate = 1
- };
-
-/** Possible types of an action */
-//map values
-_LIT( KActionValueLaunchApplication, "launch_application" );
-_LIT( KActionValueViewActivation, "view_activation" );
-_LIT( KActionValueSendSMS, "send_sms" );
-_LIT( KActionValueSendMMS, "send_mms" );
-_LIT( KActionValueSendEmail, "send_email" );
-_LIT( KLaunchMethodValueCmdLine, "cmd_line" );
-_LIT( KLaunchMethodValueMessageWithDoc, "message_with_doc" );
-_LIT( KLaunchMethodValueMessageWithTail, "message_with_tail" );
-/** The application is to open the document specified on the command line. */
-_LIT( KApaCommandOpen, "apa_command_open" );
-/** The application is to open the last used document and to run in the background. */
-_LIT( KApaCommandBackground, "apa_command_background" );
-
-//map kyes
-_LIT8( KApplicationUid, "application_uid" );
-_LIT8( KMessageUid, "message_uid" );
-_LIT8( KViewId, "view_id" );
-_LIT8( KApaCommand, "apa_command" );
-_LIT8( KViewAppUid, "view_app_uid" );
-_LIT8( KAdditionalData, "additional_data" );
-_LIT8( KDocumentName, "document_name" );
-
-_LIT8( KType, "type" );
-_LIT8( KLaunchMethod, "launch_method" );
-_LIT8( KAddress, "address" );
-_LIT8( KNumber, "number" );
-_LIT8( KAlias, "alias" );
-
-_LIT8( KHelpUid, "help_uid" );
-_LIT8( KHelpTopic, "help_topic" );
-
-_LIT8( KPublisher_Uid, "publisher_Uid" );
-_LIT8( KActivate, "Activate" );
-
-#endif // T_ACTIONHANDLERPROPERTIES_HRH
--- a/homescreensrv_plat/sapi_actionhandler/rom/actionhandler.iby Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* 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: IBY file for the Active space subsystem
-*
-*/
-
-
-#ifndef ACTIONHANDLER_IBY
-#define ACTIONHANDLER_IBY
-
-
-ECOM_PLUGIN(actionhandlerplugins.dll,actionhandlerplugins.rsc)
-ECOM_PLUGIN(actionhandlerservice.dll,actionhandlerservice.rsc)
-
-#endif // ACTIONHANDLER_IBY
-
-// End of File
\ No newline at end of file
--- a/homescreensrv_plat/sapi_actionhandler/sapi_actionhandler.metaxml Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" ?>
-<api id="33a9bf72af820d16ea8f861ad23dab15" dataversion="2.0">
-<name>sapi_actionhandler</name>
-<description>Action Handler Service API</description>
-<type>c++</type>
-<collection>contentpublishingsrv</collection>
-<libs></libs>
-<release category="platform" sinceversion="0"/>
-<attributes>
-<htmldocprovided>no</htmldocprovided>
-<adaptation>no</adaptation>
-</attributes>
-</api>
--- a/homescreensrv_plat/sapi_contentpublishing/data/cpclient.rss Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* 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: Resource file
-*
-*/
-
-
-#include <ecom/registryinfov2.rh>
-#include <liwcommon.hrh>
-
-RESOURCE REGISTRY_INFO theInfo
- {
- resource_format_version = RESOURCE_FORMAT_VERSION_2;
- dll_uid = 0x20016B7D;
- interfaces =
- {
- INTERFACE_INFO
- {
- // Base service class
- interface_uid = KLiwClassBase;
- implementations =
- {
- IMPLEMENTATION_INFO
- {
- implementation_uid = 0x20016B7E;
- version_no = 1;
- display_name = "Content Publisher Client Service Provider";
- default_data = "Service.ContentPublishing";
- opaque_data = "IDataSource";
- },
- IMPLEMENTATION_INFO
- {
- implementation_uid = 0x2001955F;
- version_no = 1;
- display_name = "Content Publisher Client Service Provider";
- default_data = "Service.ContentPublishing";
- opaque_data = "IContentPublishing";
- }
- };
- }
- };
- }
--- a/homescreensrv_plat/sapi_contentpublishing/group/bld.inf Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for Content Publisher Service
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-
-DEFAULT
-
-
-PRJ_EXPORTS
-../rom/sapi_contentpublishing.iby CORE_MW_LAYER_IBY_EXPORT_PATH(sapi_contentpublishing.iby)
-
-
-PRJ_MMPFILES
-cpclient.mmp
-
-// End of File
--- a/homescreensrv_plat/sapi_contentpublishing/group/cpclient.mmp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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
-*
-*/
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-
-TARGET cpclient.dll
-TARGETTYPE PLUGIN
-UID 0x10009D8D 0x20016B7D
-
-CAPABILITY CAP_ECOM_PLUGIN
-
-VENDORID VID_DEFAULT
-
-LANG SC
-
-SOURCEPATH ../src
-SOURCE cpclient.cpp
-SOURCE cpclientsession.cpp
-SOURCE cpclientactivenotifier.cpp
-SOURCE cdatasourceinterface.cpp
-SOURCE ccontentpublishinginterface.cpp
-SOURCE cpclientiterable.cpp
-SOURCE cpclientservice.cpp
-
-
-SOURCEPATH ../data
-START RESOURCE cpclient.rss
-TARGET cpclient.rsc
-TARGETPATH /resource/plugins
-END // RESOURCE
-
-USERINCLUDE .
-USERINCLUDE ../inc
-USERINCLUDE ../../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY estor.lib
-LIBRARY efsrv.lib
-LIBRARY liwservicehandler.lib
-LIBRARY cputils.lib
-
-#ifdef CONTENT_PUBLISHER_DEBUG
-LIBRARY cpdebug.lib
-#endif
-
-//end of file
-
-
--- a/homescreensrv_plat/sapi_contentpublishing/inc/ccontentpublishinginterface.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
-* 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: CPS Service Content Interface
- *
-*/
-
-
-#ifndef CCONTENTPUBLISHINGINTERFACE_H
-#define CCONTENTPUBLISHINGINTERFACE_H
-
-#include "cdatasourceinterface.h"
-
-/**
- * CPS Service Interface
- *
- * This class implements interface to CPS Service.
- *
- * @lib cpclient.dll
- * @since S60 v 5.0
- */
-class CContentPublishingInterface : public CDataSourceInterface
- {
-public:
-
- /**
- * Two-phased constructor.
- */
- static CContentPublishingInterface* NewL();
-
- /**
- * Two-phased constructor.
- */
- static CContentPublishingInterface* NewLC();
-
- /**
- * Desctructor.
- */
- ~CContentPublishingInterface();
-
-private:
-
- /**
- * C++ default constructor.
- */
- CContentPublishingInterface();
-
- /**
- * Perform the second phase construction of a CCPClientInterface object.
- */
- void ConstructL();
-
- /**
- * Proccess request issued by service client.
- *
- * @param aCmdName the name of the service command to invoke
- * @param aInParamList the input parameter list, can be empty list
- * @param [in,out] aOutParamList the output parameter list, can be empty.
- * @param aCmdOptions Options for the command
- * @param aCallback callback to be registered by consumer application
- *
- */
- virtual void ProcessCommandL( const TDesC8& aCmdName,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions,
- MLiwNotifyCallback* aCallback );
-
-private:
- // data
-
- };
-
-#endif // CCONTENTPUBLISHINGINTERFACE_H
--- a/homescreensrv_plat/sapi_contentpublishing/inc/cdatasourceinterface.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* 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: CPS Service Interface
- *
-*/
-
-
-#ifndef CDATASOURCEINTERFACE_H
-#define CDATASOURCEINTERFACE_H
-
-#include <liwcommon.h>
-
-class CCPClient;
-
-/**
- * CPS Service Interface
- *
- * This class implements interface to CPS Service.
- *
- * @lib cpclient.dll
- * @since S60 v 5.0
- */
-class CDataSourceInterface : public CBase, public MLiwInterface
- {
-public:
-
- /**
- * Two-phased constructor.
- */
- static CDataSourceInterface* NewL();
-
- /**
- * Two-phased constructor.
- */
- static CDataSourceInterface* NewLC();
-
- /**
- * Desctructor.
- */
- ~CDataSourceInterface();
-
- // from base class MLiwInterface
-
- /**
- * The consumer application should call this method to execute a service
- * command directly on the interface.
- *
- * @param aCmdName the name of the service command to invoke
- * @param aInParamList the input parameter list, can be empty list
- * @param [in,out] aOutParamList the output parameter list, can be empty.
- * @param aCmdOptions Options for the command
- * @param aCallback callback to be registered by consumer application
- *
- */
- void ExecuteCmdL( const TDesC8& aCmdName,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions,
- MLiwNotifyCallback* aCallback );
-
- /**
- * The consumer application should call this method if there
- * are no more service commands to be executed on the interface.
- *
- */
- virtual void Close();
-
-protected:
-
- /**
- * C++ default constructor.
- */
- CDataSourceInterface();
- /**
- * Perform the second phase construction of a CCPClientInterface object.
- */
- void ConstructL();
-
- /**
- * Proccess request issued by service client.
- *
- * @param aCmdName the name of the service command to invoke
- * @param aInParamList the input parameter list, can be empty list
- * @param [in,out] aOutParamList the output parameter list, can be empty.
- * @param aCmdOptions Options for the command
- * @param aCallback callback to be registered by consumer application
- *
- */
- virtual void ProcessCommandL( const TDesC8& aCmdName,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions,
- MLiwNotifyCallback* aCallback );
-
-public:
-
- /**
- * Converse error code
- * @param code the error
- * @return TInt32 the error code after converse
- */
- static TInt32 ErrCodeConversion( TInt code );
-
-protected:
- // data
-
- /**
- * Client to CPS Server. Containing active object
- * to handle asynchornous requests.
- * Own.
- */
- CCPClient* iCPClient;
- };
-
-#endif // CDATASOURCEINTERFACE_H
--- a/homescreensrv_plat/sapi_contentpublishing/inc/cpclient.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
-* Copyright (c) Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Content Publisher server client
- *
-*/
-
-
-#ifndef CPCLIENT_H
-#define CPCLIENT_H
-
-// INCLUDES
-#include "cpclientsession.h"
-
-// FORWARD DECLARATIONS
-#ifdef CONTENT_PUBLISHER_DEBUG
-class CCPDebug;
-#endif
-class CLiwGenericParamList;
-class CCPActiveNotifier;
-class CCPLiwMap;
-class MLiwNotifyCallback;
-class CLiwDefaultMap;
-
-// CLASS DECLARATION
-
-/**
- * Client-side interface to Content Publisher
- *
- * This class provides the client-side interface to the Content Publisher
- * server.
- *
- * @lib cpclient.dll
- * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier
- */
-class CCPClient : public CBase
- {
-public:
-
- /**
- * Two-phased constructor.
- */
- static CCPClient* NewL();
-
- /**
- * Two-phased constructor.
- */
- static CCPClient* NewLC();
-
- /**
- * Destructor.
- */
- ~CCPClient();
-
- /**
- * Send command to server to GetList of data from Content Publisher Database
- *
- * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier
- * @param aInParamList input parameter list (filter)
- * @param aOutParamList output parameter list (iterable of maps)
- */
- void GetListL( const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList );
-
- /**
- * Send command to server to Add data to Content Publisher Database
- *
- * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier
- * @param aInParamList input parameter list (data to add)
- * @param aOutParamList output parameter list (id of data or error code)
- */
- void AddL( const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList );
-
- /**
- * Send command to server to Delete data from Content Publisher Database
- *
- * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier
- * @param aInParamList input parameter list (filter)
- */
- void DeleteL( const CLiwGenericParamList& aInParamList );
-
- /**
- * Send command to server to Register observer for notifications
- *
- * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier
- * @param aObserver
- */
- void RegisterObserverL( MLiwNotifyCallback* aObserver,
- const CLiwGenericParamList& aInParamList, TInt32 aTransactionId );
-
- /**
- * Unregister observer if Transaction Id provided or all observers if not
- *
- * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier
- * @param aInParamList input parameter list (transactionId)
- */
- void UnregisterObserversL( const CLiwGenericParamList& aInParamList );
-
- /**
- * Send command to server to ExecuteAction
- *
- * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier
- * @param aInParamList input parameter list (filter)
- * @param aOutParamList output action_map
- */
- void ExecuteActionL( const CLiwGenericParamList& aInParamList );
-
- /**
- * Check second param from IDataSource interface
- *
- * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier
- * @param aInParamList input parameter list
- * @param aKey key with map
- */
- void CheckMapL( const CLiwGenericParamList& aInParamList,
- const TDesC8& aKey );
-
-private:
-
- /**
- * C++ default constructor.
- */
- CCPClient();
-
- /**
- * Perform the second phase construction of a CCPClient object.
- */
- void ConstructL();
-
-private:
- //data
-
- /**
- * Client-server session
- */
- RCPServerClient iServerClient;
- /**
- * Pointer to an active object
- * Own.
- */
- CCPActiveNotifier * iActiveNotifier;
-
-#ifdef CONTENT_PUBLISHER_DEBUG
- CCPDebug* iDebug;
-#endif
-
- };
-
-#endif // CPCLIENT_H
-
-// End of File
--- a/homescreensrv_plat/sapi_contentpublishing/inc/cpclientactivenotifier.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
-* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Active notifier class
- *
-*/
-
-
-#ifndef CPCLIENTACTIVENOTIFIER_H
-#define CPCLIENTACTIVENOTIFIER_H
-
-// INCLUDES
-#include <e32hashtab.h>
-#include "cpclientsession.h"
-
-class MLiwNotifyCallback;
-/**
- * Content publisher active notifier class
- *
- *
- * @lib cpclient.dll
- * @since S60 v 5.0
- */
-class CCPActiveNotifier : public CActive
- {
-public:
-
- /**
- * Two-phased constructor.
- *
- */
- static CCPActiveNotifier* NewL( RCPServerClient& aServerClient );
-
- /**
- * Desctructor.
- */
- ~CCPActiveNotifier();
-
- /**
- * Register observer
- *
- * @param aObserver Pointer for callback
- * @param aMap Map containing parameters
- * @param aTransactionId Integer transaction id
- */
- void RegisterL( MLiwNotifyCallback* aObserver, TInt32 aTransactionId,
- CCPLiwMap* aMap );
-
- /**
- * Unregister observer
- *
- * @since S60 v 5.0
- */
- void UnregisterL();
-
- /**
- * Unregister observer
- *
- * @since S60 v 5.0
- * @param aTransactionId Integer transaction id
- * @return returns ETrue if last observer was unregistered
- */
- TBool UnregisterL( TInt32 aTransactionId );
-
-
- /**
- * Unregister all observers
- * @since S60 v 5.0
- */
- void UnregisterAllL( );
-
-protected:
-
- /**
- * From CActive, RunL.
- * Handles the active object’s request completion event
- */
- void RunL();
-
- /**
- * From CActive, DoCancel.
- * Implements cancellation of an outstanding request.
- */
- void DoCancel();
-
- /**
- * From CActive, RunError.
- * Implements cancellation of an outstanding request.
- */
- TInt RunError( TInt aError );
-
-private:
-
- /**
- * C++ default constructor.
- */
- CCPActiveNotifier( RCPServerClient& aServerClient );
-
- /**
- * Perform the second phase construction of a CCPActiveNotifier object.
- */
- void ConstructL();
-
- /*
- * Notify all observers
- */
- void NotifyObserversL( TInt aErrorCode,
- CLiwGenericParamList* aEventParamList );
-
- /*
- * Register observer
- */
- void RegisterAgainL( );
-
-
-private:
-
- /**
- * Descriptor where server can write to when passing data
- * Own.
- */
- HBufC8 *iObserverBuf;
-
- /**
- * Size of the descriptor passed between server and client
- * Own.
- */
- TPckgBuf<TInt>* iSizeDes;
-
-
- /**
- * Client-server session
- * Not Own.
- */
- RCPServerClient iServerClient;
-
- /*
- * Array containing all observers
- * Own
- */
- RHashMap<TInt32, MLiwNotifyCallback*> iObservers;
-
- };
-
-#endif // CPCLIENTACTIVENOTIFIER_H
--- a/homescreensrv_plat/sapi_contentpublishing/inc/cpclientiterable.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
-* Copyright (c) 2006-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: CPS Client iterable
- *
-*/
-
-
-#ifndef C_CPSERVERITERABLE_H
-#define C_CPSERVERITERABLE_H
-
-#include <liwcommon.h>
-
-/**
- * Implemenation of abstract interface to iterate over data items
- * returned by CPS Server
- *
- * @see CLiwIterable
- *
- */
-class CCPClientIterable : public CLiwIterable
- {
-public:
-
- /**
- * Two-phase Constructor
- * @param aList list to be iterated
- * @return new CIterableCalList object
- */
- static CCPClientIterable* NewL( CLiwGenericParamList* aList );
-
- /**
- * Resets the iterator.
- *
- * @return void
- */
- void Reset();
-
- /**
- * Iterates over the collection entries to fetch the next data element.
- *
- * @param aValue contains the next data element
- *
- * @return false if there are no more data elements to be fetched;
- * true otherwise
- */
- TBool NextL( TLiwVariant& aValue );
-
- /**
- * Destructor.
- */
- ~CCPClientIterable();
-
-private:
-
- /**
- * C++ default constructor.
- */
- CCPClientIterable( CLiwGenericParamList* aList );
-
- /**
- * Exctracts maps stored inside aMap as binaries and
- * inserts them as CLiwDefaultMap
- *
- * @param aMap Source and target of the operation
- */
- void ExctractBinariesL( CLiwDefaultMap& aMap );
-
-private:
-
- /**
- * CLiwGenericParamList class pointer
- * Own.
- */
- CLiwGenericParamList* iList;
-
- /**
- * Position on iList
- * Own.
- */
- TInt iPos;
-
- };
-
-#endif // C_CPSERVERITERABLE_H
-// end of file
--- a/homescreensrv_plat/sapi_contentpublishing/inc/cpclientservice.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
-* 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: CPS Client Service
- *
-*/
-
-
-#ifndef CPCLIENTSERVICE_H
-#define CPCLIENTSERVICE_H
-
-/**
- * CPS Service Provider
- *
- * This class implements new LIW Service Provider.
- *
- * @lib cpclient.dll
- * @since S60 v 5.0
- */
-class CCPClientService : public CLiwServiceIfBase
- {
-public:
-
- /**
- * Two-phase Constructor
- */
- static CCPClientService* NewL();
-
- /**
- * Destructor.
- */
- ~CCPClientService();
-
- // from base class CLiwServiceIfBase
-
- /**
- * From CLiwServiceIfBase.
- * Called by the LIW framework to initialise necessary information
- * from the Service Handler. This method is called when the consumer makes
- * the attach operation.
- *
- * @since S60 v3.2
- * @param aFrameworkCallback Framework provided callback
- * @param aInterest List of criteria items which invoked the provider.
- */
- void InitialiseL( MLiwNotifyCallback& aFrameworkCallback,
- const RCriteriaArray& aInterest );
-
- /**
- * Executes generic service commands included in criteria.
- *
- * @param aCmdId Command to be executed.
- * @param aInParamList Input parameters, can be an empty list.
- * @param aOutParamList Output parameters, can be an empty list.
- * @param aCmdOptions Options for the command
- * @param aCallback Callback for asynchronous command handling,
- * @leave KErrArgument Callback is missing when required.
- * @leave KErrNotSupported No provider supports service.
- */
- virtual void HandleServiceCmdL( const TInt& aCmdId,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions = 0,
- const MLiwNotifyCallback* aCallback = NULL );
-
-private:
-
- /**
- * C++ default constructor.
- */
- CCPClientService();
-
-private:
- // data
-
-
- };
-
-#endif // CPCLIENTSERVICE_H
--- a/homescreensrv_plat/sapi_contentpublishing/inc/cpclientsession.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-/*
-* 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: Content Publisher server client
- *
-*/
-
-
-#ifndef CPCLIENTSESSION_H
-#define CPCLIENTSESSION_H
-
-// INCLUDES
-
-#include <e32base.h>
-
-// FORWARD DECLARATIONS
-class CLiwGenericParamList;
-class CCPActive;
-class CCPLiwMap;
-
-// CLASS DECLARATION
-/**
- * Client-side interface to CPS Server
- *
- * This class provides the client-side interface to the active data server session,
- * it just passes requests to the server.
- *
- */
-class RCPServerClient : public RSessionBase
- {
-public:
-
- /**
- * Construct the object.
- */
- RCPServerClient();
-
- /**
- * Connects to the server and create a session.
- * When the server is not running, the function starts the server.
- * @return error code
- */
- TInt Connect();
-
- /**
- * Pass Add request to the server
- *
- * @since S60 v 5.0
- * @param aInParamList const reference to the input list
- * @param aOutParamList reference to the output list
- */
- void AddL( const CCPLiwMap& aMap, CLiwGenericParamList& aOutParamList );
-
- /**
- * Pass GetList request to the server
- *
- * @since S60 v 5.0
- * @param aInParamList const reference to the input list
- * @param aOutParamList reference to the output list
- */
- void GetListL( const CCPLiwMap& aMap,
- CLiwGenericParamList& aOutParamList );
-
- /**
- * Pass Delete request to the server
- *
- * @since S60 v 5.0
- * @param aInParamList const reference to the input list
- */
- void DeleteL( const CCPLiwMap& aMapt );
-
- /**
- * Pass RegisterObserver request to the server
- *
- * @since S60 v 5.0
- * @param aStatus ?
- * @param aBuf ?
- * @param aSize ?
- * @return error code
- */
- void RegisterObserverL( TRequestStatus& aStatus, TIpcArgs& aArgs );
-
- /**
- * Pass AddObserver request to the server
- *
- * @since S60 v 5.0
- * @return error code
- */
- void AddObserver( TIpcArgs& aArgs );
-
- /**
- * Pass RemoveObserver request to the server
- *
- * @since S60 v 5.0
- * @return error code
- */
- void RemoveObserver( TIpcArgs& aArgs );
-
- /**
- * Pass ExecuteAction request to the server
- *
- * @since S60 v 5.0
- * @param aInParamList const reference to the input list
- */
- void ExecuteActionL( const CCPLiwMap& aMap );
-
- /**
- * Pass GetChangeInfoData request to server
- * @param aBuf reference to the input list
- * @return error code
- */
- TInt GetChangeInfoData( TDes8& aBuf );
- /**
- * Pass Activate request to the server
- *
- * @since S60 v 5.0
- * @param aInParamList const reference to the input list
- */
- void ActivateL( const CCPLiwMap& aMap, TUint aOptions = 0 );
-
- /**
- * Pass UnregisterObserver request to the server
- *
- * @since S60 v 5.0
- * @return error code
- */
- void UnregisterObserver();
-
- /**
- * Closes session
- *
- * @since S60 v 5.0
- */
- void Close();
-
- /**
- * Return version information
- */
- TVersion Version() const;
-
-private:
- //private methods
-
- };
-
-#endif // CPCLIENTSESSION_H
-
-// End of File
--- a/homescreensrv_plat/sapi_contentpublishing/inc/serviceerrno.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Top level service provider error codes.
-* %created_by: smatasah %
-* %date_created: Wed Jan 27 16:22:10 2010 %
-*
-*/
-/**********************************************************************
-*
-* Header %name: serviceerrno.h %
-* Instance: bh1sapi_1
-* Description: Top level service provider error codes.
-* %created_by: smatasah %
-* %date_created: Wed Jan 27 16:22:10 2010 %
-*
-**********************************************************************/
-#ifndef SERVICEERRNO_H
-#define SERVICEERRNO_H
-
-#define SERRBASE 1000
-
-enum SapiErrors
- {
-
- SErrNone ,
-
- SErrInvalidServiceArgument = SERRBASE,
- SErrUnknownArgumentName ,
- SErrBadArgumentType ,
- SErrMissingArgument ,
- SErrServiceNotSupported ,
- SErrServiceInUse ,
- SErrServiceNotReady ,
- SErrNoMemory ,
- SErrHardwareNotAvailable ,
- SErrServerBusy ,
- SErrEntryExists ,
- SErrAccessDenied ,
- SErrNotFound ,
- SErrUnknownFormat ,
- SErrGeneralError ,
- SErrCancelSuccess,
- SErrServiceTimedOut
-
- };
-
-#endif
--- a/homescreensrv_plat/sapi_contentpublishing/rom/sapi_contentpublishing.iby Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* 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: IBY file for the content publishing
-*
-*/
-
-
-#ifndef SAPI_CONTENTPUBLISHING_IBY
-#define SAPI_CONTENTPUBLISHING_IBY
-
-ECOM_PLUGIN(cpclient.dll,cpclientservice.rsc)
-
-#endif // SAPI_CONTENTPUBLISHING_IBY
-
-// End of File
\ No newline at end of file
--- a/homescreensrv_plat/sapi_contentpublishing/sapi_contentpublishing.metaxml Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" ?>
-<api id="ba9f2ff57712b2cd14804cb4e3611060" dataversion="2.0">
-<name>sapi_contentpublishing</name>
-<description>Content Publishing Service API</description>
-<type>c++</type>
-<collection>contentpublishingsrv</collection>
-<libs></libs>
-<release category="platform" sinceversion="0"/>
-<attributes>
-<htmldocprovided>no</htmldocprovided>
-<adaptation>no</adaptation>
-</attributes>
-</api>
--- a/homescreensrv_plat/sapi_contentpublishing/src/ccontentpublishinginterface.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include <mmf/common/mmfcontrollerpluginresolver.h>
-
-#include "ccontentpublishinginterface.h"
-#include "cpdebug.h"
-#include "cpglobals.h"
-#include "cpclient.h"
-#include "cpclientiterable.h"
-
-using namespace LIW;
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CContentPublishingInterface* CContentPublishingInterface::NewL()
- {
- CContentPublishingInterface* self = CContentPublishingInterface::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CContentPublishingInterface* CContentPublishingInterface::NewLC()
- {
- CContentPublishingInterface* self =
- new( ELeave ) CContentPublishingInterface;
- CleanupStack::PushL( self );
- self->ConstructL( );
- return self;
- }
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CContentPublishingInterface::~CContentPublishingInterface()
- {
- CP_DEBUG( _L8("CContentPublishingInterface::~CContentPublishingInterface") );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CContentPublishingInterface::CContentPublishingInterface()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentPublishingInterface::ConstructL()
- {
- CP_DEBUG( _L8("CContentPublishingInterface::ConstructL") );
- CDataSourceInterface::ConstructL();
- }
-
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CContentPublishingInterface::ProcessCommandL( const TDesC8& aCmdName,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions,
- MLiwNotifyCallback* aCallback )
- {
- CP_DEBUG( _L8("CContentPublishingInterface::ProcessCommandL") );
-
- if ( aCmdName.CompareF( KExecuteAction ) == 0 )
- {
- iCPClient->ExecuteActionL( aInParamList );
- }
- else
- {
- CDataSourceInterface::ProcessCommandL(aCmdName,
- aInParamList, aOutParamList, aCmdOptions, aCallback);
- }
- }
--- a/homescreensrv_plat/sapi_contentpublishing/src/cdatasourceinterface.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,238 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include <mmf/common/mmfcontrollerpluginresolver.h>
-
-#include "cdatasourceinterface.h"
-#include "cpdebug.h"
-#include "cpglobals.h"
-#include "cpclient.h"
-#include "serviceerrno.h"
-#include "cpclientiterable.h"
-
-using namespace LIW;
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CDataSourceInterface* CDataSourceInterface::NewL()
- {
- CDataSourceInterface* self = CDataSourceInterface::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CDataSourceInterface* CDataSourceInterface::NewLC()
- {
- CDataSourceInterface* self = new( ELeave ) CDataSourceInterface;
- CleanupStack::PushL( self );
- self->ConstructL( );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CDataSourceInterface::~CDataSourceInterface()
- {
- CP_DEBUG( _L8("CDataSourceInterface::~CDataSourceInterface") );
- delete iCPClient;
- }
-
-// ---------------------------------------------------------------------------
-// Executes the SAPI as per params
-// ---------------------------------------------------------------------------
-//
-void CDataSourceInterface::ExecuteCmdL( const TDesC8& aCmdName,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions,
- MLiwNotifyCallback* aCallback )
- {
- CP_DEBUG( _L8("CCPClientInterface::ExecuteCmdL") );
- TInt errCode(KErrNone);
- aOutParamList.AppendL( TLiwGenericParam( EGenericParamError,
- TLiwVariant( ErrCodeConversion( KErrNone ) ) ) );
- aOutParamList.AppendL( TLiwGenericParam( KErrorCode,
- TLiwVariant( ErrCodeConversion( KErrNone ) ) ) );
- // Check the command name
- TRAP( errCode , ProcessCommandL( aCmdName, aInParamList,
- aOutParamList,
- aCmdOptions,
- aCallback ) );
- if ( errCode != KErrNone )
- {
- aOutParamList.Reset( );
- aOutParamList.AppendL( TLiwGenericParam( EGenericParamError,
- TLiwVariant( ErrCodeConversion( errCode ) ) ) );
- aOutParamList.AppendL( TLiwGenericParam( KErrorCode,
- TLiwVariant( ErrCodeConversion( errCode ) ) ) );
- }
- }
-
-// ---------------------------------------------------------------------------
-// Closes the interface
-// ---------------------------------------------------------------------------
-//
-void CDataSourceInterface::Close()
- {
- delete this;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CDataSourceInterface::CDataSourceInterface()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CDataSourceInterface::ConstructL()
- {
- iCPClient = CCPClient::NewL( );
- CP_DEBUG( _L8("CDataSourceInterface::ConstructL") );
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CDataSourceInterface::ProcessCommandL( const TDesC8& aCmdName,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions,
- MLiwNotifyCallback* aCallback )
- {
- CP_DEBUG( _L8("CCPClientInterface::ProcessCommandL") );
- TInt32 transactionId( -1 );
- if ( aCmdName.CompareF( KGetList ) == 0 )
- {
- CLiwGenericParamList* list = CLiwGenericParamList::NewL( );
- CleanupStack::PushL( list );
- iCPClient->GetListL( aInParamList, *list );
- CCPClientIterable* iterable = CCPClientIterable::NewL( list );
- CleanupStack::Pop( list );
- iterable->PushL( );
- aOutParamList.AppendL( TLiwGenericParam( KResults,
- TLiwVariant( iterable ) ) );
- CleanupStack::PopAndDestroy( iterable );
- }
- else if ( aCmdName.CompareF( KAdd ) == 0 )
- {
- iCPClient->AddL( aInParamList, aOutParamList );
- }
- else if ( aCmdName.CompareF( KDelete ) == 0 )
- {
- iCPClient->DeleteL( aInParamList );
- }
- else if ( aCmdName.CompareF( KRequestNotification ) == 0 )
- {
- if ( !(aCmdOptions & KLiwOptCancel) )
- {
- if ( !aCallback )
- {
- User::Leave( KErrPathNotFound );
- }
- transactionId = aCallback->GetTransactionID();
- iCPClient->RegisterObserverL( aCallback, aInParamList, transactionId );
- }
- else
- {
- iCPClient->UnregisterObserversL( aInParamList );
- }
- }
- else if ( aCmdName.CompareF( KCmdCancel ) == 0 )
- {
- if ( aCmdOptions & KLiwOptCancel )
- {
- iCPClient->UnregisterObserversL( aInParamList );
- }
- }
- else
- {
- User::Leave( KErrNotSupported );
- }
- if ( transactionId != -1 )
- {
- aOutParamList.AppendL( TLiwGenericParam( KTransactionID,
- TLiwVariant( TInt32( transactionId ) ) ) );
- }
- }
-
-// ---------------------------------------------------------------------------
-// ErrCode Conversion
-// ---------------------------------------------------------------------------
-//
-TInt32 CDataSourceInterface::ErrCodeConversion( TInt code )
- {
- TInt32 err;
- switch ( code )
- {
- case KErrCancel:
- // Returning KErrNone incase of KErrCancel
- case KErrNone:
- err= SErrNone;
- break;
-
- case KErrNotFound:
- err= SErrNotFound;
- break;
-
- case KErrNoMemory:
- err = SErrNoMemory;
- break;
-
- case KErrInUse:
- err = SErrServiceInUse;
- break;
-
- case KErrNotSupported:
- err = SErrServiceNotSupported;
- break;
-
- case KErrBadName:
- err = SErrBadArgumentType;
- break;
-
- case KErrArgument:
- err = SErrInvalidServiceArgument;
- break;
-
- case KErrPermissionDenied:
- err = SErrAccessDenied;
- break;
-
- case KErrPathNotFound:
- err = SErrMissingArgument;
- break;
-
- default:
- err = SErrGeneralError;
- break;
- }
- return err;
- }
--- a/homescreensrv_plat/sapi_contentpublishing/src/cpclient.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,225 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include <liwgenericparam.h>
-
-#include "cpliwmap.h"
-#include "cpclient.h"
-#include "cpserverdef.h"
-#include "cpdebug.h"
-#include "cpclientactivenotifier.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CCPClient::CCPClient()
- {
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPClient::ConstructL()
- {
-
-#ifdef CONTENT_PUBLISHER_DEBUG
- if(!CCPDebug::Enable())
- {
- iDebug = CCPDebug::NewL( KCPDebugFileName );
- }
-#endif
- CP_DEBUG( _L8("CCPClient::ConstructL()") );
- User::LeaveIfError( iServerClient.Connect( ) );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CCPClient* CCPClient::NewL()
- {
- CCPClient* self = CCPClient::NewLC( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CCPClient* CCPClient::NewLC()
- {
- CCPClient* self = new( ELeave ) CCPClient;
- CleanupStack::PushL( self );
- self->ConstructL( );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CCPClient::~CCPClient()
- {
- CP_DEBUG( _L8("CCPClient::~CCPClient()") );
- delete iActiveNotifier;
- iServerClient.Close( );
-#ifdef CONTENT_PUBLISHER_DEBUG
- delete iDebug;
-#endif
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPClient::GetListL( const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList )
- {
- CP_DEBUG( _L8("CCPClient::GetListL()") );
- CheckMapL( aInParamList, KFilter );
- CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList );
- inMapForServer->PushL( );
- inMapForServer->IsValidForGetListL( );
- iServerClient.GetListL( *inMapForServer, aOutParamList );
- CleanupStack::PopAndDestroy( inMapForServer );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPClient::AddL( const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList )
- {
- CP_DEBUG( _L8("CCPClient::AddL()") );
- CheckMapL( aInParamList, KItem );
- CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ) ;
- inMapForServer->PushL( );
- inMapForServer->IsValidForAddL( );
- iServerClient.AddL( *inMapForServer, aOutParamList );
- CleanupStack::PopAndDestroy( inMapForServer );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPClient::DeleteL( const CLiwGenericParamList& aInParamList )
- {
- CP_DEBUG( _L8("CCPClient::DeleteL()") );
- CheckMapL( aInParamList, KData );
- CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList );
- inMapForServer->PushL( );
- inMapForServer->IsValidForDeleteL( );
- iServerClient.DeleteL( *inMapForServer );
- CleanupStack::PopAndDestroy( inMapForServer );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPClient::RegisterObserverL( MLiwNotifyCallback* aObserver,
- const CLiwGenericParamList& aInParamList, TInt32 aTransactionId )
- {
- CP_DEBUG( _L8("CCPClient::RegisterObserverL()") );
- CheckMapL( aInParamList, KFilter );
- CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList );
- inMapForServer->PushL( );
- inMapForServer->IsValidForNotificationL( );
- if ( !iActiveNotifier )
- {
- iActiveNotifier = CCPActiveNotifier::NewL( iServerClient );
- }
- iActiveNotifier->RegisterL( aObserver, aTransactionId, inMapForServer );
- CleanupStack::PopAndDestroy( inMapForServer );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPClient::UnregisterObserversL( const CLiwGenericParamList& aInParamList )
- {
- CP_DEBUG( _L8("CCPClient::UnregisterObservers()") );
- if ( !iActiveNotifier )
- {
- User::Leave( KErrNotFound );
- }
- TInt32 transactionId( -1 );
- const TLiwGenericParam* param = NULL;
- TInt pos( 0 );
- param = aInParamList.FindFirst( pos, KTransactionID );
- if( !param ||
- pos == KErrNotFound ||
- !param->Value().Get( transactionId ) ||
- transactionId < 0 )
- {
- iActiveNotifier->UnregisterAllL( );
- delete iActiveNotifier;
- iActiveNotifier = NULL;
- }
- else
- {
- if( iActiveNotifier->UnregisterL( transactionId ) )
- {
- //delete only if it was the last observer
- delete iActiveNotifier;
- iActiveNotifier = NULL;
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPClient::ExecuteActionL( const CLiwGenericParamList& aInParamList )
- {
- CP_DEBUG( _L8("CCPClient::RegisterObserverL()") );
- CheckMapL( aInParamList, KFilter );
- CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList );
- inMapForServer->PushL( );
- inMapForServer->IsValidForActionL( );
- iServerClient.ExecuteActionL( *inMapForServer );
- CleanupStack::PopAndDestroy( inMapForServer );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CCPClient::CheckMapL( const CLiwGenericParamList& aInParamList,
- const TDesC8& aKey )
- {
- const TLiwGenericParam* param = NULL;
- TInt pos( 0 );
- param = aInParamList.FindFirst( pos, aKey );
- if( pos !=KErrNotFound )
- {
- if( param->Value().TypeId( ) != LIW::EVariantTypeMap )
- {
- User::Leave( KErrBadName );
- }
- }
- }
--- a/homescreensrv_plat/sapi_contentpublishing/src/cpclientactivenotifier.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,342 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include <s32mem.h>
-#include <liwcommon.h>
-#include "cpclientactivenotifier.h"
-#include "ccontentmap.h"
-#include "cpdebug.h"
-#include "cpglobals.h"
-#include "cpserverdef.h"
-#include "cdatasourceinterface.h"
-
-using namespace LIW;
-
-// ======== MEMBER FUNCTIONS ========
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-CCPActiveNotifier* CCPActiveNotifier::NewL( RCPServerClient& aServerClient )
- {
- CCPActiveNotifier* self = new( ELeave )
- CCPActiveNotifier ( aServerClient );
- CleanupStack::PushL( self );
- self->ConstructL( );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// destructor
-// ---------------------------------------------------------------------------
-CCPActiveNotifier::~CCPActiveNotifier()
- {
- CP_DEBUG( _L8("CCPActiveNotifier::CCPActiveNotifier()" ) );
- Cancel( );
- iObservers.Close( );
- delete iObserverBuf;
- delete iSizeDes;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPActiveNotifier::RegisterL( MLiwNotifyCallback* aObserver,
- TInt32 aTransactionId, CCPLiwMap* aMap )
- {
- CP_DEBUG( _L8("CCPActiveNotifier::RegisterL()" ) );
- TIpcArgs args;
-
- if(iObservers.Find( aTransactionId ))
- {
- User::Leave( KErrInUse );
- }
-
- iObservers.InsertL( aTransactionId, aObserver );
- delete iObserverBuf;
- iObserverBuf = NULL;
- iObserverBuf = aMap->PackForServerLC( );
- CleanupStack::Pop( iObserverBuf );
- args.Set( KDescriptorPosition, &*iObserverBuf );
- args.Set( KTransactionPosition, aTransactionId );
-
- if ( !IsActive( ) )
- {
- iSizeDes = new (ELeave) TPckgBuf<TInt>( );
- args.Set( KReturnPosition, iSizeDes );
- iServerClient.RegisterObserverL( iStatus, args );
- SetActive( );
- }
- else
- {
- iServerClient.AddObserver( args );
- }
- }
-
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPActiveNotifier::UnregisterL()
- {
- CP_DEBUG( _L8("CCPActiveNotifier::UnregisterL()" ) );
- if ( !IsActive( ) )
- {
- User::Leave( KErrNotFound );
- }
- else
- {
- Cancel( );
- delete iSizeDes;
- iSizeDes = NULL;
- }
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-TBool CCPActiveNotifier::UnregisterL( TInt32 aTransactionId )
- {
- TBool last(EFalse);
- CP_DEBUG( _L8("CCPActiveNotifier::UnregisterL()" ) );
-
- MLiwNotifyCallback** observer = iObservers.Find(aTransactionId);
- if (observer)
- {
- CLiwGenericParamList* changeInfoList =
- CLiwGenericParamList::NewL( );
- CleanupStack::PushL( changeInfoList );
- CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL( );
- CleanupStack::PushL( inParamList );
-
- changeInfoList->AppendL(TLiwGenericParam(EGenericParamError,
- TLiwVariant(CDataSourceInterface::ErrCodeConversion(KErrNone))));
- changeInfoList->AppendL(TLiwGenericParam(KErrorCode, TLiwVariant(
- CDataSourceInterface::ErrCodeConversion(KErrNone))));
-
- (*observer)->HandleNotifyL( aTransactionId, KLiwEventCanceled, *changeInfoList,
- *inParamList );
-
- CleanupStack::PopAndDestroy( inParamList );
- CleanupStack::PopAndDestroy( changeInfoList );
- }
- else
- {
- User::Leave(KErrNotFound);
- }
-
- TIpcArgs args;
- args.Set( KTransactionPosition, aTransactionId );
- iServerClient.RemoveObserver( args );
-
- iObservers.Remove( aTransactionId );
-
- if( !iObservers.Count() )
- {
- UnregisterL();
- last = ETrue;
- }
- return last;
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPActiveNotifier::UnregisterAllL( )
- {
- CP_DEBUG( _L8("CCPActiveNotifier::UnregisterAllL()" ) );
- if (!iObservers.Count())
- {
- User::Leave( KErrNotFound );
- }
- THashMapIter<TInt32, MLiwNotifyCallback*> iter( iObservers );
- const TInt32* transaction = iter.NextKey();
- while( transaction )
- {
- UnregisterL( *transaction );
- transaction = iter.NextKey( );
- }
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPActiveNotifier::RunL()
- {
- CP_DEBUG( _L8("CCPActiveNotifier::RunL()" ) );
- CLiwGenericParamList* eventParamList = CLiwGenericParamList::NewL();
- CleanupStack::PushL(eventParamList);
-
- TInt error = iStatus.Int();
- if (KErrNone == error)
- {
- RBuf8 outbuf;
- outbuf.CleanupClosePushL();
- outbuf.CreateL((*iSizeDes)());
- error = iServerClient.GetChangeInfoData(outbuf);
- RDesReadStream stream(outbuf);
- CleanupClosePushL(stream);
- eventParamList->InternalizeL(stream);
- CleanupStack::PopAndDestroy(&stream);
- delete iSizeDes;
- iSizeDes = NULL;
- CleanupStack::PopAndDestroy(&outbuf);
- }
- RegisterAgainL();
-
- NotifyObserversL(error, eventParamList);
- CleanupStack::PopAndDestroy(eventParamList);
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPActiveNotifier::NotifyObserversL( TInt aErrorCode,
- CLiwGenericParamList* aEventParamList )
- {
- TInt event( KLiwEventInProgress );
- if ( aErrorCode == KErrCancel )
- {
- event = KLiwEventCanceled;
- }
- else if ( aErrorCode != KErrNone )
- {
- event = KLiwEventStopped;
- }
-
- for ( TInt i = 0; i<aEventParamList->Count(); i++ )
- {
- TLiwGenericParam param;
- param.PushL();
- TLiwVariant mapsV;
- mapsV.PushL();
- aEventParamList->AtL( i, param );
- mapsV = param.Value();
- CLiwDefaultList* listOfMatchingMaps = CLiwDefaultList::NewLC( );
- if (mapsV.Get( *listOfMatchingMaps ))
- {
- TLiwVariant transV;
- transV.PushL();
- TInt transIndex (listOfMatchingMaps->Count()-1);
- listOfMatchingMaps->AtL(transIndex ,transV);
- TInt32 transactionId ( KErrNotFound );
- transV.Get( transactionId );
- MLiwNotifyCallback** observer = iObservers.Find( transactionId );
-
- if ( observer )
- {
- listOfMatchingMaps->Remove( transIndex );
- CLiwGenericParamList* changeInfoList =
- CLiwGenericParamList::NewL( );
- CleanupStack::PushL( changeInfoList );
- CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL( );
- CleanupStack::PushL( inParamList );
-
- changeInfoList->AppendL( TLiwGenericParam( KChangeInfo,
- TLiwVariant( listOfMatchingMaps ) ) );
-
- changeInfoList->AppendL( TLiwGenericParam( EGenericParamError,
- TLiwVariant( CDataSourceInterface::ErrCodeConversion( aErrorCode ) ) ) );
- changeInfoList->AppendL( TLiwGenericParam( KErrorCode,
- TLiwVariant( CDataSourceInterface::ErrCodeConversion( aErrorCode ) ) ) );
- (*observer)->HandleNotifyL( transactionId, event, *changeInfoList,
- *inParamList );
-
- CleanupStack::PopAndDestroy( inParamList );
- CleanupStack::PopAndDestroy( changeInfoList );
- }//if
-
- CleanupStack::PopAndDestroy( &transV );
- }//if
- CleanupStack::PopAndDestroy( listOfMatchingMaps );
- CleanupStack::PopAndDestroy( &mapsV );
- CleanupStack::PopAndDestroy( ¶m );
- }//for
- }
-
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPActiveNotifier::DoCancel()
- {
- CP_DEBUG( _L8("CCPActiveNotifier::DoCancel()" ) );
- iServerClient.UnregisterObserver( );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-TInt CCPActiveNotifier::RunError( TInt /*aError*/)
- {
- TRAP_IGNORE( RegisterAgainL( ) );
- return KErrNone;
- }
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-CCPActiveNotifier::CCPActiveNotifier( RCPServerClient& aServerClient ) :
- CActive(EPriorityStandard)
- {
- iServerClient = aServerClient;
- CActiveScheduler::Add( this );
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPActiveNotifier::ConstructL()
- {
-
- }
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void CCPActiveNotifier::RegisterAgainL()
- {
- CP_DEBUG( _L8("CCPActiveNotifier::RegisterAgainL()" ) );
-
- if (!IsActive())
- {
- TIpcArgs args;
- args.Set(KTransactionPosition, KErrAlreadyExists);
- if (iSizeDes)
- {
- delete iSizeDes;
- iSizeDes = NULL;
- }
- iSizeDes = new (ELeave) TPckgBuf<TInt> ();
- args.Set(KReturnPosition, iSizeDes);
- iServerClient.RegisterObserverL(iStatus, args);
- SetActive();
- }
- }
--- a/homescreensrv_plat/sapi_contentpublishing/src/cpclientiterable.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-#include <s32mem.h>
-
-#include "cpclientiterable.h"
-#include "cpglobals.h"
-#include "cpdebug.h"
-
-using namespace LIW;
-
-// ---------------------------------------------------------------------------
-// Two-Phase constructor
-// ---------------------------------------------------------------------------
-//
-CCPClientIterable* CCPClientIterable::NewL( CLiwGenericParamList* aList )
- {
- return new(ELeave) CCPClientIterable( aList );
- }
-
-// ---------------------------------------------------------------------------
-// Constructor
-// ---------------------------------------------------------------------------
-//
-CCPClientIterable::CCPClientIterable( CLiwGenericParamList* aList ) :
- iList(aList)
- {
- }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-CCPClientIterable::~CCPClientIterable()
- {
- delete iList;
- }
-
-// ---------------------------------------------------------------------------
-// Reset the list
-// ---------------------------------------------------------------------------
-//
-void CCPClientIterable::Reset()
- {
- iPos = 0;
- }
-
-// ---------------------------------------------------------------------------
-// Gets next element in list
-// ---------------------------------------------------------------------------
-//
-TBool CCPClientIterable::NextL( TLiwVariant& aNext )
- {
- CP_DEBUG( _L8("CCPClientIterable::NextL()") );
- TBool retValue = EFalse;
- const TLiwGenericParam* param= NULL;
- param = iList->FindFirst( iPos, KListMap, EVariantTypeMap );
-
- if ( param && iPos !=KErrNotFound )
- {
- CLiwDefaultMap* map = CLiwDefaultMap::NewLC( );
- //get map
- if ( param->Value().Get( *map ) )
- {
- ExctractBinariesL( *map );
- aNext.SetL( map );
- retValue = ETrue;
- }
- CleanupStack::PopAndDestroy( map );
- iPos++;
- }
- return retValue;
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPClientIterable::ExctractBinariesL( CLiwDefaultMap& aMap )
- {
- CP_DEBUG( _L8("CCPClientIterable::ExctractBinariesL()") );
- TLiwVariant buffer;
- buffer.PushL( );
- if ( aMap.FindL( KDataMap, buffer ) )
- {
- TPtrC8 packedData( KNullDesC8 );
- if ( buffer.Get( packedData ) )
- {
- RDesReadStream str(packedData);
- CleanupClosePushL( str );
- CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC( str );
- aMap.Remove( KDataMap );
- aMap.InsertL( KDataMap, datamap );
- CleanupStack::PopAndDestroy( datamap );
- CleanupStack::PopAndDestroy( &str );
- }
- }
- if ( aMap.FindL( KActionMap, buffer ) )
- {
- TPtrC8 packedAction( KNullDesC8 );
- if ( buffer.Get( packedAction ) )
- {
- RDesReadStream str(packedAction);
- CleanupClosePushL( str );
- CLiwDefaultMap* actionmap = CLiwDefaultMap::NewLC( str );
- aMap.Remove( KActionMap );
- aMap.InsertL( KActionMap, actionmap );
- CleanupStack::PopAndDestroy( actionmap );
- CleanupStack::PopAndDestroy( &str );
- }
- }
- CleanupStack::PopAndDestroy( &buffer );
- }
--- a/homescreensrv_plat/sapi_contentpublishing/src/cpclientservice.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include <ecom/implementationproxy.h>
-#include <liwcommon.h>
-#include <liwserviceifbase.h>
-
-#include "cpclientservice.h"
-#include "cpdebug.h"
-#include "cpglobals.h"
-#include "cdatasourceinterface.h"
-#include "ccontentpublishinginterface.h"
-
-const TInt implUid( 0x20016B7E );
-const TInt implContentUid( 0x2001955F );
-
-using namespace LIW;
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPClientService::CCPClientService()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPClientService* CCPClientService::NewL()
- {
- return new(ELeave) CCPClientService();
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCPClientService::~CCPClientService()
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPClientService::InitialiseL(
- MLiwNotifyCallback& /*aFrameworkCallback*/, const RCriteriaArray& /*aInterest*/)
- {
-
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCPClientService::HandleServiceCmdL( const TInt& aCmdId,
- const CLiwGenericParamList& aInParamList,
- CLiwGenericParamList& aOutParamList, TUint aCmdOptions,
- const MLiwNotifyCallback* aCallback )
- {
- CP_DEBUG( _L8("CCPClientService::HandleServiceCmdL()") );
- if ( (aCallback ) || (aCmdOptions ) )
- {
- // report error if request is anything other than synchronous
- //or user sends a callback parameter
- aOutParamList.AppendL( TLiwGenericParam( EGenericParamError,
- TLiwVariant( KErrNotSupported ) ) );
- aOutParamList.AppendL( TLiwGenericParam( KErrorCode,
- TLiwVariant( KErrNotSupported ) ) );
- return;
- }
-
- TPtrC8 cmdName;
- const TLiwGenericParam* cmd= NULL;
-
- if ( aCmdId == KLiwCmdAsStr )
- {
- TInt pos = 0;
- cmd = aInParamList.FindFirst( pos, KCommand );
- if ( cmd )
- {
- cmdName.Set( cmd->Value().AsData( ) );
- }
- else
- {
- aOutParamList.AppendL( TLiwGenericParam( EGenericParamError,
- TLiwVariant( KErrArgument ) ) );
- aOutParamList.AppendL( TLiwGenericParam( KErrorCode,
- TLiwVariant( KErrArgument ) ) );
- }
- }
- else
- {
- aOutParamList.AppendL( TLiwGenericParam( EGenericParamError,
- TLiwVariant( KErrNotSupported ) ) );
- aOutParamList.AppendL( TLiwGenericParam( KErrorCode,
- TLiwVariant( KErrNotSupported ) ) );
- }
- if ( !cmdName.CompareF( KCPInterface ) )
- {
- //Create interface pointer and return the output param
- CDataSourceInterface* ifp =CDataSourceInterface::NewLC( );
- aOutParamList.AppendL( TLiwGenericParam( KCPInterface,
- TLiwVariant( ifp ) ) );
- CleanupStack::Pop( ifp );
- return;
- }
- else if ( !cmdName.CompareF( KCPContentInterface ) )
- {
- //Create interface pointer and return the output param
- CContentPublishingInterface* ifp =
- CContentPublishingInterface::NewLC( );
- aOutParamList.AppendL( TLiwGenericParam( KCPContentInterface,
- TLiwVariant( ifp ) ) );
- CleanupStack::Pop( ifp );
- return;
- }
- else
- {
- aOutParamList.AppendL( TLiwGenericParam( EGenericParamError,
- TLiwVariant( KErrNotSupported ) ) );
- aOutParamList.AppendL( TLiwGenericParam( KErrorCode,
- TLiwVariant( KErrNotSupported ) ) );
- }
- }
-
-// ---------------------------------------------------------
-// Map the interface UIDs to implementation factory functions
-// ---------------------------------------------------------
-//
-const TImplementationProxy ImplementationTable[] =
- {
- IMPLEMENTATION_PROXY_ENTRY( implUid, CCPClientService::NewL ),
- IMPLEMENTATION_PROXY_ENTRY( implContentUid, CCPClientService::NewL )
- };
-
-// ---------------------------------------------------------
-// Exported proxy for instantiation method resolution
-// ---------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
- TInt& aTableCount)
- {
- aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
- return ImplementationTable;
- }
--- a/homescreensrv_plat/sapi_contentpublishing/src/cpclientsession.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,285 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
- *
-*/
-
-
-#include <s32mem.h>
-#include <liwcommon.h>
-
-#include "cpserverdef.h"
-#include "cpliwmap.h"
-#include "cpclientsession.h"
-#include "cpglobals.h"
-#include "cpdebug.h"
-#include "cpclientactivenotifier.h"
-
-// Number of message slots to reserve for this client server session.
-const TUint KDefaultMessageSlots( 1 );
-
-// Function prototypes
-static TInt StartServer();
-static TInt CreateServerProcess();
-
-// ======== MEMBER FUNCTIONS ========
-
-// -----------------------------------------------------------------------------
-// RCPServerClient::RCPServerClient
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-RCPServerClient::RCPServerClient() :
- RSessionBase()
- {
- // No implementation required
- }
-
-// -----------------------------------------------------------------------------
-// RCPServerClient::Connect
-// Connect to Content publisher server session.
-// -----------------------------------------------------------------------------
-//
-TInt RCPServerClient::Connect()
- {
- TInt error =:: StartServer();
-
- if ( error == KErrNone )
- {
- error = CreateSession( KCPServerName,
- Version(),
- KDefaultMessageSlots );
- }
- return error;
- }
-
-// -----------------------------------------------------------------------------
-//
-//
-// -----------------------------------------------------------------------------
-//
-void RCPServerClient::Close()
- {
- RSessionBase::Close( );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void RCPServerClient::AddL( const CCPLiwMap& aMap,
- CLiwGenericParamList& aOutParamList )
- {
- CP_DEBUG( _L8("RCPServerClient::AddL()") );
- HBufC8 *inbuf = aMap.PackForServerLC( );
- TInt32 id( 0);
- TPckg<TInt32> sizeDes(id);
- TIpcArgs args;
- args.Set( KDescriptorPosition, &*inbuf );
- args.Set( KReturnPosition, &sizeDes );
- User::LeaveIfError( SendReceive( ECpServerAddData, args ) );
- TLiwGenericParam param( KItemId, id);
- aOutParamList.AppendL( param );
- CleanupStack::PopAndDestroy( inbuf );
- }
-
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void RCPServerClient::GetListL( const CCPLiwMap& aMap,
- CLiwGenericParamList& aOutParamList )
- {
- CP_DEBUG( _L8("RCPServerClient::GetListL()") );
- TIpcArgs args;
- HBufC8 *inbuf = aMap.PackForServerLC( );
- TInt error(KErrNone);
- TInt sizeList( 0);
- TPckg<TInt> sizeDes(sizeList);
- args.Set( KDescriptorPosition, &*inbuf );
- args.Set( KReturnPosition, &sizeDes );
- error = SendReceive( ECpServerGetListSize, args );
- if ( error == KErrNone )
- {
- TIpcArgs args;
- RBuf8 outbuf;
- outbuf.CleanupClosePushL( );
- outbuf.CreateL( sizeList );
- args.Set( KDescriptorPosition, &outbuf );
- error = SendReceive( ECpServerGetListData, args );
- if ( error == KErrNone )
- {
- RDesReadStream stream(outbuf);
- CleanupClosePushL( stream );
- aOutParamList.InternalizeL( stream ) ;
- CleanupStack::PopAndDestroy( &stream );
- }
- CleanupStack::PopAndDestroy( &outbuf );
- }
- User::LeaveIfError( error );
- CleanupStack::PopAndDestroy( inbuf );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void RCPServerClient::ExecuteActionL( const CCPLiwMap& aMap )
- {
- CP_DEBUG( _L8("RCPServerClient::ExecuteActionL()") );
- HBufC8 *inbuf = aMap.PackForServerLC( );
- TIpcArgs args;
- args.Set( KDescriptorPosition, &*inbuf );
- User::LeaveIfError( SendReceive( ECpServerExecuteAction, args ) );
- CleanupStack::PopAndDestroy( inbuf );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void RCPServerClient::DeleteL( const CCPLiwMap& aMap )
- {
- CP_DEBUG( _L8("RCPServerClient::DeleteL()") );
- HBufC8 *inbuf = aMap.PackForServerLC( );
- TIpcArgs args;
- args.Set( KDescriptorPosition, &*inbuf );
- User::LeaveIfError( SendReceive( ECpServerRemoveData, args ) );
- CleanupStack::PopAndDestroy( inbuf );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void RCPServerClient::RegisterObserverL( TRequestStatus& aStatus,
- TIpcArgs& aArgs )
- {
- CP_DEBUG( _L8("RCPServerClient::RegisterObserver()") );
- SendReceive( ECpServerRegisterObserver, aArgs, aStatus );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void RCPServerClient::AddObserver( TIpcArgs& aArgs )
- {
- CP_DEBUG( _L8("RCPServerClient::AddObserver()") );
- SendReceive( ECpServerAddObserver, aArgs );
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void RCPServerClient::RemoveObserver( TIpcArgs& aArgs )
- {
- CP_DEBUG( _L8("RCPServerClient::AddObserver()") );
- SendReceive( ECpServerRemoveObserver, aArgs );
- }
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-TInt RCPServerClient::GetChangeInfoData( TDes8& aBuf )
- {
- CP_DEBUG( _L8("RCPServerClient::GetChangeInfoData()") );
- TIpcArgs args;
- args.Set( KDescriptorPosition, &aBuf );
- TInt error = SendReceive( ECpServerGetChangeInfoData, args );
- return error;
- }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void RCPServerClient::UnregisterObserver()
- {
- CP_DEBUG( _L8("RCPServerClient::UnregisterObserver()") );
- SendReceive( ECpServerUnRegisterObserver );
- }
-
-// -----------------------------------------------------------------------------
-// RCPServerClient::Version
-// Version information.
-// -----------------------------------------------------------------------------
-//
-TVersion RCPServerClient::Version() const
- {
- CP_DEBUG( _L8("RCPServerClient::Version()") );
- return (TVersion( KCPServerMajorVersionNumber,
- KCPServerMinorVersionNumber, KCPServerBuildVersionNumber ) );
- }
-
-// -----------------------------------------------------------------------------
-// StartServer
-// Static method to start the server.
-// -----------------------------------------------------------------------------
-//
-static TInt StartServer()
- {
- TInt result;
-
- TFindServer findServer( KCPServerName );
- TFullName name;
-
- result = findServer.Next( name );
- if ( result != KErrNone )
- {
- // Server not running
- result = CreateServerProcess( );
- }
- return result;
- }
-
-// -----------------------------------------------------------------------------
-// CreateServerProcess
-// Static method to create the server process.
-// -----------------------------------------------------------------------------
-//
-static TInt CreateServerProcess()
- {
- CP_DEBUG( _L8("RCPServerClient::CreateServerProcess()") );
- const TUidType serverUid( KNullUid, KNullUid, KServerUid3);
- RProcess server;
- TInt result;
- result = server.Create( KCPServerFilename, KNullDesC, serverUid );
- if ( result == KErrNone )
- {
- TRequestStatus stat = KRequestPending;
- server.Rendezvous( stat );
- if ( stat != KRequestPending )
- {
- server.Kill( 0 ); // abort startup
- }
- else
- {
- server.Resume( ); // logon OK - start the server
- }
-
- User::WaitForRequest( stat ); // wait for start or death
- // we can't use the 'exit reason' if the server panicked as this
- // is the panic 'reason' and may be '0' which cannot be distinguished
- // from KErrNone
- result = (server.ExitType( ) == EExitPanic ) ? KErrGeneral
- : stat.Int( );
- }
- server.Close( );
- return result;
- }
--- a/hsappkeyhandler/src/hsappkeyplugin.cpp Fri Apr 16 14:45:49 2010 +0300
+++ b/hsappkeyhandler/src/hsappkeyplugin.cpp Fri Apr 30 15:22:08 2010 +0300
@@ -166,6 +166,7 @@
if(KErrNone != mDialog->Show(KTsPluginName,*params,this)) {
delete mDialog;
+ mDialog = 0;
}
delete params;
}
--- a/rom/homescreensrv_core.iby Fri Apr 16 14:45:49 2010 +0300
+++ b/rom/homescreensrv_core.iby Fri Apr 30 15:22:08 2010 +0300
@@ -62,9 +62,6 @@
// ---- hswidgetmodel --------------------------------------------
file=ABI_DIR\BUILD_DIR\hswidgetmodel.dll SHARED_LIB_DIR\hswidgetmodel.dll
-// ---- screensavermodel --------------------------------------------
-file=ABI_DIR\BUILD_DIR\screensavermodel.dll SHARED_LIB_DIR\screensavermodel.dll
-
// ---- homescreen_information_api --------------------------------------------
data=\epoc32\data\c\resource\qt\crml\homescreeninformation.qcrml resource\qt\crml\homescreeninformation.qcrml
#endif // __HOMESCREENSRV_CORE_IBY__
--- a/screensavermodel/inc/iscreensaverprovider.h Fri Apr 16 14:45:49 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: Screensaver provider interface.
-*
-*/
-
-#ifndef ISCREENSAVERPROVIDER_H
-#define ISCREENSAVERPROVIDER_H
-
-#include <QtPlugin>
-#include <QVariant>
-
-/*!
- \class ScreensaverToken
- \brief Represents a screensaver that can be created.
-
- Screensavers are located in screensaver providers. Each provider
- exposes its contained screensavers as screensaver tokens. A token has
- all the needed information for screensaver selection and creation.
-*/
-class ScreensaverToken
-{
-
-public:
-
- /*!
- The name of the library/plugin that contains the screensaver.
- */
- QString mLibrary;
-
- /*!
- Uniquely identifies the screensaver.
- */
- QString mUri;
-
-};
-
-class Screensaver;
-
-/*!
- \class IScreensaverProvider
- \brief Defines a mechanism for retrieving a screensaver.
-
- Interface that defines a mechanism for retrieving a screensaver.
- Each screensaver provider implements this interface.
-*/
-class IScreensaverProvider
-{
-
-public:
-
- /*!
- Destructs the class.
- */
- virtual ~IScreensaverProvider() {}
-
-public:
-
- /*!
- Returns contained screensavers as a list of screensaver tokens.
- \return Contained screensavers as tokens.
- */
- virtual QList<ScreensaverToken> screensavers() = 0;
-
- /*!
- Creates and returns a screensaver based on the given token.
- \param token Identifies the screensaver to be created.
- \return The created screensaver or null in failure cases.
- */
- virtual Screensaver *createScreensaver(const ScreensaverToken &token) = 0;
-
-};
-
-Q_DECLARE_METATYPE(ScreensaverToken)
-Q_DECLARE_INTERFACE(IScreensaverProvider,
- "com.nokia.screensaver.iscreensaverprovider/1.0")
-
-#endif // ISCREENSAVERPROVIDER_H
--- a/screensavermodel/inc/screensaver.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +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 screensavers.
-*
-*/
-
-#ifndef SCREENSAVER_H
-#define SCREENSAVER_H
-
-#include <QGraphicsWidget>
-
-#include "screensavermodel_global.h"
-
-class ScreensaverPrivate;
-
-enum ScreensaverState
-{
- ScreensaverStateConstructed = 0,
- ScreensaverStateInitialized,
- ScreensaverStateBackground,
- ScreensaverStateForeground,
- ScreensaverStatePartialForeground,
- ScreensaverStatePowerSave,
- ScreensaverStateClosed
-};
-
-class SREENSAVERMODEL_EXPORT Screensaver : public QObject
-{
- Q_OBJECT
-
-public:
-
- Screensaver(QObject *parent = 0);
- virtual ~Screensaver();
-
- ScreensaverState currentState();
-
-public slots:
-
- void initialize();
- void foreground();
- void partialForeground();
- void background();
- void powerSave();
- void close();
-
-protected:
-
- virtual bool onInitialize();
- virtual bool onForeground() = 0;
- virtual bool onPartialForeground() = 0;
- virtual bool onBackground() = 0;
- virtual bool onPowerSave() = 0;
- virtual bool onClose();
-
-signals:
-
- void faulted();
- void viewChanged(QGraphicsWidget *widget);
-
-private:
-
- Q_DISABLE_COPY(Screensaver)
-
-private:
-
- ScreensaverPrivate * const m_d;
- friend class ScreensaverPrivate;
-
-};
-
-#endif // SCREENSAVER_H
--- a/screensavermodel/inc/screensaver_p.h Fri Apr 16 14:45:49 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: The private implementation of the Screensaver.
-*
-*/
-
-#ifndef SCREENSAVER_P_H
-#define SCREENSAVER_P_H
-
-#include "screensaver.h"
-
-class QGraphicsWidget;
-
-class ScreensaverPrivate
-{
-public:
-
- ScreensaverPrivate(Screensaver * const screensaverPublic);
- ~ScreensaverPrivate();
-
- ScreensaverState currentState();
-
-public slots:
-
- void initialize();
- void foreground();
- void partialForeground();
- void background();
- void powerSave();
- void close();
-
-private:
-
- Q_DISABLE_COPY(ScreensaverPrivate)
-
-public:
-
- Screensaver * const m_q;
- ScreensaverState mState;
-};
-
-#endif // SCREENSAVER_P_H
--- a/screensavermodel/inc/screensaverfactory.h Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Screensaver factory.
-*
-*/
-
-#ifndef SCREENSAVERFACTORY_H
-#define SCREENSAVERFACTORY_H
-
-#include <QObject>
-
-#include "iscreensaverprovider.h"
-#include "screensavermodel_global.h"
-
-class QPluginLoader;
-
-class SREENSAVERMODEL_EXPORT ScreensaverPluginUnloader : public QObject
-{
- Q_OBJECT
-
-public:
-
- ScreensaverPluginUnloader(QPluginLoader *pluginLoader, QObject *parent = 0);
- ~ScreensaverPluginUnloader();
-
-private:
-
- QPluginLoader *mPluginLoader;
-
-};
-
-class ScreensaverFactoryPrivate;
-
-class SREENSAVERMODEL_EXPORT ScreensaverFactory : public QObject
-{
- Q_OBJECT
-
-public:
-
- ScreensaverFactory(const QString& pluginDirectory, QObject *parent = 0);
- virtual ~ScreensaverFactory();
-
- Screensaver *createScreensaver(const ScreensaverToken &token);
-
-private:
-
- Q_DISABLE_COPY(ScreensaverFactory)
-
-private:
-
- ScreensaverFactoryPrivate *m_d;
- friend class ScreensaverFactoryPrivate;
-
-};
-
-#endif // SCREENSAVERFACTORY_H
--- a/screensavermodel/inc/screensaverfactory_p.h Fri Apr 16 14:45:49 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: Screensaver factory private implementation.
-*
-*/
-
-#ifndef SCREENSAVERFACTORY_P_H
-#define SCREENSAVERFACTORY_P_H
-
-#include "iscreensaverprovider.h"
-
-class ScreensaverFactory;
-class IScreensaverProvider;
-
-class ScreensaverFactoryPrivate
-{
-
-public:
-
- ScreensaverFactoryPrivate(const QString& pluginDirectory,
- ScreensaverFactory* screensaverFactoryPublic);
- ~ScreensaverFactoryPrivate();
-
- Screensaver *createScreensaver(const ScreensaverToken &token);
-
-private:
-
- Q_DISABLE_COPY(ScreensaverFactoryPrivate)
-
-public:
-
- ScreensaverFactory *m_q;
- QString mPluginDirectory;
-
-};
-
-#endif // SCREENSAVERFACTORY_P_H
--- a/screensavermodel/inc/screensavermodel_global.h Fri Apr 16 14:45:49 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: The dll header file.
-*
-*/
-
-#ifndef SREENSAVERMODEL_GLOBAL_H
-#define SREENSAVERMODEL_GLOBAL_H
-
-#include <Qt/qglobal.h>
-
-#ifdef SREENSAVERMODEL_LIB
- #define SREENSAVERMODEL_EXPORT Q_DECL_EXPORT
-#else
- #ifdef SREENSAVERMODEL_TEST
- #define SREENSAVERMODEL_EXPORT
- #else
- #define SREENSAVERMODEL_EXPORT Q_DECL_IMPORT
- #endif
-#endif
-
-#endif // SREENSAVERMODEL_GLOBAL_H
--- a/screensavermodel/screensavermodel.pri Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: screensavermodel.pri
-#
-
-HEADERS += ./inc/*.h
-
-SOURCES += ./src/*.cpp
-
-DEPENDPATH += . \
- inc \
- src
-
-INCLUDEPATH += . \
- inc
--- a/screensavermodel/screensavermodel.pro Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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: screensavermodel.pro
-#
-
-TEMPLATE = lib
-
-include (../common.pri)
-
-symbian: {
-TARGET.UID3 = 0x20027051
-}
-
-DEFINES += SREENSAVERMODEL_LIB
-
-include(screensavermodel.pri)
--- a/screensavermodel/src/screensaver.cpp Fri Apr 16 14:45:49 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: Base class for all screensavers.
-*
-*/
-
-#include "screensaver.h"
-#include "screensaver_p.h"
-
-/*!
- \enum ScreensaverState
- Lists states that the Screensaver can be in.
-*/
-
-/*
- \var ScreensaverState ScreensaverStateConstructed
- Screensaver is in this state right after construction.
-*/
-
-/*
- \var ScreensaverState ScreensaverStateInitialized
-
- All Screensaver resources are initialized.
- Screensaver is set to Initialized state after a call to initialize
- (if previously Constructed or Closed) method.
-*/
-
-/*
- \var Screensaver ScreensaverStateBackground
- Screensaver is in background, its operations are suspended.
- Screensaver is set to Background after a call to background method.
-*/
-
-/*
- \var Screensaver ScreensaverStateForeground
- Screensaver is in foreground and fully operational, showing the main visualization.
- Screensaver is set to Foreground after a call to foreground method.
-*/
-
-/*
- \var Screensaver ScreensaverStatePartialForeground
- Screensaver has limited foreground (in OLED display cases).
- Screensaver is set to PartialForeground after a call to partialForeground method.
-*/
-
-/*
- \var Screensaver ScreensaverStatePowerSave
- Device is in power save mode. Screensaver should limit all processing.
- Screensaver is set to PowerSave after a call to powerSave method.
-*/
-
-/*
- \var Screensaver ScreensaverStateClosed
- Screensaver is closed. All resources should be frees.
- Screensaver is set to Closed after a call to close method.
-*/
-
-/*!
- \class Screensaver
- \brief Base class for all screensavers.
-
- Screensaver plug-ins provide the visualizations for different screensaver application states.
- A Screensaver is notified about state changes and in consequence it should emit a signal
- viewChanged() carrying a QGraphicsWidget which will be set as the current view.
- The application takse care about tracing device status so the Screensaver should be only
- concerned about the GUI.
- */
-
-/*!
- Constructs a new Screensaver with \a parent.
- */
-Screensaver::Screensaver(QObject *parent) :
- QObject(parent), m_d(new ScreensaverPrivate(this))
-{
-}
-
-/*!
- Destructs the class.
- */
-Screensaver::~Screensaver()
-{
- delete m_d;
-}
-
-/*!
- \fn void Screensaver::faulted()
-
- This signal is emitted if a fault occurs when changing Screensaver's state.
- */
-
-/*!
- \fn void Screensaver::viewChanged(QGraphicsWidget *widget)
-
- This signal should be emitted when the Screensaver needs to change its visualization
- after a state change.
- \param widget The graphics widget container holding the current visualization.
- */
-
-/*!
- Returns the state that the Screensaver is currently in.
- \return The current state.
- */
-ScreensaverState Screensaver::currentState()
-{
- return m_d->currentState();
-}
-
-/*!
- Initializes the Screensaver
- */
-void Screensaver::initialize()
-{
- m_d->initialize();
-}
-
-/*!
- Called when the application is in foreground.
- */
-void Screensaver::foreground()
-{
- m_d->foreground();
-}
-
-/*!
- Called when the application gains limited foreground as with OLED display cases.
- */
-void Screensaver::partialForeground()
-{
- m_d->partialForeground();
-}
-
-/*!
- Called when the application goes to background.
- */
-void Screensaver::background()
-{
- m_d->background();
-}
-
-/*!
- Called when device enters power save mode.
- */
-void Screensaver::powerSave()
-{
- m_d->powerSave();
-}
-
-/*!
- Stops Screensaver's processing.
- */
-void Screensaver::close()
-{
- m_d->close();
-}
-
-/*!
- \fn virtual bool Screensaver::onForeground() = 0
-
- After a call the Screensaver should emit the foreground state visualization.
- Returns true if the operation secceeded, otherwise false - in this case
- the faulted() signal will be emitted by the base class.
- \return Indicates if the operation succeeded.
- */
-
-/*!
- \fn virtual bool Screensaver::onPartialForeground() = 0
-
- After a call the Screensaver should emit the partial foreground state visualization.
- This is valid for OLED display cases when the screensaver is displayed at all times
- with limited functionality.
- Returns true if the operation secceeded, otherwise false - in this case
- the faulted() signal will be emitted by the base class.
- \return Indicates if the operation succeeded.
- */
-
-/*!
- \fn virtual bool Screensaver::onBackground() = 0
-
- After a call the Screensaver should limit its processing.
- Returns true if the operation secceeded, otherwise false - in this case
- the faulted() signal will be emitted by the base class.
- \return Indicates if the operation succeeded.
- */
-
-/*!
- \fn virtual bool Screensaver::onPowerSave() = 0
-
- After a call the Screensaver should limit its processing as much as possible.
- Returns true if the operation secceeded, otherwise false - in this case
- the faulted() signal will be emitted by the base class.
- \return Indicates if the operation succeeded.
- */
-
-/*!
- After a call it should initialize the Screensaver.
- Returns true if the operation secceeded, otherwise false - in this case
- the faulted() signal will be emitted by the base class.
- The default implementation does nothing and always returns true.
- \return Indicates if the operation succeeded.
- */
-bool Screensaver::onInitialize()
-{
- return true;
-}
-
-/*!
- After a call it should close the Screensaver.
- The Screensaver should also free all resources.
- Returns true if the operation secceeded, otherwise false - in this case
- the faulted() signal will be emitted by the base class.
- The default implementation does nothing and always returns true.
- \return Indicates if the operation succeeded.
- */
-bool Screensaver::onClose()
-{
- return true;
-}
--- a/screensavermodel/src/screensaver_p.cpp Fri Apr 16 14:45:49 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: Base class for all screensavers.
-*
-*/
-
-#include "screensaver_p.h"
-
-/*!
- \class Screensaver
- \brief The private implementation of the Screensaver.
- */
-
-/*!
- Constructs a new ScreensaverPrivate with \a screensaverPublic.
- */
-ScreensaverPrivate::ScreensaverPrivate(Screensaver * const screensaverPublic) :
- m_q(screensaverPublic), mState(ScreensaverStateConstructed)
-{
-}
-
-/*!
- Destructs the class.
- */
-ScreensaverPrivate::~ScreensaverPrivate()
-{
-}
-
-/*!
- Return current state.
- \return Current state.
- */
-ScreensaverState ScreensaverPrivate::currentState()
-{
- return mState;
-}
-
-/*!
- Change state on Initialized.
- */
-void ScreensaverPrivate::initialize()
-{
- switch (mState)
- {
- case ScreensaverStateConstructed:
- case ScreensaverStateClosed:
- break;
- default:
- return;
- }
-
- mState = ScreensaverStateInitialized;
- if (!m_q->onInitialize()) {
- emit m_q->faulted();
- }
-}
-
-/*!
- Change state on Foreground.
- */
-void ScreensaverPrivate::foreground()
-{
- switch (mState)
- {
- case ScreensaverStateInitialized:
- case ScreensaverStateBackground:
- case ScreensaverStatePowerSave:
- case ScreensaverStatePartialForeground:
- break;
- default:
- return;
- }
-
- mState = ScreensaverStateForeground;
- if (!m_q->onForeground()) {
- emit m_q->faulted();
- }
-}
-
-/*!
- Change state on PartialForeground.
- */
-void ScreensaverPrivate::partialForeground()
-{
- switch (mState)
- {
- case ScreensaverStateInitialized:
- case ScreensaverStateForeground:
- case ScreensaverStateBackground:
- break;
- default:
- return;
- }
-
- mState = ScreensaverStatePartialForeground;
- if (!m_q->onPartialForeground()) {
- emit m_q->faulted();
- }
-}
-
-/*!
- Change state on Background.
- */
-void ScreensaverPrivate::background()
-{
- switch (mState)
- {
- case ScreensaverStateInitialized:
- case ScreensaverStateForeground:
- case ScreensaverStatePartialForeground:
- case ScreensaverStatePowerSave:
- break;
- default:
- return;
- }
-
- mState = ScreensaverStateBackground;
- if (!m_q->onBackground()) {
- emit m_q->faulted();
- }
-}
-
-/*!
- Change state on Disabled.
- */
-void ScreensaverPrivate::powerSave()
-{
- switch (mState)
- {
- case ScreensaverStateBackground:
- break;
- default:
- return;
- }
-
- mState = ScreensaverStatePowerSave;
- if (!m_q->onPowerSave()) {
- emit m_q->faulted();
- }
-}
-
-/*!
- Change state on Closed.
- */
-void ScreensaverPrivate::close()
-{
- switch (mState)
- {
- case ScreensaverStateInitialized:
- case ScreensaverStateBackground:
- case ScreensaverStateForeground:
- case ScreensaverStatePartialForeground:
- case ScreensaverStatePowerSave:
- break;
- default:
- return;
- }
-
- mState = ScreensaverStateClosed;
- if (!m_q->onClose()) {
- emit m_q->faulted();
- }
-}
--- a/screensavermodel/src/screensaverfactory.cpp Fri Apr 16 14:45:49 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +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: Screensaver factory.
-*
-*/
-
-#include <QDebug>
-#include <QStringList>
-#include <QDir>
-#include <QPluginLoader>
-
-#include "screensaverfactory.h"
-#include "screensaverfactory_p.h"
-#include "screensaver.h"
-
-/*!
- \class ScreensaverPluginUnloader
- \brief Unloads plugin and deletes plugin loader.
-
- Holds plugin loader instance and unloads and destroys plugin
- on it's destructor.
- */
-
-/*!
- Constructs a new SnsrPluginUnloader with \a pluginLoader and \a parent.
- */
-ScreensaverPluginUnloader::ScreensaverPluginUnloader(
- QPluginLoader *pluginLoader, QObject *parent) :
- QObject(parent), mPluginLoader(pluginLoader)
-{
-}
-
-/*!
- Destructs the class.
- */
-ScreensaverPluginUnloader::~ScreensaverPluginUnloader()
-{
- if (mPluginLoader) {
- mPluginLoader->unload();
- delete mPluginLoader;
- }
-}
-
-/*!
- \class ScreensaverFactoryPrivate
- \brief The private implementation of the ScreensaverFactory.
- */
-
-/*!
- Constructs a new ScreensaverFactoryPrivate with \a pluginDirectory and \a screensaverFactoryPublic.
- */
-ScreensaverFactoryPrivate::ScreensaverFactoryPrivate(const QString& pluginDirectory,
- ScreensaverFactory *screensaverFactoryPublic) :
- m_q(screensaverFactoryPublic), mPluginDirectory(pluginDirectory)
-{
-}
-
-/*!
- Destructs the class.
- */
-ScreensaverFactoryPrivate::~ScreensaverFactoryPrivate()
-{
-}
-
-/*!
- Creates and returns a screensaver on the given token.
- \param token Identifies the screensaver to be created.
- \return The created state.
- */
-Screensaver* ScreensaverFactoryPrivate::createScreensaver(const ScreensaverToken &token)
-{
- 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(mPluginDirectory).exists() &&
- !pluginPaths.contains(QDir(mPluginDirectory).absolutePath())) {
- pluginPaths << mPluginDirectory;
- }
-
- IScreensaverProvider *provider(0);
- QPluginLoader *loader = new QPluginLoader();
- QObject *plugin(0);
-
- for(int i=0; i < pluginPaths.count(); i++) {
- QString path = pluginPaths.at(i);
- QString fileName = QDir(path).absoluteFilePath(token.mLibrary);
-
- loader->setFileName(fileName);
- plugin = loader->instance();
- provider = qobject_cast<IScreensaverProvider*>(plugin);
- if (provider) {
- break;
- }
- }
-
- Screensaver *screensaver(0);
-
- if (provider) {
- screensaver = provider->createScreensaver(token);
- if (!screensaver) {
- qWarning() << "Screensaver creation failed.";
- qWarning() << token.mLibrary << "cannot provide" << token.mUri;
- loader->unload();
- delete loader;
- } else {
- // unload plugin once screensaver gets deleted
- ScreensaverPluginUnloader *unloader = new ScreensaverPluginUnloader(loader);
- unloader->connect(screensaver, SIGNAL(destroyed()), SLOT(deleteLater()));
- }
- } else {
- qDebug() << "Screensaver creation failed.";
- qWarning() << token.mLibrary << "- provider not found";
- loader->unload();
- delete loader;
- }
-
- return screensaver;
-}
-
-/*!
- \class ScreensaverFactory
- \brief Finds and creates screensavers.
-
- Screensaver factory creates an instance of a screensaver
- on a screensaver token that is given to it.
- */
-
-/*!
- Constructs a new ScreensaverFactory with \a pluginDirectory and \a parent.
- */
-ScreensaverFactory::ScreensaverFactory(const QString& pluginDirectory,
- QObject *parent) :
- QObject(parent), m_d(new ScreensaverFactoryPrivate(pluginDirectory, this))
-{
-}
-
-/*!
- Destructs the class.
- */
-ScreensaverFactory::~ScreensaverFactory()
-{
- delete m_d;
-}
-
-/*!
- Creates and returns a screensaver on the given token.
- \param token Identifies the screensaver to be created.
- \return The created screensaver.
- */
-Screensaver* ScreensaverFactory::createScreensaver(const ScreensaverToken &token)
-{
- return m_d->createScreensaver(token);
-}