--- a/activityfw/activitydatabase/eabi/hsactivitydbclientu.def Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/eabi/hsactivitydbclientu.def Mon May 03 12:48:45 2010 +0300
@@ -31,4 +31,5 @@
_ZThn8_N18HsActivityDbClient14updateActivityERK5QHashI7QString8QVariantE @ 30 NONAME
_ZThn8_N18HsActivityDbClient21applicationActivitiesER5QListI5QHashI7QString8QVariantEERKS4_ @ 31 NONAME
_ZThn8_N18HsActivityDbClient27removeApplicationActivitiesERK5QHashI7QString8QVariantE @ 32 NONAME
+ _ZN18HsActivityDbClient12getThumbnailER7QPixmapRK7QString @ 33 NONAME
--- a/activityfw/activitydatabase/hsactivitydbclient/hsactivitydbclient.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/hsactivitydbclient.pro Mon May 03 12:48:45 2010 +0300
@@ -20,8 +20,6 @@
QT += core \
sql
-QT -= gui
-
HEADERS += inc/hsactivitydbclient.h
SOURCES += src/hsactivitydbclient.cpp
@@ -50,5 +48,6 @@
DEPLOYMENT += api
TARGET.CAPABILITY = ALL -TCB
TARGET.EPOCALLOWDLLDATA = 1
+TARGET.UID3 = 0x200267B3
MMP_RULES += EXPORTUNFROZEN
}
--- a/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbasyncrequestobserver.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbasyncrequestobserver.h Mon May 03 12:48:45 2010 +0300
@@ -25,10 +25,10 @@
* Function inform observer about asynchronous request results
* @param result - request result
* @param requestType - request type
- * @param data - respons data
+ * @param data - respons data
*/
- virtual void asyncRequestCompleated(int result,
- int requestType,
- const QString& data)=0;
+ virtual void asyncRequestCompleated(int result,
+ int requestType,
+ const QString &data)=0;
};
#endif // HSACTIVITYDBASYNCREQUESTOBSERVER_H
--- a/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbclient.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbclient.h Mon May 03 12:48:45 2010 +0300
@@ -36,90 +36,99 @@
public HsActivityDbClientInterface,
public HsActivityDbAsyncRequestObserver
{
-Q_OBJECT
+ Q_OBJECT
public:
/**
* Constructor
*/
HsActivityDbClient(QObject* =0);
-
+
/**
* Destructor
*/
~HsActivityDbClient();
-
+
/**
* Establish connection with activity server
* @return 0 on succees, error code otherwise
*/
int connect();
-
+
/**
* Interface implementation.
* @see int HsActivityDbAsyncRequestObserver::asyncRequestCompleated(int, int, const QString&)
*/
- void asyncRequestCompleated(int, int, const QString&);
-
+ void asyncRequestCompleated(int, int, const QString &);
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::saveActivity(const QVariantHash&)
*/
int addActivity(const QVariantHash &);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::updateActivity(const QVariantHash&)
*/
int updateActivity(const QVariantHash &);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::deleteActivity(const QVariantHash &)
*/
int removeActivity(const QVariantHash &activity);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::deleteApplicationActivities(const QVariantHash &)
*/
int removeApplicationActivities(const QVariantHash &activity);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::activities(QList<QVariantHash>&)
*/
int activities(QList<QVariantHash> &);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::applicationActivities(QList<QVariantHash> &, const QVariantHash &)
*/
- int applicationActivities(QList<QVariantHash> &,
+ int applicationActivities(QList<QVariantHash> &,
const QVariantHash &);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &)
*/
int waitActivity(const QVariantHash &);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &)
*/
int launchActivity(const QVariantHash &);
+
+ /**
+ * 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);
+
signals:
/**
* Function notify about runtime activity change
* @param activityId - requested activity name
*/
- void activityRequested(const QString& activityId);
+ void activityRequested(const QString &activityId);
private:
/**
* Private client implementation.
* Own.
*/
- HsActivityDbClientPrivate* d_ptr;
+ HsActivityDbClientPrivate *d_ptr;
};
#endif //HSACTIVITYDBCLIENT_H
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbasyncrequest_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbasyncrequest_p.h Mon May 03 12:48:45 2010 +0300
@@ -32,32 +32,32 @@
/**
* First step constructor
*/
- static HsActivityDbAsyncRequestPrivate*
- NewL(HsActivityDbAsyncRequestObserver &, HsActivityDbClientPrivate &);
-
+ static HsActivityDbAsyncRequestPrivate*
+ NewL(HsActivityDbAsyncRequestObserver &, HsActivityDbClientPrivate &);
+
/**
* First step constructor
*/
- static HsActivityDbAsyncRequestPrivate*
- NewLC(HsActivityDbAsyncRequestObserver &, HsActivityDbClientPrivate &);
-
+ static HsActivityDbAsyncRequestPrivate*
+ NewLC(HsActivityDbAsyncRequestObserver &, HsActivityDbClientPrivate &);
+
/**
* Destructor
*/
~HsActivityDbAsyncRequestPrivate();
-
+
/**
* Function create subscription to current ativity changes
* @param condition - activity filetering rules
*/
- void waitActivity(const QVariantHash& condition);
+ void waitActivity(const QVariantHash &condition);
protected:
/**
* Interface implementation.
* @see void CActive::DoCancel()
*/
void DoCancel();
-
+
/**
* Interface implementation.
* @see void CActive::DoCancel()
@@ -70,8 +70,8 @@
HsActivityDbAsyncRequestPrivate(HsActivityDbAsyncRequestObserver &,
HsActivityDbClientPrivate &);
private:
- HsActivityDbAsyncRequestObserver& mObserver;
- HsActivityDbClientPrivate& mSession;
+ HsActivityDbAsyncRequestObserver &mObserver;
+ HsActivityDbClientPrivate &mSession;
int mRequestType;
RBuf8 mDataBuf;
TPckgBuf<int> mDataSize;
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h Mon May 03 12:48:45 2010 +0300
@@ -23,7 +23,7 @@
class HsActivityDbAsyncRequestPrivate;
/**
- * Class implemets HsActivityDbClientInterface and is responsible for
+ * Class implemets HsActivityDbClientInterface and is responsible for
* activity data management on S60 enviroment.
*/
class HsActivityDbClientPrivate : protected RSessionBase,
@@ -33,67 +33,67 @@
/**
* Constructor
*/
- HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver&);
-
+ HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver &);
+
/**
* Destructor
*/
~HsActivityDbClientPrivate();
-
+
/**
* Function establish connection to activity server
* @return 0 on succees, error code otherwise
*/
int connect();
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::addActivity(const QVariantHash &)
*/
int addActivity(const QVariantHash &);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::updateActivity(const QVariantHash &)
*/
int updateActivity(const QVariantHash &);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::removeActivity(const QVariantHash &)
*/
int removeActivity(const QVariantHash &activity);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::removeApplicationActivities(const QVariantHash &)
*/
int removeApplicationActivities(const QVariantHash &activity);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::requestedActivityName(QString &, const QVariantHash &);
*/
int requestedActivityName(QString &, const QVariantHash &);
-
+
/**
* Interface implementation.
* @see int HsActivityDbClientInterface::activities(QList<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 &)
@@ -106,73 +106,81 @@
*/
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 dst - destination, preallocated buffer
*/
- void getData(RBuf8 & dst);
-
+ void getData(RBuf8 &dst);
+
/**
* Function initialize aync request
* @param func - requested function
* @param data - request data
* @param status - request status
*/
- void sendDataAsync(int func,const TIpcArgs & data, TRequestStatus& status);
-
+ void sendDataAsync(int func,const TIpcArgs &data, TRequestStatus &status);
+
private:
/**
* Function start activity server process.
* Function can leave on failure.
*/
void startServerL();
-
+
/**
* Function establish connection to activity server.
* Function can leave on failure
*/
void connectL();
-
+
/**
* Function execute remote call request.
* @param function - remote function identyfier
- * @param activity - remote function parameters
+ * @param activity - remote function parameters
*/
- void execSimpleRequestL( int function, const QVariantHash &activity);
-
+ void execSimpleRequestL(int function, const QVariantHash &activity);
+
/**
* Function retrieve current activity name for application.
* Function can leave on failure
* @param result - activity name
- * @param activity - request filtering rules
+ * @param activity - request filtering rules
*/
- void requestedActivityNameL(QString& result,
+ void requestedActivityNameL(QString &result,
const QVariantHash &activity);
-
- /**
- * Function retrieve all stored activity
- * Function can leave on failure
- * @param result - list of activity
- */
- void activitiesL(QList<QVariantHash>& result);
-
+
/**
* Function retrieve all stored activity
* Function can leave on failure
* @param result - list of activity
- * @param cond - request conditions
*/
- void applicationActivitiesL(QList<QVariantHash>& result,
- const QVariantHash & cond);
-
+ void activitiesL(QList<QVariantHash>& result);
+
+ /**
+ * Function retrieve all stored activity
+ * Function can leave on failure
+ * @param result - list of activity
+ * @param cond - request conditions
+ */
+ void applicationActivitiesL(QList<QVariantHash>& result,
+ const QVariantHash &cond);
+
void waitActivityL(const QVariantHash &activity);
private:
/**
* Async request handler
* Own
*/
- HsActivityDbAsyncRequestPrivate* mAsyncDataHandler;
+ HsActivityDbAsyncRequestPrivate *mAsyncDataHandler;
};
#endif // HSACTIVITYDBCLIENTPRIVATE_H
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbasyncrequest_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbasyncrequest_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -22,11 +22,11 @@
//
// -----------------------------------------------------------------------------
//
-HsActivityDbAsyncRequestPrivate*
- HsActivityDbAsyncRequestPrivate::NewL(HsActivityDbAsyncRequestObserver& observer,
- HsActivityDbClientPrivate& session)
+HsActivityDbAsyncRequestPrivate*
+HsActivityDbAsyncRequestPrivate::NewL(HsActivityDbAsyncRequestObserver &observer,
+ HsActivityDbClientPrivate &session)
{
- HsActivityDbAsyncRequestPrivate* self =
+ HsActivityDbAsyncRequestPrivate *self =
HsActivityDbAsyncRequestPrivate::NewLC(observer, session);
CleanupStack::Pop(self);
return self;
@@ -35,12 +35,12 @@
//
// -----------------------------------------------------------------------------
//
-HsActivityDbAsyncRequestPrivate*
- HsActivityDbAsyncRequestPrivate::NewLC(HsActivityDbAsyncRequestObserver& observer,
- HsActivityDbClientPrivate& session)
+HsActivityDbAsyncRequestPrivate*
+HsActivityDbAsyncRequestPrivate::NewLC(HsActivityDbAsyncRequestObserver &observer,
+ HsActivityDbClientPrivate &session)
{
- HsActivityDbAsyncRequestPrivate* self =
- new (ELeave)HsActivityDbAsyncRequestPrivate(observer, session);
+ HsActivityDbAsyncRequestPrivate *self =
+ new(ELeave)HsActivityDbAsyncRequestPrivate(observer, session);
CleanupStack::PushL(self);
self->mDataBuf.CreateL(64);
return self;
@@ -51,7 +51,7 @@
//
HsActivityDbAsyncRequestPrivate::HsActivityDbAsyncRequestPrivate(HsActivityDbAsyncRequestObserver &observer,
HsActivityDbClientPrivate &session)
-:
+ :
CActive(EPriorityStandard),
mObserver(observer),
mSession(session),
@@ -77,8 +77,8 @@
//
void HsActivityDbAsyncRequestPrivate::DoCancel()
{
- if(IsActive()) {
- mSession.cancelWaitActivity();
+ if (IsActive()) {
+ mSession.cancelWaitActivity();
}
}
@@ -92,12 +92,12 @@
CleanupClosePushL(buff);
QString data;
int requestResult(iStatus.Int());
- if(KErrNone == requestResult) {
- if(0 < mDataSize()) {
+ if (KErrNone == requestResult) {
+ if (0 < mDataSize()) {
buff.CreateL(mDataSize());
}
mSession.getData(buff);
- data = QString::fromAscii(reinterpret_cast<const char*>(buff.Ptr()),
+ data = QString::fromAscii(reinterpret_cast<const char *>(buff.Ptr()),
buff.Length());
buff.Close();
}
@@ -109,7 +109,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivityDbAsyncRequestPrivate::waitActivity(const QVariantHash& condition)
+void HsActivityDbAsyncRequestPrivate::waitActivity(const QVariantHash &condition)
{
mRequestType = WaitActivity;
iStatus = KRequestPending;
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbclient_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbclient_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -19,12 +19,14 @@
#include "hsactivitydbasyncrequest_p.h"
#include "hsactivityglobals.h"
#include "hsserializer.h"
+#include <qvariant.h>
+
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
-HsActivityDbClientPrivate::HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver& observer)
+HsActivityDbClientPrivate::HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver &observer)
{
mAsyncDataHandler = HsActivityDbAsyncRequestPrivate::NewL(observer, *this);
}
@@ -55,8 +57,8 @@
//
int HsActivityDbClientPrivate::addActivity(const QVariantHash &activity)
{
- TRAPD( errNo, execSimpleRequestL(AddActivity, activity);)
- return errNo;
+ TRAPD(errNo, execSimpleRequestL(AddActivity, activity);)
+ return errNo;
}
// -----------------------------------------------------------------------------
@@ -65,8 +67,8 @@
//
int HsActivityDbClientPrivate::updateActivity(const QVariantHash &activity)
{
- TRAPD( errNo, execSimpleRequestL(UpdateActivity, activity);)
- return errNo;
+ TRAPD(errNo, execSimpleRequestL(UpdateActivity, activity);)
+ return errNo;
}
// -----------------------------------------------------------------------------
@@ -75,8 +77,8 @@
//
int HsActivityDbClientPrivate::removeActivity(const QVariantHash &activity)
{
- TRAPD( errNo, execSimpleRequestL(RemoveActivity, activity);)
- return errNo;
+ TRAPD(errNo, execSimpleRequestL(RemoveActivity, activity);)
+ return errNo;
}
// -----------------------------------------------------------------------------
@@ -85,8 +87,8 @@
//
int HsActivityDbClientPrivate::removeApplicationActivities(const QVariantHash &activity)
{
- TRAPD( errNo, execSimpleRequestL(RemoveApplicationActivities, activity);)
- return errNo;
+ TRAPD(errNo, execSimpleRequestL(RemoveApplicationActivities, activity);)
+ return errNo;
}
// -----------------------------------------------------------------------------
@@ -103,8 +105,8 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityDbClientPrivate::applicationActivities(QList<QVariantHash>& result,
- const QVariantHash & condition)
+int HsActivityDbClientPrivate::applicationActivities(QList<QVariantHash>& result,
+ const QVariantHash &condition)
{
TRAPD(errNo, applicationActivitiesL(result, condition));
return errNo;
@@ -117,7 +119,7 @@
//
int HsActivityDbClientPrivate::waitActivity(const QVariantHash &activity)
{
- TRAPD( errNo, waitActivityL(activity);)
+ TRAPD(errNo, waitActivityL(activity);)
return errNo;
}
@@ -127,7 +129,7 @@
//
int HsActivityDbClientPrivate::launchActivity(const QVariantHash &activity)
{
- TRAPD( errNo, execSimpleRequestL(LaunchActivity, activity);)
+ TRAPD(errNo, execSimpleRequestL(LaunchActivity, activity);)
return errNo;
}
@@ -148,18 +150,18 @@
{
RProcess server;
const TUidType uid(KNullUid, KNullUid, KActivityServerUid);
- User::LeaveIfError(server.Create( KActivityServerName, KNullDesC, uid));
+ User::LeaveIfError(server.Create(KActivityServerName, KNullDesC, uid));
TRequestStatus stat;
- server.Rendezvous( stat );
- if ( stat != KRequestPending ) {
+ server.Rendezvous(stat);
+ if (stat != KRequestPending) {
server.Kill(0);
} else {
server.Resume();
}
User::WaitForRequest(stat);
- int errNo = (EExitPanic == server.ExitType()) ?
+ int errNo = (EExitPanic == server.ExitType()) ?
KErrGeneral : stat.Int();
- if(KErrCancel == errNo) {
+ if (KErrCancel == errNo) {
errNo = KErrNone;
}
server.Close();
@@ -174,20 +176,21 @@
{
const int asyncMessageSlots(4);
const int maxRetry(4);
-
+
TInt retry = maxRetry;
TInt errNo(KErrNone);
do {
- errNo = CreateSession( KActivityServerName, TVersion( 0, 0, 0 ), asyncMessageSlots );
- if( KErrNotFound != errNo && KErrServerTerminated != errNo) {
+ errNo = CreateSession(KActivityServerName, TVersion(0, 0, 0), asyncMessageSlots);
+ if (KErrNotFound != errNo && KErrServerTerminated != errNo) {
retry =0;
} else {
TRAP(errNo, startServerL());
if (KErrNone != errNo && KErrAlreadyExists != errNo) {
retry =0;
+ errNo = CreateSession(KActivityServerName, TVersion(0, 0, 0), asyncMessageSlots);
}
}
- } while(--retry > 0);
+ } while (--retry > 0);
User::LeaveIfError(errNo);
}
@@ -209,7 +212,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivityDbClientPrivate::requestedActivityNameL(QString& result,
+void HsActivityDbClientPrivate::requestedActivityNameL(QString &result,
const QVariantHash &activity)
{
RBuf8 data;
@@ -218,11 +221,11 @@
data.CreateL(256);
data << activity;
User::LeaveIfError(SendReceive(RequestedActivityName, TIpcArgs(&data,&sizeBuf)));
- if(sizeBuf() > data.MaxSize()) {
- data.ReAlloc(sizeBuf());
+ if (sizeBuf() > data.MaxSize()) {
+ data.ReAlloc(sizeBuf());
}
User::LeaveIfError(SendReceive(GetData, TIpcArgs(&data)));
- result = QString::fromAscii(reinterpret_cast<const char*>(data.Ptr()),
+ result = QString::fromAscii(reinterpret_cast<const char *>(data.Ptr()),
data.Length());
CleanupStack::PopAndDestroy(&data);
}
@@ -238,8 +241,8 @@
CleanupClosePushL(data);
data.CreateL(256);
User::LeaveIfError(SendReceive(Activities, TIpcArgs(&data, &sizeBuf)));
- if(sizeBuf() > data.MaxSize()) {
- data.ReAlloc(sizeBuf());
+ if (sizeBuf() > data.MaxSize()) {
+ data.ReAlloc(sizeBuf());
}
User::LeaveIfError(SendReceive(GetData, TIpcArgs(&data)));
result << data;
@@ -250,7 +253,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivityDbClientPrivate::applicationActivitiesL(QList<QVariantHash>& result,
+void HsActivityDbClientPrivate::applicationActivitiesL(QList<QVariantHash>& result,
const QVariantHash & condition)
{
RBuf8 data;
@@ -259,8 +262,8 @@
data.CreateL(256);
data << condition;
User::LeaveIfError(SendReceive(ApplicationActivities, TIpcArgs(&data, &sizeBuf)));
- if(sizeBuf() > data.MaxSize()) {
- data.ReAlloc(sizeBuf());
+ if (sizeBuf() > data.MaxSize()) {
+ data.ReAlloc(sizeBuf());
}
User::LeaveIfError(SendReceive(GetData, TIpcArgs(&data)));
result << data;
@@ -273,7 +276,7 @@
//
void HsActivityDbClientPrivate::waitActivityL(const QVariantHash &activity)
{
- if(mAsyncDataHandler->IsActive()) {
+ if (mAsyncDataHandler->IsActive()) {
User::Leave(KErrServerBusy);
} else {
mAsyncDataHandler->waitActivity(activity);
@@ -284,7 +287,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivityDbClientPrivate::getData(RBuf8& data)
+void HsActivityDbClientPrivate::getData(RBuf8 &data)
{
SendReceive(GetData, TIpcArgs(&data));
}
@@ -299,3 +302,26 @@
{
SendReceive(func, data, status);
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+int HsActivityDbClientPrivate::getThumbnail(QPixmap &dst, const QString & src)
+{
+ 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());
+ }
+ User::LeaveIfError(SendReceive(GetData, TIpcArgs(&data)));
+ dst << data;
+ CleanupStack::PopAndDestroy(&data);
+ return 0;
+}
--- a/activityfw/activitydatabase/hsactivitydbclient/src/hsactivitydbclient.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbclient/src/hsactivitydbclient.cpp Mon May 03 12:48:45 2010 +0300
@@ -21,8 +21,8 @@
//
// -----------------------------------------------------------------------------
//
-HsActivityDbClient::HsActivityDbClient(QObject* obj)
-:
+HsActivityDbClient::HsActivityDbClient(QObject *obj)
+ :
QObject(obj),
d_ptr(0)
{
@@ -51,16 +51,16 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivityDbClient::asyncRequestCompleated(int result,
+void HsActivityDbClient::asyncRequestCompleated(int result,
int requestType,
const QString& data)
{
- switch(requestType){
- case WaitActivity:
- if( KErrNone == result ) {
- emit activityRequested(data);
- }
- break;
+ switch (requestType) {
+ case WaitActivity:
+ if (KErrNone == result) {
+ emit activityRequested(data);
+ }
+ break;
}
}
@@ -90,7 +90,7 @@
{
return d_ptr->removeActivity(activity);
}
-
+
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
@@ -113,8 +113,8 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityDbClient::applicationActivities(QList<QVariantHash> & result,
- const QVariantHash & conditions)
+int HsActivityDbClient::applicationActivities(QList<QVariantHash> & result,
+ const QVariantHash &conditions)
{
return d_ptr->applicationActivities(result, conditions);
}
@@ -136,3 +136,12 @@
{
return d_ptr->launchActivity(activity);
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+int HsActivityDbClient::getThumbnail(QPixmap &dst, const QString & src)
+{
+ return d_ptr->getThumbnail(dst, src);
+}
--- a/activityfw/activitydatabase/hsactivitydbserver/hsactivitydbserver.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/hsactivitydbserver.pro Mon May 03 12:48:45 2010 +0300
@@ -44,6 +44,13 @@
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
+
}
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivityserver.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivityserver.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -32,23 +32,23 @@
* Constructor
* @param storage - reference to initialized activity storage
*/
- HsActivityServer(HsActivityDbClientInterface& storage);
-
+ HsActivityServer(HsActivityDbClientInterface &storage);
+
/**
* Destructor
*/
~HsActivityServer();
-
+
/**
* Function establish server and initialize listening proces
- * @return true on succees, false otherwise
+ * @return true on succees, false otherwise
*/
bool start();
private:
/**
* Private server implementation
*/
- HsActivityServerPrivate* d_ptr;
+ HsActivityServerPrivate *d_ptr;
};
#endif //HSACTIVITYSERVER_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivitystorage.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivitystorage.h Mon May 03 12:48:45 2010 +0300
@@ -29,24 +29,24 @@
* 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 &)
@@ -58,26 +58,26 @@
* @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,
+ 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 &)
@@ -88,6 +88,6 @@
* Private storage implementation
* Own.
*/
- HsActivityStoragePrivate* d_ptr;
+ HsActivityStoragePrivate *d_ptr;
};
#endif //HSACTIVITYSTORAGE_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivitystorage_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/inc/hsactivitystorage_p.h Mon May 03 12:48:45 2010 +0300
@@ -21,7 +21,7 @@
/**
* Class implements HsActivityDbClientInterface and storage functionality using
- * database subsystem
+ * database subsystem
*/
class HsActivityStoragePrivate: public HsActivityDbClientInterface
{
@@ -30,61 +30,61 @@
* 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 &)
- */
+ /**
+ * 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,
+ 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 &)
@@ -96,50 +96,50 @@
* @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
+ * @return SQL query error code
*/
- int getSqlErrorCode(const QSqlQuery& query);
-
+ int getSqlErrorCode(const QSqlQuery &query);
+
/**
* Function exeute SQL query
- * @param query - SQL
+ * @param query - SQL
* @return true on succees, false otherwise
*/
- bool exec(QSqlQuery& query);
-
+ bool exec(QSqlQuery &query);
+
/**
* Function exeute SQL query
* @param query - SQL query that has to be executed
* @return true on succees, false otherwise
*/
- bool exec(const QString &query, const QVariantHash& params);
-
+ bool exec(const QString &query, const QVariantHash ¶ms);
+
/**
* Funciton bind provided filtering rules with prepared SQL query
- * @param query - 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());
-
+ void bind(QSqlQuery &query,
+ const QVariantHash &activity,
+ const QVariantHash &additionalData = QVariantHash());
+
/**
* Funciton get records that match conditions
- * @param result - output destination
+ * @param result - output destination
* @param query - SQL query sting
* @param conditions - query conditions
*/
- int activities(QList<QVariantHash> &results,
+ int activities(QList<QVariantHash> &results,
const QString &query,
const QVariantHash &conditions);
--- a/activityfw/activitydatabase/hsactivitydbserver/s60/inc/hsactivityserver_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/s60/inc/hsactivityserver_p.h Mon May 03 12:48:45 2010 +0300
@@ -24,53 +24,53 @@
/**
* Class implemets server functionality for S60 enviroment
*/
-class HsActivityServerPrivate : public CServer2
+class HsActivityServerPrivate : public CServer2
{
public:
/**
* Constructor
*/
- HsActivityServerPrivate(HsActivityDbClientInterface& storage);
-
+ HsActivityServerPrivate(HsActivityDbClientInterface &storage);
+
/**
* Destructor
*/
~HsActivityServerPrivate();
-
+
/**
* Function establish server and initialize listening proces
- * @return true on succees, false otherwise
+ * @return true on succees, false otherwise
*/
bool start();
-
+
/**
- * Function look for active application session and complete pending message
+ * Function look for active application session and complete pending message
*/
- void notifyL(int applicationId, const QString& activityName);
-
+ void notifyL(int applicationId, const QString &activityName);
+
/**
- * Cancel notification
+ * Cancel notification
*/
void cancelNotify(int applicationId);
-
+
/**
* Function add item to pending messages
*/
- void waitNotification(int applicationId, const RMessage2& msg);
+ 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;
+ CSession2 *NewSessionL(const TVersion &version,const RMessage2 &message)const;
private:
/**
* Reference to initialized storage client
*/
- HsActivityDbClientInterface& mStorage;
-
+ HsActivityDbClientInterface &mStorage;
+
QHash<int,RMessage2> mPendingMessage;
};
--- a/activityfw/activitydatabase/hsactivitydbserver/s60/inc/hsactivitysession_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/s60/inc/hsactivitysession_p.h Mon May 03 12:48:45 2010 +0300
@@ -19,8 +19,9 @@
#define ACTIVITYSESSIONPRIVATE_H
#include <e32base.h>
#include "hsactivitydbclientinterface.h"
+
/**
- * Class impolements client session for S60 enviroment.
+ * Class impolements client session for S60 enviroment.
* Class is responsible for request handling and data translations
*/
class HsActivitySessionPrivate: public CSession2
@@ -30,122 +31,130 @@
* Constructor
* @param storage - reference to initialized activity storage
*/
- HsActivitySessionPrivate(HsActivityDbClientInterface& storage);
-
+ HsActivitySessionPrivate(HsActivityDbClientInterface &storage);
+
/**
* Destructor
*/
~HsActivitySessionPrivate();
-
+
/**
* Implements interface
* @see void CSession2::ServiceL(const RMessage2&)
*/
- void ServiceL(const RMessage2& message);
-
+ 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);
+
+ 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
+ * @param message - request message
*/
- void HandleAddActivityL(const RMessage2& 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
+ * @param message - request message
*/
- void HandleUpdateActivityL(const RMessage2& 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
+ * @param message - request message
*/
- void HandleRemoveActivityL(const RMessage2& 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
+ * @param message - request message
*/
- void HandleRemoveApplicationActivitiesL(const RMessage2& 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
+ * @param message - request message
*/
- void HandleActivitiesL(const RMessage2& 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
+ * @param message - request message
*/
- void HandleApplicationActivitiesL(const RMessage2& message);
-
+ void HandleApplicationActivitiesL(const RMessage2 &message);
+
/**
* Function handle data translation and forward request to server
* Function can leave on failure.
- * @param message - request message
+ * @param message - request message
*/
- void HandleLaunchActivityL(const RMessage2& message);
-
+ void HandleLaunchActivityL(const RMessage2 &message);
+
/**
* Function handle data translation and forward request to server
* Function can leave on failure.
- * @param message - request message
+ * @param message - request message
*/
- void HandleWaitActivityL(const RMessage2& message);
+ void HandleWaitActivityL(const RMessage2 &message);
+
+ /**
+ * Function cancels subscribtion
+ * @param message - request message
+ */
+ void HandleCancelWaitActivity(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
+ * @param message - request message
*/
- void HandleGetDataL(const RMessage2& message);
-
+ void HandleGetDataL(const RMessage2 &message);
+
void LaunchActivityL();
+
+ void WaitActivityL(const RMessage2 &message);
- 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);
-
+ void ReadDataL(const RMessage2 &src);
+
/**
* Function handle data translation and forward request to storage client
* Function can leave on failure.
- * @param message - request message
+ * @param message - request message
*/
void LeaveIfNotZero(int errNo);
private:
/**
* Reference to storage client
*/
- HsActivityDbClientInterface& mStorage;
+ HsActivityDbClientInterface &mStorage;
RBuf8 mData;
QVariantHash mActivity;
QList<QVariantHash> mResult;
--- a/activityfw/activitydatabase/hsactivitydbserver/s60/src/hsactivityserver_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/s60/src/hsactivityserver_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -22,9 +22,9 @@
//
// -----------------------------------------------------------------------------
//
-HsActivityServerPrivate::HsActivityServerPrivate(HsActivityDbClientInterface& storage)
-:
- CServer2( EPriorityNormal, ESharableSessions),
+HsActivityServerPrivate::HsActivityServerPrivate(HsActivityDbClientInterface &storage)
+ :
+ CServer2(EPriorityNormal, ESharableSessions),
mStorage(storage)
{
}
@@ -43,19 +43,19 @@
//
bool HsActivityServerPrivate::start()
{
- return ( KErrNone == Start(KActivityServerName) );
+ return (KErrNone == Start(KActivityServerName));
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
-void HsActivityServerPrivate::notifyL(int applicationId,
- const QString& activityName)
+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 );
+ 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));
}
}
@@ -64,10 +64,10 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivityServerPrivate::waitNotification(int applicationId,
- const RMessage2& msg)
+void HsActivityServerPrivate::waitNotification(int applicationId,
+ const RMessage2 &msg)
{
- if(mPendingMessage.find(applicationId) != mPendingMessage.end()) {
+ if (mPendingMessage.find(applicationId) != mPendingMessage.end()) {
msg.Kill(EBadMessageNumber);
}
mPendingMessage.insert(applicationId,msg);
@@ -77,21 +77,20 @@
// -----------------------------------------------------------------------------
//
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));
- }
- }
+{
+ 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
+CSession2 *HsActivityServerPrivate::NewSessionL(const TVersion &,
+ const RMessage2&)const
{
- return new (ELeave) HsActivitySessionPrivate(mStorage);
+ return new(ELeave) HsActivitySessionPrivate(mStorage);
}
--- a/activityfw/activitydatabase/hsactivitydbserver/s60/src/hsactivitysession_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/s60/src/hsactivitysession_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -19,14 +19,13 @@
#include "hsactivityglobals.h"
#include "hsserializer.h"
#include <qglobal.h>
-
-const char ActivityPrimaryKeyFormat [] = "%1:%2";
+#include <qpixmap.h>
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
-HsActivitySessionPrivate::HsActivitySessionPrivate(HsActivityDbClientInterface& storage)
-: mStorage(storage), mAppId(KErrNotFound)
+HsActivitySessionPrivate::HsActivitySessionPrivate(HsActivityDbClientInterface &storage)
+ : mStorage(storage), mAppId(KErrNotFound)
{
}
@@ -36,34 +35,56 @@
//
HsActivitySessionPrivate::~HsActivitySessionPrivate()
{
- CancelNotify();
- mData.Close();
+ CancelNotify();
+ mData.Close();
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::ServiceL(const RMessage2& message)
+void HsActivitySessionPrivate::ServiceL(const RMessage2 &message)
{
mActivity.clear();
mResult.clear();
mName.clear();
-
- int errNo(KErrNone);
- switch(message.Function()) {
- case AddActivity: HandleAddActivityL(message); break;
- case UpdateActivity: HandleUpdateActivityL(message); break;
- case RemoveActivity: HandleRemoveActivityL(message); break;
- case RemoveApplicationActivities: HandleRemoveApplicationActivitiesL(message); break;
- case Activities: HandleActivitiesL(message);break;
- case ApplicationActivities: HandleApplicationActivitiesL(message);break;
- case LaunchActivity: HandleLaunchActivityL(message);break;
- case WaitActivity: HandleWaitActivityL(message);return; //!!!!! This message shouldn't be compleated !!!!!
- case GetData: HandleGetDataL(message); break;
- case CancelWait: HandleCancelWaitActivity(message); break;
- default:
- message.Panic(KErr400, CServer2::EBadMessageNumber);
+
+ 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);
}
@@ -81,7 +102,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::HandleAddActivityL(const RMessage2& message)
+void HsActivitySessionPrivate::HandleAddActivityL(const RMessage2 &message)
{
ReadDataL(message);
LeaveIfNotZero(mStorage.addActivity(mActivity));
@@ -91,7 +112,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::HandleUpdateActivityL(const RMessage2& message)
+void HsActivitySessionPrivate::HandleUpdateActivityL(const RMessage2 &message)
{
ReadDataL(message);
LeaveIfNotZero(mStorage.updateActivity(mActivity));
@@ -101,7 +122,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::HandleRemoveActivityL(const RMessage2& message)
+void HsActivitySessionPrivate::HandleRemoveActivityL(const RMessage2 &message)
{
ReadDataL(message);
LeaveIfNotZero(mStorage.removeActivity(mActivity));
@@ -111,7 +132,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::HandleRemoveApplicationActivitiesL(const RMessage2& message)
+void HsActivitySessionPrivate::HandleRemoveApplicationActivitiesL(const RMessage2 &message)
{
ReadDataL(message);
LeaveIfNotZero(mStorage.removeApplicationActivities(mActivity));
@@ -121,7 +142,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::HandleActivitiesL(const RMessage2& message)
+void HsActivitySessionPrivate::HandleActivitiesL(const RMessage2 &message)
{
int errNo(KErrNone);
QT_TRYCATCH_LEAVING(errNo = mStorage.activities(mResult));
@@ -135,7 +156,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::HandleApplicationActivitiesL(const RMessage2& message)
+void HsActivitySessionPrivate::HandleApplicationActivitiesL(const RMessage2 &message)
{
int errNo(KErrNone);
ReadDataL(message);
@@ -150,7 +171,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::HandleLaunchActivityL(const RMessage2& message)
+void HsActivitySessionPrivate::HandleLaunchActivityL(const RMessage2 &message)
{
ReadDataL(message);
LaunchActivityL();
@@ -160,7 +181,7 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::HandleWaitActivityL(const RMessage2& message)
+void HsActivitySessionPrivate::HandleWaitActivityL(const RMessage2 &message)
{
ReadDataL(message);
WaitActivityL(message);
@@ -170,16 +191,26 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::HandleCancelWaitActivity(const RMessage2& /*message*/)
- {
- CancelNotify();
- }
+void HsActivitySessionPrivate::HandleGetThumbnailL(const RMessage2 &message)
+{
+ ReadDataL(message);
+ GetThumbnailL(message);
+}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::HandleGetDataL(const RMessage2& message)
+void HsActivitySessionPrivate::HandleCancelWaitActivity(const RMessage2& /*message*/)
+{
+ CancelNotify();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void HsActivitySessionPrivate::HandleGetDataL(const RMessage2 &message)
{
message.WriteL(0, mData);
}
@@ -190,25 +221,25 @@
//
void HsActivitySessionPrivate::LaunchActivityL()
{
- CServer2* const server(const_cast<CServer2*>(Server()));
- if(mActivity.end() == mActivity.find(ActivityApplicationKeyword) ||
- mActivity.end() == mActivity.find(ActivityActivityKeyword)) {
+ 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());
+ static_cast<HsActivityServerPrivate *>
+ (server)->notifyL(mActivity.find(ActivityApplicationKeyword).value().toInt(),
+ mActivity.find(ActivityActivityKeyword).value().toString());
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::LaunchActivityL(const RMessage2 &message,
- const QString &name )
+void HsActivitySessionPrivate::LaunchActivityL(const RMessage2 &message,
+ const QString &name)
{
- if (mData.MaxSize() < name.toAscii().length()){
- mData.ReAlloc( name.toAscii().length());
+ if (mData.MaxSize() < name.toAscii().length()) {
+ mData.ReAlloc(name.toAscii().length());
}
mData.Copy(reinterpret_cast<const TUint8*>(name.toAscii().data()),
name.toAscii().length());
@@ -220,15 +251,29 @@
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::WaitActivityL(const RMessage2& msg)
+void HsActivitySessionPrivate::WaitActivityL(const RMessage2 &msg)
{
- CServer2* const server(const_cast<CServer2*>(Server()));
- if(mActivity.end() == mActivity.find(ActivityApplicationKeyword)) {
+ 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);
+ 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);
}
// -----------------------------------------------------------------------------
@@ -236,36 +281,35 @@
// -----------------------------------------------------------------------------
//
void HsActivitySessionPrivate::CancelNotify()
- {
- if ( mAppId != KErrNotFound )
- {
- CServer2* const server(const_cast<CServer2*>(Server()));
- static_cast<HsActivityServerPrivate*>(server)->cancelNotify(mAppId);
- mAppId = KErrNotFound;
- }
- }
+{
+ 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::CancelNotify(RMessage2 &message)
+{
+ message.Complete(KErrCancel);
+}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
-void HsActivitySessionPrivate::ReadDataL(const RMessage2& src)
+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);
+ src.ReadL(0, buffer, 0);
if (buffer.Length() != srcLength) {
User::Leave(KErrCorrupt);
}
--- a/activityfw/activitydatabase/hsactivitydbserver/s60/src/main.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/s60/src/main.cpp Mon May 03 12:48:45 2010 +0300
@@ -28,34 +28,34 @@
#include "hsactivitystorage.h"
class HsActivityMainAppUi : public QS60MainAppUi
- {
+{
public:
TBool FrameworkCallsRendezvous() const {
return EFalse;
}
- };
+};
class HsActivityMainDocument : public QS60MainDocument
- {
+{
public:
- HsActivityMainDocument(CEikApplication &mainApplication):QS60MainDocument(mainApplication){}
-
+ HsActivityMainDocument(CEikApplication &mainApplication):QS60MainDocument(mainApplication) {}
+
CEikAppUi *CreateAppUiL() {
- return (static_cast <CEikAppUi*>(new(ELeave)HsActivityMainAppUi));
+ return (static_cast <CEikAppUi *>(new(ELeave)HsActivityMainAppUi));
}
- };
+};
class HsActivityApplication : public QS60MainApplication
- {
+{
protected:
CApaDocument *CreateDocumentL() {
- return new (ELeave) HsActivityMainDocument(*this);
- }
- };
+ return new(ELeave) HsActivityMainDocument(*this);
+ }
+};
CApaApplication *newHsActivityApplication()
{
- return new HsActivityApplication;
+ return new HsActivityApplication;
}
int main(int argc, char *argv[])
@@ -64,20 +64,20 @@
HsActivityStorage storage;
HsActivityServer server(storage);
int retVal(KErrGeneral);
- if( server.start() ){
- CEikonEnv * env = CEikonEnv::Static();
- if ( env ) {
- CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(env->WsSession());
+ 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
+ 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.
+ rootWindowGroup.SetOrdinalPosition(-1, ECoeWinPriorityNormal); //move to background.
CleanupStack::PopAndDestroy();
- }
+ }
RProcess::Rendezvous(KErrNone);
retVal = app.exec();
- }else
+ } else
RProcess::Rendezvous(retVal);
return retVal;
}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/hsactivityserver.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/hsactivityserver.cpp Mon May 03 12:48:45 2010 +0300
@@ -21,8 +21,8 @@
//
// -----------------------------------------------------------------------------
//
-HsActivityServer::HsActivityServer(HsActivityDbClientInterface& storage)
-:
+HsActivityServer::HsActivityServer(HsActivityDbClientInterface &storage)
+ :
d_ptr(new HsActivityServerPrivate(storage))
{
}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/hsactivitystorage.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/hsactivitystorage.cpp Mon May 03 12:48:45 2010 +0300
@@ -22,8 +22,8 @@
// -----------------------------------------------------------------------------
//
HsActivityStorage::HsActivityStorage()
-:
-d_ptr(new HsActivityStoragePrivate())
+ :
+ d_ptr(new HsActivityStoragePrivate())
{
}
@@ -40,7 +40,7 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityStorage::addActivity(const QVariantHash& activity)
+int HsActivityStorage::addActivity(const QVariantHash &activity)
{
return d_ptr->addActivity(activity);
}
@@ -49,7 +49,7 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityStorage::updateActivity(const QVariantHash& activity)
+int HsActivityStorage::updateActivity(const QVariantHash &activity)
{
return d_ptr->updateActivity(activity);
}
@@ -58,7 +58,7 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityStorage::removeActivity(const QVariantHash& activity)
+int HsActivityStorage::removeActivity(const QVariantHash &activity)
{
return d_ptr->removeActivity(activity);
}
@@ -67,7 +67,7 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityStorage::removeApplicationActivities(const QVariantHash& activity)
+int HsActivityStorage::removeApplicationActivities(const QVariantHash &activity)
{
return d_ptr->removeApplicationActivities(activity);
}
@@ -77,7 +77,7 @@
// -----------------------------------------------------------------------------
//
int HsActivityStorage::activities(QList<QVariantHash>& result)
-{
+{
return d_ptr->activities(result);
}
@@ -85,7 +85,7 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityStorage::applicationActivities(QList<QVariantHash>& result,
+int HsActivityStorage::applicationActivities(QList<QVariantHash>& result,
const QVariantHash &activity)
{
return d_ptr->applicationActivities(result, activity);
--- a/activityfw/activitydatabase/hsactivitydbserver/src/hsactivitystorage_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/hsactivitystorage_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -37,12 +37,12 @@
settings.setValue(ActivityStorageProperty, ActivityDefaultStorage);
}
QString databaseFile = settings.value(ActivityStorageProperty).toString();
-
+
if (QSqlDatabase::contains(ActivityStorageName)) {
mConn = QSqlDatabase::database(ActivityStorageName);
- } else {
+ } else {
mConn = QSqlDatabase::addDatabase(ActivityStorageDriver, ActivityStorageName);
- mConn.setDatabaseName(databaseFile);
+ mConn.setDatabaseName(databaseFile);
if (!mConn.open()) {
qWarning(qPrintable(mConn.lastError().text()));
return;
@@ -72,13 +72,13 @@
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()) {
+ if (query.next()) {
return KErrGeneral;
}
query.prepare(ActivityInsertActivityQuery);
@@ -99,7 +99,7 @@
QByteArray streamedData;
QDataStream stream(&streamedData, QIODevice::WriteOnly);
stream << activity;
-
+
// update
QSqlQuery query(mConn);
query.prepare(ActivityUpdateActivityQuery);
@@ -131,8 +131,8 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityStoragePrivate::requestedActivityName(QString& result,
- const QVariantHash &activity)
+int HsActivityStoragePrivate::requestedActivityName(QString &result,
+ const QVariantHash &activity)
{
QSqlQuery query(mConn);
query.prepare(ActivitySelectActiveQuery);
@@ -159,8 +159,8 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityStoragePrivate::applicationActivities(QList<QVariantHash> & result,
- const QVariantHash & condition)
+int HsActivityStoragePrivate::applicationActivities(QList<QVariantHash> & result,
+ const QVariantHash &condition)
{
return activities(result, ActivityApplicationActivitiesQuery, condition);
}
@@ -188,7 +188,7 @@
//
bool HsActivityStoragePrivate::checkTables()
{
- return (QStringList("Activities") == mConn.tables());
+ return (QStringList("Activities") == mConn.tables());
}
// -----------------------------------------------------------------------------
@@ -202,34 +202,34 @@
qErrnoWarning(qPrintable(mConn.lastError().text()));
return;
}
-
+
// drop any existing tables
QSqlQuery query(mConn);
- foreach (const QString &tableName, mConn.tables()) {
+ 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)
+int HsActivityStoragePrivate::getSqlErrorCode(const QSqlQuery &query)
{
const QSqlError err(query.lastError());
const QString errStr(err.text());
-
+
if (QSqlError ::NoError == err.type()) {
return 0;
} else {
@@ -242,7 +242,7 @@
//
// -----------------------------------------------------------------------------
//
-bool HsActivityStoragePrivate::exec(QSqlQuery& query)
+bool HsActivityStoragePrivate::exec(QSqlQuery &query)
{
const bool retVal = query.exec();
qErrnoWarning(qPrintable(query.lastQuery()));
@@ -256,30 +256,30 @@
//
// -----------------------------------------------------------------------------
//
-bool HsActivityStoragePrivate::exec(const QString &queryStr, const QVariantHash& params)
+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)
+void HsActivityStoragePrivate::bind(QSqlQuery &query,
+ const QVariantHash &activity,
+ const QVariantHash &additionalData)
{
const QChar tag(' ');
- QString queryString( query.lastQuery() );
+ QString queryString(query.lastQuery());
QVariantHash::const_iterator iter;
int offset(0);
QStringList tokens;
-
- //explode SQL query to tokens
+
+ //explode SQL query to tokens
do {
offset = queryString.indexOf(tag, 0);
if (0 < offset) {
@@ -292,24 +292,24 @@
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()) ){
+ 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) {
+ for (iter = additionalData.constBegin();
+ iter != additionalData.constEnd();
+ ++iter) {
if ((*token).contains(iter.key())) {
query.bindValue(iter.key(), iter.value());
break;
@@ -322,12 +322,12 @@
//
// -----------------------------------------------------------------------------
//
-int HsActivityStoragePrivate::activities(QList<QVariantHash> &results,
- const QString &queryStr,
- const QVariantHash &conditions)
+int HsActivityStoragePrivate::activities(QList<QVariantHash> &results,
+ const QString &queryStr,
+ const QVariantHash &conditions)
{
results.clear();
-
+
QSqlQuery query(mConn);
query.prepare(queryStr);
bind(query, conditions);
--- a/activityfw/activitydatabase/hsactivitydbserver/src/main.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/hsactivitydbserver/src/main.cpp Mon May 03 12:48:45 2010 +0300
@@ -20,15 +20,22 @@
#include "hsactivityserver.h"
#include "hsactivitystorage.h"
-
+#ifdef Q_OS_SYMBIAN
+#include <coemain.h>
+#include <coedef.h>
+#endif
int main(int argc, char *argv[])
{
+#ifdef Q_OS_SYMBIAN
+ CCoeEnv::Static()->RootWin().SetOrdinalPosition(0, ECoeWinPriorityNeverAtFront);
+#endif
+
QCoreApplication app(argc, argv);
HsActivityStorage storage;
HsActivityServer server(storage);
int retVal(KErrGeneral);
- if( server.start() ){
+ if (server.start()) {
retVal = app.exec();
}
return retVal;
--- a/activityfw/activitydatabase/inc/hsactivitydbclientinterface.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/inc/hsactivitydbclientinterface.h Mon May 03 12:48:45 2010 +0300
@@ -21,8 +21,7 @@
/**
* Enumerate supported functions
*/
-enum ClientFunctions
-{
+enum ClientFunctions {
AddActivity =0,
UpdateActivity,
RemoveActivity,
@@ -32,72 +31,74 @@
ApplicationActivities,
WaitActivity,
LaunchActivity,
+ GetThumbnail,
GetData,
CancelWait
};
const char ActivityApplicationKeyword [] = ":ApplicationId";
const char ActivityActivityKeyword [] = ":ActivityName";
+const char ActivityScreenshotKeyword [] = "screenshot";
class HsActivityDbClientInterface
{
public:
-
+
/**
* Function save provided avtivity in activity storage
* @param activity - activity to store
- * @return 0 on succees, error code otherwise
+ * @return 0 on succees, error code otherwise
*/
virtual int addActivity(const QVariantHash &activity) =0;
-
+
/**
* Function update exiting activity
* @param activity - filtering rules
- * @return 0 on succees, error code otherwise
+ * @return 0 on succees, error code otherwise
*/
virtual int updateActivity(const QVariantHash &activity) =0;
-
+
/**
* Function delete activity
* @param activity - filtering rules
- * @return 0 on succees, error code otherwise
+ * @return 0 on succees, error code otherwise
*/
virtual int removeActivity(const QVariantHash &activity) =0;
-
+
/**
* Function delete activity for application
* @param activity - filtering rules
- * @return 0 on succees, error code otherwise
+ * @return 0 on succees, error code otherwise
*/
virtual int removeApplicationActivities(const QVariantHash &activity) =0;
-
+
/**
* Function return list of all activity
* @param result - destination list
- * @return 0 on succees, error code otherwise
+ * @return 0 on succees, error code otherwise
*/
virtual int activities(QList<QVariantHash>& result) =0;
-
+
/**
* Function return list of all activity
* @param result - destination list,
* @param activity - filtering rules
- * @return 0 on succees, error code otherwise
+ * @return 0 on succees, error code otherwise
*/
- virtual int applicationActivities(QList<QVariantHash>& result,
+ virtual int applicationActivities(QList<QVariantHash>& result,
const QVariantHash &activity) =0;
-
+
/**
* Function subscribe to activity
* @param activity - filtering rules
- * @return 0 on succees, error code otherwise
+ * @return 0 on succees, error code otherwise
*/
virtual int waitActivity(const QVariantHash &activity)=0;
-
+
/**
* Function launch application activity
- * @param activity - filtering rules
- * @return 0 on succees, error code otherwise
+ * @param activity - filtering rules
+ * @return 0 on succees, error code otherwise
*/
virtual int launchActivity(const QVariantHash &activity)=0;
};
--- a/activityfw/activitydatabase/s60/inc/hsactivityglobals.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/s60/inc/hsactivityglobals.h Mon May 03 12:48:45 2010 +0300
@@ -19,8 +19,8 @@
#include <e32base.h>
const TUid KActivityServerUid = {0x200267B4};
-_LIT( KActivityServerName, "hsactivitydbserver" );
-_LIT( KErr400, "Bad Reqest" );
-_LIT( KErr403, "Access denied" );
+_LIT(KActivityServerName, "hsactivitydbserver");
+_LIT(KErr400, "Bad Reqest");
+_LIT(KErr403, "Access denied");
#endif
--- a/activityfw/activitydatabase/s60/inc/hsserializer.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/s60/inc/hsserializer.h Mon May 03 12:48:45 2010 +0300
@@ -11,30 +11,40 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef HSSERIALIZER_H
#define HSSERIALIZER_H
#include <qvariant.h>
+#include <qpixmap.h>
+/**
+ * Operator serialize QPixmap to RBuf8
+ */
+RBuf8 &operator <<(RBuf8 &dst, const QPixmap &src);
+
+/**
+ * Operator deserialize TDesc8 to QPixmap
+ */
+QPixmap &operator <<(QPixmap &dst, const TDesC8 &src);
/**
* Operator serialize VarinatHash to RBuf8
*/
-RBuf8& operator <<(RBuf8& dst, const QVariantHash& src);
+RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src);
/**
* Operator deserialize RBuf8 to VarinatHash
*/
-QVariantHash& operator <<(QVariantHash& dst, const TDesC8& src);
+QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src);
/**
* Operator serialize QList<QVariantHash> to RBuf8
*/
-RBuf8& operator <<(RBuf8& dst, const QList<QVariantHash>& src);
+RBuf8 &operator <<(RBuf8 &dst, const QList<QVariantHash>& src);
/**
* Operator deserialize RBuf8 to QList<QVariantHash>
*/
-QList<QVariantHash>& operator <<(QList<QVariantHash>& dst, const TDesC8& src);
+QList<QVariantHash>& operator <<(QList<QVariantHash>& dst, const TDesC8 &src);
#endif
--- a/activityfw/activitydatabase/s60/src/hsserializer.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitydatabase/s60/src/hsserializer.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#include "hsserializer.h"
@@ -20,15 +20,15 @@
//
// -----------------------------------------------------------------------------
//
-RBuf8& operator <<(RBuf8& dst, const QVariantHash& src)
+RBuf8 &operator <<(RBuf8 &dst, const QPixmap &src)
{
QByteArray buffer;
QDataStream stream(&buffer, QIODevice::WriteOnly);
-
+
QT_TRYCATCH_LEAVING(stream << src);
const int dataLength(buffer.length());
- const unsigned char* dataPtr(reinterpret_cast<const unsigned char*>(buffer.constData()));
- if( dst.MaxLength() < dataLength ) {
+ const unsigned char *dataPtr(reinterpret_cast<const unsigned char *>(buffer.constData()));
+ if (dst.MaxLength() < dataLength) {
dst.ReAllocL(dataLength);
}
dst.Copy(dataPtr, dataLength);
@@ -39,11 +39,11 @@
//
// -----------------------------------------------------------------------------
//
-QVariantHash& operator <<(QVariantHash& dst, const TDesC8& src)
+QPixmap &operator <<(QPixmap &dst, const TDesC8 &src)
{
- QByteArray buffer( QByteArray::fromRawData(reinterpret_cast<const char*>(src.Ptr()),
- src.Length()) );
-
+ QByteArray buffer(QByteArray::fromRawData(reinterpret_cast<const char *>(src.Ptr()),
+ src.Length()) );
+
QDataStream stream(&buffer, QIODevice::ReadOnly);
QT_TRYCATCH_LEAVING(stream >> dst);
return dst;
@@ -53,17 +53,18 @@
//
// -----------------------------------------------------------------------------
//
-RBuf8& operator <<(RBuf8& dst, const QList<QVariantHash>& src)
+RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src)
{
QByteArray buffer;
QDataStream stream(&buffer, QIODevice::WriteOnly);
-
+
QT_TRYCATCH_LEAVING(stream << src);
-
- if( dst.MaxLength() < buffer.length() ) {
- dst.ReAllocL(buffer.length());
+ const int dataLength(buffer.length());
+ const unsigned char *dataPtr(reinterpret_cast<const unsigned char *>(buffer.constData()));
+ if (dst.MaxLength() < dataLength) {
+ dst.ReAllocL(dataLength);
}
- dst.Copy(reinterpret_cast<const TUint8*>(buffer.data()), buffer.length());
+ dst.Copy(dataPtr, dataLength);
return dst;
}
@@ -71,12 +72,44 @@
//
// -----------------------------------------------------------------------------
//
-QList<QVariantHash>& operator <<(QList<QVariantHash>& dst, const TDesC8& src)
+QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src)
{
- QByteArray buffer(QByteArray::fromRawData(reinterpret_cast<const char*>(src.Ptr()),
- src.Length()));
-
+ QByteArray buffer(QByteArray::fromRawData(reinterpret_cast<const char *>(src.Ptr()),
+ src.Length()) );
+
QDataStream stream(&buffer, QIODevice::ReadOnly);
QT_TRYCATCH_LEAVING(stream >> dst);
return dst;
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RBuf8 &operator <<(RBuf8 &dst, const QList<QVariantHash>& src)
+{
+ QByteArray buffer;
+ QDataStream stream(&buffer, QIODevice::WriteOnly);
+
+ QT_TRYCATCH_LEAVING(stream << src);
+
+ if (dst.MaxLength() < buffer.length()) {
+ dst.ReAllocL(buffer.length());
+ }
+ dst.Copy(reinterpret_cast<const TUint8 *>(buffer.data()), buffer.length());
+ return dst;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+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);
+ return dst;
+}
--- a/activityfw/activityfw.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityfw.pro Mon May 03 12:48:45 2010 +0300
@@ -21,7 +21,6 @@
symbian:SUBDIRS += activitydatabase
SUBDIRS += activityserviceplugin \
- activitylauncher \
orbitintegration/hbactivityplugin
--- a/activityfw/activitylauncher/activitylauncherview.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitylauncher/activitylauncherview.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#include "activitylauncherview.h"
@@ -35,25 +35,25 @@
{
QServiceManager serviceManager;
mActivityManager = serviceManager.loadInterface("com.nokia.qt.activities.ActivityManager");
-
+
if (!mActivityManager) {
qFatal("Cannot initialize critical com.nokia.qt.activities.ActivityManager service");
}
// create UI
setTitle(tr("Activity launcher"));
- QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
- QGraphicsLinearLayout* statusLayout = new QGraphicsLinearLayout(Qt::Horizontal);
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
+ QGraphicsLinearLayout *statusLayout = new QGraphicsLinearLayout(Qt::Horizontal);
mStatusLabel = new HbLabel(this);
mStatusLabel->setAlignment(Qt::AlignLeft);
statusLayout->setMaximumHeight(15);
- HbLabel* statusHeader = new HbLabel("Status: ");
+ HbLabel *statusHeader = new HbLabel("Status: ");
statusHeader->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
statusLayout->addItem(statusHeader);
statusLayout->addItem(mStatusLabel);
- HbGridView* activities = new HbGridView();
+ HbGridView *activities = new HbGridView();
connect(activities, SIGNAL(activated(QModelIndex)), this, SLOT(itemPressed(QModelIndex)));
activities->setRowCount(1);
activities->setColumnCount(1);
@@ -73,7 +73,7 @@
ActivityLauncherView::~ActivityLauncherView()
{
- delete mActivityManager;
+ delete mActivityManager;
}
void ActivityLauncherView::getActivitiesList()
@@ -84,13 +84,13 @@
mModel->clear();
foreach(const QVariantHash& activityEntry, mCurrentActivities) {
- QStandardItem* newItem = new QStandardItem(QIcon(activityEntry.value("screenshot").value<QPixmap>()), QString("%1").arg(activityEntry.value(ActivityActivityKeyword).toInt()));
+ QStandardItem *newItem = new QStandardItem(QIcon(activityEntry.value("screenshot").value<QPixmap>()), QString("%1").arg(activityEntry.value(ActivityActivityKeyword).toInt()));
mModel->invisibleRootItem()->appendRow(newItem);
}
mStatusLabel->setPlainText(QString("Ready (%1 activities)").arg(mCurrentActivities.count()));
}
-bool ActivityLauncherView::eventFilter(QObject* obj, QEvent* event)
+bool ActivityLauncherView::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::ApplicationActivate) {
getActivitiesList();
@@ -98,7 +98,7 @@
return QObject::eventFilter(obj, event);
}
-void ActivityLauncherView::itemPressed(const QModelIndex& index)
+void ActivityLauncherView::itemPressed(const QModelIndex &index)
{
QVariantHash activity = mCurrentActivities.at(index.row());
int applicationId = activity.value(ActivityApplicationKeyword).toInt();
--- a/activityfw/activitylauncher/activitylauncherview.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitylauncher/activitylauncherview.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef ACTIVITYLAUNCHERVIEW_H
@@ -22,7 +22,7 @@
class HbLabel;
class QStandardItemModel;
-
+
class ActivityLauncherView : public HbView
{
Q_OBJECT
@@ -32,20 +32,20 @@
~ActivityLauncherView();
private slots:
- void itemPressed(const QModelIndex& index);
+ void itemPressed(const QModelIndex &index);
protected:
- bool eventFilter(QObject* obj, QEvent* event);
+ bool eventFilter(QObject *obj, QEvent *event);
private:
void getActivitiesList();
private:
- QStandardItemModel* mModel;
+ QStandardItemModel *mModel;
QList<QVariantHash> mCurrentActivities;
- HbLabel* mStatusLabel;
-
- QObject* mActivityManager;
+ HbLabel *mStatusLabel;
+
+ QObject *mActivityManager;
};
#endif // ACTIVITYLAUNCHERVIEW_H
--- a/activityfw/activitylauncher/main.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activitylauncher/main.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -24,12 +24,12 @@
int main(int argc, char *argv[])
{
- HbApplication app(argc, argv);
+ HbApplication app(argc, argv);
HbMainWindow mainWindow;
ActivityLauncherView mainView;
mainWindow.addView(&mainView);
mainWindow.show();
- return app.exec();
+ return app.exec();
}
--- a/activityfw/activityserviceplugin/activityclient.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activityclient.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -55,3 +55,8 @@
{
return d_ptr->waitActivity();
}
+
+QVariantHash ActivityClient::parseCommandLine(const QStringList &commandLineParams) const
+{
+ return d_ptr->parseCommandLine(commandLineParams);
+}
--- a/activityfw/activityserviceplugin/activityclient.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activityclient.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef ACTIVITYCLIENT_H
@@ -26,7 +26,7 @@
class ActivityClient : public QObject
{
-Q_OBJECT
+ Q_OBJECT
public:
ActivityClient(QObject *parent = 0);
@@ -39,14 +39,15 @@
QList<QVariantHash> activities() const;
QVariant activityData(const QString &activityId) const;
bool waitActivity();
+ QVariantHash parseCommandLine(const QStringList &commandLineParams) const;
signals:
void activityRequested(const QString &activityId);
-
+
private:
ActivityClientPrivate *d_ptr;
friend class ActivityClientPrivate;
-
+
};
#endif // ACTIVITYCLIENT_H
--- a/activityfw/activityserviceplugin/activityclient_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activityclient_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#include "activityclient_p.h"
@@ -19,14 +19,18 @@
#include "activitydatastorage.h"
#include <hsactivitydbclient.h>
+#include <QCoreApplication>
#include <QStringList>
#include <QTimer>
+#include <QUrl>
+#include <QDebug>
+#include <QDir>
-ActivityClientPrivate::ActivityClientPrivate(ActivityClient *q) : QObject(q)
+ActivityClientPrivate::ActivityClientPrivate(ActivityClient *q) : QObject(q), isconnected(false)
{
mDataStorage = new ActivityDataStorage();
mServerClient = new HsActivityDbClient();
- mServerClient->connect();
+ isconnected = ( KErrNone == mServerClient->connect());
connect(mServerClient, SIGNAL(activityRequested(QString)), q, SIGNAL(activityRequested(QString)));
}
@@ -38,66 +42,118 @@
bool ActivityClientPrivate::addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters)
{
- QVariantHash activity(parameters);
- mDataStorage->addActivity(activityId, data);
- RProcess process;
-
- activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
- activity.insert(ActivityActivityKeyword, activityId);
- mServerClient->addActivity(activity);
-
+ 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);
+ }
// @todo make those operations atomic
// @todo return real result
- return true;
+ return isconnected;
}
bool ActivityClientPrivate::removeActivity(const QString &activityId)
{
- QVariantHash activity;
- RProcess process;
- activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
- activity.insert(ActivityActivityKeyword, activityId);
- mDataStorage->removeActivity(activityId);
- mServerClient->removeActivity(activity);
+ 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);
+ }
// @todo make those operations atomic
// @todo return real result
- return true;
+ return isconnected;
}
bool ActivityClientPrivate::updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters)
{
- QVariantHash activity(parameters);
- RProcess process;
- activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
- activity.insert(ActivityActivityKeyword, activityId);
- mDataStorage->updateActivity(activityId, data);
- mServerClient->updateActivity(activity);
+ 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);
+ }
// @todo make those operations atomic
// @todo return real result
- return true;
+ return isconnected;
}
QList<QVariantHash> ActivityClientPrivate::activities() const
{
- QVariantHash activity;
- RProcess process;
- activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
-
QList<QVariantHash> activities;
-
- mServerClient->applicationActivities(activities, activity);
+ if (isconnected) {
+ QVariantHash activity;
+ RProcess process;
+ activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
+ mServerClient->applicationActivities(activities, activity);
+ }
return activities;
}
QVariant ActivityClientPrivate::activityData(const QString &activityId) const
{
- return mDataStorage->activityData(activityId);
+ return isconnected ? mDataStorage->activityData(activityId) : QVariant();
}
bool ActivityClientPrivate::waitActivity()
{
- RProcess process;
- QVariantHash activity;
- activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
- return !mServerClient->waitActivity(activity);
+ bool retVal(isconnected);
+ if (isconnected) {
+ RProcess process;
+ QVariantHash activity;
+ activity.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
+ retVal = !mServerClient->waitActivity(activity);
+ }
+ return retVal;
}
+
+QVariantHash ActivityClientPrivate::parseCommandLine(const QStringList &commandLineParams) const
+{
+ QVariantHash activityParams;
+ int activityMarkerIndex = commandLineParams.indexOf("-activity");
+ if (activityMarkerIndex != -1 && commandLineParams.count() - 1 > activityMarkerIndex) {
+ QUrl activityUri(commandLineParams.at(activityMarkerIndex+1));
+ if (activityUri.scheme() == "appto") {
+ QList<QPair<QString, QString> > parameters = activityUri.queryItems();
+ for (QList<QPair<QString, QString> >::const_iterator i = parameters.constBegin(); i != parameters.constEnd(); ++i) {
+ activityParams.insert(i->first, i->second);
+ }
+
+ if (activityParams.contains("activityname") && !activityParams.value("activityname").toString().isEmpty()) {
+ return activityParams;
+ }
+ }
+ }
+ return QVariantHash();
+}
+
+void ActivityClientPrivate::registerThumbnail(const QString &name, QVariantHash &activity)
+{
+ QVariantHash::const_iterator findIterator(activity.constFind(ActivityScreenshotKeyword));
+ if (activity.constEnd() != findIterator &&
+ findIterator.value().canConvert<QPixmap>()) {
+ const QString thumbnailManagerName = thumbnailName(name);
+ if (findIterator.value().value<QPixmap>().save(thumbnailManagerName)) {
+ activity.insert(ActivityScreenshotKeyword, thumbnailManagerName);
+ } else {
+ activity.remove(ActivityScreenshotKeyword);
+ }
+ }
+}
+
+QString ActivityClientPrivate::thumbnailName(const QString &activityId) const
+{
+ return QDir::toNativeSeparators(qApp->applicationDirPath() +
+ "/" +
+ QString::number(qHash(activityId), 16) +
+ ".png");
+}
--- a/activityfw/activityserviceplugin/activityclient_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activityclient_p.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef ACTIVITYCLIENT_P_H
@@ -26,11 +26,10 @@
class ActivityDataStorage;
class ActivityServerClient;
class HsActivityDbClient;
-
-class ActivityClientPrivate : public QObject
+class ActivityClientPrivate : public QObject
{
-Q_OBJECT
+ Q_OBJECT
public:
ActivityClientPrivate(ActivityClient *q);
@@ -43,12 +42,16 @@
QList<QVariantHash> activities() const;
QVariant activityData(const QString &activityId) const;
bool waitActivity();
-
-
+ QVariantHash parseCommandLine(const QStringList &commandLineParams) const;
+
private:
- ActivityClient* q_ptr;
- ActivityDataStorage* mDataStorage;
- HsActivityDbClient* mServerClient;
+ void registerThumbnail(const QString &, QVariantHash&);
+ QString thumbnailName(const QString &) const;
+
+private:
+ ActivityDataStorage *mDataStorage;
+ HsActivityDbClient *mServerClient;
+ bool isconnected;
};
#endif // ACTIVITYCLIENT_P_H
--- a/activityfw/activityserviceplugin/activitydatastorage.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activitydatastorage.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#include "activitydatastorage.h"
@@ -28,9 +28,9 @@
QSqlDatabase database;
if (QSqlDatabase::contains(KConnectionName)) {
database = QSqlDatabase::database(KConnectionName);
- } else {
+ } else {
database = QSqlDatabase::addDatabase("QSQLITE", KConnectionName);
- database.setDatabaseName("activitydatastorage.db");
+ database.setDatabaseName("activitydatastorage.db");
if (!database.open()) {
qFatal(qPrintable(database.lastError().text()));
}
@@ -49,13 +49,13 @@
bool ActivityDataStorage::addActivity(const QString &activityId, const QVariant &data)
{
QSqlDatabase database = QSqlDatabase::database(KConnectionName);
-
+
QByteArray streamedData;
{
QDataStream stream(&streamedData, QIODevice::WriteOnly);
stream << data;
- }
-
+ }
+
// insert data
QSqlQuery query(database);
if (!query.prepare("INSERT INTO Activities(Name, Data) VALUES(:Name, :Data)")) {
@@ -67,8 +67,8 @@
if (!query.exec()) {
qCritical(qPrintable(query.lastError().text()));
return false;
- }
-
+ }
+
return true;
}
@@ -86,13 +86,13 @@
bool ActivityDataStorage::updateActivity(const QString &activityId, const QVariant &data)
{
QSqlDatabase database = QSqlDatabase::database(KConnectionName);
-
+
QByteArray streamedData;
{
QDataStream stream(&streamedData, QIODevice::WriteOnly);
stream << data;
- }
-
+ }
+
// update data
QSqlQuery query(database);
if (!query.prepare("UPDATE Activities SET Data = :Data WHERE Name = :Name")) {
@@ -105,7 +105,7 @@
qCritical(qPrintable(query.lastError().text()));
return false;
}
-
+
return query.numRowsAffected() > 0;
}
@@ -117,13 +117,13 @@
qCritical(qPrintable(query.lastError().text()));
return QVariant();
}
-
+
QVariant result;
if (query.next()) {
QByteArray data(query.value(0).toByteArray());
QDataStream stream(&data, QIODevice::ReadOnly);
stream >> result;
- }
+ }
return result;
}
@@ -131,17 +131,17 @@
{
QStringList expectedTables("Activities");
QStringList actualTables = QSqlDatabase::database(KConnectionName).tables();
- return (expectedTables == actualTables);
+ return (expectedTables == actualTables);
}
void ActivityDataStorage::recreateTables()
{
QSqlDatabase database = QSqlDatabase::database(KConnectionName);
-
+
if (!database.transaction()) {
qFatal(qPrintable(database.lastError().text()));
}
-
+
// drop any existing tables
{
QSqlQuery dropQuery(database);
@@ -158,14 +158,14 @@
QString statement(
"CREATE TABLE Activities("
"Name TEXT NOT NULL PRIMARY KEY UNIQUE,"
- "Data BLOB NOT NULL)");
-
+ "Data BLOB NOT NULL)");
+
if (!createQuery.exec(statement)) {
qFatal(qPrintable(createQuery.lastError().text()));
}
}
-
+
if (!database.commit()) {
qFatal(qPrintable(database.lastError().text()));
- }
+ }
}
--- a/activityfw/activityserviceplugin/activitydatastorage.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activitydatastorage.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef ACTIVITYDATASTORAGE_H
@@ -20,23 +20,23 @@
#include <QVariant>
#include <QString>
-class ActivityDataStorage
+class ActivityDataStorage
{
-
+
public:
ActivityDataStorage();
~ActivityDataStorage();
-
+
public:
bool addActivity(const QString &activityId, const QVariant &data);
bool removeActivity(const QString &activityId);
bool updateActivity(const QString &activityId, const QVariant &data);
QVariant activityData(const QString &activityId) const;
-
+
private:
bool checkTables();
void recreateTables();
-
+
};
#endif // ACTIVITYDATASTORAGE_H
--- a/activityfw/activityserviceplugin/activitymanager.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activitymanager.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -26,27 +26,32 @@
{
}
-QList<QVariantHash> ActivityManager::activitiesList()
-{
- return d_ptr->activitiesList();
+QList<QVariantHash> ActivityManager::activitiesList()
+{
+ return d_ptr->activitiesList();
}
void ActivityManager::launchActivity(const QString &uri)
-{
- d_ptr->launchActivity(uri);
+{
+ d_ptr->launchActivity(uri);
}
void ActivityManager::launchActivity(int applicationId, const QString &activityId)
-{
+{
d_ptr->launchActivity(applicationId, activityId);
}
void ActivityManager::removeActivity(int applicationId, const QString &activityId)
-{
+{
d_ptr->removeActivity(applicationId, activityId);
}
void ActivityManager::removeApplicationActivities(int applicationId)
-{
+{
d_ptr->removeApplicationActivities(applicationId);
}
+
+void ActivityManager::getThumbnail(const QString &thumbnailId, void *userData)
+{
+ d_ptr->getThumbnail(thumbnailId, userData);
+}
--- a/activityfw/activityserviceplugin/activitymanager.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activitymanager.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef ACTIVITYMANAGER_H
@@ -20,13 +20,14 @@
#include <QObject>
#include <QVariant>
#include <QList>
+#include <QPixmap>
class ActivityManagerPrivate;
class ActivityManager : public QObject
{
-Q_OBJECT
+ Q_OBJECT
public:
ActivityManager(QObject *parent = 0);
@@ -34,16 +35,19 @@
public slots:
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 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);
+
+signals:
+ void thumbnailReady(QPixmap, void *);
+
private:
ActivityManagerPrivate *d_ptr;
-
+
friend class ActivityManagerPrivate;
-
};
#endif // ACTIVITYMANAGER_H
--- a/activityfw/activityserviceplugin/activitymanager_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activitymanager_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#include "activitymanager_p.h"
@@ -40,7 +40,7 @@
}
void ActivityManagerPrivate::launchActivity(const QString &uri)
-{
+{
// @todo use the same parser as in HbApplicationPrivate (if possible)
QRegExp uriMatcher("^appto://(.+)\\?activityname=(.+)$");
if (uriMatcher.indexIn(uri) != -1) {
@@ -48,15 +48,14 @@
Q_ASSERT(list.count() == 3);
launchActivity(list.at(1).toInt(), list.at(2));
} else {
- qWarning("Activity URI parsing error");
+ qWarning("Activity URI parsing error");
}
}
void ActivityManagerPrivate::launchActivity(int applicationId, const QString &activityId)
-{
-
+{
ApplicationLauncher applicationLauncher;
- if(applicationLauncher.isRunning(applicationId)) {
+ if (applicationLauncher.isRunning(applicationId)) {
QVariantHash activity;
activity.insert(ActivityApplicationKeyword, applicationId);
activity.insert(ActivityActivityKeyword, activityId);
@@ -68,7 +67,7 @@
}
void ActivityManagerPrivate::removeActivity(int applicationId, const QString &activityId)
-{
+{
QVariantHash activity;
activity.insert(ActivityApplicationKeyword, applicationId);
activity.insert(ActivityActivityKeyword, activityId);
@@ -81,3 +80,10 @@
activity.insert(ActivityApplicationKeyword, applicationId);
mServerClient->removeApplicationActivities(activity);
}
+
+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 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activitymanager_p.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef ACTIVITYMANAGER_P_H
@@ -28,7 +28,7 @@
class ActivityManagerPrivate : public QObject
{
-Q_OBJECT
+ Q_OBJECT
public:
ActivityManagerPrivate(ActivityManager *q);
@@ -36,16 +36,15 @@
public slots:
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 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 *);
private:
ActivityManager *q_ptr;
HsActivityDbClient *mServerClient;
-
-
};
#endif // ACTIVITYMANAGER_P_H
--- a/activityfw/activityserviceplugin/activityserviceplugin.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activityserviceplugin.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -24,14 +24,14 @@
#include "activityclient.h"
#include "activitymanager.h"
-QObject* ActivityServicePlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session)
+QObject *ActivityServicePlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session)
{
Q_UNUSED(context);
Q_UNUSED(session);
if (descriptor.interfaceName() == "com.nokia.qt.activities.ActivityClient") {
return new ActivityClient();
- } else if (descriptor.interfaceName() == "com.nokia.qt.activities.ActivityManager") {
+ } else if (descriptor.interfaceName() == "com.nokia.qt.activities.ActivityManager") {
return new ActivityManager();
} else {
return NULL;
--- a/activityfw/activityserviceplugin/activityserviceplugin.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activityserviceplugin.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef ACTIVITYSERVICEPLUGIN_H
@@ -26,10 +26,10 @@
{
Q_OBJECT
Q_INTERFACES(QtMobility::QServicePluginInterface)
-
+
public:
- QObject* createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session);
-
+ QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session);
+
};
#endif //ACTIVITYSERVICEPLUGIN_H
--- a/activityfw/activityserviceplugin/activityserviceplugin.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/activityserviceplugin.pro Mon May 03 12:48:45 2010 +0300
@@ -42,8 +42,11 @@
HEADERS += ./s60/applicationlauncher_p.h
- LIBS += -lhsactivitydbclient \
- -lxqutils \
+ LIBS += -lapparc \
+ -lapgrfx \
+ -lcone \
+ -lhsactivitydbclient \
+ -lxqutils
}
@@ -58,6 +61,8 @@
load(data_caging_paths)
TARGET.EPOCALLOWDLLDATA = 1
TARGET.CAPABILITY = ALL -TCB
+ TARGET.UID3 = 0x200267B2
+
plugin.sources = activityserviceplugin.dll
plugin.path = $$QT_PLUGINS_BASE_DIR
--- a/activityfw/activityserviceplugin/applicationlauncher.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/applicationlauncher.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
--- a/activityfw/activityserviceplugin/applicationlauncher.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/applicationlauncher.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef APPLICATIONLAUNCHER_H
@@ -27,15 +27,15 @@
public:
ApplicationLauncher();
~ApplicationLauncher();
-
-public:
+
+public:
bool isRunning(int applicationId);
void startApplication(int applicationId, const QString &activityId);
void bringToForeground(int applicationId);
-
-private:
+
+private:
ApplicationLauncherPrivate *d_ptr;
-
+
};
#endif // APPLICATIONLAUNCHER_H
--- a/activityfw/activityserviceplugin/s60/activitydatabase_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/s60/activitydatabase_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -34,13 +34,13 @@
{
}
-void ActivityDatabasePrivate::saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata)
+void ActivityDatabasePrivate::saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata)
{
QVariantHash request(activityMetadata);
request.insert(ActivityApplicationKeyword,applicationName);
request.insert(ActivityActivityKeyword,activityName);
mClient.saveActivity(request);
-
+
}
void ActivityDatabasePrivate::deleteActivity(const QString &applicationName, const QString &activityName)
@@ -65,7 +65,7 @@
return retVal;
}
-QList<QVariantHash> ActivityDatabasePrivate::applicationActivitiesList(const QString & applicationName)
+QList<QVariantHash> ActivityDatabasePrivate::applicationActivitiesList(const QString &applicationName)
{
QList<QVariantHash> result;
QVariantHash request;
--- a/activityfw/activityserviceplugin/s60/activitydatabase_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/s60/activitydatabase_p.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef ACTIVITYDATABASE_P_H
@@ -20,24 +20,25 @@
#include <QVariant>
#include <QList>
#include <hsactivitydbclient.h>
-class ActivityDatabasePrivate {
+class ActivityDatabasePrivate
+{
public:
ActivityDatabasePrivate();
~ActivityDatabasePrivate();
-
+
public:
- void saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata);
+ void saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata);
void deleteActivity(const QString &applicationName, const QString &activityName);
- void deleteApplicationActivities(const QString &applicationName);
+ void deleteApplicationActivities(const QString &applicationName);
QList<QVariantHash> allActivitiesList();
- QList<QVariantHash> applicationActivitiesList(const QString &applicationName);
+ QList<QVariantHash> applicationActivitiesList(const QString &applicationName);
QString requestedActivityName(const QString &applicationName);
void setActivityRequestFlag(const QString &applicationName, const QString &activityName);
void clearActivityRequestFlag(const QString &applicationName, const QString &activityName);
-
+
private:
- HsActivityDbClient mClient;
+ HsActivityDbClient mClient;
};
#endif // ACTIVITYDATABASE_P_H
--- a/activityfw/activityserviceplugin/s60/activityserverclient_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/s60/activityserverclient_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
--- a/activityfw/activityserviceplugin/s60/activityserverclient_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/s60/activityserverclient_p.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef ACTIVITYSERVERCLIENT_P_H
@@ -27,7 +27,7 @@
public:
ActivityServerClientPrivate();
-
+
public: // API used by ActivityClient
bool addActivity(const QString &activityId, const QVariantHash ¶meters);
bool removeActivity(const QString &activityId);
@@ -37,11 +37,11 @@
public: // API used by ActivityManager
bool removeActivity(int applicationId, const QString &activityId);
bool removeApplicationActivities(int applicationId);
- QList<QVariantHash> activities();
-
+ QList<QVariantHash> activities();
+
public:
- ActivityServerClient* q_ptr;
-
+ ActivityServerClient *q_ptr;
+
};
#endif // ACTIVITYSERVERCLIENT_P_H
--- a/activityfw/activityserviceplugin/s60/applicationlauncher_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/s60/applicationlauncher_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,14 +11,14 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#include "applicationlauncher_p.h"
#include <apgcli.h>
#include <apacmdln.h>
-#include <APGTASK.H>
+#include <apgtask.h>
#include <eikenv.h>
#include <XQConversions>
@@ -32,33 +32,32 @@
void ApplicationLauncherPrivate::startApplication(int applicationId, const QString &activityId)
{
- QString actId = "\""+activityId+"\"";
+ QString actId = "\""+activityId+"\"";
QString uri = QString("-activity appto://%1?activityname=%2").arg(uint(applicationId), 8, 16, QChar('0')).arg(actId);
-
- QT_TRAP_THROWING(
- {
- HBufC* uriAsDescriptor = XQConversions::qStringToS60Desc(uri);
+
+ QT_TRAP_THROWING( {
+ HBufC *uriAsDescriptor = XQConversions::qStringToS60Desc(uri);
CleanupStack::PushL(uriAsDescriptor);
-
+
RApaLsSession apaLsSession;
User::LeaveIfError(apaLsSession.Connect());
CleanupClosePushL(apaLsSession);
-
+
TApaAppInfo appInfo;
TInt retVal = apaLsSession.GetAppInfo(appInfo, TUid::Uid(applicationId));
-
- if(retVal == KErrNone) {
+
+ if (retVal == KErrNone) {
RProcess application;
User::LeaveIfError(application.Create(appInfo.iFullName, *uriAsDescriptor));
application.Resume();
} else {
// @todo
}
-
+
CleanupStack::PopAndDestroy(&apaLsSession);
CleanupStack::PopAndDestroy(uriAsDescriptor);
}
- );
+ );
}
void ApplicationLauncherPrivate::bringToForeground(int applicationId)
--- a/activityfw/activityserviceplugin/s60/applicationlauncher_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/s60/applicationlauncher_p.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef APPLICATIONLAUNCHER_P_H
@@ -21,12 +21,12 @@
class ApplicationLauncherPrivate
{
-
-public:
+
+public:
bool isRunning(int applicationId);
void startApplication(int applicationId, const QString &activityId);
void bringToForeground(int applicationId);
-
+
};
#endif // APPLICATIONLAUNCHER_P_H
--- a/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -26,9 +26,8 @@
QServiceManager manager;
bool ok = manager.addService(":/activityserviceplugin.xml");
- if ( !ok )
- {
- int err = manager.error();
- qFatal("%d ini", err);
+ if (!ok) {
+ int err = manager.error();
+ qFatal("%d ini", err);
}
}
--- a/activityfw/activityserviceplugin/win/activitydatabase_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/win/activitydatabase_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#include "activitydatabase_p.h"
@@ -38,14 +38,14 @@
QSqlDatabase database;
if (QSqlDatabase::contains(KConnectionName)) {
database = QSqlDatabase::database(KConnectionName);
- } else {
+ } else {
database = QSqlDatabase::addDatabase("QSQLITE", KConnectionName);
- database.setDatabaseName(databaseFile);
+ database.setDatabaseName(databaseFile);
if (!database.open()) {
qFatal(qPrintable(database.lastError().text()));
}
- }
-
+ }
+
if (!checkTables()) {
recreateTables();
}
@@ -56,30 +56,30 @@
QSqlDatabase::database(KConnectionName).close();
}
-void ActivityDatabasePrivate::saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata)
+void ActivityDatabasePrivate::saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata)
{
if (applicationName.isEmpty() || activityName.isEmpty() || activityMetadata.value("screenshot").isNull()) {
qWarning("Activity entry is invalid, aborting save");
return;
}
-
+
QVariantHash activityData(activityMetadata);
activityData.insert(ActivityApplicationKeyword, applicationName);
- activityData.insert(ActivityActivityKeyword, activityName);
-
+ activityData.insert(ActivityActivityKeyword, activityName);
+
// stream whole entry to bytearray
QByteArray streamedData;
{
QDataStream stream(&streamedData, QIODevice::WriteOnly);
stream << activityData;
- }
+ }
QSqlDatabase database = QSqlDatabase::database(KConnectionName);
-
+
if (!database.transaction()) {
qFatal(qPrintable(database.lastError().text()));
}
-
+
// update or insert data
{
QSqlQuery query(database);
@@ -106,13 +106,13 @@
query.bindValue(":Data", streamedData);
if (!query.exec()) {
qFatal(qPrintable(query.lastError().text()));
- }
+ }
}
}
-
+
if (!database.commit()) {
qFatal(qPrintable(database.lastError().text()));
- }
+ }
}
void ActivityDatabasePrivate::deleteActivity(const QString &applicationName, const QString &activityName)
@@ -143,13 +143,13 @@
return activitiesList(QString("SELECT Data FROM Activities WHERE ApplicationName = '%1'").arg(applicationName));
}
-QList<QVariantHash> ActivityDatabasePrivate::activitiesList(const QString& sqlCommand)
-{
+QList<QVariantHash> ActivityDatabasePrivate::activitiesList(const QString &sqlCommand)
+{
QSqlQuery query(QSqlDatabase::database(KConnectionName));
if (!query.exec(sqlCommand)) {
qFatal(qPrintable(query.lastError().text()));
}
-
+
QList<QVariantHash> result;
while (query.next()) {
QVariantHash activityEntry;
@@ -159,7 +159,7 @@
stream >> activityEntry;
}
result.append(activityEntry);
- }
+ }
return result;
}
@@ -169,23 +169,23 @@
if (!query.exec(QString("SELECT ActivityName FROM Activities WHERE ApplicationName = '%1' AND RequestFlag").arg(applicationName))) {
qFatal(qPrintable(query.lastError().text()));
}
-
+
QString result;
if (query.next()) {
result = query.value(0).toString();
- }
+ }
return result;
}
void ActivityDatabasePrivate::setActivityRequestFlag(const QString &applicationName, const QString &activityName)
{
QSqlQuery query(QSqlDatabase::database(KConnectionName));
-
+
// clear old requests for given application
if (!query.exec(QString("UPDATE Activities SET RequestFlag=0 WHERE ApplicationName = '%1'").arg(applicationName))) {
qFatal(qPrintable(query.lastError().text()));
}
-
+
// set new request
if (!query.exec(QString("UPDATE Activities SET RequestFlag=1 WHERE ApplicationName = '%1' AND ActivityName = '%2'").arg(applicationName).arg(activityName))) {
qFatal(qPrintable(query.lastError().text()));
@@ -206,17 +206,17 @@
{
QStringList expectedTables("Activities");
QStringList actualTables = QSqlDatabase::database(KConnectionName).tables();
- return (expectedTables == actualTables);
+ return (expectedTables == actualTables);
}
void ActivityDatabasePrivate::recreateTables()
{
QSqlDatabase database = QSqlDatabase::database(KConnectionName);
-
+
if (!database.transaction()) {
qFatal(qPrintable(database.lastError().text()));
}
-
+
// drop any existing tables
{
QSqlQuery dropQuery(database);
@@ -237,13 +237,13 @@
"RequestFlag BOOL NOT NULL DEFAULT FALSE,"
"Data BLOB NOT NULL,"
"PRIMARY KEY(ActivityName, ApplicationName))");
-
+
if (!createQuery.exec(statement)) {
qFatal(qPrintable(createQuery.lastError().text()));
}
}
-
+
if (!database.commit()) {
qFatal(qPrintable(database.lastError().text()));
- }
+ }
}
--- a/activityfw/activityserviceplugin/win/activitydatabase_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/win/activitydatabase_p.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef ACTIVITYDATABASE_P_H
@@ -20,29 +20,30 @@
#include <QVariant>
#include <QList>
-class ActivityDatabasePrivate {
+class ActivityDatabasePrivate
+{
public:
ActivityDatabasePrivate();
~ActivityDatabasePrivate();
-
+
public:
- void saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata);
+ void saveActivity(const QString &applicationName, const QString &activityName, const QVariantHash &activityMetadata);
void deleteActivity(const QString &applicationName, const QString &activityName);
- void deleteApplicationActivities(const QString &applicationName);
+ void deleteApplicationActivities(const QString &applicationName);
QList<QVariantHash> allActivitiesList();
- QList<QVariantHash> applicationActivitiesList(const QString &applicationName);
+ QList<QVariantHash> applicationActivitiesList(const QString &applicationName);
QString requestedActivityName(const QString &applicationName);
void setActivityRequestFlag(const QString &applicationName, const QString &activityName);
void clearActivityRequestFlag(const QString &applicationName, const QString &activityName);
private:
- QList<QVariantHash> activitiesList(const QString& sqlCommand);
-
+ QList<QVariantHash> activitiesList(const QString &sqlCommand);
+
private:
bool checkTables();
void recreateTables();
-
+
};
#endif // ACTIVITYDATABASE_P_H
--- a/activityfw/activityserviceplugin/win/applicationlauncher_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/win/applicationlauncher_p.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#include "applicationlauncher_p.h"
--- a/activityfw/activityserviceplugin/win/applicationlauncher_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/activityserviceplugin/win/applicationlauncher_p.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
#ifndef APPLICATIONLAUNCHER_P_H
@@ -21,12 +21,12 @@
class ApplicationLauncherPrivate
{
-
-public:
+
+public:
bool isRunning(int applicationId);
void startApplication(int applicationId, const QString &activityId);
void bringToForeground(int applicationId);
-
+
};
#endif // APPLICATIONLAUNCHER_P_H
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -25,7 +25,7 @@
HbActivityPlugin::HbActivityPlugin(QObject *parent) : HbActivityPluginInterface(parent), mActivityClient(0)
{
QServiceManager serviceManager;
-
+
if (serviceManager.findInterfaces("ActivityService").isEmpty()) {
// clean old entries
serviceManager.removeService("ActivityService");
@@ -35,11 +35,11 @@
}
}
- mActivityClient = serviceManager.loadInterface("com.nokia.qt.activities.ActivityClient");
+ mActivityClient = serviceManager.loadInterface("com.nokia.qt.activities.ActivityClient");
if (!mActivityClient) {
qWarning("Cannot initialize critical com.nokia.qt.activities.ActivityClient service.");
}
-
+
connect(mActivityClient, SIGNAL(activityRequested(QString)), this, SIGNAL(activityRequested(QString)));
}
@@ -51,11 +51,11 @@
bool HbActivityPlugin::addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters)
{
bool retVal(false);
- QMetaObject::invokeMethod(mActivityClient,
- "addActivity",
- Q_RETURN_ARG(bool, retVal),
- Q_ARG(QString, activityId),
- Q_ARG(QVariant, data),
+ QMetaObject::invokeMethod(mActivityClient,
+ "addActivity",
+ Q_RETURN_ARG(bool, retVal),
+ Q_ARG(QString, activityId),
+ Q_ARG(QVariant, data),
Q_ARG(QVariantHash, parameters));
return retVal;
}
@@ -63,9 +63,9 @@
bool HbActivityPlugin::removeActivity(const QString &activityId)
{
bool retVal(false);
- QMetaObject::invokeMethod(mActivityClient,
- "removeActivity",
- Q_RETURN_ARG(bool, retVal),
+ QMetaObject::invokeMethod(mActivityClient,
+ "removeActivity",
+ Q_RETURN_ARG(bool, retVal),
Q_ARG(QString, activityId));
return retVal;
}
@@ -73,9 +73,9 @@
bool HbActivityPlugin::updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters)
{
bool retVal(false);
- QMetaObject::invokeMethod(mActivityClient,
- "updateActivity",
- Q_RETURN_ARG(bool, retVal),
+ QMetaObject::invokeMethod(mActivityClient,
+ "updateActivity",
+ Q_RETURN_ARG(bool, retVal),
Q_ARG(QString, activityId),
Q_ARG(QVariant, data),
Q_ARG(QVariantHash, parameters));
@@ -84,8 +84,8 @@
QList<QVariantHash> HbActivityPlugin::activities()
{
QList<QVariantHash> data;
- QMetaObject::invokeMethod(mActivityClient,
- "activities",
+ QMetaObject::invokeMethod(mActivityClient,
+ "activities",
Q_RETURN_ARG(QList<QVariantHash>, data));
return data;
}
@@ -93,8 +93,8 @@
QVariant HbActivityPlugin::activityData(const QString &activityId)
{
QVariant data;
- QMetaObject::invokeMethod(mActivityClient,
- "activityData",
+ QMetaObject::invokeMethod(mActivityClient,
+ "activityData",
Q_RETURN_ARG(QVariant, data),
Q_ARG(QString, activityId));
return data;
@@ -103,10 +103,20 @@
bool HbActivityPlugin::waitActivity()
{
bool retVal(false);
- QMetaObject::invokeMethod(mActivityClient,
- "waitActivity",
+ QMetaObject::invokeMethod(mActivityClient,
+ "waitActivity",
Q_RETURN_ARG(bool, retVal));
return retVal;
}
-Q_EXPORT_PLUGIN2(hbactivityplugin, HbActivityPlugin)
+QVariantHash HbActivityPlugin::parseCommandLine(const QStringList &commandLineParams)
+{
+ QVariantHash retVal;
+ QMetaObject::invokeMethod(mActivityClient,
+ "parseCommandLine",
+ Q_RETURN_ARG(QVariantHash, retVal),
+ Q_ARG(QStringList, commandLineParams));
+ return retVal;
+}
+
+Q_EXPORT_PLUGIN2(hbactivityplugin, HbActivityPlugin)
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -24,11 +24,11 @@
{
Q_OBJECT
Q_INTERFACES(HbActivityPluginInterface)
-
+
public:
HbActivityPlugin(QObject *parent = 0);
~HbActivityPlugin();
-
+
public:
virtual bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters);
virtual bool removeActivity(const QString &activityId);
@@ -36,10 +36,11 @@
virtual QList<QVariantHash> activities();
virtual QVariant activityData(const QString &activityId);
virtual bool waitActivity();
+ virtual QVariantHash parseCommandLine(const QStringList &commandLineParams);
private:
QObject *mActivityClient;
-
+
};
#endif //HBACTIVITYPLUGIN_H
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.pro Mon May 03 12:48:45 2010 +0300
@@ -34,7 +34,7 @@
pluginDep.sources = hbactivityplugin.dll
pluginDep.path = $$QT_PLUGINS_BASE_DIR
DEPLOYMENT += pluginDep
-
+ TARGET.UID3 = 0x200267B1
TARGET.EPOCALLOWDLLDATA = 1
TARGET.CAPABILITY = ALL -TCB
}
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugininterface.h Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugininterface.h Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -31,7 +31,7 @@
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;
@@ -39,10 +39,11 @@
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")
--- a/activityfw/rom/activitymanager_core.iby Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/rom/activitymanager_core.iby Mon May 03 12:48:45 2010 +0300
@@ -21,10 +21,6 @@
file=ABI_DIR\BUILD_DIR\activityserviceplugin.dll SHARED_LIB_DIR\activityserviceplugin.dll
data=\epoc32\data\z\resource\qt\plugins\activityserviceplugin.qtplugin resource\qt\plugins\activityserviceplugin.qtplugin
-file=ABI_DIR\BUILD_DIR\activitylauncher.exe PROGRAMS_DIR\activitylauncher.exe
-data=ZPRIVATE\10003a3f\import\apps\activitylauncher_reg.rsc private\10003a3f\import\apps\activitylauncher_reg.rsc
-data=\epoc32\data\z\resource\apps\activitylauncher.rsc resource\apps\activitylauncher.rsc
-
file=ABI_DIR\BUILD_DIR\hsactivitydbserver.exe PROGRAMS_DIR\hsactivitydbserver.exe
data=ZPRIVATE\10003a3f\import\apps\hsactivitydbserver_reg.rsc private\10003a3f\import\apps\hsactivitydbserver_reg.rsc
data=\epoc32\data\z\resource\apps\hsactivitydbserver.rsc resource\apps\hsactivitydbserver.rsc
--- a/activityfw/sis/activitymanager.pkg Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/sis/activitymanager.pkg Mon May 03 12:48:45 2010 +0300
@@ -31,10 +31,6 @@
"/epoc32/release/armv5/urel/activityserviceplugin.dll"-"!:\sys\bin\activityserviceplugin.dll"
"/epoc32/data/z/resource/qt/plugins/activityserviceplugin.qtplugin"-"!:\resource\qt\plugins\activityserviceplugin.qtplugin"
-"/epoc32/release/armv5/urel/activitylauncher.exe" - "!:\sys\bin\activitylauncher.exe"
-"/epoc32/data/z/resource/apps/activitylauncher.rsc" - "!:\resource\apps\activitylauncher.rsc"
-"/epoc32/data/z/private/10003a3f/import/apps/activitylauncher_reg.rsc" - "!:\private\10003a3f\import\apps\activitylauncher_reg.rsc"
-
"/epoc32/release/armv5/urel/hsactivitydbserver.exe" - "!:\sys\bin\hsactivitydbserver.exe"
"/epoc32/data/z/resource/apps/hsactivitydbserver.rsc" - "!:\resource\apps\hsactivitydbserver.rsc"
"/epoc32/data/z/private/10003a3f/import/apps/hsactivitydbserver_reg.rsc" - "!:\private\10003a3f\import\apps\hsactivitydbserver_reg.rsc"
--- a/activityfw/sis/stubs/activitymanager_stub.pkg Fri Apr 16 15:16:09 2010 +0300
+++ b/activityfw/sis/stubs/activitymanager_stub.pkg Mon May 03 12:48:45 2010 +0300
@@ -32,14 +32,9 @@
;Unique Vendor name
:"Nokia"
-;"" - "Z:\sys\bin\activityserviceinstaller.exe"
"" - "Z:\sys\bin\activityserviceplugin.dll"
"" - "Z:\resource\qt\plugins\activityserviceplugin.qtplugin"
-"" - "Z:\sys\bin\activitylauncher.exe"
-"" - "Z:\resource\apps\activitylauncher.rsc"
-"" - "Z:\private\10003a3f\import\apps\activitylauncher_reg.rsc"
-
"" - "Z:\sys\bin\hsactivitydbserver.exe"
"" - "Z:\resource\apps\hsactivitydbserver.rsc"
"" - "Z:\private\10003a3f\import\apps\hsactivitydbserver_reg.rsc"
Binary file activityfw/sis/stubs/activitymanager_stub.sis has changed
--- a/appfoundation/appfoundation.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/appfoundation/appfoundation.pro Mon May 03 12:48:45 2010 +0300
@@ -16,11 +16,9 @@
TEMPLATE = subdirs
-SUBDIRS+= servicemodel \
- statemodel \
+SUBDIRS+= statemodel \
appruntimemodel
CONFIG += ordered
tests:include(appfoundation_tests.pri)
-
--- a/appfoundation/appfoundation_tests.pri Fri Apr 16 15:16:09 2010 +0300
+++ b/appfoundation/appfoundation_tests.pri Mon May 03 12:48:45 2010 +0300
@@ -14,7 +14,5 @@
# Description:
#
-SUBDIRS += ./appruntimemodel/tsrc \
- ./servicemodel/tsrc \
+SUBDIRS += ./appruntimemodel/tsrc \
./statemodel/tsrc
-
--- a/bagetmodel/bagetmodel.pri Fri Apr 16 15:16:09 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: bagetmodel.pri
-#
-
-HEADERS += ./inc/*.h
-
-SOURCES += ./src/*.cpp
-
-DEPENDPATH += . \
- inc \
- src
-
-INCLUDEPATH += . \
- inc
--- a/bagetmodel/bagetmodel.pro Fri Apr 16 15:16:09 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: bagetmodel.pro
-#
-
-TEMPLATE = lib
-
-include (../common.pri)
-
-symbian: {
-TARGET.UID3 = 0x20027053
-}
-
-DEFINES += BAGETMODEL_LIB
-
-include(bagetmodel.pri)
--- a/bagetmodel/inc/baget.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +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 bagets.
-*
-*/
-
-#ifndef BAGET_H
-#define BAGET_H
-
-#include <QGraphicsWidget>
-
-#include "bagetmodel_global.h"
-
-enum BagetState
-{
- BagetStateConstructed = 0,
- BagetStateRunning,
- BagetStateSuspended,
- BagetStateStopped
-};
-
-class BagetPrivate;
-
-class BAGETMODEL_EXPORT Baget : public QGraphicsWidget
-{
- Q_OBJECT
-
-public:
-
- Baget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
- virtual ~Baget();
-
- BagetState currentState();
-
-public slots:
-
- void start();
- void stop();
- void resume();
- void suspend();
-
-signals:
-
- void faulted();
-
-protected:
-
- virtual bool onStart() = 0;
- virtual bool onStop() = 0;
- virtual bool onResume();
- virtual bool onSuspend();
-
-private:
-
- Q_DISABLE_COPY(Baget)
-
-private:
-
- BagetPrivate * const m_d;
- friend class BagetPrivate;
-
-};
-
-#endif // BAGET_H
--- a/bagetmodel/inc/baget_p.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Private implementation of Baget.
-*
-*/
-
-#ifndef BAGET_P_H
-#define BAGET_P_H
-
-#include "baget.h"
-
-class BagetPrivate
-{
-
-public:
-
- BagetPrivate(Baget * const bagetPublic);
- ~BagetPrivate();
-
- void start();
- void stop();
- void resume();
- void suspend();
-
- BagetState currentState();
-
-private:
-
- Q_DISABLE_COPY(BagetPrivate)
-
-private:
-
- Baget *m_q;
- BagetState mState;
-
-};
-
-#endif // BAGET_P_H
--- a/bagetmodel/inc/bagetfactory.h Fri Apr 16 15:16:09 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: Baget factory.
-*
-*/
-
-#ifndef BAGETFACTORY_H
-#define BAGETFACTORY_H
-
-#include <QObject>
-
-#include "ibagetprovider.h"
-#include "bagetmodel_global.h"
-
-class QPluginLoader;
-
-class BAGETMODEL_EXPORT BagetPluginUnloader : public QObject
-{
- Q_OBJECT
-
-public:
-
- BagetPluginUnloader(QPluginLoader *pluginLoader, QObject *parent = 0);
- ~BagetPluginUnloader();
-
-private:
-
- QPluginLoader *mPluginLoader;
-
-};
-
-class BagetFactoryPrivate;
-
-class BAGETMODEL_EXPORT BagetFactory : public QObject
-{
- Q_OBJECT
-
-public:
-
- BagetFactory(const QString& pluginDirectory, QObject *parent = 0);
- virtual ~BagetFactory();
-
- Baget *createBaget(const BagetToken &token);
-
-private:
-
- Q_DISABLE_COPY(BagetFactory)
-
-private:
-
- BagetFactoryPrivate *m_d;
- friend class BagetFactoryPrivate;
-
-};
-
-#endif // BAGETFACTORY_H
--- a/bagetmodel/inc/bagetfactory_p.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +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: Baget factory's private implementation.
-*
-*/
-
-#ifndef BAGETFACTORY_P_H
-#define BAGETFACTORY_P_H
-
-class BagetFactory;
-
-class BagetFactoryPrivate
-{
-
-public:
-
- BagetFactoryPrivate(const QString& pluginDirectory,
- BagetFactory* bagetFactoryPublic);
- ~BagetFactoryPrivate();
-
- Baget *createBaget(const BagetToken &token);
-
-private:
-
- Q_DISABLE_COPY(BagetFactoryPrivate)
-
-public:
-
- BagetFactory *m_q;
- QString mPluginDirectory;
-
-};
-
-#endif // BAGETFACTORY_P_H
--- a/bagetmodel/inc/bagetmodel_global.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: bagetmodel_global.h
-*
-*/
-
-
-#ifndef BAGEMODEL_GLOBAL_H
-#define BAGEMODEL_GLOBAL_H
-
-#include <qglobal.h>
-
-#ifdef BAGETMODEL_LIB
- #define BAGETMODEL_EXPORT Q_DECL_EXPORT
-#else
- #ifdef BAGETMODEL_TEST
- #define BAGETMODEL_EXPORT
- #else
- #define BAGETMODEL_EXPORT Q_DECL_IMPORT
- #endif
-#endif
-
-#endif // BAGEMODEL_GLOBAL_H
--- a/bagetmodel/inc/ibagetprovider.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +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: Baget provider interface.
-*
-*/
-
-#ifndef IBAGETPROVIDER_H
-#define IBAGETPROVIDER_H
-
-#include <QtPlugin>
-#include <QVariant>
-
-/*!
- \class BagetToken
- \brief Represents a Baget that can be created.
-
- Bagets are located in baget providers. Each provider
- exposes its contained Bagets as baget tokens. A token has all
- the needed information for Baget selection and creation.
-*/
-class BagetToken
-{
-
-public:
-
- /*!
- The name of the library/plugin that contains the Baget.
- */
- QString mLibrary;
-
- /*!
- Uniquely identifies the Baget.
- */
- QString mUri;
-
-};
-
-class Baget;
-
-/*!
- \class IBagetProvider
- \brief Defines a mechanism for retrieving a Baget.
-
- Interface that defines a mechanism for retrieving a Baget.
- Each Baget provider implements this interface.
-*/
-class IBagetProvider
-{
-
-public:
-
- /*!
- Destructor.
- */
- virtual ~IBagetProvider() {}
-
-public:
-
- /*!
- Returns contained Bagets as a list of baget tokens.
- \return Contained Bagets as tokens.
- */
- virtual QList<BagetToken> bagets() = 0;
-
- /*!
- Creates and returns a Baget based on the given token.
- \param token Identifies the Baget to be created.
- \return The created Baget or null in failure cases.
- */
- virtual Baget *createBaget(const BagetToken &token) = 0;
-
-};
-
-Q_DECLARE_METATYPE(BagetToken)
-Q_DECLARE_INTERFACE(IBagetProvider, "com.nokia.baget.ibagetprovider/1.0")
-
-#endif // IBAGETPROVIDER_H
--- a/bagetmodel/src/baget.cpp Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +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 bagets.
-*
-*/
-
-#include "baget.h"
-#include "baget_p.h"
-
-/*!
- \enum BagetState
- Lists states that the baget can be in.
-*/
-
-/*
- \var BagetState BagetStateConstructed
- Baget is in this state right after construction.
-*/
-
-/*
- \var BagetState BagetStateRunning
- Baget is performing regular operations (animations, etc.).
- Baget is set to Running state after a call to start (if previously Constructed or Stopped)
- or resume (if previously Suspended) methods.
- \sa Baget::start()
- \sa Baget::resume()
-*/
-
-/*
- \var BagetState BagetStateSuspended
- Baget operations are suspended (e.g. animation timers stopped).
- Baget is set to Suspended after a call to suspend (if previously Running) method.
- \sa Baget::suspend()
-*/
-
-/*
- \var BagetState BagetStateStopped
- Baget finished all processing and released all resources.
- Baget is set to Stopped after a call to stop (if previously Running or Suspended) method.
- \sa Baget::stop()
-*/
-
-/*!
- \class Baget
- \brief Base class for all Bagets.
-
- Baget (BAckGround widgET) is a widget intended to be displayed in the background
- of an application view. It does not respond to user input. It usually performs some
- animations to make the view more appealing.
- Bagets are intended for use with HbStackedLayout as the bottom most QGraphicsWidget.
- */
-
-/*!
- Constructs a new Baget with \a parent and \a flags.
- */
-Baget::Baget(QGraphicsItem *parent, Qt::WindowFlags flags) :
- QGraphicsWidget(parent, flags), m_d(new BagetPrivate(this))
-{
-}
-
-/*!
- Destructs the class.
- */
-Baget::~Baget()
-{
- delete m_d;
-}
-
-/*!
- \fn void Baget::faulted()
-
- This signal is emitted if a fault occurs when changing Baget's state.
- */
-
-/*!
- Returns the state that the Baget is currently in.
- \return The current state.
- */
-BagetState Baget::currentState()
-{
- return m_d->currentState();
-}
-
-/*!
- Initiates Baget's processing.
- */
-void Baget::start()
-{
- m_d->start();
-}
-
-/*!
- Stops Baget's processing.
- After this call Baget should also free all resources.
- */
-void Baget::stop()
-{
- m_d->stop();
-}
-
-/*!
- Resumes Baget's processing.
- */
-void Baget::resume()
-{
- m_d->resume();
-}
-
-/*!
- Suspends Baget's processing.
- */
-void Baget::suspend()
-{
- m_d->suspend();
-}
-
-/*!
- \fn virtual bool Baget::onStart() = 0
-
- After a call it should start Baget's 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 Baget::onStop() = 0
-
- After a call it should stop Baget's processing and
- free all resources.
- 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 resume Baget's processing.
- 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 Baget::onResume()
-{
- return true;
-}
-
-/*!
- After a call it should suspend Baget's processing.
- 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 Baget::onSuspend()
-{
- return true;
-}
--- a/bagetmodel/src/baget_p.cpp Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +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: Private implementation of Baget.
-*
-*/
-
-#include "baget_p.h"
-
-/*!
- \class BagetPrivate
- \brief Private implementation of Baget.
- */
-
-/*!
- Constructs a new BagetPrivate with \a bagetPublic.
- */
-BagetPrivate::BagetPrivate(Baget * const bagetPublic) :
- m_q(bagetPublic), mState(BagetStateConstructed)
-{
-}
-
-/*!
- Destructs the class.
- */
-BagetPrivate::~BagetPrivate()
-{
-}
-
-/*!
- Manages Baget's start.
- */
-void BagetPrivate::start()
-{
- switch (mState)
- {
- case BagetStateConstructed:
- case BagetStateStopped:
- break;
-
- default:
- return;
- }
-
- mState = BagetStateRunning;
- if (!m_q->onStart()) {
- emit m_q->faulted();
- }
-}
-
-/*!
- Manages Baget's stop.
- */
-void BagetPrivate::stop()
-{
- switch (mState)
- {
- case BagetStateRunning:
- case BagetStateSuspended:
- break;
-
- default:
- return;
- }
-
- mState = BagetStateStopped;
- if (!m_q->onStop()) {
- emit m_q->faulted();
- }
-}
-
-/*!
- Manages Baget's resume.
- */
-void BagetPrivate::resume()
-{
- switch (mState)
- {
- case BagetStateSuspended:
- break;
-
- default:
- return;
- }
-
- mState = BagetStateRunning;
- if (!m_q->onResume()) {
- emit m_q->faulted();
- }
-}
-
-/*!
- Manages Baget's suspend.
- */
-void BagetPrivate::suspend()
-{
- switch (mState)
- {
- case BagetStateRunning:
- break;
-
- default:
- return;
- }
-
- mState = BagetStateSuspended;
- if (!m_q->onSuspend()) {
- emit m_q->faulted();
- }
-}
-
-/*!
- Returns Baget's current state.
- \return The current state.
- */
-BagetState BagetPrivate::currentState()
-{
- return mState;
-}
--- a/bagetmodel/src/bagetfactory.cpp Fri Apr 16 15:16:09 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: Widget factory.
-*
-*/
-
-#include <QDebug>
-#include <QStringList>
-#include <QDir>
-#include <QPluginLoader>
-
-#include "bagetfactory.h"
-#include "bagetfactory_p.h"
-#include "baget.h"
-#include "ibagetprovider.h"
-
-/*!
- \class BagetPluginUnloader
- \brief Unloads plugin and deletes plugin loader.
-
- Holds plugin loader instance and unloads and destroys plugin
- on it's destructor.
- */
-
-/*!
- Constructs a new BagetPluginUnloader with \a pluginLoader and \a parent.
- */
-BagetPluginUnloader::BagetPluginUnloader(QPluginLoader *pluginLoader, QObject *parent) :
- QObject(parent), mPluginLoader(pluginLoader)
-{
-}
-
-/*!
- Destructs the class.
- */
-BagetPluginUnloader::~BagetPluginUnloader()
-{
- if (mPluginLoader) {
- mPluginLoader->unload();
- delete mPluginLoader;
- }
-}
-
-/*!
- \class BagetFactoryPrivate
- \brief Private implementation of the BagetFactory.
- */
-
-/*!
- Constructs a new BagetFactoryPrivate with \a pluginDirectory and \a bagetFactoryPublic.
- */
-BagetFactoryPrivate::BagetFactoryPrivate(const QString& pluginDirectory,
- BagetFactory *bagetFactoryPublic) :
- m_q(bagetFactoryPublic), mPluginDirectory(pluginDirectory)
-{
-}
-
-/*!
- Destructs the class.
- */
-BagetFactoryPrivate::~BagetFactoryPrivate()
-{
-}
-
-/*!
- Creates and returns a Baget based on the given token.
- \param token Identifies the Baget to be created.
- \return The created Baget.
- */
-Baget *BagetFactoryPrivate::createBaget(const BagetToken &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;
- }
-
- IBagetProvider *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<IBagetProvider*>(plugin);
- if (provider) {
- break;
- }
- }
-
- Baget *baget(0);
-
- if (provider) {
- baget = provider->createBaget(token);
- if (!baget) {
- qWarning() << "Baget creation failed.";
- qWarning() << token.mLibrary << "cannot provide" << token.mUri;
- loader->unload();
- delete loader;
- } else {
- // unload plugin once baget gets deleted
- BagetPluginUnloader *unloader = new BagetPluginUnloader(loader);
- unloader->connect(baget, SIGNAL(destroyed()), SLOT(deleteLater()));
- }
- } else {
- qDebug() << "Baget creation failed.";
- qWarning() << token.mLibrary << "- provider not found";
- loader->unload();
- delete loader;
- }
-
- return baget;
-}
-
-/*!
- \class BagetFactory
- \brief Finds and creates baget widgets.
-
- Baget factory creates an instance of a Baget
- based on a BagetToken that is given to it.
- */
-
-/*!
- Constructs a new BagetFactory with \a pluginDirectory and \a parent.
- */
-BagetFactory::BagetFactory(const QString& pluginDirectory, QObject *parent) :
- QObject(parent), m_d(new BagetFactoryPrivate(pluginDirectory, this))
-{
-}
-
-/*!
- Destructs the class.
- */
-BagetFactory::~BagetFactory()
-{
- delete m_d;
-}
-
-/*!
- Creates and returns a Baget based on the given token.
- \param token Identifies the Baget to be created.
- \return The created Baget.
- */
-Baget* BagetFactory::createBaget(const BagetToken &token)
-{
- return m_d->createBaget(token);
-}
--- a/common.pri Fri Apr 16 15:16:09 2010 +0300
+++ b/common.pri Mon May 03 12:48:45 2010 +0300
@@ -81,7 +81,6 @@
$$PWD/homescreensrv_plat/appruntimemodel_api \
$$PWD/homescreensrv_plat/contentstorage_api \
$$PWD/homescreensrv_plat/hswidgetmodel_api \
- $$PWD/homescreensrv_plat/servicemodel_api \
$$PWD/homescreensrv_plat/statemodel_api \
$$PWD/homescreensrv_plat/homescreen_information_api/inc
}
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserver.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserver.h Mon May 03 12:48:45 2010 +0300
@@ -110,7 +110,7 @@
/**
* Returns notifications array
*/
- RPointerArray<CLiwDefaultList>& CCPServer::GetNotifications( );
+ RPointerArray<CLiwDefaultList>& GetNotifications( );
private:
// From CActive
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpliwmap.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpliwmap.cpp Mon May 03 12:48:45 2010 +0300
@@ -827,7 +827,7 @@
{
TBool result( EFalse );
TInt pos( 0 );
- const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, aProperty );
+ iMap->FindFirst( pos, aProperty );
if ( pos != KErrNotFound )
{
result = ETrue;
--- a/contentstorage/bwins/caextendedmenuu.def Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
- ?GetItemIcon@CaMenuIconUtility@@SAPAVCAknIcon@@ABVCCaInnerEntry@@@Z @ 1 NONAME ; class CAknIcon * CaMenuIconUtility::GetItemIcon(class CCaInnerEntry const &)
-
--- a/contentstorage/bwins/camenuu.def Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/bwins/camenuu.def Mon May 03 12:48:45 2010 +0300
@@ -19,4 +19,6 @@
?AddL@CCaStorageProxy@@QAEXPAVCCaInnerEntry@@H@Z @ 18 NONAME ; void CCaStorageProxy::AddL(class CCaInnerEntry *, int)
?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 *)
--- a/contentstorage/bwins/cautilsu.def Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/bwins/cautilsu.def Mon May 03 12:48:45 2010 +0300
@@ -24,68 +24,76 @@
?SetAttributeNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 23 NONAME ; void CCaLocalizationEntry::SetAttributeNameL(class TDesC16 const &)
?GetCount@CCaInnerQuery@@QBEIXZ @ 24 NONAME ; unsigned int CCaInnerQuery::GetCount(void) const
?GetParentId@CCaInnerNotifierFilter@@QBEHXZ @ 25 NONAME ; int CCaInnerNotifierFilter::GetParentId(void) const
- ?GetStringId@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 26 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetStringId(void) const
- ?GetFlags@CCaInnerEntry@@QBEIXZ @ 27 NONAME ; unsigned int CCaInnerEntry::GetFlags(void) const
- ?NewL@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 28 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewL(class TDesC16 const &)
- ?SetParentId@CCaInnerNotifierFilter@@QAEXH@Z @ 29 NONAME ; void CCaInnerNotifierFilter::SetParentId(int)
- ?SetFlagsOn@CCaInnerQuery@@QAEXI@Z @ 30 NONAME ; void CCaInnerQuery::SetFlagsOn(unsigned int)
- ?SetTypeNames@CCaInnerNotifierFilter@@QAEXPAVCDesC16ArrayFlat@@@Z @ 31 NONAME ; void CCaInnerNotifierFilter::SetTypeNames(class CDesC16ArrayFlat *)
- ?NewLC@CCaLocalizationEntry@@SAPAV1@XZ @ 32 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewLC(void)
- ?NewL@CCaInnerNotifierFilter@@SAPAV1@W4TNotifierType@1@@Z @ 33 NONAME ; class CCaInnerNotifierFilter * CCaInnerNotifierFilter::NewL(enum CCaInnerNotifierFilter::TNotifierType)
- ?GetTableName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 34 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetTableName(void) const
- ?GetFlagsOff@CCaInnerQuery@@QBEIXZ @ 35 NONAME ; unsigned int CCaInnerQuery::GetFlagsOff(void) const
- ?InternalizeL@CCaInnerEntry@@QAEXAAVRReadStream@@@Z @ 36 NONAME ; void CCaInnerEntry::InternalizeL(class RReadStream &)
- ?GetAttributeName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 37 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetAttributeName(void) const
- ?GetTUint@MenuUtils@@SAHABVTDesC16@@AAI@Z @ 38 NONAME ; int MenuUtils::GetTUint(class TDesC16 const &, unsigned int &)
- ?AddAttributeL@CCaInnerQuery@@QAEXABVTDesC16@@0@Z @ 39 NONAME ; void CCaInnerQuery::AddAttributeL(class TDesC16 const &, class TDesC16 const &)
- ?Exist@RCaEntryAttrArray@@QAEHABVTDesC16@@@Z @ 40 NONAME ; int RCaEntryAttrArray::Exist(class TDesC16 const &)
- ?AddAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@0@Z @ 41 NONAME ; void CCaInnerEntry::AddAttributeL(class TDesC16 const &, class TDesC16 const &)
- ?GetParentId@CCaInnerQuery@@QBEHXZ @ 42 NONAME ; int CCaInnerQuery::GetParentId(void) const
- ?SetDescriptionL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 43 NONAME ; void CCaInnerEntry::SetDescriptionL(class TDesC16 const &)
- ?SetEntryRole@CCaInnerNotifierFilter@@QAEXW4TEntryRole@@@Z @ 44 NONAME ; void CCaInnerNotifierFilter::SetEntryRole(enum TEntryRole)
- ?GetFlagsOn@CCaInnerQuery@@QBEIXZ @ 45 NONAME ; unsigned int CCaInnerQuery::GetFlagsOn(void) const
- ?GetIconId@CCaInnerEntry@@QBEHXZ @ 46 NONAME ; int CCaInnerEntry::GetIconId(void) const
- ?SetIconDataL@CCaInnerEntry@@QAEXABVTDesC16@@00@Z @ 47 NONAME ; void CCaInnerEntry::SetIconDataL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &)
- ?GetEntryRole@CCaInnerNotifierFilter@@QBE?AW4TEntryRole@@XZ @ 48 NONAME ; enum TEntryRole CCaInnerNotifierFilter::GetEntryRole(void) const
- ?GetId@CCaInnerEntry@@QBEHXZ @ 49 NONAME ; int CCaInnerEntry::GetId(void) const
- ?SetEntryTypeNames@CCaInnerQuery@@QAEXPAVCDesC16ArrayFlat@@@Z @ 50 NONAME ; void CCaInnerQuery::SetEntryTypeNames(class CDesC16ArrayFlat *)
- ?GetNotifierType@CCaInnerNotifierFilter@@QBE?AW4TNotifierType@1@XZ @ 51 NONAME ; enum CCaInnerNotifierFilter::TNotifierType CCaInnerNotifierFilter::GetNotifierType(void) const
- ?ExternalizeL@CCaInnerEntry@@QBEXAAVRWriteStream@@@Z @ 52 NONAME ; void CCaInnerEntry::ExternalizeL(class RWriteStream &) const
- ?SetRole@CCaInnerQuery@@QAEXH@Z @ 53 NONAME ; void CCaInnerQuery::SetRole(int)
- ?GetIcon@CCaInnerEntry@@QBEABUTIconAttributes@1@XZ @ 54 NONAME ; struct CCaInnerEntry::TIconAttributes const & CCaInnerEntry::GetIcon(void) const
- ?NewL@CCaLocalizationEntry@@SAPAV1@XZ @ 55 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewL(void)
- ?InternalizeL@CCaInnerNotifierFilter@@QAEXAAVRReadStream@@@Z @ 56 NONAME ; void CCaInnerNotifierFilter::InternalizeL(class RReadStream &)
- ?InternalizeL@RCaIdsArray@@QAEXAAVRReadStream@@@Z @ 57 NONAME ; void RCaIdsArray::InternalizeL(class RReadStream &)
- ?MarshalDataLC@RCaIdsArray@@QBEPAVHBufC8@@XZ @ 58 NONAME ; class HBufC8 * RCaIdsArray::MarshalDataLC(void) const
- ?GetEntryTypeNames@CCaInnerQuery@@QBEPBVCDesC16ArrayFlat@@XZ @ 59 NONAME ; class CDesC16ArrayFlat const * CCaInnerQuery::GetEntryTypeNames(void) const
- ?SetValueL@CCaEntryAttribute@@QAEXABVTDesC16@@@Z @ 60 NONAME ; void CCaEntryAttribute::SetValueL(class TDesC16 const &)
- ?ExternalizeL@CCaInnerQuery@@QBEXAAVRWriteStream@@@Z @ 61 NONAME ; void CCaInnerQuery::ExternalizeL(class RWriteStream &) const
- ?GetLocalizedString@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 62 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetLocalizedString(void) const
- ?InternalizeL@CCaInnerQuery@@QAEXAAVRReadStream@@@Z @ 63 NONAME ; void CCaInnerQuery::InternalizeL(class RReadStream &)
- ?NewLC@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 64 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewLC(class TDesC16 const &)
- ?GetTypeNames@CCaInnerNotifierFilter@@QBEPAVCDesC16ArrayFlat@@XZ @ 65 NONAME ; class CDesC16ArrayFlat * CCaInnerNotifierFilter::GetTypeNames(void) const
- ?NewL@CCaInnerEntry@@SAPAV1@XZ @ 66 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewL(void)
- ?SetRole@CCaInnerEntry@@QAEXI@Z @ 67 NONAME ; void CCaInnerEntry::SetRole(unsigned int)
- ?NewLC@CCaInnerEntry@@SAPAV1@XZ @ 68 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewLC(void)
- ?SetTableNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 69 NONAME ; void CCaLocalizationEntry::SetTableNameL(class TDesC16 const &)
- ?GetAttributes@CCaInnerEntry@@QBEABVRCaEntryAttrArray@@XZ @ 70 NONAME ; class RCaEntryAttrArray const & CCaInnerEntry::GetAttributes(void) const
- ?GetRowId@CCaLocalizationEntry@@QBEHXZ @ 71 NONAME ; int CCaLocalizationEntry::GetRowId(void) const
- ?SetIdsL@CCaInnerQuery@@QAEXABV?$RArray@H@@@Z @ 72 NONAME ; void CCaInnerQuery::SetIdsL(class RArray<int> const &)
- ?SetFlagsOff@CCaInnerQuery@@QAEXI@Z @ 73 NONAME ; void CCaInnerQuery::SetFlagsOff(unsigned int)
- ?RemoveAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 74 NONAME ; void CCaInnerEntry::RemoveAttributeL(class TDesC16 const &)
- ?GetRole@CCaInnerEntry@@QBEIXZ @ 75 NONAME ; unsigned int CCaInnerEntry::GetRole(void) const
- ?GetIds@CCaInnerQuery@@QBEABV?$RArray@H@@XZ @ 76 NONAME ; class RArray<int> const & CCaInnerQuery::GetIds(void) const
- ?ExternalizeL@RCaEntriesArray@@QBEXAAVRWriteStream@@@Z @ 77 NONAME ; void RCaEntriesArray::ExternalizeL(class RWriteStream &) const
- ?NewL@CCaInnerQuery@@SAPAV1@XZ @ 78 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewL(void)
- ?SetUid@CCaInnerQuery@@QAEXI@Z @ 79 NONAME ; void CCaInnerQuery::SetUid(unsigned int)
- ?GetDescription@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 80 NONAME ; class RBuf16 const & CCaInnerEntry::GetDescription(void) const
- ?GetRole@CCaInnerQuery@@QBEHXZ @ 81 NONAME ; int CCaInnerQuery::GetRole(void) const
- ?GetEntryTypeName@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 82 NONAME ; class RBuf16 const & CCaInnerEntry::GetEntryTypeName(void) const
- ?NewLC@CCaInnerQuery@@SAPAV1@XZ @ 83 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewLC(void)
- ?SetTextL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 84 NONAME ; void CCaInnerEntry::SetTextL(class TDesC16 const &)
- ?SetParentId@CCaInnerQuery@@QAEXH@Z @ 85 NONAME ; void CCaInnerQuery::SetParentId(int)
- ?GetIds@CCaInnerNotifierFilter@@QBE?AV?$RArray@H@@XZ @ 86 NONAME ; class RArray<int> CCaInnerNotifierFilter::GetIds(void) const
- ?SetStringIdL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 87 NONAME ; void CCaLocalizationEntry::SetStringIdL(class TDesC16 const &)
- ?SetTextId@CCaLocalizationEntry@@QAEXI@Z @ 88 NONAME ; void CCaLocalizationEntry::SetTextId(unsigned int)
- ?RemoveAttribute@RCaEntryAttrArray@@QAEXABVTDesC16@@@Z @ 89 NONAME ; void RCaEntryAttrArray::RemoveAttribute(class TDesC16 const &)
+ ?SetId@CCaInnerIconDescription@@QAEXH@Z @ 26 NONAME ; void CCaInnerIconDescription::SetId(int)
+ ?GetStringId@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 27 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetStringId(void) const
+ ?GetFlags@CCaInnerEntry@@QBEIXZ @ 28 NONAME ; unsigned int CCaInnerEntry::GetFlags(void) const
+ ?NewL@CCaInnerIconDescription@@SAPAV1@XZ @ 29 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewL(void)
+ ?NewL@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 30 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewL(class TDesC16 const &)
+ ?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 &)
+ ?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 &)
--- a/contentstorage/caclient/caclient.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/caclient.pro Mon May 03 12:48:45 2010 +0300
@@ -19,8 +19,6 @@
HB = hbcore
MOBILITY = serviceframework
-# temporary solution to solve problems with SF in MW dependency
-qtAddLibrary(QtServiceFramework)
DEFINES += CACLIENT_LIB
@@ -44,17 +42,20 @@
../extinc \
../inc
-LIBS += -lcautils \
- -lcaextendedmenu \
+LIBS += -lavkon \
+ -lcautils \
-lestor \
-lbafl \
-laknicon \
-lcharconv \
-lfbscli \
-lbitgdi \
- -lxqutils
+ -lxqutils \
+ -lsif \
+ -lscrclient \
+ -laknicon
+
include(caclient_s60.pri)
-include(cahandler.pri)
}
win32: {
--- a/contentstorage/caclient/cahandler.pri Fri Apr 16 15:16:09 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:
-#
-
-INCLUDEPATH += ../cahandler/inc \
- ../cahandler/app/inc \
- ../cahandler/url/inc \
- ../cahandler/tapp/inc
-
-HEADERS += ../cahandler/inc/*.h \
- ../cahandler/app/inc/*.h \
- ../cahandler/url/inc/*.h \
- ../cahandler/tapp/inc/catapphandler.h
-
-SOURCES += ../cahandler/app/src/*.cpp \
- ../cahandler/url/src/*.cpp \
- ../cahandler/tapp/src/catapphandler.cpp
-
-LIBS += -lswinstcli \
- -lapgrfx \
- -lws32 \
- -lapparc \
- -lsisregistryclient \
- -leikcore \
- -lcone \
- -lefsrv \
- -lxqservice
-
-
--- a/contentstorage/caclient/inc/caclient_defines.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/inc/caclient_defines.h Mon May 03 12:48:45 2010 +0300
@@ -14,9 +14,10 @@
* Description: caclient_defines.h
*
*/
-
+
const char APPLICATION_UID_ATTRIBUTE_NAME[] = "application:uid";
const char APPLICATION_ENTRY_TYPE_NAME[] = "application";
const char WIDGET_ENTRY_TYPE_NAME[] = "widget";
const char URL_ENTRY_TYPE_NAME[] = "url";
-const char TEMPLATED_APPLICATION_ENTRY_TYPE_NAME[] = "templatedApplication";
\ No newline at end of file
+const char PACKAGE_ENTRY_TYPE_NAME[] = "package";
+const char TEMPLATED_APPLICATION_ENTRY_TYPE_NAME[] = "templatedApplication";
--- a/contentstorage/caclient/inc/caitemmodel_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/inc/caitemmodel_p.h Mon May 03 12:48:45 2010 +0300
@@ -55,7 +55,7 @@
void setIconSize(const QSize &size);
QSize getIconSize() const;
QModelIndex root();
- CaEntry *entry(const QModelIndex &modelIndex) const;
+ QSharedPointer<CaEntry> entry(const QModelIndex &modelIndex) const;
void setSecondLineVisibility(bool secondLineVisibility);
bool secondLineVisibility() const;
QVariant displayRole(const QModelIndex &modelIndex) const;
@@ -75,7 +75,8 @@
void updateParentEntry();
void updateItemData(int id);
void addItem(int id);
- void handleAddItems(QList<int> &itemsList);
+ void addItemBlock(const QList<int> &itemsList);
+ void handleAddItems(const QList<int> &itemsList);
int itemRow(int id);
void removeItem(int id);
void removeItems(const QList<int> &itemsList);
@@ -94,7 +95,7 @@
// data
CaItemModel *const m_q;
- CaEntry *mParentEntry;//own
+ QSharedPointer<CaEntry> mParentEntry;
CaQuery mQuery;
QSharedPointer<CaService> mService;
CaItemModelList mEntries;
--- a/contentstorage/caclient/inc/caitemmodellist.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/inc/caitemmodellist.h Mon May 03 12:48:45 2010 +0300
@@ -41,7 +41,7 @@
~CaItemModelList();
void clear();
int count() const;
- CaEntry *at(int row) const;
+ QSharedPointer<CaEntry> at(int row) const;
void reloadEntries(const CaQuery &query);
void updateEntry(int id);
void updateEntries(const CaQuery &query);
@@ -60,7 +60,7 @@
private: // data
QList<int> mOrderedList;
- QHash<int, CaEntry *> mEntriesHash;
+ QHash<int, QSharedPointer<CaEntry> > mEntriesHash;
QSharedPointer<CaService> mService;
};
--- a/contentstorage/caclient/inc/caservice_p.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/inc/caservice_p.h Mon May 03 12:48:45 2010 +0300
@@ -35,11 +35,11 @@
explicit CaServicePrivate(CaService *servicePublic);
~CaServicePrivate();
- QList<CaEntry *> getEntries(const QList<int> &entryIdList) const;
- QList<CaEntry *> getEntries(const CaQuery &query) const;
+ QList< QSharedPointer<CaEntry> > getEntries(const QList<int> &entryIdList) const;
+ QList< QSharedPointer<CaEntry> > getEntries(const CaQuery &query) const;
QList<int> getEntryIds(const CaQuery &query) const;
- CaEntry *createEntry(const CaEntry &entry);
+ QSharedPointer<CaEntry> createEntry(const CaEntry &entry);
bool removeEntries(const QList<int> &entryIdList);
--- a/contentstorage/caclient/installs_win32.pri Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/installs_win32.pri Mon May 03 12:48:45 2010 +0300
@@ -16,7 +16,7 @@
# take path from common.pri
cadb.path = $$DESTDIR
-cadb.files = ./../castorage/data/castorage.db
+cadb.files = ./../castorage/data/stub/castorage.db
cadb.CONFIG += no_build
INSTALLS += cadb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/s60/inc/cabitmapadapter.h Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef BITMAPADAPTER_H
+#define BITMAPADAPTER_H
+
+// INCLUDES
+
+// CLASS DECLARATION
+#include <QList>
+
+class CFbsBitmap;
+
+/**
+ * CaBitmapAdapter
+ *
+ */
+class CaBitmapAdapter
+{
+public:
+
+ //Static convertion methods between Symbian and Qt objects
+
+ /**
+ * Make bitmap copy, used to get rid of compression for extended bitmap
+ * @param input input bitmap.
+ * @return copied bitmap.
+ */
+ static CFbsBitmap *copyBitmapLC(CFbsBitmap *input);
+
+ /**
+ * Convert bitmap
+ * @param input bitmap.
+ * @return qPixmap.
+ */
+ static QPixmap fromSymbianCFbsBitmap(CFbsBitmap *aBitmap);
+
+ /**
+ * Convert from bitmap and mask to qpixmap
+ * @param input bitmap.
+ * @param pixmap to prepare.
+ * @return void.
+ */
+ static void fromBitmapAndMaskToPixmapL(CFbsBitmap* fbsBitmap, CFbsBitmap* fbsMask, QPixmap& pixmap);
+
+};
+
+#endif // BITMAPADAPTER_H
--- a/contentstorage/caclient/s60/inc/caclientproxy.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/s60/inc/caclientproxy.h Mon May 03 12:48:45 2010 +0300
@@ -108,7 +108,7 @@
* @param sourceList List of results.
* @return error code
*/
- ErrorCode getData(const QList<int> &entryIdList, QList<CaEntry *> &sourceList);
+ ErrorCode getData(const QList<int> &entryIdList, QList< QSharedPointer<CaEntry> > &sourceList);
/**
* Method for fetching entries.
@@ -117,7 +117,7 @@
* @param sourceList List of results.
* @return error code
*/
- ErrorCode getData(const CaQuery &query, QList<CaEntry *> &sourceList);
+ ErrorCode getData(const CaQuery &query, QList< QSharedPointer<CaEntry> > &sourceList);
/**
* Method for fetching entries.
@@ -199,7 +199,7 @@
* @param sourceList list of entries.
*/
void getDataL(const QList<int> &entryIdList,
- QList<CaEntry *> &sourceList);
+ QList< QSharedPointer<CaEntry> > &sourceList);
/**
* Method for fetching entries. Symbian specific.
@@ -207,7 +207,7 @@
* @param sourceList list of entries.
*/
void getDataL(const CaQuery &query,
- QList<CaEntry *> &sourceList);
+ QList< QSharedPointer<CaEntry> > &sourceList);
/**
* Method for fetching entries. Symbian specific.
--- a/contentstorage/caclient/s60/inc/cahandler.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/s60/inc/cahandler.h Mon May 03 12:48:45 2010 +0300
@@ -21,16 +21,17 @@
#include <cadefs.h>
#include <caclient_global.h>
-class CaEntry;
+class CCaInnerEntry;
class QString;
-class CaHandler: public QObject
+class CaHandler
{
- Q_OBJECT
-
public:
- virtual int execute(const CaEntry &entry,
+ virtual ~CaHandler() {}
+ virtual int execute(CCaInnerEntry &innerEntry,
const QString &commandName) = 0;
};
+Q_DECLARE_INTERFACE(CaHandler, "com.nokia.homescreen.ICommandHandler")
+
#endif
--- a/contentstorage/caclient/s60/inc/cahandlerproxy.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/s60/inc/cahandlerproxy.h Mon May 03 12:48:45 2010 +0300
@@ -25,6 +25,7 @@
#include <cadefs.h>
#include "cahandlerloader.h"
+
class CaEntry;
class CaHandlerProxy
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/s60/inc/camenuiconmifutility.h Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef MENUICONMIFUTILITY_H
+#define MENUICONMIFUTILITY_H
+
+// INCLUDES
+
+// CLASS DECLARATION
+#include <cadefs.h>
+
+/**
+ * CaMenuIconMifUtility
+ *
+ */
+class CaMenuIconMifUtility
+{
+public:
+
+ /**
+ * Create pixmap from filename
+ * @param fileName icon filename.
+ * @param icon size.
+ * @param pixmap to fill.
+ * @return void.
+ */
+ static void GetPixmapByFilenameL(TDesC& fileName, const QSize &size,
+ QPixmap& pixmap);
+};
+
+#endif // MENUICONMIFUTILITY_H
--- a/contentstorage/caclient/s60/inc/caobjectadapter.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/s60/inc/caobjectadapter.h Mon May 03 12:48:45 2010 +0300
@@ -22,6 +22,7 @@
// CLASS DECLARATION
#include <QList>
+#include <QSharedPointer>
#include <cadefs.h>
@@ -83,7 +84,7 @@
*/
static void convertL(
const RPointerArray<CCaInnerEntry>& fromEntriesArray,
- QList<CaEntry *>& toEntriesArray);
+ QList< QSharedPointer<CaEntry> > & toEntriesArray);
/**
* Converts QList of ids to RArray of TInts.
@@ -108,13 +109,6 @@
TInt internalErrorCode);
/**
- * Creates icon.
- * @param entry entry.
- * @return HbIcon.
- */
- static HbIcon makeIcon(const CaEntry &entry, const QSize &size);
-
- /**
* Converts notifier type to inner notifier type.
* @param from notifier type.
* @param to resulting inner notifier type.
@@ -149,19 +143,6 @@
int id);
private:
- /**
- * Creates icon. Leaving version.
- * @param entry entry.
- * @return HbIcon.
- */
- static HbIcon makeIconL(const CaEntry &entry, const QSize &size);
-
- /**
- * Make bitmap copy, used to get rid of compression for extended bitmap
- * @param input input bitmap.
- * @return copied bitmap.
- */
- static CFbsBitmap *copyBitmapLC(CFbsBitmap *input);
/**
* Maps a given sort subject and the order to be applied
--- a/contentstorage/caclient/s60/inc/caqtsfhandlerloader.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/s60/inc/caqtsfhandlerloader.h Mon May 03 12:48:45 2010 +0300
@@ -28,8 +28,11 @@
public CaHandlerLoader
{
public:
+ CaQtSfHandlerLoader();
CaHandler *loadHandler(const QString &entryTypeName,
const QString &commandName);
+protected:
+ void registerPlugins() const;
};
#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/s60/src/cabitmapadapter.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,125 @@
+/*
+ * 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 <e32std.h>
+#include <exception>
+#include <e32base.h>
+#include <badesca.h>
+
+#include <fbs.h>
+#include <bitdev.h>
+#include <QPixmap>
+#include <HbIcon>
+#include <QBitmap>
+#include <QDebug>
+#include <XQConversions>
+
+#include "cadef.h"
+#include "cabitmapadapter.h"
+
+static QImage::Format TDisplayMode2Format(TDisplayMode mode)
+{
+ QImage::Format format;
+ switch (mode) {
+ case EGray2:
+ format = QImage::Format_MonoLSB;
+ break;
+ case EColor256:
+ case EGray256:
+ format = QImage::Format_Indexed8;
+ break;
+ case EColor4K:
+ format = QImage::Format_RGB444;
+ break;
+ case EColor64K:
+ format = QImage::Format_RGB16;
+ break;
+ case EColor16M:
+ format = QImage::Format_RGB888;
+ break;
+ case EColor16MU:
+ format = QImage::Format_RGB32;
+ break;
+ case EColor16MA:
+ format = QImage::Format_ARGB32;
+ break;
+ case EColor16MAP:
+ format = QImage::Format_ARGB32_Premultiplied;
+ break;
+ default:
+ format = QImage::Format_Invalid;
+ break;
+ }
+ return format;
+}
+
+QPixmap CaBitmapAdapter::fromSymbianCFbsBitmap(CFbsBitmap *aBitmap)
+{
+ aBitmap->BeginDataAccess();
+ uchar *data = (uchar *)aBitmap->DataAddress();
+ TSize size = aBitmap->SizeInPixels();
+ TDisplayMode displayMode = aBitmap->DisplayMode();
+
+ // QImage format must match to bitmap format
+ QImage image(data, size.iWidth, size.iHeight, TDisplayMode2Format(
+ displayMode));
+ aBitmap->EndDataAccess();
+
+ // No data copying happens because
+ // image format matches native OpenVG format.
+ // So QPixmap actually points to CFbsBitmap data.
+ return QPixmap::fromImage(image);
+}
+
+// -----------------------------------------------------------------------------
+// copying compressed bitmap
+//----------------------------------------------------------------------------
+CFbsBitmap *CaBitmapAdapter::copyBitmapLC(CFbsBitmap *input)
+{
+ CFbsBitmap *bmp = new(ELeave) CFbsBitmap();
+ CleanupStack::PushL(bmp);
+ bmp->Create(input->SizeInPixels(), input->DisplayMode());
+
+ CFbsBitmapDevice *bitmapDevice = CFbsBitmapDevice::NewL(bmp);
+ CleanupStack::PushL(bitmapDevice);
+ CFbsBitGc *bmpGc;
+ bitmapDevice->CreateContext(bmpGc);
+ bmpGc->BitBlt(TPoint(0,0), input);
+ delete bmpGc;
+ CleanupStack::PopAndDestroy(bitmapDevice);
+ return bmp;
+}
+
+void CaBitmapAdapter::fromBitmapAndMaskToPixmapL(CFbsBitmap* fbsBitmap,
+ CFbsBitmap* fbsMask, QPixmap& pixmap)
+{
+ if (fbsBitmap->Header().iCompression == ENoBitmapCompression) {
+ pixmap = CaBitmapAdapter::fromSymbianCFbsBitmap(fbsBitmap);
+ QPixmap mask = CaBitmapAdapter::fromSymbianCFbsBitmap(fbsMask);
+ pixmap.setAlphaChannel(mask);
+ } else { // we need special handling for icons in 9.2 (NGA)
+ // let's hope that in future it will be in QT code
+ CFbsBitmap *temp(NULL);
+ temp = CaBitmapAdapter::copyBitmapLC(fbsBitmap);
+ pixmap = CaBitmapAdapter::fromSymbianCFbsBitmap(temp);
+ CleanupStack::PopAndDestroy();
+ temp = CaBitmapAdapter::copyBitmapLC(fbsMask);
+ QPixmap mask = CaBitmapAdapter::fromSymbianCFbsBitmap(temp);
+ CleanupStack::PopAndDestroy();
+ pixmap.setAlphaChannel(mask);
+ }
+}
--- a/contentstorage/caclient/s60/src/caclientproxy.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/s60/src/caclientproxy.cpp Mon May 03 12:48:45 2010 +0300
@@ -128,7 +128,7 @@
//
//----------------------------------------------------------------------------
ErrorCode CaClientProxy::getData(const QList<int> &entryIdList,
- QList<CaEntry *> &sourceList)
+ QList< QSharedPointer<CaEntry> > &sourceList)
{
TRAPD(error, getDataL(entryIdList, sourceList));
@@ -142,7 +142,7 @@
//
//----------------------------------------------------------------------------
ErrorCode CaClientProxy::getData(const CaQuery &query,
- QList<CaEntry *> &sourceList)
+ QList< QSharedPointer<CaEntry> > &sourceList)
{
TRAPD(error, getDataL(query, sourceList));
@@ -281,7 +281,7 @@
//
//----------------------------------------------------------------------------
void CaClientProxy::getDataL(const QList<int> &entryIdList,
- QList<CaEntry *> &sourceList)
+ QList< QSharedPointer<CaEntry> > &sourceList)
{
CCaInnerQuery *query = CCaInnerQuery::NewLC();
RArray<TInt> array;
@@ -301,7 +301,7 @@
//
//----------------------------------------------------------------------------
void CaClientProxy::getDataL(const CaQuery &query,
- QList<CaEntry *> &sourceList)
+ QList< QSharedPointer<CaEntry> > &sourceList)
{
CCaInnerQuery *innerQuery = CCaInnerQuery::NewLC();
CaObjectAdapter::convertL(query, *innerQuery);
--- a/contentstorage/caclient/s60/src/cahandlerproxy.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/s60/src/cahandlerproxy.cpp Mon May 03 12:48:45 2010 +0300
@@ -19,10 +19,12 @@
#include "cahandler.h"
#include "cahandlerproxy.h"
#include "cahandlerloader.h"
+#include "cainnerentry.h"
+#include "caobjectadapter.h"
/*!
\class CaHandlerProxy
- \ingroup
+ \ingroup
\brief Forwards execute request to an implemenation provided by specific handler loader.
\sa CaHandlerLoader
@@ -60,9 +62,15 @@
TInt result = KErrNotFound;
if (handler != NULL) {
- result = handler->execute(entry, commandName);
+ QScopedPointer<CCaInnerEntry> innerEntry(NULL);
+ TRAP(result,
+ innerEntry.reset(CCaInnerEntry::NewL());
+ CaObjectAdapter::convertL(entry, *innerEntry);
+ )
+ if (result == KErrNone) {
+ result = handler->execute(*innerEntry, commandName);
+ }
}
-
return result;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/s60/src/camenuiconmifutility.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c)2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: ?Description
+ *
+ */
+
+#include <e32std.h>
+#include <e32base.h>
+#include <QBitmap>
+#include <QDebug>
+#include <AknIconUtils.h> // avkon
+#include <APGICNFL.H> // fbsbitmap
+
+#include "cabitmapadapter.h"
+#include "camenuiconmifutility.h"
+
+
+void CaMenuIconMifUtility::GetPixmapByFilenameL(TDesC& fileName,
+ const QSize &size, QPixmap& pixmap)
+{
+ 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,
+ bitmapIndex, maskIndex );
+ }
+
+ 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);
+
+ // bitmap and icon, AknsUtils::CreateIconLC doesn't specify the order
+ CleanupStack::Pop(2);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/s60/src/camenuiconutility.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+// conversion
+#include <XQConversions>
+// apparc
+#include <apparc.h>
+#include <APGCLI.H>
+// cfbsbitmap
+#include <APGICNFL.H>
+
+#include <HbIcon>
+#include "camenuiconutility.h"
+#include "camenuiconmifutility.h"
+#include "cabitmapadapter.h"
+#include "caentry.h"
+#include "caquery.h"
+#include "caservice.h"
+#include "cadef.h"
+
+const QString appUidAttributeName("application:uid");
+
+/*!
+ Get icon from entry.
+ \param entry const reference to CaEntry.
+ \retval icon.
+ */
+LOCAL_C HbIcon getIconFromEntry(const CaEntry& entry)
+{
+ HbIcon icon;
+ QString skinId(entry.iconDescription().skinId());
+ if (!skinId.isEmpty()) {
+ icon = HbIcon(skinId);
+ }
+
+ if (icon.isNull() || !(icon.size().isValid())) {
+ QString fileName(entry.iconDescription().filename());
+ if (!fileName.isEmpty()) {
+
+ // TODO:
+ // work-around for HbIcon::size() method locking files if returns
+ // default size, error id: ou1cimx1#279208 Case: mcl06HsDo07 -
+ // "Cannot delete file" when trying to uninstall sisx file
+
+ if (entry.entryTypeName() == XQConversions::s60DescToQString(
+ KCaTypeWidget)) {
+ icon = QIcon(fileName);
+ qWarning("Widget icon created by QIcon, "
+ "as work-around for HbIcon::size");
+ } else {
+ icon = HbIcon(fileName);
+ }
+ }
+ }
+ return icon;
+}
+
+/*!
+ Get icon from apparc.
+ \param entry const reference to CaEntry.
+ \param sie const reference to icon size.
+ \retval icon.
+ */
+LOCAL_C HbIcon getIconFromApparcL(const CaEntry& entry, const QSize &size)
+{
+ HbIcon icon;
+
+ RApaLsSession apaLsSession;
+ CleanupClosePushL(apaLsSession);
+ User::LeaveIfError(apaLsSession.Connect());
+
+ QString uidString(entry.attribute(appUidAttributeName));
+ TUid uid;
+ uid = uid.Uid(uidString.toInt());
+
+ CApaAppServiceInfoArray* skinArray(NULL);
+ TRAPD( err, skinArray = apaLsSession.GetAppServiceOpaqueDataLC(uid, TUid::Uid(0x2002DCF3));
+ if (err == KErrNone && skinArray ) {
+ TArray<TApaAppServiceInfo> tmpArray( skinArray->Array() );
+ if ( tmpArray.Count() ) {
+ TPtrC8 opaque(tmpArray[0].OpaqueData());
+ const TPtrC16 iconName((TText16*) opaque.Ptr(),(opaque.Length()+1)>>1);
+ icon = HbIcon( XQConversions:: s60DescToQString( iconName ) );
+ }
+ }
+ CleanupStack::PopAndDestroy(skinArray);
+ );
+
+ if (icon.isNull() || !(icon.size().isValid())) {
+ TSize iconSize(size.width(), size.height());
+ CApaMaskedBitmap* apaMaskedBitmap = CApaMaskedBitmap::NewLC();
+ TInt err = apaLsSession.GetAppIcon(uid,iconSize,*apaMaskedBitmap);
+
+ TInt iconsCount(0);
+ apaLsSession.NumberOfOwnDefinedIcons(uid, iconsCount);
+
+ QPixmap pixmap;
+ if ((err == KErrNone) && (iconsCount > 0)) {
+ CaBitmapAdapter::fromBitmapAndMaskToPixmapL(apaMaskedBitmap,
+ apaMaskedBitmap->Mask(), pixmap);
+
+ pixmap = pixmap.scaled(size, Qt::KeepAspectRatioByExpanding);
+ icon = HbIcon(QIcon(pixmap));
+ } else {
+ HBufC* fileNameFromApparc;
+ TInt err2 = apaLsSession.GetAppIcon(uid,fileNameFromApparc);
+ CleanupStack::PushL(fileNameFromApparc);
+ if (err2 == KErrNone) {
+ QString fileName = XQConversions::s60DescToQString(
+ fileNameFromApparc->Des());
+ if (fileName.contains(QString(".mif"))) {
+
+ TPtr ptr(fileNameFromApparc->Des());
+ CaMenuIconMifUtility::GetPixmapByFilenameL(ptr,size,pixmap);
+
+ pixmap = pixmap.scaled(size, Qt::KeepAspectRatioByExpanding);
+ icon = HbIcon(QIcon(pixmap));
+ }
+ }
+ CleanupStack::Pop(fileNameFromApparc);
+ }
+
+ CleanupStack::PopAndDestroy(apaMaskedBitmap);
+ }
+ CleanupStack::PopAndDestroy(&apaLsSession);
+
+ return icon;
+}
+
+/*!
+ Get default icon from theme.
+ \param entry const reference to CaEntry.
+ \retval icon.
+ */
+LOCAL_C HbIcon getDefaultIcon(const CaEntry& entry)
+{
+ HbIcon icon;
+
+ if (entry.entryTypeName() ==
+ XQConversions::s60DescToQString(KCaTypeApp)) {
+ icon = HbIcon("qtg_large_application");
+ } else if (entry.entryTypeName() ==
+ XQConversions::s60DescToQString(KCaTypeFolder) ||
+ entry.entryTypeName() ==
+ XQConversions::s60DescToQString(KCaTypeCollection) ||
+ entry.entryTypeName() ==
+ XQConversions::s60DescToQString(KCaTypeCollectionDownload)) {
+ icon = HbIcon("qtg_large_application");
+ } else if (entry.entryTypeName() ==
+ XQConversions::s60DescToQString(KCaTypeUrl)) {
+ icon = HbIcon("qtg_large_application");
+ } else if (entry.entryTypeName() ==
+ XQConversions::s60DescToQString(KCaTypeWidget)) {
+ icon = HbIcon("qtg_large_application");
+ } else if (entry.entryTypeName() ==
+ XQConversions::s60DescToQString(KCaTypeTemplatedApp)) {
+ icon = HbIcon("qtg_large_application");
+ } else if (entry.entryTypeName() ==
+ XQConversions::s60DescToQString(KCaTypePackage)) {
+ icon = HbIcon("qtg_large_application");
+ }
+
+ return icon;
+}
+
+/*!
+ Get entry by uid.
+ \param uid application uid.
+ \retval entry.
+ */
+LOCAL_C CaEntry getEntryByUid(int uid)
+{
+ CaEntry entry;
+ CaQuery query;
+ query.setAttribute(QString("application:uid"), QString::number(uid));
+ QList< QSharedPointer<CaEntry> > entries = CaService::instance()->getEntries(query);
+ if (!entries.isEmpty()) {
+ entry = *(entries.first());
+ }
+ return entry;
+}
+
+/*!
+ Get icon when uid is defined.
+ \param entry const reference to CaEntry.
+ \param sie const reference to icon size.
+ \retval icon.
+ */
+HbIcon CaMenuIconUtility::getApplicationIcon(int uid,
+ const QSize &size)
+{
+ HbIcon icon;
+ CaEntry entry;
+ entry = getEntryByUid(uid);
+ icon = getEntryIcon(entry, size);
+ return icon;
+}
+
+/*!
+ Get icon.
+ \param entry const reference to CaEntry.
+ \param sie const reference to icon size.
+ \retval icon.
+ */
+HbIcon CaMenuIconUtility::getEntryIcon(const CaEntry& entry,
+ const QSize &size)
+{
+ HbIcon icon;
+ icon = getIconFromEntry(entry);
+
+ if (icon.isNull() || !(icon.size().isValid())) {
+ TRAP_IGNORE(icon = getIconFromApparcL(entry, size));
+ }
+
+ if (icon.isNull() || !(icon.size().isValid())) {
+ icon = getDefaultIcon(entry);
+ }
+
+ return icon;
+}
+
+
--- a/contentstorage/caclient/s60/src/caobjectadapter.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/s60/src/caobjectadapter.cpp Mon May 03 12:48:45 2010 +0300
@@ -34,65 +34,11 @@
#include "caentry_p.h"
#include "cainnerquery.h"
#include "caquery.h"
-#include "camenuiconutility.h"
+
#include "canotifierfilter.h"
#include "cainnernotifierfilter.h"
#include "caclient_defines.h"
-static QImage::Format TDisplayMode2Format(TDisplayMode mode)
-{
- QImage::Format format;
- switch (mode) {
- case EGray2:
- format = QImage::Format_MonoLSB;
- break;
- case EColor256:
- case EGray256:
- format = QImage::Format_Indexed8;
- break;
- case EColor4K:
- format = QImage::Format_RGB444;
- break;
- case EColor64K:
- format = QImage::Format_RGB16;
- break;
- case EColor16M:
- format = QImage::Format_RGB888;
- break;
- case EColor16MU:
- format = QImage::Format_RGB32;
- break;
- case EColor16MA:
- format = QImage::Format_ARGB32;
- break;
- case EColor16MAP:
- format = QImage::Format_ARGB32_Premultiplied;
- break;
- default:
- format = QImage::Format_Invalid;
- break;
- }
- return format;
-}
-
-QPixmap fromSymbianCFbsBitmap(CFbsBitmap *aBitmap)
-{
- aBitmap->BeginDataAccess();
- uchar *data = (uchar *)aBitmap->DataAddress();
- TSize size = aBitmap->SizeInPixels();
- TDisplayMode displayMode = aBitmap->DisplayMode();
-
- // QImage format must match to bitmap format
- QImage image(data, size.iWidth, size.iHeight, TDisplayMode2Format(
- displayMode));
- aBitmap->EndDataAccess();
-
- // No data copying happens because
- // image format matches native OpenVG format.
- // So QPixmap actually points to CFbsBitmap data.
- return QPixmap::fromImage(image);
-}
-
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
@@ -181,10 +127,16 @@
const QMap<QString, QString> attributesMap = fromQuery.attributes();
foreach(QString key, attributesMap.keys()) {
- toQuery.AddAttributeL(
- XQConversions::qStringToS60Desc(key)->Des(),
- XQConversions::qStringToS60Desc(
- attributesMap.value(key))->Des());
+ if (key == APPLICATION_UID_ATTRIBUTE_NAME) {
+ const TInt32 uid = attributesMap.value(key).toInt();
+ toQuery.SetUid(uid);
+ }
+ else {
+ toQuery.AddAttributeL(
+ XQConversions::qStringToS60Desc(key)->Des(),
+ XQConversions::qStringToS60Desc(
+ attributesMap.value(key))->Des());
+ }
}
}
@@ -206,16 +158,16 @@
toEntry.setFlags(static_cast<EntryFlag>(fromEntry.GetFlags()));
// take care of converting icon attributes
- const CCaInnerEntry::TIconAttributes &icon = fromEntry.GetIcon();
+ const CCaInnerIconDescription* innerIcon = fromEntry.Icon();
+ CaIconDescription iconDescription;
- CaIconDescription iconDescription;
- iconDescription.setId(icon.iId);
+ iconDescription.setId(innerIcon->Id());
iconDescription.setFilename(
- XQConversions::s60DescToQString(icon.iFileName));
+ XQConversions::s60DescToQString(innerIcon->FileName()));
iconDescription.setSkinId(
- XQConversions::s60DescToQString(icon.iSkinId));
+ XQConversions::s60DescToQString(innerIcon->SkinId()));
iconDescription.setApplicationId(
- XQConversions::s60DescToQString(icon.iApplicationId));
+ XQConversions::s60DescToQString(innerIcon->ApplicationId()));
toEntry.setIconDescription(iconDescription);
@@ -282,11 +234,11 @@
//----------------------------------------------------------------------------
void CaObjectAdapter::convertL(
const RPointerArray<CCaInnerEntry> &fromEntriesArray,
- QList<CaEntry *> &toEntryList)
+ QList< QSharedPointer<CaEntry> > &toEntryList)
{
for (int i = 0; i < fromEntriesArray.Count(); ++i) {
- CaEntry *const toEntry = new CaEntry(
- static_cast<EntryRole>(fromEntriesArray[i]->GetRole()));
+ const QSharedPointer<CaEntry> toEntry (new CaEntry(
+ static_cast<EntryRole>(fromEntriesArray[i]->GetRole())));
CaObjectAdapter::convert(*fromEntriesArray[i], *toEntry);
@@ -319,21 +271,6 @@
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
-HbIcon CaObjectAdapter::makeIcon(const CaEntry &entry, const QSize &size)
-{
-
- HbIcon icon;
- TRAPD(leaveCode, icon = makeIconL(entry, size));
-
- USE_QDEBUG_IF(leaveCode) << "CaObjectAdapter::makeIcon leaveCode:"
- << leaveCode;
-
- return icon;
-}
-
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
ErrorCode CaObjectAdapter::convertErrorCode(int internalErrorCode)
{
ErrorCode error(NoErrorCode);
@@ -357,94 +294,6 @@
return error;
}
-
-// -----------------------------------------------------------------------------
-// copying compressed bitmap
-//----------------------------------------------------------------------------
-CFbsBitmap *CaObjectAdapter::copyBitmapLC(CFbsBitmap *input)
-{
- CFbsBitmap *bmp = new(ELeave) CFbsBitmap();
- CleanupStack::PushL(bmp);
- bmp->Create(input->SizeInPixels(), input->DisplayMode());
-
- CFbsBitmapDevice *bitmapDevice = CFbsBitmapDevice::NewL(bmp);
- CleanupStack::PushL(bitmapDevice);
- CFbsBitGc *bmpGc;
- bitmapDevice->CreateContext(bmpGc);
- bmpGc->BitBlt(TPoint(0,0), input);
- delete bmpGc;
- CleanupStack::PopAndDestroy(bitmapDevice);
- return bmp;
-}
-
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
-HbIcon CaObjectAdapter::makeIconL(const CaEntry &entry, const QSize &size)
-{
- HbIcon icon;
- QString skinId(entry.iconDescription().skinId());
- if (!skinId.isEmpty()) {
- icon = HbIcon(skinId);
- }
- if (icon.isNull() || !(icon.size().isValid())) {
- QString filename(entry.iconDescription().filename());
- if (!filename.isEmpty()) {
-
- // TODO:
- // work-around for HbIcon::size() method locking files if returns
- // default size, error id: ou1cimx1#279208 Case: mcl06HsDo07 -
- // "Cannot delete file" when trying to uninstall sisx file
-
- if (entry.entryTypeName() == XQConversions::s60DescToQString(KCaTypeWidget)) {
- icon = QIcon(filename);
- qWarning("Widget icon created by QIcon, as work-around for HbIcon::size");
- } else {
- icon = HbIcon(filename);
- }
- }
- }
-
- //try to load symbian icon from multi-bitmap (mbm, mbg)
- if (icon.isNull() || !(icon.size().isValid())) {
- CCaInnerEntry *innerEntry = CCaInnerEntry::NewLC();
- CaObjectAdapter::convertL(entry, *innerEntry);
-
- CAknIcon *aknIcon = CaMenuIconUtility::GetItemIcon(*innerEntry);
- QPixmap pixmap;
- if (aknIcon) {
- CleanupStack::PushL(aknIcon);
-
- //need to disable compression to properly convert the bitmap
- AknIconUtils::DisableCompression(aknIcon->Bitmap());
- AknIconUtils::SetSize(
- aknIcon->Bitmap(), TSize(size.width(), size.height()),
- EAspectRatioPreservedAndUnusedSpaceRemoved);
- if (aknIcon->Bitmap()->Header().iCompression
- == ENoBitmapCompression) {
- pixmap = fromSymbianCFbsBitmap(aknIcon->Bitmap());
- QPixmap mask = fromSymbianCFbsBitmap(aknIcon->Mask());
- pixmap.setAlphaChannel(mask);
- } else { // we need special handling for icons in 9.2 (NGA)
- // let's hope that in future it will be in QT code
- CFbsBitmap *temp(NULL);
- temp = copyBitmapLC(aknIcon->Bitmap());
- pixmap = fromSymbianCFbsBitmap(temp);
- CleanupStack::PopAndDestroy();
- temp = copyBitmapLC(aknIcon->Mask());
- QPixmap mask = fromSymbianCFbsBitmap(temp);
- CleanupStack::PopAndDestroy();
- pixmap.setAlphaChannel(mask);
- }
- pixmap = pixmap.scaled(size, Qt::KeepAspectRatioByExpanding);
- CleanupStack::PopAndDestroy(aknIcon);
- icon = HbIcon(QIcon(pixmap));
- }
- CleanupStack::PopAndDestroy(innerEntry);
- }
- return icon;
-}
-
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
--- a/contentstorage/caclient/s60/src/caqtsfhandlerloader.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/s60/src/caqtsfhandlerloader.cpp Mon May 03 12:48:45 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+#include <QApplication>
+#include <QDir>
#include <QMap>
#include <QScopedPointer>
#include <QString>
@@ -25,16 +27,12 @@
#include "cahandler.h"
#include "caqtsfhandlerloader.h"
#include "caclient_defines.h"
-#include "caapphandler.h"
-#include "caurlhandler.h"
-#include "catapphandler.h"
-#include "cas60handleradapter.h"
QTM_USE_NAMESPACE
/*!
\class CaQtSfHandlerLoader
- \ingroup
+ \ingroup
\brief Loads handlers implementation
The purpose of the class is to find Qt SF plugins implementing command handlers.
@@ -44,10 +42,44 @@
*/
/*!
- Loads handler implementations appropriate for the requested entry type name and command.
+ Constructor.
+*/
+CaQtSfHandlerLoader::CaQtSfHandlerLoader()
+{
+ registerPlugins();
+}
+
+/*!
+ Load plugins for command handling.
+*/
+void CaQtSfHandlerLoader::registerPlugins() const
+{
+ const QString pluginPath("hsresources/plugins/commandhandler");
+ const QFileInfoList drives = QDir::drives();
+ foreach(QFileInfo drive, drives) {
+ const QString driveLetter = drive.absolutePath();
+ const QString pluginAbsolutePath = driveLetter + pluginPath;
+ const QDir pluginDir(pluginAbsolutePath);
+ if(QDir(pluginDir).exists()) {
+ const QFileInfoList fileInfos =
+ pluginDir.entryInfoList(QStringList("*.xml"));
+
+ QApplication::addLibraryPath(pluginAbsolutePath);
+
+ QServiceManager serviceManager;
+ foreach(QFileInfo fileInfo, fileInfos) {
+ serviceManager.addService(fileInfo.absoluteFilePath());
+ }
+ }
+ }
+}
+
+/*!
+ Loads handler implementations appropriate for the requested entry type name and command.
+
The caller takes ownership of the returned pointer.
-
+
\param entryTypeName Entry type name.
\param commandName Name of the command to be handled.
\return A pointer to handler serving the entry type and command if found, NULL otherwise.
@@ -57,18 +89,26 @@
{
Q_UNUSED(commandName);
- CaHandler *implementation(0);
-
- if (entryTypeName == APPLICATION_ENTRY_TYPE_NAME
- || entryTypeName == WIDGET_ENTRY_TYPE_NAME) {
- implementation = new CaS60HandlerAdapter<CCaAppHandler>;
- } else if (entryTypeName == URL_ENTRY_TYPE_NAME) {
- implementation = new CaS60HandlerAdapter<CCaUrlHandler>;
- } else if (entryTypeName == TEMPLATED_APPLICATION_ENTRY_TYPE_NAME) {
- implementation = new CaTappHandler;
+ QString typeName(entryTypeName);
+ if (entryTypeName == WIDGET_ENTRY_TYPE_NAME
+ || entryTypeName == PACKAGE_ENTRY_TYPE_NAME) {
+ typeName = QString(APPLICATION_ENTRY_TYPE_NAME);
}
- return implementation;
+ QServiceManager serviceManager;
+ QServiceFilter serviceFilter("com.nokia.homescreen.ICommandHandler");
+ serviceFilter.setCustomAttribute("entryTypeName", typeName);
+ QList<QServiceInterfaceDescriptor> serviceInterfaceDescriptorList =
+ serviceManager.findInterfaces(serviceFilter);
+ CaHandler *interfaceHandler = NULL;
+ if (!serviceInterfaceDescriptorList.isEmpty()) {
+ QServiceInterfaceDescriptor serviceInterfaceDescriptor =
+ serviceInterfaceDescriptorList[0];
+ QObject *handler =
+ serviceManager.loadInterface(serviceInterfaceDescriptor);
+ interfaceHandler = qobject_cast<CaHandler *>(handler);
+ }
+ return interfaceHandler;
}
--- a/contentstorage/caclient/src/caentry.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/src/caentry.cpp Mon May 03 12:48:45 2010 +0300
@@ -24,6 +24,7 @@
#include "caobjectadapter.h"
#include "caiconcache.h"
#include "caclienttest_global.h"
+#include "camenuiconutility.h"
// ======== MEMBER FUNCTIONS ========
@@ -473,7 +474,7 @@
CaEntryPrivate::CaEntryPrivate(CaEntry *entryPublic) :
m_q(entryPublic), mId(0), mText(), mDescription(), mIconDescription(),
mFlags(RemovableEntryFlag|VisibleEntryFlag),mEntryTypeName(),
- mAttributes()
+ mAttributes(), mEntryRole(ItemEntryRole)
{
}
/*!
@@ -629,7 +630,7 @@
*/
HbIcon CaEntryPrivate::makeIcon(const QSize &size) const
{
- return CaObjectAdapter::makeIcon(*m_q, size);
+ return CaMenuIconUtility::getEntryIcon(*m_q, size);
}
/*!
--- a/contentstorage/caclient/src/caitemmodel.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/src/caitemmodel.cpp Mon May 03 12:48:45 2010 +0300
@@ -382,7 +382,7 @@
\endcode
*/
-CaEntry *CaItemModel::entry(const QModelIndex &index) const
+QSharedPointer<CaEntry> CaItemModel::entry(const QModelIndex &index) const
{
return m_d->entry(index);
}
@@ -394,7 +394,7 @@
*/
CaItemModelPrivate::CaItemModelPrivate(const CaQuery &query,
CaItemModel *itemModelPublic) :
- QObject(), m_q(itemModelPublic), mParentEntry(0), mQuery(query),
+ QObject(), m_q(itemModelPublic), mParentEntry(), mQuery(query),
mService(CaService::instance()), mEntries(mService), mNotifier(NULL),
mSize(defaultIconSize), mSecondLineVisibility(true)
{
@@ -408,7 +408,6 @@
CaItemModelPrivate::~CaItemModelPrivate()
{
mEntries.clear();
- delete mParentEntry;
delete mNotifier;
}
@@ -466,6 +465,10 @@
case CaItemModel::TextRole:
variant = QVariant(entry(modelIndex)->text());
break;
+ case CaItemModel::FullTextRole:
+ variant = QVariant(entry(modelIndex)->text() + QString(" ")
+ + entry(modelIndex)->description());
+ break;
default:
variant = QVariant(QVariant::Invalid);
}
@@ -550,7 +553,7 @@
\param modelIndex index of entry in model
\retval pointer to an entry
*/
-CaEntry *CaItemModelPrivate::entry(const QModelIndex &modelIndex) const
+QSharedPointer<CaEntry> CaItemModelPrivate::entry(const QModelIndex &modelIndex) const
{
if (modelIndex.column() == 1) {
return mParentEntry;
@@ -687,7 +690,6 @@
CACLIENTTEST_FUNC_ENTRY("CaItemModelPrivate::updateParentEntry");
if (mQuery.parentId()) {
- delete mParentEntry;
mParentEntry = mService->getEntry(mQuery.parentId());
}
@@ -706,14 +708,14 @@
mEntries.updateEntry(id);
QList<int> ids = mService->getEntryIds(mQuery);
- if (mEntries.indexOf(id) >= 0
+ if (mEntries.indexOf(id) >= 0
&& ids.indexOf(id) == mEntries.indexOf(id)) {
emit m_q->dataChanged(index(mEntries.indexOf(id)), index(
mEntries.indexOf(id)));
} else if (ids.indexOf(id) < 0){
removeItem(id);
} else if (mEntries.indexOf(id) < 0){
- addItem(id);
+ addItem(id);
} else if (mParentEntry && id == mParentEntry->id()) {
updateParentEntry();
m_q->reset();
@@ -743,63 +745,63 @@
}
/*!
+ Adds new item block to model
+ Use in cases when inserting / appending an adjacent block of items
+ \param itemsList list of adjacent items
+ */
+void CaItemModelPrivate::addItemBlock(const QList<int> &itemsList)
+{
+ CACLIENTTEST_FUNC_ENTRY("CaItemModelPrivate::addItemBlock");
+ if (!itemsList.isEmpty()) {
+ int firstRow = itemRow(itemsList.first());
+ int lastRow = itemRow(itemsList.last());
+ m_q->beginInsertRows(QModelIndex(), firstRow, lastRow);
+ for (int i = 0; i < itemsList.count(); ++i) {
+ mEntries.insert(firstRow + i, itemsList.at(i));
+ }
+ m_q->endInsertRows();
+ emit m_q->scrollTo(firstRow, QAbstractItemView::PositionAtTop);
+ }
+ CACLIENTTEST_FUNC_EXIT("CaItemModelPrivate::addItemBlock");
+}
+
+/*!
Adds new items to model
\param itemsList current items list
*/
-void CaItemModelPrivate::handleAddItems(QList<int> &itemsList)
+void CaItemModelPrivate::handleAddItems(const QList<int> &itemsList)
{
CACLIENTTEST_FUNC_ENTRY("CaItemModelPrivate::handleAddItems");
-
- int entriesCount = mEntries.count();
- if (entriesCount) {
- int lastRow = itemsList.indexOf(mEntries[entriesCount - 1]);
- if (itemsList.count() == entriesCount) {
- //count is same and last item is in same position
- //so we update whole model
- bool orderChanged(false);
- while (entriesCount) {
- if (itemsList.indexOf(mEntries[entriesCount - 1])
- != (entriesCount - 1)) {
- orderChanged = true;
- break;
- }
- entriesCount--;
- }
- if (orderChanged) {
+ const int oldItemCount(mEntries.count());
+ if (oldItemCount) {
+ const int newItemCount(itemsList.count());
+ if (newItemCount == oldItemCount) {
+ // count is the same - check if item order changed
+ if (itemsList == mEntries.orderedIdList()) {
+ // assume that if the order has not changed
+ // it had to be the secondary lines
+ updateModel();
+ } else {
updateLayout();
}
- else {
- updateModel();
- }
-
- } else if ((itemsList.count() - entriesCount) == 1 && lastRow
- == entriesCount) {
- //just one item added - collection
+ } else {
int i = 0;
- for (i = 0; i < entriesCount; i++) {
- if (itemsList[i] != mEntries[i]) {
- addItem(itemsList[i]);
- updateLayout();
- emit m_q->scrollTo(i,
- QAbstractItemView::PositionAtTop);
+ QList<int> oldList = mEntries.orderedIdList();
+ //we loop through items to find first added
+ while (i < oldList.count()) {
+ if (oldList[i] != itemsList[i]) {
+ oldList.takeAt(i);
+ } else {
+ ++i;
}
}
- while (i < itemsList.count()) {
- addItem(itemsList[i]);
- i++;
- }
- } else {
- //some items were inserted
- //so we update model and emit signal with row number
- //of first moved/added item
- //signal is needed to scroll a view to proper position after
- //some items were added
updateModel();
- emit m_q->scrollTo(lastRow + 1,
- QAbstractItemView::PositionAtTop);
- }
+ //i is the index of first added item
+ emit m_q->scrollTo(i, QAbstractItemView::PositionAtTop);
+ }
} else {
- updateModel();
+ // items added to an empty list - add all as a single block
+ addItemBlock(itemsList);
}
CACLIENTTEST_FUNC_EXIT("CaItemModelPrivate::handleAddItems");
}
@@ -890,12 +892,10 @@
foreach (index, oldPersistentIndexList) {
newPersistentIndexList <<
m_q->createIndex(
- newPositionsList.at(index.row()),
- 0,
- index.internalPointer());
+ newPositionsList.at(index.row()), 0, index.internalPointer());
}
-
- m_q->changePersistentIndexList(oldPersistentIndexList, newPersistentIndexList);
+ m_q->changePersistentIndexList(
+ oldPersistentIndexList, newPersistentIndexList);
m_q->layoutChanged();
CACLIENTTEST_FUNC_EXIT("CaItemModelPrivate::updateLayout");
--- a/contentstorage/caclient/src/caitemmodellist.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/src/caitemmodellist.cpp Mon May 03 12:48:45 2010 +0300
@@ -49,7 +49,6 @@
{
CACLIENTTEST_FUNC_ENTRY("CaItemModelList::clear");
mOrderedList.clear();
- qDeleteAll(mEntriesHash);
mEntriesHash.clear();
CACLIENTTEST_FUNC_EXIT("CaItemModelList::clear");
}
@@ -68,7 +67,7 @@
\param row of model list
\retval entry at row
*/
-CaEntry *CaItemModelList::at(int row) const
+QSharedPointer<CaEntry> CaItemModelList::at(int row) const
{
int id = mOrderedList[row];
return mEntriesHash.value(id);
@@ -83,7 +82,7 @@
CACLIENTTEST_FUNC_ENTRY("CaItemModelList::reloadEntries");
clear();
int id=0;
- QList<CaEntry *> eList = mService->getEntries(query);
+ QList< QSharedPointer<CaEntry> > eList = mService->getEntries(query);
for (int i = 0; i < eList.count(); i++) {
id = eList[i]->id();
mOrderedList << id;
@@ -100,7 +99,6 @@
{
CACLIENTTEST_FUNC_ENTRY("CaItemModelList::updateEntry");
if (mEntriesHash.contains(id)) {
- delete mEntriesHash.take(id);
mEntriesHash.insert(id, mService->getEntry(id));
}
CACLIENTTEST_FUNC_EXIT("CaItemModelList::updateEntry");
@@ -155,7 +153,7 @@
{
CACLIENTTEST_FUNC_ENTRY("CaItemModelList::remove");
if (mEntriesHash.contains(id)) {
- delete mEntriesHash.take(id);
+ mEntriesHash.remove(id);
}
mOrderedList.removeOne(id);
CACLIENTTEST_FUNC_EXIT("CaItemModelList::remove");
--- a/contentstorage/caclient/src/caservice.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/src/caservice.cpp Mon May 03 12:48:45 2010 +0300
@@ -103,15 +103,15 @@
\endcode
*/
-CaEntry *CaService::getEntry(int entryId) const
+QSharedPointer<CaEntry> CaService::getEntry(int entryId) const
{
- QList<CaEntry *> entries = getEntries(QList<int> () << entryId);
+ QList< QSharedPointer<CaEntry> > entries = getEntries(QList<int> () << entryId);
if (entries.count()) {
// there should be exactly one entry with specified ID if present
Q_ASSERT(entries.count() == 1);
return entries[0];
} else {
- return NULL;
+ return QSharedPointer<CaEntry>();
}
}
@@ -135,7 +135,7 @@
\endcode
*/
-QList<CaEntry *> CaService::getEntries(const QList<int> &entryIdList) const
+QList< QSharedPointer<CaEntry> > CaService::getEntries(const QList<int> &entryIdList) const
{
return m_d->getEntries(entryIdList);
}
@@ -162,7 +162,7 @@
\endcode
*/
-QList<CaEntry *> CaService::getEntries(const CaQuery &query) const
+QList< QSharedPointer<CaEntry> > CaService::getEntries(const CaQuery &query) const
{
return m_d->getEntries(query);
}
@@ -216,7 +216,7 @@
...
\endcode
*/
-CaEntry *CaService::createEntry(const CaEntry &entry) const
+QSharedPointer<CaEntry> CaService::createEntry(const CaEntry &entry) const
{
return m_d->createEntry(entry);
}
@@ -284,15 +284,15 @@
\example
\code
...
- bool result = service->removeEntries( QList<CaEntry *>() << newItem );
+ bool result = service->removeEntries( QList< QSharedPointer<CaEntry> >() << newItem );
\b Output:
result == true
\endcode
*/
-bool CaService::removeEntries(const QList<CaEntry *> &entryList) const
+bool CaService::removeEntries(const QList< QSharedPointer<CaEntry> > &entryList) const
{
QList<int> idList;
- CaEntry *entry(NULL);
+ QSharedPointer<CaEntry> entry;
foreach(entry, entryList) {
idList << entry->id();
}
@@ -449,10 +449,10 @@
\endcode
*/
bool CaService::insertEntriesIntoGroup(const CaEntry &group,
- const QList<CaEntry *> &entryList, int beforeEntryId) const
+ const QList< QSharedPointer<CaEntry> > &entryList, int beforeEntryId) const
{
QList<int> idList;
- CaEntry *entry(NULL);
+ QSharedPointer<CaEntry> entry;
foreach(entry, entryList) {
idList << entry->id();
}
@@ -563,10 +563,10 @@
\endcode
*/
bool CaService::removeEntriesFromGroup(const CaEntry &group,
- const QList<CaEntry *> &entryList) const
+ const QList< QSharedPointer<CaEntry> > &entryList) const
{
QList<int> idList;
- CaEntry *entry(NULL);
+ QSharedPointer<CaEntry> entry;
foreach(entry, entryList) {
idList << entry->id();
}
@@ -681,17 +681,17 @@
itemToAppend.setTypeName( "TypeNameAppend" );
CaEntry * entryToAppend = service->createEntry( itemToAppend );
bool result = service->appendEntriesToGroup(
- *newGroup, QList<CaEntry *>() << entryToAppend );
+ *newGroup, QList< QSharedPointer<CaEntry> >() << entryToAppend );
...
\b Output:
result == true
\endcode
*/
bool CaService::appendEntriesToGroup(const CaEntry &group,
- const QList<CaEntry *> &entryList) const
+ const QList< QSharedPointer<CaEntry> > &entryList) const
{
QList<int> idList;
- CaEntry *entry(NULL);
+ QSharedPointer<CaEntry> entry;
foreach(entry, entryList) {
idList << entry->id();
}
@@ -797,10 +797,10 @@
\endcode
*/
bool CaService::prependEntriesToGroup(const CaEntry &group,
- const QList<CaEntry *> &entryList) const
+ const QList< QSharedPointer<CaEntry> > &entryList) const
{
QList<int> idList;
- CaEntry *entry(NULL);
+ QSharedPointer<CaEntry> entry;
foreach(entry, entryList) {
idList << entry->id();
}
@@ -831,11 +831,10 @@
{
bool result = false;
- CaEntry *const temporaryEntry = getEntry(entryId);
+ const QSharedPointer<CaEntry> temporaryEntry = getEntry(entryId);
- if (temporaryEntry != NULL) {
+ if (!temporaryEntry.isNull()) {
result = executeCommand(*temporaryEntry, command);
- delete temporaryEntry;
}
return result;
}
@@ -957,14 +956,14 @@
\param entryIdList list of entry ids
\retval list of entries (pointers)
*/
-QList<CaEntry *> CaServicePrivate::getEntries(const QList<int> &entryIdList) const
+QList< QSharedPointer<CaEntry> > CaServicePrivate::getEntries(const QList<int> &entryIdList) const
{
qDebug() << "CaServicePrivate::getEntries"
<< "entryIdList:" << entryIdList;
CACLIENTTEST_FUNC_ENTRY("CaServicePrivate::getEntries");
- QList<CaEntry *> resultList;
+ QList< QSharedPointer<CaEntry> > resultList;
mErrorCode = mProxy->getData(entryIdList, resultList);
@@ -987,9 +986,9 @@
\param query the query information to select specific entries.
\param placeholder list of entries for a specific select.
*/
-QList<CaEntry *> CaServicePrivate::getEntries(const CaQuery &query) const
+QList< QSharedPointer<CaEntry> > CaServicePrivate::getEntries(const CaQuery &query) const
{
- QList<CaEntry *> resultList;
+ QList< QSharedPointer<CaEntry> > resultList;
mErrorCode = mProxy->getData(query, resultList);
@@ -1019,36 +1018,29 @@
\param query const reference to entry to copy
\retval pointer to newely created copy
*/
-CaEntry *CaServicePrivate::createEntry(const CaEntry &entry)
+QSharedPointer<CaEntry> CaServicePrivate::createEntry(const CaEntry &entry)
{
qDebug() << "CaServicePrivate::createEntry"
<< "entry id:" << entry.id();
CACLIENTTEST_FUNC_ENTRY("CaServicePrivate::createEntry");
- CaEntry *newEntry = NULL;
ErrorCode addDataResult = NoErrorCode;
- try {
- newEntry = new CaEntry(entry.role());
+ QSharedPointer<CaEntry> newEntry (new CaEntry(entry.role()));
- QScopedPointer<CaEntry> entryClone(new CaEntry(entry));
-
- const int nonExistingObjectId = 0;
-
- CaObjectAdapter::setId(*entryClone, nonExistingObjectId);
+ QScopedPointer<CaEntry> entryClone(new CaEntry(entry));
+ const int nonExistingObjectId = 0;
+ CaObjectAdapter::setId(*entryClone, nonExistingObjectId);
- addDataResult =
- mProxy->addData(*entryClone, *newEntry);
- } catch (const std::bad_alloc &) {
- addDataResult = OutOfMemoryErrorCode;
- }
+ addDataResult =
+ mProxy->addData(*entryClone, *newEntry);
+ // return empty pointer if nothing was added
if (addDataResult != NoErrorCode) {
- delete newEntry;
- newEntry = NULL;
+ newEntry.clear();
}
-
+
mErrorCode = addDataResult;
qDebug() << "CaServicePrivate::createEntry mErrorCode:" << mErrorCode;
--- a/contentstorage/caclient/stub/inc/caclientproxy.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/stub/inc/caclientproxy.h Mon May 03 12:48:45 2010 +0300
@@ -109,7 +109,7 @@
* @param sourceList List of results.
* @return error code
*/
- ErrorCode getData(const QList<int>& entryIdList, QList<CaEntry *>& sourceList);
+ ErrorCode getData(const QList<int>& entryIdList, QList< QSharedPointer<CaEntry> >& sourceList);
/**
* Method for fetching entries.
@@ -118,7 +118,7 @@
* @param sourceList List of results.
* @return error code
*/
- ErrorCode getData(const CaQuery &query, QList<CaEntry *>& sourceList);
+ ErrorCode getData(const CaQuery &query, QList< QSharedPointer<CaEntry> >& sourceList);
/**
* Method for fetching entries.
@@ -178,6 +178,7 @@
const QList<int> &entryIds,
const QList<int> &parentIds,
QString &query);
+ int getEntryIdByUid(const CaEntry &entry, const int uid);
private:
QString mWidgetRegistryPath;
--- a/contentstorage/caclient/stub/inc/canotifiers.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/stub/inc/canotifiers.h Mon May 03 12:48:45 2010 +0300
@@ -38,6 +38,8 @@
static void Notify(int groupId);
+ static void NotifyTouched(int id);
+
static void Notify(const CaEntry &targetEntry,
ChangeType changeType,
QList<int> &parentIds);
@@ -58,4 +60,4 @@
};
-#endif // CANOTIFIERS_H
\ No newline at end of file
+#endif // CANOTIFIERS_H
--- a/contentstorage/caclient/stub/src/caclientproxy.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/stub/src/caclientproxy.cpp Mon May 03 12:48:45 2010 +0300
@@ -32,6 +32,7 @@
#include "canotifier_p.h"
#include "canotifiers.h"
+#include "caclient_defines.h"
#include "hswidgetregistryservice.h"
const char *DATABASE_CONNECTION_NAME = "CaService";
@@ -47,7 +48,7 @@
//
//----------------------------------------------------------------------------
CaClientProxy::CaClientProxy() :
- mWidgetRegistryPath("hsresources/import/widgetregistry")
+ mWidgetRegistryPath("private/20022F35/import/widgetregistry")
{
}
@@ -278,10 +279,10 @@
qDebug() << "CaClientProxy::removeData" << "entryIdList: "
<< entryIdList;
- QList<CaEntry *> entryList;
+ QList< QSharedPointer<CaEntry> > entryList;
getData(entryIdList, entryList);
QList<QList<int> > parentsIds;
- foreach(CaEntry *entry, entryList) {
+ foreach(QSharedPointer<CaEntry> entry, entryList) {
QList<int> parentIds;
GetParentsIds(QList<int>() << entry->id(), parentIds);
parentsIds.append(parentIds);
@@ -486,7 +487,7 @@
//
//----------------------------------------------------------------------------
ErrorCode CaClientProxy::getData(const QList<int> &entryIdList,
- QList<CaEntry *> &sourceList)
+ QList< QSharedPointer<CaEntry> > &sourceList)
{
qDebug() << "CaClientProxy::getData" << "entryIdList: "
<< entryIdList;
@@ -507,7 +508,7 @@
qDebug() << query.executedQuery();
int role =
query.value(query.record().indexOf("EN_ROLE")).toInt();
- CaEntry *entry = new CaEntry((EntryRole) role);
+ QSharedPointer<CaEntry> entry (new CaEntry((EntryRole) role));
CaObjectAdapter::setId(*entry,
query.value(query.record().indexOf("ENTRY_ID")).toInt());
entry->setText(query.value(
@@ -571,7 +572,7 @@
//
//----------------------------------------------------------------------------
ErrorCode CaClientProxy::getData(const CaQuery &query,
- QList<CaEntry *> &sourceList)
+ QList< QSharedPointer<CaEntry> > &sourceList)
{
QList<int> entryIdList;
ErrorCode errorCode = getEntryIds(query, entryIdList);
@@ -709,7 +710,12 @@
{
qDebug() << "CaClientProxy::executeCommand" << "entry id: "
<< entry.id() << "command: " << command;
- return NoErrorCode;
+
+ ErrorCode result = NoErrorCode;
+ if (command != caCmdOpen && command != QString("remove")) {
+ result = UnknownErrorCode;
+ }
+ return result;
}
//----------------------------------------------------------------------------
@@ -717,7 +723,12 @@
//----------------------------------------------------------------------------
ErrorCode CaClientProxy::touch(const CaEntry &entry)
{
- const int id = entry.id();
+ int id = entry.id();
+ if (id <= 0) {
+ const int uid = entry.attribute(
+ QString(APPLICATION_UID_ATTRIBUTE_NAME)).toInt();
+ id = getEntryIdByUid(entry, uid);
+ }
qDebug() << "CaClientProxy::touch" << "id: " << id;
@@ -742,11 +753,11 @@
ErrorCode error = NoErrorCode;
if (success) {
query.exec("commit");
- QList<CaEntry *> entryList;
+ QList< QSharedPointer<CaEntry> > entryList;
if (getData(QList<int>() << id, entryList) == NoErrorCode) {
QList<int> parentIds;
GetParentsIds(QList<int>() << id, parentIds);
- CaNotifiers::Notify(*entryList[0], UpdateChangeType, parentIds);
+ CaNotifiers::NotifyTouched(id);
}
} else {
query.exec("rollback");
@@ -1018,3 +1029,19 @@
}
return success;
}
+
+int CaClientProxy::getEntryIdByUid(const CaEntry &entry, const int uid)
+{
+ int result = -1;
+
+ QSqlQuery query(dbConnection());
+ query.prepare("SELECT ENTRY_ID from CA_ENTRY where EN_UID=?");
+ query.addBindValue(uid);
+ bool success = query.exec();
+
+ if (success && (query.first())) {
+ result = query.value(query.record().indexOf("ENTRY_ID")).toInt();
+ }
+
+ return result;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/caclient/stub/src/camenuiconutility.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include <HbIcon>
+#include <QDir>
+#include <cadefs.h>
+
+#include "camenuiconutility.h"
+#include "caicondescription.h"
+#include "caentry.h"
+
+/*!
+ Get icon when uid is defined.
+ \param entry const reference to CaEntry.
+ \param sie const reference to icon size.
+ \retval icon.
+ */
+HbIcon CaMenuIconUtility::getApplicationIcon(int uid,
+ const QSize &size)
+{
+ HbIcon icon;
+ return icon;
+}
+
+/*!
+ Get icon.
+ \param entry const reference to CaEntry.
+ \param sie const reference to icon size.
+ \retval icon.
+ */
+HbIcon CaMenuIconUtility::getEntryIcon(const CaEntry& entry,
+ const QSize &size)
+{
+ HbIcon icon;
+ QString filename(entry.iconDescription().filename());
+ if (!filename.isEmpty()) {
+ icon = HbIcon(filename);
+ }
+ if (icon.isNull() || !(icon.size().isValid())) {
+ icon = HbIcon(QDir(".").absoluteFilePath("resource/application.png"));
+ }
+ return icon;
+}
+
+
--- a/contentstorage/caclient/stub/src/canotifiers.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/stub/src/canotifiers.cpp Mon May 03 12:48:45 2010 +0300
@@ -55,6 +55,20 @@
}
}
+void CaNotifiers::NotifyTouched(int id)
+{
+ for (NotifierHash::const_iterator i = mNotifiers.constBegin();
+ i != mNotifiers.constEnd();
+ ++i) {
+ const CaNotifierFilter *filter = i.key().first;
+ if (filter->getIds().isEmpty() || filter->getIds().contains(id)) {
+ if (i.key().second == CaNotifierPrivate::EntryTouchedNotifierType) {
+ i.value()->entryTouched(id);
+ }
+ }
+ }
+}
+
void CaNotifiers::Notify(const CaEntry &targetEntry,
ChangeType changeType,
QList<int> &parentIds)
--- a/contentstorage/caclient/stub/src/caobjectadapter.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/stub/src/caobjectadapter.cpp Mon May 03 12:48:45 2010 +0300
@@ -33,9 +33,10 @@
QString filename(entry.iconDescription().filename());
if (!filename.isEmpty()) {
icon = HbIcon(filename);
+ //icon.addBadge( Qt::AlignTop | Qt::AlignRight, HbIcon("qtg_small_hs_widget"));
}
if (icon.isNull() || !(icon.size().isValid())) {
- icon = HbIcon(QDir(".").absoluteFilePath("resource/application.png"));
+ icon = HbIcon("qtg_large_application");
}
return icon;
}
--- a/contentstorage/caclient/stub/src/hswidgetregistryservice.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/caclient/stub/src/hswidgetregistryservice.cpp Mon May 03 12:48:45 2010 +0300
@@ -22,7 +22,6 @@
#include "hswidgetregistryservice.h"
#include "hswidgetregistryservice_p.h"
#include "hswidgetprovidermanifest.h"
-#include "servicefinder.h"
const char POSTERURI[] = "homescreen.nokia.com/widget/poster/";
const char POSTERWIDGETNAME[] = "name";
--- a/contentstorage/cahandler/app/app.pri Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/app/app.pri Mon May 03 12:48:45 2010 +0300
@@ -8,5 +8,6 @@
# Nokia Corporation - initial contribution.
# Contributors:
# Description:
-HEADERS += ./inc/*.h ../inc/*.h
+
+HEADERS += ./inc/*.h
SOURCES += ./src/*.cpp
--- a/contentstorage/cahandler/app/app.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/app/app.pro Mon May 03 12:48:45 2010 +0300
@@ -39,7 +39,6 @@
-lecom \
-lswinstcli \
-lcautils \
- -lcaclient \
-lapgrfx \
-lws32 \
-lapparc \
@@ -47,8 +46,9 @@
-leikcore \
-lcone \
-lefsrv \
+ -lsif \
+ -lscrclient \
-lxqutils
-
exists($${EPOCROOT}epoc32/include/mw/XQSettingsManager):LIBS += -lxqsettingsmanager
}
--- a/contentstorage/cahandler/app/inc/caapphandler.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/app/inc/caapphandler.h Mon May 03 12:48:45 2010 +0300
@@ -24,13 +24,14 @@
class CEikonEnv;
class CCaInnerEntry;
class CCaUninstallOperation;
+class CCaUsifUninstallOperation;
/**
* Command handler for application entries.
*
* @lib caclient.lib
*/
-NONSHARABLE_CLASS( CCaAppHandler )
+NONSHARABLE_CLASS( CCaAppHandler ): public CBase
{
public:
@@ -72,18 +73,48 @@
*/
void LaunchApplicationL( const TUid aUid, const TDesC8 &aParam,
TInt aViewId );
-
+
/**
* Closes application
* @param aEntry the entry represeting application to close
*/
void CloseApplicationL( CCaInnerEntry& aEntry );
+ /**
+ * Uninstall application
+ * @param aEntry the entry represeting application to uninstall
+ */
+ void HandleRemoveL( CCaInnerEntry &aEntry );
+
+ /**
+ * Gets component id
+ * @param aEntry the entry
+ * @param aSoftwareType indicates software type
+ * @return component id
+ */
+ TInt GetComponentIdL( const CCaInnerEntry &aEntry,
+ const TDesC& aSoftwareType );
+
+ /**
+ * Start uninstall operation via usif
+ * @param aComponentId component id
+ */
+ void StartUsifUninstallL( TInt aComponentId );
+
+
+ /**
+ * Start uninstall operation via swi
+ * @param aEntry the entry
+ */
+ void StartSwiUninstallL(CCaInnerEntry &aEntry );
+
+
private:
// data
CEikonEnv* iEikEnv;
CCaUninstallOperation* iUninstallOperation;
+ CCaUsifUninstallOperation* iUsifUninstallOperation;
};
#endif // C_CAAPPHANDLER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/cahandler/app/inc/cas60apphandleradapter.h Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef CA_S60_APP_HANDLER_ADAPTER_H
+#define CA_S60_APP_HANDLER_ADAPTER_H
+
+#include <cadefs.h>
+#include <QString>
+
+#include "cahandler.h"
+
+class CCaInnerEntry;
+
+class CaS60AppHandlerAdapter: public QObject, public CaHandler
+{
+ Q_OBJECT
+ Q_INTERFACES(CaHandler)
+
+public:
+ int execute(CCaInnerEntry &innerEntry, const QString &commandName);
+
+};
+
+#endif // CA_S60_APP_HANDLER_ADAPTER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/cahandler/app/inc/causifuninstalloperation.h Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: ?Description
+ *
+ */
+
+#ifndef C_CAUSIFUNINSTALLOPERATION_H
+#define C_CAUSIFUNINSTALLOPERATION_H
+
+#include <e32base.h>
+#include <usif/sif/sif.h>
+
+using namespace Usif;
+
+/**
+ * Uninstall Operation
+ * Encapsulates the functionality of uninstalling an application.
+ *
+ * @lib caclient.lib
+ */
+NONSHARABLE_CLASS(CCaUsifUninstallOperation): public CActive {
+
+public:
+ /**
+ * Destructor
+ */
+ virtual ~CCaUsifUninstallOperation();
+
+ /**
+ * Two-phased constructor. Leaves on failure.
+ * Allocates memory for and constructs an uninstaller object. After that
+ * starts asynchronous uninnstallation of the requested entry
+ * @param aEntry entry to be uninstalled
+ * @param aPriority priority of the active scheduler responsible for handling
+ * asynchronous installation operation
+ * @return The constructed object.
+ */
+ static CCaUsifUninstallOperation *NewL(TComponentId, TInt aPriority =
+ CActive::EPriorityStandard);
+
+private:
+ // construction
+ /**
+ * Constructor.
+ * Starts active scheduler.
+ * @param aEntry entry to be uninstalle
+ * @param aPriority priority of the active scheduler responsible for handling
+ * asynchronous installation operation
+ */
+ CCaUsifUninstallOperation(TInt aPriority);
+
+ /**
+ * Initializes the object and starts asynchronous uninstallation process.
+ * @param aEntry entry to be uninstalle
+ * asynchronous installation operation
+ */
+ void ConstructL(TComponentId aComponentId);
+
+
+
+private:
+ // from CActive
+
+ void RunL();
+ void DoCancel();
+ TInt RunError(TInt aError);
+
+private:
+ COpaqueNamedParams* iArguments;
+ COpaqueNamedParams* iResults;
+
+ RSoftwareInstall iUninstaller;
+};
+
+#endif // C_CAUSIFUNINSTALLOPERATION_H
--- a/contentstorage/cahandler/app/resource/caapphandlerplugin.s60xml Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<service>
- <name>caapphandlerplugin</name>
- <filepath>z:/hsresources/plugins/commandhandler/caapphandlerplugin.qtplugin</filepath>
- <description></description>
- <interface>
- <name>com.nokia.homescreen.ICommandHandler</name>
- <version>1.0</version>
- <description></description>
- <capabilities></capabilities>
- <customproperty key="entryTypeName">application</customproperty>
- </interface>
-</service>
--- a/contentstorage/cahandler/app/src/caapphandler.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/app/src/caapphandler.cpp Mon May 03 12:48:45 2010 +0300
@@ -24,15 +24,20 @@
#include <AknDef.h>
#include <AknTaskList.h>
+#include <usif/usifcommon.h>
+#include <usif/scr/scr.h>
+
#include "caapphandler.h"
#include "cainnerentry.h"
#include "cauninstalloperation.h"
-#include"catasklist.h"
+#include "causifuninstalloperation.h"
+#include "catasklist.h"
#include "cautils.h"
#include "cadef.h"
// ======== MEMBER FUNCTIONS ========
+using namespace Usif;
// ---------------------------------------------------------------------------
//
@@ -41,6 +46,7 @@
CCaAppHandler::~CCaAppHandler()
{
delete iUninstallOperation;
+ delete iUsifUninstallOperation;
}
// ---------------------------------------------------------------------------
@@ -64,6 +70,7 @@
{
iEikEnv = CEikonEnv::Static();
iUninstallOperation = NULL;
+ iUsifUninstallOperation = NULL;
}
// ---------------------------------------------------------------------------
@@ -81,11 +88,12 @@
void CCaAppHandler::HandleCommandL(
CCaInnerEntry &aEntry, const TDesC8 &aCommand )
{
+
if( aCommand == KCaCmdOpen()
&& aEntry.GetEntryTypeName() == KCaTypeApp() )
{
TInt viewId(-1);
- TBuf<KCaMaxAttrValueLen> viewIdValue;
+ TPtrC viewIdValue;
if( aEntry.FindAttribute( KCaAttrView(), viewIdValue ) )
{
if( MenuUtils::GetTUint( viewIdValue, (TUint &) viewId )
@@ -102,17 +110,9 @@
{
CloseApplicationL( aEntry );
}
- else if ( aCommand == KCaCmdRemove()
- && ( aEntry.GetEntryTypeName() == KCaTypeApp()
- || aEntry.GetEntryTypeName() == KCaTypeWidget() ) )
+ else if ( aCommand == KCaCmdRemove() )
{
- if ( iUninstallOperation && iUninstallOperation->IsActive() )
- {
- User::Leave( KErrInUse );
- }
- delete iUninstallOperation;
- iUninstallOperation = NULL;
- iUninstallOperation = CCaUninstallOperation::NewL( aEntry );
+ HandleRemoveL(aEntry);
}
else
{
@@ -149,20 +149,22 @@
}
else
{
- TApaAppInfo appInfo;
+ // TApaAppInfo size is greater then 1024 bytes
+ // so its instances should not be created on the stack.
+ TApaAppInfo* appInfo = new( ELeave ) TApaAppInfo;
+ CleanupStack::PushL( appInfo );
TApaAppCapabilityBuf capabilityBuf;
RApaLsSession appArcSession;
User::LeaveIfError( appArcSession.Connect() );
CleanupClosePushL<RApaLsSession>( appArcSession );
- User::LeaveIfError( appArcSession.GetAppInfo( appInfo, aUid ) );
+ User::LeaveIfError( appArcSession.GetAppInfo( *appInfo, aUid ) );
User::LeaveIfError( appArcSession.GetAppCapability(
capabilityBuf, aUid ) );
TApaAppCapability &caps = capabilityBuf();
- TFileName appName = appInfo.iFullName;
CApaCommandLine *cmdLine = CApaCommandLine::NewLC();
- cmdLine->SetExecutableNameL( appName );
+ cmdLine->SetExecutableNameL( appInfo->iFullName );
if( caps.iLaunchInBackground )
{
@@ -179,6 +181,7 @@
CleanupStack::PopAndDestroy( cmdLine );
CleanupStack::PopAndDestroy( &appArcSession );
+ CleanupStack::PopAndDestroy( appInfo );
}
CleanupStack::PopAndDestroy( &wsSession );
}
@@ -218,3 +221,103 @@
CleanupStack::PopAndDestroy( &wsSession );
}
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaAppHandler::HandleRemoveL( CCaInnerEntry &aEntry )
+{
+ if (!( aEntry.GetFlags() & ERemovable ) )
+ {
+ User::Leave( KErrAccessDenied );
+ }
+ if ( aEntry.GetEntryTypeName() == KCaTypeApp() )
+ {
+ TComponentId componentId( GetComponentIdL( aEntry,KSoftwareTypeJava ) );
+ if ( componentId != KErrNotFound )
+ {
+ StartUsifUninstallL( componentId );
+ }
+ else
+ {
+ StartSwiUninstallL( aEntry );
+ }
+ }
+ else if ( aEntry.GetEntryTypeName() == KCaTypeWidget() )
+ {
+ StartSwiUninstallL( aEntry );
+ }
+ else if( aEntry.GetEntryTypeName() == KCaTypePackage() )
+ {
+ TPtrC componentId;
+ if ( aEntry.FindAttribute( KCaAttrComponentId, componentId ) )
+ {
+ TInt32 id ;
+ TLex idDesc;
+ idDesc.Assign( componentId );
+ User::LeaveIfError( idDesc.Val( id ) );
+ StartUsifUninstallL( id );
+ }
+ }
+ else
+ {
+ User::Leave( KErrNotSupported );
+ }
+}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CCaAppHandler::GetComponentIdL( const CCaInnerEntry &aEntry,
+ const TDesC& aSoftwareType )
+{
+ TInt id(KErrNotFound);
+ RSoftwareComponentRegistry scr;
+ CleanupClosePushL(scr);
+ User::LeaveIfError(scr.Connect());
+ CComponentFilter* compFilter = CComponentFilter::NewLC();
+ compFilter->AddPropertyL(_L("Uid"), aEntry.GetUid());
+ compFilter->SetSoftwareTypeL(aSoftwareType);
+ RArray<TComponentId> componentIdList;
+ CleanupClosePushL(componentIdList);
+ scr.GetComponentIdsL(componentIdList, compFilter);
+ if (componentIdList.Count() > 0)
+ {
+ id = componentIdList[0];
+ }
+ CleanupStack::PopAndDestroy(&componentIdList);
+ CleanupStack::PopAndDestroy(compFilter);
+ CleanupStack::PopAndDestroy(&scr);
+ return id;
+}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaAppHandler::StartUsifUninstallL( TInt aComponentId )
+{
+ if ( iUsifUninstallOperation && iUsifUninstallOperation->IsActive() )
+ {
+ User::Leave( KErrInUse );
+ }
+ delete iUsifUninstallOperation;
+ iUsifUninstallOperation = NULL;
+ iUsifUninstallOperation = CCaUsifUninstallOperation::NewL( aComponentId );
+}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaAppHandler::StartSwiUninstallL(CCaInnerEntry &aEntry )
+{
+ if ( iUninstallOperation && iUninstallOperation->IsActive() )
+ {
+ User::Leave( KErrInUse );
+ }
+ delete iUninstallOperation;
+ iUninstallOperation = NULL;
+ iUninstallOperation = CCaUninstallOperation::NewL( aEntry );
+}
--- a/contentstorage/cahandler/app/src/caapphandlerplugin.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/app/src/caapphandlerplugin.cpp Mon May 03 12:48:45 2010 +0300
@@ -19,11 +19,11 @@
#include <qserviceinterfacedescriptor.h>
#include <qabstractsecuritysession.h>
#include <qservicecontext.h>
+
#include "cahandlerloader.h"
-
#include "caapphandler.h"
#include "caapphandlerplugin.h"
-#include "cas60handleradapter.h"
+#include "cas60apphandleradapter.h"
/*!
\class CaAppHandlerPlugin
@@ -47,13 +47,12 @@
if (descriptor.interfaceName() ==
"com.nokia.homescreen.ICommandHandler") {
- return new CaS60HandlerAdapter<CCaAppHandler>;
+ return new CaS60AppHandlerAdapter();
} else {
return 0;
}
}
-// TODO: uncomment when it will be used in plugin
-//Q_EXPORT_PLUGIN2(caapphandlerplugin, CaAppHandlerPlugin)
+Q_EXPORT_PLUGIN2(caapphandlerplugin, CaAppHandlerPlugin)
/*!
@@ -81,7 +80,7 @@
*/
/*!
- \fn int CaS60HandlerAdapter<typename Plugin>::execute(const CaEntry &entry, const QString &commandName)
+ \fn int CaS60HandlerAdapter<typename Plugin>::execute(const CaEntry &entry, const QString &commandName)
\param entry Subject of the command.
\param commandName The name of the command to execute.
\return 0 on success, error code otherwise.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/cahandler/app/src/cas60apphandleradapter.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,34 @@
+/*
+ * 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 <XQConversions>
+#include <utf.h>
+#include <QScopedPointer>
+
+#include "cas60apphandleradapter.h"
+#include "caapphandler.h"
+#include "cainnerentry.h"
+
+int CaS60AppHandlerAdapter::execute(CCaInnerEntry &innerEntry, const QString &commandName)
+{
+ QScopedPointer<HBufC8> commandNameDesc8(XQConversions::qStringToS60Desc8(commandName));
+ TRAPD(result,
+ static QScopedPointer<CCaAppHandler> plugin(CCaAppHandler::NewL());
+ plugin->HandleCommandL(innerEntry, commandNameDesc8->Des());
+ );
+ return result;
+}
--- a/contentstorage/cahandler/app/src/cauninstalloperation.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/app/src/cauninstalloperation.cpp Mon May 03 12:48:45 2010 +0300
@@ -18,6 +18,7 @@
#include <apgcli.h>
#include <swi/sisregistrysession.h>
#include <swi/sisregistryentry.h>
+
#include "cautils.h"
#include "cadef.h"
#include "cainnerentry.h"
@@ -69,7 +70,6 @@
//
void CCaUninstallOperation::ConstructL(CCaInnerEntry &aEntry)
{
- TBuf<KCaMaxAttrValueLen> uidAttr;
TUint uid = aEntry.GetUid();
TUid packageUid = KNullUid;
@@ -112,11 +112,15 @@
CleanupClosePushL(apaLsSession);
User::LeaveIfError(apaLsSession.GetAllApps());
- TApaAppInfo appInfo;
- User::LeaveIfError(apaLsSession.GetAppInfo(appInfo, aAppUid));
- if (!GetInstallPkgUidL(appInfo.iFullName, aPackageUid)) {
+ // TApaAppInfo size is greater then 1024 bytes
+ // so its instances should not be created on the stack.
+ TApaAppInfo* appInfo = new(ELeave) TApaAppInfo();
+ CleanupStack::PushL(appInfo);
+ User::LeaveIfError(apaLsSession.GetAppInfo(*appInfo, aAppUid));
+ if (!GetInstallPkgUidL(appInfo->iFullName, aPackageUid)) {
aPackageUid = aAppUid;
}
+ CleanupStack::PopAndDestroy(appInfo);
aMimeType.Set(KAppMimeType);
CleanupStack::PopAndDestroy(&apaLsSession);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/cahandler/app/src/causifuninstalloperation.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,103 @@
+/*
+ * 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 <usif/usifcommon.h>
+#include "cautils.h"
+#include "cadef.h"
+#include "cainnerentry.h"
+#include "causifuninstalloperation.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// CCaUsifUninstallOperation::~CCaUsifUninstallOperation
+// ---------------------------------------------------------------------------
+//
+CCaUsifUninstallOperation::~CCaUsifUninstallOperation()
+ {
+ Cancel();
+ delete iArguments;
+ delete iResults;
+ iUninstaller.Close();
+ }
+
+// ---------------------------------------------------------------------------
+// CCaUsifUninstallOperation::NewL
+// ---------------------------------------------------------------------------
+//
+CCaUsifUninstallOperation *CCaUsifUninstallOperation::NewL(
+ TComponentId aComponentId, TInt aPriority)
+ {
+ CCaUsifUninstallOperation *self = new (ELeave) CCaUsifUninstallOperation(
+ aPriority);
+ CleanupStack::PushL(self);
+ self->ConstructL(aComponentId);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// CCaUsifUninstallOperation::CCaUsifUninstallOperation
+// ---------------------------------------------------------------------------
+//
+CCaUsifUninstallOperation::CCaUsifUninstallOperation( TInt aPriority ) :
+ CActive(aPriority), iUninstaller()
+ {
+ CActiveScheduler::Add(this);
+ }
+
+// ---------------------------------------------------------------------------
+// CCaUsifUninstallOperation::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CCaUsifUninstallOperation::ConstructL(TComponentId aComponentId)
+ {
+ // Silent uninstallation request
+ User::LeaveIfError(iUninstaller.Connect());
+ iArguments = COpaqueNamedParams::NewL();
+ iResults = COpaqueNamedParams::NewL();
+ iArguments->AddIntL(KSifInParam_InstallSilently, 1);
+ iUninstaller.Uninstall(aComponentId, *iArguments, *iResults, iStatus);
+ SetActive();
+ }
+
+// ---------------------------------------------------------------------------
+// CCaUsifUninstallOperation::RunL
+// ---------------------------------------------------------------------------
+//
+void CCaUsifUninstallOperation::RunL()
+ {
+ iUninstaller.Close();
+ }
+
+// ---------------------------------------------------------------------------
+// CCaUsifUninstallOperation::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CCaUsifUninstallOperation::DoCancel()
+ {
+ iUninstaller.CancelOperation();
+ }
+
+// ---------------------------------------------------------------------------
+// CCaUsifUninstallOperation::RunError
+// ---------------------------------------------------------------------------
+//
+TInt CCaUsifUninstallOperation::RunError(TInt /* aError */)
+ {
+ return KErrNone;
+ }
--- a/contentstorage/cahandler/inc/cas60handleradapter.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#ifndef CA_S60_HANDLER_ADAPTER_H
-#define CA_S60_HANDLER_ADAPTER_H
-
-#include <e32des8.h>
-#include <cadefs.h>
-#include <caentry.h>
-#include <QScopedPointer>
-#include <QString>
-#include <utf.h>
-#include <XQConversions>
-
-#include "cainnerentry.h"
-#include "cahandler.h"
-#include "caobjectadapter.h"
-
-template <typename Plugin>
-class CaS60HandlerAdapter: public CaHandler
-{
-public:
- int execute(const CaEntry &entry, const QString &commandName) {
-
- QScopedPointer<HBufC8> commandNameDesc8(XQConversions::qStringToS60Desc8(commandName));
- QScopedPointer<CCaInnerEntry> innerEntry(NULL);
-
- TRAPD(result,
- innerEntry.reset(CCaInnerEntry::NewL());
- CaObjectAdapter::convertL(entry, *innerEntry);
-
- static QScopedPointer<Plugin> plugin(Plugin::NewL());
- plugin->HandleCommandL(*innerEntry, commandNameDesc8->Des());
- );
-
- return result;
- }
-};
-
-
-#endif
--- a/contentstorage/cahandler/tapp/catapphandler.pro Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-TEMPLATE = lib
-TARGET = catapphandlerplugin
-CONFIG += plugin mobility
-MOBILITY = serviceframework
-
-PLUGIN_SUBDIR = /hsresources/plugins/commandhandler
-
-
-include (../../../common.pri)
-
-
-DEPENDPATH += ./inc \
- ./src \
- ../../caclient/s60/inc
-
-INCLUDEPATH += ./inc \
- ../../caclient/s60/inc
-
-
-symbian: {
- TARGET.UID3 = 0x20028710
-
-
- LIBS += -lxqservice \
- -lxqutils
-# -lhsutils
-
-}
-
-
-include(catapphandler.pri)
--- a/contentstorage/cahandler/tapp/catapphandlerplugin.pri Fri Apr 16 15:16:09 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:
-#
-
-HEADERS += ./inc/*.h ../inc/*.h
-SOURCES += ./src/*.cpp
-
-
--- a/contentstorage/cahandler/tapp/inc/catapphandler.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/tapp/inc/catapphandler.h Mon May 03 12:48:45 2010 +0300
@@ -19,25 +19,23 @@
#define CATAPPHANDLER_H
#include <QObject>
+
#include "cahandler.h"
-#include "cadefs.h"
-class CaEntry;
+class CCaInnerEntry;
class XQApplicationManager;
-const QString hsitemLaunchUri("item:launchuri");
-
-class CaTappHandler: public CaHandler
+class CaTappHandler: public QObject, public CaHandler
{
-Q_OBJECT
+ Q_OBJECT
+ Q_INTERFACES(CaHandler)
public:
-
-explicit CaTappHandler(QObject *parent = 0);
+ explicit CaTappHandler(QObject *parent = 0);
~CaTappHandler();
Q_INVOKABLE
- int execute(const CaEntry& entry, const QString& command);
+ int execute(CCaInnerEntry& innerEntry, const QString& command);
private:
XQApplicationManager* mAiwMgr;
--- a/contentstorage/cahandler/tapp/inc/catapphandlerplugin.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/tapp/inc/catapphandlerplugin.h Mon May 03 12:48:45 2010 +0300
@@ -26,8 +26,8 @@
class CaTappHandlerPlugin: public QObject, public QServicePluginInterface
{
-Q_OBJECT
-Q_INTERFACES(QtMobility::QServicePluginInterface)
+ Q_OBJECT
+ Q_INTERFACES(QtMobility::QServicePluginInterface)
public:
QObject *createInstance(const QServiceInterfaceDescriptor &descriptor,
--- a/contentstorage/cahandler/tapp/resource/catapphandlerplugin.s60xml Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<service>
- <name>catapphandlerplugin</name>
- <filepath>z:/hsresources/plugins/commandhandler/catapphandlerplugin.qtplugin</filepath>
- <description>Content Arsenal tapp handler plugin</description>
- <interface>
- <name>com.nokia.homescreen.ICommandHandler</name>
- <version>1.0</version>
- <description> executes commands on tapps </description>
- <capabilities></capabilities>
- </interface>
-</service>
-
--- a/contentstorage/cahandler/tapp/resource/catapphandlerplugin.xml Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/tapp/resource/catapphandlerplugin.xml Mon May 03 12:48:45 2010 +0300
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<service>
<name>catapphandlerplugin</name>
- <filepath>z:/hsresources/plugins/commandhandler/catapphandlerplugin.qtplugin</filepath>
+ <filepath>catapphandlerplugin</filepath>
<description>Content Arsenal tapp handler plugin</description>
<interface>
<name>com.nokia.homescreen.ICommandHandler</name>
<version>1.0</version>
<description> executes commands on tapps </description>
- <customproperty key="entryTypeName">application</customproperty>
+ <customproperty key="entryTypeName">templatedApplication</customproperty>
<capabilities></capabilities>
</interface>
</service>
--- a/contentstorage/cahandler/tapp/src/catapphandler.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/tapp/src/catapphandler.cpp Mon May 03 12:48:45 2010 +0300
@@ -18,11 +18,15 @@
#include <qservicemanager.h>
#include <qservicefilter.h>
#include <qserviceinterfacedescriptor.h>
-
+#include <XQConversions>
#include <xqappmgr.h>
#include "caentry.h"
#include "catapphandler.h"
+#include "cainnerentry.h"
+#include "caclient_defines.h"
+
+_LIT(hsitemLaunchUri, "item:launchuri");
QTM_USE_NAMESPACE
@@ -57,11 +61,15 @@
\param command Description of the command.
\return Error code described in QSERVICEMANAGER.H
*/
-int CaTappHandler::execute(const CaEntry& entry, const QString& command)
+int CaTappHandler::execute(CCaInnerEntry& innerEntry, const QString& command)
{
int error = 0; // this returns Error enum from QSERVICEMANAGER.H
if (command == caCmdOpen) {
- QUrl url(entry.attribute(hsitemLaunchUri)); // f.e. QUrl url ("application://101F7AE7?");
+ TPtrC attribute;
+ innerEntry.FindAttribute(hsitemLaunchUri, attribute);
+
+ // e.g. QUrl url ("application://101F7AE7?");
+ QUrl url(QString::fromUtf16(attribute.Ptr(), attribute.Length()));
QScopedPointer<XQAiwRequest> request(mAiwMgr->create(url, true));
if (!request.isNull()) {
bool res = request->send();
--- a/contentstorage/cahandler/tapp/src/catapphandlerplugin.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/tapp/src/catapphandlerplugin.cpp Mon May 03 12:48:45 2010 +0300
@@ -15,16 +15,9 @@
*
*/
-/*#include <qserviceinterfacedescriptor.h>
- #include <qabstractsecuritysession.h>
- #include <qservicecontext.h>
- */
-
#include "catapphandlerplugin.h"
#include "catapphandler.h"
-#include <cadefs.h>
-
#ifdef COVERAGE_MEASUREMENT
#pragma CTC SKIP
#endif //COVERAGE_MEASUREMENT
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/cahandler/tapp/tapp.pri Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+HEADERS += ./inc/*.h
+SOURCES += ./src/*.cpp
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/cahandler/tapp/tapp.pro Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,49 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = lib
+TARGET = catapphandlerplugin
+CONFIG += plugin mobility
+MOBILITY = serviceframework
+
+PLUGIN_SUBDIR = /hsresources/plugins/commandhandler
+
+
+include (../../../common.pri)
+
+
+DEPENDPATH += ./inc \
+ ./src
+
+INCLUDEPATH += ./inc \
+ ../../caclient/inc \
+ ../../caclient/s60/inc \
+ ../../cautils/inc
+
+
+symbian: {
+ TARGET.UID3 = 0x20028710
+
+
+ LIBS += -lxqservice \
+ -lxqutils \
+ -lcautils
+# -lhsutils
+
+}
+
+
+include(tapp.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/cahandler/url/inc/cas60urlhandleradapter.h Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef CA_S60_URL_HANDLER_ADAPTER_H
+#define CA_S60_URL_HANDLER_ADAPTER_H
+
+#include <QString>
+
+#include "cahandler.h"
+
+class CCaInnerEntry;
+
+class CaS60UrlHandlerAdapter: public QObject, public CaHandler
+{
+ Q_OBJECT
+ Q_INTERFACES(CaHandler)
+
+public:
+ int execute(CCaInnerEntry &innerEntry, const QString &commandName);
+
+};
+
+#endif //CA_S60_URL_HANDLER_ADAPTER_H
--- a/contentstorage/cahandler/url/inc/caurlhandler.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/url/inc/caurlhandler.h Mon May 03 12:48:45 2010 +0300
@@ -34,7 +34,7 @@
*
* @lib caclient.lib
*/
-NONSHARABLE_CLASS( CCaUrlHandler )
+NONSHARABLE_CLASS( CCaUrlHandler ): public CBase
{
public:
--- a/contentstorage/cahandler/url/resource/caurlhandlerplugin.s60xml Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<service>
- <name>caurlhandlerplugin</name>
- <filepath>z:/hsresources/plugins/commandhandler/caurlhandlerplugin.qtplugin</filepath>
- <description></description>
- <interface>
- <name>com.nokia.homescreen.ICommandHandler</name>
- <version>1.0</version>
- <description></description>
- <capabilities></capabilities>
- <customproperty key="entryTypeName">url</customproperty>
- </interface>
-</service>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/cahandler/url/src/cas60urlhandleradapter.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,34 @@
+/*
+ * 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 <XQConversions>
+#include <utf.h>
+#include <QScopedPointer>
+
+#include "cas60urlhandleradapter.h"
+#include "caurlhandler.h"
+#include "cainnerentry.h"
+
+int CaS60UrlHandlerAdapter::execute(CCaInnerEntry &innerEntry, const QString &commandName)
+{
+ QScopedPointer<HBufC8> commandNameDesc8(XQConversions::qStringToS60Desc8(commandName));
+ TRAPD(result,
+ static QScopedPointer<CCaUrlHandler> plugin(CCaUrlHandler::NewL());
+ plugin->HandleCommandL(innerEntry, commandNameDesc8->Des());
+ );
+ return result;
+}
--- a/contentstorage/cahandler/url/src/caurlhandlerplugin.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/url/src/caurlhandlerplugin.cpp Mon May 03 12:48:45 2010 +0300
@@ -22,7 +22,7 @@
#include "cahandlerloader.h"
#include "caurlhandlerplugin.h"
-#include "cas60handleradapter.h"
+#include "cas60urlhandleradapter.h"
#include "caurlhandler.h"
/*!
@@ -35,7 +35,7 @@
\param descriptor Service descriptor.
\param context Ignored.
\param session Ignored.
- \return An instance of the CaS60HandlerAdapter<CCaUrlHandler> when descriptor interface name
+ \return An instance of the CaS60UrlHandlerAdapter<CCaUrlHandler> when descriptor interface name
is "com.nokia.homescreen.ICommandHandler", NULL otherwise.
*/
QObject *CaUrlHandlerPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor,
@@ -47,10 +47,9 @@
if (descriptor.interfaceName() ==
"com.nokia.homescreen.ICommandHandler") {
- return new CaS60HandlerAdapter<CCaUrlHandler>;
+ return new CaS60UrlHandlerAdapter();
} else {
return 0;
}
}
-// TODO: uncomment when it will be a plugin
-//Q_EXPORT_PLUGIN2(caurlhandlerplugin, CaUrlHandlerPlugin)
+Q_EXPORT_PLUGIN2(caurlhandlerplugin, CaUrlHandlerPlugin)
--- a/contentstorage/cahandler/url/url.pri Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/url/url.pri Mon May 03 12:48:45 2010 +0300
@@ -9,5 +9,5 @@
# Contributors:
# Description:
-HEADERS += ./inc/*.h ../inc/*.h
+HEADERS += ./inc/*.h
SOURCES += ./src/*.cpp
--- a/contentstorage/cahandler/url/url.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cahandler/url/url.pro Mon May 03 12:48:45 2010 +0300
@@ -39,7 +39,6 @@
-lecom \
-lswinstcli \
-lcautils \
- -lcaclient \
-lapgrfx \
-lws32 \
-lapparc \
--- a/contentstorage/casrv/caappscanner/group/caappscanner.mmp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/caappscanner/group/caappscanner.mmp Mon May 03 12:48:45 2010 +0300
@@ -57,3 +57,5 @@
LIBRARY efsrv.lib
LIBRARY sisregistryclient.lib
LIBRARY platformenv.lib
+// temporary till cWRT will be in SCR
+LIBRARY WidgetRegistryClient.lib
--- a/contentstorage/casrv/caappscanner/inc/casrvappscanner.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/caappscanner/inc/casrvappscanner.h Mon May 03 12:48:45 2010 +0300
@@ -100,7 +100,7 @@
/**
* Handle Install Event.
* @since S60 v5.0
- * @param aUid installed uid.
+ * @param aUid installed/uninstalled app uid.
*/
void HandleInstallNotifyL( TInt aUid );
@@ -157,12 +157,39 @@
* @result id of download collection
*/
TInt GetCollectionDownloadIdL();
+
+ /**
+ * Gets collectionId of all collection
+ * @result id of all collection
+ */
+ TInt GetAllCollectionIdL();
/**
* Adds application entry to downloaded collection
* @param aEntryId application entry id.
*/
void AddEntryToDownloadedCollectionL( TInt aEntryId );
+
+ /**
+ * Add application entry to predefined collection
+ * @param aEntry application entry.
+ * @param aUpdate is entry updated by a client
+ */
+ 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.
+ */
+ void AddCollectionToAllCollectionL( TInt aCollectionId );
/**
* Removes application entry from downloaded collection
@@ -210,7 +237,7 @@
* @param aUid uid applications
* @return ETrue if app is in rom
*/
- TBool IsInRom( TInt aUid );
+ TBool IsInRomL( TInt aUid );
/**
* Get applications from AppArc
@@ -238,9 +265,9 @@
* contains applications
*/
void RemoveSatAppL( RPointerArray<CCaInnerEntry>& aArray );
-
+
/**
- * Ensure that HsApplicaiton is not visible: Add HsApplication
+ * Ensure that HsApplicaiton is not visible: Add HsApplication
* as hidden to CaStorage or remove HsApplication entry
* from array (found in CaStorage).
* @param aArray RPointerArray with CCaInnerEntries
@@ -298,7 +325,7 @@
* Removes app from storage.
* @param aAppEntry app to remove.
*/
- void CCaSrvAppScanner::RemoveAppL( CCaInnerEntry* aAppEntry );
+ void RemoveAppL( CCaInnerEntry* aAppEntry );
/**
* Adds flag objects(only one flag at time).
@@ -333,7 +360,7 @@
* @param aDefaultDrive drive type.
* @return ETrue if app is installed on given drive type.
*/
- TBool IsAppInDrive( const TUid aUid,
+ TBool IsAppInDriveL( const TUid aUid,
const DriveInfo::TDefaultDrives& aDefaultDrive ) const;
/**
@@ -341,14 +368,14 @@
* @param aUid app uid.
* @return ETrue if app is installed on MMC.
*/
- TBool IsInMmc( const TUid aUid ) const;
+ TBool IsInMmcL( const TUid aUid ) const;
/**
* Check if application is installed on mass storage.
* @param aUid app uid.
* @return ETrue if app is installed on mass storage.
*/
- TBool IsInMassStorage( const TUid aUid ) const;
+ TBool IsInMassStorageL( const TUid aUid ) const;
/**
* Check if drive's status is EDriveInUse.
@@ -383,6 +410,17 @@
* 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
+ */
+ void MakeCollectionVisibleIfHasVisibleEntryL( CCaInnerEntry* aEntry );
private:
// data
@@ -398,6 +436,7 @@
RArray<TInt> iInstalledPackages;
TInt iCollectionDownloadId;
+ TInt iAllCollectionId;
CA_STORAGE_TEST_FRIEND_CLASS (T_casrvAppScaner)
};
--- a/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp Mon May 03 12:48:45 2010 +0300
@@ -20,6 +20,7 @@
#include <swi/sisregistrysession.h>
#include <swi/sisregistryentry.h>
#include <swi/sisregistrypackage.h>
+#include <WidgetRegistryClient.h>
#include "cadef.h"
#include "casrvappscanner.h"
@@ -32,6 +33,8 @@
#include "caarraycleanup.inl"
#include "castorageproxy.h"
+
+
// ==================== LOCAL FUNCTIONS ====================
/**
@@ -135,6 +138,7 @@
User::LeaveIfError( iApaLsSession.GetAllApps() ); // This is async.
iApaLsSession.RegisterListPopulationCompleteObserver( iStatus );
iCollectionDownloadId = 0;
+ iAllCollectionId = 0;
SetActive();
}
@@ -148,6 +152,7 @@
// AppArc app scan complete, we have the app list.
UpdateApplicationEntriesL();
InstallationNotifyL();
+ MakeNotEmptyCollectionsVisibleL();
}
// ---------------------------------------------------------
@@ -221,7 +226,7 @@
toUpdate = HandleMissingFlagUpdate( aEntry ) || toUpdate;
toUpdate = HandleLockDeleteFlagUpdateL( aEntry ) || toUpdate;
toUpdate = SetApaAppInfoL( aEntry ) || toUpdate;
-
+
if( iInstalledPackages.Find( aEntry->GetUid() ) != KErrNotFound )
{
AddEntryToDownloadedCollectionL( aEntry->GetId() );
@@ -232,6 +237,7 @@
//update app in storage
iCaStorageProxy.AddL( aEntry );
RemoveFromInstalledPackages( aEntry->GetUid() );
+ AddEntryToPredefinedCollectionL( aEntry, ETrue );
}
}
// ---------------------------------------------------------
@@ -275,14 +281,14 @@
CCaInnerEntry* aItem, TUint aMmcId )
{
TBool toUpdate( ETrue );
- if( IsInMmc( TUid::Uid( aItem->GetUid() ) ) )
+ if( IsInMmcL( TUid::Uid( aItem->GetUid() ) ) )
{
//app is instaled on mmc - KCaAttrMmcId attribute update
TBuf<KUidChars> uidString;
uidString.Format( KHexFormat, aMmcId );
aItem->AddAttributeL( KCaAttrMmcId, uidString );
}
- else if ( IsInMassStorage( TUid::Uid( aItem->GetUid() ) ) )
+ else if ( IsInMassStorageL( TUid::Uid( aItem->GetUid() ) ) )
{
//its app installed on mass storage, we need to leave it
//in case of connecting usb in mass storage mode
@@ -362,7 +368,7 @@
{
TBool toChange( EFalse );
TBool isVisible = ( ( aItem->GetFlags() & EVisible ) != 0 );
- if( isVisible && IsInRom( aItem->GetUid() ) )
+ if( isVisible && IsInRomL( aItem->GetUid() ) )
{
if( ( aItem->GetFlags() & ERemovable ) != 0 )
{
@@ -441,21 +447,21 @@
appEntry->SetUid( KHsAppUid.iUid );
TInt index = aArray.Find(
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 )
{
aArray[index]->SetFlags( aArray[index]->GetFlags() & ~EVisible);
iCaStorageProxy.AddL( aArray[index] );
- }
+ }
delete aArray[index];
- aArray.Remove( index );
+ aArray.Remove( index );
}
else
{ // if not found add as not visible to the storage
appEntry->SetEntryTypeNameL( KCaTypeApp );
- appEntry->SetFlags( 0 );
+ appEntry->SetFlags( 0 );
appEntry->SetRole( EItemEntryRole );
SetApaAppInfoL( appEntry );
iCaStorageProxy.AddL( appEntry );
@@ -470,23 +476,25 @@
//
void CCaSrvAppScanner::GetApaItemsL( RArray<TCaAppAtributes>& aArray )
{
- TApaAppInfo appInfo;
+ TApaAppInfo* appInfo = new(ELeave) TApaAppInfo();
+ CleanupStack::PushL(appInfo);
TApaAppCapabilityBuf appCap;
User::LeaveIfError( iApaLsSession.GetAllApps( 0 ) );
// for every application get uid, hidden and missing attribute
// and add to aArray.
- while( KErrNone == iApaLsSession.GetNextApp( appInfo ) )
+ while( KErrNone == iApaLsSession.GetNextApp( *appInfo ) )
{
User::LeaveIfError( iApaLsSession.GetAppCapability(
- appCap, appInfo.iUid ) );
+ appCap, appInfo->iUid ) );
// "Hidden" status according to AppArc.
if( !appCap().iAppIsHidden )
{
- TCaAppAtributes appAtributes( appInfo.iUid.iUid );
+ TCaAppAtributes appAtributes( appInfo->iUid.iUid );
aArray.AppendL( appAtributes );
}
}
+ CleanupStack::PopAndDestroy(appInfo);
}
// ---------------------------------------------------------
@@ -534,6 +542,36 @@
}
// ---------------------------------------------------------
+// CCaSrvAppScanner::GetAllCollectionIdL
+// ---------------------------------------------------------
+//
+TInt CCaSrvAppScanner::GetAllCollectionIdL()
+ {
+ if( iAllCollectionId == 0 )
+ {
+ CCaInnerQuery *getAllCollectionIdQuery = CCaInnerQuery::NewLC();
+ CDesC16ArrayFlat *typenameArray = new(ELeave) CDesC16ArrayFlat(
+ KDefaultGranularity );
+ CleanupStack::PushL( typenameArray );
+ typenameArray->AppendL( KCaTypeMenuCollections );
+ getAllCollectionIdQuery->SetEntryTypeNames( typenameArray );
+ CleanupStack::Pop( typenameArray );
+
+ RArray<TInt> idArray;
+ CleanupClosePushL( idArray );
+ iCaStorageProxy.GetEntriesIdsL( getAllCollectionIdQuery,
+ idArray );
+ if( idArray.Count() )
+ {
+ iAllCollectionId = idArray[0];
+ }
+ CleanupStack::PopAndDestroy( &idArray );
+ CleanupStack::PopAndDestroy( getAllCollectionIdQuery );
+ }
+ return iAllCollectionId;
+ }
+
+// ---------------------------------------------------------
// CCaSrvAppScanner::GetMcsItemsL
// ---------------------------------------------------------
//
@@ -652,7 +690,7 @@
void CCaSrvAppScanner::AddEntryToDownloadedCollectionL( TInt aEntryId )
{
TCaOperationParams params = { TCaOperationParams::EPrepend, GetCollectionDownloadIdL(), 0 // not used
- };
+ };
RArray<TInt> entryIds;
CleanupClosePushL( entryIds );
@@ -663,13 +701,124 @@
}
// ---------------------------------------------------------
+// CCaSrvAppScanner::AddEntryToPredefinedCollectionL
+// ---------------------------------------------------------
+//
+void CCaSrvAppScanner::AddEntryToPredefinedCollectionL(
+ CCaInnerEntry* aEntry, TBool aUpdate )
+ {
+ TApaAppCapabilityBuf capability;
+ User::LeaveIfError( iApaLsSession.GetAppCapability( capability,
+ TUid::Uid( aEntry->GetUid() ) ) );
+
+ if( capability().iGroupName.Length() )
+ {
+ // appgroup_name is defined for this app. Find or create folder.
+ CCaInnerQuery *innerQuery = CCaInnerQuery::NewLC();
+ innerQuery->SetRole( CCaInnerQuery::Group );
+ innerQuery->AddAttributeL( KCaAppGroupName,
+ capability().iGroupName );
+
+ // get entries by attributes
+ RPointerArray<CCaInnerEntry> resultArrayItems;
+ CleanupResetAndDestroyPushL( resultArrayItems );
+ iCaStorageProxy.GetEntriesL( innerQuery, resultArrayItems );
+
+ RArray<TInt> entryIds;
+ CleanupClosePushL( entryIds );
+ TInt entryId = aEntry->GetId();
+ entryIds.AppendL( entryId );
+ TCaOperationParams organizeParams;
+ organizeParams.iBeforeEntryId = 0;
+
+ if( resultArrayItems.Count() )
+ {
+ // collection with appgroup_name exist - add entry
+ // to this collection
+ organizeParams.iGroupId = resultArrayItems[0]->GetId();
+ }
+ else
+ {
+ // create new collection
+ TInt predefinedCollectionId = CreatePredefinedCollectionL(
+ capability().iGroupName );
+
+ organizeParams.iGroupId = predefinedCollectionId;
+
+ // 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 );
+ }
+ }
+
+// ---------------------------------------------------------
+// CCaSrvAppScanner::CreatePredefinedCollectionL
+// ---------------------------------------------------------
+//
+TInt CCaSrvAppScanner::CreatePredefinedCollectionL( const TDesC& aGroupName )
+ {
+ CCaInnerEntry *innerEntry = CCaInnerEntry::NewLC();
+ innerEntry->SetTextL( aGroupName );
+ innerEntry->SetEntryTypeNameL( KCaTypeCollection );
+ innerEntry->SetRole( CCaInnerQuery::Group );
+ innerEntry->AddAttributeL( KCaAppGroupName, aGroupName );
+ innerEntry->SetFlags( EVisible );
+ innerEntry->SetFlags( innerEntry->GetFlags() | ERemovable );
+ _LIT( KCollectionIconFileName, "qtg_large_applications_user");
+ innerEntry->SetIconDataL( KCollectionIconFileName,
+ KNullDesC, KNullDesC );
+ iCaStorageProxy.AddL( innerEntry );
+ // Get new collection Id
+ TInt newCollectionId = innerEntry->GetId();
+ CleanupStack::PopAndDestroy( innerEntry );
+
+ return newCollectionId;
+ }
+
+// ---------------------------------------------------------
+// CCaSrvAppScanner::AddCollectionToAllCollectionL
+// ---------------------------------------------------------
+//
+void CCaSrvAppScanner::AddCollectionToAllCollectionL( TInt aCollectionId )
+ {
+ RArray<TInt> entryIds;
+ CleanupClosePushL( entryIds );
+ entryIds.AppendL( aCollectionId );
+
+ TCaOperationParams organizeParams;
+ organizeParams.iBeforeEntryId = 0;
+ organizeParams.iOperationType = TCaOperationParams::EAppend;
+ organizeParams.iGroupId = GetAllCollectionIdL();
+ iCaStorageProxy.OrganizeL( entryIds, organizeParams );
+ CleanupStack::PopAndDestroy( &entryIds );
+ }
+
+
+
+// ---------------------------------------------------------
// CCaSrvAppScanner::RemoveToDownloadedCollectionL
// ---------------------------------------------------------
//
void CCaSrvAppScanner::RemoveEntryFromDownloadedL( TInt aEntryId )
{
TCaOperationParams params = { TCaOperationParams::ERemove, GetCollectionDownloadIdL(), 0 // not used
- };
+ };
RArray<TInt> entryIds;
CleanupClosePushL( entryIds );
@@ -713,6 +862,9 @@
HandleMmcAttrUpdateL( appEntry, aCurrentMmcId );
iCaStorageProxy.AddL( appEntry );
+
+ AddEntryToPredefinedCollectionL( appEntry );
+
if( iInstalledPackages.Find( aUid ) != KErrNotFound )
{
AddEntryToDownloadedCollectionL( appEntry->GetId() );
@@ -759,6 +911,29 @@
changed = ETrue;
}
CleanupStack::PopAndDestroy( &attrVal );
+ // check if its java app and add attr for entrys
+ TUid appTypeUid;
+ if( KErrNone == iApaLsSession.GetAppType( appTypeUid, info.iUid ) )
+ {
+ if( appTypeUid == KMidletApplicationTypeUid )
+ {
+ aEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueJava );
+ aEntry->AddAttributeL( KCaAttrAppSettingsPlugin, KCaAttrJavaAppSettingsPluginValue );
+ }
+ else if (appTypeUid == KCWRTApplicationTypeUid)
+ {
+ aEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueCWRT );
+ aEntry->AddAttributeL( KCaAttrAppWidgetUri, KCaAttrAppWidgetUriCWRTValue );
+ // web id should be taken from SCR when supported
+ RWidgetRegistryClientSession wrtSession;
+ CleanupClosePushL(wrtSession);
+ User::LeaveIfError( wrtSession.Connect());
+ TFileName bundleId;
+ wrtSession.GetWidgetBundleId(info.iUid, bundleId);
+ aEntry->AddAttributeL( KCaAttrAppWidgetParamWebAppId, bundleId );
+ CleanupStack::PopAndDestroy(&wrtSession);
+ }
+ }
}
return changed;
}
@@ -794,12 +969,13 @@
}
else
{
- RemoveAppL( aCaEntries[i] );
+ //RemoveAppL( aCaEntries[i] );
+ AddObjectFlagL( aCaEntries[i], EMissing );
}
}
else
{
- RemoveAppL( aCaEntries[i] );
+ AddObjectFlagL( aCaEntries[i], EMissing );
}
CleanupStack::PopAndDestroy( &attrVal );
}
@@ -898,48 +1074,49 @@
}
// ---------------------------------------------------------
-// CCaSrvAppScanner::IsAppInDrive
+// CCaSrvAppScanner::IsAppInDriveL
// ---------------------------------------------------------
//
-TBool CCaSrvAppScanner::IsAppInDrive(
+TBool CCaSrvAppScanner::IsAppInDriveL(
const TUid aUid,
const DriveInfo::TDefaultDrives& aDefaultDrive ) const
{
TBool ret( EFalse );
- TApaAppInfo info;
- TInt err = iApaLsSession.GetAppInfo( info, aUid );
- if( !err && IsFileInDrive( info.iFullName, aDefaultDrive ) )
+ TApaAppInfo* appInfo = new( ELeave ) TApaAppInfo();
+ TInt err = iApaLsSession.GetAppInfo( *appInfo, aUid );
+ if( !err && IsFileInDrive( appInfo->iFullName, aDefaultDrive ) )
{
ret = ETrue;
}
+ delete appInfo;
return ret;
}
// ---------------------------------------------------------
-// CCaSrvAppScanner::IsInMmc
+// CCaSrvAppScanner::IsInMmcL
// ---------------------------------------------------------
//
-TBool CCaSrvAppScanner::IsInMmc( const TUid aUid ) const
+TBool CCaSrvAppScanner::IsInMmcL( const TUid aUid ) const
{
- return IsAppInDrive( aUid, DriveInfo::EDefaultRemovableMassStorage );
+ return IsAppInDriveL( aUid, DriveInfo::EDefaultRemovableMassStorage );
}
// ---------------------------------------------------------
-// CCaSrvAppScanner::IsInMassStorage
+// CCaSrvAppScanner::IsInMassStorageL
// ---------------------------------------------------------
//
-TBool CCaSrvAppScanner::IsInMassStorage( const TUid aUid ) const
+TBool CCaSrvAppScanner::IsInMassStorageL( const TUid aUid ) const
{
- return IsAppInDrive( aUid, DriveInfo::EDefaultMassStorage );
+ return IsAppInDriveL( aUid, DriveInfo::EDefaultMassStorage );
}
// ---------------------------------------------------------
-// CCaSrvAppScanner::IsInRom
+// CCaSrvAppScanner::IsInRomL
// ---------------------------------------------------------
//
-TBool CCaSrvAppScanner::IsInRom( TInt aUid )
+TBool CCaSrvAppScanner::IsInRomL( TInt aUid )
{
- return IsAppInDrive( TUid::Uid( aUid ), DriveInfo::EDefaultRom );
+ return IsAppInDriveL( TUid::Uid( aUid ), DriveInfo::EDefaultRom );
}
// ---------------------------------------------------------
@@ -966,6 +1143,54 @@
return inUse;
}
+void CCaSrvAppScanner::MakeNotEmptyCollectionsVisibleL()
+ {
+ RPointerArray<CCaInnerEntry> resultArray;
+ CleanupResetAndDestroyPushL( resultArray );
+ CCaInnerQuery* hiddenCollectionsQuery = CCaInnerQuery::NewLC();
+ CDesC16ArrayFlat* entryType = new ( ELeave ) CDesC16ArrayFlat(
+ KGranularityOne );
+ CleanupStack::PushL( entryType );
+ entryType->AppendL( KCaTypeCollection );
+ hiddenCollectionsQuery->SetEntryTypeNames( entryType );
+ hiddenCollectionsQuery->SetFlagsOff( EVisible );
+ iCaStorageProxy.GetEntriesL( hiddenCollectionsQuery, resultArray );
+ CleanupStack::Pop( entryType );
+ CleanupStack::PopAndDestroy( hiddenCollectionsQuery );
+ if( resultArray.Count() )
+ {
+ for( TInt i=0; i<resultArray.Count(); i++ )
+ {
+ // for any not visible collection
+ MakeCollectionVisibleIfHasVisibleEntryL( resultArray[i] );
+ }
+ }
+ CleanupStack::PopAndDestroy( &resultArray );
+ }
+
+void CCaSrvAppScanner::MakeCollectionVisibleIfHasVisibleEntryL(
+ CCaInnerEntry* aEntry )
+ {
+ RPointerArray<CCaInnerEntry> resultEntriesArray;
+ CleanupResetAndDestroyPushL( resultEntriesArray );
+ CCaInnerQuery* visibleEntriesQuery = CCaInnerQuery::NewLC();
+ visibleEntriesQuery->SetParentId( aEntry->GetId() );
+ visibleEntriesQuery->SetFlagsOn( EVisible );
+ visibleEntriesQuery->SetFlagsOff( EMissing );
+ iCaStorageProxy.GetEntriesL( visibleEntriesQuery, resultEntriesArray );
+ if( resultEntriesArray.Count() )
+ {
+ // set collection visible if hidden
+ if( HandleHiddenFlagUpdateL( aEntry ) )
+ {
+ // update here this collection
+ iCaStorageProxy.AddL( aEntry, ETrue );
+ }
+ }
+ CleanupStack::PopAndDestroy( visibleEntriesQuery );
+ CleanupStack::PopAndDestroy( &resultEntriesArray );
+ }
+
// ==================== MEMBER FUNCTIONS ====================
// ---------------------------------------------------------
--- a/contentstorage/casrv/carunningappmonitor/group/carunningappmonitor.mmp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/carunningappmonitor/group/carunningappmonitor.mmp Mon May 03 12:48:45 2010 +0300
@@ -39,7 +39,6 @@
USERINCLUDE ../../../inc
USERINCLUDE ../../../srvinc
USERINCLUDE ../../../cautils/inc
-USERINCLUDE ../../../domain/menu_content_service_api/inc
APP_LAYER_SYSTEMINCLUDE
--- a/contentstorage/casrv/causifscanner/data/causifscanner.rss Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/causifscanner/data/causifscanner.rss Mon May 03 12:48:45 2010 +0300
@@ -12,7 +12,7 @@
* Contributors:
*
* Description: caappscanner.rss
-* ECOM DLL UID: 2002870A
+* ECOM DLL UID: 2002870A
* ECOM interface UID: (KCaSrvPluginInterfaceUid)
* ECOM Implementation: 2002870B
*
--- a/contentstorage/casrv/causifscanner/group/causifscanner.mmp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/causifscanner/group/causifscanner.mmp Mon May 03 12:48:45 2010 +0300
@@ -52,3 +52,4 @@
LIBRARY cautils.lib
LIBRARY camenu.lib
LIBRARY bafl.lib
+LIBRARY efsrv.lib
--- a/contentstorage/casrv/causifscanner/inc/causifscanner.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/causifscanner/inc/causifscanner.h Mon May 03 12:48:45 2010 +0300
@@ -24,6 +24,8 @@
#include <usif/scr/scr.h>
#include "casrvplugin.h"
+#include "cainstallnotifier.h"
+#include "cammcwatcher.h"
class CCaStorageProxy;
class CCaInnerEntry;
@@ -33,45 +35,166 @@
/*
An implementation of the CCaSrvPlugin interface for the Reference Installer.
- The CaSrvManager loads and uses this plug-in when the MIME type of a package is 'binary/sif-refpkg'.
+ The CaSrvManager loads and uses this plug-in when the MIME type of a package
+ is 'binary/sif-refpkg'.
*/
-NONSHARABLE_CLASS(CCaUsifScanner): public CCaSrvPlugin
+NONSHARABLE_CLASS(CCaUsifScanner): public CCaSrvPlugin,
+ public MCaInstallListener, public MMmcWatcherCallback
{
public:
+
+ /**
+ * Two-phased constructor.
+ * @param aPLuginParam plugin param consist of storage, storage utils.
+ * @retval New object.
+ */
static CCaUsifScanner* NewL( TPluginParams* aPluginParams );
+
+ /**
+ * Destructor.
+ */
~CCaUsifScanner();
- void InstallL( const TDesC& aFileName );
+ /**
+ * Installs application.
+ * @param aFileName File name to be installed.
+ */
+ // void InstallL( const TDesC& aFileName );
+
+public:
+ // from MCaInstallListener
+
+ /**
+ * Handle Install/Uninstall Event.
+ * @since S60 v5.0
+ * @param aUid installed uid.
+ */
+ void HandleInstallNotifyL( TInt aUid );
+
+ /**
+ * MmcChangeL is called when the MMC is removed or inserted.
+ */
+ void MmcChangeL();
private:
+
+ /**
+ * Constructor
+ * @param aStorageProxy Storage handler.
+ */
CCaUsifScanner( CCaStorageProxy& aStorageProxy );
+
+ /**
+ * Second phased constructor.
+ */
void ConstructL();
+
+ /**
+ * Copy constructor.
+ */
CCaUsifScanner( const CCaUsifScanner & );
+
+ /**
+ * Operator "=". Assigns new object.
+ *
+ */
CCaUsifScanner& operator =( const CCaUsifScanner & );
- void AddCollectionUsifL();
- TInt GetCollectionUsifIdL();
-
+ /**
+ * Creates AppLib's entry from Usif's entry
+ * @param aEntry Usif entry obtained from Sif database.
+ * @param aCaEntry AppLib entry to be filled from Usif entry.
+ */
void CreateCaEntryFromEntryL( const CComponentEntry* aEntry,
CCaInnerEntry* aCaEntry );
- void AddNativeAppsL();
+ /**
+ * Adds package to database. Scans Sif db and adds entries to AppLib db.
+ */
+ void AddPackageL();
+
+ /**
+ * Updates package in the database.
+ */
+ void UpdatePackagesL();
+
+ /**
+ * Gets entries from AppLib story.
+ * @param aArray Array of entries to be obtained from db.
+ */
+ void GetCaPackageEntriesL( RPointerArray<CCaInnerEntry>& aArray );
+
+ /**
+ * Gets entries from Usif story.
+ * @param aArray Array of entries to be obtained from db.
+ */
+ void GetUsifPackageEntriesL( RPointerArray<CComponentEntry>& aArray );
- void GetCaAppEntriesL( RPointerArray<CCaInnerEntry>& aArray );
+ /**
+ * Checks if entry exists in AppLib db.
+ * @param aArray Array of entries from AppLib db.
+ * @param aEntry Entry data to be checked if exists.
+ * @retval Returns array index if exists, otherwise KErrNotFound.
+ */
+ TInt PackageExistL( RPointerArray<CCaInnerEntry>& aArray,
+ const CComponentEntry* aEntry );
- TInt AppExist( RPointerArray<CCaInnerEntry>& aArray,
- CCaInnerEntry* aEntry );
+ /**
+ * Finds deleted entries from Usif. Updates aCaArray.
+ * @param aCaArray Entries from AppLib db.
+ * @param aUsifArray Entries from Usif db.
+ */
+ void FindDeletedEntriesL( RPointerArray<CCaInnerEntry>& aCaArray,
+ const RPointerArray<CComponentEntry>& aUsifArray );
+
+ /**
+ * Removes entries from db.
+ * @param aCaArray Entries to be removed.
+ */
+ void RemoveEntriesFromDbL( RPointerArray<CCaInnerEntry>& aCaArray );
+
+ /**
+ * Update usif list.
+ */
+ void UpdateUsifListL();
private:
- /*
+ /**
* not own
+ * Storage proxy.
*/
CCaStorageProxy& iStorageProxy;
- /*
- * Usif Collection id. Temporary solution.
+ /**
+ * Install notifier. Own.
+ */
+ CCaInstallNotifier *iSystemInstallNotifier;
+
+ /**
+ * Uninstall notifier. Own.
+ */
+ CCaInstallNotifier *iUsifUninstallNotifier;
+
+ /**
+ * Install and uninstall notifier. Own.
*/
- TInt iCollectionUsifId;
+ CCaInstallNotifier *iJavaInstallNotifier;
+
+ /**
+ * File session. Own
+ */
+ RFs iFs;
+
+ /**
+ * Mmc watcher. Own.
+ */
+ CCaMmcWatcher* iMmcWatcher;
+
+ /**
+ * Software component registry. Own.
+ */
+ RSoftwareComponentRegistry iSoftwareRegistry;
+
};
#endif // CAUSIFSCANNER_H
--- a/contentstorage/casrv/causifscanner/src/causifscanner.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/causifscanner/src/causifscanner.cpp Mon May 03 12:48:45 2010 +0300
@@ -31,17 +31,14 @@
using namespace Usif;
-_LIT( KUsifPluginCollection, "Usif collection");
-_LIT( KCaAttrComponentId, "component_id" );
-
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
//
CCaUsifScanner* CCaUsifScanner::NewL( TPluginParams* aPluginParams )
{
- CCaUsifScanner* self = new ( ELeave )
- CCaUsifScanner( *aPluginParams->storageProxy );
+ CCaUsifScanner* self = new ( ELeave ) CCaUsifScanner(
+ *aPluginParams->storageProxy );
CleanupStack::PushL( self );
self->ConstructL();
CleanupStack::Pop( self );
@@ -55,7 +52,6 @@
CCaUsifScanner::CCaUsifScanner( CCaStorageProxy& aStorageProxy ) :
iStorageProxy( aStorageProxy )
{
-
}
// ---------------------------------------------------------------------------
@@ -64,8 +60,21 @@
//
void CCaUsifScanner::ConstructL()
{
- AddCollectionUsifL();
- AddNativeAppsL();
+ iSystemInstallNotifier = CCaInstallNotifier::NewL( *this,
+ CCaInstallNotifier::ESisInstallNotification );
+
+ iUsifUninstallNotifier = CCaInstallNotifier::NewL( *this,
+ CCaInstallNotifier::EUsifUninstallNotification );
+
+ iJavaInstallNotifier = CCaInstallNotifier::NewL( *this,
+ CCaInstallNotifier::EJavaInstallNotification );
+
+ User::LeaveIfError( iFs.Connect() );
+ iMmcWatcher = CCaMmcWatcher::NewL( iFs, this );
+
+ User::LeaveIfError( iSoftwareRegistry.Connect() );
+
+ UpdateUsifListL();
}
// ---------------------------------------------------------------------------
@@ -74,84 +83,65 @@
//
CCaUsifScanner::~CCaUsifScanner()
{
- }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaUsifScanner::InstallL( const TDesC& aFileName )
- {
- RSoftwareInstall sif;
- CleanupClosePushL( sif );
- User::LeaveIfError( sif.Connect());
-
- // Install the component
- TRequestStatus status;
- sif.Install( aFileName, status, EFalse );
- User::WaitForRequest( status );
- User::LeaveIfError(status.Int());
-
- // Disconnect from the SIF server
- CleanupStack::PopAndDestroy( &sif );
+ delete iMmcWatcher;
+ delete iSystemInstallNotifier;
+ delete iUsifUninstallNotifier;
+ delete iJavaInstallNotifier;
+ iFs.Close();
+ iSoftwareRegistry.Close();
}
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
//
-void CCaUsifScanner::AddCollectionUsifL()
+/*void CCaUsifScanner::InstallL( const TDesC& aFileName )
+ {
+ RSoftwareInstall sif;
+ CleanupClosePushL( sif );
+ User::LeaveIfError( sif.Connect());
+
+ // Install the component
+ TRequestStatus status;
+ sif.Install( aFileName, status, EFalse );
+ User::WaitForRequest( status );
+ User::LeaveIfError(status.Int());
+
+ // Disconnect from the SIF server
+ CleanupStack::PopAndDestroy( &sif );
+ }*/
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaUsifScanner::HandleInstallNotifyL( TInt /*aUid*/)
{
- if( GetCollectionUsifIdL() == 0 )
- {
- CCaInnerEntry *entry = CCaInnerEntry::NewLC();
- entry->SetRole( EGroupEntryRole );
- entry->SetEntryTypeNameL( KCaTypeCollection );
- entry->SetFlags( ERemovable | EVisible );
- entry->SetTextL( KUsifPluginCollection );
- iStorageProxy.AddL( entry );
- iCollectionUsifId = entry->GetId();
- CleanupStack::PopAndDestroy( entry );
-
- TCaOperationParams params =
- {
- TCaOperationParams::EPrepend, 2, 0
- };
- RArray<TInt> ids;
- CleanupClosePushL( ids );
- ids.AppendL( iCollectionUsifId );
- iStorageProxy.OrganizeL( ids, params );
- CleanupStack::PopAndDestroy( &ids );
- }
+ UpdateUsifListL();
}
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
//
-TInt CCaUsifScanner::GetCollectionUsifIdL()
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT
+void CCaUsifScanner::MmcChangeL()
{
- if( iCollectionUsifId == 0 )
- {
- RPointerArray<CCaInnerEntry> resultArray;
- CleanupResetAndDestroyPushL( resultArray );
- CCaInnerQuery* allAppQuery = CCaInnerQuery::NewLC();
- CDesC16ArrayFlat* appType = new ( ELeave ) CDesC16ArrayFlat( 1 );
- CleanupStack::PushL( appType );
- appType->AppendL( KCaTypeCollection );
- allAppQuery->SetEntryTypeNames( appType );
- allAppQuery->SetRole(CCaInnerQuery::Group);
- CleanupStack::Pop( appType );
- iStorageProxy.GetEntriesL( allAppQuery, resultArray );
- CleanupStack::PopAndDestroy( allAppQuery );
- for(TInt i(0); i< resultArray.Count(); i++ )
- {
- if(!resultArray[i]->GetText().Compare(KUsifPluginCollection))
- iCollectionUsifId = resultArray[i]->GetId();
- }
- CleanupStack::PopAndDestroy( &resultArray );
- }
- return iCollectionUsifId;
+ UpdateUsifListL();
+ }
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaUsifScanner::UpdateUsifListL()
+ {
+ AddPackageL();
+ UpdatePackagesL();
}
// ---------------------------------------------------------------------------
@@ -162,10 +152,19 @@
const CComponentEntry* aEntry, CCaInnerEntry* aCaEntry )
{
aCaEntry->SetRole( EItemEntryRole );
- aCaEntry->SetEntryTypeNameL(KCaTypeApp);
- if( aEntry->Name().Compare(KNullDesC))
+ aCaEntry->SetEntryTypeNameL( KCaTypePackage );
+ if( !aEntry->SoftwareType().Compare( KSoftwareTypeNative ) )
+ {
+ aCaEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueNative );
+ }
+ else if( !aEntry->SoftwareType().Compare( KSoftwareTypeJava ) )
{
- aCaEntry->SetTextL(aEntry->Name());
+ aCaEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueJava );
+ }
+ if( aEntry->Name().Compare( KNullDesC ) )
+ {
+ aCaEntry->SetTextL( aEntry->Name() );
+ aCaEntry->AddAttributeL( KCaAttrLongName, aEntry->Name() );
}
if( !aEntry->IsHidden() )
{
@@ -175,92 +174,77 @@
{
aCaEntry->SetFlags( aCaEntry->GetFlags() | ERemovable );
}
- if( aEntry->GlobalId().Compare( KNullDesC ) )
- {
- TLex lex( aEntry->GlobalId() );
- TUint uint( 0 );
- User::LeaveIfError( lex.Val( uint, EHex ) );
- aCaEntry->SetUid( uint );
- }
+ // entries obtained with usif should have component id.
+ //it's needed for uninstalling
RBuf compIdDesc;
- CleanupClosePushL(compIdDesc);
- compIdDesc.CreateL(KCaMaxAttrValueLen);
- compIdDesc.Num(aEntry->ComponentId());
+ CleanupClosePushL( compIdDesc );
+ compIdDesc.CreateL( KCaMaxAttrValueLen );
+ compIdDesc.Num( aEntry->ComponentId() );
aCaEntry->AddAttributeL( KCaAttrComponentId, compIdDesc );
CleanupStack::PopAndDestroy( &compIdDesc );
-
}
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
//
-void CCaUsifScanner::AddNativeAppsL()
+void CCaUsifScanner::AddPackageL()
{
- TLanguage locale = TLanguage(-1);
-
- CComponentFilter *filter = CComponentFilter::NewL();
- CleanupStack::PushL(filter);
- filter->SetSoftwareTypeL( KSoftwareTypeNative );
- filter->SetRemovable(ETrue);
-
- // Connect to the SCR server
- RSoftwareComponentRegistry *scr = new RSoftwareComponentRegistry();
- CleanupClosePushL(*scr);
- User::LeaveIfError( scr->Connect() );
-
- // Create an SCR view
- RSoftwareComponentRegistryView *scrView =
- new RSoftwareComponentRegistryView();
- CleanupClosePushL(*scrView);
- scrView->OpenViewL( *scr, filter );
-
- // Iterate over the matching components
- CComponentEntry* entry = CComponentEntry::NewLC();
-
RPointerArray<CCaInnerEntry> entries;
CleanupResetAndDestroyPushL( entries );
- GetCaAppEntriesL(entries);
+ GetCaPackageEntriesL( entries );
- RArray<TInt> entryIds;
- CleanupClosePushL(entryIds);
- while( scrView->NextComponentL( *entry, locale ) )
+ RPointerArray<CComponentEntry> resultUsifArray;
+ CleanupResetAndDestroyPushL( resultUsifArray );
+ GetUsifPackageEntriesL( resultUsifArray );
+
+ for( TInt idx(0); idx < resultUsifArray.Count(); idx++ )
{
- CCaInnerEntry *caEntry = CCaInnerEntry::NewLC();
- CreateCaEntryFromEntryL( entry, caEntry );
-
- if( !AppExist(entries, caEntry))
+ if( PackageExistL( entries, resultUsifArray[idx] ) == KErrNotFound )
{
+ CCaInnerEntry *caEntry = CCaInnerEntry::NewLC();
+ CreateCaEntryFromEntryL( resultUsifArray[idx], caEntry );
iStorageProxy.AddL( caEntry );
- entryIds.Append( caEntry->GetId() );
+ CleanupStack::PopAndDestroy( caEntry );
}
- CleanupStack::PopAndDestroy( caEntry );
}
- TCaOperationParams params =
- {
- TCaOperationParams::EAppend, iCollectionUsifId, 0
- };
- iStorageProxy.OrganizeL( entryIds, params );
- CleanupStack::PopAndDestroy( &entryIds );
+ CleanupStack::PopAndDestroy( &resultUsifArray );
CleanupStack::PopAndDestroy( &entries );
- CleanupStack::PopAndDestroy( entry );
- CleanupStack::PopAndDestroy(scrView);
- CleanupStack::PopAndDestroy(scr);
- CleanupStack::PopAndDestroy(filter);
}
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
//
-void CCaUsifScanner::GetCaAppEntriesL(
+void CCaUsifScanner::UpdatePackagesL()
+ {
+ RPointerArray<CCaInnerEntry> resultCaArray;
+ CleanupResetAndDestroyPushL( resultCaArray );
+ GetCaPackageEntriesL( resultCaArray );
+
+ RPointerArray<CComponentEntry> resultUsifArray;
+ CleanupResetAndDestroyPushL( resultUsifArray );
+ GetUsifPackageEntriesL( resultUsifArray );
+
+ FindDeletedEntriesL( resultCaArray, resultUsifArray );
+ RemoveEntriesFromDbL( resultCaArray );
+
+ CleanupStack::PopAndDestroy( &resultUsifArray );
+ CleanupStack::PopAndDestroy( &resultCaArray );
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaUsifScanner::GetCaPackageEntriesL(
RPointerArray<CCaInnerEntry>& aArray )
{
CCaInnerQuery* allAppQuery = CCaInnerQuery::NewLC();
CDesC16ArrayFlat* appType = new ( ELeave ) CDesC16ArrayFlat( 1 );
CleanupStack::PushL( appType );
- appType->AppendL( KCaTypeApp );
+ appType->AppendL( KCaTypePackage );
allAppQuery->SetEntryTypeNames( appType );
CleanupStack::Pop( appType );
iStorageProxy.GetEntriesL( allAppQuery, aArray );
@@ -271,13 +255,108 @@
//
// ---------------------------------------------------------------------------
//
-TInt CCaUsifScanner::AppExist( RPointerArray<CCaInnerEntry>& aArray,
- CCaInnerEntry* aEntry )
+void CCaUsifScanner::GetUsifPackageEntriesL(
+ RPointerArray<CComponentEntry>& aArray )
{
- for (TInt i(0); i < aArray.Count(); i++)
+ CComponentFilter *filter = CComponentFilter::NewL();
+ CleanupStack::PushL( filter );
+ filter->SetRemovable( ETrue );
+ filter->SetHidden( EFalse );
+
+ // Create an SCR view
+ RSoftwareComponentRegistryView scrView;
+ CleanupClosePushL( scrView );
+ scrView.OpenViewL( iSoftwareRegistry, filter );
+
+ // Iterate over the matching components
+ //The ownership is transferred to the calling client.
+ CComponentEntry* entry = scrView.NextComponentL();
+ while( entry )
+ {
+ CleanupStack::PushL( entry );
+ if( iSoftwareRegistry.IsComponentPresentL( entry->ComponentId() ) )
+ {
+ aArray.AppendL( entry );
+ CleanupStack::Pop( entry );
+ }
+ else
+ {
+ CleanupStack::PopAndDestroy( entry );
+ }
+ entry = scrView.NextComponentL();
+ }
+ CleanupStack::PopAndDestroy( &scrView );
+ CleanupStack::PopAndDestroy( filter );
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CCaUsifScanner::PackageExistL( RPointerArray<CCaInnerEntry>& aArray,
+ const CComponentEntry* aEntry )
+ {
+ for( TInt idx( 0 ); idx < aArray.Count(); idx++ )
{
- if( aArray[i]->GetUid() == aEntry->GetUid())
- return KErrAlreadyExists;
+ TBuf<KMaxUnits> compIdDes;
+ if( aArray[idx]->FindAttribute( KCaAttrComponentId, compIdDes ) )
+ {
+ TLex lex( compIdDes );
+ TUint uint( 0 );
+ User::LeaveIfError( lex.Val( uint ) );
+ if( aEntry->ComponentId() == uint )
+ {
+ return idx;
+ }
+ }
}
- return KErrNone;
+ return KErrNotFound;
}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaUsifScanner::FindDeletedEntriesL(
+ RPointerArray<CCaInnerEntry>& aCaArray, const RPointerArray<
+ CComponentEntry>& aUsifArray )
+ {
+ for( TInt idx( aCaArray.Count() - 1 ); idx >= 0; idx-- )
+ {
+ TBuf<KMaxUnits> compIdDes;
+ if( aCaArray[idx]->FindAttribute( KCaAttrComponentId, compIdDes ) )
+ {
+ TLex lex( compIdDes );
+ TUint uint( 0 );
+ User::LeaveIfError( lex.Val( uint ) );
+ //for each usif entry check if entry has to be removed
+ for( TInt k( 0 ); k < aUsifArray.Count(); k++ )
+ {
+ if( aUsifArray[k]->ComponentId() == uint
+ && iSoftwareRegistry.IsComponentPresentL( uint ) )
+ {
+ delete aCaArray[idx];
+ aCaArray.Remove( idx );
+ break;
+ }
+ }
+ }
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaUsifScanner::RemoveEntriesFromDbL(
+ RPointerArray<CCaInnerEntry>& aCaArray )
+ {
+ RArray<TInt> entriesId;
+ CleanupClosePushL( entriesId );
+ for( TInt i( 0 ); i < aCaArray.Count(); i++ )
+ {
+ entriesId.Append( aCaArray[i]->GetId() );
+ }
+ iStorageProxy.RemoveL( entriesId );
+ CleanupStack::PopAndDestroy( &entriesId );
+ }
--- a/contentstorage/casrv/causifscanner/src/proxy.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/causifscanner/src/proxy.cpp Mon May 03 12:48:45 2010 +0300
@@ -32,7 +32,6 @@
EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
TInt& aTableCount )
{
- aTableCount = sizeof( ImplementationTable )
- / sizeof(TImplementationProxy);
+ aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
return ImplementationTable;
}
--- a/contentstorage/casrv/cawidgetscanner/group/cawidgetscanner.mmp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/group/cawidgetscanner.mmp Mon May 03 12:48:45 2010 +0300
@@ -39,7 +39,6 @@
SOURCE cawidgetscannerparser.cpp
SOURCE cawidgetdescription.cpp
SOURCE cawidgetstoragehandler.cpp
-SOURCE cawidgetmmcwatcher.cpp
SOURCE widgetscannerutils.cpp
USERINCLUDE ../inc
--- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetmmcwatcher.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +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_CAWIDGETMMCWATCHER_H
-#define C_CAWIDGETMMCWATCHER_H
-
-
-#include <e32base.h>
-#include <f32file.h>
-
-/**
- * Interface for observing MMC events.
- *
- * @since S60 S60 v3.1
- */
-class MWidgetMmcWatcherCallback
- {
-
-public:
- /**
- * MmcChangeL is called when the MMC is removed or inserted.
- */
- virtual void MmcChangeL() = 0;
-
- };
-
-/**
- * This active object waits for an indication that the media has changed.
- *
- * @since S60 S60 v3.1
- */
-class CCaWidgetMmcWatcher : public CActive
- {
-
-public:
-
- /**
- * Two-phased constructor.
- * @param aObserver Pointer to notifier interface.
- * @param aFs file server session.
- */
- static CCaWidgetMmcWatcher* NewL( RFs& aFs,
- MWidgetMmcWatcherCallback* aObserver );
-
- /**
- * Two-phased constructor.
- * @param aObserver Pointer to notifier interface.
- * @param aFs file server session.
- */
- static CCaWidgetMmcWatcher* NewLC( RFs& aFs,
- MWidgetMmcWatcherCallback* aObserver );
-
- /**
- * Destructor
- */
- ~CCaWidgetMmcWatcher();
-
-private:
-
- /**
- * C++ default constructor
- * @param aObserver Pointer to notifier interface.
- * @param aFs file server session.
- */
- CCaWidgetMmcWatcher( RFs& aFs, MWidgetMmcWatcherCallback* aObserver );
-
- /**
- * By default Symbian OS constructor is private.
- */
- void ConstructL();
-
- /**
- * Set notification request
- */
- void WaitForChangeL();
-
- /**
- * From CActive.
- */
- void DoCancel();
-
- /**
- * From CActive.
- */
- void RunL();
-
- /**
- * From CActive.
- */
- TInt RunError( TInt aError );
-
-private:
-
- /**
- * File server session.
- * Not Own
- */
- RFs iFs;
-
- /**
- * MMC events observer
- * Not own.
- */
- MWidgetMmcWatcherCallback* iObserver;
- };
-
-
-#endif // C_CAWIDGETMMCWATCHER_H
--- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerplugin.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetscannerplugin.h Mon May 03 12:48:45 2010 +0300
@@ -22,16 +22,16 @@
#include <casrvplugin.h>
#include <f32file.h>
#include "cawidgetdescription.h"
-#include "cawidgetmmcwatcher.h"
+#include "cammcwatcher.h"
class TPluginParams;
class CCaWidgetScannerParser;
class CCaWidgetScannerInstallNotifier;
class CCaWidgetStorageHandler;
-class CCaWidgetScannerPlugin : public CCaSrvPlugin, MWidgetMmcWatcherCallback
+class CCaWidgetScannerPlugin : public CCaSrvPlugin, MMmcWatcherCallback
{
-
+
public:
// Constructors and destructor
@@ -45,7 +45,7 @@
* C++ destructor
*/
~CCaWidgetScannerPlugin();
-
+
/**
* SynchronizeL
*/
@@ -53,12 +53,12 @@
private:
//from MWidgetMmcWatcherCallback
-
+
/**
* MmcChangeL is called when the MMC is removed or inserted.
*/
void MmcChangeL();
-
+
private:
/**
@@ -72,7 +72,7 @@
void ConstructL( TPluginParams* aPluginParams );
private:
-
+
/**
* File session. Own
*/
@@ -92,12 +92,12 @@
* Content Storage Handler. Own.
*/
CCaWidgetStorageHandler* iStorageHandler;
-
+
/**
* Mmc watcher. Own.
*/
- CCaWidgetMmcWatcher* iMmcWatcher;
-
+ CCaMmcWatcher* iMmcWatcher;
+
};
#endif // C_CAWIDGETSCANNERPLUGIN_H
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp Mon May 03 12:48:45 2010 +0300
@@ -57,8 +57,7 @@
void CCaWidgetDescription::ConstructL( CCaInnerEntry* aEntry )
{
iEntryId = aEntry->GetId();
- iDescription.CreateL(aEntry->GetDescription().Length());
- iDescription = aEntry->GetDescription();
+ iDescription.CreateL( aEntry->GetDescription() );
//package uid
TBuf<KMaxUidName> uidDesc;
aEntry->FindAttribute( KCaPackageUid, uidDesc );
@@ -67,10 +66,8 @@
TLex uidLex(uidDesc);
User::LeaveIfError( uidLex.Val( iPackageUid, EHex ));
}
- iTitle.CreateL(aEntry->GetText().Length());
- iTitle = aEntry->GetText();
- iIconUri.CreateL(aEntry->GetIcon().iFileName.Length());
- iIconUri = aEntry->GetIcon().iFileName;
+ iTitle.CreateL( aEntry->GetText() );
+ iIconUri.CreateL( aEntry->Icon()->FileName() );
//library
iLibrary.CreateL( KCaMaxAttrValueLen );
aEntry->FindAttribute( KAttrWidgetLibrary, iLibrary );
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetmmcwatcher.cpp Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +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 <driveinfo.h>
-
-#include "cawidgetmmcwatcher.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CCaWidgetMmcWatcher::NewL
-// Second phase constructor
-// ---------------------------------------------------------
-//
-CCaWidgetMmcWatcher* CCaWidgetMmcWatcher::NewL( RFs& aFs,
- MWidgetMmcWatcherCallback* aObserver )
- {
- CCaWidgetMmcWatcher* self = NewLC( aFs, aObserver );
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------
-// CCaWidgetMmcWatcher::NewLC
-// Second phase constructor
-// ---------------------------------------------------------
-//
-CCaWidgetMmcWatcher* CCaWidgetMmcWatcher::NewLC( RFs& aFs,
- MWidgetMmcWatcherCallback* aObserver )
- {
- CCaWidgetMmcWatcher* self = new (ELeave) CCaWidgetMmcWatcher( aFs,
- aObserver );
- CleanupStack::PushL ( self );
- self->ConstructL();
- return self;
- }
-
-// ---------------------------------------------------------
-// CCaWidgetMmcWatcher::~CCaWidgetMmcWatcher
-// Destructor
-// ---------------------------------------------------------
-//
-CCaWidgetMmcWatcher::~CCaWidgetMmcWatcher()
- {
- Cancel();
- }
-
-// ---------------------------------------------------------
-// CCaWidgetMmcWatcher::CCaWidgetMmcWatcher
-// Default constructor
-// ---------------------------------------------------------
-//
-CCaWidgetMmcWatcher::CCaWidgetMmcWatcher( RFs& aFs,
- MWidgetMmcWatcherCallback* aObserver )
- : CActive( CActive::EPriorityStandard ),
- iFs(aFs),
- iObserver(aObserver)
- {
- CActiveScheduler::Add(this);
- }
-
-// ---------------------------------------------------------
-// CCaWidgetMmcWatcher::ConstructL
-// default Symbian OS constructor
-// ---------------------------------------------------------
-//
-void CCaWidgetMmcWatcher::ConstructL()
- {
- WaitForChangeL();
- }
-
-// ---------------------------------------------------------
-// CCaWidgetMmcWatcher::WaitForChangeL
-// Request notification for disk change
-// ---------------------------------------------------------
-//
-void CCaWidgetMmcWatcher::WaitForChangeL()
- {
- TInt mmcDrive;
- User::LeaveIfError( DriveInfo::GetDefaultDrive(
- DriveInfo::EDefaultRemovableMassStorage, mmcDrive ) );
- TDriveName mmcDriveName( TDriveUnit( mmcDrive ).Name() );
- iFs.NotifyChange( ENotifyEntry, iStatus, mmcDriveName );
- SetActive();
- }
-
-// ---------------------------------------------------------
-// CCaWidgetMmcWatcher::DoCancel
-// ---------------------------------------------------------
-//
-void CCaWidgetMmcWatcher::DoCancel()
- {
- iFs.NotifyChangeCancel();
- }
-
-// ---------------------------------------------------------------------------
-// CCaWidgetMmcWatcher::RunError
-// ---------------------------------------------------------------------------
-//
-TInt CCaWidgetMmcWatcher::RunError( TInt /*aError*/ )
- {
- // No need to do anything
- return KErrNone;
- }
-
-// ---------------------------------------------------------
-// CCaWidgetMmcWatcher::RunL
-// ---------------------------------------------------------
-//
-void CCaWidgetMmcWatcher::RunL()
- {
- TInt status( iStatus.Int() );
- WaitForChangeL();
- if ( status >= KErrNone )
- {
- iObserver->MmcChangeL();
- }
- }
-
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp Mon May 03 12:48:45 2010 +0300
@@ -239,7 +239,7 @@
SetIconUriL( aElement, aPackageUid, widget);
widget->SetPackageUidL( aPackageUid );
SetMmcIdL( widget );
-
+
TTime modificationTime;
iFs.Modified( aFilePath, modificationTime);
TInt64 modificationIntTime = modificationTime.Int64();
@@ -268,7 +268,7 @@
void CCaWidgetScannerParser::SetUriL(
TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
{
- HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
+ HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
aElement.AttributeValueL( KUri ) );
CleanupStack::PushL( attributeValue );
@@ -286,7 +286,7 @@
void CCaWidgetScannerParser::SetLibraryL( TXmlEngElement & aElement,
const TDesC & aPackageUid, CCaWidgetDescription * aWidget )
{
- HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
+ HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
aElement.AttributeValueL( KLibrary ) );
CleanupStack::PushL( attributeValue );
@@ -296,7 +296,7 @@
//set path for hs to use, trim last 2 chars (doubleslash)
aWidget->SetPathL(libraryPath->Mid(0,libraryPath->Length()-1));
-
+
libraryPath->ReAllocL(
libraryPath->Length() + attributeValue->Length());
@@ -320,7 +320,7 @@
void CCaWidgetScannerParser::SetTitleL(
TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
{
- HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
+ HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
aElement.AttributeValueL( KTitle ) );
CleanupStack::PushL( attributeValue );
@@ -338,7 +338,7 @@
void CCaWidgetScannerParser::SetDescriptionL(
TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
{
- HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
+ HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
aElement.AttributeValueL( KDescription ) );
CleanupStack::PushL( attributeValue );
@@ -356,7 +356,7 @@
void CCaWidgetScannerParser::SetVisibilityL(
TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
{
- HBufC *hidden = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
+ HBufC *hidden = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
aElement.AttributeValueL( KHidden ) );
CleanupStack::PushL( hidden );
@@ -374,7 +374,7 @@
void CCaWidgetScannerParser::SetIconUriL( TXmlEngElement & aElement,
const TDesC & aPackageUid, CCaWidgetDescription * aWidget )
{
- HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
+ HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
aElement.AttributeValueL( KIconUri ) );
CleanupStack::PushL( attributeValue );
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerplugin.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerplugin.cpp Mon May 03 12:48:45 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -48,7 +48,7 @@
// ============================ MEMBER FUNCTIONS ===============================
// -----------------------------------------------------------------------------
-// CCaWidgetScannerPlugin ::CCaWidgetScannerPlugin
+// CCaWidgetScannerPlugin ::CCaWidgetScannerPlugin
// C++ default constructor can NOT contain any code, that
// might leave.
// -----------------------------------------------------------------------------
@@ -65,11 +65,11 @@
void CCaWidgetScannerPlugin::ConstructL( TPluginParams* aPluginParams )
{
User::LeaveIfError( iFs.Connect() );
- iMmcWatcher = CCaWidgetMmcWatcher::NewL( iFs, this );
+ iMmcWatcher = CCaMmcWatcher::NewL( iFs, this );
iInstallNotifier = CCaWidgetScannerInstallNotifier::NewL( this,
KUidSystemCategory, KSAUidSoftwareInstallKeyValue );
iParser = CCaWidgetScannerParser::NewL( iFs );
- iStorageHandler = CCaWidgetStorageHandler::NewL(
+ iStorageHandler = CCaWidgetStorageHandler::NewL(
aPluginParams->storageProxy, iFs );
SynchronizeL();
}
@@ -79,7 +79,7 @@
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
-CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewL(
+CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewL(
TPluginParams* aPluginParams )
{
CCaWidgetScannerPlugin * self = NewLC( aPluginParams );
@@ -92,7 +92,7 @@
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
-CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewLC(
+CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewLC(
TPluginParams* aPluginParams )
{
CCaWidgetScannerPlugin * self = new( ELeave ) CCaWidgetScannerPlugin ( );
@@ -115,18 +115,18 @@
}
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
//
void CCaWidgetScannerPlugin::SynchronizeL()
{
iStorageHandler->SynchronizeL( iParser->WidgetsScanL() );
}
-
+
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
-//
+//
void CCaWidgetScannerPlugin::MmcChangeL()
{
SynchronizeL();
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp Mon May 03 12:48:45 2010 +0300
@@ -174,8 +174,6 @@
//
void CCaWidgetStorageHandler::RemoveWidgetsL()
{
- RArray<TInt> widgetsToRemove;
- CleanupClosePushL( widgetsToRemove );
for( TInt i = 0; i < iWidgets.Count(); i++ )
{
if( iUpdatedIndexes.Find( i ) == KErrNotFound )
@@ -188,15 +186,10 @@
}
else
{
- widgetsToRemove.AppendL( iWidgets[i]->GetEntryId() );
+ SetMissingFlagL( iWidgets[i] );
}
}
}
- if( widgetsToRemove.Count() > 0 )
- {
- iStorage->RemoveL( widgetsToRemove );
- }
- CleanupStack::PopAndDestroy( &widgetsToRemove );
}
// ----------------------------------------------------------------------------
Binary file contentstorage/castorage/data/castorage.db has changed
--- a/contentstorage/castorage/data/castoragedb_create.sql Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/castorage/data/castoragedb_create.sql Mon May 03 12:48:45 2010 +0300
@@ -87,8 +87,9 @@
DROP VIEW IF EXISTS COLLECTION;
CREATE VIEW COLLECTION
AS SELECT
- "" AS "COLLECTION_NAME",
- "" AS "COL_LOCNAME",
+ "" AS "COLLECTION_NAME",
+ "" AS "COL_LOCNAME",
+ "" AS "COL_APP_GROUP_NAME",
"" AS "ICON";
SELECT " CREATE TRIGGER collection_insert" AS " ";
@@ -101,17 +102,20 @@
DELETE FROM CA_ICON WHERE ICON_ID = last_insert_rowid() AND
(IC_FILENAME IS NULL OR (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
-- INSERT ENTRY
- INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_FLAGS, EN_ICON_ID )
- VALUES ( new.COLLECTION_NAME , 2, "collection", 12, (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON ));
- -- LOCALIZATION
- INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_ROW_ID )
- VALUES ( 'CA_ENTRY', 'EN_TEXT', new.COL_LOCNAME, ( SELECT last_insert_rowid() ) );
- DELETE FROM CA_LOCALIZATION_TEXT WHERE LT_STRING_ID IS NULL AND LOC_TEXT_ID = last_insert_rowid() ;
- -- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
+ INSERT INTO CA_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 ));
+ -- LOCALIZATION
+ INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_ROW_ID )
+ VALUES ( 'CA_ENTRY', 'EN_TEXT', new.COL_LOCNAME, ( SELECT last_insert_rowid() ) );
+ DELETE FROM CA_LOCALIZATION_TEXT WHERE LT_STRING_ID IS NULL AND LOC_TEXT_ID = last_insert_rowid() ;
+ -- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION)
VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "menucollections") ,
(SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME),
(SELECT IFNULL(MAX(GE_POSITION)+1, 1) FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "menucollections")) );
+ -- ADD ATTRIBUTE
+ INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
+ VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME AND (EN_TYPE_NAME = "collection::downloaded" OR EN_TYPE_NAME = "collection") ), "appgroup_name", new.COL_APP_GROUP_NAME );
END;
-- CREATE VIEW ITEM_TO_COLLECTION
@@ -132,7 +136,7 @@
-- INSERT ENTRY
INSERT OR IGNORE INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_UID )
VALUES ( new.ITEM_NAME, 1, "application", new.ITEM_DEST );
- -- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
+ -- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION)
VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME) ,
(SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME),
@@ -152,7 +156,7 @@
VALUES ( new.ITEM_NAME, 1, "url", (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON ));
INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
VALUES ( ( SELECT last_insert_rowid() ) ,"url",new.ITEM_DEST);
- -- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
+ -- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION)
VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME) ,
(SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME),
@@ -160,7 +164,7 @@
END;
--- CREATE VIEW WIDGET _TO_COLLECTION
+-- CREATE VIEW WIDGET _TO_COLLECTION
SELECT "------------------------------------" AS " ";
SELECT "CREATE VIEW WIDGET_TO_COLLECTION" AS " ";
DROP VIEW IF EXISTS WIDGET_TO_COLLECTION;
@@ -195,15 +199,12 @@
VALUES ( ( SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME ) ,"long_name",new.LONG_NAME);
INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
VALUES ( ( SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME ) ,"widget:uri",new.URI);
- -- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
+ -- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION)
VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME) ,
(SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME),
(SELECT IFNULL(MAX(GE_POSITION)+1, 1) FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME)) );
-END;
-
-
-
+END;
SELECT "INSERT INITIAL DATA TO CA_DB_PROPERTIES" AS " ";
@@ -215,9 +216,33 @@
INSERT INTO CA_DB_PROPERTIES ( DB_PROPERTY, DB_VALUE )
VALUES ( 'QMfile', 'db_textmap_' );
-
-
-
+-- insert neccessary items
+SELECT "INSERT menucollections ENTRY" AS " ";
+INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID )
+VALUES ( 'AllCollections', 2, "menucollections", NULL , NULL );
+
+INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
+VALUES ( last_insert_rowid(), "appgroup_name", "AllCollections" );
+
+SELECT "------------------------------------" AS " ";
+SELECT "INSERT Downloaded collection ENTRY" AS " ";
+INSERT INTO CA_ICON (IC_FILENAME)
+VALUES ( "qtg_large_applications_download");
+
+INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_FLAGS )
+VALUES ( 'Downloaded', 2, "collection::downloaded", last_insert_rowid() , 8 );
+
+INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
+VALUES ( last_insert_rowid(), "appgroup_name", " Downloaded" );
+
+INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_ROW_ID )
+VALUES ( 'CA_ENTRY', 'EN_TEXT', "txt_applib_dblist_downloaded", ( SELECT last_insert_rowid() ) );
+
+INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION)
+VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "menucollections") ,
+ (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "collection::downloaded"),
+ 1 );
+
SELECT "------------------------------------" AS " ";
SELECT "castoragedb_create - END" AS " ";
SELECT "------------------------------------" AS " ";
--- a/contentstorage/castorage/data/castoragedb_variant.sql Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/castorage/data/castoragedb_variant.sql Mon May 03 12:48:45 2010 +0300
@@ -1,41 +1,16 @@
SELECT "------------------------------------" AS " ";
SELECT "castoragedb_variant - BEGIN" AS " ";
--- insert neccessary items
-SELECT "INSERT GROUPS" AS " ";
-SELECT "." AS " ";
-INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID )
-VALUES ( 'Menu', 2, "folder", NULL , NULL );
-
-SELECT "INSERT menucollections ENTRY" AS " ";
-INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID )
-VALUES ( 'AllCollections', 2, "menucollections", NULL , NULL );
-
-INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID, EN_FLAGS )
-VALUES ( 'Application Library', 2, "applicationlibrary", NULL, NULL, 8 );
-
-SELECT "------------------------------------" AS " ";
-SELECT "INSERT Downloaded collection ENTRY" AS " ";
-INSERT INTO CA_ICON (IC_FILENAME)
-VALUES ( "qtg_large_applications_download");
-INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_FLAGS )
-VALUES ( 'Downloaded', 2, "collection::downloaded", last_insert_rowid() , 8 );
-INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_ROW_ID )
-VALUES ( 'CA_ENTRY', 'EN_TEXT', "txt_applib_dblist_downloaded", ( SELECT last_insert_rowid() ) );
-INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION)
-VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "menucollections") ,
- (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "collection::downloaded"),
- 1 );
-- insert additional items
-INSERT INTO COLLECTION (COLLECTION_NAME, COL_LOCNAME, ICON) VALUES ( 'Office', "txt_applib_dblist_office", "qtg_large_applications_user");
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_LOCNAME, COL_APP_GROUP_NAME ,ICON) VALUES ( 'Office', "txt_applib_dblist_office", 'Office', "qtg_large_applications_user");
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
VALUES ("application", 'calendar', 268458241, 'Office' );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
VALUES ("application", 'Phonebook', 537014009, 'Office' );
-INSERT INTO COLLECTION (COLLECTION_NAME, ICON) VALUES ( 'Multimedia', "qtg_large_applications_user" );
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME ,ICON) VALUES ( 'Multimedia', 'Multimedia' , "qtg_large_applications_user" );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
VALUES ("application", 'Themes', 268458546, 'Multimedia' );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
@@ -43,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, ICON) VALUES ( 'Utils', "qtg_large_applications_user" );
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME ,ICON) VALUES ( 'Utils', 'Utils', "qtg_large_applications_user" );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
VALUES ("application", 'ControlPanel', 537026521, 'Utils' );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
@@ -54,9 +29,8 @@
VALUES ("application", 'eshell', 270498535, 'Utils' );
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME)
VALUES ("application", 'Conn. mgr.', 270501072, 'Utils' );
-
-INSERT INTO COLLECTION (COLLECTION_NAME, COL_LOCNAME, ICON) VALUES ( 'Games', "txt_applib_dblist_games", "qtg_large_applications_user" );
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_LOCNAME, COL_APP_GROUP_NAME ,ICON) VALUES ( 'Games', "txt_applib_dblist_games", 'Games',"qtg_large_applications_user" );
SELECT "castoragedb_variant - END" AS " ";
SELECT "------------------------------------" AS " ";
Binary file contentstorage/castorage/data/stub/castorage.db has changed
--- a/contentstorage/castorage/inc/casqlcommands.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/castorage/inc/casqlcommands.h Mon May 03 12:48:45 2010 +0300
@@ -91,6 +91,10 @@
_LIT( KSQLUpdateEntryFlags, "EN_FLAGS = :EN_FLAGS " );
_LIT( KSQLUpdateWhere, "WHERE ENTRY_ID = :ENTRY_ID " );
+// Null Icon params
+_LIT( KSQLEmptyIconFileName, "(IC_FILENAME IS NULL OR IC_FILENAME = '')" );
+_LIT( KSQLEmptyIconSkinId, "(IC_SKIN_ID IS NULL OR IC_SKIN_ID = '')" );
+_LIT( KSQLEmptyIconAppId, "(IC_APP_ID IS NULL OR IC_APP_ID = '')" );
// Update Icon
_LIT( KSQLUpdateIconId, "ICON_ID = :ICON_ID " );
@@ -175,10 +179,7 @@
_LIT( KSQLNotINIds," AND GE_GROUP_ID NOT IN( %S )" );
-_LIT( KSQLGetIconId,"SELECT ICON_ID AS Data FROM CA_ICON \
-WHERE IC_FILENAME = :IC_FILENAME AND \
-IC_SKIN_ID = :IC_SKIN_ID AND \
-IC_APP_ID = :IC_APP_ID");
+_LIT( KSQLGetIconIdWhere,"SELECT ICON_ID AS Data FROM CA_ICON WHERE ");
_LIT( KSQLGetEntryIdFromEntryTable,"SELECT ENTRY_ID AS Data FROM CA_ENTRY \
WHERE ENTRY_ID = :ENTRY_ID");
--- a/contentstorage/castorage/inc/casqlquery.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/castorage/inc/casqlquery.h Mon May 03 12:48:45 2010 +0300
@@ -327,7 +327,7 @@
* @param aIconAttributes an icon attributes.
* @return Entry count.
*/
- TInt ExecuteL( CCaInnerEntry::TIconAttributes& aIconAttributes );
+ TInt ExecuteL( CCaInnerIconDescription* aInnerIconDescription );
private:
--- a/contentstorage/castorage/inc/casqlquerycreator.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/castorage/inc/casqlquerycreator.h Mon May 03 12:48:45 2010 +0300
@@ -167,6 +167,15 @@
static void CreateCustomSortQueryL( const RArray<TInt>& aEntryIds,
RPointerArray<CCaSqlQuery>& aSqlQuery,
RSqlDatabase& aSqlDb );
+
+ /**
+ * Creates an sql query for finding an icon.
+ *
+ * @param aEntry The entry which has icon description.
+ * @param aQuery The result query.
+ */
+ static void CreateFindIconQueryL( CCaInnerEntry* aEntry,
+ CCaSqlQuery* aQuery);
private:
@@ -220,7 +229,7 @@
*/
static void CreateUpdateQueryEntryL( const CCaInnerEntry* aEntry,
CCaSqlQuery* aQuery );
-
+
/**
* Creates an sql query to get a list of entries by the given ids.
*
--- a/contentstorage/castorage/src/casqlitestorage.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/castorage/src/casqlitestorage.cpp Mon May 03 12:48:45 2010 +0300
@@ -500,12 +500,12 @@
{
//check if icon exists - just update
CCaSqlQuery* query = CCaSqlQuery::NewLC( iSqlDb );
- query->SetQueryL( KSQLGetIconId );
+ CaSqlQueryCreator::CreateFindIconQueryL(aEntry, query);
query->SetTableType( CCaSqlQuery::EIconTable );
query->PrepareL();
query->BindValuesForGetIconL( aEntry );
- CCaInnerEntry::TIconAttributes iconAttributes;
- TInt countIcons = query->ExecuteL( iconAttributes );
+ TInt idIcon( 0 );
+ query->ExecuteL( idIcon );
CleanupStack::PopAndDestroy( query );
aSqlQuery[i]->PrepareL();
@@ -513,11 +513,10 @@
TInt tmpId( 0 );
TRAPD( err, tmpId = aSqlQuery[i]->ExecuteL() );
aSqlQuery[i]->CloseStatement();
- if( !countIcons && !aEntry->GetIconId() )
+ if( !idIcon && !aEntry->GetIconId() )
{ // new icon added
aEntry->SetIconId( tmpId );
}
-
if( err == KSqlErrConstraint )
{
// ignore, this means that the icon cannot be removed
--- a/contentstorage/castorage/src/casqlquery.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/castorage/src/casqlquery.cpp Mon May 03 12:48:45 2010 +0300
@@ -509,22 +509,22 @@
if( iQuery.Find( KSQLIconId ) != KErrNotFound )
{
BindIntL(iStatement.ParameterIndex( KSQLIconId ),
- aEntry->GetIcon().iId );
+ aEntry->Icon()->Id() );
}
if( iQuery.Find( KSQLIcFileName ) != KErrNotFound )
{
BindTextL( iStatement.ParameterIndex( KSQLIcFileName ),
- aEntry->GetIcon().iFileName );
+ aEntry->Icon()->FileName() );
}
if( iQuery.Find( KSQLIcSkinId ) != KErrNotFound )
{
BindTextL( iStatement.ParameterIndex( KSQLIcSkinId ),
- aEntry->GetIcon().iSkinId );
+ aEntry->Icon()->SkinId() );
}
if( iQuery.Find( KSQLIcAppId ) != KErrNotFound )
{
BindTextL( iStatement.ParameterIndex( KSQLIcAppId ),
- aEntry->GetIcon().iApplicationId );
+ aEntry->Icon()->ApplicationId() );
}
}
@@ -853,24 +853,36 @@
//
// ---------------------------------------------------------------------------
//
-TInt CCaSqlQuery::ExecuteL( CCaInnerEntry::TIconAttributes& aIconAttributes )
+TInt CCaSqlQuery::ExecuteL( CCaInnerIconDescription* aInnerIconDescription )
{
TInt columnCount( 0 );
+
+ RBuf description;
+ description.CleanupClosePushL();
+ description.CreateL(KMaxFileName);
+
while( iStatement.Next() == KSqlAtRow )
{
- aIconAttributes.iId = iStatement.ColumnInt(
- ColumnIndexL( iStatement, KColumnIconId ) );
+ aInnerIconDescription->SetId( iStatement.ColumnInt(
+ ColumnIndexL( iStatement, KColumnIconId ) ) );
User::LeaveIfError(iStatement.ColumnText(
ColumnIndexL( iStatement, KColumnIcFileName),
- aIconAttributes.iFileName));
+ description));
+ aInnerIconDescription->SetFileNameL(description);
+
User::LeaveIfError(iStatement.ColumnText(
ColumnIndexL( iStatement, KColumnIcSkinId),
- aIconAttributes.iSkinId));
+ description));
+ aInnerIconDescription->SetSkinIdL(description);
+
User::LeaveIfError(iStatement.ColumnText(
ColumnIndexL( iStatement, KColumnIcAppId),
- aIconAttributes.iApplicationId));
+ description));
+ aInnerIconDescription->SetApplicationIdL(description);
+
columnCount++;
}
+ CleanupStack::PopAndDestroy(&description);
return columnCount;
}
--- a/contentstorage/castorage/src/casqlquerycreator.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/castorage/src/casqlquerycreator.cpp Mon May 03 12:48:45 2010 +0300
@@ -209,6 +209,72 @@
aQuery->SetQueryL( query );
CleanupStack::PopAndDestroy( &query );
}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CaSqlQueryCreator::CreateFindIconQueryL( CCaInnerEntry* aEntry,
+ CCaSqlQuery* aQuery)
+ {
+ RBuf iconQuery;
+ iconQuery.CleanupClosePushL();
+ iconQuery.CreateL( KSQLGetIconIdWhere );
+
+ if( aEntry->Icon()->FileName().Compare( KNullDesC ) )
+ {
+ iconQuery.ReAllocL( iconQuery.Length() + KSQLUpdateIconFileName().Length()
+ + KAnd().Length() );
+ iconQuery.Append( KSQLUpdateIconFileName );
+ iconQuery.Append( KAnd );
+ }
+ else
+ {
+ iconQuery.ReAllocL( iconQuery.Length() + KSQLEmptyIconFileName().Length()
+ + KAnd().Length() );
+ iconQuery.Append( KSQLEmptyIconFileName );
+ iconQuery.Append( KAnd );
+ }
+
+ if( aEntry->Icon()->SkinId().Compare( KNullDesC ) )
+ {
+ iconQuery.ReAllocL( iconQuery.Length() + KSQLUpdateIconSkinId().Length()
+ + KAnd().Length() );
+ iconQuery.Append( KSQLUpdateIconSkinId );
+ iconQuery.Append( KAnd );
+ }
+ else
+ {
+ iconQuery.ReAllocL( iconQuery.Length() + KSQLEmptyIconSkinId().Length()
+ + KAnd().Length() );
+ iconQuery.Append( KSQLEmptyIconSkinId );
+ iconQuery.Append( KAnd );
+ }
+
+ if( aEntry->Icon()->ApplicationId().Compare( KNullDesC ) )
+ {
+ iconQuery.ReAllocL( iconQuery.Length() + KSQLUpdateIconAppId().Length()
+ + KAnd().Length() );
+ iconQuery.Append( KSQLUpdateIconAppId );
+ iconQuery.Append( KAnd );
+ }
+ else
+ {
+ iconQuery.ReAllocL( iconQuery.Length() + KSQLEmptyIconAppId().Length()
+ + KAnd().Length() );
+ iconQuery.Append( KSQLEmptyIconAppId );
+ iconQuery.Append( KAnd );
+ }
+
+ if (!iconQuery.Right(KAnd().Length()).Compare(KAnd))
+ {
+ iconQuery.Delete( iconQuery.Length() - KAnd().Length(), KAnd().Length() );
+ }
+
+ aQuery->SetQueryL( iconQuery );
+ CleanupStack::PopAndDestroy( &iconQuery );
+ }
+
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
@@ -218,9 +284,9 @@
{
DEBUG( ("_CA_:CASqlQueryCreator::CreateAddIconQueryForNewL") );
CCaSqlQuery* query = CCaSqlQuery::NewLC( aSqlDb );
- query->SetQueryL( KSQLGetIconId );
+
+ CreateFindIconQueryL(aEntry, query);
query->SetTableType( CCaSqlQuery::EIconTable );
-
query->PrepareL();
query->BindValuesForGetIconL( aEntry );
TInt idIcon( 0 );
@@ -230,9 +296,9 @@
if( idIcon == 0 )
{
// entry's icon data is not in DB
- if( ( aEntry->GetIcon().iFileName.Length() != 0 ) ||
- ( aEntry->GetIcon().iSkinId.Length() != 0 ) ||
- ( aEntry->GetIcon().iApplicationId.Length() != 0 )
+ if( ( aEntry->Icon()->FileName().Length() != 0 ) ||
+ ( aEntry->Icon()->SkinId().Length() != 0 ) ||
+ ( aEntry->Icon()->ApplicationId().Length() != 0 )
)
{
// icon is not null, so that insert it to storage
@@ -251,6 +317,7 @@
aQuery->SetTableType( CCaSqlQuery::ENoTableType );
}
}
+
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
@@ -265,12 +332,14 @@
query->PrepareL();
query->BindValuesForGetEntriesL( aEntry );
- CCaInnerEntry::TIconAttributes iconAttributs;
- query->ExecuteL( iconAttributs );
+
+ CCaInnerIconDescription* innerIcon = CCaInnerIconDescription::NewLC();
+
+ query->ExecuteL( innerIcon );
query->CloseStatement();
- if( !( !iconAttributs.iFileName.Compare( aEntry->GetIcon().iFileName )
- && (!iconAttributs.iSkinId.Compare( aEntry->GetIcon().iSkinId ))
- && (!iconAttributs.iApplicationId.Compare( aEntry->GetIcon().iApplicationId ))
+ if( !( !innerIcon->FileName().Compare( aEntry->Icon()->FileName() )
+ && (!innerIcon->SkinId().Compare( aEntry->Icon()->SkinId() ))
+ && (!innerIcon->ApplicationId().Compare( aEntry->Icon()->ApplicationId() ))
) )
{
// entry's icon data is updated
@@ -299,8 +368,11 @@
CleanupStack::PopAndDestroy( &innerEntries );
}
+ CleanupStack::PopAndDestroy( innerIcon );
+
CleanupStack::PopAndDestroy( query );
}
+
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
@@ -323,6 +395,7 @@
CreateAddIconQueryForUpdateL( aEntry, aQuery, aSqlDb );
}
}
+
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
@@ -335,21 +408,21 @@
query.CleanupClosePushL();
query.CreateL( KSQLUpdateIcon().Length() );
query.Append( KSQLUpdateIcon );
- if( aEntry->GetIcon().iFileName.Compare( KNullDesC ) )
+ if( aEntry->Icon()->FileName().Compare( KNullDesC ) )
{
query.ReAllocL( query.Length() + KSQLUpdateIconFileName().Length()
+ KComma().Length() );
query.Append( KSQLUpdateIconFileName );
query.Append( KComma );
}
- if( aEntry->GetIcon().iSkinId.Compare( KNullDesC ) )
+ if( aEntry->Icon()->SkinId().Compare( KNullDesC ) )
{
query.ReAllocL( query.Length() + KSQLUpdateIconSkinId().Length()
+ KComma().Length() );
query.Append( KSQLUpdateIconSkinId );
query.Append( KComma );
}
- if( aEntry->GetIcon().iApplicationId.Compare(KNullDesC) )
+ if( aEntry->Icon()->ApplicationId().Compare(KNullDesC) )
{
query.ReAllocL( query.Length() + KSQLUpdateIconAppId().Length()
+ KComma().Length() );
@@ -357,8 +430,7 @@
}
if( !query.Right( KComma().Length() ).Compare( KComma ) )
{
- query.Assign( query.Mid( query.Length() -
- KComma().Length()).AllocL() );
+ query.Delete( query.Length() - KComma().Length(), KComma().Length() );
}
// add WHERE expr
query.ReAllocL( query.Length() + KSQLUpdateIconWhere().Length() );
@@ -1035,9 +1107,9 @@
{
CaSqlQueryCreator::TIconType iconType;
if(
- aEntry->GetIcon().iApplicationId.Length() == 0 &&
- aEntry->GetIcon().iSkinId.Length() == 0 &&
- aEntry->GetIcon().iFileName.Length() == 0 )
+ aEntry->Icon()->ApplicationId().Length() == 0 &&
+ aEntry->Icon()->SkinId().Length() == 0 &&
+ aEntry->Icon()->FileName().Length() == 0 )
{
if( aEntry->GetIconId() > 0 )
{
--- a/contentstorage/cautils/inc/caentryattribute.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cautils/inc/caentryattribute.h Mon May 03 12:48:45 2010 +0300
@@ -131,6 +131,15 @@
*/
IMPORT_C TBool Find( const TDesC& aName, TDes& aAttrVal );
+ /**
+ * Find attribute by name.
+ * @param aId Id.
+ * @param aName Name.
+ * @param aAttr Attribute value.
+ * @return TBool, ETrue if attribute was found
+ */
+ IMPORT_C TBool Find( const TDesC& aName, TPtrC& aAttrVal );
+
/*
* Check if attribute exists
* @param aId Id
--- a/contentstorage/cautils/inc/cainnerentry.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cautils/inc/cainnerentry.h Mon May 03 12:48:45 2010 +0300
@@ -21,6 +21,7 @@
#include <e32base.h>
#include "caentryattribute.h"
+#include "cainnericondescription.h"
/**
* Class represents Content Arsenal entry
@@ -28,19 +29,6 @@
NONSHARABLE_CLASS( CCaInnerEntry ): public CBase
{
public:
- /*
- * Struct containing icon attributes
- */
- struct TIconAttributes
- {
- //TODO: maybe it should be C class with RBuf instead of TFileName
- TInt iId;
- TFileName iFileName;
- TBuf<KMaxFileName> iSkinId;
- TBuf<KMaxUidName> iApplicationId;
- };
-
-public:
/**
* Destructor.
@@ -77,7 +65,7 @@
* @return Entry description.
*/
IMPORT_C const RBuf& GetDescription() const;
-
+
/**
* Gets entry typename.
* @return Entry typename.
@@ -85,10 +73,10 @@
IMPORT_C const RBuf& GetEntryTypeName() const;
/**
- * Gets icon attributes.
- * @return Icon atrributes.
+ * Gets icon description.
+ * @return Icon description.
*/
- IMPORT_C const CCaInnerEntry::TIconAttributes& GetIcon() const;
+ IMPORT_C const CCaInnerIconDescription* Icon() const;
/**
* Gets entry flags.
@@ -138,7 +126,7 @@
* @param aText Entry description.
*/
IMPORT_C void SetDescriptionL( const TDesC& aText );
-
+
/**
* Sets the entry typename.
* @param aTypeName Entry typename.
@@ -151,8 +139,8 @@
* @param aSkinId Skin id.
* @param aApplicationId application id.
*/
- IMPORT_C void SetIconDataL(
- const TDesC& aFilename, const TDesC& aSkinId, const TDesC& aApplicationId );
+ IMPORT_C void SetIconDataL(
+ const TDesC& aFilename, const TDesC& aSkinId, const TDesC& aApplicationId );
/**
* Adds attribute to entry.
@@ -186,7 +174,15 @@
* @return ETrue if attribute exists.
*/
IMPORT_C TBool FindAttribute( const TDesC& aKey, TDes& aAttrVal );
-
+
+ /**
+ * Verifies if attribute exists, and returns its value for the given key.
+ * @param aKey Attribute key.
+ * @param aAttrVal Attribute value.
+ * @return ETrue if attribute exists.
+ */
+ IMPORT_C TBool FindAttribute( const TDesC& aKey, TPtrC& aAttrVal );
+
/**
* Sets the entry uid.
* @param aUid Entry uid.
@@ -242,7 +238,7 @@
* Own.
*/
RBuf iDescription;
-
+
/*
* Entry type.
* Own.
@@ -250,9 +246,10 @@
RBuf iEntryTypeName;
/*
+ * Icon.
* Own.
*/
- TIconAttributes iIcon;
+ CCaInnerIconDescription* iIcon;
/*
* Flags.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/cautils/inc/cainnericondescription.h Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Definition of entry attribute
+ *
+ */
+
+#ifndef __CAINNERICONDESCRIPTION_H__
+#define __CAINNERICONDESCRIPTION_H__
+
+#include <e32base.h>
+
+//FORWARD DECLARATIONS
+class RWriteStream;
+class RReadStream;
+
+/**
+ * CA entry icon.
+ * @lib .lib
+ * @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CCaInnerIconDescription ): public CBase
+ {
+
+public:
+
+ /**
+ * Destructor.
+ */
+ virtual ~CCaInnerIconDescription();
+
+ /**
+ * Two-phased constructor.
+ * @return The created object.
+ */
+ IMPORT_C static CCaInnerIconDescription* NewL();
+
+ /**
+ * Two-phased constructor.
+ * @return The created object.
+ */
+ IMPORT_C static CCaInnerIconDescription* NewLC();
+
+ /**
+ * Gets icon id.
+ * @return iId.
+ */
+ TInt Id() const
+ {
+ return iId;
+ }
+
+ /**
+ * Gets file name.
+ * @return iFileName.
+ */
+ TPtrC FileName() const
+ {
+ return iFileName;
+ }
+
+ /**
+ * Gets skin id.
+ * @return iSkinId
+ */
+ TPtrC SkinId() const
+ {
+ return iSkinId;
+ }
+
+ /**
+ * Gets application id.
+ * @return iApplicationId
+ */
+ TPtrC ApplicationId() const
+ {
+ return iApplicationId;
+ }
+
+ /**
+ * Set icon id.
+ * @param aId Value
+ */
+ IMPORT_C void SetId( const TInt aId );
+
+ /**
+ * Set icon file name.
+ * @param aFileName Value
+ * Ownership taken.
+ */
+ IMPORT_C void SetFileNameL( const TDesC& aFileName );
+
+ /**
+ * Set icon skin id.
+ * @param aSkinId Value
+ * Ownership taken.
+ */
+ IMPORT_C void SetSkinIdL( const TDesC& aSkinId );
+
+ /**
+ * Set application id.
+ * @param aApplicationId Value
+ * Ownership taken.
+ */
+ IMPORT_C void SetApplicationIdL( const TDesC& aApplicationId );
+
+ /**
+ * Externalizes icon to the stream
+ * @param aStream a write stream
+ */
+ void ExternalizeL( RWriteStream& aStream ) const;
+
+ /**
+ * Internalizes stream to the icon
+ * @param aStream a read stream
+ */
+ void InternalizeL( RReadStream& aStream );
+
+private:
+
+ /**
+ * Second phased constructor.
+ */
+ void ConstructL();
+
+ /**
+ * Constructor
+ */
+ CCaInnerIconDescription();
+
+private:
+ // data
+
+ /*
+ * icon id
+ */
+ TInt iId;
+
+ /*
+ * Icon filename
+ */
+ RBuf iFileName;
+
+ /*
+ * Icon skin id
+ */
+ RBuf iSkinId;
+
+ /*
+ * Icon application id
+ */
+ RBuf iApplicationId;
+ };
+
+#endif // __CAINNERICONDESCRIPTION_H__
--- a/contentstorage/cautils/src/caentryattribute.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cautils/src/caentryattribute.cpp Mon May 03 12:48:45 2010 +0300
@@ -124,6 +124,23 @@
}
// ---------------------------------------------------------
+// RMenuSrvAttrArray::Find
+// ---------------------------------------------------------
+//
+EXPORT_C TBool RCaEntryAttrArray::Find( const TDesC& aName, TPtrC& aAttrVal )
+ {
+ for( TInt i = 0; i < Count(); i++ )
+ {
+ if( aName.Compare( operator[]( i )->Name() ) == KErrNone )
+ {
+ aAttrVal.Set( operator[]( i )->Value() );
+ return ETrue;
+ }
+ }
+ return EFalse;
+ }
+
+// ---------------------------------------------------------
// RCaEntryAttrArray::Exist
// ---------------------------------------------------------
//
--- a/contentstorage/cautils/src/cainnerentry.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/cautils/src/cainnerentry.cpp Mon May 03 12:48:45 2010 +0300
@@ -30,6 +30,7 @@
iDescription.Close();
iEntryTypeName.Close();
iAttributes.ResetAndDestroy();
+ delete iIcon;
}
// ---------------------------------------------------------------------------
@@ -63,13 +64,6 @@
{
aStream.WriteInt32L( iId );
aStream.WriteInt32L( iUid );
- aStream.WriteInt32L( iIcon.iId );
- aStream.WriteUint32L( iIcon.iFileName.Length() );
- aStream.WriteL( iIcon.iFileName, iIcon.iFileName.Length() );
- aStream.WriteUint32L( iIcon.iSkinId.Length() );
- aStream.WriteL( iIcon.iSkinId, iIcon.iSkinId.Length() );
- aStream.WriteUint32L( iIcon.iApplicationId.Length() );
- aStream.WriteL( iIcon.iApplicationId, iIcon.iApplicationId.Length() );
aStream.WriteUint32L( iFlags );
aStream.WriteUint32L( iRole );
aStream.WriteUint32L( iText.Length() );
@@ -79,6 +73,7 @@
aStream.WriteUint32L( iEntryTypeName.Length() );
aStream.WriteL( iEntryTypeName, iEntryTypeName.Length() );
iAttributes.ExternalizeL( aStream );
+ iIcon->ExternalizeL( aStream );
aStream.CommitL();
}
@@ -90,16 +85,9 @@
{
iId = aStream.ReadInt32L();
iUid = aStream.ReadInt32L();
- iIcon.iId = aStream.ReadInt32L();
- TUint length = aStream.ReadUint32L();
- aStream.ReadL( iIcon.iFileName, length );
- length = aStream.ReadUint32L();
- aStream.ReadL( iIcon.iSkinId, length );
- length = aStream.ReadUint32L();
- aStream.ReadL( iIcon.iApplicationId, length );
iFlags = aStream.ReadUint32L();
iRole = aStream.ReadUint32L();
- length = aStream.ReadUint32L();
+ TUint length = aStream.ReadUint32L();
iText.Close();
iText.CreateL( length );
aStream.ReadL( iText, length );
@@ -112,6 +100,7 @@
iEntryTypeName.CreateL( length );
aStream.ReadL( iEntryTypeName, length );
iAttributes.InternalizeL( aStream );
+ iIcon->InternalizeL( aStream );
}
// ---------------------------------------------------------------------------
@@ -120,7 +109,7 @@
//
void CCaInnerEntry::ConstructL()
{
-
+ iIcon = CCaInnerIconDescription::NewL();
}
// ---------------------------------------------------------------------------
@@ -129,7 +118,6 @@
//
CCaInnerEntry::CCaInnerEntry()
{
-
}
// ---------------------------------------------------------------------------
@@ -172,7 +160,7 @@
//
// ---------------------------------------------------------------------------
//
-EXPORT_C const CCaInnerEntry::TIconAttributes& CCaInnerEntry::GetIcon() const
+EXPORT_C const CCaInnerIconDescription* CCaInnerEntry::Icon() const
{
return iIcon;
}
@@ -219,7 +207,7 @@
//
EXPORT_C TInt CCaInnerEntry::GetIconId() const
{
- return iIcon.iId;
+ return iIcon->Id();
}
// SETTERS
@@ -269,9 +257,9 @@
EXPORT_C void CCaInnerEntry::SetIconDataL(
const TDesC& aFilename, const TDesC& aSkinId, const TDesC& aApplicationId )
{
- iIcon.iFileName.Copy( aFilename );
- iIcon.iSkinId.Copy( aSkinId );
- iIcon.iApplicationId.Copy(aApplicationId);
+ iIcon->SetFileNameL( aFilename );
+ iIcon->SetSkinIdL( aSkinId );
+ iIcon->SetApplicationIdL( aApplicationId );
}
// ---------------------------------------------------------------------------
@@ -333,6 +321,16 @@
//
// ---------------------------------------------------------------------------
//
+EXPORT_C TBool CCaInnerEntry::FindAttribute( const TDesC& aKey,
+ TPtrC& aAttrVal )
+ {
+ return iAttributes.Find( aKey, aAttrVal );
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
EXPORT_C void CCaInnerEntry::SetUid( TInt32 aUid )
{
iUid = aUid;
@@ -344,5 +342,5 @@
//
EXPORT_C void CCaInnerEntry::SetIconId( TInt aIconId )
{
- iIcon.iId = aIconId;
+ iIcon->SetId( aIconId );
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/cautils/src/cainnericondescription.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,162 @@
+/*
+ * 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: Definition of entry attribute
+ *
+ */
+
+// INCLUDE FILES
+#include <s32mem.h>
+#include "cainnericondescription.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CCaInnerIconDescription::~CCaInnerIconDescription
+// ---------------------------------------------------------
+//
+CCaInnerIconDescription::~CCaInnerIconDescription()
+ {
+ iFileName.Close();
+ iSkinId.Close();
+ iApplicationId.Close();
+ }
+
+// ---------------------------------------------------------
+// CCaInnerIconDescription::NewL
+// ---------------------------------------------------------
+//
+EXPORT_C CCaInnerIconDescription* CCaInnerIconDescription::NewL()
+ {
+ CCaInnerIconDescription* self = NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------
+// CCaInnerIconDescription::NewLC
+// ---------------------------------------------------------
+//
+EXPORT_C CCaInnerIconDescription* CCaInnerIconDescription::NewLC()
+ {
+ CCaInnerIconDescription* self = new ( ELeave ) CCaInnerIconDescription();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------
+// CCaInnerIconDescription::ConstructL
+// ---------------------------------------------------------
+//
+void CCaInnerIconDescription::ConstructL()
+ {
+ }
+
+// ---------------------------------------------------------
+// CCaInnerIconDescription::CCaInnerIconDescription
+// ---------------------------------------------------------
+//
+CCaInnerIconDescription::CCaInnerIconDescription()
+ {
+ }
+
+// ---------------------------------------------------------
+// CCaInnerIconDescription::SetId
+// ---------------------------------------------------------
+//
+EXPORT_C void CCaInnerIconDescription::SetId( const TInt aId )
+ {
+ iId = aId;
+ }
+
+// ---------------------------------------------------------
+// CCaInnerIconDescription::SetFileNameL
+// ---------------------------------------------------------
+//
+EXPORT_C void CCaInnerIconDescription::SetFileNameL( const TDesC& aFileName )
+ {
+ if( iFileName.Length() > 0 )
+ {
+ iFileName.Close();
+ }
+ iFileName.CreateL( aFileName );
+ }
+
+// ---------------------------------------------------------
+// CCaInnerIconDescription::SetSkinIdL
+// ---------------------------------------------------------
+//
+EXPORT_C void CCaInnerIconDescription::SetSkinIdL( const TDesC& aSkinId )
+ {
+ if( iSkinId.Length() > 0 )
+ {
+ iSkinId.Close();
+ }
+ iSkinId.CreateL( aSkinId );
+ }
+
+// ---------------------------------------------------------
+// CCaInnerIconDescription::SetApplicationIdL
+// ---------------------------------------------------------
+//
+EXPORT_C void CCaInnerIconDescription::SetApplicationIdL( const TDesC& aApplicationId )
+ {
+ if( iApplicationId.Length() > 0 )
+ {
+ iApplicationId.Close();
+ }
+ iApplicationId.CreateL( aApplicationId );
+ }
+
+// ---------------------------------------------------------------------------
+// CCaInnerIconDescription::ExternalizeL
+// ---------------------------------------------------------------------------
+//
+void CCaInnerIconDescription::ExternalizeL( RWriteStream& aStream ) const
+ {
+ aStream.WriteInt32L( iId );
+ aStream.WriteUint32L( iFileName.Length() );
+ aStream.WriteL( iFileName, iFileName.Length() );
+ aStream.WriteUint32L( iSkinId.Length() );
+ aStream.WriteL( iSkinId, iSkinId.Length() );
+ aStream.WriteUint32L( iApplicationId.Length() );
+ aStream.WriteL( iApplicationId, iApplicationId.Length() );
+ aStream.CommitL();
+ }
+
+// ---------------------------------------------------------------------------
+// CCaInnerIconDescription::InternalizeL
+// ---------------------------------------------------------------------------
+//
+void CCaInnerIconDescription::InternalizeL( RReadStream& aStream )
+ {
+ iId = aStream.ReadInt32L();
+
+ TUint length = aStream.ReadUint32L();
+ iFileName.Close();
+ iFileName.CreateL( length );
+ aStream.ReadL( iFileName, length );
+
+ length = aStream.ReadUint32L();
+ iSkinId.Close();
+ iSkinId.CreateL( length );
+ aStream.ReadL( iSkinId, length );
+
+ length = aStream.ReadUint32L();
+ iApplicationId.Close();
+ iApplicationId.CreateL( length );
+ aStream.ReadL( iApplicationId, length );
+ }
+
+// End of File
--- a/contentstorage/contentstorage.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/contentstorage.pro Mon May 03 12:48:45 2010 +0300
@@ -20,6 +20,7 @@
SUBDIRS += cautils
SUBDIRS += group
SUBDIRS += casrv/calocalizerscanner
+SUBDIRS += cahandler
}
SUBDIRS += caclient
CONFIG += ordered
--- a/contentstorage/eabi/caextendedmenuu.def Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
- _ZN17CaMenuIconUtility11GetItemIconERK13CCaInnerEntry @ 1 NONAME
-
--- a/contentstorage/eabi/camenuu.def Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/eabi/camenuu.def Mon May 03 12:48:45 2010 +0300
@@ -21,4 +21,6 @@
_ZNK14CCaSrvEngUtils13GetApaAppInfoE4TUidR11TApaAppInfo @ 20 NONAME
_ZTI15CCaStorageProxy @ 21 NONAME
_ZTV15CCaStorageProxy @ 22 NONAME
+ _ZN13CCaMmcWatcher4NewLER3RFsP19MMmcWatcherCallback @ 23 NONAME
+ _ZN13CCaMmcWatcher5NewLCER3RFsP19MMmcWatcherCallback @ 24 NONAME
--- a/contentstorage/eabi/cautilsu.def Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/eabi/cautilsu.def Mon May 03 12:48:45 2010 +0300
@@ -50,42 +50,50 @@
_ZN22CCaInnerNotifierFilter4NewLENS_13TNotifierTypeE @ 49 NONAME
_ZN22CCaInnerNotifierFilter5NewLCENS_13TNotifierTypeE @ 50 NONAME
_ZN22CCaInnerNotifierFilter7SetIdsLERK6RArrayIiE @ 51 NONAME
- _ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 52 NONAME
- _ZNK11RCaIdsArray12ExternalizeLER12RWriteStream @ 53 NONAME
- _ZNK11RCaIdsArray13MarshalDataLCEv @ 54 NONAME
- _ZNK13CCaInnerEntry12ExternalizeLER12RWriteStream @ 55 NONAME
- _ZNK13CCaInnerEntry13GetAttributesEv @ 56 NONAME
- _ZNK13CCaInnerEntry14GetDescriptionEv @ 57 NONAME
- _ZNK13CCaInnerEntry16GetEntryTypeNameEv @ 58 NONAME
- _ZNK13CCaInnerEntry5GetIdEv @ 59 NONAME
- _ZNK13CCaInnerEntry6GetUidEv @ 60 NONAME
- _ZNK13CCaInnerEntry7GetIconEv @ 61 NONAME
- _ZNK13CCaInnerEntry7GetRoleEv @ 62 NONAME
- _ZNK13CCaInnerEntry7GetTextEv @ 63 NONAME
- _ZNK13CCaInnerEntry8GetFlagsEv @ 64 NONAME
- _ZNK13CCaInnerEntry9GetIconIdEv @ 65 NONAME
- _ZNK13CCaInnerQuery10GetFlagsOnEv @ 66 NONAME
- _ZNK13CCaInnerQuery11GetFlagsOffEv @ 67 NONAME
- _ZNK13CCaInnerQuery11GetParentIdEv @ 68 NONAME
- _ZNK13CCaInnerQuery12ExternalizeLER12RWriteStream @ 69 NONAME
- _ZNK13CCaInnerQuery13GetAttributesEv @ 70 NONAME
- _ZNK13CCaInnerQuery17GetEntryTypeNamesEv @ 71 NONAME
- _ZNK13CCaInnerQuery6GetIdsEv @ 72 NONAME
- _ZNK13CCaInnerQuery6GetUidEv @ 73 NONAME
- _ZNK13CCaInnerQuery7GetRoleEv @ 74 NONAME
- _ZNK13CCaInnerQuery7GetSortEv @ 75 NONAME
- _ZNK13CCaInnerQuery8GetCountEv @ 76 NONAME
- _ZNK15RCaEntriesArray12ExternalizeLER12RWriteStream @ 77 NONAME
- _ZNK20CCaLocalizationEntry11GetStringIdEv @ 78 NONAME
- _ZNK20CCaLocalizationEntry12GetTableNameEv @ 79 NONAME
- _ZNK20CCaLocalizationEntry16GetAttributeNameEv @ 80 NONAME
- _ZNK20CCaLocalizationEntry18GetLocalizedStringEv @ 81 NONAME
- _ZNK20CCaLocalizationEntry8GetRowIdEv @ 82 NONAME
- _ZNK20CCaLocalizationEntry9GetTextIdEv @ 83 NONAME
- _ZNK22CCaInnerNotifierFilter11GetParentIdEv @ 84 NONAME
- _ZNK22CCaInnerNotifierFilter12ExternalizeLER12RWriteStream @ 85 NONAME
- _ZNK22CCaInnerNotifierFilter12GetEntryRoleEv @ 86 NONAME
- _ZNK22CCaInnerNotifierFilter12GetTypeNamesEv @ 87 NONAME
- _ZNK22CCaInnerNotifierFilter15GetNotifierTypeEv @ 88 NONAME
- _ZNK22CCaInnerNotifierFilter6GetIdsEv @ 89 NONAME
+ _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
--- a/contentstorage/extinc/camenuiconutility.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: The API supports requesting raw bitmaps
- *
-*/
-
-
-#ifndef __CAMENUICONUTILITY_H__
-#define __CAMENUICONUTILITY_H__
-
-#include <AknIconUtils.h>
-
-class CCaInnerEntry;
-
-/**
- * Icon utility.
- * This is a utilitiy class providing method(s) for querying raw bitmap data
- * belonging to menu items
- * @lib caextendedmenu.lib
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CaMenuIconUtility )
- {
-public:
- /**
- * Creates the icon that belongs to a menu item.
- * @since S60 v5.0.
- * @param aEntry entry for which an icon is queried for
- * @return the icon of the specified entry. The ownership of the icon
- * object is transferred to the caller.
- */
- IMPORT_C static CAknIcon* GetItemIcon( const CCaInnerEntry &aEntry );
- };
-
-#endif // __CAMENUICONUTILITY_H__
--- a/contentstorage/extinc/casathandler.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/extinc/casathandler.h Mon May 03 12:48:45 2010 +0300
@@ -20,7 +20,7 @@
#include <AknIconUtils.h>
-#include <rsatsession.h>
+#include <RSatSession.h>
#include <tsaticoninfo.h>
#ifdef SIM_ATK_SERVICE_API_V1
#include <rsatservice.h>// MCL
--- a/contentstorage/extsrc/caiconutility.cpp Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: The API supports requesting raw bitmaps
- *
- */
-
-// INCLUDE FILES
-#include <e32base.h>
-#include <AknsUtils.h>
-#include <satdomainpskeys.h>
-#include <e32property.h>
-#include <apgcli.h>
-#include <AknInternalIconUtils.h>
-#include "cadef.h"
-#include "cautils.h"
-#include "cainnerentry.h"
-#include "camenuiconutility.h"
-#include "caarraycleanup.inl"
-#include "casathandler.h"
-
-// ================= LOCAL FUNCTIONS ========================
-
-// ---------------------------------------------------------
-// LoadSkinL
-// ---------------------------------------------------------
-//
-LOCAL_C CAknIcon* GetSkinL( TInt majorId, TInt minorId )
- {
- CAknIcon* icon = NULL;
- if( majorId >= 0 && minorId >= 0 )
- {
- CFbsBitmap* bitmap( 0 );
- CFbsBitmap* mask( 0 );
-
- TAknsItemID skinId;
- skinId.Set( majorId, minorId );
-
- MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
- if( skinInstance )
- {
- AknsUtils::CreateIconLC( skinInstance, skinId, bitmap, mask,
- KNullDesC, KErrNotFound, KErrNotFound );
- icon = CAknIcon::NewL();
- icon->SetBitmap( bitmap );
- icon->SetMask( mask );
- }
-
- // bitmap and icon, AknsUtils::CreateIconLC doesn't specify the order
- CleanupStack::Pop( 2 );
- }
-
- return icon;
- }
-
-// ---------------------------------------------------------
-// GetAppSkinL
-// ---------------------------------------------------------
-//
-LOCAL_C CAknIcon* GetAppSkinL( TUid& aAppUid )
- {
- CAknIcon* icon = NULL;
- CFbsBitmap* bitmap( 0 );
- CFbsBitmap* mask( 0 );
-
- MAknsSkinInstance* skin = AknsUtils::SkinInstance();
- if( skin )
- {
- TRAPD( err,
- {
- AknsUtils::CreateAppIconLC( skin, aAppUid,
- EAknsAppIconTypeList, bitmap, mask );
- CleanupStack::Pop(2); //for trap
- }
- );
- if( err == KErrNone )
- {
- icon = CAknIcon::NewL();
- icon->SetBitmap( bitmap );
- icon->SetMask( mask );
- }
- }
- return icon;
- }
-
-
-// ---------------------------------------------------------
-// GetDefaultSkinL
-// ---------------------------------------------------------
-//
-LOCAL_C CAknIcon* GetDefaultSkinL( const CCaInnerEntry &aItem )
- {
- CAknIcon* icon = NULL;
- if( aItem.GetEntryTypeName().Compare( KCaTypeApp ) == KErrNone )
- {
- TUid appUid( TUid::Uid( aItem.GetUid() ) );
- if( appUid == KSatUid )
- {
- CCaSatHandler* satHandler = CCaSatHandler::NewL();
- CleanupStack::PushL( satHandler );
- icon = satHandler->LoadIconL();
- CleanupStack::PopAndDestroy( satHandler );
- }
- if( !icon )
- {
- icon = GetAppSkinL( appUid );
- }
- if( !icon )
- {
- icon = GetSkinL( KAknsIIDQgnMenuUnknownLst.iMajor,
- KAknsIIDQgnMenuUnknownLst.iMinor );
- }
- }
- else if( aItem.GetEntryTypeName().Compare( KCaTypeFolder ) == KErrNone
- || aItem.GetEntryTypeName().Compare( KCaTypeCollection )
- == KErrNone || aItem.GetEntryTypeName().Compare(
- KCaTypeCollectionDownload ) == KErrNone )
- {
- icon = GetSkinL( KAknsIIDQgnPropFolderAppsMedium.iMajor,
- KAknsIIDQgnPropFolderAppsMedium.iMinor );
- }
- else if( aItem.GetEntryTypeName().Compare( KCaTypeUrl ) == KErrNone )
- {
- icon = GetSkinL( KAknsIIDQgnPropPbCommUrl.iMajor,
- KAknsIIDQgnPropPbCommUrl.iMinor );
- }
- else if( aItem.GetEntryTypeName().Compare( KCaTypeWidget ) == KErrNone )
- {
- icon = GetSkinL( KAknsIIDQgnIndiBrowserTbFeeds.iMajor,
- KAknsIIDQgnIndiBrowserTbFeeds.iMinor );
- }
- else if( aItem.GetEntryTypeName().Compare( KCaTypeTemplatedApp ) == KErrNone )
- {
- TInt uid;
- TLex lex (aItem.GetIcon().iApplicationId);
- lex.Val(uid);
- TUid appUid( TUid::Uid( uid ) );
- icon = GetAppSkinL( appUid );
- if( !icon )
- {
- icon = GetSkinL( KAknsIIDQgnMenuUnknownLst.iMajor,
- KAknsIIDQgnMenuUnknownLst.iMinor );
- }
- }
-
- return icon;
- }
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// MenuIconUtility::GetItemIcon
-// ---------------------------------------------------------
-//
-EXPORT_C CAknIcon* CaMenuIconUtility::GetItemIcon(
- const CCaInnerEntry &aEntry )
- {
- CAknIcon* icon = NULL;
- CCaInnerEntry::TIconAttributes iconAttributes( aEntry.GetIcon() );
- TRAP_IGNORE( icon = GetDefaultSkinL( aEntry ) );
- return icon;
- }
--- a/contentstorage/group/caextendedmenu.mmp Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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 caextendedmenu.dll
-TARGETTYPE dll
-UID 0x1000008D 0x20022F8C
-CAPABILITY CAP_GENERAL_DLL
-VENDORID VID_DEFAULT
-
-SOURCEPATH ../extsrc
-SOURCE caiconutility.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../extinc
-USERINCLUDE ../cautils/inc
-USERINCLUDE ../castorage/inc/
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY aknskins.lib
-LIBRARY aknicon.lib
-LIBRARY camenu.lib
-LIBRARY cautils.lib
-LIBRARY fbscli.lib
-LIBRARY casathandler.lib
-LIBRARY efsrv.lib
-LIBRARY apgrfx.lib
-LIBRARY ecom.lib
-
--- a/contentstorage/group/camenu.mmp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/group/camenu.mmp Mon May 03 12:48:45 2010 +0300
@@ -12,7 +12,7 @@
* Contributors:
*
* Description:
-* Version : %version: 19.1.3 % << Don't touch! Updated by Synergy at check-out.
+* Version : %version: 19.1.6 % << Don't touch! Updated by Synergy at check-out.
*
*/
@@ -34,6 +34,8 @@
SOURCE casrv.cpp
SOURCE casrvmmchistory.cpp
SOURCE cainstallnotifier.cpp
+SOURCE cainstallstrategy.cpp
+SOURCE cammcwatcher.cpp
SOURCE casrvengutils.cpp
SOURCE casrvnotifier.cpp
SOURCE castorageproxy.cpp
@@ -46,7 +48,7 @@
USERINCLUDE ../casrv/casrvmgr/inc
-MW_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
LIBRARY euser.lib
LIBRARY efsrv.lib
@@ -56,6 +58,7 @@
LIBRARY cautils.lib
LIBRARY castorage.lib
LIBRARY sysutil.lib
+LIBRARY platformenv.lib
LIBRARY ws32.lib
LIBRARY bafl.lib
--- a/contentstorage/group/group.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/group/group.pro Mon May 03 12:48:45 2010 +0300
@@ -31,11 +31,11 @@
"../casrv/casrvmgr/group/casrvmanager.mmp" \
"camenu.mmp" \
"camenusrv.mmp" \
- "caextendedmenu.mmp" \
"../casrv/caappscanner/group/caappscanner.mmp" \
"../casrv/casatmonitor/group/casatmonitor.mmp" \
"../casrv/cawidgetscanner/group/cawidgetscanner.mmp" \
- "../casrv/carunningappmonitor/group/carunningappmonitor.mmp"
+ "../casrv/carunningappmonitor/group/carunningappmonitor.mmp" \
+ "../casrv/causifscanner/group/causifscanner.mmp" \
tests_krakow {
BLD_INF_RULES.prj_mmpfiles += \
--- a/contentstorage/inc/cadef.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/inc/cadef.h Mon May 03 12:48:45 2010 +0300
@@ -12,7 +12,7 @@
* Contributors:
*
* Description: Definition of different constants
- * Version : %version: 10.1.7 % << Don't touch! Updated by Synergy at check-out.
+ * Version : %version: 10.1.12 % << Don't touch! Updated by Synergy at check-out.
*
*/
@@ -57,11 +57,14 @@
EMissing = 64
};
// Ca - Application
+
+_LIT( KCaTypeMenuCollections, "menucollections" );
_LIT( KCaTypeFolder, "folder" );
_LIT( KCaTypeCollection, "collection" );
_LIT( KCaTypeApp, "application" );
_LIT( KCaTypeWidget, "widget" );
_LIT( KCaTypeUrl, "url" );
+_LIT( KCaTypePackage, "package" );
_LIT( KCaAttrView, "view" ); ///< View.
_LIT( KCaAttrUrl, "url" );
_LIT( KCaAttrWindowGroupId, "window_group_id" );
@@ -69,6 +72,20 @@
_LIT( KCaPackageUid,"packageuid");
_LIT( KCaAttrInstallationTime, "installationTime");
_LIT( KCaTypeTemplatedApp, "templatedApplication" );
+_LIT( KCaAttrAppType, "apptype");
+_LIT( KCaAttrAppTypeValueJava, "java");
+_LIT( KCaAttrAppTypeValueCWRT, "cwrt");
+_LIT( KCaAttrAppTypeValueNative, "native");
+_LIT( KCaAttrComponentId, "component_id" );
+_LIT( KCaAttrAppSettingsPlugin, "app_settings_plugin");
+// app settings plugin for java apps
+_LIT( KCaAttrJavaAppSettingsPluginValue,
+ "/resource/qt/plugins/appsettings/javaapplicationsettingsview.qtplugin");
+_LIT( KCaAttrAppWidgetUri, "widget:uri");
+_LIT( KCaAttrAppWidgetUriCWRTValue, "wrtwidgetuiplugin");
+_LIT( KCaAttrAppWidgetParamWebAppId, "widgetparam:webAppId");
+
+_LIT( KCaAppGroupName, "appgroup_name" );
const TInt KGranularityOne = 1;
const TInt KUidChars = 10;
@@ -95,7 +112,17 @@
{
0x20022F35
};
-
+
+const TUid KMidletApplicationTypeUid =
+ {
+ 0x10210E26
+ };
+
+const TUid KCWRTApplicationTypeUid =
+ {
+ 0x200267DC
+ };
+
const TInt KCenRepBufferSize = 255;
//
// Attributes commonly used for all items.
--- a/contentstorage/srvinc/cainstallnotifier.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/srvinc/cainstallnotifier.h Mon May 03 12:48:45 2010 +0300
@@ -23,6 +23,8 @@
#include <e32property.h>
#include "castorage_global.h"
+class CNotifierStrategy;
+
/**
* Interface for updating after installer events.
*
@@ -37,7 +39,7 @@
* Pure virtual method.
* @param aEvent event type.
*/
- virtual void HandleInstallNotifyL( TInt aEvent ) = 0;
+ virtual void HandleInstallNotifyL(TInt aEvent) = 0;
};
/**
@@ -45,43 +47,24 @@
*
* @since S60 v5.0
*/
-NONSHARABLE_CLASS( CCaInstallNotifier ): public CActive
+NONSHARABLE_CLASS( CCaInstallNotifier ) : public CActive
{
public:
/**
- * Enum defining the operation type.
- */
- enum TInstOp
- {
- EInstOpNone = 0x00000000,
- EInstOpInstall = 0x00000001,
- EInstOpUninstall = 0x00000002,
- EInstOpRestore = 0x00000004
- };
-
- /**
- * Enum defining the operation status.
- */
- enum TInstOpStatus
- {
- EInstOpStatusNone = 0x00000000,
- EInstOpStatusSuccess = 0x00000100,
- EInstOpStatusAborted = 0x00000200
- };
-
- /**
* Enum defining notification type.
*/
enum TNotificationType
{
- ENoNotification = 0x00000000,
- ESisInstallNotification = KUidSwiLatestInstallation, ///< installation notification
+ ENoNotification, ///< No notification.
+ ESisInstallNotification, ///< System installation notification.
+ EJavaInstallNotification, ///< Java instalation and uninstallation notification.
+ EUsifUninstallNotification, ///< Usif's uninstalation notification.
};
/**
- * Creates an instance of CCaInstallNotifier implementation.
+ * Creates an instance of CCaInstallNotifier.
* @param aNotifier Reference to notifier interface.
* @param aNotificationType Notification type.
*/
@@ -99,14 +82,13 @@
* Constructor.
* @param aNotifier Reference to notifier interface.
*/
- CCaInstallNotifier( MCaInstallListener& aListener,
- TNotificationType aNotificationType );
+ CCaInstallNotifier( MCaInstallListener& aListener );
/**
* Symbian 2nd phase constructor.
* @param aNotificationType Notification type.
*/
- void ConstructL();
+ void ConstructL( TNotificationType aNotificationType );
/**
* From CActive.
@@ -138,9 +120,9 @@
MCaInstallListener& iListener;
/*
- * Notification type.
+ * Notification strategy.
*/
- TInt iRPropertyKey;
+ CNotifierStrategy* iNotifierStrategy;
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/srvinc/cainstallstrategy.h Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: ?Description
+ *
+ */
+
+#ifndef CAINSTALLSTRATEGY_H
+#define CAINSTALLSTRATEGY_H
+
+#include "cainstallnotifier.h"
+#include <e32base.h>
+#include <SWInstallerInternalPSKeys.h>
+
+/**
+ * Strategy interface.
+ *
+ * @since S60 v5.0
+ */
+class CNotifierStrategy: public CBase
+ {
+public:
+
+ /**
+ * Notifies listener with changes in property.
+ * @param aProperty to read values from.
+ * @param aListener listener to notify.
+ */
+ virtual void NotifyListenerL( RProperty& aProperty,
+ MCaInstallListener& aListener ) = 0;
+
+ };
+
+/**
+ * CA Install strategy.
+ *
+ * @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CCaSwiInstallStrategy ): public CNotifierStrategy
+ {
+public:
+
+ /**
+ * Creates an instance of CCaInstallStrategy.
+ * @param aProperty property to handle.
+ */
+ static CCaSwiInstallStrategy* NewL( RProperty& aProperty );
+
+ /**
+ * Notifies listener with changes in property.
+ * @param aProperty to read values from.
+ * @param aListener listener to notify.
+ */
+ void NotifyListenerL( RProperty& aProperty,
+ MCaInstallListener& aListener );
+
+private:
+
+ /**
+ * Constructor.
+ * @param aProperty property to handle.
+ */
+ CCaSwiInstallStrategy( RProperty& aProperty );
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL();
+
+ };
+
+/**
+ * CA Java install strategy.
+ *
+ * @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CCaJavaInstallStrategy ): public CNotifierStrategy
+ {
+public:
+
+ /**
+ * Creates an instance of CCaInstallStrategy.
+ * @param aProperty property to handle.
+ */
+ static CCaJavaInstallStrategy* NewL( RProperty& aProperty );
+
+ /**
+ * Notifies listener with changes in property.
+ * @param aProperty to read values from.
+ * @param aListener listener to notify.
+ */
+ void NotifyListenerL( RProperty& aProperty,
+ MCaInstallListener& aListener );
+
+private:
+
+ /**
+ * Constructor.
+ * @param aProperty property to handle.
+ */
+ CCaJavaInstallStrategy( RProperty& aProperty );
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL();
+
+ };
+
+/**
+ * CA Unninstal with USIF strategy.
+ *
+ * @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CCaUsifUninstallStrategy ): public CNotifierStrategy
+ {
+public:
+
+ /**
+ * Creates an instance of CCaInstallStrategy.
+ * @param aProperty property to handle.
+ */
+ static CCaUsifUninstallStrategy* NewL( RProperty& aProperty );
+
+ /**
+ * Notifies listener with changes in property.
+ * @param aProperty to read values from.
+ * @param aListener listener to notify.
+ */
+ void NotifyListenerL( RProperty& aProperty,
+ MCaInstallListener& aListener );
+
+private:
+
+ /**
+ * Constructor.
+ * @param aProperty property to handle.
+ */
+ CCaUsifUninstallStrategy( RProperty& aProperty );
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL();
+
+private:
+
+ /**
+ * Contains uid of application that was started to uninstall.
+ */
+ TInt iAppUid;
+
+ };
+
+#endif /* CAINSTALLSTRATEGY_H */
+
+// End of File
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/srvinc/cammcwatcher.h Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,122 @@
+/*
+* 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_CAMMCWATCHER_H
+#define C_CAMMCWATCHER_H
+
+
+#include <e32base.h>
+#include <f32file.h>
+
+/**
+ * Interface for observing MMC events.
+ *
+ * @since S60 S60 v3.1
+ */
+class MMmcWatcherCallback
+ {
+
+public:
+ /**
+ * MmcChangeL is called when the MMC is removed or inserted.
+ */
+ virtual void MmcChangeL() = 0;
+
+ };
+
+/**
+ * This active object waits for an indication that the media has changed.
+ *
+ * @since S60 S60 v3.1
+ */
+NONSHARABLE_CLASS( CCaMmcWatcher ) : public CActive
+ {
+
+public:
+
+ /**
+ * Two-phased constructor.
+ * @param aObserver Pointer to notifier interface.
+ * @param aFs file server session.
+ */
+IMPORT_C static CCaMmcWatcher* NewL( RFs& aFs,
+ MMmcWatcherCallback* aObserver );
+
+ /**
+ * Two-phased constructor.
+ * @param aObserver Pointer to notifier interface.
+ * @param aFs file server session.
+ */
+IMPORT_C static CCaMmcWatcher* NewLC( RFs& aFs,
+ MMmcWatcherCallback* aObserver );
+
+ /**
+ * Destructor
+ */
+ ~CCaMmcWatcher();
+
+private:
+
+ /**
+ * C++ default constructor
+ * @param aObserver Pointer to notifier interface.
+ * @param aFs file server session.
+ */
+ CCaMmcWatcher( RFs& aFs, MMmcWatcherCallback* aObserver );
+
+ /**
+ * By default Symbian OS constructor is private.
+ */
+ void ConstructL();
+
+ /**
+ * Set notification request
+ */
+ void WaitForChangeL();
+
+ /**
+ * From CActive.
+ */
+ void DoCancel();
+
+ /**
+ * From CActive.
+ */
+ void RunL();
+
+ /**
+ * From CActive.
+ */
+ TInt RunError( TInt aError );
+
+private:
+
+ /**
+ * File server session.
+ * Not Own
+ */
+ RFs iFs;
+
+ /**
+ * MMC events observer
+ * Not own.
+ */
+ MMmcWatcherCallback* iObserver;
+ };
+
+
+#endif // C_CAMMCWATCHER_H
--- a/contentstorage/srvinc/casrvengutils.h Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/srvinc/casrvengutils.h Mon May 03 12:48:45 2010 +0300
@@ -47,7 +47,7 @@
* @param aAttrExists ETrue if attribute exist.
* @param aAttrVal attribute value.
*/
- TBool IsNative( const CCaInnerEntry& aEntry );
+ TBool IsNativeL( const CCaInnerEntry& aEntry );
private:
@@ -61,7 +61,7 @@
* @param aAppUid applications uid
* @param aIsNative ETrue if apppication is native
*/
- void IsNative( TUid aAppUid, TBool& aIsNative );
+ void IsNativeL( TUid aAppUid, TBool& aIsNative );
private:
// Data
--- a/contentstorage/srvsrc/cainstallnotifier.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/srvsrc/cainstallnotifier.cpp Mon May 03 12:48:45 2010 +0300
@@ -16,14 +16,14 @@
*/
#include "cainstallnotifier.h"
+#include "cainstallstrategy.h"
EXPORT_C CCaInstallNotifier* CCaInstallNotifier::NewL(
MCaInstallListener& aListener, TNotificationType aNotificationType )
{
- CCaInstallNotifier* self = new ( ELeave ) CCaInstallNotifier(
- aListener, aNotificationType );
+ CCaInstallNotifier* self = new ( ELeave ) CCaInstallNotifier( aListener );
CleanupStack::PushL( self );
- self->ConstructL();
+ self->ConstructL( aNotificationType );
CleanupStack::Pop( self );
return self;
}
@@ -32,21 +32,34 @@
{
Cancel();
iProperty.Close();
+ delete iNotifierStrategy;
}
-CCaInstallNotifier::CCaInstallNotifier( MCaInstallListener& aListener,
- TNotificationType aNotificationType ) :
+CCaInstallNotifier::CCaInstallNotifier( MCaInstallListener& aListener ) :
CActive( EPriorityNormal ), iListener( aListener )
{
- iRPropertyKey = aNotificationType;
- iProperty.Attach( KUidSystemCategory, iRPropertyKey );
CActiveScheduler::Add( this );
- iProperty.Subscribe( iStatus );
SetActive();
}
-void CCaInstallNotifier::ConstructL()
+void CCaInstallNotifier::ConstructL( TNotificationType aNotificationType )
{
+ switch( aNotificationType )
+ {
+ case ESisInstallNotification:
+ iNotifierStrategy = CCaSwiInstallStrategy::NewL( iProperty );
+ break;
+ case EUsifUninstallNotification:
+ iNotifierStrategy = CCaUsifUninstallStrategy::NewL( iProperty );
+ break;
+ case EJavaInstallNotification:
+ iNotifierStrategy = CCaJavaInstallStrategy::NewL( iProperty );
+ break;
+ default:
+ User::Leave( KErrNotSupported );
+ break;
+ }
+ iProperty.Subscribe( iStatus );
}
void CCaInstallNotifier::DoCancel()
@@ -58,13 +71,7 @@
{
SetActive();
iProperty.Subscribe( iStatus );
- TInt appUid;
- User::LeaveIfError( iProperty.Get( KUidSystemCategory, iRPropertyKey,
- appUid ) );
- if( appUid )
- {
- iListener.HandleInstallNotifyL( appUid );
- }
+ iNotifierStrategy->NotifyListenerL( iProperty, iListener );
}
TInt CCaInstallNotifier::RunError( TInt /*aError*/)
@@ -72,3 +79,4 @@
// No need to do anything
return KErrNone;
}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/srvsrc/cainstallstrategy.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,172 @@
+/*
+ * 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 <e32property.h>
+#include <SWInstallerInternalPSKeys.h>
+#include <javadomainpskeys.h>
+#include "cainstallstrategy.h"
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaSwiInstallStrategy* CCaSwiInstallStrategy::NewL( RProperty& aProperty )
+ {
+ CCaSwiInstallStrategy* self = new ( ELeave ) CCaSwiInstallStrategy(
+ aProperty );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaSwiInstallStrategy::NotifyListenerL(
+ RProperty& aProperty, MCaInstallListener& aListener )
+ {
+ TInt appUid;
+ User::LeaveIfError( aProperty.Get( KUidSystemCategory,
+ KUidSwiLatestInstallation, appUid ) );
+ if( appUid )
+ {
+ aListener.HandleInstallNotifyL(appUid );
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaSwiInstallStrategy::CCaSwiInstallStrategy( RProperty& aProperty )
+ {
+ aProperty.Attach( KUidSystemCategory, KUidSwiLatestInstallation );
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaSwiInstallStrategy::ConstructL()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaJavaInstallStrategy* CCaJavaInstallStrategy::NewL( RProperty& aProperty )
+ {
+ CCaJavaInstallStrategy* self =
+ new ( ELeave ) CCaJavaInstallStrategy( aProperty );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaJavaInstallStrategy::NotifyListenerL(
+ RProperty& aProperty, MCaInstallListener& aListener )
+ {
+//TODO: temporary sollution until new notification mechanism from usif in wk14
+// TInt state;
+// User::LeaveIfError( aProperty.Get( KUidSystemCategory,
+// KPSUidJavaLatestInstallationState, state ) );
+// if( ( ( state & ESASwisInstall ) || ( state & ESASwisUninstall ) )
+// && ( state & ESASwisStatusSuccess ) )
+// {
+ TInt appUid;
+ User::LeaveIfError( aProperty.Get( KUidSystemCategory,
+ KPSUidJavaLatestInstallation, appUid ) );
+ aListener.HandleInstallNotifyL(appUid );
+// }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaJavaInstallStrategy::CCaJavaInstallStrategy( RProperty& aProperty )
+ {
+ aProperty.Attach( KUidSystemCategory, KPSUidJavaLatestInstallationState );
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaJavaInstallStrategy::ConstructL()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaUsifUninstallStrategy* CCaUsifUninstallStrategy::NewL(
+ RProperty& aProperty )
+ {
+ CCaUsifUninstallStrategy* self =
+ new ( ELeave ) CCaUsifUninstallStrategy( aProperty );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaUsifUninstallStrategy::NotifyListenerL(
+ RProperty& aProperty, MCaInstallListener& aListener )
+ {
+ TInt appUid;
+ User::LeaveIfError( aProperty.Get( KPSUidSWInstallerUiNotification,
+ KSWInstallerUninstallation, appUid ) );
+ // if there is some value!=0 in iAppUid and appUid==0 that means
+ // application with uid==iAppUid was uninstalled, so we notify aListener
+ if( iAppUid && !appUid )
+ {
+ aListener.HandleInstallNotifyL( iAppUid );
+ }
+ iAppUid = appUid;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaUsifUninstallStrategy::CCaUsifUninstallStrategy( RProperty& aProperty )
+ {
+ aProperty.Attach(
+ KPSUidSWInstallerUiNotification, KSWInstallerUninstallation );
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaUsifUninstallStrategy::ConstructL()
+ {
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/srvsrc/cammcwatcher.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* 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 <driveinfo.h>
+
+#include "cammcwatcher.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CCaWidgetMmcWatcher::NewL
+// Second phase constructor
+// ---------------------------------------------------------
+//
+EXPORT_C CCaMmcWatcher* CCaMmcWatcher::NewL( RFs& aFs,
+ MMmcWatcherCallback* aObserver )
+ {
+ CCaMmcWatcher* self = NewLC( aFs, aObserver );
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------
+// CCaWidgetMmcWatcher::NewLC
+// Second phase constructor
+// ---------------------------------------------------------
+//
+EXPORT_C CCaMmcWatcher* CCaMmcWatcher::NewLC( RFs& aFs,
+ MMmcWatcherCallback* aObserver )
+ {
+ CCaMmcWatcher* self = new (ELeave) CCaMmcWatcher( aFs,
+ aObserver );
+ CleanupStack::PushL ( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------
+// CCaWidgetMmcWatcher::~CCaWidgetMmcWatcher
+// Destructor
+// ---------------------------------------------------------
+//
+CCaMmcWatcher::~CCaMmcWatcher()
+ {
+ Cancel();
+ }
+
+// ---------------------------------------------------------
+// CCaWidgetMmcWatcher::CCaWidgetMmcWatcher
+// Default constructor
+// ---------------------------------------------------------
+//
+CCaMmcWatcher::CCaMmcWatcher( RFs& aFs,
+ MMmcWatcherCallback* aObserver )
+ : CActive( CActive::EPriorityStandard ),
+ iFs(aFs),
+ iObserver(aObserver)
+ {
+ CActiveScheduler::Add(this);
+ }
+
+// ---------------------------------------------------------
+// CCaWidgetMmcWatcher::ConstructL
+// default Symbian OS constructor
+// ---------------------------------------------------------
+//
+void CCaMmcWatcher::ConstructL()
+ {
+ WaitForChangeL();
+ }
+
+// ---------------------------------------------------------
+// CCaWidgetMmcWatcher::WaitForChangeL
+// Request notification for disk change
+// ---------------------------------------------------------
+//
+void CCaMmcWatcher::WaitForChangeL()
+ {
+ TInt mmcDrive;
+ User::LeaveIfError( DriveInfo::GetDefaultDrive(
+ DriveInfo::EDefaultRemovableMassStorage, mmcDrive ) );
+ TDriveName mmcDriveName( TDriveUnit( mmcDrive ).Name() );
+ iFs.NotifyChange( ENotifyEntry, iStatus, mmcDriveName );
+ SetActive();
+ }
+
+// ---------------------------------------------------------
+// CCaWidgetMmcWatcher::DoCancel
+// ---------------------------------------------------------
+//
+void CCaMmcWatcher::DoCancel()
+ {
+ iFs.NotifyChangeCancel();
+ }
+
+// ---------------------------------------------------------------------------
+// CCaWidgetMmcWatcher::RunError
+// ---------------------------------------------------------------------------
+//
+TInt CCaMmcWatcher::RunError( TInt /*aError*/ )
+ {
+ // No need to do anything
+ return KErrNone;
+ }
+
+// ---------------------------------------------------------
+// CCaWidgetMmcWatcher::RunL
+// ---------------------------------------------------------
+//
+void CCaMmcWatcher::RunL()
+ {
+ TInt status( iStatus.Int() );
+ WaitForChangeL();
+ if ( status >= KErrNone )
+ {
+ iObserver->MmcChangeL();
+ }
+ }
+
--- a/contentstorage/srvsrc/casrvengutils.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/srvsrc/casrvengutils.cpp Mon May 03 12:48:45 2010 +0300
@@ -115,10 +115,10 @@
}
// ---------------------------------------------------------
-// CMenuSrvEngUtils::IsNative
+// CMenuSrvEngUtils::IsNativeL
// ---------------------------------------------------------
//
-TBool CCaSrvEngUtils::IsNative( const CCaInnerEntry& aEntry )
+TBool CCaSrvEngUtils::IsNativeL( const CCaInnerEntry& aEntry )
{
TBool native( EFalse );
if( aEntry.GetEntryTypeName().CompareF( KCaTypeApp ) == KErrNone )
@@ -126,7 +126,7 @@
TUid uid;
if( GetAppUid( aEntry, uid ) == KErrNone )
{
- IsNative( uid, native );
+ IsNativeL( uid, native );
}
}
return native;
@@ -137,17 +137,18 @@
// ---------------------------------------------------------
//
-void CCaSrvEngUtils::IsNative( TUid aAppUid, TBool& aIsNative )
+void CCaSrvEngUtils::IsNativeL( TUid aAppUid, TBool& aIsNative )
{
- TApaAppInfo appInfo;
+ TApaAppInfo* appInfo = new( ELeave ) TApaAppInfo();
aIsNative = EFalse;
- TInt error = iApaLsSession.GetAppInfo( appInfo, aAppUid );
+ TInt error = iApaLsSession.GetAppInfo( *appInfo, aAppUid );
if( error == KErrNone )
{
- error = iApaLsSession.IsProgram( appInfo.iFullName, aIsNative );
+ error = iApaLsSession.IsProgram( appInfo->iFullName, aIsNative );
if( error != KErrNone )
{
aIsNative = EFalse;
}
}
+ delete appInfo;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/group/bld.inf Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+TOOLS2
+
+PRJ_EXPORTS
+skin_icon.prf /epoc32/tools/qt/mkspecs/features/symbian/skin_icon.prf
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/group/skin_icon.prf Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,16 @@
+
+!isEmpty(SKINICON) {
+
+!count(SKINICON, 1) {
+ SKINICON = $$first(SKINICON)
+ warning("Only first icon specified in SKINICON variable is used: $$SKINICON")
+}
+# use proper UID
+RSS_RULES.header *= "$${LITERAL_HASH}include <eikon.rh>"
+RSS_RULES.header += "$${LITERAL_HASH}define SKINSERVICE 0x2002DCF3"
+RSS_RULES.service_list += "uid = SKINSERVICE; opaque_data = r_skin_icon; "
+RSS_RULES.footer +="RESOURCE TBUF r_skin_icon \{ buf =\"$$SKINICON\"; \}"
+}
+
+
+
--- a/homescreensrv.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/homescreensrv.pro Mon May 03 12:48:45 2010 +0300
@@ -22,9 +22,10 @@
contentpublishingsrv \
homescreensrv_plat \
screensavermodel \
- bagetmodel \
- activityfw \
tsrc
+symbian:SUBDIRS += activityfw
+symbian:SUBDIRS += hsappkeyhandler
+
CONFIG += ordered
--- a/homescreensrv_plat/contentstorage_api/caitemmodel.h Fri Apr 16 15:16:09 2010 +0300
+++ b/homescreensrv_plat/contentstorage_api/caitemmodel.h Mon May 03 12:48:45 2010 +0300
@@ -47,8 +47,8 @@
ParentIdRole,
TypeRole,
FlagsRole,
- TextRole//contains title represented as QString,
- //convinient for operations such as search
+ TextRole,//contains title represented as QString,
+ FullTextRole //'title description' convinient for operations such as search
};
// Function declarations
@@ -75,7 +75,7 @@
void setParentId(int parentId);
void setFlagsOn(const EntryFlags &onFlags);
void setFlagsOff(const EntryFlags &offFlags);
- CaEntry* entry(const QModelIndex &index) const;
+ QSharedPointer<CaEntry> entry(const QModelIndex &index) const;
signals:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/contentstorage_api/camenuiconutility.h Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: The API supports requesting raw bitmaps
+ *
+*/
+
+
+#ifndef __CAMENUICONUTILITY_H__
+#define __CAMENUICONUTILITY_H__
+
+#include "caclient_global.h"
+
+class CaEntry;
+class HbIcon;
+
+class CACLIENT_EXPORT CaMenuIconUtility
+{
+public:
+ static HbIcon getApplicationIcon(int uid,
+ const QSize &size = QSize(50,80));
+
+ static HbIcon getEntryIcon(const CaEntry& entry,
+ const QSize &size = QSize(50,80));
+};
+
+#endif // __CAMENUICONUTILITY_H__
--- a/homescreensrv_plat/contentstorage_api/caservice.h Fri Apr 16 15:16:09 2010 +0300
+++ b/homescreensrv_plat/contentstorage_api/caservice.h Mon May 03 12:48:45 2010 +0300
@@ -44,17 +44,17 @@
static QSharedPointer<CaService> instance();
- CaEntry * getEntry(int entryId) const;
- QList<CaEntry *> getEntries(const QList<int> &entryIdList) const;
- QList<CaEntry *> getEntries(const CaQuery &query) const;
+ QSharedPointer<CaEntry> getEntry(int entryId) const;
+ QList< QSharedPointer<CaEntry> > getEntries(const QList<int> &entryIdList) const;
+ QList< QSharedPointer<CaEntry> > getEntries(const CaQuery &query) const;
QList<int> getEntryIds(const CaQuery &query) const;
- CaEntry *createEntry(const CaEntry &entry) const;
+ QSharedPointer<CaEntry> createEntry(const CaEntry &entry) const;
bool removeEntry(int entryId) const;
bool removeEntry(const CaEntry &entry) const;
bool removeEntries(const QList<int> &entryIdList) const;
- bool removeEntries(const QList<CaEntry *> &entryList) const;
+ bool removeEntries(const QList< QSharedPointer<CaEntry> > &entryList) const;
bool updateEntry(const CaEntry &entry) const;
bool touch(const CaEntry &entry) const;
@@ -66,7 +66,7 @@
bool insertEntriesIntoGroup(int groupId, const QList<int> &entryIdList,
int beforeEntryId) const;
bool insertEntriesIntoGroup(const CaEntry &group,
- const QList<CaEntry *> &entryList, int beforeEntryId) const;
+ const QList< QSharedPointer<CaEntry> > &entryList, int beforeEntryId) const;
bool removeEntryFromGroup(int groupId, int entryId) const;
bool removeEntryFromGroup(const CaEntry &group,
@@ -74,7 +74,7 @@
bool removeEntriesFromGroup(int groupId,
const QList<int> &entryIdList) const;
bool removeEntriesFromGroup(const CaEntry &group,
- const QList<CaEntry *> &entryList) const;
+ const QList< QSharedPointer<CaEntry> > &entryList) const;
bool appendEntryToGroup(int groupId, int entryId) const;
bool appendEntryToGroup(const CaEntry &group,
@@ -82,7 +82,7 @@
bool appendEntriesToGroup(int groupId,
const QList<int> &entryIdList) const;
bool appendEntriesToGroup(const CaEntry &group,
- const QList<CaEntry *> &entryList) const;
+ const QList< QSharedPointer<CaEntry> > &entryList) const;
bool prependEntryToGroup(int groupId, int entryId) const;
bool prependEntryToGroup(const CaEntry &group,
@@ -90,7 +90,7 @@
bool prependEntriesToGroup(int groupId,
const QList<int> &entryIdList) const;
bool prependEntriesToGroup(const CaEntry &group,
- const QList<CaEntry *> &entryList) const;
+ const QList< QSharedPointer<CaEntry> > &entryList) const;
bool executeCommand(int entryId, const QString &command =
caCmdOpen) const;
--- a/homescreensrv_plat/contentstorage_api/contentstorage_api.pri Fri Apr 16 15:16:09 2010 +0300
+++ b/homescreensrv_plat/contentstorage_api/contentstorage_api.pri Mon May 03 12:48:45 2010 +0300
@@ -23,4 +23,5 @@
contentstorage_api/canotifierfilter.h \
contentstorage_api/caquery.h \
contentstorage_api/caservice.h \
- contentstorage_api/caitemmodel.h
\ No newline at end of file
+ contentstorage_api/caitemmodel.h \
+ contentstorage_api/camenuiconutility.h
\ No newline at end of file
--- a/homescreensrv_plat/homescreensrv_plat.pro Fri Apr 16 15:16:09 2010 +0300
+++ b/homescreensrv_plat/homescreensrv_plat.pro Mon May 03 12:48:45 2010 +0300
@@ -20,7 +20,6 @@
include(appruntimemodel_api/appruntimemodel_api.pri)
include(contentstorage_api/contentstorage_api.pri)
include(hswidgetmodel_api/hswidgetmodel_api.pri)
-include(servicemodel_api/servicemodel_api.pri)
include(statemodel_api/statemodel_api.pri)
include(menu_sat_interface_api/menu_sat_interface_api.pri)
include(homescreen_information_api/homescreen_information_api.pri)
--- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahpapplauncher.cpp Fri Apr 16 15:16:09 2010 +0300
+++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahpapplauncher.cpp Mon May 03 12:48:45 2010 +0300
@@ -77,7 +77,7 @@
TInt errCode(KErrArgument);
RBuf launchMethod;
CleanupClosePushL( launchMethod );
-
+
if ( !ExtractDesL( aMap, launchMethod, KLaunchMethod ) )
{
if ( !launchMethod.CompareF( KLaunchMethodValueCmdLine ) )
@@ -90,8 +90,8 @@
errCode = ExecuteApaMessageL( aMap );
}
}
-
- CleanupStack::PopAndDestroy( &launchMethod );
+
+ CleanupStack::PopAndDestroy( &launchMethod );
return errCode;
}
@@ -133,19 +133,19 @@
// ---------------------------------------------------------------------------
// 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() );
+ 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 )
@@ -153,7 +153,7 @@
{
errCode = task.SendMessage( messageUid, additionalData );
}
- CleanupStack::PopAndDestroy( &additionalData );
+ CleanupStack::PopAndDestroy( &additionalData );
}
else
{ // app not yet running
@@ -170,7 +170,7 @@
errCode = StartAppL( aMap );
}
}
- CleanupStack::PopAndDestroy( &launchMethod );
+ CleanupStack::PopAndDestroy( &launchMethod );
}
}
return errCode;
@@ -179,14 +179,14 @@
// ---------------------------------------------------------------------------
// Start document
// ---------------------------------------------------------------------------
-//
+//
TInt CAHAppLauncher::StartDocumentL( const CLiwMap* aMap )
{
TInt errCode(KErrArgument);
TUid appUid= TUid::Null( );
RBuf documentNameValue;
CleanupClosePushL( documentNameValue );
- if ( !ExtractUidL( aMap, appUid, KApplicationUid )
+ if ( !ExtractUidL( aMap, appUid, KApplicationUid )
&& !ExtractDesL( aMap, documentNameValue, KDocumentName ) )
{
RApaLsSession appArcSession;
@@ -202,7 +202,7 @@
// ---------------------------------------------------------------------------
// Starts application
// ---------------------------------------------------------------------------
-//
+//
TInt CAHAppLauncher::StartAppL( const CLiwMap* aMap )
{
TInt errCode(KErrArgument);
@@ -294,7 +294,7 @@
}
// ---------------------------------------------------------------------------
-//
+//
// ---------------------------------------------------------------------------
//
TInt CAHAppLauncher::ExtractDesL( const CLiwMap* aMap,
@@ -306,17 +306,23 @@
TPtrC tempString( KNullDesC );
if ( aMap->FindL( aMapName, variant ) )
{
- variant.Get( tempString );
- aString.ReAllocL( tempString.Length( ) );
- aString.Append( tempString );
- errCode = KErrNone;
+ if ( variant.Get( tempString ) )
+ {
+ aString.ReAllocL( tempString.Length( ) );
+ aString.Append( tempString );
+ errCode = KErrNone;
+ }
+ else
+ {
+ errCode = KErrCorrupt;
+ }
}
- CleanupStack::PopAndDestroy( &variant );
+ CleanupStack::PopAndDestroy( &variant );
return errCode;
}
-
+
// ---------------------------------------------------------------------------
-//
+//
// ---------------------------------------------------------------------------
//
TInt CAHAppLauncher::ExtractDes8L( const CLiwMap* aMap,
@@ -328,17 +334,23 @@
TPtrC8 tempString( KNullDesC8 );
if ( aMap->FindL( aMapName, variant ) )
{
- variant.Get( tempString );
- aString.ReAllocL( tempString.Length( ) );
- aString.Append( tempString );
- errCode = KErrNone;
+ if ( variant.Get( tempString ) )
+ {
+ aString.ReAllocL( tempString.Length( ) );
+ aString.Append( tempString );
+ errCode = KErrNone;
+ }
+ else
+ {
+ errCode = KErrCorrupt;
+ }
}
- CleanupStack::PopAndDestroy( &variant );
+ CleanupStack::PopAndDestroy( &variant );
return errCode;
- }
+ }
// ---------------------------------------------------------------------------
-//
+//
// ---------------------------------------------------------------------------
//
TInt CAHAppLauncher::ExtractUidL( const CLiwMap* aMap, TUid& aUid,
@@ -351,16 +363,22 @@
variant.PushL( );
if ( aMap->FindL( aMapName, variant ) )
{
- variant.Get( temp );
- aUid = TUid::Uid( temp );
- errCode = KErrNone;
+ 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 )
@@ -370,13 +388,25 @@
TLiwVariant variant;
if ( aMap->FindL( KViewId, variant ) )
{
- variant.Get( aViewId.iViewUid.iUid );
- variant.Reset( );
- if ( aMap->FindL( KViewAppUid, variant ) )
+ if ( variant.Get( aViewId.iViewUid.iUid ) )
{
- variant.Get( aViewId.iAppUid.iUid );
variant.Reset( );
- errCode = KErrNone;
+ if ( aMap->FindL( KViewAppUid, variant ) )
+ {
+ if ( variant.Get( aViewId.iAppUid.iUid ) )
+ {
+ variant.Reset( );
+ errCode = KErrNone;
+ }
+ else
+ {
+ errCode = KErrCorrupt;
+ }
+ }
+ }
+ else
+ {
+ errCode = KErrCorrupt;
}
}
@@ -384,7 +414,7 @@
}
// ---------------------------------------------------------------------------
-//
+//
// ---------------------------------------------------------------------------
//
TApaCommand CAHAppLauncher::GetCommandL( const CLiwMap* aMap )
@@ -403,4 +433,4 @@
return command;
}
-// End of file
+// End of file
--- a/homescreensrv_plat/servicemodel_api/hsiserviceprovider.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +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: HsService provider interface.
-*
-*/
-
-
-#ifndef HSISERVICEPROVIDER_H
-#define HSISERVICEPROVIDER_H
-
-#include <QtPlugin>
-#include <QList>
-#include <QString>
-
-/**
- * @ingroup group_hsservicemodel group_service_api_candidates
- * @brief Represents a home screen service that can be created.
- *
- * Home screen services are located in service providers. Each provider
- * exposes its contained services as service tokens. A token has all
- * the needed information for service selection and creation.
- *
- * @lib ?library
- * @since S60 ?S60_version
- */
-class HsServiceToken
-{
-
-public:
-
- /**
- * The name of the library/plugin that contains the service.
- */
- QString mLibrary;
-
- /**
- * Uniquely identifies the service.
- */
- QString mUri;
-
-};
-
-
-class IHsPlatformServiceAdapter;
-
-/**
- * @ingroup group_hsservicemodel group_service_api_candidates
- * @brief Defines a mechanism for retrieving a home screen service.
- *
- * Interface that defines a mechanism for retrieving a home screen
- * service. Each home screen service provider implements this interface.
- *
- * @lib ?library
- * @since S60 ?S60_version
- */
-class IHsServiceProvider
-{
-
-public:
-
- /**
- * Destructor.
- * @since S60 ?S60_version.
- */
- virtual ~IHsServiceProvider() {}
-
-public:
-
- /**
- * Returns contained services as a list of service tokens.
- * @since S60 ?S60_version.
- * @return Contained services as tokens.
- */
- virtual QList<HsServiceToken> services() = 0;
-
- /**
- * Creates and returns a service based on the given token.
- * @since S60 ?S60_version.
- * @param aToken Identifies the service to be created.
- * @return The created service or null in failure cases.
- */
- virtual IHsPlatformServiceAdapter* createService(const HsServiceToken& aToken) = 0;
-
-};
-
-Q_DECLARE_INTERFACE(IHsServiceProvider, "com.nokia.homescreen.iserviceprovider/1.0")
-
-#endif
--- a/homescreensrv_plat/servicemodel_api/iplatformserviceadapter.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#ifndef IPLATFORMHSSERVICEMODEL_H
-#define IPLATFORMHSSERVICEMODEL_H
-
-#include <QString>
-#include "serviceinterfaceid.h"
-
-class IHsServiceBase;
-class HsService;
-
-/**
- * @ingroup group_hsservicemodel group_service_api_candidates
- * @brief Pure virtual class to create requested service.
- * All the service plugines need to implement this class.
- *
- */
-class IHsPlatformServiceAdapter
-{
-
-public:
-
- /**
- * Destructor.
- * @since S60 ?S60_version.
- */
- virtual ~IHsPlatformServiceAdapter() {}
-
-public:
-
- /**
- *
- * @param aService for example 'HsService.Messaging'
- * @param aInterface for example 'IMessaging'
- * @since S60 ?S60_version.
- * @return pointer to created service. NULL if service not found.
- */
- virtual HsService* getService(const QString &aService, const QString &aInterface) = 0;
-
- /**
- * @param aInterfaceId
- * @since S60 ?S60_version.
- * @return pointer to created service. NULL if service not found.
- */
- virtual IHsServiceBase* getService(const HsServiceInterfaceId &aInterfaceId) = 0;
-
-};
-
-#endif
--- a/homescreensrv_plat/servicemodel_api/service.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +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 SERVICE_H
-#define SERVICE_H
-
-#include "servicemodel_global.h"
-#include <QObject>
-#include <QVariant>
-
-class ServiceParameters;
-
-/**
- * @ingroup group_hsservicemodel group_service_api_candidates
- * @brief Base class for all the services.
- */
-class HSSERVICEMODEL_EXPORT HsService : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * Constructor
- * @param aParent
- */
- HsService( QObject* aParent = 0 ) : QObject( aParent ) {}
-
- /**
- * destructor
- * @since S60 ?S60_version.
- */
- virtual ~HsService() {}
-
-public:
-
- /**
- * Execute service command
- * @param aCommand service command
- * @param aInParameters parameters.
- * For example messaging service
- * needs to have at least the following pairs to send short message:
- * 'MessageType' - 'SMS'
- * 'To' - 'phone number here'
- * 'BodyText' - 'this is text to be sent'
- * So aInParameters should include QMap:
- * @code
- * QMap<QString, QVariant> parameters;
- * parameters["MessageType"]=QVariant(QString("SMS"));
- * parameters["To"]=QVariant(QString("555555"));
- * parameters["BodyText"]=QVariant(QString("this is bodytext"));
- * QVariant inParameters;
- * inParameters.setValue(parameters);
- * @endcode
- */
- virtual void executeCommand(const QByteArray &aCommand, const QVariant &aInParameters) = 0;
-
- /**
- * Cancels ALL then pending commands.
- */
- virtual void cancelCommands() = 0;
-
- /**
- * Get data after dataReceived signal has been received.
- *
- * @param aData data buffer to be filled
- * TODO: error?
- */
- virtual void getData(QVariant &aData) = 0;
-
-signals:
-
- /**
- * Signal emitted when data is received, client can then make query for the received data using getData function.
- */
- void dataReceived();
-
- /**
- * Signal emitted when data is received
- * @param aData (QMap<QString, QVariant>) data received from the service
- */
- void dataReceived(const QVariant &aData);
-
-};
-
-#endif
--- a/homescreensrv_plat/servicemodel_api/servicebase.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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: HsService base
-*
-*/
-
-
-#ifndef SERVICEBASE_H
-#define SERVICEBASE_H
-
-struct HsServiceInterfaceId;
-
-/** @ingroup group_hsservicemodel group_service_api_candidates
- * The base class for service interfaces
- *
- * @lib
- * @since S60 ?S60_version
- */
-class IHsServiceBase
- {
-
-public:
- /**
- * Default virtual destructor.
- */
- virtual ~IHsServiceBase() {}
-
- /**
- * Interface getter with casting.
- *
- * @since S60 ?S60_version
- * @param aBase HsService base object.
- * @return The queried interface, or NULL if the interface is not
- * supported or available.
- */
- template <class T>
- static T* MakeInterface(IHsServiceBase* aBase)
- {
- return (aBase? static_cast<T*>(aBase->resolveService(T::type())): 0);
- }
-
-
- /**
- * Interface getter.
- * Derived classes should always call the base class method
- * from the overridden MakeInterface.
- *
- * @since S60 ?S60_version
- * @param aType The type id of the queried interface.
- * @return The queried interface, or NULL if the interface is not
- * supported or available.
- */
- virtual IHsServiceBase* resolveService( const HsServiceInterfaceId &aType ) = 0;
-
-
- };
-
-#endif
--- a/homescreensrv_plat/servicemodel_api/servicefinder.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +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: HsService Finder
-*
-*/
-
-
-#ifndef SERVICEFINDER_H
-#define SERVICEFINDER_H
-
-#include <QObject>
-#include "serviceinterfaceid.h"
-#include "hsiserviceprovider.h"
-#include "servicemodel_global.h"
-
-class IHsServiceBase;
-class HsServiceFinderPrivate;
-class HsService;
-
-/**
- * @ingroup group_hsservicemodel group_service_api_candidates
- * @brief Helper class to search and create services.
- * HsService adapter is the component to find different platform service implementations
- * and offer interface to use services.
- */
-class HSSERVICEMODEL_EXPORT HsServiceFinder : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * Constructor.
- * @since S60 ?S60_version.
- * @param aPluginManifestDirectory Directory that contains plugin manifests.
- * @param aPluginDirectory Directory that contains plugin binaries.
- * @param aParent Parent object.
- */
- HsServiceFinder(const QString& aPluginManifestDirectory,
- const QString& aPluginDirectory,
- QObject* aParent = 0);
-
-
- /**
- * Destructor
- */
- virtual ~HsServiceFinder();
-
-public:
-
- /**
- * Get list of all services in the device implemented according the service architecture.
- * @return list of services (empty list if no services in the device).
- */
- QList<HsServiceToken> getServiceList();
-
- /**
- * Get list of all services in the device implemented according the service architecture.
- * @param aService for example 'BackupService'
- * @return list of matched services (empty list if no services in the device).
- * @code
- * if (!mServiceFinder)
- * {
- * mServiceFinder = new HsServiceFinder("c:/hsplugins","c:/hsplugins",this);
- * }
- * IBackupService* service = 0;
- * QList<HsServiceToken> serviceList = mServiceFinder->getServiceList(IBackupService::type().mImplementationId );
- * if ( serviceList.count() )
- * {
- * // use first found service
- * service = mServiceFinder->getService<IBackupService>(IBackupService::type(), serviceList.at(0));
- * }
- *
- * @endcode
- */
- QList<HsServiceToken> getServiceList(const QString &aService);
-
- /**
- * Get service. This method returns the service as a QObject.
- * @param aService for example 'HsService.Messaging'
- * @param aInterface for example 'IMessaging'
- * @return pointer to HsService object. Ownership is NOT transferred to caller.
- * @see releaseService
- * @code
- * if (!mServiceFinder)
- * {
- * mServiceFinder = new HsServiceFinder("c:/hsplugins","c:/hsplugins",this);
- * }
- * HsService* servicePtr = mServiceFinder->getService("HsService.Messaging", "IMessaging");
- * @endcode
- */
- HsService *getService(const QString &aService, const QString &aInterface);
-
- /**
- * Get service. This method returns the service as an abstract interface.
- * @param aInterfaceId service interface identifier
- * @param aPluginName which plugin implements this service, if empty, then first found interface is used.
- * @return pointer to service interface object. Ownership is NOT transferred to caller.
- *
- * Example in source code:
- * @code
- * if (!mServiceFinder)
- * {
- * mServiceFinder = new HsServiceFinder("c:/hsplugins","c:/hsplugins",this);
- * }
- * IBackupService* service = 0;
- * service = mServiceFinder->getService<IBackupService>(IBackupService::type(), "backupservice");
- * if ( service )
- * {
- * service->backupPage();
- * }
- * @endcode
- * where IBackupService is defined in header file:
- * @code
- * static const HsServiceInterfaceId Identifier=
- * {
- * 0,"persistanceservice"
- * };
- *
- * class IBackupService: public IHsServiceBase
- * {
- * public:
- * static inline const HsServiceInterfaceId& type()
- * {
- * return Identifier;
- * }
- * public:
- * virtual void backupPage() = 0;
- * virtual IHsServiceBase* resolveService(const HsServiceInterfaceId& aType) = 0;
- * ... other possible API functions
- * @endcode
- * @see more details in example backupservice implementation, IBackupService, PersistanceService...
- */
- template<class T> T *getService(const HsServiceInterfaceId &aInterfaceId, const QString &aPluginName)
- {
- return static_cast<T*>(getService(aInterfaceId, aPluginName));
- }
-
- /**
- * Get service. This method returns the service as an abstract interface.
- * @param aInterfaceId service interface identifier
- * @param aToken which plugin implements this service
- * @return pointer to service interface object. Ownership is NOT transferred to caller.
- *
- * @code
- * if (!mServiceFinder)
- * {
- * mServiceFinder = new HsServiceFinder("c:/hsplugins","c:/hsplugins",this);
- * }
- * IBackupService* service = 0;
- * QList<HsServiceToken> serviceList = mServiceFinder->getServiceList(IBackupService::type().mImplementationId);
- * if ( serviceList.count() )
- * {
- * // use first found service
- * service = mServiceFinder->getService<IBackupService>(IBackupService::type(), serviceList.at(0));
- * }
- * if ( service )
- * {
- * service->backupPage();
- * }
- * @endcode
- */
- template<class T> T *getService(const HsServiceInterfaceId &aInterfaceId, const HsServiceToken &aToken)
- {
- return static_cast<T*>(getService(aInterfaceId, aToken));
- }
-
- /**
- * Get service. This method returns the service as an Base interface of the all services.
- * @param aInterfaceId service interface identifier
- * @param aPluginName which plugin implements this service
- * @return pointer to service interface object. Ownership is NOT transferred to caller.
- */
- IHsServiceBase *getService(const HsServiceInterfaceId &aInterfaceId, const QString &aPluginName);
-
- /**
- * Get service. This method returns the service as an Base interface of the all services.
- * @param aInterfaceId service interface identifier
- * @param aToken which plugin implements this service
- * @return pointer to service interface object. Ownership is NOT transferred to caller.
- */
- IHsServiceBase *getService(const HsServiceInterfaceId &aInterfaceId, const HsServiceToken &aToken);
-
- /**
- * Release service
- * @param aService service to be released and deleted. HsService is QObject based service.
- */
- void releaseService(HsService *aService);
-
- /**
- * Cancels asynchronous service requests.
- * @param aService QObject based service.
- */
- void cancel(HsService *aService);
-
-private:
-
- /**
- * The private implementation.
- */
- HsServiceFinderPrivate *mServiceFinderPrivate;
-
-};
-
-#endif
--- a/homescreensrv_plat/servicemodel_api/serviceinterfaceid.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#ifndef SERVICEINTERFACEID_H
-#define SERVICEINTERFACEID_H
-
-#include <QString>
-
-/**
- * @ingroup group_hsservicemodel group_service_api_candidates
- * @brief Interface id
- *
- * @lib servicemodel.lib
- *
- * @since S60 ?S60_version
- *
- */
-struct HsServiceInterfaceId
-{
- /**
- * Interface id.
- */
- unsigned int mInterfaceId;
-
- /**
- * Implementation id.
- */
- QString mImplementationId;
-};
-
-#endif
--- a/homescreensrv_plat/servicemodel_api/servicemodel_api.pri Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-PLATFORM_HEADERS += \
- servicemodel_api/hsiserviceprovider.h \
- servicemodel_api/iplatformserviceadapter.h \
- servicemodel_api/service.h \
- servicemodel_api/servicebase.h \
- servicemodel_api/servicefinder.h \
- servicemodel_api/serviceinterfaceid.h \
- servicemodel_api/servicemodel_global.h
\ No newline at end of file
--- a/homescreensrv_plat/servicemodel_api/servicemodel_global.h Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +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 HSSERVICEMODEL_GLOBAL_H
-#define HSSERVICEMODEL_GLOBAL_H
-
-#include <Qt/qglobal.h>
-
-
-#ifdef HSSERVICEMODEL_LIB
- #define HSSERVICEMODEL_EXPORT Q_DECL_EXPORT
-#else
- #ifdef HSSERVICEMODEL_TEST
- #define HSSERVICEMODEL_EXPORT
- #else
- #define HSSERVICEMODEL_EXPORT Q_DECL_IMPORT
- #endif
-
-#endif
-
-
-#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/data/hsappkeyplugin.rss Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <ecom/registryinfov2.rh>
+#include "../inc/hsappkeyhandleruids.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+ {
+ resource_format_version = RESOURCE_FORMAT_VERSION_2;
+ dll_uid = KUIDAPPKEYPLUGINDLL;
+ interfaces =
+ {
+ INTERFACE_INFO
+ {
+ interface_uid = 0x10207131; // from sysapkeyhandlerplugininterface.h
+ implementations =
+ {
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = KUIDAPPKEYPLUGINIMPL1;
+ version_no = 2;
+ display_name = "AppkeyPlugin";
+ default_data = "";
+ opaque_data = "ResidentPlugin";
+ rom_only = 1;
+ }
+ };
+ }
+ };
+ }
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/group/bld.inf Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* 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:
+* Provides the information required for building the ES System App
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+// ROM files
+../rom/hsappkeyhandler.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hsappkeyhandler.iby)
+../sis/stubs/hsappkeyplugin_stub.sis /epoc32/release/winscw/udeb/z/system/install/hsappkeyplugin_stub.sis
+../sis/stubs/hsappkeyplugin_stub.sis /epoc32/data/z/system/install/hsappkeyplugin_stub.sis
+
+PRJ_MMPFILES
+hsappkeyplugin.mmp
+
+PRJ_TESTMMPFILES
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/group/hsappkeyplugin.mmp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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 <defaultcaps.hrh>
+#include <platform_paths.hrh>
+#include "../inc/hsappkeyhandleruids.hrh"
+
+TARGET hsappkeyplugin.dll
+TARGETTYPE PLUGIN
+CAPABILITY CAP_ECOM_PLUGIN
+VENDORID VID_DEFAULT
+UID 0x10009D8D KUIDAPPKEYPLUGINDLL
+
+START RESOURCE ../data/hsappkeyplugin.rss
+TARGET hsappkeyplugin.rsc
+END
+
+SOURCEPATH ../src
+SOURCE hsappkeyplugin.cpp
+SOURCE hsappkeypluginproxy.cpp
+
+USERINCLUDE ../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+
+LIBRARY ecom.lib
+LIBRARY euser.lib
+LIBRARY eikcore.lib
+LIBRARY eiksrv.lib
+LIBRARY cone.lib
+LIBRARY ws32.lib
+LIBRARY HbCore.lib
+LIBRARY apparc.lib
+LIBRARY apgrfx.lib
+DEBUGLIBRARY flogger.lib
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/hsappkeyhandler.pro Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = subdirs
+
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include \"group/bld.inf\""
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/inc/hsappkeyhandleruids.hrh Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HSAPPKEYPLUGINUIDS_HRH
+#define HSAPPKEYPLUGINUIDS_HRH
+
+#define KUIDAPPKEYPLUGINDLL 0x20026780
+#define KUIDAPPKEYPLUGINIMPL1 0x20026781
+
+#endif // HSAPPKEYPLUGINUIDS_HRH
+
+// End of File
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/inc/hsappkeyplugin.h Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Main plugin class
+ *
+*/
+
+
+#ifndef HSAPPKEYPLUGIN_H
+#define HSAPPKEYPLUGIN_H
+
+#include <sysapkeyhandlerplugininterface.h>
+#include <hb/hbcore/hbdevicedialogsymbian.h>
+
+class CEikonEnv;
+class CHbDeviceDialogSymbian;
+
+/**
+* CAppKeyPlugin
+* An implementation of the CSysapKeyHandlerPlugin definition. The plugin handles EKeyXXX events.
+* This is concrete class, instance of which
+* ECOM framework gives to ECOM clients.
+* @lib CAppKeyPlugin
+* @since Series 60 version 3.1
+*/
+class CHsAppKeyPlugin : public CSysapKeyHandlerPlugin,
+ public MHbDeviceDialogObserver
+ {
+ public: // Constructors and destructor
+ /**
+ * Two-phased constructor.
+ */
+ static CHsAppKeyPlugin* NewL();
+
+ /**
+ * Destructor.
+ */
+ virtual ~CHsAppKeyPlugin();
+ public: //MHbDeviceDialogObserver interfaces
+ void DataReceived(CHbSymbianVariantMap& aData);
+
+ void DeviceDialogClosed(TInt aCompletionCode);
+
+ public: // New functions
+ /**
+ * HandleKeyEventL
+ * @since Series 60 Series60_version 3.0
+ * @param const TKeyEvent& aKeyEvent, TEventCode aType
+ * @return TKeyResponse If key was consumed. Generally it should be, since the KEF calls the plugins only with the right key.
+ */
+ virtual TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent,
+ TEventCode aType );
+
+ /**
+ * Provides the key events that the plugin wants to listen to.
+ * Plugins should overload this method if they are of version 2 or higher.
+ * iCode, iScanCode and iModifiers MUST be defined in each TKeyEvent.
+ *
+ * @since S60 5.1
+ * @return array of key events
+ */
+ void ProvideKeyEventsL( RArray<TKeyEvent>& aKeyEventArray );
+ private: // Constructors
+ /**
+ * C++ default constructor.
+ */
+ CHsAppKeyPlugin();
+
+ /**
+ * By default Symbian 2nd phase constructor is private.
+ */
+ void ConstructL();
+
+ void HandleShortPressL();
+
+ void HandleLongPressL();
+
+ private: //data
+ /** Cached pointer to the CEikonEnv singelton instance */
+ CEikonEnv* iEikEnv;
+ TBool iSecondEvent;
+ CHbDeviceDialogSymbian* mDialog;
+ };
+
+#endif // HSAPPKEYPLUGIN_H
+
+// End of File
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/rom/hsappkeyhandler.iby Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,24 @@
+/*
+* 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:
+*
+*/
+#ifndef __HSAPPKEYPLUGIN_IBY__
+#define __HSAPPKEYPLUGIN_IBY__
+
+ECOM_PLUGIN( hsappkeyplugin.dll, hsappkeyplugin.rsc )
+// stub sis
+data=ZSYSTEM/install/hsappkeyplugin_stub.sis system/install/hsappkeyplugin_stub.sis
+
+#endif // __HSAPPKEYPLUGIN_IBY__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/sis/hsappkeyplugin.pkg Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,29 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+;Language - standard language definitions
+&EN
+
+; standard SIS file header
+#{"hsappkeyplugin"},(0x20026780),1,0,0,TYPE=SA, RU
+
+;Localized Vendor Name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+"/epoc32/release/armv5/urel/hsappkeyplugin.dll"-"!:\sys\bin\hsappkeyplugin.dll"
+"/epoc32/data/z/resource/plugins/hsappkeyplugin.rsc"-"!:\resource\plugins\hsappkeyplugin.rsc"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/sis/stubs/createstubs.bat Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,17 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+
+for %%f in (*.pkg) do makesis -s %%f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/sis/stubs/hsappkeyplugin_stub.pkg Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,37 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+; ------------------------------------------------------------------------------
+; Taskswitcher stub SIS package file.
+; Used to enable Taskswitcher to be updated from ROM with a SIS package.
+; When you add new files into this stub, please remember to update
+; SIS stub with "makesis -s" command.
+; ------------------------------------------------------------------------------
+;
+;Language - standard language definitions
+&EN
+
+; standard SIS file header
+#{"hsappkeyplugin"},(0x20026780),1,0,0,TYPE=SA
+
+;Localized Vendor Name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+""-"Z:\sys\bin\hsappkeyplugin.dll"
+""-"Z:\resource\plugins\hsappkeyplugin.rsc"
+
Binary file hsappkeyhandler/sis/stubs/hsappkeyplugin_stub.sis has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/src/hsappkeyplugin.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Main plugin class
+ *
+*/
+
+
+#include <w32std.h>
+#include <eikenv.h>
+#include <apgtask.h>
+#include <apgcli.h>
+#include <hb/hbcore/hbdevicedialogsymbian.h>
+#include <hb/hbcore/hbsymbianvariant.h>
+#include "hsappkeyplugin.h"
+
+const TUid KHSAppUid = { 0x20022F35 };
+_LIT(KTsPluginName, "com.nokia.taskswitcher.tsdevicedialogplugin/1.0");
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CHsAppKeyPlugin::CHsAppKeyPlugin()
+: iEikEnv( CEikonEnv::Static() )
+{
+}
+
+// ---------------------------------------------------------------------------
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CHsAppKeyPlugin* CHsAppKeyPlugin::NewL()
+{
+ CHsAppKeyPlugin* self = new (ELeave) CHsAppKeyPlugin;
+ self->iEikEnv->RootWin().CaptureLongKey(EKeyApplication0,
+ EKeyApplication0,
+ 0,
+ 0,
+ 0,
+ ELongCaptureWaitShort);
+ return self;
+}
+
+// ---------------------------------------------------------------------------
+// C++ Destructor
+// ---------------------------------------------------------------------------
+//
+CHsAppKeyPlugin::~CHsAppKeyPlugin()
+{
+ delete mDialog;
+}
+
+// ---------------------------------------------------------------------------
+// From MHbDeviceDialogObserver
+//
+// ---------------------------------------------------------------------------
+//
+void CHsAppKeyPlugin::DataReceived(CHbSymbianVariantMap& /*aData*/)
+{
+ //no implementation required
+}
+
+// ---------------------------------------------------------------------------
+// From MHbDeviceDialogObserver
+//
+// ---------------------------------------------------------------------------
+//
+void CHsAppKeyPlugin::DeviceDialogClosed(TInt /*aCompletionCode*/)
+{
+ delete mDialog;
+ mDialog = 0;
+}
+
+// ---------------------------------------------------------------------------
+// From CSysapKeyHandlerPlugin
+//
+// ---------------------------------------------------------------------------
+//
+TKeyResponse CHsAppKeyPlugin::HandleKeyEventL( const TKeyEvent& aKeyEvent ,
+ TEventCode /*aType*/
+ )
+{
+ TKeyResponse retVal(EKeyWasNotConsumed);
+ if (aKeyEvent.iCode == EKeyApplication0) {
+ if (iSecondEvent) {
+ if (aKeyEvent.iRepeats > 0)
+ HandleLongPressL();
+ else
+ HandleShortPressL();
+ retVal = EKeyWasConsumed;
+ }
+ iSecondEvent =!iSecondEvent;
+ }
+ return retVal;
+}
+
+// ---------------------------------------------------------------------------
+// From CSysapKeyHandlerPlugin
+//
+// ---------------------------------------------------------------------------
+//
+void CHsAppKeyPlugin::ProvideKeyEventsL(RArray<TKeyEvent>& aKeyEventArray)
+{
+ TKeyEvent key;
+ key.iCode = EKeyApplication0;
+ key.iScanCode = EStdKeyApplication0;
+ key.iModifiers = 0;
+ aKeyEventArray.Append(key);
+}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CHsAppKeyPlugin::HandleShortPressL()
+{
+ RWsSession& ws = iEikEnv->WsSession();
+ TApaTaskList appList(ws);
+ TApaTask task = appList.FindApp(KHSAppUid);
+
+ if (task.Exists()) {
+ task.BringToForeground();
+ } else {
+ RApaLsSession apaLsSession;
+ User::LeaveIfError(apaLsSession.Connect());
+ CleanupClosePushL(apaLsSession);
+
+ TApaAppInfo appInfo;
+ apaLsSession.GetAppInfo(appInfo, KHSAppUid );
+
+ CApaCommandLine *cmdLine = CApaCommandLine::NewLC();
+ cmdLine->SetExecutableNameL(appInfo.iFullName);
+ User::LeaveIfError( apaLsSession.StartApp(*cmdLine));
+
+ CleanupStack::PopAndDestroy(cmdLine);
+ CleanupStack::PopAndDestroy(&apaLsSession);
+ }
+ delete mDialog;
+ mDialog =0;
+}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CHsAppKeyPlugin::HandleLongPressL()
+{
+ if( !mDialog ) {
+ mDialog = CHbDeviceDialogSymbian ::NewL();
+
+ CHbSymbianVariantMap* params = CHbSymbianVariantMap::NewL();
+
+ if(KErrNone != mDialog->Show(KTsPluginName,*params,this)) {
+ delete mDialog;
+ }
+ delete params;
+ }
+}
+// End of File
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hsappkeyhandler/src/hsappkeypluginproxy.cpp Mon May 03 12:48:45 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 implementation table
+ *
+*/
+
+#include <e32base.h>
+#include <e32std.h>
+#include <ecom/ecom.h>
+#include <ecom/implementationproxy.h>
+#include "hsappkeyhandleruids.hrh"
+#include "hsappkeyplugin.h"
+
+const TImplementationProxy AppkeyPluginImplementationTable[] =
+ {
+ IMPLEMENTATION_PROXY_ENTRY(KUIDAPPKEYPLUGINIMPL1, CHsAppKeyPlugin::NewL)
+ };
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+ {
+ aTableCount = sizeof(AppkeyPluginImplementationTable) / sizeof(TImplementationProxy);
+
+ return AppkeyPluginImplementationTable;
+ }
--- a/layers.sysdef.xml Fri Apr 16 15:16:09 2010 +0300
+++ b/layers.sysdef.xml Mon May 03 12:48:45 2010 +0300
@@ -6,6 +6,12 @@
<SystemDefinition name="homescreensrv" schema="1.5.1">
<systemModel>
+ <layer name="tools_layer">
+ <module name="homescreensrvconf">
+ <unit name="homescreensrvconf" unitID="hs.homescreensrvconf" mrp="" bldFile="&layer_real_source_path;/group"/>
+ </module>
+ </layer>
+
<layer name="mw_layer">
<module name="homescreensrv">
<unit unitID="hs.homescreensrv" mrp="" bldFile="&layer_real_source_path;" name="homescreensrv" proFile="homescreensrv.pro" qmakeArgs="-r"/>
--- a/rom/homescreensrv_core.iby Fri Apr 16 15:16:09 2010 +0300
+++ b/rom/homescreensrv_core.iby Mon May 03 12:48:45 2010 +0300
@@ -22,12 +22,22 @@
////////////////////////////////////////
// ---- contentstorage --------------------------------------------
+file=ABI_DIR\BUILD_DIR\caapphandlerplugin.dll SHARED_LIB_DIR\caapphandlerplugin.dll
+data=\epoc32\data\z\hsresources\plugins\commandhandler\caapphandlerplugin.qtplugin hsresources\plugins\commandhandler\caapphandlerplugin.qtplugin
+data=\epoc32\data\z\hsresources\plugins\commandhandler\caapphandlerplugin.xml hsresources\plugins\commandhandler\caapphandlerplugin.xml
+
+file=ABI_DIR\BUILD_DIR\catapphandlerplugin.dll SHARED_LIB_DIR\catapphandlerplugin.dll
+data=\epoc32\data\z\hsresources\plugins\commandhandler\catapphandlerplugin.qtplugin hsresources\plugins\commandhandler\catapphandlerplugin.qtplugin
+data=\epoc32\data\z\hsresources\plugins\commandhandler\catapphandlerplugin.xml hsresources\plugins\commandhandler\catapphandlerplugin.xml
+
+file=ABI_DIR\BUILD_DIR\caurlhandlerplugin.dll SHARED_LIB_DIR\caurlhandlerplugin.dll
+data=\epoc32\data\z\hsresources\plugins\commandhandler\caurlhandlerplugin.qtplugin hsresources\plugins\commandhandler\caurlhandlerplugin.qtplugin
+data=\epoc32\data\z\hsresources\plugins\commandhandler\caurlhandlerplugin.xml hsresources\plugins\commandhandler\caurlhandlerplugin.xml
file=ABI_DIR\BUILD_DIR\caclient.dll SHARED_LIB_DIR\caclient.dll
file=ABI_DIR\BUILD_DIR\cautils.dll SHARED_LIB_DIR\cautils.dll
file=ABI_DIR\BUILD_DIR\camenu.dll SHARED_LIB_DIR\camenu.dll
file=ABI_DIR\BUILD_DIR\camenuserver.exe PROGRAMS_DIR\camenuserver.exe
-file=ABI_DIR\BUILD_DIR\caextendedmenu.dll SHARED_LIB_DIR\caextendedmenu.dll
file=ABI_DIR\BUILD_DIR\casathandler.dll SHARED_LIB_DIR\casathandler.dll
file=ABI_DIR\BUILD_DIR\castorage.dll SHARED_LIB_DIR\castorage.dll
file=ABI_DIR\BUILD_DIR\MenuInterface.dll SHARED_LIB_DIR\MenuInterface.dll
@@ -37,14 +47,12 @@
ECOM_PLUGIN( cawidgetscanner.dll, cawidgetscanner.rsc )
ECOM_PLUGIN( calocalizerscanner.dll, calocalizerscanner.rsc )
ECOM_PLUGIN( carunningappmonitor.dll, carunningappmonitor.rsc )
+ECOM_PLUGIN( causifscanner.dll, causifscanner.rsc )
data=ZPRIVATE\20022F90\castorage.db private\20022F90\castorage.db
// ---- appfoundation --------------------------------------------
-// -------- servicemodel
-file=ABI_DIR\BUILD_DIR\hsservicemodel.dll SHARED_LIB_DIR\hsservicemodel.dll
-
// -------- statemodel
file=ABI_DIR\BUILD_DIR\statemodel.dll SHARED_LIB_DIR\statemodel.dll
@@ -57,9 +65,6 @@
// ---- screensavermodel --------------------------------------------
file=ABI_DIR\BUILD_DIR\screensavermodel.dll SHARED_LIB_DIR\screensavermodel.dll
-// ---- bagetmodel --------------------------------------------
-file=ABI_DIR\BUILD_DIR\bagetmodel.dll SHARED_LIB_DIR\bagetmodel.dll
-
// ---- homescreen_information_api --------------------------------------------
data=\epoc32\data\c\resource\qt\crml\homescreeninformation.qcrml resource\qt\crml\homescreeninformation.qcrml
#endif // __HOMESCREENSRV_CORE_IBY__
--- a/sis/homescreensrv.pkg Fri Apr 16 15:16:09 2010 +0300
+++ b/sis/homescreensrv.pkg Mon May 03 12:48:45 2010 +0300
@@ -130,6 +130,8 @@
"/epoc32/data/z/resource/plugins/cawidgetscanner.rsc"-"c:/resource/plugins/cawidgetscanner.rsc"
"/epoc32/release/armv5/urel/calocalizerscanner.dll" - "c:/sys/bin/calocalizerscanner.dll"
"/epoc32/data/z/resource/plugins/calocalizerscanner.rsc"-"c:/resource/plugins/calocalizerscanner.rsc"
+"/epoc32/release/armv5/urel/causifscanner.dll" - "c:/sys/bin/causifscanner.dll"
+"/epoc32/data/z/resource/plugins/causifscanner.rsc"-"c:/resource/plugins/causifscanner.rsc"
"/epoc32/release/armv5/urel/camenuserver.exe" - "c:/sys/bin/camenuserver.exe"
@@ -142,9 +144,6 @@
; ---- appfoundation --------------------------------------------
-; -------- servicemodel
-"/epoc32/release/armv5/urel/hsservicemodel.dll" - "c:/sys/bin/hsservicemodel.dll"
-
; -------- statemodel
"/epoc32/release/armv5/urel/statemodel.dll" - "c:/sys/bin/statemodel.dll"
@@ -156,6 +155,3 @@
; ---- screensavermodel --------------------------------------------
"/epoc32/release/armv5/urel/screensavermodel.dll" - "c:/sys/bin/screensavermodel.dll"
-
-; ---- bagetmodel --------------------------------------------
-"/epoc32/release/armv5/urel/bagetmodel.dll" - "c:/sys/bin/bagetmodel.dll"
--- a/sis/homescreensrv_ut_hs.pkg Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-
-; Language
-&EN
-
-; SIS heade name, uid, version
-#{"hssrv ut hs"},(0x20022F67),1,0,0
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Supports S60 5th Edition
-[0x1028315F], 0, 0, 0, {"S60ProductID"}
-
-;--------------- appfoundation ---------------
-
-;servicemodel:
-"/epoc32/release/armv5/urel/t_hsservicemodelexe.exe" - "c:/sys/bin/t_hsservicemodelexe.exe"
-"/epoc32/data/z/private/10003a3f/import/apps/t_hsservicemodelexe_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsservicemodelexe_reg.rsc"
-"/epoc32/data/z/resource/apps/t_hsservicemodelexe.rsc" - "c:/resource/apps/t_hsservicemodelexe.rsc"
-"/epoc32/release/armv5/urel/testserviceprovider.dll" - "c:/sys/bin/testserviceprovider.dll"
-"/epoc32/data/z/hsresources/testresources/hsresources/plugins/serviceproviders/testserviceprovider.qtplugin" - "c:/hsresources/testresources/hsresources/plugins/serviceproviders/testserviceprovider.qtplugin"
-"/epoc32/data/z/hsresources/testresources/hsresources/plugins/serviceproviders/test1serviceprovider.manifest" - "c:/hsresources/testresources/hsresources/plugins/serviceproviders/test1serviceprovider.manifest"
-"/epoc32/data/z/hsresources/testresources/hsresources/plugins/serviceproviders/test2serviceprovider.manifest" - "c:/hsresources/testresources/hsresources/plugins/serviceproviders/test2serviceprovider.manifest"
-"../appfoundation/servicemodel/tsrc/t_hsservicemodelexe/invalidservice.manifest" - "c:/hsresources/testresources/invalidservice.manifest"
-"../appfoundation/servicemodel/tsrc/t_hsservicemodelexe/notwellformedservice.manifest" - "c:/hsresources/testresources/notwellformedservice.manifest"
-"../appfoundation/servicemodel/tsrc/t_hsservicemodelexe/validservice.manifest" - "c:/hsresources/testresources/validservice.manifest"
-"../appfoundation/servicemodel/tsrc/t_hsservicemodelexe/validservice2.manifest" - "c:/hsresources/testresources/validservice2.manifest"
-
-;statemodel:
-"/epoc32/release/armv5/urel/t_hsstatemodelexe.exe" - "c:/sys/bin/t_hsstatemodelexe.exe"
-"/epoc32/data/z/private/10003a3f/import/apps/t_hsstatemodelexe_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsstatemodelexe_reg.rsc"
-"/epoc32/data/z/resource/apps/t_hsstatemodelexe.rsc" - "c:/resource/apps/t_hsstatemodelexe.rsc"
-"/epoc32/release/armv5/urel/teststateprovider.dll" - "c:/sys/bin/teststateprovider.dll"
-"/epoc32/data/z/hsresources/testresources/plugins/stateproviders/teststateprovider.qtplugin" - "c:/hsresources/testresources/plugins/stateproviders/teststateprovider.qtplugin"
-"/epoc32/data/z/hsresources/testresources/plugins/stateproviders/teststateprovider.manifest" - "c:/hsresources/testresources/plugins/stateproviders/teststateprovider.manifest"
-"../appfoundation/statemodel/tsrc/t_hsstatemodelexe/invalidstate.manifest" - "c:/hsresources/testresources/invalidstate.manifest"
-"../appfoundation/statemodel/tsrc/t_hsstatemodelexe/notwellformedstate.manifest" - "c:/hsresources/testresources/notwellformedstate.manifest"
-"../appfoundation/statemodel/tsrc/t_hsstatemodelexe/validstate2.manifest" - "c:/hsresources/testresources/validstate2.manifest"
-"../appfoundation/statemodel/tsrc/t_hsstatemodelexe/validstate.manifest" - "c:/hsresources/testresources/validstate.manifest"
-
-;appruntimemodel:
-"/epoc32/release/armv5/urel/t_hsruntimemodelexe.exe" - "c:/sys/bin/t_hsruntimemodelexe.exe"
-"/epoc32/data/z/private/10003a3f/import/apps/t_hsruntimemodelexe_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsruntimemodelexe_reg.rsc"
-"/epoc32/data/z/resource/apps/t_hsruntimemodelexe.rsc" - "c:/resource/apps/t_hsruntimemodelexe.rsc"
-"/epoc32/release/armv5/urel/testruntimeprovider.dll" - "c:/sys/bin/testruntimeprovider.dll"
-"/epoc32/data/z/hsresources/testresources/plugins/runtimeproviders/testruntimeprovider.qtplugin" - "c:/hsresources/testresources/plugins/runtimeproviders/testruntimeprovider.qtplugin"
-"/epoc32/data/z/hsresources/testresources/plugins/runtimeproviders/testruntimeprovider.manifest" - "c:/hsresources/testresources/plugins/runtimeproviders/testruntimeprovider.manifest"
-"../appfoundation/appruntimemodel/tsrc/t_hsruntimemodelexe/invalidruntime.manifest" - "c:/hsresources/testresources/invalidruntime.manifest"
-"../appfoundation/appruntimemodel/tsrc/t_hsruntimemodelexe/notwellformedruntime.manifest" - "c:/hsresources/testresources/notwellformedruntime.manifest"
-"../appfoundation/appruntimemodel/tsrc/t_hsruntimemodelexe/validruntime2.manifest" - "c:/hsresources/testresources/validruntime2.manifest"
-"../appfoundation/appruntimemodel/tsrc/t_hsruntimemodelexe/validruntime.manifest" - "c:/hsresources/testresources/validruntime.manifest"
-
-;--------------- hswidgetmodel ---------------
-
-"/epoc32/release/armv5/urel/t_hswidgetmodelexe.exe" - "c:/sys/bin/t_hswidgetmodelexe.exe"
-"/epoc32/data/z/private/10003a3f/import/apps/t_hswidgetmodelexe_reg.rsc" - "c:/private/10003a3f/import/apps/t_hswidgetmodelexe_reg.rsc"
-"/epoc32/data/z/resource/apps/t_hswidgetmodelexe.rsc" - "c:/resource/apps/t_hswidgetmodelexe.rsc"
-"/epoc32/release/armv5/urel/testwidgetprovider.dll" - "c:/sys/bin/testwidgetprovider.dll"
-"/epoc32/data/z/hsresources/testresources/plugins/widgetproviders/testwidgetprovider.qtplugin" - "c:/hsresources/testresources/plugins/widgetproviders/testwidgetprovider.qtplugin"
-"/epoc32/data/z/hsresources/testresources/plugins/widgetproviders/testwidgetprovider.manifest" - "c:/hsresources/testresources/plugins/widgetproviders/testwidgetprovider.manifest"
-"../hswidgetmodel/tsrc/t_hswidgetmodelexe/invalidwidget.manifest" - "c:/hsresources/testresources/invalidwidget.manifest"
-"../hswidgetmodel/tsrc/t_hswidgetmodelexe/notwellformedwidget.manifest" - "c:/hsresources/testresources/notwellformedwidget.manifest"
-"../hswidgetmodel/tsrc/t_hswidgetmodelexe/validwidget2.manifest" - "c:/hsresources/testresources/validwidget2.manifest"
-"../hswidgetmodel/tsrc/t_hswidgetmodelexe/validwidget.manifest" - "c:/hsresources/testresources/validwidget.manifest"
--- a/sis/homescreensrv_ut_hs_sisx.bat Fri Apr 16 15:16:09 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-@rem
-@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-@rem All rights reserved.
-@rem This component and the accompanying materials are made available
-@rem under the terms of "Eclipse Public License v1.0"
-@rem which accompanies this distribution, and is available
-@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-@rem
-@rem Initial Contributors:
-@rem Nokia Corporation - initial contribution.
-@rem
-@rem Contributors:
-@rem
-@rem Description:
-@rem
-@echo off
-
-if exist homescreensrv_ut_hs.sisx del homescreensrv_ut_hs.sisx
-
-makesis homescreensrv_ut_hs.pkg
-signsis homescreensrv_ut_hs.sis homescreensrv_ut_hs.sisx rd.cer rd-key.pem
-
-if exist homescreensrv_ut_hs.sisx (
-echo homescreensrv_ut_hs.sisx creation SUCCEEDED
-del homescreensrv_ut_hs.sis
-)
-
-if not exist homescreensrv_ut_hs.sisx (
-echo homescreensrv_ut_hs.sisx creation FAILED
-)
\ No newline at end of file