--- a/contentpublishingsrv/contentpublishingserver/cpserver/group/cpserver.mmp Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/group/cpserver.mmp Wed Mar 31 22:04:35 2010 +0300
@@ -32,6 +32,7 @@
SOURCE cpnotificationhandler.cpp
SOURCE cpserverburlistener.cpp
SOURCE cpactionhandlerthread.cpp
+SOURCE cpactiondatacache.cpp
USERINCLUDE ../inc
USERINCLUDE ../../cpsqlitestorage/inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpactiondatacache.h Wed Mar 31 22:04:35 2010 +0300
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Class used by session to handle asynchronous requests
+ *
+*/
+
+
+#ifndef C_CPACTIONDATACACHE_H
+#define C_CPACTIONDATACACHE_H
+
+#include <e32base.h>
+#include <e32hashtab.h>
+
+class CLiwDefaultList;
+
+/**
+ * Action Data Cache holds a list containing data needed to
+ * lauch an action fetched from SQL database
+ * @since S60 v5.0
+ */
+class CCPActionDataCache:public CBase
+ {
+public:
+
+ /**
+ * Creates new instance of CCPActionDataCache.
+ *
+ * @return new instance of CCPActionDataCache
+ */
+ static CCPActionDataCache* NewL( );
+
+ /**
+ * Creates new instance of CCPActionDataCache.
+ *
+ * @return new instance of CCPActionDataCache
+ */
+ static CCPActionDataCache* NewLC( );
+
+ /**
+ * Destructor.
+ */
+ virtual ~CCPActionDataCache();
+
+ /**
+ * Removes an item from the cache
+ *
+ * @param aMap a map containing item identifiers
+ */
+ void HandleCacheRemoveL( const CLiwMap* aMap );
+
+ /**
+ * Appends an item to the cache
+ *
+ * @param aParamList a list to be added to the cache
+ */
+ void AppendL( const CLiwGenericParamList* aParamList);
+
+ /**
+ * Checks if it is possible to cache the item.
+ * Only items that are specified, which means that id or
+ * all parameters ( publisher, content_type, content_id ) are provided
+ *
+ * @param aMap a map containing item identifiers
+ * @return ETrue if it is possible to cache an item, EFalse if not
+ */
+ TBool IsCacheableL( const CLiwMap* aMap );
+
+ /**
+ * Checks if it item exists in the cache.
+ *
+ * @param aMap a map containing item identifiers
+ * @return ETrue if the item exists in the cache, EFalse if not
+ */
+ TBool ExistL( const CLiwMap* aMap );
+
+ /**
+ * Gets an item from the cache
+ *
+ * @param aMap a map containing item identifiers
+ * @return aParamList item returned from the cache
+ */
+ void GetL( const CLiwMap* aMap,
+ CLiwGenericParamList* aParamList );
+
+private:
+
+ /*
+ * Constructor
+ */
+ CCPActionDataCache();
+
+ /**
+ * 2nd phase constructor.
+ */
+ void ConstructL( );
+
+ /**
+ * Checks if two items match
+ *
+ * @param aCachedMap a map from the cache containing item identifiers
+ * @param aInputMap an input map containing item identifiers
+ * @return ETrue if items match , EFalse if not
+ */
+ TBool MatchL(const CLiwMap* aCachedMap, const CLiwMap* aInputMap);
+
+ /**
+ * Checks if two strings contained in both maps match
+ *
+ * @param aLeft first map
+ * @param aRight second map
+ * @param aKey key
+ * @return ETrue if items match , EFalse if not
+ */
+ TBool MatchL(const CLiwMap* aLeft,
+ const CLiwMap* aRight, const TDesC8& aKey );
+
+ /**
+ * Checks if a string contained in map is specified
+ * (it has value different than "all")
+ *
+ * @param aMap map
+ * @param aKey key
+ * @return ETrue if item is specified , EFalse if not
+ */
+ TBool IsSpecifiedL(const CLiwMap* aMap,
+ const TDesC8& aKey );
+
+ /**
+ * Finds the item in the cache
+ *
+ * @param aKey map containing identifiers
+ * @return id of the item in a cache, KErrNotFound if does not
+ * exist in the cache
+ */
+ TInt FindL( const CLiwMap* aKey );
+
+ /**
+ * Copies variant from one map to another
+ *
+ * @param aKey key
+ * @param aInMap input map
+ * @param aOutMap output map
+ */
+ void CopyVariantL(const TDesC8& aKey,
+ const CLiwMap* aInMap, CLiwDefaultMap* aOutMap );
+
+private:
+
+ /*
+ * Internal list. Own
+ */
+ CLiwDefaultList* iInternalList;
+ };
+
+#endif // C_CPACTIONDATACACHE_H
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpglobals.h Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpglobals.h Wed Mar 31 22:04:35 2010 +0300
@@ -59,6 +59,8 @@
_LIT8( KDelete, "Delete" );
_LIT8( KRequestNotification, "RequestNotification" );
_LIT8( KExecuteAction, "ExecuteAction" );
+_LIT8( KExecuteMultipleActions, "ExecuteMultipleActions" );
+
_LIT8( KCmdCancel, "Cancel" );
_LIT8( KActivate, "Activate" );
_LIT8( KActivateTrigger, "activate" );
@@ -69,6 +71,7 @@
_LIT8( KAction, "action" );
_LIT8( KItem, "item" );
_LIT8( KFilter, "filter" );
+_LIT8( KFilters, "filters" );
_LIT8( KData, "data" );
_LIT8( KSortOrder, "sort_order" );
_LIT8( KItemId, "item_id" );
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserver.h Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserver.h Wed Mar 31 22:04:35 2010 +0300
@@ -110,7 +110,7 @@
/**
* Returns notifications array
*/
- RPointerArray<CLiwDefaultList>& CCPServer::GetNotifications( );
+ RPointerArray<CLiwDefaultList>& GetNotifications( );
private:
// From CActive
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdatamanager.h Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdatamanager.h Wed Mar 31 22:04:35 2010 +0300
@@ -21,6 +21,7 @@
#include <e32base.h>
#include "cpstorage.h"
+#include "cpactiondatacache.h"
// FORWARD DECLARATIONS
#ifdef CONTENT_PUBLISHER_DEBUG
@@ -84,12 +85,14 @@
/**
* Fetches action from database
* @param aInParamList filter and sorting criteria
+ * @param aEnableCache flag indicating if action data should be cached
* @param aOutParamList results
* @param aNotificationList change info list (for notifications)
* @return KErrNotFound if data was not found
*/
- TInt GetActionL( const CCPLiwMap& aMa,
- CLiwGenericParamList& aOutParamList,
+ TInt GetActionsL( const CCPLiwMap& aMap,
+ TBool aEnableCache,
+ CLiwGenericParamList& aOutParamList,
CLiwDefaultList* aNotificationList = NULL );
/**
@@ -183,7 +186,7 @@
void FillActionParamListL(
CLiwGenericParamList & aOutParamList,
const TLiwGenericParam* aParam,
- RBuf8 & aActionTrigger);
+ const CLiwDefaultList* aActionTriggers);
/**
* Creates map for GetList request - publisher, content_type
@@ -211,6 +214,7 @@
*/
void BuildChangeInfoL(
const CCPLiwMap* aMap,
+ const CLiwDefaultList* aActionTriggers,
const TLiwGenericParam* aParam,
CLiwDefaultList* aChangeInfoList );
/**
@@ -221,6 +225,7 @@
*/
void BuildDefaultChangeInfoL(
const CCPLiwMap* aMap,
+ const CLiwDefaultList* aActionTriggers,
CLiwDefaultList* aChangeInfoList );
/**
* Builds change info list when query to database returned nothing
@@ -250,6 +255,13 @@
void CopyActionTrigger16L( const CLiwMap* aInMap,
CLiwDefaultMap* aOutMap );
+ /**
+ * Converts variant type from TDesC8 to TDesC
+ * @param aVariant variant to convert
+ */
+ void CopyActionTrigger16L( const TLiwVariant& aVariant,
+ CLiwDefaultMap* aOutMap );
+
private:
// data
@@ -265,6 +277,13 @@
*/
RPointerArray<CCPNotificationHandler> iNotificationsArray;
+ /*
+ * Action data cache
+ * Own.
+ */
+ CCPActionDataCache* iActionDataCache;
+
+
#ifdef CONTENT_PUBLISHER_DEBUG
CCPDebug* iDebug;
#endif
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdef.h Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdef.h Wed Mar 31 22:04:35 2010 +0300
@@ -39,6 +39,7 @@
ECpServerAddObserver = 23,
ECpServerRemoveObserver = 24,
ECpServerExecuteAction = 30,
+ ECpServerExecuteMultipleActions = 31,
ECpServerInternal = 100
};
--- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserversession.h Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserversession.h Wed Mar 31 22:04:35 2010 +0300
@@ -1,20 +1,19 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Server Session
+ * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
-*/
-
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Server Session
+ *
+ */
#ifndef C_CCPSERVERSESSION_H
#define C_CCPSERVERSESSION_H
@@ -51,12 +50,12 @@
/**
* Two-phased constructor.
*/
- static CCPServerSession* NewL( TPointersForSession& aPasser );
+ static CCPServerSession* NewL(TPointersForSession& aPasser);
/**
* Two-phased constructor.
*/
- static CCPServerSession* NewLC( TPointersForSession& aPasser );
+ static CCPServerSession* NewLC(TPointersForSession& aPasser);
/**
* Destroy the object and release all memory objects
@@ -71,14 +70,14 @@
* @param aMessage message from client (containing requested operation
* and any data)
*/
- void ServiceL( const RMessage2& aMessage );
+ void ServiceL(const RMessage2& aMessage);
/**
* Selects correct function from message
* @param aMessage message from client (containing requested operation
* and any data)
*/
- void DispatchMessageL( const RMessage2& aMessage, TBool& aPanicedClient );
+ void DispatchMessageL(const RMessage2& aMessage, TBool& aPanicedClient);
private:
// New methods
@@ -91,69 +90,84 @@
/**
* Perform the second phase construction of a CCPServerSession object
*/
- void ConstructL( TPointersForSession& aPasser );
+ void ConstructL(TPointersForSession& aPasser);
/**
* Add Data request
* @param Message from client
*/
- void AddDataL( const RMessage2& aMessage );
+ void AddDataL(const RMessage2& aMessage);
/**
* Specific add data request - data is not actually added to database
* but notification is send.
* @param Message from client
*/
- void AddDataNonPersistentL( const RMessage2& aMessage );
+ void AddDataNonPersistentL(const RMessage2& aMessage);
/**
* Get data request - first phase
* @param Message from client
*/
- void GetListSizeL( const RMessage2& aMessage );
+ void GetListSizeL(const RMessage2& aMessage);
/**
* Get data request - second phase
* @param Message from client
*/
- void GetListDataL( const RMessage2& aMessage );
+ void GetListDataL(const RMessage2& aMessage);
/**
* Remove data request
* @param Message from client
*/
- void RemoveDataL( const RMessage2& aMessage );
+ void RemoveDataL(const RMessage2& aMessage);
/**
* Executes action request
* @param Message from client
*/
- void ExecuteActionL( const RMessage2& aMessage );
+ void ExecuteActionL(const RMessage2& aMessage);
+
+ /**
+ * Executes actions and sends notifications
+ * @param aMap input map from client
+ * @param aEnableCache indicates if action data should be cached
+ * @param aOptions command options
+ */
+ void ExecuteActionL(const CCPLiwMap* aMap,
+ TBool aEnableCache, TUint aOptions);
+
+ /**
+ * Executes multiple actions request
+ * @param Message from client
+ */
+ void ExecuteMultipleActionsL(const RMessage2& aMessage);
/**
* Executes action request
* @param aActionParams list with actions
*/
- void ExecuteL( const CLiwGenericParamList& aActionParams );
+ void ExecuteL(const CLiwGenericParamList& aActionParams);
/**
* Register for notification request
* @param Message from client
*/
- void RegisterObserverL( const RMessage2& aMessage );
+ void RegisterObserverL(const RMessage2& aMessage);
/**
* Adds new observer
* @param Message from client
*/
- void AddObserverL( const RMessage2& aMessage );
+ void AddObserverL(const RMessage2& aMessage);
/**
* Removes observer
* @param Message from client
*/
- void RemoveObserverL( const RMessage2& aMessage );
-
+ void RemoveObserverL(const RMessage2& aMessage);
+
/**
* Unregister from notification request
* @param Message from client
@@ -164,7 +178,7 @@
* Send information about change in database to client
* @param Message from client
*/
- void GetChangeInfoDataL( const RMessage2& aMessage );
+ void GetChangeInfoDataL(const RMessage2& aMessage);
/**
* Converts CLiwGenericParamList to descriptor and
@@ -172,22 +186,22 @@
* @param Message to complete
* @param Parameters for message
*/
- void ExternalizeAndWriteToClientL( const RMessage2& aMessage,
- const CLiwGenericParamList* outParamList );
-
- /**
- * Unpacks message from client to map
- * @param Message to complete
- * @return CCPLiwMap with data from client
- */
- CCPLiwMap* UnpackFromClientLC( const RMessage2& aMessage );
+ void ExternalizeAndWriteToClientL(const RMessage2& aMessage,
+ const CLiwGenericParamList* outParamList);
- /**
- * Send notification
- * @param aNotificationList
- */
- void SendNotificationL( CCPLiwMap* aMap,
- CLiwDefaultList* aNotificationList );
+ /**
+ * Unpacks message from client to map
+ * @param Message to complete
+ * @return CCPLiwMap with data from client
+ */
+ CCPLiwMap* UnpackFromClientLC(const RMessage2& aMessage);
+
+ /**
+ * Send notification
+ * @param aNotificationList
+ */
+ void SendNotificationL(CCPLiwMap* aMap,
+ CLiwDefaultList* aNotificationList);
/**
* Get and Execute Activate or Deactivate action from the DB
@@ -195,14 +209,29 @@
*/
void GetAndExecuteActionL( CCPLiwMap* aMap, CLiwDefaultList* aNotificationList,
TBool aInsertTrigger = EFalse );
-
+
/**
* Get Server Lock
* @return ETrue if aMessege cannot be processed
* because Backup or Restore is running
**/
- TBool GetServerLock( const RMessage2& aMessage );
-
+ TBool GetServerLock(const RMessage2& aMessage);
+
+ /**
+ * Unpacks data for ExecuteMultipleActions from client
+ * @param Message from client
+ * @return list containing input data from the client
+ **/
+ CLiwGenericParamList* UnpackForMultiExecuteLC(const RMessage2& aMessage);
+
+ /**
+ * Checks map validity of input data and returns list
+ * that can be used to call execute
+ * @param aMaps input data
+ * @return list containing input maps for Execute
+ **/
+ CLiwDefaultList* CheckValidityLC(const CLiwList* aMaps);
+
private:
/*
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpactiondatacache.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -0,0 +1,300 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: ?Description
+
+ *
+*/
+
+
+#include <liwcommon.h>
+#include <liwvariant.h>
+#include <s32mem.h>
+
+#include "cpactiondatacache.h"
+#include "cpglobals.h"
+
+using namespace LIW;
+
+_LIT8(KCachedMap, "cached_map");
+
+static const int KMaxCacheItems = 6;
+
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCPActionDataCache* CCPActionDataCache::NewL()
+ {
+ CCPActionDataCache* self = CCPActionDataCache::NewLC();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCPActionDataCache* CCPActionDataCache::NewLC()
+ {
+ CCPActionDataCache* self = new (ELeave) CCPActionDataCache;
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCPActionDataCache::ConstructL( )
+ {
+ iInternalList = CLiwDefaultList::NewL();
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCPActionDataCache::CCPActionDataCache()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCPActionDataCache::~CCPActionDataCache()
+ {
+ iInternalList->Close();
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCPActionDataCache::HandleCacheRemoveL(const CLiwMap* aMap)
+ {
+ TInt id = FindL(aMap);
+ if (id != KErrNotFound)
+ {
+ iInternalList->Remove(id);
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCPActionDataCache::AppendL( const CLiwGenericParamList* aParamList)
+ {
+ const TLiwGenericParam* param;
+ TInt pos( 0);
+ param = aParamList->FindFirst( pos, KListMap );
+
+ if (param && param->Value().TypeId() == EVariantTypeMap)
+ {
+ const CLiwMap* inputMap = param->Value().AsMap();
+ CLiwDefaultMap* map = CLiwDefaultMap::NewLC();
+ CopyVariantL(KId, inputMap, map);
+ CopyVariantL(KPublisherId, inputMap, map);
+ CopyVariantL(KContentType, inputMap, map);
+ CopyVariantL(KContentId, inputMap, map);
+ map->InsertL(KCachedMap, TLiwVariant(inputMap));
+ iInternalList->AppendL(TLiwVariant(map));
+ CleanupStack::PopAndDestroy(map);
+
+ if (iInternalList->Count() > KMaxCacheItems)
+ {
+ iInternalList->Remove(0);
+ }
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CCPActionDataCache::IsCacheableL(const CLiwMap* aMap)
+ {
+ TBool result(EFalse);
+ TLiwVariant value;
+ value.PushL();
+
+ if (aMap->FindL(KId, value) && value.AsTInt32() > 0)
+ {
+ result = ETrue;
+ }
+ else if (IsSpecifiedL(aMap, KPublisherId) && IsSpecifiedL(aMap,
+ KContentType) && IsSpecifiedL(aMap, KContentId))
+ {
+ result = ETrue;
+ }
+
+ CleanupStack::PopAndDestroy(&value);
+ return result;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CCPActionDataCache::ExistL(const CLiwMap* aMap)
+ {
+ TBool result(EFalse);
+ if (FindL(aMap) != KErrNotFound)
+ {
+ result = ETrue;
+ }
+ return result;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCPActionDataCache::GetL(const CLiwMap* aMap,
+ CLiwGenericParamList* aParamList)
+ {
+ TInt id = FindL(aMap);
+ if (id != KErrNotFound)
+ {
+ TLiwVariant value;
+ value.PushL();
+ iInternalList->AtL(id, value);
+ const CLiwMap* map = value.AsMap();
+ if (map->FindL(KCachedMap, value))
+ {
+ CLiwDefaultMap* outMap = CLiwDefaultMap::NewLC();
+ value.Get(*outMap);
+ TLiwGenericParam genericParam(KListMap, TLiwVariant(outMap));
+ aParamList->AppendL(genericParam);
+ CleanupStack::PopAndDestroy(outMap);
+ }
+ CleanupStack::PopAndDestroy(&value);
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CCPActionDataCache::MatchL(const CLiwMap* aCachedMap,
+ const CLiwMap* aInputMap)
+ {
+ TBool idMatch(EFalse);
+ TLiwVariant l, r;
+ l.PushL();
+ r.PushL();
+ if (aCachedMap->FindL(KId, l) && aInputMap->FindL(KId, r) && l.AsTInt32()
+ == r.AsTInt32())
+ {
+ idMatch = ETrue;
+ }
+ if (!idMatch)
+ {
+ if (MatchL(aCachedMap, aInputMap, KPublisherId) && MatchL(aCachedMap,
+ aInputMap, KContentType) && MatchL(aCachedMap, aInputMap,
+ KContentId))
+ {
+ idMatch = ETrue;
+ }
+ }
+
+ CleanupStack::PopAndDestroy(&r);
+ CleanupStack::PopAndDestroy(&l);
+ return idMatch;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CCPActionDataCache::MatchL(const CLiwMap* aLeft, const CLiwMap* aRight,
+ const TDesC8& aKey)
+ {
+ TBool match(EFalse);
+ TLiwVariant l, r;
+ l.PushL();
+ r.PushL();
+ if (aLeft->FindL(aKey, l) && aRight->FindL(aKey, r)
+ && !l.AsDes().Compare(r.AsDes()))
+ {
+ match = ETrue;
+ }
+ CleanupStack::PopAndDestroy(&r);
+ CleanupStack::PopAndDestroy(&l);
+ return match;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CCPActionDataCache::IsSpecifiedL(const CLiwMap* aMap,
+ const TDesC8& aKey)
+ {
+ TBool result(EFalse);
+ TLiwVariant value;
+ value.PushL();
+ if (aMap->FindL(aKey, value) && value.AsDes().Compare(KNullDesC) != 0
+ && value.AsDes().Compare(KAll) != 0)
+ {
+ result = ETrue;
+ }
+ CleanupStack::PopAndDestroy(&value);
+ return result;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CCPActionDataCache::FindL(const CLiwMap* aKey)
+ {
+ TInt result(KErrNotFound);
+ TLiwVariant value;
+ value.PushL();
+ for (TInt i = 0; i < iInternalList->Count(); i++)
+ {
+ iInternalList->AtL(i, value);
+ if (MatchL(value.AsMap(), aKey))
+ {
+ result = i;
+ break;
+ }
+ }
+ CleanupStack::PopAndDestroy(&value);
+ return result;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CCPActionDataCache::CopyVariantL(const TDesC8& aKey,
+ const CLiwMap* aInMap, CLiwDefaultMap* aOutMap)
+ {
+ //TODO: method exist also in data manager - should be refactored
+ TLiwVariant variant;
+ variant.PushL();
+ if (aInMap->FindL(aKey, variant))
+ {
+ aOutMap->InsertL(aKey, variant);
+ }
+ CleanupStack::PopAndDestroy(&variant);
+ }
--- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -312,12 +312,8 @@
{
listOfMatchingMaps->AppendL( variant );
}
- else
- {
- variant.Reset();
- }
}
- CleanupStack::Pop( &variant );
+ CleanupStack::PopAndDestroy( &variant );
}
if ( listOfMatchingMaps->Count( ) )
{
--- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserverdatamanager.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserverdatamanager.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -38,6 +38,7 @@
//
CCPDataManager::~CCPDataManager()
{
+ delete iActionDataCache;
iNotificationsArray.Close( );
delete iStorage;
}
@@ -85,6 +86,7 @@
{
iStorage = StorageFactory::NewDatabaseL( );
}
+ iActionDataCache = CCPActionDataCache::NewL();
}
// ---------------------------------------------------------------------------
@@ -98,6 +100,8 @@
CCPLiwMap* getlistmap = CreateMapForGetlistLC( aMap );
+ iActionDataCache->HandleCacheRemoveL( &aMap );
+
TBool activateMap = aMap.GetActivateInfo();
TBool activateDB ( EFalse );
TBool activateSupport =aMap.ActivateActionSupport( );
@@ -158,7 +162,7 @@
//
// ---------------------------------------------------------------------------
//
-TInt CCPDataManager::GetActionL( const CCPLiwMap& aMap,
+TInt CCPDataManager::GetActionsL( const CCPLiwMap& aMap, TBool aEnableCache,
CLiwGenericParamList& aOutParamList, CLiwDefaultList* aNotificationList )
{
CP_DEBUG( _L8("CCPDataManager::GetActionL()") );
@@ -166,12 +170,25 @@
CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC( );
TInt result( KErrNone );
- TRAP( result, iStorage->GetListL( &aMap, *paramList ) );
- RBuf8 actionTrigger;
- actionTrigger.CleanupClosePushL();
+
+ CLiwDefaultList* actionTriggers = aMap.GetActionTriggersLC();
- if ( aMap.GetPropertyL( KActionTrigger, actionTrigger ) )
+ if ( actionTriggers )
{
+ TBool cacheable = iActionDataCache->IsCacheableL( &aMap );
+ if (aEnableCache && cacheable && iActionDataCache->ExistL( &aMap ))
+ {
+ iActionDataCache->GetL( &aMap, paramList );
+ }
+ else
+ {
+ TRAP( result, iStorage->GetListL( &aMap, *paramList ) );
+ if ( aEnableCache && cacheable && result == KErrNone )
+ {
+ iActionDataCache->AppendL(paramList);
+ }
+ }
+
const TLiwGenericParam* param;
TInt pos( 0);
@@ -179,14 +196,15 @@
//at least one param should be valid to preceed
if ( !param || pos == KErrNotFound )
{
- BuildDefaultChangeInfoL(&aMap, aNotificationList);
+ BuildDefaultChangeInfoL(&aMap, actionTriggers, aNotificationList);
}
//iteration through paramList items
while ( param && pos != KErrNotFound )
{
- BuildChangeInfoL( &aMap, param, aNotificationList );
- FillActionParamListL( aOutParamList, param, actionTrigger );
+ BuildChangeInfoL( &aMap, actionTriggers, param,
+ aNotificationList );
+ FillActionParamListL( aOutParamList, param, actionTriggers );
param = paramList->FindNext( pos, KListMap );
}
}
@@ -194,7 +212,8 @@
{
User::Leave( KErrNotFound );
}
- CleanupStack::PopAndDestroy( &actionTrigger );
+
+ CleanupStack::PopAndDestroy( actionTriggers );
CleanupStack::PopAndDestroy( paramList );
return result;
}
@@ -207,7 +226,7 @@
void CCPDataManager::FillActionParamListL(
CLiwGenericParamList& aOutParamList,
const TLiwGenericParam* aParam,
- RBuf8 & aActionTrigger)
+ const CLiwDefaultList* aActionTriggers)
{
CP_DEBUG( _L8("CCPDataManager::FillActionParamListL()") );
__ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) );
@@ -219,7 +238,17 @@
RDesReadStream str(actionBinaries);
CleanupClosePushL( str );
CLiwDefaultMap* actionMap = CLiwDefaultMap::NewLC( str );
- ExtractTriggerL( aOutParamList, actionMap, aActionTrigger );
+
+ TLiwVariant trigger;
+ trigger.PushL();
+ TInt count = aActionTriggers->Count();
+ for ( TInt i = 0; i<count; i++ )
+ {
+ trigger.Reset();
+ aActionTriggers->AtL( i,trigger );
+ ExtractTriggerL( aOutParamList, actionMap, trigger.AsData());
+ }
+ CleanupStack::PopAndDestroy(&trigger);
CleanupStack::PopAndDestroy( actionMap );
CleanupStack::PopAndDestroy( &str );
@@ -273,6 +302,7 @@
{
CP_DEBUG( _L8("CCPDataManager::RemoveData()") );
__ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) );
+ iActionDataCache->HandleCacheRemoveL( &aMap );
iStorage->RemoveL( &aMap );
}
@@ -456,29 +486,38 @@
// -----------------------------------------------------------------------------
//
void CCPDataManager::BuildChangeInfoL( const CCPLiwMap* aMap,
+ const CLiwDefaultList* aActionTriggers,
const TLiwGenericParam* aParam,
CLiwDefaultList* aChangeInfoList )
{
TLiwVariant resultVar = aParam->Value();
if ( resultVar.TypeId() == EVariantTypeMap )
{
- resultVar.PushL();
- CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC();
-
- CopyVariantL(KId, resultVar.AsMap(), changeInfoMap );
- CopyVariantL(KPublisherId, resultVar.AsMap(), changeInfoMap );
- CopyVariantL(KContentType, resultVar.AsMap(), changeInfoMap );
- CopyVariantL(KContentId, resultVar.AsMap(), changeInfoMap );
- CopyVariantL(KFlag, resultVar.AsMap(), changeInfoMap );
- CopyVariantL(KType, aMap, changeInfoMap );
- CopyVariantL(KActionTrigger, aMap, changeInfoMap );
- CopyActionTrigger16L( aMap, changeInfoMap );
-
- changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) );
-
- aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) );
- CleanupStack::PopAndDestroy( changeInfoMap );
- CleanupStack::PopAndDestroy( &resultVar );
+ for ( TInt i = 0; i<aActionTriggers->Count(); i++ )
+ {
+ resultVar.PushL();
+ CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC();
+
+ CopyVariantL(KId, resultVar.AsMap(), changeInfoMap );
+ CopyVariantL(KPublisherId, resultVar.AsMap(), changeInfoMap );
+ CopyVariantL(KContentType, resultVar.AsMap(), changeInfoMap );
+ CopyVariantL(KContentId, resultVar.AsMap(), changeInfoMap );
+ CopyVariantL(KFlag, resultVar.AsMap(), changeInfoMap );
+ CopyVariantL(KType, aMap, changeInfoMap );
+
+ TLiwVariant trigger;
+ trigger.PushL();
+ aActionTriggers->AtL(i,trigger);
+ changeInfoMap->InsertL(KActionTrigger, trigger);
+ CopyActionTrigger16L(trigger,changeInfoMap);
+ CleanupStack::PopAndDestroy(&trigger);
+
+ changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) );
+
+ aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) );
+ CleanupStack::PopAndDestroy( changeInfoMap );
+ CleanupStack::PopAndDestroy( &resultVar );
+ }
}
}
@@ -488,23 +527,32 @@
// -----------------------------------------------------------------------------
//
void CCPDataManager::BuildDefaultChangeInfoL( const CCPLiwMap* aMap,
+ const CLiwDefaultList* aActionTriggers,
CLiwDefaultList* aChangeInfoList )
{
- CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC();
+ for ( TInt i = 0; i<aActionTriggers->Count(); i++ )
+ {
+ CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC();
- CopyVariantL(KId, aMap, changeInfoMap );
- CopyVariantL(KPublisherId, aMap, changeInfoMap );
- CopyVariantL(KContentType, aMap, changeInfoMap );
- CopyVariantL(KContentId, aMap, changeInfoMap );
- CopyVariantL(KFlag, aMap, changeInfoMap );
- CopyVariantL(KType, aMap, changeInfoMap );
- CopyVariantL(KActionTrigger, aMap, changeInfoMap );
- CopyActionTrigger16L( aMap, changeInfoMap );
-
- changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) );
-
- aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) );
- CleanupStack::PopAndDestroy( changeInfoMap );
+ CopyVariantL(KId, aMap, changeInfoMap );
+ CopyVariantL(KPublisherId, aMap, changeInfoMap );
+ CopyVariantL(KContentType, aMap, changeInfoMap );
+ CopyVariantL(KContentId, aMap, changeInfoMap );
+ CopyVariantL(KFlag, aMap, changeInfoMap );
+ CopyVariantL(KType, aMap, changeInfoMap );
+
+ TLiwVariant trigger;
+ trigger.PushL();
+ aActionTriggers->AtL(i,trigger);
+ changeInfoMap->InsertL(KActionTrigger, trigger);
+ CopyActionTrigger16L(trigger,changeInfoMap);
+ CleanupStack::PopAndDestroy(&trigger);
+
+ changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) );
+
+ aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) );
+ CleanupStack::PopAndDestroy( changeInfoMap );
+ }
}
// -----------------------------------------------------------------------------
@@ -559,22 +607,30 @@
variant.PushL();
if ( aInMap->FindL( KActionTrigger(), variant ) )
{
-
- TPtrC8 result8( KNullDesC8 );
- if( variant.Get( result8 ) )
- {
- RBuf actionTrigger;
- actionTrigger.CleanupClosePushL();
- actionTrigger.Assign(
- EscapeUtils::ConvertToUnicodeFromUtf8L( result8 ) );
-
- variant.Reset();
- variant.Set( actionTrigger );
- CleanupStack::PopAndDestroy( &actionTrigger );
- }
-
- aOutMap->InsertL( KActionTrigger16(), variant );
+ CopyActionTrigger16L(variant,aOutMap);
}
CleanupStack::PopAndDestroy( &variant );
}
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CCPDataManager::CopyActionTrigger16L( const TLiwVariant& aVariant,
+ CLiwDefaultMap* aOutMap )
+ {
+ if( aVariant.TypeId() == EVariantTypeDesC8 )
+ {
+ TLiwVariant variant;
+ variant.PushL();
+ RBuf desc16;
+ desc16.CleanupClosePushL();
+ desc16.Assign(
+ EscapeUtils::ConvertToUnicodeFromUtf8L( aVariant.AsData()) );
+ variant.Set( desc16 );
+ aOutMap->InsertL(KActionTrigger16(),variant);
+ CleanupStack::PopAndDestroy( &desc16 );
+ CleanupStack::PopAndDestroy( &variant );
+ }
+ }
+
--- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -33,7 +33,6 @@
#include "cpactionhandlerthread.h"
#include "cpnotificationhandler.h"
-
using namespace LIW;
// ================= MEMBER FUNCTIONS =======================
@@ -183,6 +182,9 @@
case ECpServerExecuteAction:
ExecuteActionL( aMessage );
break;
+ case ECpServerExecuteMultipleActions:
+ ExecuteMultipleActionsL( aMessage );
+ break;
default:
iServer->PanicClient( aMessage, ECPServerBadRequest );
aPanicedClient = ETrue;
@@ -282,26 +284,68 @@
//
void CCPServerSession::ExecuteActionL( const RMessage2& aMessage )
{
- TInt error(KErrNone);
CP_DEBUG( _L8("CCPServerSession::ExecuteActionSizeL()" ) );
-
TUint options = static_cast<TUint>( aMessage.Int2() ); // 2 == KOptionsPosition
+ CCPLiwMap* map = UnpackFromClientLC( aMessage );
+ ExecuteActionL( map, EFalse, options );
+ CleanupStack::PopAndDestroy( map );
+ }
- CCPLiwMap* map = UnpackFromClientLC( aMessage );
- CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC( );
+// -----------------------------------------------------------------------------
+//
+// --------------- --------------------------------------------------------------
+//
+void CCPServerSession::ExecuteActionL(const CCPLiwMap* aMap,
+ TBool aEnableCache, TUint aOptions)
+ {
+ CP_DEBUG( _L8("CCPServerSession::ExecuteActionSizeL()" ) );
+ TInt error(KErrNone);
+ CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC();
CLiwDefaultList* list = CLiwDefaultList::NewLC();
- error = iDataManager->GetActionL( *map, *paramList, list );
+ error = iDataManager->GetActionsL(*aMap, aEnableCache, *paramList, list );
//we notify apart from action execution result. So in fact
//notification means there was an attempt to execute action
- if ( !( options & KDisableNotification ) )
+ if (!(aOptions & KDisableNotification))
{
- iDataManager->HandleChangeL( list );
+ iDataManager->HandleChangeL(list);
}
- User::LeaveIfError( error );
- ExecuteL( *paramList );
- CleanupStack::PopAndDestroy( list );
- CleanupStack::PopAndDestroy( paramList );
- CleanupStack::PopAndDestroy( map );
+ User::LeaveIfError(error);
+ ExecuteL(*paramList);
+ CleanupStack::PopAndDestroy(list);
+ CleanupStack::PopAndDestroy(paramList);
+ }
+
+// -----------------------------------------------------------------------------
+// CCPServerSession::ExecuteMultipleActionsL
+// --------------- --------------------------------------------------------------
+//
+void CCPServerSession::ExecuteMultipleActionsL(const RMessage2& aMessage)
+ {
+ CP_DEBUG( _L8("CCPServerSession::ExecuteMultipleActionsL()" ) );
+
+ CLiwGenericParamList* genericList = UnpackForMultiExecuteLC(aMessage);
+ TUint options = static_cast<TUint> (aMessage.Int2()); // 2 == KOptionsPosition
+
+ const TLiwGenericParam* param = NULL;
+ TInt pos(0);
+ param = genericList->FindFirst(pos, KFilters);
+ const CLiwList* maps = param->Value().AsList();
+ CLiwDefaultList* cpMaps = CheckValidityLC(maps);
+
+ //execute actions
+ for (TInt i = 0; i < cpMaps->Count(); i++)
+ {
+ TLiwVariant mapVariant;
+ mapVariant.PushL();
+ cpMaps->AtL(i, mapVariant);
+ const CCPLiwMap* map =
+ static_cast<const CCPLiwMap*> (mapVariant.AsMap());
+ ExecuteActionL(map, ETrue, options);
+ CleanupStack::PopAndDestroy(&mapVariant);
+ }
+
+ CleanupStack::PopAndDestroy(cpMaps);
+ CleanupStack::PopAndDestroy(genericList);
}
// -----------------------------------------------------------------------------
@@ -488,7 +532,7 @@
aMap->InsertL( KActionTrigger, TLiwVariant( KActivateTrigger ) );
}
CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC();
- iDataManager->GetActionL( *aMap, *paramList, aNotificationList );
+ iDataManager->GetActionsL( *aMap, EFalse, *paramList, aNotificationList );
iActionHandlerThread->ExecuteL( *paramList );
CleanupStack::PopAndDestroy( paramList );
}
@@ -504,4 +548,51 @@
&& iServer->GetLock() );
}
+
+// -----------------------------------------------------------------------------
+//
+// --------------- --------------------------------------------------------------
+//
+CLiwGenericParamList* CCPServerSession::UnpackForMultiExecuteLC(
+ const RMessage2& aMessage)
+ {
+ TInt deslen = aMessage.GetDesLengthL(KDescriptorPosition);
+ HBufC8* buffer = HBufC8::NewLC(deslen);
+ TPtr8 tempDes = buffer->Des();
+ aMessage.Read(KDescriptorPosition, tempDes);
+ RDesReadStream datastrm(*buffer);
+ CleanupClosePushL(datastrm);
+ CLiwGenericParamList* genericList = CLiwGenericParamList::NewL(datastrm);
+ CleanupStack::PopAndDestroy(&datastrm);
+ CleanupStack::PopAndDestroy(buffer);
+ CleanupStack::PushL(genericList);
+ return genericList;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// --------------- --------------------------------------------------------------
+//
+CLiwDefaultList* CCPServerSession::CheckValidityLC(const CLiwList* aMaps)
+ {
+ CLiwDefaultList* cpMaps = CLiwDefaultList::NewLC();
+ for (TInt i = 0; i < aMaps->Count(); i++)
+ {
+ TLiwVariant mapVariant;
+ mapVariant.PushL();
+ aMaps->AtL(i, mapVariant);
+ if (mapVariant.TypeId() != LIW::EVariantTypeMap)
+ {
+ User::Leave(KErrBadName);
+ }
+ CCPLiwMap* map = CCPLiwMap::NewL(*mapVariant.AsMap());
+ map->PushL();
+ map->IsValidForActionL();
+ cpMaps->AppendL(TLiwVariant(map));
+ CleanupStack::PopAndDestroy(map);
+ CleanupStack::PopAndDestroy(&mapVariant);
+ }
+ return cpMaps;
+ }
+
// End of File
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/bwins/cpdebugu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/bwins/cpdebugu.def Wed Mar 31 22:04:35 2010 +0300
@@ -1,8 +1,9 @@
EXPORTS
- ?Data@CCPDebug@@CAPAUDebugData@@XZ @ 1 NONAME ; struct DebugData * CCPDebug::Data(void)
- ?Enable@CCPDebug@@SAHXZ @ 2 NONAME ; int CCPDebug::Enable(void)
- ?EnableLogging@CCPDebug@@SAXH@Z @ 3 NONAME ; void CCPDebug::EnableLogging(int)
- ?NewL@CCPDebug@@SAPAV1@ABVTDesC16@@@Z @ 4 NONAME ; class CCPDebug * CCPDebug::NewL(class TDesC16 const &)
+ ?EnableLogging@CCPDebug@@SAXH@Z @ 1 NONAME ; void CCPDebug::EnableLogging(int)
+ ?Printf@CCPDebug@@SAXV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 2 NONAME ; void CCPDebug::Printf(class TRefByValue<class TDesC8 const >, ...)
+ ?NewL@CCPDebug@@SAPAV1@ABVTDesC16@@@Z @ 3 NONAME ; class CCPDebug * CCPDebug::NewL(class TDesC16 const &)
+ ?Data@CCPDebug@@CAPAUDebugData@@XZ @ 4 NONAME ; struct DebugData * CCPDebug::Data(void)
?NewLC@CCPDebug@@SAPAV1@ABVTDesC16@@@Z @ 5 NONAME ; class CCPDebug * CCPDebug::NewLC(class TDesC16 const &)
- ?Printf@CCPDebug@@SAXV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 6 NONAME ; void CCPDebug::Printf(class TRefByValue<class TDesC8 const >, ...)
+ ?ExtendedPrint@CCPDebug@@SAXPBDABVCLiwGenericParamList@@@Z @ 6 NONAME ; void CCPDebug::ExtendedPrint(char const *, class CLiwGenericParamList const &)
+ ?Enable@CCPDebug@@SAHXZ @ 7 NONAME ; int CCPDebug::Enable(void)
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/eabi/cpdebugu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/eabi/cpdebugu.def Wed Mar 31 22:04:35 2010 +0300
@@ -1,8 +1,9 @@
EXPORTS
_ZN8CCPDebug13EnableLoggingEi @ 1 NONAME
- _ZN8CCPDebug4DataEv @ 2 NONAME
- _ZN8CCPDebug4NewLERK7TDesC16 @ 3 NONAME
- _ZN8CCPDebug5NewLCERK7TDesC16 @ 4 NONAME
- _ZN8CCPDebug6EnableEv @ 5 NONAME
- _ZN8CCPDebug6PrintfE11TRefByValueIK6TDesC8Ez @ 6 NONAME
+ _ZN8CCPDebug13ExtendedPrintEPKcRK20CLiwGenericParamList @ 2 NONAME
+ _ZN8CCPDebug4DataEv @ 3 NONAME
+ _ZN8CCPDebug4NewLERK7TDesC16 @ 4 NONAME
+ _ZN8CCPDebug5NewLCERK7TDesC16 @ 5 NONAME
+ _ZN8CCPDebug6EnableEv @ 6 NONAME
+ _ZN8CCPDebug6PrintfE11TRefByValueIK6TDesC8Ez @ 7 NONAME
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group/cpdebug.mmp Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group/cpdebug.mmp Wed Mar 31 22:04:35 2010 +0300
@@ -39,5 +39,7 @@
LIBRARY euser.lib
LIBRARY estor.lib
LIBRARY efsrv.lib
+LIBRARY liwservicehandler.lib
+
//end of file
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/inc/cpdebug.h Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/inc/cpdebug.h Wed Mar 31 22:04:35 2010 +0300
@@ -23,6 +23,7 @@
#include <e32base.h>
#ifdef CONTENT_PUBLISHER_DEBUG
#include <f32file.h>
+#include <liwgenericparam.h>
_LIT(KCPDebugDirName, "contentpublisher" );
_LIT(KCPDebugFileName, "c:\\contentpublisher.txt" );
@@ -62,6 +63,14 @@
*/
IMPORT_C static void Printf(TRefByValue<const TDesC8> aFormat, ...);
+ /**
+ * Print debug text to RDebug
+ *
+ */
+ IMPORT_C static void ExtendedPrint( const char* aStringParam,
+ const CLiwGenericParamList& aInParamList );
+
+
private:
CCPDebug();
@@ -84,7 +93,7 @@
};
#define CP_DEBUG(s) CCPDebug::Printf(s)
-
+#define CP_EXTENDED_DEBUG(s,p) CCPDebug::ExtendedPrint(s,p)
/**
* Thread local storage space. Writable static data is not supported in
* Symbian, so static data is stored in this struct.
@@ -100,7 +109,8 @@
#else
-#define CP_DEBUG(s)
+#define CP_DEBUG(s)
+#define CP_EXTENDED_DEBUG(s,p)
#endif
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/src/cpdebug.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/src/cpdebug.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -37,7 +37,7 @@
iData->iFileName = aFile;
Dll::SetTls( iData );
User::LeaveIfError( iData->iFs.Connect( ) );
- EnableLogging( ETrue );
+ EnableLogging( EFalse );
}
// ---------------------------------------------------------------------------
@@ -161,6 +161,25 @@
//
// ---------------------------------------------------------------------------
//
+EXPORT_C void CCPDebug::ExtendedPrint( const char* aStringParam,
+ const CLiwGenericParamList& aInParamList )
+ {
+ RDebug::Printf( "CPS Client::Request %s Parameters: \n", aStringParam );
+ for ( TInt i = 0; i < aInParamList.Count( ); i++ )
+ {
+ TLiwGenericParam tempParam;
+ tempParam.PushL();
+ TRAP_IGNORE( aInParamList.AtL(i ,tempParam) );
+ Dump( tempParam.Value() );
+ CleanupStack::Pop(&tempParam);
+ tempParam.Reset();
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
EXPORT_C DebugData* CCPDebug::Data()
{
return static_cast<DebugData*>(Dll::Tls());
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/bwins/cputilsu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/bwins/cputilsu.def Wed Mar 31 22:04:35 2010 +0300
@@ -1,16 +1,18 @@
EXPORTS
- ?GetProperty@CCPLiwMap@@QBEHABVTDesC8@@AAJ@Z @ 1 NONAME ; int CCPLiwMap::GetProperty(class TDesC8 const &, long &) const
- ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf16@@@Z @ 2 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf16 &) const
- ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf8@@@Z @ 3 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf8 &) const
- ?IsValidForActionL@CCPLiwMap@@QBEXXZ @ 4 NONAME ; void CCPLiwMap::IsValidForActionL(void) const
- ?IsValidForNotificationL@CCPLiwMap@@QBEXXZ @ 5 NONAME ; void CCPLiwMap::IsValidForNotificationL(void) const
- ?NewL@CCPLiwMap@@SAPAV1@AAVRDesReadStream@@@Z @ 6 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class RDesReadStream &)
+ ?PackForServerLC@CCPLiwMap@@QBEPAVHBufC8@@XZ @ 1 NONAME ; class HBufC8 * CCPLiwMap::PackForServerLC(void) const
+ ?NewL@CCPLiwMap@@SAPAV1@ABVCLiwMap@@@Z @ 2 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class CLiwMap const &)
+ ?IsValidForActionL@CCPLiwMap@@QBEXXZ @ 3 NONAME ; void CCPLiwMap::IsValidForActionL(void) const
+ ?NewL@CCPLiwMap@@SAPAV1@AAVRDesReadStream@@@Z @ 4 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class RDesReadStream &)
+ ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf8@@@Z @ 5 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf8 &) const
+ ?GetProperty@CCPLiwMap@@QBEHABVTDesC8@@AAJ@Z @ 6 NONAME ; int CCPLiwMap::GetProperty(class TDesC8 const &, long &) const
?NewL@CCPLiwMap@@SAPAV1@ABVCLiwGenericParamList@@@Z @ 7 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class CLiwGenericParamList const &)
- ?NewL@CContentMap@@SAPAV1@XZ @ 8 NONAME ; class CContentMap * CContentMap::NewL(void)
- ?NewL@CPublisherRegistryMap@@SAPAV1@XZ @ 9 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewL(void)
- ?NewLC@CContentMap@@SAPAV1@XZ @ 10 NONAME ; class CContentMap * CContentMap::NewLC(void)
- ?NewLC@CPublisherRegistryMap@@SAPAV1@XZ @ 11 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewLC(void)
- ?PackForServerLC@CCPLiwMap@@QBEPAVHBufC8@@XZ @ 12 NONAME ; class HBufC8 * CCPLiwMap::PackForServerLC(void) const
- ?Reset@CCPLiwMap@@QBEXXZ @ 13 NONAME ; void CCPLiwMap::Reset(void) const
- ?SetSecurityL@CCPLiwMap@@QAEXABVRMessage2@@@Z @ 14 NONAME ; void CCPLiwMap::SetSecurityL(class RMessage2 const &)
+ ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf16@@@Z @ 8 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf16 &) const
+ ?Reset@CCPLiwMap@@QBEXXZ @ 9 NONAME ; void CCPLiwMap::Reset(void) const
+ ?IsValidForNotificationL@CCPLiwMap@@QBEXXZ @ 10 NONAME ; void CCPLiwMap::IsValidForNotificationL(void) const
+ ?SetSecurityL@CCPLiwMap@@QAEXABVRMessage2@@@Z @ 11 NONAME ; void CCPLiwMap::SetSecurityL(class RMessage2 const &)
+ ?NewLC@CPublisherRegistryMap@@SAPAV1@XZ @ 12 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewLC(void)
+ ?NewL@CPublisherRegistryMap@@SAPAV1@XZ @ 13 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewL(void)
+ ?GetActionTriggersLC@CCPLiwMap@@QBEPAVCLiwDefaultList@@XZ @ 14 NONAME ; class CLiwDefaultList * CCPLiwMap::GetActionTriggersLC(void) const
+ ?NewLC@CContentMap@@SAPAV1@XZ @ 15 NONAME ; class CContentMap * CContentMap::NewLC(void)
+ ?NewL@CContentMap@@SAPAV1@XZ @ 16 NONAME ; class CContentMap * CContentMap::NewL(void)
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/eabi/cputilsu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/eabi/cputilsu.def Wed Mar 31 22:04:35 2010 +0300
@@ -6,13 +6,15 @@
_ZN9CCPLiwMap12SetSecurityLERK9RMessage2 @ 5 NONAME
_ZN9CCPLiwMap4NewLER14RDesReadStream @ 6 NONAME
_ZN9CCPLiwMap4NewLERK20CLiwGenericParamList @ 7 NONAME
- _ZNK9CCPLiwMap11GetPropertyERK6TDesC8Rl @ 8 NONAME
- _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R5RBuf8 @ 9 NONAME
- _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R6RBuf16 @ 10 NONAME
- _ZNK9CCPLiwMap15PackForServerLCEv @ 11 NONAME
- _ZNK9CCPLiwMap17IsValidForActionLEv @ 12 NONAME
- _ZNK9CCPLiwMap23IsValidForNotificationLEv @ 13 NONAME
- _ZNK9CCPLiwMap5ResetEv @ 14 NONAME
- _ZTI9CCPLiwMap @ 15 NONAME ; #<TI>#
- _ZTV9CCPLiwMap @ 16 NONAME ; #<VT>#
+ _ZN9CCPLiwMap4NewLERK7CLiwMap @ 8 NONAME
+ _ZNK9CCPLiwMap11GetPropertyERK6TDesC8Rl @ 9 NONAME
+ _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R5RBuf8 @ 10 NONAME
+ _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R6RBuf16 @ 11 NONAME
+ _ZNK9CCPLiwMap15PackForServerLCEv @ 12 NONAME
+ _ZNK9CCPLiwMap17IsValidForActionLEv @ 13 NONAME
+ _ZNK9CCPLiwMap19GetActionTriggersLCEv @ 14 NONAME
+ _ZNK9CCPLiwMap23IsValidForNotificationLEv @ 15 NONAME
+ _ZNK9CCPLiwMap5ResetEv @ 16 NONAME
+ _ZTI9CCPLiwMap @ 17 NONAME
+ _ZTV9CCPLiwMap @ 18 NONAME
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpliwmap.h Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpliwmap.h Wed Mar 31 22:04:35 2010 +0300
@@ -24,6 +24,7 @@
class RDesReadStream;
class CCPSecurityPolicy;
+class TLiwGenericParam;
// CLASS DECLARATION
/**
@@ -74,6 +75,11 @@
IMPORT_C static CCPLiwMap* NewL( const CLiwGenericParamList& aList );
/**
+ * Two-phased constructor.
+ */
+ IMPORT_C static CCPLiwMap* NewL( const CLiwMap& aMap );
+
+ /**
* Used by client to serialize this object
*
* @return object serialized to binary
@@ -133,7 +139,16 @@
IMPORT_C TBool GetProperty( const TDesC8& aProperty,
TInt32& aResult ) const;
-
+
+ /**
+ * Return list of action triggers from main map
+ * Note that these are not triggers from action map
+ *
+ * @return list of action triggers, NULL if main map
+ * doesn't have action trigger
+ */
+ IMPORT_C CLiwDefaultList* GetActionTriggersLC( ) const;
+
/**
* Setter for security policy
*
@@ -379,6 +394,18 @@
void SetL( const CLiwGenericParamList& aInParamList );
/**
+ * Sets all parameters according to provided list
+ * @param aMap map with parameters
+ */
+ void SetL( const CLiwMap& aMap );
+
+ /**
+ * Extracts a param and appends it to the internal list
+ * @param aParam a param to extract
+ */
+ void ExtractParamL(const TLiwGenericParam& aParam);
+
+ /**
* Check Get properties
*
* @return logical sum of TCPProperties of the object
@@ -438,7 +465,6 @@
*
*/
TBool PropertyExists( const TDesC8& aProperty ) const;
-
/**
* Fetches entries from database
@@ -607,6 +633,14 @@
* Perform the second phase construction of a CCPLiwMap object.
*/
void ConstructL();
+
+ /**
+ * Checks a type a map
+ * @param aVariant variant containing a map type
+ * @return ETrue if a type is Publisher and EFalse if Content
+ * in other cases method leaves
+ */
+ static TBool IsTypePublisherL(const TLiwVariant& aVariant);
protected:
// data
--- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpliwmap.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpliwmap.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -20,7 +20,6 @@
#include <liwgenericparam.h>
#include <escapeutils.h>
#include <badesca.h>
-#include <aiwvarianttype.hrh>
#include "cpliwmap.h"
#include "cpdebug.h"
@@ -29,6 +28,8 @@
#include "cpublisherregistrymap.h"
#include "cpsecuritypolicy.h"
+using namespace LIW;
+
// ======== MEMBER FUNCTIONS ========
// ---------------------------------------------------------------------------
@@ -56,34 +57,16 @@
CCPLiwMap* map( NULL );
if( param && pos !=KErrNotFound )
{
- RBuf typeBuf;
- typeBuf.CleanupClosePushL();
- TPtrC type( KNullDesC );
- if( !param->Value().Get( type ) )
+ if( IsTypePublisherL(param->Value()) )
{
- TPtrC8 type8( KNullDesC8 );
- if( !param->Value().Get( type8 ) )
- {
- User::Leave( KErrBadName );
- }
- typeBuf.Assign( EscapeUtils::ConvertToUnicodeFromUtf8L( type8 ) );
+ map = CPublisherRegistryMap::NewLC();
}
- else
- {
- typeBuf.CreateL( type );
- }
- if( typeBuf.Find( KCpData () ) != KErrNotFound )
+ else
{
map = CContentMap::NewLC();
}
- else if ( typeBuf.Find( KPublisher () ) != KErrNotFound )
- {
- map = CPublisherRegistryMap::NewLC();
- }
- else User::Leave( KErrArgument );
- map->SetL( aList );
- CleanupStack::Pop( map );
- CleanupStack::PopAndDestroy( &typeBuf );
+ map->SetL(aList);
+ CleanupStack::Pop(map);
}
else
{
@@ -95,6 +78,38 @@
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
+//
+EXPORT_C CCPLiwMap* CCPLiwMap::NewL( const CLiwMap& aMap )
+ {
+ CP_DEBUG( _L8("CCPLiwMap::NewL") );
+ TLiwVariant typeVariant;
+ typeVariant.PushL();
+ CCPLiwMap* map( NULL );
+
+ if (aMap.FindL(KType, typeVariant))
+ {
+ if( IsTypePublisherL(typeVariant) )
+ {
+ map = CPublisherRegistryMap::NewLC();
+ }
+ else
+ {
+ map = CContentMap::NewLC();
+ }
+ map->SetL(aMap);
+ CleanupStack::Pop(map);
+ }
+ else
+ {
+ User::Leave( KErrPathNotFound );
+ }
+ CleanupStack::PopAndDestroy(&typeVariant);
+ return map;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
//
EXPORT_C HBufC8* CCPLiwMap::PackForServerLC() const
{
@@ -282,6 +297,61 @@
return result;
}
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CLiwDefaultList* CCPLiwMap::GetActionTriggersLC( ) const
+ {
+ CP_DEBUG( _L8("CCPLiwMap::GetActionTriggers") );
+ TInt pos( 0 );
+ CLiwDefaultList* list(NULL);
+ const TLiwGenericParam* paramForValue = iMap->FindFirst( pos,
+ KActionTrigger );
+ if ( paramForValue )
+ {
+ if ( paramForValue->Value().TypeId() == EVariantTypeDesC8 )
+ {
+ list = CLiwDefaultList::NewLC();
+ list->AppendL(paramForValue->Value());
+ }
+ if ( paramForValue->Value().TypeId() == EVariantTypeDesC )
+ {
+ list = CLiwDefaultList::NewLC();
+ RBuf8 desc8;
+ desc8.CleanupClosePushL();
+ desc8.Assign( EscapeUtils::ConvertFromUnicodeToUtf8L(
+ paramForValue->Value().AsDes() ) );
+ list->AppendL(TLiwVariant(desc8));
+ CleanupStack::PopAndDestroy( &desc8 );
+ }
+ else if ( paramForValue->Value().TypeId() == EVariantTypeList )
+ {
+ list = CLiwDefaultList::NewLC();
+ const CLiwList* sourceList = paramForValue->Value().AsList();
+ TInt count = sourceList->Count();
+ for (TInt i = 0; i < count; i++)
+ {
+ TLiwVariant trigger;
+ sourceList->AtL(i,trigger);
+ if (trigger.TypeId() == EVariantTypeDesC8)
+ {
+ list->AppendL(trigger);
+ }
+ else if (trigger.TypeId() == EVariantTypeDesC)
+ {
+ RBuf8 desc8;
+ desc8.CleanupClosePushL();
+ desc8.Assign( EscapeUtils::ConvertFromUnicodeToUtf8L(
+ trigger.AsDes() ) );
+ list->AppendL(TLiwVariant(desc8));
+ CleanupStack::PopAndDestroy( &desc8 );
+ }
+ }
+ }
+ }
+ return list;
+ }
// ---------------------------------------------------------------------------
//
@@ -445,49 +515,78 @@
//
void CCPLiwMap::SetL( const CLiwGenericParamList& aInParamList )
{
-
CP_DEBUG( _L8("CCPLiwMap::SetL") );
for ( TInt i = 0; i < aInParamList.Count( ); i++ )
{
const TLiwGenericParam& param = aInParamList[i];
- if ( param.Value().TypeId( ) == LIW::EVariantTypeMap )
+ ExtractParamL(param);
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCPLiwMap::SetL( const CLiwMap& aMap )
+ {
+ CP_DEBUG( _L8("CCPLiwMap::SetL") );
+ for ( TInt i = 0; i < aMap.Count( ); i++ )
+ {
+ TBuf8<128> key;
+ aMap.AtL(i, key);
+ TLiwVariant value;
+ value.PushL();
+ aMap.FindL(key, value);
+ TLiwGenericParam param(key,value);
+ ExtractParamL(param);
+ CleanupStack::PopAndDestroy(&value);
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCPLiwMap::ExtractParamL(const TLiwGenericParam& aParam)
+ {
+ CP_DEBUG( _L8("CCPLiwMap::ExtractVariantL") );
+ if (aParam.Value().TypeId() == LIW::EVariantTypeMap)
+ {
+ const CLiwMap* map = aParam.Value().AsMap();
+ for (TInt i = 0; i < map->Count(); i++)
{
- const CLiwMap* map = param.Value().AsMap( );
- for ( TInt i = 0; i <map->Count( ); i++ )
+ TBuf8<128> key;
+ map->AtL(i, key);
+ TLiwVariant value;
+ value.PushL();
+ map->FindL(key, value);
+ if (key == KOperation)
{
- TBuf8<128> key;
- map->AtL( i, key );
- TLiwVariant value;
- value.PushL( );
- map->FindL( key, value );
- if ( key == KOperation )
- {
- IsProperOperationL( value );
- }
- RBuf8 datadesc;
- datadesc.CleanupClosePushL();
- if ( value.TypeId( ) == LIW::EVariantTypeMap )
- {
- const CLiwMap* internalMap = value.AsMap( );
- datadesc.CreateL( internalMap->Size( ) );
- RDesWriteStream datastrm(datadesc);
- CleanupClosePushL( datastrm );
- internalMap->ExternalizeL( datastrm );
- datastrm.CommitL( );
- CleanupStack::PopAndDestroy( &datastrm );
- value.Reset( );
- value.Set( datadesc );
- }
- TLiwGenericParam data( key, value);
- iMap->AppendL( data );
- CleanupStack::PopAndDestroy( &datadesc );
- CleanupStack::PopAndDestroy( &value );
+ IsProperOperationL(value);
}
+ RBuf8 datadesc;
+ datadesc.CleanupClosePushL();
+ if (value.TypeId() == LIW::EVariantTypeMap)
+ {
+ const CLiwMap* internalMap = value.AsMap();
+ datadesc.CreateL(internalMap->Size());
+ RDesWriteStream datastrm(datadesc);
+ CleanupClosePushL(datastrm);
+ internalMap->ExternalizeL(datastrm);
+ datastrm.CommitL();
+ CleanupStack::PopAndDestroy(&datastrm);
+ value.Reset();
+ value.Set(datadesc);
+ }
+ TLiwGenericParam data(key, value);
+ iMap->AppendL(data);
+ CleanupStack::PopAndDestroy(&datadesc);
+ CleanupStack::PopAndDestroy(&value);
}
- else
- {
- iMap->AppendL( param );
- }
+ }
+ else
+ {
+ iMap->AppendL(aParam);
}
}
@@ -765,11 +864,21 @@
//
TBool CCPLiwMap::IsTriggerL( ) const
{
- TBool result( EFalse );
- RBuf8 buffer;
- buffer.CleanupClosePushL();
- result = GetPropertyL( KActionTrigger, buffer );
- CleanupStack::PopAndDestroy( &buffer );
+ TBool result(EFalse);
+ TInt pos( 0 );
+ const TLiwGenericParam* paramForValue = iMap->FindFirst( pos,
+ KActionTrigger );
+ if ( pos != KErrNotFound )
+ {
+ result = ETrue;
+ LIW::TVariantTypeId variantType = paramForValue->Value().TypeId();
+ if ( variantType != EVariantTypeDesC &&
+ variantType != EVariantTypeDesC8 &&
+ variantType != EVariantTypeList )
+ {
+ User::Leave( KErrBadName );
+ }
+ }
return result;
}
@@ -1177,6 +1286,46 @@
//
// ---------------------------------------------------------------------------
//
+TBool CCPLiwMap::IsTypePublisherL( const TLiwVariant& aVariant )
+ {
+ TBool result (EFalse);
+ RBuf typeBuf;
+ typeBuf.CleanupClosePushL();
+ TPtrC type( KNullDesC );
+ if( !aVariant.Get( type ) )
+ {
+ TPtrC8 type8( KNullDesC8 );
+ if( !aVariant.Get( type8 ) )
+ {
+ User::Leave( KErrBadName );
+ }
+ typeBuf.Assign( EscapeUtils::ConvertToUnicodeFromUtf8L( type8 ) );
+ }
+ else
+ {
+ typeBuf.CreateL( type );
+ }
+ if( typeBuf.Find( KCpData () ) != KErrNotFound )
+ {
+ result = EFalse;
+ }
+ else if ( typeBuf.Find( KPublisher () ) != KErrNotFound )
+ {
+ result = ETrue;
+ }
+ else
+ {
+ User::Leave( KErrArgument );
+ }
+ CleanupStack::PopAndDestroy( &typeBuf );
+ return result;
+ }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
void CCPLiwMap::CheckIdentifiersL() const
{
IsPublisherNameL();
@@ -1253,7 +1402,7 @@
if ( pos != KErrNotFound )
{
found = ETrue;
- TInt length;
+ TInt length(0);
if( paramForValue->Value().TypeId() == EVariantTypeDesC )
{
length = paramForValue->Value().AsDes().Length();
--- a/contextutility/bwins/hgcontextutilityu.def Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-EXPORTS
- ?PublishServiceIdL@CHgContextUtility@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 1 NONAME ; void CHgContextUtility::PublishServiceIdL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishMusicContextL@CHgContextUtility@@QAEXABVTTimeIntervalMicroSeconds32@@@Z @ 2 NONAME ; void CHgContextUtility::PublishMusicContextL(class TTimeIntervalMicroSeconds32 const &)
- ?PublishContactContextL@CHgContextUtility@@QAEXABV?$RPointerArray@VMVPbkStoreContact@@@@ABVTTimeIntervalMicroSeconds32@@@Z @ 3 NONAME ; void CHgContextUtility::PublishContactContextL(class RPointerArray<class MVPbkStoreContact> const &, class TTimeIntervalMicroSeconds32 const &)
- ?SplitCombinedStringL@CHgContextUtility@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 4 NONAME ; void CHgContextUtility::SplitCombinedStringL(class TDesC16 const &, class CDesC16Array &)
- ?PublishContactContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 5 NONAME ; void CHgContextUtility::PublishContactContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ??1CHgContextUtility@@UAE@XZ @ 6 NONAME ; CHgContextUtility::~CHgContextUtility(void)
- ?NewLC@CHgContextUtility@@SAPAV1@XZ @ 7 NONAME ; class CHgContextUtility * CHgContextUtility::NewLC(void)
- ?RePublishWhenFgL@CHgContextUtility@@QAEXH@Z @ 8 NONAME ; void CHgContextUtility::RePublishWhenFgL(int)
- ?PublishPhotoContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 9 NONAME ; void CHgContextUtility::PublishPhotoContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ?BuildCombinedStringL@CHgContextUtility@@SAPAVHBufC16@@ABVMDesC16Array@@@Z @ 10 NONAME ; class HBufC16 * CHgContextUtility::BuildCombinedStringL(class MDesC16Array const &)
- ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 11 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkContactLink@@ABVTTimeIntervalMicroSeconds32@@@Z @ 12 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkContactLink const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishUrlContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 13 NONAME ; void CHgContextUtility::PublishUrlContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishTvContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 14 NONAME ; void CHgContextUtility::PublishTvContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &)
- ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@@Z @ 15 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class MDesC16Array const &)
- ?AllowPublishFromBackground@CHgContextUtility@@QAEXH@Z @ 16 NONAME ; void CHgContextUtility::AllowPublishFromBackground(int)
- ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkStoreContact@@ABVTTimeIntervalMicroSeconds32@@@Z @ 17 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkStoreContact const &, class TTimeIntervalMicroSeconds32 const &)
- ?AddMusicContextInfoL@CHgContextUtility@@QAEXABVTDesC16@@0@Z @ 18 NONAME ; void CHgContextUtility::AddMusicContextInfoL(class TDesC16 const &, class TDesC16 const &)
- ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@@Z @ 19 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &)
- ?NewL@CHgContextUtility@@SAPAV1@XZ @ 20 NONAME ; class CHgContextUtility * CHgContextUtility::NewL(void)
- ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 21 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishTextContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 22 NONAME ; void CHgContextUtility::PublishTextContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@0@Z @ 23 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class TDesC16 const &)
- ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@0@Z @ 24 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &, class TDesC16 const &)
- ?PublishRadioContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 25 NONAME ; void CHgContextUtility::PublishRadioContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &)
- ?PublishPhotoContextL@CHgContextUtility@@QAEXKAAVCMdESession@@ABVTTimeIntervalMicroSeconds32@@@Z @ 26 NONAME ; void CHgContextUtility::PublishPhotoContextL(unsigned long, class CMdESession &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishContactContextL@CHgContextUtility@@QAEXABVCVPbkContactLinkArray@@ABVTTimeIntervalMicroSeconds32@@@Z @ 27 NONAME ; void CHgContextUtility::PublishContactContextL(class CVPbkContactLinkArray const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishTimeContextL@CHgContextUtility@@QAEXABVTTime@@ABVTTimeIntervalMicroSeconds32@@@Z @ 28 NONAME ; void CHgContextUtility::PublishTimeContextL(class TTime const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishContactContextL@CHgContextUtility@@QAEXABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 29 NONAME ; void CHgContextUtility::PublishContactContextL(class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &)
-
--- a/contextutility/eabi/hgcontextutilityu.def Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-EXPORTS
- _ZN17CHgContextUtility16RePublishWhenFgLEi @ 1 NONAME
- _ZN17CHgContextUtility17PublishServiceIdLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 2 NONAME
- _ZN17CHgContextUtility17PublishTvContextLERK7TDesC16S2_S2_S2_ @ 3 NONAME
- _ZN17CHgContextUtility18PublishUrlContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 4 NONAME
- _ZN17CHgContextUtility19PublishTextContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 5 NONAME
- _ZN17CHgContextUtility19PublishTimeContextLERK5TTimeRK27TTimeIntervalMicroSeconds32 @ 6 NONAME
- _ZN17CHgContextUtility20AddMusicContextInfoLERK7TDesC16S2_ @ 7 NONAME
- _ZN17CHgContextUtility20BuildCombinedStringLERK12MDesC16Array @ 8 NONAME
- _ZN17CHgContextUtility20PublishMusicContextLERK27TTimeIntervalMicroSeconds32 @ 9 NONAME
- _ZN17CHgContextUtility20PublishPhotoContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 10 NONAME
- _ZN17CHgContextUtility20PublishPhotoContextLEmR11CMdESessionRK27TTimeIntervalMicroSeconds32 @ 11 NONAME
- _ZN17CHgContextUtility20PublishRadioContextLERK7TDesC16S2_S2_S2_ @ 12 NONAME
- _ZN17CHgContextUtility20SplitCombinedStringLERK7TDesC16R12CDesC16Array @ 13 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 14 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK13RPointerArrayI17MVPbkStoreContactERK27TTimeIntervalMicroSeconds32 @ 15 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK16MVPbkContactLinkRK27TTimeIntervalMicroSeconds32 @ 16 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK17MVPbkStoreContactRK27TTimeIntervalMicroSeconds32 @ 17 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK21CVPbkContactLinkArrayRK27TTimeIntervalMicroSeconds32 @ 18 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 19 NONAME
- _ZN17CHgContextUtility26AllowPublishFromBackgroundEi @ 20 NONAME
- _ZN17CHgContextUtility4NewLEv @ 21 NONAME
- _ZN17CHgContextUtility5NewLCEv @ 22 NONAME
- _ZN17CHgContextUtilityD0Ev @ 23 NONAME
- _ZN17CHgContextUtilityD1Ev @ 24 NONAME
- _ZN17CHgContextUtilityD2Ev @ 25 NONAME
- _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16 @ 26 NONAME
- _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16S2_ @ 27 NONAME
- _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16RK12MDesC16Array @ 28 NONAME
- _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16S2_ @ 29 NONAME
- _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16RK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 30 NONAME
- _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 31 NONAME
- _ZTI21CHgContextUtilityBase @ 32 NONAME
- _ZTV21CHgContextUtilityBase @ 33 NONAME
-
--- a/contextutility/group/bld.inf Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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: Build info file for Context publishing helper DLL.
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_EXPORTS
-../rom/hgcontextutility.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hgcontextutility.iby)
-
-
-PRJ_MMPFILES
-hgcontextutility.mmp
-
-PRJ_TESTMMPFILES
-
-
--- a/contextutility/group/hgcontextutility.mmp Mon Mar 15 12:41:53 2010 +0200
+++ /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: Context publishing helper dll
-*
-*/
-
-
-#include <platform_paths.hrh>
-#include <defaultcaps.hrh>
-
-TARGETTYPE DLL
-TARGET hgcontextutility.dll
-UID 0x1000008d
-CAPABILITY CAP_GENERAL_DLL
-
-SOURCEPATH ../src
-SOURCE hgcontextutilitybase.cpp
-SOURCE hgcontextutility.cpp
-SOURCE hgcontextutilityimpl.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../inc
-
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY estor.lib
-LIBRARY bafl.lib
-LIBRARY cfclient.lib
-LIBRARY cfservices.lib
-LIBRARY cone.lib
-LIBRARY ws32.lib
-LIBRARY mdeclient.lib
-LIBRARY vpbkeng.lib
-
--- a/contextutility/inc/hgcontexttypes.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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: CFW source and type names
-*
-*/
-
-#ifndef HGCONTEXTTYPES_H
-#define HGCONTEXTTYPES_H
-
-#include <e32base.h>
-#include <hg/hgcontextdef.h> // pull in the public part
-
-_LIT( KHgCFTypeFgApp, "FgApp" ); // published by fswserver
-
-_LIT( KHgCFTypeUpdateAvail, "UpdateAvail" ); // for iad source plug-in
-
-_LIT( KHgCFTypeMdsObjChanged, "MdsObjChanged" );
-_LIT( KHgCFTypeMdsRelChanged, "MdsRelChanged" );
-
-_LIT( KHgCFValueDuplicateMarker, "<dupl>" ); // may be used in PbkContactMulti
-
-const TInt KHgCFValueLinkMarker = 2; // prefix when Contact holds a vpbk contact link
-
-_LIT( KHgCFTypeCallState, "CallState" );
-_LIT( KHgCFTypeCallSusp, "CallSusp" ); // see hgcfcallsourceplugin
-_LIT( KHgCFTypeContactFromCall, "ContactFromCall" ); // contains "1" if contact is coming from a voice/video call
-
-#endif // HGCONTEXTTYPES_H
--- a/contextutility/inc/hgcontextutilityimpl.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,434 +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: Context publishing helper dll
-*
-*/
-
-
-#ifndef HGCONTEXTUTILITYIMPL_H
-#define HGCONTEXTUTILITYIMPL_H
-
-#include <e32base.h>
-#include <cflistener.h>
-#include <bamdesca.h>
-#include <badesca.h>
-#include <mdccommon.h>
-#include <coemain.h>
-#include <e32hashtab.h>
-
-class CCFClient;
-class MVPbkContactLink;
-class MVPbkStoreContact;
-class CVPbkContactLinkArray;
-class CMdESession;
-
-/**
- * Utility class offering static and non-static functions for
- * publishing and accessing context through the Context Framework.
- */
-NONSHARABLE_CLASS( CHgContextUtilityImpl ) :
- public CTimer,
- public MCFListener,
- public MCoeForegroundObserver
- {
-public:
- static CHgContextUtilityImpl* NewL();
- static CHgContextUtilityImpl* NewLC();
- virtual ~CHgContextUtilityImpl();
-
- /**
- * Publishes context.
- * Also defines the context if it has not been defined.
- * Publishing empty value is not allowed, however such errors are ignored
- * here so the function will not leave when CFW responds with KErrArgument.
- * The security policy for the context will be set to require
- * LocalServices capability.
- * @param aContextType context type, source is always KHgCFSource
- * @param aContextData value for the context
- */
- void PublishContextL( const TDesC& aContextType,
- const TDesC& aContextData );
-
- /**
- * Publishes context, the value will contain all the strings
- * from the given array, typically by using some separator character.
- * @see PublishContextL
- * @param aContextType context type, source is always KHgCFSource
- * @param aContextData value for the context will be a combined
- * version of all the strings from this array
- */
- void PublishContextL( const TDesC& aContextType,
- const MDesCArray& aContextData );
-
- /**
- * Static version that uses the given CCFClient instance.
- * @param aCFClient a CCFClient instance
- * @param aContextType context type, source is always KHgCFSource
- * @param aContextData value for the context
- */
- static void PublishContextL( CCFClient& aCFClient,
- const TDesC& aContextType, const TDesC& aContextData );
-
- /**
- * Publishes context but only after a short interval, using a timer.
- * If it is called again before the timer expires then the timer
- * is restarted (and so the previous pending value is never published).
- * @param aContextType context type, source is always KHgCFSource
- * @param aContextData value for the context
- * @param aDelay delay for the timer
- */
- void PublishContextDelayedL( const TDesC& aContextType,
- const TDesC& aContextData, TTimeIntervalMicroSeconds32 aDelay );
-
- /**
- * Overload for delayed publishing of a value combined from multiple strings.
- * @param aContextType context type
- * @param aContextData string array
- * @param aDelay delay for the timer, in microseconds
- */
- void PublishContextDelayedL( const TDesC& aContextType,
- const MDesCArray& aContextData, TTimeIntervalMicroSeconds32 aDelay );
-
- /**
- * Requests the given context and returns the value for the
- * first result. Returns NULL if not found.
- * @param aContextType context type, the source is always KHgCFSource
- */
- HBufC* GetContextL( const TDesC& aContextType );
-
- /**
- * Requests the given context and returns the value for the
- * first result. Returns NULL if not found.
- * @param aContextSource context source
- * @param aContextType context type
- */
- HBufC* GetContextL( const TDesC& aContextSource,
- const TDesC& aContextType );
-
- /**
- * Creates a combined string from the elements of the given array.
- * Returns NULL if the array has less than 2 elements.
- * @param aArray string array
- * @return combined string or NULL, ownership transferred to caller
- */
- static HBufC* BuildCombinedStringL( const MDesCArray& aArray );
-
- /**
- * Splits the given combined string and appends the components to
- * the given array. The initial content of the array is not modified.
- * If aString does not seem to be a string combined from multiple entries
- * then aString is appended to aArray without any changes.
- * @param aString combined string, input
- * @param aArray array, output
- */
- static void SplitCombinedStringL( const TDesC& aString,
- CDesCArray& aArray );
-
- /**
- * Gets a string that can be published straight via PublishContextL.
- * The pointer is left on the cleanup stack.
- * Returned & pushed pointer may also be NULL is something goes wrong.
- */
- HBufC* MakeLinkPublishableLC( const MVPbkContactLink& aLink );
-
- /**
- * Publishes contact context.
- * @param aContact contact
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishContactContextL( const MVPbkStoreContact& aContact,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Publishes contact context.
- * This may include async operations and therefore the actual publishing may happen
- * only after this function returns.
- * @param aContactLink contact link
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishContactContextL( const MVPbkContactLink& aContactLink,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Publishes contact context.
- * Attempts to publish an empty value will be ignored.
- *
- * Prefer using the overloads taking vpbk contact or link, whenever possible.
- * Use this in case of unknown contacts only, that is, a name, phone number,
- * or email address that does not belong to a phonebook contact.
- *
- * @param aContactName formatted name, phone number, or email address,
- * or a combination of them, e.g. "firstname lastname", "+12345678",
- * "lastname firstname <abcd@efg.com>", "firstname, lastname <0501234567>".
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishContactContextL( const TDesC& aContactName,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Overload for publishing multiple contacts.
- * @param aContacts contact array
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishContactContextL(
- const RPointerArray<MVPbkStoreContact>& aContacts,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Overload for publishing multiple contacts.
- * This may include async operations and therefore the actual publishing may happen
- * only after this function returns.
- * @param aContactLinks contact link array
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishContactContextL(
- const CVPbkContactLinkArray& aContactLinks,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Overload for publishing multiple contacts.
- * @param aContactNames string array, for element format
- * see PublishContactContextL(const TDesC&)
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishContactContextL( const MDesCArray& aContactNames,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Publishes freetext context.
- * Not to be used for bulk text (e.g. full content of some text viewer component).
- * @param aText some text, typically the highlighted substring
- * from a viewer or editor control
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishTextContextL( const TDesC& aText,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Publishes URL context.
- * @param aUrl URL
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishUrlContextL( const TDesC& aUrl,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Publishes date/time context.
- * @param aTime time
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishTimeContextL( const TTime& aTime,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Publishes photo context.
- * @param aFilename name of image file, with full path
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishPhotoContextL( const TDesC& aFilename,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Publishes photo context.
- * @param aMdeItemId item id for the Image object in MDS
- * @param aMdeSession opened metadata engine session
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishPhotoContextL( TItemId aMdeItemId,
- CMdESession& aMdeSession,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Publishes TV context.
- * Pass KNullDesC if some of the needed data is not available.
- * @param aChannelName channel name
- * @param aProgramName program name
- * @param aProgramDescription program description
- * @param aGenre genre
- */
- void PublishTvContextL( const TDesC& aChannelName,
- const TDesC& aProgramName, const TDesC& aProgramDescription,
- const TDesC& aGenre );
-
- /**
- * Publishes an account id as contact context.
- *
- * @param aServiceId the service prefix, e.g. "Ovi"
- * @param aAccountId the account id
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- void PublishServiceIdL( const TDesC& aServiceId,
- const TDesC& aAccountId,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Enables or disables automatic re-publishing of the latest
- * context (published via this context utility instance) whenever
- * the application comes to foreground.
- *
- * It is DISABLED by default.
- *
- * By enabling this the applications do not have to care about
- * context publishing in HandleForegroundEventL etc.
- *
- * The feature needs CCoeEnv and calls will be ignored if the
- * environment is not available.
- *
- * @param aEnable flag to turn the feature on/off
- */
- void RePublishWhenFgL( TBool aEnable );
-
- /**
- * Enables or disables context publishing when being in background.
- * Applies to all PublishContextL variants.
- * If disabled then no context will be published if it seems that the
- * caller application is not in foreground.
- * Has no effect if there is no CCoeEnv available, publishing is always
- * allowed in that case.
- *
- * It is DISABLED by default, that is, publishing is not allowed
- * from applications that are not in foreground.
- *
- * @param aAllow flag to turn the feature on/off
- */
- void AllowPublishFromBackground( TBool aAllow );
-
- /**
- * @see CHgContextUtility::AddMusicContextInfo
- */
- void AddMusicContextInfoL( const TDesC& aKey, const TDesC& aData );
-
- /**
- * @see CHgContextUtility::AddMusicContextInfo
- */
- void PublishMusicContextL(
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * @see CHgContextUtility::PublishRadioContextL
- */
- void PublishRadioContextL(
- const TDesC& aRadioName,
- const TDesC& aRadioUrl,
- const TDesC& aRadioFrequency,
- const TDesC& aRadioRDSPI );
-
-private: // from MCFListener
- void ContextIndicationL( const CCFContextIndication& aChangedContext );
- void ActionIndicationL( const CCFActionIndication& aActionToExecute );
- void HandleContextFrameworkError( TCFError aError,
- const TDesC& aSource, const TDesC& aType );
- TAny* Extension( const TUid& aExtensionUid ) const;
-
-private: // from MCoeForegroundObserver
- void HandleGainingForeground();
- void HandleLosingForeground();
-
-private: // from CTimer
- void RunL();
- TInt RunError( TInt aError );
-
-private:
- /**
- * Constructor.
- */
- CHgContextUtilityImpl();
-
- /**
- * 2nd phase constructor.
- */
- void ConstructL();
-
- /**
- * Creates CCFClient instance if not yet done.
- * Does not leave if creation fails.
- * Returns ETrue if iCFClient is usable.
- */
- TBool CFReady();
-
- /**
- * Returns ETrue if the root window's wgid is same as
- * the focused window group's wgid.
- * Always returns ETrue if CCoeEnv is not available.
- */
- TBool IsForeground();
-
- /**
- * Returns ETrue if publishing context is allowed at the moment.
- * Uses IsForeground and the allow-publish-from-background setting.
- */
- TBool AllowedToPublish();
-
- /**
- * Makes sure the specific key contains valid data and publishes it.
- *
- * @param aKey Key to be checked and published.
- * @param aDelay Delay for publishing the context data.
- */
- void VerifyAndPublishMusicContextL(
- const TDesC& aKey,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Simple wrapper to handle between delayed and instant publish.
- * @see PublishContextL
- * @see PublishContextDelayedL
- */
- void PublishContextL(
- const TDesC& aContextType,
- const TDesC& aContextData,
- const TTimeIntervalMicroSeconds32& aDelay );
-
- CCFClient* iCFClient;
- HBufC* iPendingContextType;
- HBufC* iPendingContextData;
- CDesCArray* iPendingContextDataArray;
-
- HBufC* iLastContextType;
- HBufC* iLastContextData;
- TBool iFgWatchEnabled;
- CCoeEnv* iEnv; // not own
- TBool iAllowPublishFromBackground;
-
- /**
- * List of parameters to be published. Owns pointers.
- */
- RPtrHashMap<TDesC, TDesC> iMusicContextInfo;
- };
-
-#endif /* HGCONTEXTUTILITYIMPL_H */
--- a/contextutility/inc/hgctxutilslogging.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Logging utils
-*
-*/
-
-
-#ifdef _DEBUG
-_LIT( KHgLogFile, "hgctxutils.txt" );
-_LIT( KHgLogPath, "teleport" );
-#define _HGLOG_LOG_COMPONENT_ID 0x1000008d
-
-#endif
-#include "hglogging.h"
--- a/contextutility/inc/hglogging.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +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: Logging utils
-*
-*/
-
-
-#ifndef HGLOGLOGUTILS_H
-#define HGLOGLOGUTILS_H
-
-/**
- * @file
- *
- * TAKING LOGGING INTO USE:
- *
- * This step is needed to do once per component.
- *
- * For each component that uses these common logging macros should specify
- * their own logging configuration file, which includes this file. In that
- * configuration file, following constants and macros must be defined.
- * For example:
- * @code
- *
- * _LIT( KHgLogFile, "text_file_for_logging.txt" );
- * _LIT( KHgLogPath, "folder_for_text_file" );
- * #define _HGLOG_LOG_COMPONENT_ID <some unique number here>
- *
- * #include "hglogging.h"
- *
- * @/code
- *
- * KHgLogFile : This is the name of the file, where all the logs for
- * this components are being written.
- *
- * KHgLogPath : This is the folder name under c:\logs, where the file
- * is to be stored. For example, if KHgLogPath is "test",
- * log file is created into folder c:\logs\test.
- *
- * _HGLOG_LOG_COMPONENT_ID : Unique number id of the component. This is
- * for filtering purposes.
- *
- * _HGLOG_RDEBUG : When defined tracing instead of file logging.
- * Default is for file logging.
- *
- * --------------------------------------------------------------------------
- *
- * USING LOGGING:
- *
- * Basically the use is simple, register function use with HGLOG_CONTEXT,
- * then log function enter by any HGLOG_IN -macro, then possibly use HGLOG
- * -macros for function logging and finally HGLOG_OUT -macros for returning
- * from the function.
- *
- * @code
- * TInt CGood::Example( TInt aSomething )
- * {
- * // Create log context class, which is maintained for lifetime of the
- * // method.
- * HGLOG_CONTEXT( Example, HGLOG_LOCAL );
- *
- * // Indicate we are entering the function.
- * HGLOG_IN1( "aSomething contains value %d", aSomething );
- *
- * // Your buggy code...
- *
- * // Before leaving, indicate function execution has ended.
- * HGLOG_OUT();
- *
- * return 0;
- * }
- * @/code
- */
-
-#include <e32def.h>
-#include <e32std.h>
-
-#include "hglogutils.h"
-
-#define HGLOG_API 0
-#define HGLOG_LOCAL 1
-
-#define HGLOG_INFO 0
-#define HGLOG_WARNING 1
-#define HGLOG_ERROR 2
-
-#define HGLOG_ASSERT(_assertion) __HGLOG_ASSERT_DBG(_assertion)
-#define HGLOG_TRACE_ASSERT(_assertion) __ASSERT_DEBUG((_assertion), User::Invariant() )
-
-#ifdef _DEBUG
-
-/*****************************************************************************
- LOGGING MACROS - LOGGING ON
-*****************************************************************************/
-
- /**
- * Context initialization
- * NOTE: HGLOG_STATIC_CONTEXT is meant for static methods.
- *
- * @param _fn Name of the function.
- * @param _vis Visibility for the client, use values HGLOG_API or HGLOG_LOCAL
- * @param _thdId For static functions, thread id can be given here.
- */
- #define HGLOG_CONTEXT(_fn, _vis ) _THgLogContext _dc((TText*)L ## #_fn, _HGLOG_LOG_COMPONENT_ID, _vis, (TUint)this, RProcess().SecureId().iId )
- #define HGLOG_STATIC_CONTEXT(_fn, _vis, _thdId) _THgLogContext _dc((TText*)L ## #_fn, _HGLOG_LOG_COMPONENT_ID, _vis, _thdId, RProcess().SecureId().iId )
-
- /**
- * Entering function
- *
- * @param string Custom text. Example: HGLOG_IN0( "Yeah!!!" );
- * @param p1 - p5 For multiple variables in same string.
- */
- #define HGLOG_IN() do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s "), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_ENTRY(); } while(0)
- #define HGLOG0_IN(string) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_ENTRY(); } while(0)
- #define HGLOG1_IN(string, p1) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); _MARK_ENTRY(); } while(0)
- #define HGLOG2_IN(string, p1, p2) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); _MARK_ENTRY(); } while(0)
- #define HGLOG3_IN(string, p1, p2, p3) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); _MARK_ENTRY(); } while(0)
- #define HGLOG4_IN(string, p1, p2, p3, p4) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); _MARK_ENTRY(); } while(0)
- #define HGLOG5_IN(string, p1, p2, p3, p4, p5) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); _MARK_ENTRY(); } while(0)
-
- /** Leaving function */
- #define HGLOG_OUT() do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s "), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_EXIT(); } while(0)
- #define HGLOG0_OUT(string) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_EXIT(); } while(0)
- #define HGLOG1_OUT(string, p1) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); _MARK_EXIT(); } while(0)
- #define HGLOG2_OUT(string, p1, p2) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); _MARK_EXIT(); } while(0)
- #define HGLOG3_OUT(string, p1, p2, p3) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); _MARK_EXIT(); } while(0)
- #define HGLOG4_OUT(string, p1, p2, p3, p4) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); _MARK_EXIT(); } while(0)
- #define HGLOG5_OUT(string, p1, p2, p3, p4, p5) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); _MARK_EXIT(); } while(0)
-
- /** Leaving function with return value */
- #define HGLOG0_RET(val, fmtstr) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val); _MARK_EXIT(); } while(0); return val;} while(0)
- #define HGLOG1_RET(val, fmtstr, p1) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1); _MARK_EXIT(); } while(0); return val;} while(0)
- #define HGLOG2_RET(val, fmtstr, p1, p2) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2); _MARK_EXIT(); } while(0); return val;} while(0)
- #define HGLOG3_RET(val, fmtstr, p1, p2, p3) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3); _MARK_EXIT(); } while(0); return val;} while(0)
- #define HGLOG4_RET(val, fmtstr, p1, p2, p3, p4) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3, p4); _MARK_EXIT(); } while(0); return val;} while(0)
- #define HGLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3, p4, p5); _MARK_EXIT(); } while(0); return val;} while(0)
-
- /**
- * General log lines
- *
- * @param level This can be used as internal information
- * field, such as info, error, warning etc.
- * @param string Custom string
- * @param p1 - p5 For multiple variables in same string.
- */
- #define HGLOG0(level, string) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); } while(0)
- #define HGLOG1(level, string, p1) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); } while(0)
- #define HGLOG2(level, string, p1, p2) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); } while(0)
- #define HGLOG3(level, string, p1, p2, p3) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); } while(0)
- #define HGLOG4(level, string, p1, p2, p3, p4) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); } while(0)
- #define HGLOG5(level, string, p1, p2, p3, p4, p5) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); } while(0)
-
- /** Error logging */
- #define __HGLOG_ASSERT_DBG( _assertion ) do { if( _assertion ) { break; } TFileName file; file.Copy( _L8( __FILE__ ) ); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s Assert:%S:%d:" L ## #_assertion) , _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, &file, __LINE__ ); User::Invariant(); } while( 0 )
- #define __HGLOG_TRACE_ASSERT_DBG(_assertion, _textToPrint, _panicCode) do { if (_assertion) { break; } _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s ASSERTION FAILED!!! %s file: %s, line: %s"), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, _textToPrint, __FILE__, __LINE__); User::Panic(_L("AssertionFailed"), _panicCode} while(0)
- #define HGLOG_TRAPHANDLER() _THgLogTrapHandler _traceTrapHandler; _traceTrapHandler.oldHandler = User::SetTrapHandler(&_traceTrapHandler)
-
-/*****************************************************************************
- LOGGING MACROS - NO LOGGING
-*****************************************************************************/
-#else // _DEBUG
-
- #define HGLOG_CONTEXT(_fn, _vis )
- #define HGLOG_STATIC_CONTEXT(_fn, _vis, _thdId)
-
- #define HGLOG_IN()
- #define HGLOG0_IN(string)
- #define HGLOG1_IN(string, p1)
- #define HGLOG2_IN(string, p1, p2)
- #define HGLOG3_IN(string, p1, p2, p3)
- #define HGLOG4_IN(string, p1, p2, p3, p4)
- #define HGLOG5_IN(string, p1, p2, p3, p4, p5)
-
- #define HGLOG_OUT()
- #define HGLOG0_OUT(string)
- #define HGLOG1_OUT(string, p1)
- #define HGLOG2_OUT(string, p1, p2)
- #define HGLOG3_OUT(string, p1, p2, p3)
- #define HGLOG4_OUT(string, p1, p2, p3, p4)
- #define HGLOG5_OUT(string, p1, p2, p3, p4, p5)
-
- #define HGLOG0_RET(val, fmtstr) return val
- #define HGLOG1_RET(val, fmtstr, p1) return val
- #define HGLOG2_RET(val, fmtstr, p1, p2) return val
- #define HGLOG3_RET(val, fmtstr, p1, p2, p3) return val
- #define HGLOG4_RET(val, fmtstr, p1, p2, p3, p4) return val
- #define HGLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) return val
-
- #define HGLOG0(level, string)
- #define HGLOG1(level, string, p1)
- #define HGLOG2(level, string, p1, p2)
- #define HGLOG3(level, string, p1, p2, p3)
- #define HGLOG4(level, string, p1, p2, p3, p4)
- #define HGLOG5(level, string, p1, p2, p3, p4, p5)
-
- #define BIND_TRACE_TRAPHANDLER()
- #define TRACE_DECL() TInt _iTraceThreadId
- #define TRACE_FAST_CREATE(_thdId) _thdId++;
- #define TRACE_CREATE()
-
- #define __HGLOG_ASSERT_DBG(_assertion)
- #define __TRACE_ASSERT_DBG(_assertion, _message, _panicCode )
-
-#endif // _DEBUG
-
-#endif // HGLOGLOGUTILS_H
-
-// End of File
--- a/contextutility/inc/hglogutils.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +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: Logging utils
-*
-*/
-
-
-#ifndef HGLOGUTILS_H
-#define HGLOGUTILS_H
-
-/**
- * NOTE: This file contains the logic related to logging. Change only if you
- * know what you're doing.
- */
-
-
-
-
-
-
-
-
-
-
-#ifdef _DEBUG
-
-#include <e32debug.h>
-#include <e32std.h>
-
-static const TUint HGLOGERR = 2; /**< Used to create an error message */
-
-// These macros are real macros, that should be used. For temporary purposes, these
-// are left out and the logging is done by simple entry logging
-#define _HGLOG_UNCONTROLLED_INPUT_MSG L"%s%d[%x:%x:%x]>%s UNCONTROLLED ENTRY!"
-#define _HGLOG_MULTIPLE_ENTRY_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL ENTRY!"
-#define _HGLOG_UNCONTROLLER_EXIT_MSG L"%s%d[%x:%x:%x]<%s UNCONTROLLED EXIT!"
-#define _HGLOG_MULTIPLE_EXIT_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL EXIT!"
-#define _HGLOG_TRAP_HARNESS_ENTRY L"_D%d[%x:%x:%x]TraceFramework: Entering trap harness"
-#define _HGLOG_TRAP_HARNESS_EXIT L"_D%d[%x:%x:%x]TraceFramework: Exiting trap harness"
-#define _HGLOG_TRAP_HARNESS_LEAVE L"_D%d[%x:%x:%x]TraceFramework: ---------- LEAVE OCCURRED !!! ---------- "
-#define _HGLOG_API_PREFIX L"_A"
-#define _HGLOG_LOCAL_PREFIX L"_L"
-
-/**
-* @file
-* trace_utils.h contains definitions needed for advanced tracing features.
-* Tracing can be customized using the following compile time flags:
-* - <b>_DEBUG</b>
-* - With this flag undefined, all traces are disabled
-* - <b>__KERNEL_MODE__</b>
-* - if kernel mode flag is defined, kernel macro variants are used (no unicode or shared heap related stuff, faster)
-* - <b>DISABLE_SYNTAX_CHECK</b>
-* - If this flag is defined, runtime syntax checking features are disabled from traces
-*/
-#ifndef DISABLE_SYNTAX_CHECK
- #define _MARK_ENTRY() _dc.inOk=ETrue
- #define _DOINCHK() _dc.DoInChk()
- #define _CHK_MULTIIN() _dc.ChkMultiIn()
- #define _CHK_MULTIOUT() _dc.ChkMultiOut()
- #define _MARK_EXIT() _dc.outOk=ETrue
-#else
- #define _MARK_ENTRY()
- #define _DOINCHK()
- #define _CHK_MULTIIN()
- #define _CHK_MULTIOUT()
- #define _MARK_EXIT()
-#endif // DISABLE_SYNTAX_CHECK
-
-/** For tracing */
-#ifdef _HGLOG_RDEBUG
- #define _IT(a) (TPtrC((const TText *)(a)))
- #define _HGLOGPRINTER RDebug::Print
-
-/** For filedebug */
-#else // _HGLOG_RDEBUG
-
- /** Includes */
- #include <e32base.h>
- #include <e32std.h>
- #include <e32def.h>
- #include <e32svr.h>
-
-// both of headers defines KLogBufferSize
-#ifndef __COMMSDEBUGUTILITY_H__
- #include <flogger.h>
-#endif
-
- #define _IT(a) KHgLogPath, KHgLogFile, EFileLoggingModeAppend, (TPtrC((const TText *)(a)))
- #define _HGLOGPRINTER RFileLogger::WriteFormat
-#endif // _HGLOG_RDEBUG
-
-class _THgLogContext
- {
- public:
- _THgLogContext(
- const TText* _fn,
- const TUint _id,
- const TUint _vis,
- const TUint _addr,
- const TUint _thdId,
- const TUint _category=0 )
- :
- iFn(_fn),
- iId(_id),
- iApi((TBool)_vis),
- iAddr(_addr),
- iThdId(_thdId),
- iVis((_vis == 0 ? (TText*)_HGLOG_API_PREFIX : (TText*)_HGLOG_LOCAL_PREFIX)),
- iCategory(_category)
- #ifndef DISABLE_SYNTAX_CHECK
- ,outOk(EFalse), inOk(EFalse)
- #endif
- {
- }
- ~_THgLogContext()
- {
- #ifndef DISABLE_SYNTAX_CHECK
- do
- {
- DoInChk();
- if (!outOk)
- {
- _HGLOGPRINTER(_IT(_HGLOG_UNCONTROLLER_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn);
- }
- } while (0);
- #endif // DISABLE_SYNTAX_CHECK
- }
-
- const TText* iFn;
- const TUint iId;
- const TText* iVis;
- const TUint iAddr;
- const TInt iThdId;
- const TBool iApi;
- const TUint iCategory;
-
- #ifndef DISABLE_SYNTAX_CHECK
- inline void DoInChk()
- {
- if (!inOk)
- {
- _HGLOGPRINTER(_IT(_HGLOG_UNCONTROLLED_INPUT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn);
- inOk = ETrue;
- }
- }
-
- inline void ChkMultiIn()
- {
- if (inOk)
- {
- _HGLOGPRINTER(_IT(_HGLOG_MULTIPLE_ENTRY_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn);
- }
- }
-
- inline void ChkMultiOut()
- {
- if (outOk)
- {
- _HGLOGPRINTER(_IT(_HGLOG_MULTIPLE_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn);
- }
- }
-
- TBool inOk;
- TBool outOk;
- #endif // DISABLE_SYNTAX_CHECK
- };
-
-class _THgLogTrapHandler: public TTrapHandler
- {
- public:
-
- _THgLogTrapHandler(_THgLogContext& _context) : _dc( _context )
- {
- RThread me;
- iThdId = (TInt)me.Id();
- }
- void Trap()
- {
- _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_ENTRY), 0, HGLOGERR, iThdId, this);
- oldHandler->Trap();
- }
- void UnTrap()
- {
- _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_EXIT), 0, HGLOGERR, iThdId, this);
- oldHandler->UnTrap();
- }
- void Leave(TInt aValue)
- {
- _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_LEAVE), 0, HGLOGERR, iThdId, this);
- oldHandler->Leave(aValue);
- }
- TTrapHandler* oldHandler;
- private:
- _THgLogContext& _dc;
- TInt iThdId;
- };
-
-#endif // _DEBUG
-
-#endif // HGLOGUTILS_H
\ No newline at end of file
--- a/contextutility/rom/hgcontextutility.iby Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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: Iby file
-*
-*/
-
-
-#ifndef HGCONTEXTUTILITY_IBY
-#define HGCONTEXTUTILITY_IBY
-
-#include <data_caging_paths_for_iby.hrh>
-
-file=ABI_DIR\BUILD_DIR\hgcontextutility.dll SHARED_LIB_DIR\hgcontextutility.dll
-
-#endif // HGCONTEXTUTILITY_IBY
--- a/contextutility/src/hgcontextutility.cpp Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,281 +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: Context publishing helper dll
-*
-*/
-
-
-#include <hg/hgcontextutility.h>
-#include "hgcontextutilityimpl.h"
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::NewL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CHgContextUtility* CHgContextUtility::NewL()
- {
- CHgContextUtility* self = NewLC();
- CleanupStack::Pop( self );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::NewLC
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CHgContextUtility* CHgContextUtility::NewLC()
- {
- CHgContextUtility* self = new ( ELeave ) CHgContextUtility;
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::CHgContextUtility
-// -----------------------------------------------------------------------------
-//
-CHgContextUtility::CHgContextUtility()
- {
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::ConstructL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtility::ConstructL()
- {
- BaseConstructL();
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::~CHgContextUtility
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CHgContextUtility::~CHgContextUtility()
- {
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishContactContextL(
- const MVPbkStoreContact& aContact,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishContactContextL( aContact, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishContactContextL(
- const MVPbkContactLink& aContactLink,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishContactContextL( aContactLink, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishContactContextL(
- const TDesC& aContactName,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishContactContextL( aContactName, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishContactContextL(
- const RPointerArray<MVPbkStoreContact>& aContacts,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishContactContextL( aContacts, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishContactContextL(
- const CVPbkContactLinkArray& aContactLinks,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishContactContextL( aContactLinks, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishContactContextL(
- const MDesCArray& aContactNames,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishContactContextL( aContactNames, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishTextContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishTextContextL( const TDesC& aText,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishTextContextL( aText, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishUrlContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishUrlContextL( const TDesC& aUrl,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishUrlContextL( aUrl, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishTimeContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishTimeContextL( const TTime& aTime,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishTimeContextL( aTime, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishPhotoContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishPhotoContextL(
- const TDesC& aFilename,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishPhotoContextL( aFilename, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishPhotoContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishPhotoContextL(
- TItemId aMdeItemId,
- CMdESession& aMdeSession,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishPhotoContextL( aMdeItemId, aMdeSession, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishTvContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishTvContextL( const TDesC& aChannelName,
- const TDesC& aProgramName, const TDesC& aProgramDescription,
- const TDesC& aGenre )
- {
- iImpl->PublishTvContextL( aChannelName, aProgramName,
- aProgramDescription, aGenre );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishServiceIdL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishServiceIdL( const TDesC& aServiceId,
- const TDesC& aAccountId,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishServiceIdL( aServiceId, aAccountId, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::RePublishWhenFgL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::RePublishWhenFgL( TBool aEnable )
- {
- iImpl->RePublishWhenFgL( aEnable );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::AllowPublishFromBackground
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::AllowPublishFromBackground( TBool aAllow )
- {
- iImpl->AllowPublishFromBackground( aAllow );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::AddMusicContextInfoL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::AddMusicContextInfoL(
- const TDesC& aKey, const TDesC& aData )
- {
- iImpl->AddMusicContextInfoL( aKey, aData );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishMusicContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishMusicContextL(
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishMusicContextL( aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::PublishRadioContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtility::PublishRadioContextL(
- const TDesC& aRadioName,
- const TDesC& aRadioUrl,
- const TDesC& aRadioFrequency,
- const TDesC& aRadioRDSPI )
- {
- iImpl->PublishRadioContextL( aRadioName, aRadioUrl,
- aRadioFrequency, aRadioRDSPI );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::BuildCombinedStringL
-// -----------------------------------------------------------------------------
-EXPORT_C HBufC* CHgContextUtility::BuildCombinedStringL( const MDesCArray& aArray )
-{
- return CHgContextUtilityImpl::BuildCombinedStringL(aArray);
-}
-
-// -----------------------------------------------------------------------------
-// CHgContextUtility::SplitCombinedStringL
-// -----------------------------------------------------------------------------
-EXPORT_C void CHgContextUtility::SplitCombinedStringL( const TDesC& aString,
- CDesCArray& aArray )
-{
- CHgContextUtilityImpl::SplitCombinedStringL(aString, aArray);
-}
-//
-// end of file
--- a/contextutility/src/hgcontextutilitybase.cpp Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +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: Context publishing helper dll
-*
-*/
-
-
-#include <hg/hgcontextutilitybase.h>
-#include "hgcontextutilityimpl.h"
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityBase::CHgContextUtilityBase
-// -----------------------------------------------------------------------------
-//
-CHgContextUtilityBase::CHgContextUtilityBase()
- {
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityBase::BaseConstructL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityBase::BaseConstructL()
- {
- iImpl = CHgContextUtilityImpl::NewL();
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityBase::~CHgContextUtilityBase
-// -----------------------------------------------------------------------------
-//
-CHgContextUtilityBase::~CHgContextUtilityBase()
- {
- delete iImpl;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityBase::PublishContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtilityBase::PublishContextL( const TDesC& aContextType,
- const TDesC& aContextData )
- {
- iImpl->PublishContextL( aContextType, aContextData );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityBase::PublishContextL
-// Array version
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtilityBase::PublishContextL( const TDesC& aContextType,
- const MDesCArray& aContextData )
- {
- iImpl->PublishContextL( aContextType, aContextData );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityBase::GetContextL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C HBufC* CHgContextUtilityBase::GetContextL( const TDesC& aContextSource,
- const TDesC& aContextType )
- {
- return iImpl->GetContextL( aContextSource, aContextType );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityBase::GetContextL
-// Version using a fixed context source
-// -----------------------------------------------------------------------------
-//
-EXPORT_C HBufC* CHgContextUtilityBase::GetContextL( const TDesC& aContextType )
- {
- return iImpl->GetContextL( aContextType );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityBase::PublishContextDelayedL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtilityBase::PublishContextDelayedL(
- const TDesC& aContextType,
- const TDesC& aContextData,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishContextDelayedL( aContextType, aContextData, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityBase::PublishContextDelayedL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CHgContextUtilityBase::PublishContextDelayedL(
- const TDesC& aContextType,
- const MDesCArray& aContextData,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- iImpl->PublishContextDelayedL( aContextType, aContextData, aDelay );
- }
-
-
-// end of file
--- a/contextutility/src/hgcontextutilityimpl.cpp Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,972 +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: Context publishing helper dll
-*
-*/
-
-
-#include <cfcontextobject.h>
-#include <cfclient.h>
-#include <mdesession.h>
-#include <mdeobject.h>
-#include <s32mem.h>
-#include <MVPbkContactLink.h>
-#include <MVPbkStoreContact.h>
-#include <MVPbkStreamable.h>
-#include <CVPbkContactLinkArray.h>
-#include <e32debug.h>
-#include <w32std.h>
-#include "hgcontextutilityimpl.h"
-#include "hgcontexttypes.h"
-
-// max number of entries processed when aContextData is an array in PublishContextL
-const TInt KMaxEntriesInMulti = 20;
-
-// separator character in combined string for multiple entries
-const TInt KMultiSepChar = 0x0001;
-
-// granularity for string array
-const TInt KArrayGranularity = 4;
-
-// argument for CBufFlat ctor when serializing contact links
-const TInt KBufGranularity = 64;
-
-// default security policy (use LocalServices cap) for contexts
-_LIT_SECURITY_POLICY_C1( KContextSecurity, ECapabilityLocalServices );
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::NewL
-// -----------------------------------------------------------------------------
-//
-CHgContextUtilityImpl* CHgContextUtilityImpl::NewL()
- {
- CHgContextUtilityImpl* self = NewLC();
- CleanupStack::Pop( self );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::NewLC
-// -----------------------------------------------------------------------------
-//
-CHgContextUtilityImpl* CHgContextUtilityImpl::NewLC()
- {
- CHgContextUtilityImpl* self = new ( ELeave ) CHgContextUtilityImpl;
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::CHgContextUtilityImpl
-// -----------------------------------------------------------------------------
-//
-CHgContextUtilityImpl::CHgContextUtilityImpl()
- : CTimer( CActive::EPriorityStandard )
- {
- CActiveScheduler::Add( this );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::ConstructL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::ConstructL()
- {
- CTimer::ConstructL();
-
- iEnv = CCoeEnv::Static(); // may be NULL
-
- // Do not create iCFClient here as cf server may not be available yet
- // if we are early in the boot phase.
-
- // set defaults
- RePublishWhenFgL( EFalse );
- AllowPublishFromBackground( EFalse );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::~CHgContextUtilityImpl
-// -----------------------------------------------------------------------------
-//
-CHgContextUtilityImpl::~CHgContextUtilityImpl()
- {
- Cancel();
- delete iPendingContextType;
- delete iPendingContextData;
- delete iPendingContextDataArray;
- delete iCFClient;
- delete iLastContextType;
- delete iLastContextData;
- if ( iFgWatchEnabled && iEnv )
- {
- iEnv->RemoveForegroundObserver( *this );
- }
-
- iMusicContextInfo.ResetAndDestroy();
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::CFReady
-// -----------------------------------------------------------------------------
-//
-TBool CHgContextUtilityImpl::CFReady()
- {
- if ( !iCFClient )
- {
- TRAPD( err, iCFClient = CCFClient::NewL( *this ) );
- if ( err != KErrNone )
- {
- RDebug::Printf( "[hgctxutil] cfw not ready" );
- return EFalse;
- }
- }
- return ETrue;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContextL
-// All other non-static versions of this function will fall back to this one.
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContextL( const TDesC& aContextType,
- const TDesC& aContextData )
- {
- RDebug::Print( _L("[hgctxutil] PublishContextL [%S] [%S]"),
- &aContextType, &aContextData );
- // create cf client instance if not yet done
- // and check foreground status if needed
- if ( CFReady() && AllowedToPublish() )
- {
- // call static version with our cf client instance
- PublishContextL( *iCFClient, aContextType, aContextData );
- }
- // store type and value for later use
- // (even when cfserver is not available yet, the data may still be
- // used later when the app comes to foreground, for example)
- if ( iLastContextType != &aContextType )
- {
- delete iLastContextType; iLastContextType = 0;
- iLastContextType = aContextType.AllocL();
- }
- if ( iLastContextData != &aContextData )
- {
- delete iLastContextData; iLastContextData = 0;
- iLastContextData = aContextData.AllocL();
- }
- }
-
-// -----------------------------------------------------------------------------
-// AppendCharL
-// Appends a char to aDst, calls ReAllocL when needed, assumes that aDst
-// is also on cleanupstack (at top position) so it updates that pointer too.
-// -----------------------------------------------------------------------------
-//
-LOCAL_C void AppendCharL( HBufC*& aDst, TChar aChar )
- {
- TPtr des( aDst->Des() );
- if ( des.Length() == des.MaxLength() )
- {
- HBufC* oldDst = aDst;
- aDst = aDst->ReAllocL( des.MaxLength() * 2 );
- CleanupStack::Pop( oldDst ); // pop the old pointer
- CleanupStack::PushL( aDst ); // and push the new (possibly different) one
- des.Set( aDst->Des() );
- }
- des.Append( aChar );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::BuildCombinedStringL
-// -----------------------------------------------------------------------------
-//
-HBufC* CHgContextUtilityImpl::BuildCombinedStringL(
- const MDesCArray& aArray )
- {
- TInt arrayCount = aArray.MdcaCount();
- if ( arrayCount >= 2 )
- {
- // Rules:
- // 1. escape all separator chars in the input with a preceeding \
- // 2. escape all \ chars in the input with \\
- // 3. take only the first KMaxEntriesInMulti elements from the array
- // 4. append a separator also after last entry
- // 5. prepend two separators to the combined string
- TInt processedEntryCount = Min( arrayCount, KMaxEntriesInMulti );
- // calculate a big enough size so we can avoid ReAllocL calls later
- TInt sz = 0;
- for ( TInt i = 0; i < processedEntryCount; ++i )
- {
- sz += aArray.MdcaPoint( i ).Length() + 1;
- }
- sz += 2; // for the magic prefix
- HBufC* value = HBufC::NewLC( sz );
- AppendCharL( value, KMultiSepChar );
- AppendCharL( value, KMultiSepChar );
- for ( TInt i = 0; i < processedEntryCount; ++i )
- {
- TPtrC entry( aArray.MdcaPoint( i ) );
- // append, also do the escaping
- for ( TInt j = 0, je = entry.Length(); j != je; ++j )
- {
- TChar c = entry[j];
- if ( c == KMultiSepChar || c == '\\' )
- {
- AppendCharL( value, '\\' );
- }
- AppendCharL( value, c );
- }
- AppendCharL( value, KMultiSepChar );
- }
- CleanupStack::Pop( value );
- return value;
- }
- return 0;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::SplitCombinedStringL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::SplitCombinedStringL(
- const TDesC& aString, CDesCArray& aArray )
- {
- TInt inputLength = aString.Length();
- TBool isMulti = inputLength > 2
- && aString[0] == KMultiSepChar && aString[1] == KMultiSepChar;
- if ( isMulti )
- {
- // allocate a work buffer that is big enough for sure
- HBufC* buf = HBufC::NewLC( inputLength );
- TPtr des( buf->Des() );
- TBool esc = EFalse;
- // go through the string, find entries, and add them to output array
- for ( TInt i = 2; i < inputLength; ++i ) // start from 2 because of the magic prefix
- {
- TChar c = aString[i];
- if ( c == '\\' && !esc )
- {
- esc = ETrue;
- }
- else if ( c == KMultiSepChar && !esc )
- {
- // found separator: append to output array, clear buffer, and continue
- aArray.AppendL( des );
- des.Zero();
- }
- else
- {
- esc = EFalse;
- des.Append( c );
- }
- }
- CleanupStack::PopAndDestroy( buf );
- }
- else
- {
- // not a combined string: append to array as it is
- aArray.AppendL( aString );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContextL( const TDesC& aContextType,
- const MDesCArray& aContextData )
- {
- TInt entryCount = aContextData.MdcaCount();
- // do nothing if array is empty
- if ( !entryCount )
- {
- return;
- }
- // nothing special when having only 1 item
- if ( entryCount == 1 )
- {
- PublishContextL( aContextType, aContextData.MdcaPoint( 0 ) );
- return;
- }
- // at least two items: create the special combined string
- HBufC* value = BuildCombinedStringL( aContextData );
- CleanupStack::PushL( value );
- // publish the combined string
- PublishContextL( aContextType, *value );
- CleanupStack::PopAndDestroy( value );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContextL
-// This is the version of the function where the real work is performed.
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContextL( CCFClient& aCFClient,
- const TDesC& aContextType, const TDesC& aContextData )
- {
- CCFContextObject* context = CCFContextObject::NewLC();
- context->SetSourceL( KHgCFSource );
- context->SetTypeL( aContextType );
- context->SetValueL( aContextData );
- TInt err = aCFClient.PublishContext( *context );
- if ( err == KErrNotFound )
- {
- User::LeaveIfError( aCFClient.DefineContext( KHgCFSource,
- aContextType, KContextSecurity ) );
- err = aCFClient.PublishContext( *context );
- if ( err != KErrArgument ) // ignore -6 which comes e.g. when trying to publish an empty value
- {
- User::LeaveIfError( err );
- }
- }
- else if ( err != KErrArgument )
- {
- User::LeaveIfError( err );
- }
- CleanupStack::PopAndDestroy( context );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::GetContextL
-// -----------------------------------------------------------------------------
-//
-HBufC* CHgContextUtilityImpl::GetContextL( const TDesC& aContextSource,
- const TDesC& aContextType )
- {
- HBufC* ret = 0;
- if ( CFReady() )
- {
- CCFContextQuery* query = CCFContextQuery::NewLC();
- query->SetSourceL( aContextSource );
- query->SetTypeL( aContextType );
- RContextObjectArray result;
- TInt err = iCFClient->RequestContext( *query, result );
- if ( err == KErrNone && result.Count() )
- {
- ret = result[0]->Value().Alloc();
- }
- result.ResetAndDestroy();
- CleanupStack::PopAndDestroy( query );
- }
- return ret;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::GetContextL
-// -----------------------------------------------------------------------------
-//
-HBufC* CHgContextUtilityImpl::GetContextL( const TDesC& aContextType )
- {
- return GetContextL( KHgCFSource, aContextType );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContextDelayedL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContextDelayedL( const TDesC& aContextType,
- const TDesC& aContextData, TTimeIntervalMicroSeconds32 aDelay )
- {
- Cancel();
- delete iPendingContextType; iPendingContextType = 0;
- iPendingContextType = aContextType.AllocL();
- delete iPendingContextData; iPendingContextData = 0;
- iPendingContextData = aContextData.AllocL();
- delete iPendingContextDataArray; iPendingContextDataArray = 0;
- After( aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContextDelayedL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContextDelayedL( const TDesC& aContextType,
- const MDesCArray& aContextData, TTimeIntervalMicroSeconds32 aDelay )
- {
- Cancel();
- delete iPendingContextType; iPendingContextType = 0;
- iPendingContextType = aContextType.AllocL();
- delete iPendingContextData; iPendingContextData = 0;
- if ( iPendingContextDataArray )
- {
- iPendingContextDataArray->Reset();
- }
- else
- {
- iPendingContextDataArray = new ( ELeave ) CDesC16ArrayFlat( KArrayGranularity );
- }
- for ( TInt i = 0, ie = aContextData.MdcaCount(); i != ie; ++i )
- {
- iPendingContextDataArray->AppendL( aContextData.MdcaPoint( i ) );
- }
- After( aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::RunL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::RunL()
- {
- if ( iPendingContextType )
- {
- if ( iPendingContextData )
- {
- PublishContextL( *iPendingContextType, *iPendingContextData );
- }
- else if ( iPendingContextDataArray )
- {
- PublishContextL( *iPendingContextType, *iPendingContextDataArray );
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::RunError
-// -----------------------------------------------------------------------------
-//
-TInt CHgContextUtilityImpl::RunError( TInt /*aError*/ )
- {
- return KErrNone;
- }
-
-// empty implementations for cfw
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::ContextIndicationL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::ContextIndicationL(
- const CCFContextIndication& /*aChangedContext*/ )
- {
- // empty
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::ActionIndicationL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::ActionIndicationL(
- const CCFActionIndication& /*aActionToExecute*/ )
- {
- // empty
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::HandleContextFrameworkError
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::HandleContextFrameworkError( TCFError /*aError*/,
- const TDesC& /*aSource*/,
- const TDesC& /*aType*/ )
- {
- // empty
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::Extension
-// -----------------------------------------------------------------------------
-//
-TAny* CHgContextUtilityImpl::Extension( const TUid& /*aExtensionUid*/ ) const
- {
- return 0;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::MakeLinkPublishableLC
-// -----------------------------------------------------------------------------
-//
-HBufC* CHgContextUtilityImpl::MakeLinkPublishableLC(
- const MVPbkContactLink& aLink )
- {
- HBufC* ret = 0;
- // serialize the link and place it into a 16-bit descriptor
- // prefixed with one special mark character
- const MVPbkStreamable* strm = aLink.Streamable();
- User::LeaveIfNull(strm);
- CBufFlat* buf = CBufFlat::NewL( KBufGranularity );
- CleanupStack::PushL( buf );
- RBufWriteStream ws;
- CleanupClosePushL( ws );
- ws.Open( *buf );
- strm->ExternalizeL( ws );
- CleanupStack::PopAndDestroy( &ws );
- TPtr8 p( buf->Ptr( 0 ) );
- ret = HBufC::NewLC( p.Length() + 1 );
- TPtr des( ret->Des() );
- des.Copy( p );
- _LIT( KTemp, " " );
- des.Insert( 0, KTemp );
- des[0] = KHgCFValueLinkMarker; // codescanner::accessArrayElementWithoutCheck2
- CleanupStack::Pop( ret );
- CleanupStack::PopAndDestroy( buf );
- CleanupStack::PushL( ret );
- return ret;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContactContextL(
- const MVPbkStoreContact& aContact,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- MVPbkContactLink* link = aContact.CreateLinkLC();
- if ( link )
- {
- HBufC* pubstr = MakeLinkPublishableLC( *link );
- PublishContactContextL( *pubstr, aDelay );
- CleanupStack::PopAndDestroy( pubstr );
- }
- CleanupStack::PopAndDestroy( );//link
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContactContextL(
- const MVPbkContactLink& aContactLink,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- HBufC* pubstr = MakeLinkPublishableLC( aContactLink );
- PublishContactContextL( *pubstr, aDelay );
- CleanupStack::PopAndDestroy( pubstr );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContactContextL(
- const TDesC& aContactName,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- if ( !aDelay.Int() )
- {
- PublishContextL( KHgCFTypeContact, aContactName );
- }
- else
- {
- PublishContextDelayedL( KHgCFTypeContact, aContactName, aDelay );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContactContextL(
- const RPointerArray<MVPbkStoreContact>& aContacts,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- CDesCArray* arr = new ( ELeave ) CDesCArrayFlat( KArrayGranularity );
- CleanupStack::PushL( arr );
- for ( TInt i = 0, ie = aContacts.Count(); i != ie; ++i )
- {
- MVPbkContactLink* link = aContacts[i]->CreateLinkLC();
- if ( link )
- {
- HBufC* pubstr = MakeLinkPublishableLC( *link );
- arr->AppendL( *pubstr );
- CleanupStack::PopAndDestroy( pubstr );
- }
- CleanupStack::PopAndDestroy( );//link
- }
- PublishContactContextL( *arr, aDelay );
- CleanupStack::PopAndDestroy( arr );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContactContextL(
- const CVPbkContactLinkArray& aContactLinks,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- CDesCArray* arr = new ( ELeave ) CDesCArrayFlat( KArrayGranularity );
- CleanupStack::PushL( arr );
- for ( TInt i = 0, ie = aContactLinks.Count(); i != ie; ++i )
- {
- HBufC* pubstr = MakeLinkPublishableLC( aContactLinks.At( i ) );
- arr->AppendL( *pubstr );
- CleanupStack::PopAndDestroy( pubstr );
- }
- PublishContactContextL( *arr, aDelay );
- CleanupStack::PopAndDestroy( arr );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContactContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContactContextL(
- const MDesCArray& aContactNames,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- if ( !aDelay.Int() )
- {
- PublishContextL( KHgCFTypeContact, aContactNames );
- }
- else
- {
- PublishContextDelayedL( KHgCFTypeContact, aContactNames, aDelay );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishTextContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishTextContextL( const TDesC& aText,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- if ( !aDelay.Int() )
- {
- PublishContextL( KHgCFTypeText, aText );
- }
- else
- {
- PublishContextDelayedL( KHgCFTypeText, aText, aDelay );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishUrlContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishUrlContextL( const TDesC& aUrl,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- if ( !aDelay.Int() )
- {
- PublishContextL( KHgCFTypeUrl, aUrl );
- }
- else
- {
- PublishContextDelayedL( KHgCFTypeUrl, aUrl, aDelay );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishTimeContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishTimeContextL( const TTime& aTime,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- // YYYYMMDD:HHMMSS.MMMMMM
- const TInt KDateTimeLength = 22;
- const TInt KYearLength = 4;
- const TInt KMonthLength = 2;
- const TInt KDayLength = 2;
- _LIT( KTimeZero, ":010101.000000");
-
- TDateTime dt = aTime.DateTime();
- TBuf<KDateTimeLength> buf;
- buf.AppendNumFixedWidth( dt.Year(), EDecimal, KYearLength );
- buf.AppendNumFixedWidth( dt.Month(), EDecimal, KMonthLength );
- buf.AppendNumFixedWidth( dt.Day(), EDecimal, KDayLength );
- buf.Append( KTimeZero );
- if ( !aDelay.Int() )
- {
- PublishContextL( KHgCFTypeActiveDate, buf );
- }
- else
- {
- PublishContextDelayedL( KHgCFTypeActiveDate, buf, aDelay );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishPhotoContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishPhotoContextL(
- const TDesC& aFilename,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- if ( !aDelay.Int() )
- {
- PublishContextL( KHgCFTypePhoto, aFilename );
- }
- else
- {
- PublishContextDelayedL( KHgCFTypePhoto, aFilename, aDelay );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishPhotoContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishPhotoContextL(
- TItemId aMdeItemId,
- CMdESession& aMdeSession,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- CMdEObject* obj = aMdeSession.GetObjectL( aMdeItemId );
- if ( obj )
- {
- CleanupStack::PushL( obj );
- PublishPhotoContextL( obj->Uri(), aDelay );
- CleanupStack::PopAndDestroy( obj );
- }
- else
- {
- User::Leave( KErrNotFound );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishTvContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishTvContextL( const TDesC& aChannelName,
- const TDesC& aProgramName, const TDesC& aProgramDescription,
- const TDesC& aGenre )
- {
- TPtrC channelName( aChannelName.Length() ? aChannelName
- : KHgCFValueUnknownInfo );
- TPtrC programName( aProgramName.Length() ? aProgramName
- : KHgCFValueUnknownInfo );
- TPtrC programDesc( aProgramDescription.Length() ? aProgramDescription
- : KHgCFValueUnknownInfo );
- TPtrC programGenre( aGenre.Length() ? aGenre : KHgCFValueUnknownInfo );
-
- // Publish description/genre first because it is unlikely to have those
- // in rules so their content will be available for sure when an action
- // is triggered.
- PublishContextL( KHgCFTypeTvProgramDesc, programDesc );
- PublishContextL( KHgCFTypeTvProgramGenre, programGenre );
- PublishContextL( KHgCFTypeTvChannelName, channelName );
- PublishContextL( KHgCFTypeTvProgramName, programName );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishServiceIdL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishServiceIdL( const TDesC& aServiceId,
- const TDesC& aAccountId,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- HBufC* combinedIdBuf = HBufC::NewLC( aServiceId.Length()
- + aAccountId.Length() + 1 );
- TPtr combinedId( combinedIdBuf->Des() );
- _LIT( KCombinedFormat, "%S:%S" );
- combinedId.Format( KCombinedFormat, &aServiceId, &aAccountId );
- PublishContactContextL( combinedId, aDelay );
- CleanupStack::PopAndDestroy( combinedIdBuf );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::RePublishWhenFgL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::RePublishWhenFgL( TBool aEnable )
- {
- if ( iEnv )
- {
- if ( iFgWatchEnabled )
- {
- iEnv->RemoveForegroundObserver( *this );
- }
- iFgWatchEnabled = aEnable;
- if ( iFgWatchEnabled )
- {
- iEnv->AddForegroundObserverL( *this );
- }
- }
- }
-
-// callbacks from CCoeEnv
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::HandleGainingForeground
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::HandleGainingForeground()
- {
- if ( iLastContextType && iLastContextData )
- {
- TRAP_IGNORE( PublishContextL( *iLastContextType, *iLastContextData ) );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::HandleLosingForeground
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::HandleLosingForeground()
- {
- // nothing to do here
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::IsForeground
-// -----------------------------------------------------------------------------
-//
-TBool CHgContextUtilityImpl::IsForeground()
- {
- if ( iEnv )
- {
- TInt rootWgId = iEnv->RootWin().WindowGroupId();
- TInt focusWgId = iEnv->WsSession().GetFocusWindowGroup();
- return rootWgId == focusWgId;
- }
- else
- {
- return ETrue;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::AllowedToPublish
-// -----------------------------------------------------------------------------
-//
-TBool CHgContextUtilityImpl::AllowedToPublish()
- {
- TBool result = !iEnv || iAllowPublishFromBackground || IsForeground();
- RDebug::Printf( "[hgctxutil] AllowedToPublish = %d", result );
- return result;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::AllowPublishFromBackground
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::AllowPublishFromBackground( TBool aAllow )
- {
- iAllowPublishFromBackground = aAllow;
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::AddMusicContextInfoL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::AddMusicContextInfoL(
- const TDesC& aKey, const TDesC& aData )
- {
- // Key needs to be provided and also it shouldn't exist in the table.
- // Latter case is simple safe measure, as RPtrHasMap won't delete existing
- // objects in InsertL, so adding same key twice would cause memory leak.
- // The use case of adding same key twice is not 'real world' case, so
- // this method can simply leave, when same key is offered again.
- __ASSERT_ALWAYS( aKey.Length(), User::Leave( KErrNotFound ) );
- __ASSERT_ALWAYS(
- !iMusicContextInfo.Find( aKey ), User::Leave( KErrAlreadyExists ) );
-
- // Hash table needs pointers and it should own the pointers, so allocate
- // key and data, and add them to table. In case the data is empty, add
- // unknown information, since some data needs to be in the action field.
- HBufC* key = aKey.AllocLC();
- HBufC* data = aData.Length() ?
- aData.AllocLC() : KHgCFValueUnknownInfo().AllocLC();
- iMusicContextInfo.InsertL( key, data );
- CleanupStack::Pop( 2, key );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishMusicContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishMusicContextL(
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- // If nothing has been done, just leave. No point of publishing entirely
- // empty music context.
- __ASSERT_ALWAYS( iMusicContextInfo.Count(), User::Leave( KErrNotReady ) );
-
- // Before publishing anything, make sure all keys contain at least some
- // data.
- VerifyAndPublishMusicContextL( KHgCFTypeMusicState, aDelay );
- VerifyAndPublishMusicContextL( KHgCFTypeMusicArtist, aDelay );
- VerifyAndPublishMusicContextL( KHgCFTypeMusicTitle, aDelay );
- VerifyAndPublishMusicContextL( KHgCFTypeMusicAlbum, aDelay );
- VerifyAndPublishMusicContextL( KHgCFTypeMusicAlbumArt, aDelay );
- VerifyAndPublishMusicContextL( KHgCFTypeMusicUri, aDelay );
- VerifyAndPublishMusicContextL( KHgCFTypeMusicGenre, aDelay );
- VerifyAndPublishMusicContextL( KHgCFTypeMusicType, aDelay );
-
- // Clear all data from hash table, so new music context can be published.
- iMusicContextInfo.ResetAndDestroy();
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::VerifyAndPublishMusicContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::VerifyAndPublishMusicContextL(
- const TDesC& aKey,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- TDesC* data = iMusicContextInfo.Find( aKey );
- if ( !data )
- {
- // Key didn't contain any data, just create the key with empty info.
- AddMusicContextInfoL( aKey, KNullDesC );
- data = iMusicContextInfo.Find( aKey );
- }
-
- PublishContextL( aKey, *data, aDelay );
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishContextL(
- const TDesC & aContextType,
- const TDesC & aContextData,
- const TTimeIntervalMicroSeconds32& aDelay )
- {
- if ( !aDelay.Int() )
- {
- PublishContextL( aContextType, aContextData );
- }
- else
- {
- PublishContextDelayedL( aContextType, aContextData, aDelay );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CHgContextUtilityImpl::PublishRadioContextL
-// -----------------------------------------------------------------------------
-//
-void CHgContextUtilityImpl::PublishRadioContextL(
- const TDesC& aRadioName,
- const TDesC& aRadioUrl,
- const TDesC& aRadioFrequency,
- const TDesC& aRadioRDSPI )
- {
- TPtrC radioName( aRadioName.Length() ? aRadioName
- : KHgCFValueUnknownInfo );
- TPtrC radioUrl( aRadioUrl.Length() ? aRadioUrl
- : KHgCFValueUnknownInfo );
- TPtrC radioFrequency( aRadioFrequency.Length() ? aRadioFrequency
- : KHgCFValueUnknownInfo );
- TPtrC radioRDSPI( aRadioRDSPI.Length() ? aRadioRDSPI
- : KHgCFValueUnknownInfo );
-
- PublishContextL( KHgCFTypeMusicRadioRDSPI, radioRDSPI );
- PublishContextL( KHgCFTypeMusicRadioFrequency, radioFrequency );
- PublishContextL( KHgCFTypeMusicRadioUrl, radioUrl );
- PublishContextL( KHgCFTypeMusicRadioName, radioName );
- }
-
-// end of file
Binary file homescreenpluginsrv/conf/hsps.confml has changed
Binary file homescreenpluginsrv/conf/hsps_200159c9.crml has changed
--- a/homescreenpluginsrv/hspsmanager/bwins/hspsclientsessionu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/bwins/hspsclientsessionu.def Wed Mar 31 22:04:35 2010 +0300
@@ -1,28 +1,28 @@
EXPORTS
- ?GetListHeaders@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@0@Z @ 1 NONAME ; int RhspsClientSession::GetListHeaders(class TDes8 &, class TDesC8 const &, class TDes8 &)
- ?CancelRequest@RhspsClientSession@@IAEXHAAVTDes8@@H@Z @ 2 NONAME ; void RhspsClientSession::CancelRequest(int, class TDes8 &, int)
- ?SetConfState@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamSetConfState@@@Z @ 3 NONAME ; int RhspsClientSession::SetConfState(class TDes8 &, struct ThspsParamSetConfState const &)
- ?CopyResourceFiles@RhspsClientSession@@IAEHAAVTDes8@@AAVTDesC16@@1@Z @ 4 NONAME ; int RhspsClientSession::CopyResourceFiles(class TDes8 &, class TDesC16 &, class TDesC16 &)
- ?Connect@RhspsClientSession@@IAEHXZ @ 5 NONAME ; int RhspsClientSession::Connect(void)
- ?GetODT@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsConfiguration@@ABVTDesC8@@AAVTDes16@@@Z @ 6 NONAME ; int RhspsClientSession::GetODT(class TDes8 &, struct ThspsConfiguration const &, class TDesC8 const &, class TDes16 &)
+ ?CancelRequest@RhspsClientSession@@IAEXHAAVTDes8@@H@Z @ 1 NONAME ; void RhspsClientSession::CancelRequest(int, class TDes8 &, int)
+ ?SetConfState@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamSetConfState@@@Z @ 2 NONAME ; int RhspsClientSession::SetConfState(class TDes8 &, struct ThspsParamSetConfState const &)
+ ?CopyResourceFiles@RhspsClientSession@@IAEHAAVTDes8@@AAVTDesC16@@1@Z @ 3 NONAME ; int RhspsClientSession::CopyResourceFiles(class TDes8 &, class TDesC16 &, class TDesC16 &)
+ ?Connect@RhspsClientSession@@IAEHXZ @ 4 NONAME ; int RhspsClientSession::Connect(void)
+ ?GetODT@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsConfiguration@@ABVTDesC8@@AAVTDes16@@@Z @ 5 NONAME ; int RhspsClientSession::GetODT(class TDes8 &, struct ThspsConfiguration const &, class TDesC8 const &, class TDes16 &)
+ ?GetListHeaders@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@H0@Z @ 6 NONAME ; int RhspsClientSession::GetListHeaders(class TDes8 &, class TDesC8 const &, int, class TDes8 &)
?MovePlugins@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamMovePlugins@@@Z @ 7 NONAME ; int RhspsClientSession::MovePlugins(class TDes8 &, struct ThpsParamMovePlugins const &)
?SetActiveTheme@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@0@Z @ 8 NONAME ; int RhspsClientSession::SetActiveTheme(class TDes8 &, class TDesC8 const &, class TDes8 &)
?SetActivePlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamSetActivePlugin@@@Z @ 9 NONAME ; int RhspsClientSession::SetActivePlugin(class TDes8 &, struct ThpsParamSetActivePlugin const &)
- ?ReplacePlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamReplacePlugin@@@Z @ 10 NONAME ; int RhspsClientSession::ReplacePlugin(class TDes8 &, struct ThspsParamReplacePlugin const &)
- ?InstallNextPhase@RhspsClientSession@@IAEXAAVTDes8@@0AAVTRequestStatus@@@Z @ 11 NONAME ; void RhspsClientSession::InstallNextPhase(class TDes8 &, class TDes8 &, class TRequestStatus &)
- ?SetPluginSettings@RhspsClientSession@@IAEHAAVTDes8@@0UThspsParamSetPluginSettings@@0@Z @ 12 NONAME ; int RhspsClientSession::SetPluginSettings(class TDes8 &, class TDes8 &, struct ThspsParamSetPluginSettings, class TDes8 &)
- ?RemovePlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamRemovePlugin@@@Z @ 13 NONAME ; int RhspsClientSession::RemovePlugin(class TDes8 &, struct ThpsParamRemovePlugin const &)
- ?GetNextHeader@RhspsClientSession@@IAEXAAVTDes8@@0AAVTRequestStatus@@@Z @ 14 NONAME ; void RhspsClientSession::GetNextHeader(class TDes8 &, class TDes8 &, class TRequestStatus &)
- ?RemoveTheme@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@@Z @ 15 NONAME ; int RhspsClientSession::RemoveTheme(class TDes8 &, class TDesC8 const &)
- ?AddPlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamAddPlugin@@AAH@Z @ 16 NONAME ; int RhspsClientSession::AddPlugin(class TDes8 &, struct ThpsParamAddPlugin const &, int &)
- ?Close@RhspsClientSession@@IAEXXZ @ 17 NONAME ; void RhspsClientSession::Close(void)
- ?GetPluginOdt@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamGetPluginOdt@@AAVTDes16@@@Z @ 18 NONAME ; int RhspsClientSession::GetPluginOdt(class TDes8 &, struct ThspsParamGetPluginOdt const &, class TDes16 &)
- ?RestoreDefault@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@0@Z @ 19 NONAME ; int RhspsClientSession::RestoreDefault(class TDes8 &, class TDesC8 const &, class TDes8 &)
- ?GetNextHeader@RhspsClientSession@@IAEHAAVTDes8@@0@Z @ 20 NONAME ; int RhspsClientSession::GetNextHeader(class TDes8 &, class TDes8 &)
- ?RestoreActiveAppConf@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamRestoreActiveAppConf@@@Z @ 21 NONAME ; int RhspsClientSession::RestoreActiveAppConf(class TDes8 &, struct ThspsParamRestoreActiveAppConf const &)
- ?InstallTheme@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC16@@0@Z @ 22 NONAME ; int RhspsClientSession::InstallTheme(class TDes8 &, class TDesC16 const &, class TDes8 &)
- ?AccessResourceFile@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsConfiguration@@ABVTDesC16@@AAH@Z @ 23 NONAME ; int RhspsClientSession::AccessResourceFile(class TDes8 &, struct ThspsConfiguration const &, class TDesC16 const &, int &)
- ?GetODTUpdate@RhspsClientSession@@IAEXAAVTDes8@@00AAVTRequestStatus@@@Z @ 24 NONAME ; void RhspsClientSession::GetODTUpdate(class TDes8 &, class TDes8 &, class TDes8 &, class TRequestStatus &)
- ?ReinstallConf@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamReinstallConf@@@Z @ 25 NONAME ; int RhspsClientSession::ReinstallConf(class TDes8 &, struct ThspsParamReinstallConf const &)
- ?RestoreConfigurations@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamRestoreConfigurations@@@Z @ 26 NONAME ; int RhspsClientSession::RestoreConfigurations(class TDes8 &, struct ThspsParamRestoreConfigurations const &)
+ ?RestoreConfigurations@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamRestoreConfigurations@@@Z @ 10 NONAME ; int RhspsClientSession::RestoreConfigurations(class TDes8 &, struct ThspsParamRestoreConfigurations const &)
+ ?ReplacePlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamReplacePlugin@@@Z @ 11 NONAME ; int RhspsClientSession::ReplacePlugin(class TDes8 &, struct ThspsParamReplacePlugin const &)
+ ?InstallNextPhase@RhspsClientSession@@IAEXAAVTDes8@@0AAVTRequestStatus@@@Z @ 12 NONAME ; void RhspsClientSession::InstallNextPhase(class TDes8 &, class TDes8 &, class TRequestStatus &)
+ ?SetPluginSettings@RhspsClientSession@@IAEHAAVTDes8@@0UThspsParamSetPluginSettings@@0@Z @ 13 NONAME ; int RhspsClientSession::SetPluginSettings(class TDes8 &, class TDes8 &, struct ThspsParamSetPluginSettings, class TDes8 &)
+ ?RemovePlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamRemovePlugin@@@Z @ 14 NONAME ; int RhspsClientSession::RemovePlugin(class TDes8 &, struct ThpsParamRemovePlugin const &)
+ ?GetNextHeader@RhspsClientSession@@IAEXAAVTDes8@@0AAVTRequestStatus@@@Z @ 15 NONAME ; void RhspsClientSession::GetNextHeader(class TDes8 &, class TDes8 &, class TRequestStatus &)
+ ?RemoveTheme@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@@Z @ 16 NONAME ; int RhspsClientSession::RemoveTheme(class TDes8 &, class TDesC8 const &)
+ ?AddPlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamAddPlugin@@AAH@Z @ 17 NONAME ; int RhspsClientSession::AddPlugin(class TDes8 &, struct ThpsParamAddPlugin const &, int &)
+ ?Close@RhspsClientSession@@IAEXXZ @ 18 NONAME ; void RhspsClientSession::Close(void)
+ ?GetPluginOdt@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamGetPluginOdt@@AAVTDes16@@@Z @ 19 NONAME ; int RhspsClientSession::GetPluginOdt(class TDes8 &, struct ThspsParamGetPluginOdt const &, class TDes16 &)
+ ?RestoreDefault@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@0@Z @ 20 NONAME ; int RhspsClientSession::RestoreDefault(class TDes8 &, class TDesC8 const &, class TDes8 &)
+ ?GetNextHeader@RhspsClientSession@@IAEHAAVTDes8@@0@Z @ 21 NONAME ; int RhspsClientSession::GetNextHeader(class TDes8 &, class TDes8 &)
+ ?RestoreActiveAppConf@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamRestoreActiveAppConf@@@Z @ 22 NONAME ; int RhspsClientSession::RestoreActiveAppConf(class TDes8 &, struct ThspsParamRestoreActiveAppConf const &)
+ ?InstallTheme@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC16@@0@Z @ 23 NONAME ; int RhspsClientSession::InstallTheme(class TDes8 &, class TDesC16 const &, class TDes8 &)
+ ?AccessResourceFile@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsConfiguration@@ABVTDesC16@@AAH@Z @ 24 NONAME ; int RhspsClientSession::AccessResourceFile(class TDes8 &, struct ThspsConfiguration const &, class TDesC16 const &, int &)
+ ?GetODTUpdate@RhspsClientSession@@IAEXAAVTDes8@@00AAVTRequestStatus@@@Z @ 25 NONAME ; void RhspsClientSession::GetODTUpdate(class TDes8 &, class TDes8 &, class TDes8 &, class TRequestStatus &)
+ ?ReinstallConf@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamReinstallConf@@@Z @ 26 NONAME ; int RhspsClientSession::ReinstallConf(class TDes8 &, struct ThspsParamReinstallConf const &)
--- a/homescreenpluginsrv/hspsmanager/bwins/hspsclientu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/bwins/hspsclientu.def Wed Mar 31 22:04:35 2010 +0300
@@ -8,9 +8,9 @@
?GethspsResult@ChspsClient@@QAEXAAVChspsResult@@@Z @ 7 NONAME ; void ChspsClient::GethspsResult(class ChspsResult &)
?NewLC@ChspsClient@@SAPAV1@AAVMhspsThemeManagementServiceObserver@@@Z @ 8 NONAME ; class ChspsClient * ChspsClient::NewLC(class MhspsThemeManagementServiceObserver &)
?hspsInstallTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC16@@AAVChspsODT@@@Z @ 9 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsInstallTheme(class TDesC16 const &, class ChspsODT &)
- ?hspsGetHeaders@ChspsClient@@QAEHABVChspsODT@@AAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 10 NONAME ; int ChspsClient::hspsGetHeaders(class ChspsODT const &, class CArrayPtrFlat<class ChspsODT> &)
- ?hspsReinstallConf@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 11 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReinstallConf(int, int)
- ?hspsRestoreDefault@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 12 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreDefault(class ChspsODT const &, class ChspsODT &)
+ ?hspsReinstallConf@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 10 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReinstallConf(int, int)
+ ?hspsRestoreDefault@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 11 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreDefault(class ChspsODT const &, class ChspsODT &)
+ ?hspsRestoreConfigurations@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 12 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreConfigurations(int, int)
?hspsReplacePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHH@Z @ 13 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReplacePlugin(int, int, int)
?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 14 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class ChspsODT const &, class ChspsODT &)
?hspsPluginUpdateL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@@Z @ 15 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsPluginUpdateL(class ChspsODT const &)
@@ -22,11 +22,11 @@
?hspsSetActivePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 21 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActivePlugin(int, int)
?hspsCancelInstallTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 22 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsCancelInstallTheme(void)
?hspsGetNextHeader@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 23 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetNextHeader(void)
- ?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC8@@AAVTDes8@@@Z @ 24 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class TDesC8 const &, class TDes8 &)
- ?hspsGetPluginOdtL@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HHPAVChspsODT@@@Z @ 25 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetPluginOdtL(int, int, class ChspsODT *)
- ?hspsRestoreActiveAppConf@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 26 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreActiveAppConf(int, int)
- ?hspsMovePluginsL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHABV?$CArrayFixFlat@H@@@Z @ 27 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsMovePluginsL(int, int, class CArrayFixFlat<int> const &)
- ?hspsGetListHeaders@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 28 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders(class ChspsODT const &, class CArrayPtrFlat<class ChspsODT> &)
- ?hspsRemoveThemeL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@@Z @ 29 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRemoveThemeL(class ChspsODT const &)
- ?hspsRestoreConfigurations@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 30 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreConfigurations(int, int)
+ ?hspsGetListHeaders@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@HAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 24 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders(class ChspsODT const &, int, class CArrayPtrFlat<class ChspsODT> &)
+ ?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC8@@AAVTDes8@@@Z @ 25 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class TDesC8 const &, class TDes8 &)
+ ?hspsGetPluginOdtL@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HHPAVChspsODT@@@Z @ 26 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetPluginOdtL(int, int, class ChspsODT *)
+ ?hspsRestoreActiveAppConf@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 27 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreActiveAppConf(int, int)
+ ?hspsMovePluginsL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHABV?$CArrayFixFlat@H@@@Z @ 28 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsMovePluginsL(int, int, class CArrayFixFlat<int> const &)
+ ?hspsGetHeaders@ChspsClient@@QAEHABVChspsODT@@HAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 29 NONAME ; int ChspsClient::hspsGetHeaders(class ChspsODT const &, int, class CArrayPtrFlat<class ChspsODT> &)
+ ?hspsRemoveThemeL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@@Z @ 30 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRemoveThemeL(class ChspsODT const &)
--- a/homescreenpluginsrv/hspsmanager/client/hspsclient.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/client/hspsclient.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -236,8 +236,10 @@
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
-EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders( const ChspsODT& aSearchMask,
- CArrayPtrFlat<ChspsODT>& aHeaderList )
+EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders(
+ const ChspsODT& aSearchMask,
+ const TBool aCopyLogos,
+ CArrayPtrFlat<ChspsODT>& aHeaderList )
{
ThspsServiceCompletedMessage ret = EhspsServiceRequestError;
TBuf8<KMaxHeaderDataLength8> headerData;
@@ -263,8 +265,11 @@
// cancel previous subscription first
hspsCancelGetListHeaders();
}
- ret = (ThspsServiceCompletedMessage)iSession.GetListHeaders(iResultData,
- iSearchMaskData->Des(),headerData );
+ ret = (ThspsServiceCompletedMessage)iSession.GetListHeaders(
+ iResultData,
+ iSearchMaskData->Des(),
+ aCopyLogos,
+ headerData );
#ifdef HSPS_LOG_ACTIVE
if( iLogBus )
@@ -534,8 +539,10 @@
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
-EXPORT_C TInt ChspsClient::hspsGetHeaders( const ChspsODT& aSearchMask,
- CArrayPtrFlat<ChspsODT>& aHeaderList )
+EXPORT_C TInt ChspsClient::hspsGetHeaders(
+ const ChspsODT& aSearchMask,
+ const TBool aCopyLogos,
+ CArrayPtrFlat<ChspsODT>& aHeaderList )
{
iHeaderList = &aHeaderList;
// Convert search mask ODT to binary stream
@@ -553,6 +560,7 @@
( ThspsServiceCompletedMessage )iSession.GetListHeaders(
iResultData,
iSearchMaskData->Des(),
+ aCopyLogos,
iHeaderData );
if ( ret == EhspsGetListHeadersSuccess )
--- a/homescreenpluginsrv/hspsmanager/client/hspsclientsession.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/client/hspsclientsession.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -153,11 +153,13 @@
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RhspsClientSession::GetListHeaders(TDes8& aResultData, const TDesC8& aSearchMaskData,
- TDes8& aHeaderData)
+ const TBool aCopyLogos, TDes8& aHeaderData)
{
aHeaderData.Zero();
aResultData.Zero();
- return SendReceive(EhspsGetListHeaders, TIpcArgs(&aResultData, &aSearchMaskData, &aHeaderData));
+ TPckg<TInt> intPkg( aCopyLogos );
+ return SendReceive( EhspsGetListHeaders,
+ TIpcArgs(&aResultData, &aSearchMaskData, &aHeaderData, &intPkg) );
}
// -----------------------------------------------------------------------------
--- a/homescreenpluginsrv/hspsmanager/eabi/hspsclientsessionu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/eabi/hspsclientsessionu.def Wed Mar 31 22:04:35 2010 +0300
@@ -11,7 +11,7 @@
_ZN18RhspsClientSession13GetNextHeaderER5TDes8S1_R14TRequestStatus @ 10 NONAME
_ZN18RhspsClientSession13ReinstallConfER5TDes8RK23ThspsParamReinstallConf @ 11 NONAME
_ZN18RhspsClientSession13ReplacePluginER5TDes8RK23ThspsParamReplacePlugin @ 12 NONAME
- _ZN18RhspsClientSession14GetListHeadersER5TDes8RK6TDesC8S1_ @ 13 NONAME
+ _ZN18RhspsClientSession14GetListHeadersER5TDes8RK6TDesC8iS1_ @ 13 NONAME
_ZN18RhspsClientSession14RestoreDefaultER5TDes8RK6TDesC8S1_ @ 14 NONAME
_ZN18RhspsClientSession14SetActiveThemeER5TDes8RK6TDesC8S1_ @ 15 NONAME
_ZN18RhspsClientSession15SetActivePluginER5TDes8RK24ThpsParamSetActivePlugin @ 16 NONAME
@@ -20,9 +20,9 @@
_ZN18RhspsClientSession17SetPluginSettingsER5TDes8S1_27ThspsParamSetPluginSettingsS1_ @ 19 NONAME
_ZN18RhspsClientSession18AccessResourceFileER5TDes8RK18ThspsConfigurationRK7TDesC16Ri @ 20 NONAME
_ZN18RhspsClientSession20RestoreActiveAppConfER5TDes8RK30ThspsParamRestoreActiveAppConf @ 21 NONAME
- _ZN18RhspsClientSession5CloseEv @ 22 NONAME
- _ZN18RhspsClientSession6GetODTER5TDes8RK18ThspsConfigurationRK6TDesC8R6TDes16 @ 23 NONAME
- _ZN18RhspsClientSession7ConnectEv @ 24 NONAME
- _ZN18RhspsClientSession9AddPluginER5TDes8RK18ThpsParamAddPluginRi @ 25 NONAME
- _ZN18RhspsClientSession21RestoreConfigurationsER5TDes8RK31ThspsParamRestoreConfigurations @ 26 NONAME
+ _ZN18RhspsClientSession21RestoreConfigurationsER5TDes8RK31ThspsParamRestoreConfigurations @ 22 NONAME
+ _ZN18RhspsClientSession5CloseEv @ 23 NONAME
+ _ZN18RhspsClientSession6GetODTER5TDes8RK18ThspsConfigurationRK6TDesC8R6TDes16 @ 24 NONAME
+ _ZN18RhspsClientSession7ConnectEv @ 25 NONAME
+ _ZN18RhspsClientSession9AddPluginER5TDes8RK18ThpsParamAddPluginRi @ 26 NONAME
--- a/homescreenpluginsrv/hspsmanager/eabi/hspsclientu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/eabi/hspsclientu.def Wed Mar 31 22:04:35 2010 +0300
@@ -1,7 +1,7 @@
EXPORTS
_ZN11ChspsClient13GethspsResultER11ChspsResult @ 1 NONAME
_ZN11ChspsClient13hspsAddPluginEiiiiRi @ 2 NONAME
- _ZN11ChspsClient14hspsGetHeadersERK8ChspsODTR13CArrayPtrFlatIS0_E @ 3 NONAME
+ _ZN11ChspsClient14hspsGetHeadersERK8ChspsODTiR13CArrayPtrFlatIS0_E @ 3 NONAME
_ZN11ChspsClient16hspsInstallThemeERK7TDesC16R5TDes8 @ 4 NONAME
_ZN11ChspsClient16hspsInstallThemeERK7TDesC16R8ChspsODT @ 5 NONAME
_ZN11ChspsClient16hspsMovePluginsLEiiRK13CArrayFixFlatIiE @ 6 NONAME
@@ -14,7 +14,7 @@
_ZN11ChspsClient17hspsReinstallConfEii @ 13 NONAME
_ZN11ChspsClient17hspsReplacePluginEiii @ 14 NONAME
_ZN11ChspsClient18hspsGetListHeadersERK6TDesC8R12CArrayPtrSegI6HBufC8E @ 15 NONAME
- _ZN11ChspsClient18hspsGetListHeadersERK8ChspsODTR13CArrayPtrFlatIS0_E @ 16 NONAME
+ _ZN11ChspsClient18hspsGetListHeadersERK8ChspsODTiR13CArrayPtrFlatIS0_E @ 16 NONAME
_ZN11ChspsClient18hspsRestoreDefaultERK8ChspsODTRS0_ @ 17 NONAME
_ZN11ChspsClient18hspsSetActiveThemeERK6TDesC8R5TDes8 @ 18 NONAME
_ZN11ChspsClient18hspsSetActiveThemeERK8ChspsODTRS0_ @ 19 NONAME
@@ -25,32 +25,32 @@
_ZN11ChspsClient22hspsCancelInstallThemeEv @ 24 NONAME
_ZN11ChspsClient24hspsCancelGetListHeadersEv @ 25 NONAME
_ZN11ChspsClient24hspsRestoreActiveAppConfEii @ 26 NONAME
- _ZN11ChspsClient4NewLER35MhspsThemeManagementServiceObserver @ 27 NONAME
- _ZN11ChspsClient5NewLCER35MhspsThemeManagementServiceObserver @ 28 NONAME
- _ZN11ChspsClient9SetLogBusEPv @ 29 NONAME
- _ZTI11ChspsClient @ 30 NONAME
- _ZTV11ChspsClient @ 31 NONAME
- _ZThn28_N11ChspsClient16hspsInstallThemeERK7TDesC16R5TDes8 @ 32 NONAME
- _ZThn28_N11ChspsClient16hspsInstallThemeERK7TDesC16R8ChspsODT @ 33 NONAME
- _ZThn28_N11ChspsClient21hspsInstallNextPhaseLER5TDes8 @ 34 NONAME
- _ZThn28_N11ChspsClient21hspsInstallNextPhaseLER8ChspsODT @ 35 NONAME
- _ZThn28_N11ChspsClient22hspsCancelInstallThemeEv @ 36 NONAME
- _ZThn32_N11ChspsClient13hspsAddPluginEiiiiRi @ 37 NONAME
- _ZThn32_N11ChspsClient16hspsMovePluginsLEiiRK13CArrayFixFlatIiE @ 38 NONAME
- _ZThn32_N11ChspsClient16hspsRemovePluginEii @ 39 NONAME
- _ZThn32_N11ChspsClient16hspsRemoveThemeLERK8ChspsODT @ 40 NONAME
- _ZThn32_N11ChspsClient16hspsSetConfStateEii23ThspsConfigurationState26ThspsConfStateChangeFilter @ 41 NONAME
- _ZThn32_N11ChspsClient17hspsGetNextHeaderEv @ 42 NONAME
- _ZThn32_N11ChspsClient17hspsPluginUpdateLERK8ChspsODT @ 43 NONAME
- _ZThn32_N11ChspsClient17hspsReplacePluginEiii @ 44 NONAME
- _ZThn32_N11ChspsClient18hspsGetListHeadersERK6TDesC8R12CArrayPtrSegI6HBufC8E @ 45 NONAME
- _ZThn32_N11ChspsClient18hspsGetListHeadersERK8ChspsODTR13CArrayPtrFlatIS0_E @ 46 NONAME
- _ZThn32_N11ChspsClient18hspsRestoreDefaultERK8ChspsODTRS0_ @ 47 NONAME
- _ZThn32_N11ChspsClient18hspsSetActiveThemeERK6TDesC8R5TDes8 @ 48 NONAME
- _ZThn32_N11ChspsClient18hspsSetActiveThemeERK8ChspsODTRS0_ @ 49 NONAME
- _ZThn32_N11ChspsClient19hspsSetActivePluginEii @ 50 NONAME
- _ZThn32_N11ChspsClient21hspsSetPluginSettingsERK8ChspsODTiR16ChspsDomDocumenti @ 51 NONAME
- _ZThn32_N11ChspsClient24hspsCancelGetListHeadersEv @ 52 NONAME
- _ZThn32_N11ChspsClient24hspsRestoreActiveAppConfEii @ 53 NONAME
- _ZN11ChspsClient25hspsRestoreConfigurationsEii @ 54 NONAME
+ _ZN11ChspsClient25hspsRestoreConfigurationsEii @ 27 NONAME
+ _ZN11ChspsClient4NewLER35MhspsThemeManagementServiceObserver @ 28 NONAME
+ _ZN11ChspsClient5NewLCER35MhspsThemeManagementServiceObserver @ 29 NONAME
+ _ZN11ChspsClient9SetLogBusEPv @ 30 NONAME
+ _ZTI11ChspsClient @ 31 NONAME
+ _ZTV11ChspsClient @ 32 NONAME
+ _ZThn28_N11ChspsClient16hspsInstallThemeERK7TDesC16R5TDes8 @ 33 NONAME
+ _ZThn28_N11ChspsClient16hspsInstallThemeERK7TDesC16R8ChspsODT @ 34 NONAME
+ _ZThn28_N11ChspsClient21hspsInstallNextPhaseLER5TDes8 @ 35 NONAME
+ _ZThn28_N11ChspsClient21hspsInstallNextPhaseLER8ChspsODT @ 36 NONAME
+ _ZThn28_N11ChspsClient22hspsCancelInstallThemeEv @ 37 NONAME
+ _ZThn32_N11ChspsClient13hspsAddPluginEiiiiRi @ 38 NONAME
+ _ZThn32_N11ChspsClient16hspsMovePluginsLEiiRK13CArrayFixFlatIiE @ 39 NONAME
+ _ZThn32_N11ChspsClient16hspsRemovePluginEii @ 40 NONAME
+ _ZThn32_N11ChspsClient16hspsRemoveThemeLERK8ChspsODT @ 41 NONAME
+ _ZThn32_N11ChspsClient16hspsSetConfStateEii23ThspsConfigurationState26ThspsConfStateChangeFilter @ 42 NONAME
+ _ZThn32_N11ChspsClient17hspsGetNextHeaderEv @ 43 NONAME
+ _ZThn32_N11ChspsClient17hspsPluginUpdateLERK8ChspsODT @ 44 NONAME
+ _ZThn32_N11ChspsClient17hspsReplacePluginEiii @ 45 NONAME
+ _ZThn32_N11ChspsClient18hspsGetListHeadersERK6TDesC8R12CArrayPtrSegI6HBufC8E @ 46 NONAME
+ _ZThn32_N11ChspsClient18hspsGetListHeadersERK8ChspsODTiR13CArrayPtrFlatIS0_E @ 47 NONAME
+ _ZThn32_N11ChspsClient18hspsRestoreDefaultERK8ChspsODTRS0_ @ 48 NONAME
+ _ZThn32_N11ChspsClient18hspsSetActiveThemeERK6TDesC8R5TDes8 @ 49 NONAME
+ _ZThn32_N11ChspsClient18hspsSetActiveThemeERK8ChspsODTRS0_ @ 50 NONAME
+ _ZThn32_N11ChspsClient19hspsSetActivePluginEii @ 51 NONAME
+ _ZThn32_N11ChspsClient21hspsSetPluginSettingsERK8ChspsODTiR16ChspsDomDocumenti @ 52 NONAME
+ _ZThn32_N11ChspsClient24hspsCancelGetListHeadersEv @ 53 NONAME
+ _ZThn32_N11ChspsClient24hspsRestoreActiveAppConfEii @ 54 NONAME
--- a/homescreenpluginsrv/hspsmanager/group/hspsthemeserver.mmp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/group/hspsthemeserver.mmp Wed Mar 31 22:04:35 2010 +0300
@@ -52,6 +52,7 @@
SOURCE hspsbrobserver.cpp
SOURCE hspsbrhandler.cpp
SOURCE hspsinstaller.cpp
+SOURCE hspsfamily.cpp
#if defined(WINSCW) || defined(__WINS__)
SOURCE hspsfamilylistener.cpp
#endif
@@ -82,16 +83,13 @@
LIBRARY hspsdefinitionengineinterface.lib
LIBRARY ecom.lib // definition engine
LIBRARY MemMan.lib
+LIBRARY ws32.lib // RWsSession
#ifdef _hsps_DEBUG_
LIBRARY flogger.lib
#endif // _hsps_DEBUG_
LIBRARY sysversioninfo.lib
LIBRARY abclient.lib
-#if defined(WINSCW) || defined(__WINS__)
-LIBRARY ws32.lib // RWsSession
-LIBRARY featmgr.lib // FeatureManager
-#endif // defined(WINSCW)
LANG SC
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenpluginsrv/hspsmanager/inc/hspsfamily.h Wed Mar 31 22:04:35 2010 +0300
@@ -0,0 +1,122 @@
+/*
+* 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:
+*
+*
+*/
+
+#ifndef HSPSFAMILY_H_
+#define HSPSFAMILY_H_
+
+#include <e32base.h>
+#include <w32std.h>
+
+#include "hspsthememanagement.h"
+
+
+
+/**
+* @ingroup group_hspsserver
+* ChspsFamily is used to get UI's resolution and orientation.
+*
+* @lib hspsThemeServer.exe
+* @since S60 9.2
+*/
+class ChspsFamily
+ {
+ public: // Constructors and destructor
+
+ /**
+ * NewL
+ * Two-phased constructor.
+ */
+ static ChspsFamily* NewL();
+
+ /**
+ * ~ChspsFamilyListener
+ * Destructor.
+ */
+ virtual ~ChspsFamily();
+
+ /**
+ * Retrieves family type from a string
+ * @since S60 9.2
+ */
+ static ThspsFamily GetFamilyType(
+ const TDesC8& aFamilyString );
+
+ /**
+ * Retrieves family type from the current resolution.
+ * @since S60 5.0
+ * @return Family id
+ */
+ ThspsFamily GetFamilyType();
+
+ /**
+ * Retrieves window server session
+ * @since S60 9.2
+ * @return Window server session
+ */
+ inline RWsSession& WsSession();
+
+ protected:
+
+ /**
+ * ConstructL
+ * By default Symbian 2nd phase constructor is private.
+ */
+ void ConstructL();
+
+ protected:
+ /**
+ * C++ default constructor.
+ */
+ ChspsFamily();
+
+
+ /**
+ * Retrieves used display code.
+ */
+ void GetFamilyString(
+ TDes8& aFamily );
+
+ private: // Data
+
+ // Window server session.
+ RWsSession iWsSession;
+
+ // Client-side handle to a server-side window group.
+ RWindowGroup iWindowGroup;
+
+ // Screen device, own.
+ CWsScreenDevice* iScreenDevice;
+
+ };
+
+
+// Inline methods
+
+
+// -----------------------------------------------------------------------------
+// ChspsFamily::WsSession
+// -----------------------------------------------------------------------------
+//
+RWsSession& ChspsFamily::WsSession()
+ {
+ return iWsSession;
+ }
+
+
+
+#endif /* HSPSFAMILY_H_ */
+
+// End of File
--- a/homescreenpluginsrv/hspsmanager/inc/hspsfamilylistener.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/inc/hspsfamilylistener.h Wed Mar 31 22:04:35 2010 +0300
@@ -24,12 +24,9 @@
#ifndef HSPSFAMILYLISTENER_H_
#define HSPSFAMILYLISTENER_H_
-#include <e32base.h>
-#include <w32std.h>
+#include "hspsfamily.h"
-#include "hspsthememanagement.h"
-
-
+class ChspsFamilyListener;
/**
* @ingroup group_hspsserver
* HandleFamilyChangeL.
@@ -47,45 +44,44 @@
virtual TBool HandleFamilyChangeL( const ThspsFamily aNewFamily ) = 0;
};
-/**
-* @ingroup group_hspsserver
-* ChspsFamilyListener is used to listen to the changes in UI's resolution and orientation.
-* Used on emulator environment only.
-*
-* @lib hspsThemeServer.exe
-* @since S60 5.0
-*/
-class ChspsFamilyListener : public CActive
- {
+
+class ChspsFamilyListenerActive : public CActive
+ {
public: // Constructors and destructor
/**
* NewL
* Two-phased constructor.
*/
- static ChspsFamilyListener* NewL(
+ static ChspsFamilyListenerActive* NewL(
+ ChspsFamilyListener& aListener,
MhspsFamilyObserver& aObserver );
/**
* ~ChspsFamilyListener
* Destructor.
*/
- virtual ~ChspsFamilyListener();
+ virtual ~ChspsFamilyListenerActive();
+
+ private:
+
/**
- * Retrieves family type from a string
- * @since S60 5.0
+ * ConstructL
+ * By default Symbian 2nd phase constructor is private.
+ */
+ void ConstructL();
+
+ ChspsFamilyListenerActive(
+ ChspsFamilyListener& aListener,
+ MhspsFamilyObserver& iObserver);
+
+ public:
+ /**
+ * Start listener.
*/
- static ThspsFamily GetFamilyType(
- const TDesC8& aFamilyString );
-
- /**
- * Retrieves family type from the current resolution.
- * @since S60 5.0
- * @return Family id
- */
- ThspsFamily GetFamilyType();
-
+ void Queue();
+
protected: // Functions from base classes
/**
@@ -108,6 +104,42 @@
* @since S60 5.0
*/
TInt RunError(TInt aError);
+
+ private: // data
+
+ // Listener reference, not owned
+ ChspsFamilyListener& iListener;
+
+ // Observer which is called when RunL occurs
+ MhspsFamilyObserver& iObserver;
+
+ };
+
+/**
+* @ingroup group_hspsserver
+* ChspsFamilyListener is used to listen to the changes in UI's resolution and orientation.
+* Used on emulator environment only.
+*
+* @lib hspsThemeServer.exe
+* @since S60 5.0
+*/
+class ChspsFamilyListener : public ChspsFamily
+ {
+ public: // Constructors and destructor
+
+ /**
+ * NewL
+ * Two-phased constructor.
+ */
+ static ChspsFamilyListener* NewL(
+ MhspsFamilyObserver& aObserver );
+
+ /**
+ * ~ChspsFamilyListener
+ * Destructor.
+ */
+ virtual ~ChspsFamilyListener();
+
private:
@@ -115,19 +147,14 @@
* ConstructL
* By default Symbian 2nd phase constructor is private.
*/
- void ConstructL();
+ void ConstructL( MhspsFamilyObserver& aObserver );
/**
* ChspsCenRepListener
* C++ default constructor.
*/
- ChspsFamilyListener(
- MhspsFamilyObserver& aObserver );
+ ChspsFamilyListener();
- /**
- * Start listener.
- */
- void Queue();
/**
* Retrieves used display code.
@@ -137,20 +164,10 @@
private: // Data
- // Observer which is called when RunL occurs
- MhspsFamilyObserver& iObserver;
-
- // Window server session.
- RWsSession iWsSession;
-
// Client-side handle to a server-side window group.
RWindowGroup iWindowGroup;
- CWsScreenDevice* iScreenDevice;
-
- TUint32 iActiveFamily;
-
- TBool iFeatureManagerLoaded;
+ ChspsFamilyListenerActive* iFamilyListenerActive;
};
--- a/homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h Wed Mar 31 22:04:35 2010 +0300
@@ -343,6 +343,7 @@
* @return ThspsServiceCompletedMessage expressing the result of the call.
*/
ThspsServiceCompletedMessage hspsGetListHeaders(const ChspsODT& /*aSearchMask*/
+ , const TBool /*aCopyLogos*/
, CArrayPtrFlat<ChspsODT>& /*aHeaderList*/);
/**
@@ -806,14 +807,6 @@
ChspsDomNode& aPluginNode );
/**
- * Copies logo icons to Homescreen's private folder
- * @since S60 5.1
- * @param aAppUid Identifies the client process
- */
- void CopyIconsToHomescreenL(
- const TUint aAppUid );
-
- /**
* Appends missing plugin with a dummy configuration where status="Error"
* @since S60 5.0
* @param aAppDom is a DOM of an application configuration
@@ -884,8 +877,7 @@
TBool iSubscription;
TInt iDeliveryCount;
ChspsODT* iSearchMask;
- ChspsODT* iSetMask;
- TLanguage iLanguage;
+ ChspsODT* iSetMask;
ChspsThemeServer& iThemeServer;
// Identifies the client application
@@ -899,6 +891,7 @@
CArrayPtrSeg<ChspsODT>& iHeaderListCache;
ChspsThemeServerSession* iServerSession; // Not owned.
CFileMan* iFileMan;
+ TBool iMaintainLogoResources;
#ifdef HSPS_LOG_ACTIVE
/**
* Log bus.
--- a/homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h Wed Mar 31 22:04:35 2010 +0300
@@ -462,13 +462,13 @@
const TDesC8& aAttrValue );
/**
- * Retrieves a filename from a file declaration.
- * @since S60 5.1
+ * Retrieves filename from a logo declaration.
+ * @since S60 5.2
* @param aFileDeclaration "SKIN():MIF()", "MIF()", "UID()" or "file.ext" string
* @param aFilename Referred file name or NULL
* @return True if a file was referred from the declaration
*/
- static TBool hspsServerUtil::IsFile(
+ static TBool hspsServerUtil::IsLogoFile(
const TDesC& aFileDeclaration,
TFileName& aFilename );
@@ -542,7 +542,28 @@
const TDesC& aPath,
const TDesC& aFilename,
TFileName& aDrivePathName );
-
+
+ /**
+ * Resolves icon path information from the provided logo declaration.
+ * Example:
+ * Decl. = "mif(536999050\270513751\268475903\1.0\sources\icon.mif)"
+ * Source = "c\private\200159c0\themes\536999050\270513751\268475903\1.0\sources\icon.mif"
+ * Target = "c\private\102750f0\536999050\270513751\268475903\1.0\sources\icon.mif"
+ * Up.decl = "mif(c\private\102750f0\536999050\270513751\268475903\1.0\sources\icon.mif)"
+ * @since S60 5.2
+ * @param aLogoDeclaration Skin():mif(), mif(), uid(), icon.mif declaration
+ * @param aAppUid Identifies the private directory where the logo file is copied to
+ * @param aTargetPath Empty or location of the target file
+ * @param aSourcePath Empty or location of the source file
+ * @param aUpdatedDeclaration Empty or declaration which points to the target location
+ */
+ static void hspsServerUtil::PopulateLogoPathsL(
+ const TDesC& aLogoDeclaration,
+ const TUint aAppUid,
+ RBuf& aTargetPath,
+ RBuf& aSourcePath,
+ RBuf& aUpdatedDeclaration );
+
private:
/**
* Internal method. Do not call directly!
--- a/homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h Wed Mar 31 22:04:35 2010 +0300
@@ -179,7 +179,7 @@
_LIT(KhspsThemeServerName,"hspsthemeserver");
/** Supported manifest version */
-_LIT(KhspsSupportedManifestVersion,"1.0");
+_LIT(KhspsSupportedManifestVersion,"2.0");
/** hspsThemeServer Uid3 = SECUREID. */
const TUid KhspsThemeServerUid3 = {0x200159C0}; //old uid 0x10207254};
@@ -210,6 +210,7 @@
class ChspsRomInstaller;
class ChspsAutoInstaller;
class ChspsThemeServerSession;
+class ChspsFamily;
#ifdef HSPS_LOG_ACTIVE
class ChspsLogBus;
@@ -631,7 +632,19 @@
* @returns The active family
*/
TUint32 GetActiveFamilyL(
- const TInt aAppUid );
+ const TInt aAppUid );
+
+ /**
+ * Installs widgets located at \private\200159C0\install\ directories.
+ * @since S60 5.0
+ */
+ void InstallWidgetsL();
+
+ /**
+ * Install all widgets from uda
+ * @since S60 5.2
+ */
+ void InstallUDAWidgetsL();
public: // from MhspsFileChangeObserver
@@ -671,10 +684,11 @@
void HandleCenRepChangeL( const TUint32 aId );
-#if defined(WINSCW) || defined(__WINS__)
+
public: // from MshspFamilyObserver
TBool HandleFamilyChangeL( const ThspsFamily aNewFamily );
-#endif // defined(WINSCW)
+
+ ChspsFamily* Family();
private:
@@ -806,12 +820,6 @@
* @since S60 5.0
*/
void HandleRomInstallationsL();
-
- /**
- * Installs widgets located at \private\200159C0\install\ directories.
- * @since S60 5.0
- */
- void InstallWidgetsL();
/**
* Initiates uninstallation of a manifest file located under the imports folder.
@@ -977,15 +985,8 @@
*/
void RestoreConfigurationL(
ChspsODT& aOdt );
-
- /**
- * Install all widgets from uda
- * @since S60 5.2
- */
- void InstallUDAWidgetsL();
-
-#if defined(WINSCW) || defined(__WINS__)
+#if defined(WINSCW) || defined(__WINS__)
/**
* Executed at startup to activate root configurations which were designed
* for the current resolution.
@@ -993,7 +994,7 @@
*/
void ActivateRootConfigurationsL();
-#endif // defined(WINSCW)
+#endif // defined(WINSCW) || defined(__WINS__)
#ifdef _hsps_SERVER_SHUTDOWN_ENABLED_
CShutdown* iShutdown;
@@ -1066,10 +1067,10 @@
CHSPSBRHandler* iBRHandler;
-#if defined(WINSCW) || defined(__WINS__)
- // Listener for resolution and orientation changes
- ChspsFamilyListener* iFamilyListener;
-#endif // defined(WINSCW)
+
+ // Family handler, own
+ ChspsFamily* iFamily;
+
#ifdef HSPS_LOG_ACTIVE
/**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenpluginsrv/hspsmanager/src/hspsfamily.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -0,0 +1,179 @@
+/*
+* 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: Family gets resolution and orientation
+*
+*/
+
+#include "hspsfamily.h"
+#include "hsps_builds_cfg.hrh"
+#include "hspsmanifest.h"
+#include <featmgr.h>
+
+
+_LIT8(KTch, "_tch");
+const TInt KMaxFamilyLength( 20 );
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// ChspsFamily::NewL
+// -----------------------------------------------------------------------------
+//
+ChspsFamily* ChspsFamily::NewL()
+ {
+ ChspsFamily* self = new(ELeave) ChspsFamily();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// ChspsFamily::ChspsFamily
+// -----------------------------------------------------------------------------
+//
+ChspsFamily::ChspsFamily()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// ChspsFamily::ConstructL
+// -----------------------------------------------------------------------------
+//
+void ChspsFamily::ConstructL()
+ {
+
+ User::LeaveIfError( iWsSession.Connect() );
+
+ iScreenDevice = new (ELeave) CWsScreenDevice( iWsSession );
+
+ User::LeaveIfError( iScreenDevice->Construct() );
+
+ }
+
+
+// ------------------------------------------------------------------------------
+// ChspsFamily::~ChspsFamily
+// ------------------------------------------------------------------------------
+ChspsFamily::~ChspsFamily()
+ {
+
+ delete iScreenDevice;
+ iWsSession.Close();
+ }
+
+// -----------------------------------------------------------------------------
+// ChspsFamily::GetFamilyString
+// -----------------------------------------------------------------------------
+void ChspsFamily::GetFamilyString(
+ TDes8& aFamily )
+ {
+ // Append input with a prefix based on the active screen resolution
+ TPixelsTwipsAndRotation sizeAndRotation;
+ iScreenDevice->GetDefaultScreenSizeAndRotation( sizeAndRotation );
+ TSize resolution( sizeAndRotation.iPixelSize );
+ if( resolution.iWidth > resolution.iHeight )
+ {
+ TInt temp = resolution.iHeight;
+ resolution.iHeight = resolution.iWidth;
+ resolution.iWidth = temp;
+ }
+ switch( resolution.iHeight )
+ {
+ case 320:
+ {
+ if ( resolution.iWidth == 240 )
+ {
+ aFamily.Append( KFamilyQvga );
+ }
+ }
+ break;
+ case 640:
+ {
+ if( resolution.iWidth == 360 )
+ {
+ aFamily.Append( KFamilyQhd );
+ }
+ else if( resolution.iWidth == 480 )
+ {
+ aFamily.Append( KFamilyVga );
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ if( aFamily.Length() > 0 )
+ {
+ aFamily.Append( KTch );
+ }
+ }
+
+// -----------------------------------------------------------------------------
+// ChspsFamily::GetFamilyType
+// -----------------------------------------------------------------------------
+ThspsFamily ChspsFamily::GetFamilyType(
+ const TDesC8& aFamilyString )
+ {
+ ThspsFamily family( EhspsFamilyUnknown );
+
+ if( aFamilyString == KFamilyQvga )
+ {
+ family = EhspsFamilyQvga;
+ }
+ else if( aFamilyString == KFamilyQvga2 )
+ {
+ family = EhspsFamilyQvga2;
+ }
+ else if( aFamilyString == KFamilyVga )
+ {
+ family = EhspsFamilyVga;
+ }
+ else if( aFamilyString == KFamilyVga3 )
+ {
+ family = EhspsFamilyVga3;
+ }
+ else if( aFamilyString == KFamilyQhd )
+ {
+ family = EhspsFamilyQhd;
+ }
+ else if( aFamilyString == KFamilyQhd_tch )
+ {
+ family = EhspsFamilyQhd_tch;
+ }
+ else if( aFamilyString == KFamilyVga_tch )
+ {
+ family = EhspsFamilyVga_tch;
+ }
+
+ return family;
+ }
+
+// -----------------------------------------------------------------------------
+// ChspsFamily::GetFamilyType
+// -----------------------------------------------------------------------------
+ThspsFamily ChspsFamily::GetFamilyType()
+ {
+ TBuf8<KMaxFamilyLength> familyString;
+ GetFamilyString( familyString );
+ return GetFamilyType( familyString );
+ }
+
+
+
+// End of File
+
--- a/homescreenpluginsrv/hspsmanager/src/hspsfamilylistener.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/src/hspsfamilylistener.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -19,7 +19,6 @@
#include "hspsfamilylistener.h"
#include "hsps_builds_cfg.hrh"
#include "hspsmanifest.h"
-#include <featmgr.h>
_LIT8(KTch, "_tch");
@@ -35,9 +34,9 @@
//
ChspsFamilyListener* ChspsFamilyListener::NewL( MhspsFamilyObserver& aObserver )
{
- ChspsFamilyListener* self = new(ELeave) ChspsFamilyListener( aObserver );
+ ChspsFamilyListener* self = new(ELeave) ChspsFamilyListener( );
CleanupStack::PushL( self );
- self->ConstructL();
+ self->ConstructL( aObserver );
CleanupStack::Pop( self );
return self;
}
@@ -46,41 +45,77 @@
// ChspsFamilyListener::ChspsFamilyListener
// -----------------------------------------------------------------------------
//
-ChspsFamilyListener::ChspsFamilyListener( MhspsFamilyObserver& aObserver )
- : CActive( EPriorityStandard ), iObserver( aObserver), iActiveFamily( EhspsFamilyUnknown )
+ChspsFamilyListener::ChspsFamilyListener()
{
- CActiveScheduler::Add(this);
}
// -----------------------------------------------------------------------------
// ChspsFamilyListener::ConstructL
// -----------------------------------------------------------------------------
//
-void ChspsFamilyListener::ConstructL()
+void ChspsFamilyListener::ConstructL( MhspsFamilyObserver& aObserver )
{
- User::LeaveIfError( iWsSession.Connect() );
-
+
+ // ChspsFamily::ConstructL ChspsFamily's second phase constructor call
+ ChspsFamily::ConstructL();
+
+ iFamilyListenerActive = ChspsFamilyListenerActive::NewL( *this, aObserver );
+
// A group needs to be instansiated so that we're able to receive events
- iWindowGroup = RWindowGroup( iWsSession );
+ iWindowGroup = RWindowGroup( WsSession() );
User::LeaveIfError( iWindowGroup.Construct(2,ETrue) ); // '2' is a meaningless handle
// Enables for EEventScreenDeviceChanged events
iWindowGroup.EnableScreenChangeEvents();
-
- iScreenDevice = new (ELeave) CWsScreenDevice( iWsSession );
- User::LeaveIfError( iScreenDevice->Construct() );
// Start the listener
- Queue();
+ iFamilyListenerActive->Queue();
}
+
+
+
+
+ChspsFamilyListenerActive* ChspsFamilyListenerActive::NewL(
+ ChspsFamilyListener& aListener,
+ MhspsFamilyObserver& aObserver )
+ {
+ ChspsFamilyListenerActive* self = new( ELeave ) ChspsFamilyListenerActive(
+ aListener,
+ aObserver );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+ChspsFamilyListenerActive::~ChspsFamilyListenerActive()
+ {
+ Cancel();
+ }
+
+void ChspsFamilyListenerActive::ConstructL()
+ {
+ }
+
+ChspsFamilyListenerActive::ChspsFamilyListenerActive(
+ ChspsFamilyListener& aListener,
+ MhspsFamilyObserver& aObserver )
+ :CActive( EPriorityStandard ),
+ iListener( aListener),
+ iObserver( aObserver )
+ {
+ CActiveScheduler::Add(this);
+ }
+
+
// ------------------------------------------------------------------------------
-// ChspsFamilyListener::Queue
+// ChspsFamilyListenerActive::Queue
// ------------------------------------------------------------------------------
-void ChspsFamilyListener::Queue()
+void ChspsFamilyListenerActive::Queue()
{
ASSERT ( !IsActive() );
- iWsSession.EventReady( &iStatus );
+ iListener.WsSession().EventReady( &iStatus );
SetActive();
}
@@ -89,139 +124,31 @@
// ------------------------------------------------------------------------------
ChspsFamilyListener::~ChspsFamilyListener()
{
- Cancel();
- if ( iFeatureManagerLoaded )
+ if ( iFamilyListenerActive )
{
- FeatureManager::UnInitializeLib();
+ delete iFamilyListenerActive;
}
- delete iScreenDevice;
iWindowGroup.Close();
- iWsSession.Close();
}
+
+
+
// -----------------------------------------------------------------------------
-// ChspsFileChangeListener::GetFamilyString
+// ChspsFamilyListener::RunL
// -----------------------------------------------------------------------------
-void ChspsFamilyListener::GetFamilyString(
- TDes8& aFamily )
- {
- // Append input with a prefix based on the active screen resolution
- TPixelsTwipsAndRotation sizeAndRotation;
- iScreenDevice->GetDefaultScreenSizeAndRotation( sizeAndRotation );
- TSize resolution( sizeAndRotation.iPixelSize );
- if( resolution.iWidth > resolution.iHeight )
- {
- TInt temp = resolution.iHeight;
- resolution.iHeight = resolution.iWidth;
- resolution.iWidth = temp;
- }
- switch( resolution.iHeight )
- {
- case 320:
- {
- if ( resolution.iWidth == 240 )
- {
- aFamily.Append( KFamilyQvga );
- }
- }
- break;
- case 640:
- {
- if( resolution.iWidth == 360 )
- {
- aFamily.Append( KFamilyQhd );
- }
- else if( resolution.iWidth == 480 )
- {
- aFamily.Append( KFamilyVga );
- }
- }
- break;
-
- default:
- break;
- }
- if( aFamily.Length() > 0 )
- {
-// // Append input with a suffix based on the touch support
-// if ( !iFeatureManagerLoaded )
-// {
-// FeatureManager::InitializeLibL();
-// iFeatureManagerLoaded = ETrue;
-// }
-// if ( FeatureManager::FeatureSupported( KFeatureIdPenSupport ) )
-// {
- aFamily.Append( KTch );
-// }
- }
- }
-
-// -----------------------------------------------------------------------------
-// ChspsFileChangeListener::GetFamilyType
-// -----------------------------------------------------------------------------
-ThspsFamily ChspsFamilyListener::GetFamilyType(
- const TDesC8& aFamilyString )
- {
- ThspsFamily family( EhspsFamilyUnknown );
-
- if( aFamilyString == KFamilyQvga )
- {
- family = EhspsFamilyQvga;
- }
- else if( aFamilyString == KFamilyQvga2 )
- {
- family = EhspsFamilyQvga2;
- }
- else if( aFamilyString == KFamilyVga )
- {
- family = EhspsFamilyVga;
- }
- else if( aFamilyString == KFamilyVga3 )
- {
- family = EhspsFamilyVga3;
- }
- else if( aFamilyString == KFamilyQhd )
- {
- family = EhspsFamilyQhd;
- }
- else if( aFamilyString == KFamilyQhd_tch )
- {
- family = EhspsFamilyQhd_tch;
- }
- else if( aFamilyString == KFamilyVga_tch )
- {
- family = EhspsFamilyVga_tch;
- }
-
- return family;
- }
-
-// -----------------------------------------------------------------------------
-// ChspsFileChangeListener::GetFamilyType
-// -----------------------------------------------------------------------------
-ThspsFamily ChspsFamilyListener::GetFamilyType()
- {
- TBuf8<KMaxFamilyLength> familyString;
- GetFamilyString( familyString );
- return GetFamilyType( familyString );
- }
-
-// -----------------------------------------------------------------------------
-// ChspsFileChangeListener::RunL
-// -----------------------------------------------------------------------------
-void ChspsFamilyListener::RunL()
+void ChspsFamilyListenerActive::RunL()
{
TWsEvent wsEvent;
- iWsSession.GetEvent(wsEvent);
+ iListener.WsSession().GetEvent(wsEvent);
switch( wsEvent.Type() )
{
case EEventScreenDeviceChanged:
{
- ThspsFamily newFamily = GetFamilyType();
+ ThspsFamily newFamily = iListener.GetFamilyType();
if ( newFamily > EhspsFamilyUnknown )
{
iObserver.HandleFamilyChangeL( newFamily );
- iActiveFamily = newFamily;
}
break;
}
@@ -236,15 +163,15 @@
// ChspsFileChangeListener::DoCancel
// -----------------------------------------------------------------------------
//
-void ChspsFamilyListener::DoCancel()
+void ChspsFamilyListenerActive::DoCancel()
{
- iWsSession.EventReadyCancel();
+ iListener.WsSession().EventReadyCancel();
}
// -----------------------------------------------------------------------------
// ChspsFileChangeListener::RunError
// -----------------------------------------------------------------------------
-TInt ChspsFamilyListener::RunError(TInt /*aError*/)
+TInt ChspsFamilyListenerActive::RunError(TInt /*aError*/)
{
return KErrNone;
}
--- a/homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -380,7 +380,7 @@
if( iLogBus )
{
iLogBus->LogText( _L( "ChspsInstallationHandler::hspsInstallTheme(): - Installation failed with error code %d" ),
- errorCode );
+ err );
}
#endif
}
@@ -802,13 +802,24 @@
User::Leave( KErrNotSupported );
}
- else
+
+ ChspsFamily* family = iThemeServer.Family();
+ if ( !family )
{
- // Store package version
- iOdt->SetPackageVersionL( *iPackageVersion );
+ User::Leave( KErrNotSupported );
}
- // Set the resolution family
+ ThspsFamily familyType = family->GetFamilyType();
+ if ( familyType == EhspsFamilyUnknown )
+ {
+ User::Leave( KErrNotSupported );
+ }
+#if !defined(WINSCW) && !defined(__WINS__)
+ if ( !( familyType & iFamilyMask ) )
+ {
+ User::Leave( KErrNotSupported );
+ }
+#endif // !defined(WINSCW) && !defined(__WINS__)
iOdt->SetFamily( iFamilyMask );
// Store root, provider and theme uid
@@ -1675,7 +1686,11 @@
iPackageVersion = HBufC::NewL( KMaxFileName );
iPackageVersion->Des().Copy( aAttributes[argIndex].Value().DesC() );
// Is manifest supported by this parser?
- iPackageVerSupported = ETrue; //TODO temporarily enable till 0.3 to 1.0 changes have been integrated ( iPackageVersion->Des().Compare(KhspsSupportedManifestVersion) == 0);
+ iPackageVerSupported = EFalse;
+ if ( iPackageVersion->Des().Compare( KhspsSupportedManifestVersion ) == 0 )
+ {
+ iPackageVerSupported = ETrue;
+ }
break;
}
}
@@ -1754,10 +1769,8 @@
if ( localName == KFamily )
{
-#if defined(WINSCW) || defined(__WINS__)
const TPtrC8 familyPtr( iContent->Des() );
- iFamilyMask |= ChspsFamilyListener::GetFamilyType( familyPtr );
-#endif // defined(WINSCW)
+ iFamilyMask |= ChspsFamily::GetFamilyType( familyPtr );
}
else if ( localName == KConfigurationType )
{
@@ -2580,7 +2593,7 @@
// check whether skin/mif/uid declarations were used
TFileName filename;
- if ( hspsServerUtil::IsFile( resultPtr, filename ) )
+ if ( hspsServerUtil::IsLogoFile( resultPtr, filename ) )
{
// check whether the file reference is valid
TPath fullname;
--- a/homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -91,14 +91,15 @@
ChspsThemeServer& aThemeServer,
const TUint aSecureId ):
CTimer(EPriorityLow),
- iLanguage ( aThemeServer.DeviceLanguage() ),
iThemeServer( aThemeServer ),
iSecureId( aSecureId ),
iCentralRepository( aThemeServer.CentralRepository() ),
iDefinitionRepository( aThemeServer.DefinitionRepository() ),
iSecurityEnforcer( aThemeServer.SecurityEnforcer() ),
iHeaderListCache( aThemeServer.HeaderListCache() ),
- iFileMan( NULL )
+ iServerSession( NULL ),
+ iFileMan( NULL ),
+ iMaintainLogoResources( EFalse )
{
iDeliveryCount = 0;
iSubscription = EFalse;
@@ -194,11 +195,11 @@
}
iSearchMask = ChspsODT::NewL();
iSearchMask->UnMarshalHeaderL(searchMaskData);
-
- // check the device language
- iLanguage = iThemeServer.DeviceLanguage();
- iSearchMask->SetOdtLanguage( (TInt)iLanguage );
-
+
+ iMaintainLogoResources = EFalse;
+ TPckg<TInt> intPkg( iMaintainLogoResources );
+ messagePtr.ReadL(3, intPkg );
+
// now there is a subscription
iSubscription = ETrue;
// fetch the header list from repository
@@ -242,9 +243,6 @@
// is there headers to delivere left
if (iHeaderDataList->Count() > iDeliveryCount)
{
- // Handle copying of logo icon resources
- CopyIconsToHomescreenL( aMessage.SecureId().iId );
-
// at least one header on the list
TPtr8 bufPtr( iHeaderDataList->At(iDeliveryCount)->Des() );
iMessagePtr.WriteL(2, bufPtr, 0);
@@ -262,82 +260,6 @@
}
}
-// -----------------------------------------------------------------------------
-// ChspsMaintenanceHandler::CopyIconsToHomescreenL
-// -----------------------------------------------------------------------------
-//
-void ChspsMaintenanceHandler::CopyIconsToHomescreenL(
- const TUint aAppUid )
- {
- HBufC8* headerData = iHeaderDataList->At(iDeliveryCount);
- ChspsODT* header = ChspsODT::UnMarshalHeaderLC( headerData->Des() );
- if ( iServerSession && header )
- {
- if( header->LogoFile().Length() )
- {
- // If a file reference was found from the logo declaration
- TFileName filename;
- if ( hspsServerUtil::IsFile( header->LogoFile(), filename ) )
- {
- if ( !iFileMan )
- {
- iFileMan = CFileMan::NewL( iServerSession->FileSystem() );
- }
-
- // Get client's private directory:
- // We should use some common directory if there are more than one SAPI clients,
- // for now we can copy files to AI3's private folder
- _LIT( KPrivatePath, "c:\\private\\%X\\");
- TPath privatePath;
- privatePath.Format( KPrivatePath, aAppUid );
-
- // Append private path to the logo file reference
- TInt offset = header->LogoFile().FindF( filename );
- if ( offset >= 0 )
- {
- // Insert private path prior to the file reference
- HBufC* logoBuf = HBufC::NewLC(
- privatePath.Length() + header->LogoFile().Length() );
- logoBuf->Des().Copy( header->LogoFile() );
- logoBuf->Des().Insert( offset, privatePath );
- header->SetLogoFileL( logoBuf->Des() );
- CleanupStack::PopAndDestroy( logoBuf );
-
- // Replace the serialized header descriptor
- HBufC8* newHeaderData = header->MarshalHeaderL();
- CleanupStack::PushL( newHeaderData );
- iHeaderDataList->InsertL(
- iDeliveryCount,
- newHeaderData );
- CleanupStack::Pop( newHeaderData );
- delete headerData;
- headerData = 0;
- iHeaderDataList->Delete( iDeliveryCount + 1 );
- }
-
- // Set target directory for file copying
- TPath targetPath;
- targetPath.Copy( privatePath );
- targetPath.Append( filename );
-
- // Set source directory for file copying
- TFileName sourceFile;
- _LIT( KThemesFolder, "themes\\" );
- iServerSession->FileSystem().SessionPath( sourceFile );
- sourceFile.Append( KThemesFolder );
- sourceFile.Append( filename );
-
- // Create the target path and copy files when required
- hspsServerUtil::CopyResourceFileL(
- iServerSession->FileSystem(),
- *iFileMan,
- targetPath,
- sourceFile );
- }
- }
- }
- CleanupStack::PopAndDestroy( header );
- }
// -----------------------------------------------------------------------------
// ChspsMaintenanceHandler::SetServerSession
@@ -1859,14 +1781,20 @@
{
TBool isView = EFalse;
- ChspsDomNode* confNode =
- (ChspsDomNode*)aPluginNode.ChildNodes().FindByName( KConfigurationElement );
+ ChspsDomNode* confNode = static_cast<ChspsDomNode*>(
+ aPluginNode.ChildNodes().FindByName( KConfigurationElement ));
+
if( confNode )
{
- ChspsDomAttribute* typeAttr =
- (ChspsDomAttribute*)confNode->AttributeList().FindByName( KConfigurationAttrType );
- isView = ( typeAttr->Value().CompareF( KConfTypeView ) == 0 );
+ ChspsDomAttribute* typeAttr = static_cast<ChspsDomAttribute*>(
+ confNode->AttributeList().FindByName( KConfigurationAttrType ));
+
+ if( typeAttr )
+ {
+ isView = ( typeAttr->Value().CompareF( KConfTypeView ) == 0 );
+ }
}
+
return isView;
}
@@ -3841,8 +3769,10 @@
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
-ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsGetListHeaders(const ChspsODT& /*aSearchMask*/,
- CArrayPtrFlat<ChspsODT>& /*aHeaderList*/)
+ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsGetListHeaders(
+ const ChspsODT& /*aSearchMask*/,
+ const TBool /*aCopyLogos*/,
+ CArrayPtrFlat<ChspsODT>& /*aHeaderList*/)
{
return EhspsServiceNotSupported;
}
@@ -4052,6 +3982,18 @@
{
After(KHeaderListUpdatePollingTimeSpan);
}
+
+ else if( aRepositoryInfo.iEventType & EhspsODTAdded
+ || aRepositoryInfo.iEventType & EhspsODTUpdated )
+ {
+ // If a widget has been installed or updated
+ if( iServerSession )
+ {
+ // Make sure all logos are copied when user retrieves the list
+ iServerSession->SetIconFileCopyRequired( ETrue );
+ }
+ }
+
return EFalse;
}
@@ -4315,37 +4257,78 @@
void ChspsMaintenanceHandler::GetHeaderListL(
CArrayPtrSeg<HBufC8>& aHeaderDataList,
const ChspsODT& aSearchMask )
- {
- HBufC8* headerBuf = aSearchMask.MarshalHeaderL();
- if ( !headerBuf )
- {
- User::Leave(KErrGeneral);
- }
- CleanupStack::PushL( headerBuf );
- ChspsODT* searchOdt = ChspsODT::UnMarshalHeaderLC( *headerBuf );
-
+ {
// Reset search results
aHeaderDataList.ResetAndDestroy();
+
+ if( !iFileMan )
+ {
+ iFileMan = CFileMan::NewL( iServerSession->FileSystem() );
+ }
for ( TInt i = 0; i < iHeaderListCache.Count(); i++ )
{
ChspsODT* header = iHeaderListCache.At( i );
- // Check whether the header matches the search criteria
- if ( FilterHeader( *searchOdt, *header ) )
+ // Check whether the header matches the search criteria (family etc)
+ if ( FilterHeader( aSearchMask, *header ) )
{
- // Append to the search results
- HBufC8* data = header->MarshalHeaderL();
+
+ // Update file paths into the existing logo declarations
+ if( header->LogoFile().Length() &&
+ iMaintainLogoResources &&
+ ( header->ConfigurationType() == EhspsWidgetConfiguration ||
+ header->ConfigurationType() == EhspsTemplateConfiguration ) )
+ {
+
+ RBuf targetFile;
+ CleanupClosePushL( targetFile );
+ targetFile.CreateL( KMaxFileName );
+
+ RBuf sourceFile;
+ CleanupClosePushL( sourceFile );
+ sourceFile.CreateL( KMaxFileName );
+
+ RBuf newDeclaration;
+ CleanupClosePushL( newDeclaration );
+ newDeclaration.CreateL( header->LogoFile().Length() + KMaxFileName );
+
+ // Find location of the logo file and location where it shold be copied
+ hspsServerUtil::PopulateLogoPathsL(
+ header->LogoFile(),
+ iSecureId,
+ targetFile,
+ sourceFile,
+ newDeclaration );
+
+ if( targetFile.Length()
+ && sourceFile.Length()
+ && newDeclaration.Length() )
+ {
+ // Update private path information to the logo declaration
+ header->SetLogoFileL( newDeclaration );
+
+ hspsServerUtil::CopyResourceFileL(
+ iServerSession->FileSystem(),
+ *iFileMan,
+ targetFile,
+ sourceFile );
+ }
+
+ CleanupStack::PopAndDestroy( 3, &targetFile ); // targetFile, sourceFile, newDeclaration
+ }
+
+ // Convert the header to a descriptor
+ HBufC8* data = header->MarshalHeaderL();
if ( data )
{
+ // Append to the search results
CleanupStack::PushL( data );
aHeaderDataList.AppendL( data );
CleanupStack::Pop( data );
}
}
- }
-
- CleanupStack::PopAndDestroy( 2, headerBuf ); // searchOdt, headerBuf
+ }
}
// -----------------------------------------------------------------------------
@@ -4555,7 +4538,7 @@
)
&&
(
- ( aMask.ConfigurationType() && aMask.ConfigurationType() == aHeader.ConfigurationType() )
+ ( aMask.ConfigurationType() && ( aHeader.ConfigurationType() == aMask.ConfigurationType() ) )
||
( !aMask.ConfigurationType() )
)
@@ -4723,10 +4706,7 @@
// Get active root configuration for the client application
ChspsODT* appODT = ChspsODT::NewL();
- CleanupStack::PushL( appODT );
- iThemeServer.GetActivateAppConfigurationL(
- params.appUid,
- *appODT );
+ CleanupStack::PushL( appODT );
#ifdef HSPS_LOG_ACTIVE
if( iLogBus )
@@ -4741,12 +4721,20 @@
TInt err = KErrNone;
if ( !params.restoreAll )
{
- // Remove all widgets from the active view
- err = RestoreActiveViewL( *appODT );
- }
+ // reinstall all widgets
+ TRAP( err, iThemeServer.InstallWidgetsL();
+ iThemeServer.InstallUDAWidgetsL() );
+
+ // Force updating of the header cache
+ iThemeServer.UpdateHeaderListCacheL();
+ }
+
+ iThemeServer.GetActivateAppConfigurationL(
+ params.appUid,
+ *appODT );
// As a backup, if restoration of the active view fails,
- // or if all views but the locked view should be removed
+ // or if all views but the locked view should be removedc
if ( err || params.restoreAll )
{
// Remove all views but the locked one and reset active view
--- a/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -1660,10 +1660,10 @@
}
// -----------------------------------------------------------------------------
-// hspsServerUtil::IsFile
+// hspsServerUtil::IsLogoFile
// -----------------------------------------------------------------------------
//
-TBool hspsServerUtil::IsFile(
+TBool hspsServerUtil::IsLogoFile(
const TDesC& aFileDeclaration,
TFileName& aFilename )
{
@@ -1891,6 +1891,57 @@
return err;
}
+
+// -----------------------------------------------------------------------------
+// hspsServerUtil::ResolveLogoPathL
+// -----------------------------------------------------------------------------
+void hspsServerUtil::PopulateLogoPathsL(
+ const TDesC& aLogoDeclaration,
+ const TUint aAppUid,
+ RBuf& aTargetPath,
+ RBuf& aSourcePath,
+ RBuf& aUpdatedDeclaration)
+ {
+ // Process widget types only
+ if ( aLogoDeclaration.Length() && aAppUid > 0 )
+ {
+ // Get possible file name from the optional logo declaration
+ // and if found, populate the paths and update the declaration
+ TFileName filename;
+ if( IsLogoFile( aLogoDeclaration, filename ) )
+ {
+ // Get client's private directory
+ _LIT( KClientPrivatePath, "c:\\private\\%X\\");
+ TPath clientPath;
+ clientPath.Format( KClientPrivatePath, aAppUid );
+
+ // Updated logo declaration
+ TInt offset = aLogoDeclaration.FindF( filename );
+ __ASSERT_DEBUG( offset != KErrNotFound, User::Leave( KErrCorrupt ) );
+ if( aLogoDeclaration.Length() + aLogoDeclaration.Mid( offset ).Length() < KMaxFileName )
+ {
+ aUpdatedDeclaration.Copy( aLogoDeclaration );
+ aUpdatedDeclaration.Insert( offset, clientPath );
+
+ // Set path and name of the target file
+ if( clientPath.Length() + filename.Length() < KMaxFileName )
+ {
+ aTargetPath.Copy( clientPath );
+ aTargetPath.Append( filename );
+
+ // Set name of the source file
+ _LIT( KServerPrivateFolder, "c:\\private\\200159c0\\themes\\" );
+ if( KServerPrivateFolder().Length() + filename.Length() < KMaxFileName )
+ {
+ aSourcePath.Copy( KServerPrivateFolder );
+ aSourcePath.Append( filename );
+ }
+ }
+ }
+
+ }
+ }
+ }
// -----------------------------------------------------------------------------
// hspsServerUtil::hspsServerUtil
--- a/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -35,6 +35,7 @@
#include "hspsdefinitionrepository.h"
#include "hspsdefinitionengineinterface.h"
#include "hspsconfiguration.h"
+#include "hspsfamily.h"
#ifdef _hsps_PERFORMANCE_TEST_
#include "hspstimemon.h"
#endif //_hsps_PERFORMANCE_TEST_
@@ -316,7 +317,10 @@
// Get active device language
iDeviceLanguage = GetDeviceLanguage();
-
+#ifdef HSPS_LOG_ACTIVE
+ iLogBus->LogText( _L( "ChspsThemeServer::GetDeviceLanguage() %d" ), iDeviceLanguage );
+#endif
+
// Setup a search mask for finding headers from the cache
iCacheMask = ChspsODT::NewL();
@@ -345,10 +349,13 @@
// Start observing the notifications
iDefinitionRepository->RegisterObserverL( *this );
- // Resolution & orientation change listener
+
#if defined(WINSCW) || defined(__WINS__)
- iFamilyListener = ChspsFamilyListener::NewL( *this );
-#endif // defined(WINSCW)
+ // Resolution & orientation change listener
+ iFamily = ChspsFamilyListener::NewL( *this );
+#else
+ iFamily = ChspsFamily::NewL();
+#endif //defined(WINSCW) || defined(__WINS__)
// Auto-localize ODTs in the Definition Repository when the device language has changed
HandleLanguageChangeL();
@@ -440,11 +447,12 @@
DisableAutoInstallation();
#endif //__DISABLE_SISX_INSTALLATION_
-#if defined(WINSCW) || defined(__WINS__)
- delete iFamilyListener;
- iFamilyListener = NULL;
-#endif // defined(WINSCW)
-
+ if ( iFamily )
+ {
+ delete iFamily;
+ iFamily = NULL;
+ }
+
delete iCenRepListener;
iCenRepListener = NULL;
@@ -515,7 +523,7 @@
#ifdef HSPS_LOG_ACTIVE
iLogBus->LogText( _L( "ChspsThemeServer::AddSession(): - now %d concurrent sessions." ),
- iSessionCount );
+ iSessions.Count() );
#endif
}
@@ -544,7 +552,7 @@
#ifdef HSPS_LOG_ACTIVE
iLogBus->LogText( _L( "ChspsThemeServer::DropSession(): - %d concurrent sessions left." ),
- iSessionCount );
+ iSessions.Count() );
#endif
}
@@ -1882,10 +1890,6 @@
//
TLanguage ChspsThemeServer::GetDeviceLanguage()
{
-#ifdef HSPS_LOG_ACTIVE
- iLogBus->LogText( _L( "ChspsThemeServer::GetDeviceLanguage(): %d returned" ), User::Language() );
-#endif
-
return User::Language();
}
@@ -2757,7 +2761,7 @@
// Activate client specific root configurations from active display resolution
ActivateRootConfigurationsL();
#endif // defined(WINSCW)
-
+
res.Close();
CleanupStack::PopAndDestroy(1, &res);
}
@@ -3516,7 +3520,7 @@
void ChspsThemeServer::ActivateRootConfigurationsL()
{
// Get family from the active resolution
- const ThspsFamily family = iFamilyListener->GetFamilyType();
+ const ThspsFamily family = iFamily->GetFamilyType();
// Try to activate an application configuration which was designed
// for the active resolution
@@ -3526,6 +3530,8 @@
HandleFamilyChangeL( KDefaultFamily );
}
}
+#endif // defined(WINSCW) || defined(__WINS__)
+
// -----------------------------------------------------------------------------
// ChspsThemeServer::HandleFamilyChangeL()
@@ -3631,7 +3637,14 @@
return activated;
}
-#endif // defined(WINSCW)
+// -----------------------------------------------------------------------------
+// ChspsThemeServer::Family()
+// -----------------------------------------------------------------------------
+//
+ChspsFamily* ChspsThemeServer::Family()
+ {
+ return iFamily;
+ }
// end of file
--- a/homescreenpluginsrv/hspsodt/bwins/hspsodtu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsodt/bwins/hspsodtu.def Wed Mar 31 22:04:35 2010 +0300
@@ -22,33 +22,31 @@
?SetLogoFileL@ChspsODT@@QAEXABVTDesC16@@@Z @ 21 NONAME ; void ChspsODT::SetLogoFileL(class TDesC16 const &)
?SetFamily@ChspsODT@@QAEXK@Z @ 22 NONAME ; void ChspsODT::SetFamily(unsigned long)
?CloneL@ChspsODT@@QBEPAV1@XZ @ 23 NONAME ; class ChspsODT * ChspsODT::CloneL(void) const
- ?PackageVersion@ChspsODT@@QBEABVTDesC16@@XZ @ 24 NONAME ; class TDesC16 const & ChspsODT::PackageVersion(void) const
- ?AddResourceL@ChspsODT@@QAEXPAVChspsResource@@@Z @ 25 NONAME ; void ChspsODT::AddResourceL(class ChspsResource *)
- ?SetPackageVersionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 26 NONAME ; void ChspsODT::SetPackageVersionL(class TDesC16 const &)
- ?SetMultiInstance@ChspsODT@@QAEXH@Z @ 27 NONAME ; void ChspsODT::SetMultiInstance(int)
- ?MultiInstance@ChspsODT@@QBEHXZ @ 28 NONAME ; int ChspsODT::MultiInstance(void) const
- ?ConfigurationType@ChspsODT@@QBEIXZ @ 29 NONAME ; unsigned int ChspsODT::ConfigurationType(void) const
- ?NewLC@ChspsODT@@SAPAV1@ABVTDesC8@@@Z @ 30 NONAME ; class ChspsODT * ChspsODT::NewLC(class TDesC8 const &)
- ?ProviderName@ChspsODT@@QBEABVTDesC16@@XZ @ 31 NONAME ; class TDesC16 const & ChspsODT::ProviderName(void) const
- ?ResourceL@ChspsODT@@QBEAAVChspsResource@@H@Z @ 32 NONAME ; class ChspsResource & ChspsODT::ResourceL(int) const
- ?OdtLanguage@ChspsODT@@QBEHXZ @ 33 NONAME ; int ChspsODT::OdtLanguage(void) const
- ?MarshalHeaderL@ChspsODT@@QBEPAVHBufC8@@XZ @ 34 NONAME ; class HBufC8 * ChspsODT::MarshalHeaderL(void) const
- ?RootUid@ChspsODT@@QBEHXZ @ 35 NONAME ; int ChspsODT::RootUid(void) const
- ?ProviderUid@ChspsODT@@QBEHXZ @ 36 NONAME ; int ChspsODT::ProviderUid(void) const
- ?SetDescriptionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 37 NONAME ; void ChspsODT::SetDescriptionL(class TDesC16 const &)
- ?ThemeShortName@ChspsODT@@QBEABVTDesC16@@XZ @ 38 NONAME ; class TDesC16 const & ChspsODT::ThemeShortName(void) const
- ?ThemeFullName@ChspsODT@@QBEABVTDesC16@@XZ @ 39 NONAME ; class TDesC16 const & ChspsODT::ThemeFullName(void) const
- ?SetThemeVersionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 40 NONAME ; void ChspsODT::SetThemeVersionL(class TDesC16 const &)
- ?InternalizeResourceListL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 41 NONAME ; void ChspsODT::InternalizeResourceListL(class RReadStream &)
- ?CloneL@ChspsODT@@QAEXAAV1@@Z @ 42 NONAME ; void ChspsODT::CloneL(class ChspsODT &)
- ?SetPreviewFileL@ChspsODT@@QAEXABVTDesC16@@@Z @ 43 NONAME ; void ChspsODT::SetPreviewFileL(class TDesC16 const &)
- ?SetOdtLanguage@ChspsODT@@QAEXH@Z @ 44 NONAME ; void ChspsODT::SetOdtLanguage(int)
- ?ExternalizeHeaderL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 45 NONAME ; void ChspsODT::ExternalizeHeaderL(class RWriteStream &) const
- ?InternalizeHeaderL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 46 NONAME ; void ChspsODT::InternalizeHeaderL(class RReadStream &)
- ?ExternalizeL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 47 NONAME ; void ChspsODT::ExternalizeL(class RWriteStream &) const
- ?SetProviderUid@ChspsODT@@QAEXH@Z @ 48 NONAME ; void ChspsODT::SetProviderUid(int)
- ?UnMarshalHeaderL@ChspsODT@@QAEXABVTDesC8@@@Z @ 49 NONAME ; void ChspsODT::UnMarshalHeaderL(class TDesC8 const &)
- ?LogoFile@ChspsODT@@QBEABVTDesC16@@XZ @ 50 NONAME ; class TDesC16 const & ChspsODT::LogoFile(void) const
- ?ThemeUid@ChspsODT@@QBEHXZ @ 51 NONAME ; int ChspsODT::ThemeUid(void) const
- ?DeleteAllResources@ChspsODT@@QAEXXZ @ 52 NONAME ; void ChspsODT::DeleteAllResources(void)
+ ?AddResourceL@ChspsODT@@QAEXPAVChspsResource@@@Z @ 24 NONAME ; void ChspsODT::AddResourceL(class ChspsResource *)
+ ?SetMultiInstance@ChspsODT@@QAEXH@Z @ 25 NONAME ; void ChspsODT::SetMultiInstance(int)
+ ?MultiInstance@ChspsODT@@QBEHXZ @ 26 NONAME ; int ChspsODT::MultiInstance(void) const
+ ?ConfigurationType@ChspsODT@@QBEIXZ @ 27 NONAME ; unsigned int ChspsODT::ConfigurationType(void) const
+ ?NewLC@ChspsODT@@SAPAV1@ABVTDesC8@@@Z @ 28 NONAME ; class ChspsODT * ChspsODT::NewLC(class TDesC8 const &)
+ ?ProviderName@ChspsODT@@QBEABVTDesC16@@XZ @ 29 NONAME ; class TDesC16 const & ChspsODT::ProviderName(void) const
+ ?ResourceL@ChspsODT@@QBEAAVChspsResource@@H@Z @ 30 NONAME ; class ChspsResource & ChspsODT::ResourceL(int) const
+ ?OdtLanguage@ChspsODT@@QBEHXZ @ 31 NONAME ; int ChspsODT::OdtLanguage(void) const
+ ?MarshalHeaderL@ChspsODT@@QBEPAVHBufC8@@XZ @ 32 NONAME ; class HBufC8 * ChspsODT::MarshalHeaderL(void) const
+ ?RootUid@ChspsODT@@QBEHXZ @ 33 NONAME ; int ChspsODT::RootUid(void) const
+ ?ProviderUid@ChspsODT@@QBEHXZ @ 34 NONAME ; int ChspsODT::ProviderUid(void) const
+ ?SetDescriptionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 35 NONAME ; void ChspsODT::SetDescriptionL(class TDesC16 const &)
+ ?ThemeShortName@ChspsODT@@QBEABVTDesC16@@XZ @ 36 NONAME ; class TDesC16 const & ChspsODT::ThemeShortName(void) const
+ ?ThemeFullName@ChspsODT@@QBEABVTDesC16@@XZ @ 37 NONAME ; class TDesC16 const & ChspsODT::ThemeFullName(void) const
+ ?SetThemeVersionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 38 NONAME ; void ChspsODT::SetThemeVersionL(class TDesC16 const &)
+ ?InternalizeResourceListL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 39 NONAME ; void ChspsODT::InternalizeResourceListL(class RReadStream &)
+ ?CloneL@ChspsODT@@QAEXAAV1@@Z @ 40 NONAME ; void ChspsODT::CloneL(class ChspsODT &)
+ ?SetPreviewFileL@ChspsODT@@QAEXABVTDesC16@@@Z @ 41 NONAME ; void ChspsODT::SetPreviewFileL(class TDesC16 const &)
+ ?SetOdtLanguage@ChspsODT@@QAEXH@Z @ 42 NONAME ; void ChspsODT::SetOdtLanguage(int)
+ ?ExternalizeHeaderL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 43 NONAME ; void ChspsODT::ExternalizeHeaderL(class RWriteStream &) const
+ ?InternalizeHeaderL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 44 NONAME ; void ChspsODT::InternalizeHeaderL(class RReadStream &)
+ ?ExternalizeL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 45 NONAME ; void ChspsODT::ExternalizeL(class RWriteStream &) const
+ ?SetProviderUid@ChspsODT@@QAEXH@Z @ 46 NONAME ; void ChspsODT::SetProviderUid(int)
+ ?UnMarshalHeaderL@ChspsODT@@QAEXABVTDesC8@@@Z @ 47 NONAME ; void ChspsODT::UnMarshalHeaderL(class TDesC8 const &)
+ ?DeleteAllResources@ChspsODT@@QAEXXZ @ 48 NONAME ; void ChspsODT::DeleteAllResources(void)
+ ?LogoFile@ChspsODT@@QBEABVTDesC16@@XZ @ 49 NONAME ; class TDesC16 const & ChspsODT::LogoFile(void) const
+ ?ThemeUid@ChspsODT@@QBEHXZ @ 50 NONAME ; int ChspsODT::ThemeUid(void) const
--- a/homescreenpluginsrv/hspsodt/eabi/hspsodtu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsodt/eabi/hspsodtu.def Wed Mar 31 22:04:35 2010 +0300
@@ -16,8 +16,8 @@
_ZN8ChspsODT16UnMarshalHeaderLERK6TDesC8 @ 15 NONAME
_ZN8ChspsODT17SetThemeFullNameLERK7TDesC16 @ 16 NONAME
_ZN8ChspsODT17UnMarshalHeaderLCERK6TDesC8 @ 17 NONAME
- _ZN8ChspsODT18InternalizeHeaderLER11RReadStream @ 18 NONAME
- _ZN8ChspsODT18SetPackageVersionLERK7TDesC16 @ 19 NONAME
+ _ZN8ChspsODT18DeleteAllResourcesEv @ 18 NONAME
+ _ZN8ChspsODT18InternalizeHeaderLER11RReadStream @ 19 NONAME
_ZN8ChspsODT18SetThemeShortNameLERK7TDesC16 @ 20 NONAME
_ZN8ChspsODT20SetConfigurationTypeEj @ 21 NONAME
_ZN8ChspsODT24InternalizeResourceListLER11RReadStream @ 22 NONAME
@@ -38,18 +38,16 @@
_ZNK8ChspsODT13ResourceCountEv @ 37 NONAME
_ZNK8ChspsODT13ThemeFullNameEv @ 38 NONAME
_ZNK8ChspsODT14MarshalHeaderLEv @ 39 NONAME
- _ZNK8ChspsODT14PackageVersionEv @ 40 NONAME
- _ZNK8ChspsODT14ThemeShortNameEv @ 41 NONAME
- _ZNK8ChspsODT17ConfigurationTypeEv @ 42 NONAME
- _ZNK8ChspsODT24ExternalizeResourceListLER12RWriteStream @ 43 NONAME
- _ZNK8ChspsODT5FlagsEv @ 44 NONAME
- _ZNK8ChspsODT6CloneLEv @ 45 NONAME
- _ZNK8ChspsODT6FamilyEv @ 46 NONAME
- _ZNK8ChspsODT7RootUidEv @ 47 NONAME
- _ZNK8ChspsODT8LogoFileEv @ 48 NONAME
- _ZNK8ChspsODT8ThemeUidEv @ 49 NONAME
- _ZNK8ChspsODT9ResourceLEi @ 50 NONAME
- _ZTI8ChspsODT @ 51 NONAME
- _ZTV8ChspsODT @ 52 NONAME
- _ZN8ChspsODT18DeleteAllResourcesEv @ 53 NONAME
+ _ZNK8ChspsODT14ThemeShortNameEv @ 40 NONAME
+ _ZNK8ChspsODT17ConfigurationTypeEv @ 41 NONAME
+ _ZNK8ChspsODT24ExternalizeResourceListLER12RWriteStream @ 42 NONAME
+ _ZNK8ChspsODT5FlagsEv @ 43 NONAME
+ _ZNK8ChspsODT6CloneLEv @ 44 NONAME
+ _ZNK8ChspsODT6FamilyEv @ 45 NONAME
+ _ZNK8ChspsODT7RootUidEv @ 46 NONAME
+ _ZNK8ChspsODT8LogoFileEv @ 47 NONAME
+ _ZNK8ChspsODT8ThemeUidEv @ 48 NONAME
+ _ZNK8ChspsODT9ResourceLEi @ 49 NONAME
+ _ZTI8ChspsODT @ 50 NONAME
+ _ZTV8ChspsODT @ 51 NONAME
--- a/homescreenpluginsrv/hspsodt/src/hspsodt.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsodt/src/hspsodt.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -22,6 +22,9 @@
#include "hspsdomdocument.h"
#include "hspsresource.h"
+// ODT version number
+_LIT( KHpspOdtVersion, "3.0" );
+
// ============================ MEMBER FUNCTIONS ===============================
// -----------------------------------------------------------------------------
@@ -62,7 +65,6 @@
aTarget.SetThemeFullNameL( aSource.ThemeFullName() );
aTarget.SetThemeShortNameL( aSource.ThemeShortName() );
aTarget.SetThemeVersionL( aSource.ThemeVersion() );
- aTarget.SetPackageVersionL( aSource.PackageVersion() );
aTarget.SetDescriptionL( aSource.Description() );
aTarget.SetLogoFileL( aSource.LogoFile() );
aTarget.SetPreviewFileL( aSource.PreviewFile() );
@@ -126,7 +128,6 @@
delete iThemeFullName;
delete iThemeShortName;
delete iThemeVersion;
- delete iPackageVersion;
// clean up the array
if( iResourceList )
{
@@ -219,14 +220,10 @@
// (other items were commented in a header).
// -----------------------------------------------------------------------------
void ChspsODT::ExternalizeHeaderL( RWriteStream& aStream ) const
- {
- const TDesC& packageVersion = PackageVersion();
- aStream.WriteInt32L( packageVersion.Length() );
- if( packageVersion.Length() > 0 )
- {
- aStream << packageVersion;
- }
-
+ {
+ aStream.WriteInt32L( KHpspOdtVersion().Length() );
+ aStream << KHpspOdtVersion();
+
aStream.WriteUint32L( iThemeUid );
const TDesC& providerName = ProviderName();
@@ -297,11 +294,8 @@
TInt ChspsODT::HeaderSize() const
{
TInt size = sizeof( TInt32 );
- if( PackageVersion().Length() > 0 )
- {
- size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality.
- size += PackageVersion().Size();
- }
+ size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality.
+ size += KHpspOdtVersion().Size();
size += sizeof( TUint32 ); // iThemeUid
@@ -370,42 +364,18 @@
EXPORT_C void ChspsODT::InternalizeHeaderL( RReadStream& aStream )
{
TInt len = aStream.ReadInt32L();
- HBufC* version = NULL;
- if( len > 0 )
- {
- version = HBufC::NewL( aStream, len );
- }
- CleanupStack::PushL( version );
-
- // Check version request.
- if( iPackageVersion )
+ HBufC* odtVersion = NULL;
+ if ( len > 0 )
{
- TBool supported = ETrue;
- if( version == NULL )
- {
- supported = EFalse;
- }
- else if( version &&
- version->Compare( *iPackageVersion ) != 0 )
- {
- supported = EFalse;
- }
-
- if( !supported )
- {
- // Package version check requested (iPackageVersion defined)
- // and package version not supported
- User::Leave( KErrNotSupported );
- }
+ odtVersion = HBufC::NewL( aStream, len );
}
-
- if( version )
+ CleanupStack::PushL( odtVersion );
+ // ODT version check.
+ if ( KHpspOdtVersion() != *odtVersion )
{
- delete iPackageVersion;
- iPackageVersion = NULL;
- iPackageVersion = version->AllocL();
+ User::Leave( KErrNotSupported );
}
- CleanupStack::PopAndDestroy( version );
+ CleanupStack::PopAndDestroy( odtVersion );
iThemeUid = aStream.ReadUint32L();
@@ -927,42 +897,6 @@
}
// -----------------------------------------------------------------------------
-// ChspsODT::SetPackageVersionL
-// Set package version
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-EXPORT_C void ChspsODT::SetPackageVersionL( const TDesC& aVersion )
- {
- if( iPackageVersion )
- {
- delete iPackageVersion;
- iPackageVersion = NULL;
- }
-
- if( aVersion.Length() != 0 )
- {
- iPackageVersion = aVersion.AllocL();
- }
- }
-
-// -----------------------------------------------------------------------------
-// ChspsODT::PackageVersion
-// Get package version
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-EXPORT_C const TDesC& ChspsODT::PackageVersion() const
- {
- if ( iPackageVersion )
- {
- return *iPackageVersion;
- }
- else
- {
- return KNullDesC;
- }
- }
-
-// -----------------------------------------------------------------------------
// ChspsODT::SetFamily
// -----------------------------------------------------------------------------
EXPORT_C void ChspsODT::SetFamily( const TUint32 aFamilyMask )
--- a/homescreenpluginsrv/hspstools/group/hspstools.mmp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspstools/group/hspstools.mmp Wed Mar 31 22:04:35 2010 +0300
@@ -57,7 +57,7 @@
nostrictdef
-LIBRARY euser.lib flogger.lib hspsdomdocument.lib liwservicehandler.lib estor.lib efsrv.lib hspsodt.lib charconv.lib hspsresource.lib
+LIBRARY euser.lib flogger.lib hspsdomdocument.lib liwservicehandler.lib estor.lib efsrv.lib hspsodt.lib charconv.lib hspsresource.lib
#ifdef ENABLE_ABIV2_MODE
DEBUGGABLE
--- a/homescreenpluginsrv/hspstools/src/hspslogbusfile.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspstools/src/hspslogbusfile.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -18,7 +18,7 @@
#include "hspslogbusfile.h"
#include "e32debug.h"
-
+#include "f32file.h"
// Constants
#ifdef HSPS_BUILD_LOG_IMPLEMENTATION
@@ -86,6 +86,13 @@
#ifdef HSPS_BUILD_LOG_IMPLEMENTATION
EXPORT_C TFileName ChspsLogBusFile::CreateLogFilename( const TDesC& aBaseline )
{
+ RFs fs;
+ if ( KErrNone == fs.Connect() )
+ {
+ fs.MkDirAll(_L("c:\\logs\\hsps\\"));
+ fs.Close();
+ }
+
TFileName fileName;
// Append baseline and trailing '_'.
--- a/homescreenpluginsrv/inc/hspsclient.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/inc/hspsclient.h Wed Mar 31 22:04:35 2010 +0300
@@ -267,8 +267,10 @@
/**
* From MhspsMaintenanceService.
*/
- IMPORT_C ThspsServiceCompletedMessage hspsGetListHeaders(const ChspsODT& aSearchMask,
- CArrayPtrFlat<ChspsODT>& aHeaderList);
+ IMPORT_C ThspsServiceCompletedMessage hspsGetListHeaders(
+ const ChspsODT& aSearchMask,
+ const TBool aCopyLogos,
+ CArrayPtrFlat<ChspsODT>& aHeaderList );
/**
* From MhspsMaintenanceService.
@@ -324,11 +326,14 @@
* @param aSearchMask is ChspsODT-object which attributes are filled to present search
* parameters for theme set queried by client. This parametrisation follows
* the high-level schema.
+ * @param aCopyLogos is set if client wants to view logos
* @param aHeaderList is an list object able to carry ChspsODT-objects.
* @return Error code
*/
- IMPORT_C TInt hspsGetHeaders(const ChspsODT& aSearchMask,
- CArrayPtrFlat<ChspsODT>& aHeaderList);
+ IMPORT_C TInt hspsGetHeaders(
+ const ChspsODT& aSearchMask,
+ const TBool aCopyLogos,
+ CArrayPtrFlat<ChspsODT>& aHeaderList);
/**
* From MhspsMaintenanceService
--- a/homescreenpluginsrv/inc/hspsclientsession.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/inc/hspsclientsession.h Wed Mar 31 22:04:35 2010 +0300
@@ -85,11 +85,12 @@
* @since S60 5.0
* @param aResultData Result data.
* @param aSearchMaskData Search mask data.
+ * @param aCopyLogos Set if logo resources should be copied to client
* @param aHeaderData Header data.
* @return Symbian error code.
*/
IMPORT_C TInt GetListHeaders(TDes8& aResultData, const TDesC8& aSearchMaskData,
- TDes8& aHeaderData);
+ const TBool aCopyLogos,TDes8& aHeaderData);
/**
* SetActiveTheme.
--- a/homescreenpluginsrv/inc/hspsodt.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/inc/hspsodt.h Wed Mar 31 22:04:35 2010 +0300
@@ -384,22 +384,6 @@
* @return TUint configuration type.
*/
IMPORT_C TUint ConfigurationType() const;
-
- /**
- * Set package version.
- *
- * @since S60 5.0
- * @param aVersion Version.
- */
- IMPORT_C void SetPackageVersionL( const TDesC& aVersion );
-
- /**
- * Get configuration type.
- *
- * @since S60 5.0
- * @return TDesC package version
- */
- IMPORT_C const TDesC& PackageVersion() const;
/**
* Set family.
@@ -506,9 +490,6 @@
TInt HeaderSize() const;
private: // Data
- // Indicates whether we are able to internalize the instance
- HBufC* iPackageVersion;
-
// Identifies specific configuration
TUint iThemeUid;
HBufC* iProviderName;
--- a/homescreenpluginsrv/inc/hspsthememanagement.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/inc/hspsthememanagement.h Wed Mar 31 22:04:35 2010 +0300
@@ -1294,11 +1294,14 @@
* @param aSearchMask is ChspsODT-object which attributes are filled to present search
* parameters for theme set queried by client. This parametrisation follows the
* high-level schema.
+ * @param aCopyLogos indicates that logo resources should be copied to a private directory
* @param aHeaderList is an list object able to carry ChspsODT-objects.
* @return ThspsServiceCompletedMessage expressing the result of the call.
*/
- virtual ThspsServiceCompletedMessage hspsGetListHeaders(const ChspsODT& aSearchMask,
- CArrayPtrFlat<ChspsODT>& aHeaderList) = 0;
+ virtual ThspsServiceCompletedMessage hspsGetListHeaders(
+ const ChspsODT& aSearchMask,
+ const TBool aCopyLogos,
+ CArrayPtrFlat<ChspsODT>& aHeaderList) = 0;
/** hspsGetListHeaders
*
--- a/homescreenpluginsrv/rom/hsps.iby Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/rom/hsps.iby Wed Mar 31 22:04:35 2010 +0300
@@ -10,7 +10,7 @@
* Nokia Corporation - initial contribution.
*
* Contributors:
-*
+* NTT DOCOMO, INC - Fixing Bug 399 - hsps.iby includes 200159C9.txt which is already included by s60cenrep_variant.iby
* Description: IBY file for ROM image creation
*
*/
@@ -47,9 +47,6 @@
//Backup registration
data=DATAZ_\private\200159c0\backup_registration.xml private\200159c0\backup_registration.xml
-//Cenrep ini
-data=DATAZ_\private\10202be9\200159c9.txt private\10202be9\200159c9.txt
-
#endif // HSPS_IBY
// End of File
--- a/homescreensrv_plat/ai_plugin_management_api/inc/hscontentpublisher.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/ai_plugin_management_api/inc/hscontentpublisher.h Wed Mar 31 22:04:35 2010 +0300
@@ -165,7 +165,12 @@
* Provides access to localized plugin name if supported. HBufC*
* @see EPublisherResources
*/
- EPluginName
+ EPluginName,
+
+ /**
+ * Provides access to CPS command buffer.
+ */
+ ECpsCmdBuffer
};
public:
--- a/homescreensrv_plat/ai_utilities_api/group/bld.inf Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/ai_utilities_api/group/bld.inf Wed Mar 31 22:04:35 2010 +0300
@@ -31,6 +31,7 @@
../inc/aipluginsettings.h MW_LAYER_PLATFORM_EXPORT_PATH(aipluginsettings.h)
../inc/aistrcnv.h MW_LAYER_PLATFORM_EXPORT_PATH(aistrcnv.h)
../inc/contentprioritymap.h MW_LAYER_PLATFORM_EXPORT_PATH(contentprioritymap.h)
+../inc/aicpscommandbuffer.h MW_LAYER_PLATFORM_EXPORT_PATH(aicpscommandbuffer.h)
#ifdef __COVER_DISPLAY
../inc/aisecondarydisplayapi.h MW_LAYER_PLATFORM_EXPORT_PATH(secondarydisplay/aisecondarydisplayapi.h)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/ai_utilities_api/inc/aicpscommandbuffer.h Wed Mar 31 22:04:35 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* 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: Cps command buffer interface
+*
+*/
+
+
+#ifndef M_CAICPSCOMMANDBUFFER_H
+#define M_CAICPSCOMMANDBUFFER_H
+
+// System includes
+#include <e32base.h>
+
+// User includes
+
+// Forward declarations
+class CLiwDefaultMap;
+
+/**
+ * AI Cps command buffer interface
+ *
+ * @lib aifw
+ * @since S60 v5.2
+ */
+class MAiCpsCommandBuffer
+ {
+public:
+ // new functions
+
+ /**
+ * Adds command to command buffer queue
+ *
+ * @since S60 5.2
+ * @param aPluginId plugin id.
+ * @param aType type of the cps registry.
+ * @param aFilter filter values.
+ * @param aAction action trigger.
+ */
+ virtual void AddCommand( const TDesC& aPluginId,
+ const TDesC& aType, CLiwDefaultMap* aFilter,
+ const TDesC8& aAction) = 0;
+
+protected:
+ // destructor
+
+ ~MAiCpsCommandBuffer() { }
+ };
+
+#endif // M_CAICPSCOMMANDBUFFER_H
+
+// End of file
+
--- a/homescreensrv_plat/context_utility_api/group/bld.inf Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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: File that exports the files belonging to context utility api
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-../inc/hgcontextutilitybase.h MW_LAYER_PLATFORM_EXPORT_PATH(hg/hgcontextutilitybase.h)
-../inc/hgcontextutility.h MW_LAYER_PLATFORM_EXPORT_PATH(hg/hgcontextutility.h)
-../inc/hgcontextdef.h MW_LAYER_PLATFORM_EXPORT_PATH(hg/hgcontextdef.h)
--- a/homescreensrv_plat/context_utility_api/inc/hgcontextdef.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +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: Context types
-*
-*/
-
-
-#ifndef HGCONTEXTDEF_H
-#define HGCONTEXTDEF_H
-
-#include <e32base.h>
-
-// context source
-_LIT( KHgCFSource, "Hg" );
-
-// context types
-_LIT( KHgCFTypeContact, "Contact" );
-_LIT( KHgCFTypePbkContact, "PbkContact" );
-_LIT( KHgCFTypePbkContactMulti, "PbkContactMulti" );
-_LIT( KHgCFTypeText, "Text" );
-_LIT( KHgCFTypePhoto, "Photo" );
-_LIT( KHgCFTypeActiveDate, "ActiveDate" );
-_LIT( KHgCFTypeUrl, "Url" );
-_LIT( KHgCFTypeDate, "Date" );
-
-_LIT( KHgCFTypeMusicState, "MusicState" );
-_LIT( KHgCFTypeMusicArtist, "MusicArtist" );
-_LIT( KHgCFTypeMusicTitle, "MusicTitle" );
-_LIT( KHgCFTypeMusicAlbum, "MusicAlbum" );
-_LIT( KHgCFTypeMusicAlbumArt, "MusicAlbumArt" );
-_LIT( KHgCFTypeMusicUri, "MusicUri" );
-_LIT( KHgCFTypeMusicGenre, "MusicGenre" );
-_LIT( KHgCFTypeMusicType, "MusicType" );
-
-_LIT( KHgCFTypeMusicRadioName, "MusicRadioName" );
-_LIT( KHgCFTypeMusicRadioUrl, "MusicRadioUrl" );
-_LIT( KHgCFTypeMusicRadioFrequency, "MusicRadioFrequency" );
-_LIT( KHgCFTypeMusicRadioRDSPI, "MusicRadioRDSPI" );
-
-_LIT( KHgCFTypeVideoState, "VideoState" );
-_LIT( KHgCFTypeVideoTitle, "VideoTitle" );
-_LIT( KHgCFTypeVideoUri, "VideoUri" );
-_LIT( KHgCFTypeVideoType, "VideoType" );
-
-_LIT( KHgCFTypeTvChannelName, "TvChannelName" );
-_LIT( KHgCFTypeTvProgramName, "TvProgramName" );
-_LIT( KHgCFTypeTvProgramDesc, "TvProgramDesc" );
-_LIT( KHgCFTypeTvProgramGenre, "TvProgramGenre" );
-
-_LIT( KHgCFTypeGpsLatitude, "GpsLatitude" );
-_LIT( KHgCFTypeGpsLongitude, "GpsLongitude" );
-
-_LIT( KHgCFTypeOviId, "OviId" );
-
-// some pre-defined values
-_LIT( KHgCFValueUnknownContact, "<unknown>" ); // special value for PbkContact
-_LIT( KHgCFValueUnknownInfo, "<unknown>" ); // e.g. for TV contexts, when information is not available
-_LIT( KHgCFValueMusicTypePlayer, "MusicPlayer" );
-_LIT( KHgCFValueMusicTypeRadio, "Radio" );
-_LIT( KHgCFValueVideoTypeLocal, "VideoLocal" );
-_LIT( KHgCFValueVideoTypeStream, "VideoStream" );
-
-_LIT( KHgCFServiceIdPrefixOvi, "Ovi" ); // for CHgContextUtility::PublishServiceIdL
-
-#endif // HGCONTEXTDEF_H
--- a/homescreensrv_plat/context_utility_api/inc/hgcontextutility.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,327 +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: Context publishing helper dll
- *
-*/
-
-
-#ifndef HGCONTEXTUTILITY_H
-#define HGCONTEXTUTILITY_H
-
-#include <e32base.h>
-#include <e32cmn.h>
-#include <bamdesca.h>
-#include <badesca.h>
-#include <mdccommon.h>
-#include <hg/hgcontextutilitybase.h>
-
-class MVPbkStoreContact;
-class MVPbkContactLink;
-class CVPbkContactLinkArray;
-class CMdESession;
-
-/**
- * Utility class to publish and access context through the Context Framework.
- * @lib hgcontextutility.lib
- *
- * Typical usage in applications that are publishing context:
- * During construction:
- * \code
- * iContextUtility = CHgContextUtility::NewL();
- * iContextUtility->RePublishWhenFgL( ETrue );
- * \endcode
- * Publishing is accomplished with one single call, for example:
- * \code
- * void ContactChanged( MVPbkStoreContact* aNewContact ) {
- * ...
- * iContextUtility->PublishContactContextL( *aNewContact );
- * ...
- * \endcode
- *
- * By default publishing requests are ignored if the application is
- * not in foreground (does not apply to apps that do not have the
- * ui environment). If there is still a good reason to allow this
- * then call AllowPublishFromBackground( ETrue ).
- */
-NONSHARABLE_CLASS( CHgContextUtility ) : public CHgContextUtilityBase
- {
-public:
- /**
- * 2-phased constructor.
- */
- IMPORT_C static CHgContextUtility* NewL();
-
- /**
- * 2-phased constructor.
- */
- IMPORT_C static CHgContextUtility* NewLC();
-
- /*
- * Destructor.
- */
- IMPORT_C ~CHgContextUtility();
-
- /**
- * Publishes contact context.
- * @param aContact contact
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishContactContextL( const MVPbkStoreContact& aContact,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Publishes contact context.
- * @param aContactLink contact link
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishContactContextL( const MVPbkContactLink& aContactLink,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Publishes contact context.
- * Attempts to publish an empty value will be ignored.
- *
- * Prefer using the overloads taking vpbk contact or link, whenever possible.
- * Use this in case of unknown contacts only, that is, a name, phone number,
- * or email address that does not belong to a phonebook contact.
- *
- * @param aContactName formatted name, phone number, or email address,
- * or a combination of them, e.g. "firstname lastname", "+12345678",
- * "lastname firstname <abcd@efg.com>", "firstname, lastname <0501234567>".
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishContactContextL( const TDesC& aContactName,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Overload for publishing multiple contacts.
- * Ownership of passed pointers is not taken.
- * @param aContacts contact array
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishContactContextL(
- const RPointerArray<MVPbkStoreContact>& aContacts,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Overload for publishing multiple contacts.
- * @param aContactLinks contact link array
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishContactContextL(
- const CVPbkContactLinkArray& aContactLinks,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Overload for publishing multiple contacts.
- * @param aContactNames string array, for element format
- * see PublishContactContextL(const TDesC&)
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishContactContextL( const MDesCArray& aContactNames,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Publishes freetext context.
- * Not to be used for bulk text (e.g. full content of some text viewer component).
- * @param aText some text, typically the highlighted substring
- * from a viewer or editor control
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishTextContextL( const TDesC& aText,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Publishes URL context.
- * @param aUrl URL
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishUrlContextL( const TDesC& aUrl,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Publishes date/time context.
- * @param aTime time
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishTimeContextL( const TTime& aTime,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Publishes photo context.
- * @param aFilename name of image file, with full path
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishPhotoContextL( const TDesC& aFilename,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Publishes photo context.
- * @param aMdeItemId item id for the Image object in MDS
- * @param aMdeSession opened metadata engine session
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishPhotoContextL( TItemId aMdeItemId,
- CMdESession& aMdeSession,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Publishes TV context.
- * Pass KNullDesC if some of the needed data is not available.
- * @param aChannelName channel name
- * @param aProgramName program name
- * @param aProgramDescription program description
- * @param aGenre genre
- */
- IMPORT_C void PublishTvContextL(
- const TDesC& aChannelName,
- const TDesC& aProgramName,
- const TDesC& aProgramDescription,
- const TDesC& aGenre );
-
- /**
- * Publishes an account id as contact context.
- *
- * @param aServiceId the service prefix, e.g. "Ovi"
- * @param aAccountId the account id
- * @param aDelay if non-zero then context is published only after
- * a short delay. If a new publish call is made before the timer fires the
- * pending value will not be published.
- */
- IMPORT_C void PublishServiceIdL( const TDesC& aServiceId,
- const TDesC& aAccountId,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Enables or disables automatic re-publishing of the latest
- * context (published via this context utility instance) whenever
- * the application comes to foreground.
- *
- * It is DISABLED by default.
- *
- * By enabling this the applications do not have to care about
- * context publishing in HandleForegroundEventL etc.
- *
- * The feature needs CCoeEnv and calls will be ignored if the
- * environment is not available.
- *
- * @param aEnable flag to turn the feature on/off
- */
- IMPORT_C void RePublishWhenFgL( TBool aEnable );
-
- /**
- * Enables or disables context publishing when being in background.
- * Applies to all PublishContextL variants.
- * If disabled then no context will be published if it seems that the
- * caller application is not in foreground.
- * Has no effect if there is no CCoeEnv available, publishing is always
- * allowed in that case.
- *
- * It is DISABLED by default, that is, publishing is not allowed
- * from applications that are not in foreground.
- *
- * @param aAllow flag to turn the feature on/off
- */
- IMPORT_C void AllowPublishFromBackground( TBool aAllow );
-
- /**
- * Adds new music context info to music context publishing parameters.
- * This method is to be used in context with PublishMusicContextL. Fill in the
- * parameters and then call PublishMusicContextL.
- * This parameter list is cleared after publishing music context.
- *
- * @param aKey Name of the key to be published.
- * @param aData Data for the key.
- * @leave KErrNotFound, when key is empty.
- * @leave KErrAlreadyExists, when key is already in the list.
- * @see hgcontextdef.h for keys
- * @see PublishMusicContextL
- */
- IMPORT_C void AddMusicContextInfoL( const TDesC& aKey, const TDesC& aData );
-
- /**
- * Publishes music context from provided parameters as music context.
- * Publishes all known (in hgcontextdef.h) music context fields as music
- * context. All keys, which do not contain any data, are automatically
- * filled with '<unknown>' -string.
- * Clears the parameter list after publishing the context.
- *
- * @leave KErrNotReady, when music context data parameter list is empty.
- * * @see hgcontextdef.h for keys
- * @see AddMusicContextInfoL
- */
- IMPORT_C void PublishMusicContextL(
- const TTimeIntervalMicroSeconds32& aDelay = 0 );
-
- /**
- * Publishes Radio context.
- * Pass KNullDesC if some of the needed data is not available.
- * @param aRadioName radio name
- * @param aRadioUrl radio url
- * @param aRadioFrequency radio frequency
- * @param aRadioRDSPI radio identification code
- */
- IMPORT_C void PublishRadioContextL(
- const TDesC& aRadioName,
- const TDesC& aRadioUrl,
- const TDesC& aRadioFrequency,
- const TDesC& aRadioRDSPI );
-
- /**
- * Creates a combined string from the elements of the given array.
- * Returns NULL if the array has less than 2 elements.
- * @param aArray string array
- * @return combined string or NULL, ownership transferred to caller
- */
- IMPORT_C static HBufC* BuildCombinedStringL( const MDesCArray& aArray );
-
- /**
- * Splits the given combined string and appends the components to
- * the given array. The initial content of the array is not modified.
- * If aString does not seem to be a string combined from multiple entries
- * then aString is appended to aArray without any changes.
- * @param aString combined string, input
- * @param aArray array, output
- */
- IMPORT_C static void SplitCombinedStringL( const TDesC& aString,
- CDesCArray& aArray );
-
-protected:
- CHgContextUtility();
- void ConstructL();
- };
-
-#endif /* HGCONTEXTUTILITY_H */
--- a/homescreensrv_plat/context_utility_api/inc/hgcontextutilitybase.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +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: Context publishing helper dll
- *
-*/
-
-
-#ifndef HGCONTEXTUTILITYBASE_H
-#define HGCONTEXTUTILITYBASE_H
-
-#include <e32base.h>
-#include <bamdesca.h>
-
-class CHgContextUtilityImpl;
-
-/**
- * Utility base class to publish and access context through the Context Framework.
- * @lib hgcontextutility.lib
- */
-class CHgContextUtilityBase : public CBase
- {
-public:
- /**
- * Publishes context.
- * Also defines the context if it has not been defined.
- * Publishing empty value is not allowed, however such errors are ignored
- * here so the function will not leave when CFW responds with KErrArgument.
- * The security policy for the context will be set to require
- * LocalServices capability.
- * @param aContextType context type, source is always KHgCFSource
- * @param aContextData value for the context
- */
- IMPORT_C void PublishContextL( const TDesC& aContextType,
- const TDesC& aContextData );
-
- /**
- * Publishes context, the value will contain all the strings
- * from the given array, typically by using some separator character.
- * @see PublishContextL
- * @param aContextType context type, source is always KHgCFSource
- * @param aContextData value for the context will be a combined
- * version of all the strings from this array
- */
- IMPORT_C void PublishContextL( const TDesC& aContextType,
- const MDesCArray& aContextData );
-
- /**
- * Publishes context but only after a short interval, using a timer.
- * If it is called again before the timer expires then the timer
- * is restarted (and so the previous pending value is never published).
- * @param aContextType context type, source is always KHgCFSource
- * @param aContextData value for the context
- * @param aDelay delay for the timer, in microseconds
- */
- IMPORT_C void PublishContextDelayedL( const TDesC& aContextType,
- const TDesC& aContextData, const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Overload for delayed publishing of a value combined from multiple strings.
- * @param aContextType context type
- * @param aContextData string array
- * @param aDelay delay for the timer, in microseconds
- */
- IMPORT_C void PublishContextDelayedL( const TDesC& aContextType,
- const MDesCArray& aContextData, const TTimeIntervalMicroSeconds32& aDelay );
-
- /**
- * Requests the given context and returns the value for the
- * first result. Returns NULL if not found.
- * @param aContextType context type, the source is always KHgCFSource
- */
- IMPORT_C HBufC* GetContextL( const TDesC& aContextType );
-
- /**
- * Requests the given context and returns the value for the
- * first result. Returns NULL if not found.
- * @param aContextSource context source
- * @param aContextType context type
- */
- IMPORT_C HBufC* GetContextL( const TDesC& aContextSource,
- const TDesC& aContextType );
-
-protected:
- CHgContextUtilityBase();
- ~CHgContextUtilityBase();
- void BaseConstructL();
- CHgContextUtilityImpl* iImpl;
- };
-
-#endif /* HGCONTEXTUTILITYBASE_H */
--- a/homescreensrv_plat/context_utility_api/tsrc/bwins/t_ui_context_utility_apiu.def Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-EXPORTS
- ?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * LibEntryL(void)
- ?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int SetRequirements(class CTestModuleParam * &, unsigned long &)
- ?PublishContactContextL@CHgContextUtility@@QAEXABV?$RPointerArray@VMVPbkStoreContact@@@@ABVTTimeIntervalMicroSeconds32@@@Z @ 3 NONAME ; void CHgContextUtility::PublishContactContextL(class RPointerArray<class MVPbkStoreContact> const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishContactContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 4 NONAME ; void CHgContextUtility::PublishContactContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ??1CHgContextUtility@@UAE@XZ @ 5 NONAME ; CHgContextUtility::~CHgContextUtility(void)
- ?NewLC@CHgContextUtility@@SAPAV1@XZ @ 6 NONAME ; class CHgContextUtility * CHgContextUtility::NewLC(void)
- ?RePublishWhenFgL@CHgContextUtility@@QAEXH@Z @ 7 NONAME ; void CHgContextUtility::RePublishWhenFgL(int)
- ?PublishPhotoContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 8 NONAME ; void CHgContextUtility::PublishPhotoContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 9 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkContactLink@@ABVTTimeIntervalMicroSeconds32@@@Z @ 10 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkContactLink const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishUrlContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 11 NONAME ; void CHgContextUtility::PublishUrlContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishTvContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 12 NONAME ; void CHgContextUtility::PublishTvContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &)
- ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@@Z @ 13 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class MDesC16Array const &)
- ?AllowPublishFromBackground@CHgContextUtility@@QAEXH@Z @ 14 NONAME ; void CHgContextUtility::AllowPublishFromBackground(int)
- ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkStoreContact@@ABVTTimeIntervalMicroSeconds32@@@Z @ 15 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkStoreContact const &, class TTimeIntervalMicroSeconds32 const &)
- ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@@Z @ 16 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &)
- ?NewL@CHgContextUtility@@SAPAV1@XZ @ 17 NONAME ; class CHgContextUtility * CHgContextUtility::NewL(void)
- ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 18 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ?SplitCombinedStringL@CHgContextUtilityImpl@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 19 NONAME ABSENT ; void CHgContextUtilityImpl::SplitCombinedStringL(class TDesC16 const &, class CDesC16Array &)
- ?PublishTextContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 20 NONAME ; void CHgContextUtility::PublishTextContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@0@Z @ 21 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class TDesC16 const &)
- ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@0@Z @ 22 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &, class TDesC16 const &)
- ?BuildCombinedStringL@CHgContextUtilityImpl@@SAPAVHBufC16@@ABVMDesC16Array@@@Z @ 23 NONAME ABSENT ; class HBufC16 * CHgContextUtilityImpl::BuildCombinedStringL(class MDesC16Array const &)
- ?PublishPhotoContextL@CHgContextUtility@@QAEXKAAVCMdESession@@ABVTTimeIntervalMicroSeconds32@@@Z @ 24 NONAME ; void CHgContextUtility::PublishPhotoContextL(unsigned long, class CMdESession &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishContactContextL@CHgContextUtility@@QAEXABVCVPbkContactLinkArray@@ABVTTimeIntervalMicroSeconds32@@@Z @ 25 NONAME ; void CHgContextUtility::PublishContactContextL(class CVPbkContactLinkArray const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishTimeContextL@CHgContextUtility@@QAEXABVTTime@@ABVTTimeIntervalMicroSeconds32@@@Z @ 26 NONAME ; void CHgContextUtility::PublishTimeContextL(class TTime const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishContactContextL@CHgContextUtility@@QAEXABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 27 NONAME ; void CHgContextUtility::PublishContactContextL(class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishServiceIdL@CHgContextUtility@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 28 NONAME ; void CHgContextUtility::PublishServiceIdL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &)
- ?PublishMusicContextL@CHgContextUtility@@QAEXABVTTimeIntervalMicroSeconds32@@@Z @ 29 NONAME ; void CHgContextUtility::PublishMusicContextL(class TTimeIntervalMicroSeconds32 const &)
- ?AddMusicContextInfoL@CHgContextUtility@@QAEXABVTDesC16@@0@Z @ 30 NONAME ; void CHgContextUtility::AddMusicContextInfoL(class TDesC16 const &, class TDesC16 const &)
- ?MatchPhoneNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@HW4TVPbkPhoneNumberMatchFlags@CVPbkPhoneNumberMatchStrategy@@AAVCVPbkContactLinkArray@@AAVTRequestStatus@@@Z @ 31 NONAME ; void CHgCtxContactMatcher::MatchPhoneNumberL(class TDesC16 const &, int, enum CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags, class CVPbkContactLinkArray &, class TRequestStatus &)
- ?OpenStoreL@CHgCtxContactMatcher@@QAEXABVCVPbkContactStoreUriArray@@AAVTRequestStatus@@@Z @ 32 NONAME ; void CHgCtxContactMatcher::OpenStoreL(class CVPbkContactStoreUriArray const &, class TRequestStatus &)
- ?SplitAndMatchL@CHgCtxContactMatcher@@QAEXABVTDesC16@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@@Z @ 33 NONAME ; void CHgCtxContactMatcher::SplitAndMatchL(class TDesC16 const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &)
- ?GetFieldDataBinaryL@CHgCtxContactMatcher@@QBE?AVTPtrC8@@ABVMVPbkStoreContact@@ABVMVPbkFieldType@@@Z @ 34 NONAME ; class TPtrC8 CHgCtxContactMatcher::GetFieldDataBinaryL(class MVPbkStoreContact const &, class MVPbkFieldType const &) const
- ?OpenAllStoresL@CHgCtxContactMatcher@@QAEXXZ @ 35 NONAME ; void CHgCtxContactMatcher::OpenAllStoresL(void)
- ?GetNameL@CHgCtxContactMatcher@@QAEPAVHBufC16@@AAVMVPbkStoreContactFieldCollection@@@Z @ 36 NONAME ; class HBufC16 * CHgCtxContactMatcher::GetNameL(class MVPbkStoreContactFieldCollection &)
- ?OpenDefaultMatchStoresL@CHgCtxContactMatcher@@QAEXAAVTRequestStatus@@@Z @ 37 NONAME ; void CHgCtxContactMatcher::OpenDefaultMatchStoresL(class TRequestStatus &)
- ?OpenAllStoresL@CHgCtxContactMatcher@@QAEXAAVTRequestStatus@@@Z @ 38 NONAME ; void CHgCtxContactMatcher::OpenAllStoresL(class TRequestStatus &)
- ?GetFieldDataDateTimeL@CHgCtxContactMatcher@@QBE?AVTTime@@ABVMVPbkStoreContact@@ABVMVPbkFieldType@@@Z @ 39 NONAME ; class TTime CHgCtxContactMatcher::GetFieldDataDateTimeL(class MVPbkStoreContact const &, class MVPbkFieldType const &) const
- ?SplitFindStringL@CHgCtxContactMatcher@@SAPAVCDesC16Array@@ABVTDesC16@@@Z @ 40 NONAME ; class CDesC16Array * CHgCtxContactMatcher::SplitFindStringL(class TDesC16 const &)
- ?GetAddressesL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 41 NONAME ; void CHgCtxContactMatcher::GetAddressesL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &)
- ?OpenOwnNumberStoresL@CHgCtxContactMatcher@@QAEXAAVTRequestStatus@@@Z @ 42 NONAME ; void CHgCtxContactMatcher::OpenOwnNumberStoresL(class TRequestStatus &)
- ?GetCustomFieldL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@W4TVPbkFieldTypeName@@W4TVPbkFieldTypeParameter@@@Z @ 43 NONAME ; void CHgCtxContactMatcher::GetCustomFieldL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &, enum TVPbkFieldTypeName, enum TVPbkFieldTypeParameter)
- ?MatchDataL@CHgCtxContactMatcher@@QAEXABVTDesC16@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@@Z @ 44 NONAME ; void CHgCtxContactMatcher::MatchDataL(class TDesC16 const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &)
- ?IsOwnNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@AAVTRequestStatus@@@Z @ 45 NONAME ; void CHgCtxContactMatcher::IsOwnNumberL(class TDesC16 const &, class TRequestStatus &)
- ?IsOwnNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@AAH@Z @ 46 NONAME ; void CHgCtxContactMatcher::IsOwnNumberL(class TDesC16 const &, int &)
- ?OpenOwnNumberStoresL@CHgCtxContactMatcher@@QAEXXZ @ 47 NONAME ; void CHgCtxContactMatcher::OpenOwnNumberStoresL(void)
- ?GetWebAddressesL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@W4TWebAddressesType@1@@Z @ 48 NONAME ; void CHgCtxContactMatcher::GetWebAddressesL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &, enum CHgCtxContactMatcher::TWebAddressesType)
- ?FieldTypes@CHgCtxContactMatcher@@QBEABVMVPbkFieldTypeList@@XZ @ 49 NONAME ; class MVPbkFieldTypeList const & CHgCtxContactMatcher::FieldTypes(void) const
- ?GetContactManager@CHgCtxContactMatcher@@QAEAAVCVPbkContactManager@@XZ @ 50 NONAME ; class CVPbkContactManager & CHgCtxContactMatcher::GetContactManager(void)
- ?GetNamesForFindL@CHgCtxContactMatcher@@QAEPAVHBufC16@@AAVMVPbkStoreContactFieldCollection@@@Z @ 51 NONAME ; class HBufC16 * CHgCtxContactMatcher::GetNamesForFindL(class MVPbkStoreContactFieldCollection &)
- ?GetNumbersL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 52 NONAME ; void CHgCtxContactMatcher::GetNumbersL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &)
- ?ContactNameFormatterL@CHgCtxContactMatcher@@QAEAAVMPbk2ContactNameFormatter@@XZ @ 53 NONAME ; class MPbk2ContactNameFormatter & CHgCtxContactMatcher::ContactNameFormatterL(void)
- ?IsEmailAddressL@CHgCtxContactMatcher@@SAHABVTDesC16@@@Z @ 54 NONAME ; int CHgCtxContactMatcher::IsEmailAddressL(class TDesC16 const &)
- ?IsPhoneNumberL@CHgCtxContactMatcher@@SAHABVTDesC16@@@Z @ 55 NONAME ; int CHgCtxContactMatcher::IsPhoneNumberL(class TDesC16 const &)
- ?GetFieldDataTextL@CHgCtxContactMatcher@@QBE?AVTPtrC16@@ABVMVPbkStoreContact@@ABVMVPbkFieldType@@@Z @ 56 NONAME ; class TPtrC16 CHgCtxContactMatcher::GetFieldDataTextL(class MVPbkStoreContact const &, class MVPbkFieldType const &) const
- ?RegisterContactObserverL@CHgCtxContactMatcher@@QAEXAAVMHgCtxContactObserver@@@Z @ 57 NONAME ; void CHgCtxContactMatcher::RegisterContactObserverL(class MHgCtxContactObserver &)
- ?GetContactStoresL@CHgCtxContactMatcher@@QAEAAVMVPbkContactStoreList@@XZ @ 58 NONAME ; class MVPbkContactStoreList & CHgCtxContactMatcher::GetContactStoresL(void)
- ?GetStoreContactL@CHgCtxContactMatcher@@QAEXABVMVPbkContactLink@@PAPAVMVPbkStoreContact@@AAVTRequestStatus@@@Z @ 59 NONAME ; void CHgCtxContactMatcher::GetStoreContactL(class MVPbkContactLink const &, class MVPbkStoreContact * *, class TRequestStatus &)
- ?CancelOperation@CHgCtxContactMatcher@@QAEXXZ @ 60 NONAME ; void CHgCtxContactMatcher::CancelOperation(void)
- ?NewLC@CHgCtxContactMatcher@@SAPAV1@PAVRFs@@@Z @ 61 NONAME ; class CHgCtxContactMatcher * CHgCtxContactMatcher::NewLC(class RFs *)
- ?GetCustomFieldTypeLC@CHgCtxContactMatcher@@QAEPAVCVPbkFieldTypeRefsList@@W4TVPbkFieldTypeName@@W4TVPbkFieldTypeParameter@@@Z @ 62 NONAME ; class CVPbkFieldTypeRefsList * CHgCtxContactMatcher::GetCustomFieldTypeLC(enum TVPbkFieldTypeName, enum TVPbkFieldTypeParameter)
- ?CloseStoresL@CHgCtxContactMatcher@@QAEXXZ @ 63 NONAME ; void CHgCtxContactMatcher::CloseStoresL(void)
- ?SplitMsgContactL@CHgCtxContactMatcher@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 64 NONAME ; void CHgCtxContactMatcher::SplitMsgContactL(class TDesC16 const &, class CDesC16Array &)
- ?GetImppFieldL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@PAVCDesC16Array@@11@Z @ 65 NONAME ; void CHgCtxContactMatcher::GetImppFieldL(class MVPbkStoreContactFieldCollection &, class CDesC16Array *, class CDesC16Array *, class CDesC16Array *)
- ?GetNamesForFindL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 66 NONAME ; void CHgCtxContactMatcher::GetNamesForFindL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &)
- ?NewL@CHgCtxContactMatcher@@SAPAV1@PAVRFs@@@Z @ 67 NONAME ; class CHgCtxContactMatcher * CHgCtxContactMatcher::NewL(class RFs *)
- ?MatchDataL@CHgCtxContactMatcher@@QAEXABVMDesC16Array@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@ABVTCallBack@@@Z @ 68 NONAME ; void CHgCtxContactMatcher::MatchDataL(class MDesC16Array const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &, class TCallBack const &)
- ?OpenStoreL@CHgCtxContactMatcher@@QAEXABVCVPbkContactStoreUriArray@@@Z @ 69 NONAME ; void CHgCtxContactMatcher::OpenStoreL(class CVPbkContactStoreUriArray const &)
- ?FindContactWithBirthdayL@CHgCtxContactMatcher@@QAEXABVTTime@@AAVCVPbkContactLinkArray@@@Z @ 70 NONAME ; void CHgCtxContactMatcher::FindContactWithBirthdayL(class TTime const &, class CVPbkContactLinkArray &)
- ?LookupL@CHgCtxContactMatcher@@QAEXABVTDesC16@@AAVCVPbkContactLinkArray@@@Z @ 71 NONAME ; void CHgCtxContactMatcher::LookupL(class TDesC16 const &, class CVPbkContactLinkArray &)
- ?UnregisterContactObserver@CHgCtxContactMatcher@@QAEXAAVMHgCtxContactObserver@@@Z @ 72 NONAME ; void CHgCtxContactMatcher::UnregisterContactObserver(class MHgCtxContactObserver &)
- ?MatchPhoneNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@HW4TVPbkPhoneNumberMatchFlags@CVPbkPhoneNumberMatchStrategy@@AAVCVPbkContactLinkArray@@@Z @ 73 NONAME ; void CHgCtxContactMatcher::MatchPhoneNumberL(class TDesC16 const &, int, enum CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags, class CVPbkContactLinkArray &)
- ?OpenDefaultMatchStoresL@CHgCtxContactMatcher@@QAEXXZ @ 74 NONAME ; void CHgCtxContactMatcher::OpenDefaultMatchStoresL(void)
- ??1CHgCtxContactMatcher@@UAE@XZ @ 75 NONAME ; CHgCtxContactMatcher::~CHgCtxContactMatcher(void)
- ?GetStoreContactL@CHgCtxContactMatcher@@QAEXABVMVPbkContactLink@@PAPAVMVPbkStoreContact@@@Z @ 76 NONAME ; void CHgCtxContactMatcher::GetStoreContactL(class MVPbkContactLink const &, class MVPbkStoreContact * *)
- ?GetEmailAddressesL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 77 NONAME ; void CHgCtxContactMatcher::GetEmailAddressesL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &)
- ?MatchDataL@CHgCtxContactMatcher@@QAEXABVTDesC16@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@AAVTRequestStatus@@@Z @ 78 NONAME ; void CHgCtxContactMatcher::MatchDataL(class TDesC16 const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &, class TRequestStatus &)
- ?GetThumbnailL@CHgCtxContactMatcher@@QAEPAVCFbsBitmap@@AAVMVPbkStoreContactFieldCollection@@@Z @ 79 NONAME ; class CFbsBitmap * CHgCtxContactMatcher::GetThumbnailL(class MVPbkStoreContactFieldCollection &)
- ?SplitCombinedStringL@CHgContextUtility@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 80 NONAME ; void CHgContextUtility::SplitCombinedStringL(class TDesC16 const &, class CDesC16Array &)
- ?BuildCombinedStringL@CHgContextUtility@@SAPAVHBufC16@@ABVMDesC16Array@@@Z @ 81 NONAME ; class HBufC16 * CHgContextUtility::BuildCombinedStringL(class MDesC16Array const &)
- ?PublishRadioContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 82 NONAME ; void CHgContextUtility::PublishRadioContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &)
-
--- a/homescreensrv_plat/context_utility_api/tsrc/eabi/t_ui_context_utility_apiu.def Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-EXPORTS
- _Z9LibEntryLv @ 1 NONAME
- _Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
- _ZN17CHgContextUtility16RePublishWhenFgLEi @ 3 NONAME
- _ZN17CHgContextUtility17PublishTvContextLERK7TDesC16S2_S2_S2_ @ 4 NONAME
- _ZN17CHgContextUtility18PublishUrlContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 5 NONAME
- _ZN17CHgContextUtility19PublishTextContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 6 NONAME
- _ZN17CHgContextUtility19PublishTimeContextLERK5TTimeRK27TTimeIntervalMicroSeconds32 @ 7 NONAME
- _ZN17CHgContextUtility20PublishPhotoContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 8 NONAME
- _ZN17CHgContextUtility20PublishPhotoContextLEmR11CMdESessionRK27TTimeIntervalMicroSeconds32 @ 9 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 10 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK13RPointerArrayI17MVPbkStoreContactERK27TTimeIntervalMicroSeconds32 @ 11 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK16MVPbkContactLinkRK27TTimeIntervalMicroSeconds32 @ 12 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK17MVPbkStoreContactRK27TTimeIntervalMicroSeconds32 @ 13 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK21CVPbkContactLinkArrayRK27TTimeIntervalMicroSeconds32 @ 14 NONAME
- _ZN17CHgContextUtility22PublishContactContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 15 NONAME
- _ZN17CHgContextUtility26AllowPublishFromBackgroundEi @ 16 NONAME
- _ZN17CHgContextUtility4NewLEv @ 17 NONAME
- _ZN17CHgContextUtility5NewLCEv @ 18 NONAME
- _ZN17CHgContextUtilityD0Ev @ 19 NONAME
- _ZN17CHgContextUtilityD1Ev @ 20 NONAME
- _ZN17CHgContextUtilityD2Ev @ 21 NONAME
- _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16 @ 22 NONAME
- _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16S2_ @ 23 NONAME
- _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16RK12MDesC16Array @ 24 NONAME
- _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16S2_ @ 25 NONAME
- _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16RK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 26 NONAME
- _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 27 NONAME
- _ZN21CHgContextUtilityImpl20BuildCombinedStringLERK12MDesC16Array @ 28 NONAME ABSENT
- _ZN21CHgContextUtilityImpl20SplitCombinedStringLERK7TDesC16R12CDesC16Array @ 29 NONAME ABSENT
- _ZTI11CHgTestBase @ 30 NONAME ; #<TI>#
- _ZTI21CHgContextUtilityBase @ 31 NONAME ; #<TI>#
- _ZTV11CHgTestBase @ 32 NONAME ; #<VT>#
- _ZTV21CHgContextUtilityBase @ 33 NONAME ; #<VT>#
- _ZN17CHgContextUtility17PublishServiceIdLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 34 NONAME
- _ZN17CHgContextUtility20AddMusicContextInfoLERK7TDesC16S2_ @ 35 NONAME
- _ZN17CHgContextUtility20PublishMusicContextLERK27TTimeIntervalMicroSeconds32 @ 36 NONAME
- _ZN17CHgContextUtility20BuildCombinedStringLERK12MDesC16Array @ 37 NONAME
- _ZN17CHgContextUtility20PublishRadioContextLERK7TDesC16S2_S2_S2_ @ 38 NONAME
- _ZN17CHgContextUtility20SplitCombinedStringLERK7TDesC16R12CDesC16Array @ 39 NONAME
- _ZN20CHgCtxContactMatcher10MatchDataLERK12MDesC16ArrayRK18MVPbkFieldTypeListR21CVPbkContactLinkArrayRK9TCallBack @ 40 NONAME
- _ZN20CHgCtxContactMatcher10MatchDataLERK7TDesC16RK18MVPbkFieldTypeListR21CVPbkContactLinkArray @ 41 NONAME
- _ZN20CHgCtxContactMatcher10MatchDataLERK7TDesC16RK18MVPbkFieldTypeListR21CVPbkContactLinkArrayR14TRequestStatus @ 42 NONAME
- _ZN20CHgCtxContactMatcher10OpenStoreLERK25CVPbkContactStoreUriArray @ 43 NONAME
- _ZN20CHgCtxContactMatcher10OpenStoreLERK25CVPbkContactStoreUriArrayR14TRequestStatus @ 44 NONAME
- _ZN20CHgCtxContactMatcher11GetNumbersLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 45 NONAME
- _ZN20CHgCtxContactMatcher12CloseStoresLEv @ 46 NONAME
- _ZN20CHgCtxContactMatcher12IsOwnNumberLERK7TDesC16R14TRequestStatus @ 47 NONAME
- _ZN20CHgCtxContactMatcher12IsOwnNumberLERK7TDesC16Ri @ 48 NONAME
- _ZN20CHgCtxContactMatcher13GetAddressesLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 49 NONAME
- _ZN20CHgCtxContactMatcher13GetImppFieldLER32MVPbkStoreContactFieldCollectionP12CDesC16ArrayS3_S3_ @ 50 NONAME
- _ZN20CHgCtxContactMatcher13GetThumbnailLER32MVPbkStoreContactFieldCollection @ 51 NONAME
- _ZN20CHgCtxContactMatcher14IsPhoneNumberLERK7TDesC16 @ 52 NONAME
- _ZN20CHgCtxContactMatcher14OpenAllStoresLER14TRequestStatus @ 53 NONAME
- _ZN20CHgCtxContactMatcher14OpenAllStoresLEv @ 54 NONAME
- _ZN20CHgCtxContactMatcher14SplitAndMatchLERK7TDesC16RK18MVPbkFieldTypeListR21CVPbkContactLinkArray @ 55 NONAME
- _ZN20CHgCtxContactMatcher15CancelOperationEv @ 56 NONAME
- _ZN20CHgCtxContactMatcher15GetCustomFieldLER32MVPbkStoreContactFieldCollectionR12CDesC16Array18TVPbkFieldTypeName23TVPbkFieldTypeParameter @ 57 NONAME
- _ZN20CHgCtxContactMatcher15IsEmailAddressLERK7TDesC16 @ 58 NONAME
- _ZN20CHgCtxContactMatcher16GetNamesForFindLER32MVPbkStoreContactFieldCollection @ 59 NONAME
- _ZN20CHgCtxContactMatcher16GetNamesForFindLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 60 NONAME
- _ZN20CHgCtxContactMatcher16GetStoreContactLERK16MVPbkContactLinkPP17MVPbkStoreContact @ 61 NONAME
- _ZN20CHgCtxContactMatcher16GetStoreContactLERK16MVPbkContactLinkPP17MVPbkStoreContactR14TRequestStatus @ 62 NONAME
- _ZN20CHgCtxContactMatcher16GetWebAddressesLER32MVPbkStoreContactFieldCollectionR12CDesC16ArrayNS_17TWebAddressesTypeE @ 63 NONAME
- _ZN20CHgCtxContactMatcher16SplitFindStringLERK7TDesC16 @ 64 NONAME
- _ZN20CHgCtxContactMatcher16SplitMsgContactLERK7TDesC16R12CDesC16Array @ 65 NONAME
- _ZN20CHgCtxContactMatcher17GetContactManagerEv @ 66 NONAME
- _ZN20CHgCtxContactMatcher17GetContactStoresLEv @ 67 NONAME
- _ZN20CHgCtxContactMatcher17MatchPhoneNumberLERK7TDesC16iN29CVPbkPhoneNumberMatchStrategy26TVPbkPhoneNumberMatchFlagsER21CVPbkContactLinkArray @ 68 NONAME
- _ZN20CHgCtxContactMatcher17MatchPhoneNumberLERK7TDesC16iN29CVPbkPhoneNumberMatchStrategy26TVPbkPhoneNumberMatchFlagsER21CVPbkContactLinkArrayR14TRequestStatus @ 69 NONAME
- _ZN20CHgCtxContactMatcher18GetEmailAddressesLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 70 NONAME
- _ZN20CHgCtxContactMatcher20GetCustomFieldTypeLCE18TVPbkFieldTypeName23TVPbkFieldTypeParameter @ 71 NONAME
- _ZN20CHgCtxContactMatcher20OpenOwnNumberStoresLER14TRequestStatus @ 72 NONAME
- _ZN20CHgCtxContactMatcher20OpenOwnNumberStoresLEv @ 73 NONAME
- _ZN20CHgCtxContactMatcher21ContactNameFormatterLEv @ 74 NONAME
- _ZN20CHgCtxContactMatcher23OpenDefaultMatchStoresLER14TRequestStatus @ 75 NONAME
- _ZN20CHgCtxContactMatcher23OpenDefaultMatchStoresLEv @ 76 NONAME
- _ZN20CHgCtxContactMatcher24FindContactWithBirthdayLERK5TTimeR21CVPbkContactLinkArray @ 77 NONAME
- _ZN20CHgCtxContactMatcher24RegisterContactObserverLER21MHgCtxContactObserver @ 78 NONAME
- _ZN20CHgCtxContactMatcher25UnregisterContactObserverER21MHgCtxContactObserver @ 79 NONAME
- _ZN20CHgCtxContactMatcher4NewLEP3RFs @ 80 NONAME
- _ZN20CHgCtxContactMatcher5NewLCEP3RFs @ 81 NONAME
- _ZN20CHgCtxContactMatcher7LookupLERK7TDesC16R21CVPbkContactLinkArray @ 82 NONAME
- _ZN20CHgCtxContactMatcher8GetNameLER32MVPbkStoreContactFieldCollection @ 83 NONAME
- _ZN20CHgCtxContactMatcherD0Ev @ 84 NONAME
- _ZN20CHgCtxContactMatcherD1Ev @ 85 NONAME
- _ZN20CHgCtxContactMatcherD2Ev @ 86 NONAME
- _ZNK20CHgCtxContactMatcher10FieldTypesEv @ 87 NONAME
- _ZNK20CHgCtxContactMatcher17GetFieldDataTextLERK17MVPbkStoreContactRK14MVPbkFieldType @ 88 NONAME
- _ZNK20CHgCtxContactMatcher19GetFieldDataBinaryLERK17MVPbkStoreContactRK14MVPbkFieldType @ 89 NONAME
- _ZNK20CHgCtxContactMatcher21GetFieldDataDateTimeLERK17MVPbkStoreContactRK14MVPbkFieldType @ 90 NONAME
- _ZThn12_N20CHgCtxContactMatcherD0Ev @ 91 NONAME
- _ZThn12_N20CHgCtxContactMatcherD1Ev @ 92 NONAME
- _ZThn16_N20CHgCtxContactMatcherD0Ev @ 93 NONAME
- _ZThn16_N20CHgCtxContactMatcherD1Ev @ 94 NONAME
- _ZThn20_N20CHgCtxContactMatcherD0Ev @ 95 NONAME
- _ZThn20_N20CHgCtxContactMatcherD1Ev @ 96 NONAME
- _ZThn4_N20CHgCtxContactMatcherD0Ev @ 97 NONAME
- _ZThn4_N20CHgCtxContactMatcherD1Ev @ 98 NONAME
- _ZThn8_N20CHgCtxContactMatcherD0Ev @ 99 NONAME
- _ZThn8_N20CHgCtxContactMatcherD1Ev @ 100 NONAME
-
--- a/homescreensrv_plat/context_utility_api/tsrc/group/bld.inf Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: T_ui_context_utility_api test module.
-*
-*/
-
-
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_TESTEXPORTS
-
-PRJ_EXPORTS
-
-PRJ_TESTMMPFILES
-t_ui_context_utility_api.mmp
-
-PRJ_MMPFILES
-
-// End of File
--- a/homescreensrv_plat/context_utility_api/tsrc/group/context_utility_api.bat Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +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
-
-ATSInterface.exe -testmodule T_ui_context_utility_api
\ No newline at end of file
--- a/homescreensrv_plat/context_utility_api/tsrc/group/t_ui_context_utility_api.mmp Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*TYPE STIFUNIT*//*
-* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: T_ui_context_utility_api test module.
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-TARGET T_ui_context_utility_api.dll
-TARGETTYPE dll
-UID 0x1000008D 0x101FB3E7
-
-CAPABILITY ALL -TCB
-
-DEFFILE T_ui_context_utility_api.def
-
-USERINCLUDE ../inc
-USERINCLUDE ../../inc
-USERINCLUDE ../../../../contextutility/inc
-
-// USERINCLUDE for base test class
-USERINCLUDE ../testbase
-
-APP_LAYER_SYSTEMINCLUDE
-
-SYSTEMINCLUDE /epoc32/include/internal
-
-SOURCEPATH ../src
-SOURCE T_ui_context_utility_api.cpp
-SOURCE T_ui_context_utility_api_cases.cpp
-SOURCE wait.cpp
-SOURCE hgctxcontactmatcher.cpp
-
-SOURCEPATH ../../../../contextutility/src
-SOURCE hgcontextutilityimpl.cpp
-SOURCE hgcontextutility.cpp
-SOURCE hgcontextutilitybase.cpp
-
-// SOURCEPATH for base test class
-SOURCEPATH ../testbase
-SOURCE hgtestbase.cpp
-
-LIBRARY euser.lib
-LIBRARY estor.lib
-LIBRARY bafl.lib
-LIBRARY stiftestinterface.lib
-LIBRARY avkon.lib
-LIBRARY aknnotify.lib
-LIBRARY eikcore.lib
-LIBRARY cfclient.lib
-LIBRARY cfservices.lib
-LIBRARY cone.lib
-LIBRARY ws32.lib
-LIBRARY mdeclient.lib
-LIBRARY vpbkeng.lib
-LIBRARY efsrv.lib
-LIBRARY Pbk2Presentation.lib
-LIBRARY fbscli.lib
-LIBRARY imageconversion.lib
-LIBRARY commonengine.lib
-
-DEBUGLIBRARY flogger.lib
-
-LANG SC
-
-EXPORTUNFROZEN
-
-// End of File
--- a/homescreensrv_plat/context_utility_api/tsrc/group/t_ui_context_utility_api.pkg Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-;
-; Installation file for STIF
-;
-
-; Languages
-&EN
-
-; Provide value for uid
-#{"STIF"},(0x00000000),1,1,0,TYPE=SA
-
-; Series60 product id for S60 3.0
-[0x101F7961], 0, 0, 0, {"Series60ProductID"}
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Logo
-; None
-
-; Package signature - Optional
-; None
-
-; Start of Package body
-
-; Condition blocks
-; None
-
-; Options list
-; None
-
-; Install files
-"\epoc32\release\armv5\udeb\T_ui_context_utility_api.dll" - "!:\Sys\Bin\T_ui_context_utility_api.dll"
-"context_utility_api.bat" - "c:\context_utility_api.bat"
-
-; Embedded SIS
-; None
-
-; End of Package body
-
-; PKG dependencies
-; None
-
-; PKG capabilities
-; None
--- a/homescreensrv_plat/context_utility_api/tsrc/inc/hgctxcontactmatcher.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,904 +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: Contact metching class
-*
-*/
-
-
-#ifndef HGCONTACTMATCHER_H
-#define HGCONTACTMATCHER_H
-
-// System includes
-#include <e32base.h>
-#include <e32std.h>
-#include <bamdesca.h>
-#include <badesca.h>
-
-#include <MVPbkSingleContactOperationObserver.h>
-#include <MVPbkContactStoreListObserver.h>
-#include <MVPbkContactFindObserver.h>
-#include <MVPbkFieldType.h>
-#include <CVPbkPhoneNumberMatchStrategy.h>
-#include <MVPbkContactFindFromStoresObserver.h>
-#include <MVPbkContactViewObserver.h>
-
-#include <finditemengine.h>
-
-// Classes referenced
-class RFs;
-class CActiveSchedulerWait;
-class CVPbkContactManager;
-class MVPbkContactLink;
-class CVPbkContactLinkArray;
-class CVPbkContactStoreUriArray;
-class MVPbkContactOperationBase;
-class MVPbkFieldType;
-class MVPbkFieldTypeList;
-class MVPbkStoreContact;
-class MVPbkStoreContactField;
-class CVPbkFieldTypeRefsList;
-class MVPbkStoreContactFieldCollection;
-class MVPbkContactFieldSelector;
-
-class CPbk2SortOrderManager;
-class MPbk2ContactNameFormatter;
-class CFbsBitmap;
-
-/**
- * Observer interface for contact added/changed/deleted notifications.
- */
-class MHgCtxContactObserver
- {
-public:
- /**
- * Called when a contact is added, changed, or deleted.
- */
- virtual void HandleContactEventL() = 0;
- };
-
-/**
-* CHgCtxContactMatcher class is an API for contact matching.
-*
-* Before a method starts executing a Virtual Phonebook operation,
-* it checks if there's an older asynchronous operation already in execution.
-* If there is, synchronous methods leave with error code KErrInUse.
-* Asynchronous methods complete the request with same error code.
-*
-* If phone backup/restore has been detected, using methods which
-* require Virtual Phonebook is not possible normally.
-* Instead those methods leave with error code KErrAccessDenied.
-* Once EStoreBackupRestoreCompleted event has been received,
-* methods can be called normally.
-*
-* @lib hgcontextservicesutils.lib
-*/
-
-NONSHARABLE_CLASS( CHgCtxContactMatcher ) : public CBase,
- public MVPbkSingleContactOperationObserver,
- public MVPbkContactStoreListObserver,
- public MVPbkContactFindObserver,
- public MVPbkContactFindFromStoresObserver,
- public MVPbkContactViewObserver
- {
-public: // Construct & destruct
-
- /**
- * Two-phase constructor for CHgCtxContactMatcher class.
- *
- * @param aFsSession File server session.
- *
- * @return CHgCtxContactMatcher* Pointer to newly created instance.
- */
- IMPORT_C static CHgCtxContactMatcher* NewL( RFs* aFsSession = 0 );
-
- /**
- * Two-phase constructor for CHgCtxContactMatcher class.
- * Like NewL(), but also places instance on cleanup stack.
- *
- * @return CHgCtxContactMatcher* Pointer to newly created instance.
- */
- IMPORT_C static CHgCtxContactMatcher* NewLC( RFs* aFsSession = 0 );
-
- /**
- * C++ destructor.
- */
- IMPORT_C ~CHgCtxContactMatcher();
-
-private: // Internal construct
-
- /**
- * C++ Constructor.
- */
- CHgCtxContactMatcher( RFs* aFsSession );
-
- /**
- * Second phase constructor
- */
- void ConstructL();
-
-public: // API methods
-
- /**
- * Opens one or more contact stores for future match operations.
- *
- * @param aUriArray Array of contact store URIs to be opened.
- *
- * @exception KErrNotSupported when none of the stores opens
- * @exception KErrGeneral if some stores are already open
- */
- IMPORT_C void OpenStoreL( const CVPbkContactStoreUriArray& aUriArray );
-
- /**
- * Opens one or more contact stores for future match operations.
- * Asynchronous version.
- *
- * @param aUriArray Array of contact store URIs to be opened.
- * @param aStatus Completion status of the request.
- * KErrNone - at least one store opened successfully
- * KErrNotSupported - all stores failed to open
- * KErrGeneral - if some stores are already open
- */
- IMPORT_C void OpenStoreL( const CVPbkContactStoreUriArray& aUriArray,
- TRequestStatus& aStatus );
-
- /**
- * Opens all contact stores for future match operations.
- * NOTE: does not open OwnNumber store.
- *
- * @exception KErrNotSupported when none of the stores opens
- * @exception KErrGeneral if some stores are already open
- */
- IMPORT_C void OpenAllStoresL();
-
- /**
- * Opens all contact stores for future match operations.
- * Asynchronous version.
- * NOTE: does not open OwnNumber store.
- *
- * @param aStatus Completion status of the request.
- * KErrNone - at least one store opened successfully
- * KErrNotSupported - all stores failed to open
- * KErrGeneral - if some stores are already open
- */
- IMPORT_C void OpenAllStoresL( TRequestStatus& aStatus );
-
- /**
- * Opens default contact stores for future match operations.
- * Used to find local aliases to phone numbers and email addresses
- * NOTE: does not open OwnNumber store or fixed dialing store
- * Opens the stores in the default preference order
- *
- * @exception KErrNotSupported when none of the stores opens
- * @exception KErrGeneral if some stores are already open
- */
- IMPORT_C void OpenDefaultMatchStoresL();
-
- /**
- * Opens default contact stores for future match operations.
- * Used to find local aliases to phone numbers and email addresses
- * Asynchronous version.
- * NOTE: does not open OwnNumber store or fixed dialing store
- * Opens the stores in the default preference order
- *
- * @param aStatus Completion status of the request.
- * KErrNone - at least one store opened successfully
- * KErrNotSupported - all stores failed to open
- * KErrGeneral - if some stores are already open
- */
- IMPORT_C void OpenDefaultMatchStoresL( TRequestStatus& aStatus );
-
- /**
- * Opens all OwnNumber stores for future match operations.
- *
- * @exception KErrNotSupported when none of the stores opens
- * @exception KErrGeneral if some stores are already open
- */
- IMPORT_C void OpenOwnNumberStoresL();
-
- /**
- * Opens all OwnNumber stores for future match operations.
- *
- * @param aStatus Completion status of the request.
- * KErrNone - at least one store opened successfully
- * KErrNotSupported - all stores failed to open
- * KErrGeneral - if some stores are already open
- */
- IMPORT_C void OpenOwnNumberStoresL( TRequestStatus& aStatus );
-
- /**
- * Closes all currently open contact stores
- * including OwnNumber stores.
- *
- * @return Leaves on error.
- */
- IMPORT_C void CloseStoresL();
-
- /**
- * Determines whether a phone number is OwnNumber. Synchronous version.
- * The method searches for the number from currently open stores.
- * In order to use SIM's ISDN store, it should be the only open store.
- * Can be opened with OpenOwnNumberStoresL().
- *
- * @param aSearch Phone number to search for
- * @param aResult Boolean result.
- */
- IMPORT_C void IsOwnNumberL( const TDesC& aSearch, TBool& aResult );
-
- /**
- * Determines whether a phone number is OwnNumber. Asynchronous version.
- * The method searches for the number from currently open stores.
- * In order to use SIM's ISDN store, it should be the only open store.
- * Can be opened with OpenOwnNumberStoresL().
- *
- * @param aSearch Phone number to search for
- * @param aStatus Request status containing the result and
- * possible error code.
- * KErrNone = TRUE,
- * KErrNotFound = FALSE,
- * other value = system wide error code.
- */
- IMPORT_C void IsOwnNumberL( const TDesC& aSearch, TRequestStatus& aStatus );
-
- /**
- * Finds contacts with phone numbers that match the search string.
- * Synchronous version.
- * Contacts are searched from all currently open contact stores.
- * Matching is done from the end of the phone number.
- * Note: If the search string is shorter than 7 digits, matching from
- * Phone memory contact store works ONLY if the phone number is
- * exactly the same as the search string.
- * Example:
- * Search string "567" would find phone number "567", but not "1234567".
- * From SIM stores both numbers would be found.
- *
- * @param aSearch Search string
- * @param aDigits Number of digits to match from the end of phone number.
- * @param aFlags Search all or stop at first match.
- * See enum values from CVPbkPhoneNumberMatchStrategy.h
- * @param aLinkArray Links to matching contacts are returned in this
- * array that method caller provides.
- *
- * @return KErrNone = success, otherwise an error code. ,,list of codes
- */
- IMPORT_C void MatchPhoneNumberL( const TDesC& aSearch, TInt aDigits,
- CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags,
- CVPbkContactLinkArray& aLinkArray );
-
- /**
- * Finds contacts with phone numbers that match the search string.
- * Asynchronous version.
- * Searching is done according to parameters like in the synchronous version,
- * but status code is returned in aStatus.
- *
- * @param aStatus Completion status of the request.
- * Values: KErrNone = success, otherwise an error code.
- */
- IMPORT_C void MatchPhoneNumberL( const TDesC& aSearch, TInt aDigits,
- CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags,
- CVPbkContactLinkArray& aLinkArray, TRequestStatus& aStatus );
-
- /**
- * Returns the global list of possible field types.
- *
- * @return List of field types
- */
- IMPORT_C const MVPbkFieldTypeList& FieldTypes() const;
-
- /**
- * Gets a store contact from a contact link.
- * @param aContactLink The link from which store contact should be returned.
- * @param aStoreContact Pointer to store contact.
- * Client must take the ownership immediately.
- */
- IMPORT_C void GetStoreContactL( const MVPbkContactLink& aContactLink,
- MVPbkStoreContact** aStoreContact );
-
- /**
- * Gets a store contact from a contact link.
- * Asynchronous version.
- * Parameters like in the synchronous version,
- * but status code is returned in aStatus.
- *
- * @param aStatus Completion status of the request.
- * Values: KErrNone = success, otherwise an error code.
- */
- IMPORT_C void GetStoreContactL( const MVPbkContactLink& aContactLink,
- MVPbkStoreContact** aStoreContact, TRequestStatus& aStatus );
-
- /**
- * Returns a pointer to contact's field data of given field type.
- * If the field type isn't found from contact, return value is KNullDesC.
- * NOTE: this works only for field types of storage type
- * EVPbkFieldStorageTypeText.
- * For other types, leaves with error code KErrArgument.
- *
- * @param aStoreContact The contact from which field data should be returned.
- * @param aFieldType Field's type.
- * @return TPtrC pointer to field's data.
- */
- IMPORT_C TPtrC GetFieldDataTextL( const MVPbkStoreContact& aStoreContact,
- const MVPbkFieldType& aFieldType ) const;
-
- /**
- * Returns a pointer to contact's field data of given field type.
- * If the field type isn't found from contact, return value is
- * "1.1.1111". (d.m.yyyy).
- * NOTE: this works only for field types of storage type
- * EVPbkFieldStorageTypeDateTime.
- * For other types, leaves with error code KErrArgument.
- *
- * @param aStoreContact The contact from which field data should be returned.
- * @param aFieldType Field's type.
- * @return TTime pointer to field's data.
- */
- IMPORT_C TTime GetFieldDataDateTimeL( const MVPbkStoreContact& aStoreContact,
- const MVPbkFieldType& aFieldType ) const;
-
- /**
- * Returns a pointer to contact's field data of given field type.
- * If the field type isn't found from contact, return value is KNullDesC8.
- * NOTE: this works only for field types of storage type
- * EVPbkFieldStorageTypeBinary.
- * For other types, leaves with error code KErrArgument.
- *
- * @param aStoreContact The contact from which field data should be returned.
- * @param aFieldType Field's type.
- * @return TPtrC8 pointer to field's data.
- */
- IMPORT_C TPtrC8 GetFieldDataBinaryL( const MVPbkStoreContact& aStoreContact,
- const MVPbkFieldType& aFieldType ) const;
-
- /**
- * Cancels asynchronous operation.
- */
- IMPORT_C void CancelOperation();
-
- /**
- * Returns the used contact store list, needed for e.g. aiw fetch
- * @return The used contact store list
- */
- IMPORT_C MVPbkContactStoreList& GetContactStoresL();
-
- /**
- * Returns the name of the contact in the same format as MPbk2ContactNameFormatter
- * @param aFieldCollection The fieldcollection of the contact
- * @return HBufC* the name of the contact or null
- */
- IMPORT_C HBufC* GetNameL(
- MVPbkStoreContactFieldCollection& aFieldCollection );
-
- /**
- * Returns reference to the contactmanager
- * @return reference to the contact manager
- */
- IMPORT_C CVPbkContactManager& GetContactManager();
-
- /**
- * Finds contacts with field data that match the search string.
- * Contacts are searched from all currently open contact stores.
- * Matching is done from field types given by the method caller.
- * The list of all possible field types can be fetched from the wrapper
- * using FieldTypes().
- *
- * @param aSearch Search string
- * @param aFieldTypes List of field types included in matching.
- * @param aLinkArray Links to matching contacts are returned
- * in this array that method caller provides.
- *
- * @return KErrNone = success, otherwise an error code. ,,list of codes
- */
- IMPORT_C void MatchDataL( const TDesC& aSearch, const MVPbkFieldTypeList& aFieldTypes,
- CVPbkContactLinkArray& aLinkArray);
-
- /**
- * Finds contacts with field data that match the search string.
- * Contacts are searched from all currently open contact stores.
- * Matching is done from field types given by the method caller.
- * The list of all possible field types can be fetched from the wrapper
- * using FieldTypes().
- *
- * @param aSearchStrings Search strings
- * @param aFieldTypes List of field types included in matching.
- * @param aLinkArray Links to matching contacts are returned
- * in this array that method caller provides.
- * @param aWordParserCallBack is the callback function to the parser
- *
- * @return KErrNone = success, otherwise an error code.
- */
- IMPORT_C void MatchDataL( const MDesC16Array& aSearchStrings,
- const MVPbkFieldTypeList& aFieldTypes,
- CVPbkContactLinkArray& aLinkArray,
- const TCallBack& aWordParserCallBack );
-
- /**
- * Finds contacts with field data that match the search string.
- * Asynchronous version.
- * Searching is done according to parameters like in the synchronous version,
- * but status code is returned in aStatus.
- *
- * @param aStatus Completion status of the request.
- * Values: KErrNone = success, otherwise an error code.
- */
- IMPORT_C void MatchDataL( const TDesC& aSearch, const MVPbkFieldTypeList& aFieldTypes,
- CVPbkContactLinkArray& aLinkArray, TRequestStatus& aStatus );
-
- /**
- * Returns reference to the contact name formatter. Object is created if not used earlier.
- * @return reference to the contact name formatter
- */
- IMPORT_C MPbk2ContactNameFormatter& ContactNameFormatterL();
-
- /**
- * Splits the input to words and then performs a MatchDataL using the same
- * splitter callback function.
- *
- * LookupL and this are the preferred functions to do text-based lookups from Hg code.
- *
- * @see MatchDataL
- * @see LookupL
- */
- IMPORT_C void SplitAndMatchL( const TDesC& aData,
- const MVPbkFieldTypeList& aFieldTypes,
- CVPbkContactLinkArray& aLinkArray );
-
- /**
- * Registers for getting notifications when a contact is added, changed, or deleted.
- * Does nothing if already added.
- * @param aObserver ref to observer
- */
- IMPORT_C void RegisterContactObserverL( MHgCtxContactObserver& aObserver );
-
- /**
- * Unregisters the given observer.
- * Does nothing if the given observer has not been registered before.
- * @param aObserver ref to observer
- */
- IMPORT_C void UnregisterContactObserver( MHgCtxContactObserver& aObserver );
-
- /**
- * Looks up a contact based on
- * - name, or
- * - phone number, or
- * - email address, or
- * - service id
- *
- * Also handles the "name <number>" or "name <email>" format.
- *
- * For service IDs the full uri must be given, e.g. if a contact
- * has an Ovi ID in phonebook set to "somebody" then the search will
- * only succeed if aData contains "Ovi:somebody" (unless of course
- * the string "somebody" matches some name fields).
- *
- * @param aData name or phone number of email address
- * @param aLinkArray array to which the result links are added,
- * no items are appended if not found
- */
- IMPORT_C void LookupL( const TDesC& aData, CVPbkContactLinkArray& aLinkArray );
-
- /**
- * Returns the phone numbers of the contact.
- * @param aFieldCollection The fieldcollection of the contact
- * @param aArray Phone numbers are appended to this. (not resetted)
- */
- IMPORT_C void GetNumbersL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray );
-
- /**
- * Returns the email addresses of the contact.
- * @param aFieldCollection The fieldcollection of the contact
- * @param aArray Email addresses are appended to this. (not resetted)
- */
- IMPORT_C void GetEmailAddressesL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray );
-
- /**
- * Constructs the address (e.g. street, city, country) for the contact.
- * The elements are combined into one string, using space as separator.
- * aArray will have 0-3 items appended: nothing, or general and/or work and/or home address.
- * @param aFieldCollection The fieldcollection of the contact
- * @param aArray Addresses are appended to this. (not resetted)
- */
- IMPORT_C void GetAddressesL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray );
-
- enum TWebAddressesType
- {
- EWebAddresses, //for general web adress
- EWebAddressesHome, //for home web adress
- EWebAddressesWork //for work web adress
- };
-
- /**
- * Gets the prefered web address for the contact.
- *
- * aArray can have 0 or more items appended.
- *
- * @param aFieldCollection The fieldcollection of the contact
- * @param aArray Web addresses are appended to this. (not resetted)
- * @param aType Determinates which web adress return, @see TWebAddressesType
- */
- IMPORT_C void GetWebAddressesL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray,
- TWebAddressesType aType );
-
-
- /**
- * Gets the thumbnail for a contact.
- * @param aFieldCollection The fieldcollection of the contact
- * @return bitmap or null (null if not found)
- */
- IMPORT_C CFbsBitmap* GetThumbnailL(
- MVPbkStoreContactFieldCollection& aFieldCollection );
-
- /**
- * Checks if the given string is a phone number.
- */
- IMPORT_C static TBool IsPhoneNumberL( const TDesC& aData );
-
- /**
- * Checks if the given string is an email address.
- */
- IMPORT_C static TBool IsEmailAddressL( const TDesC& aData );
-
- /**
- * Appends content of name fields to the given array.
- * Uses less fields than LookupL, here only family and given name
- * are taken and returned.
- *
- * @param aFieldCollection fields to check
- * @param aArray array to which strings are appended
- */
- IMPORT_C void GetNamesForFindL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray );
-
- /**
- * Gets content of name fields.
- * Overload for getting results in one string instead of an array.
- * @param aFieldCollection fields to check
- * @return content of name fields in no particular order separated by a space
- */
- IMPORT_C HBufC* GetNamesForFindL(
- MVPbkStoreContactFieldCollection& aFieldCollection );
-
- /**
- * Splits a string into parts.
- * Space, comma, and semicolon are treated as separators.
- */
- IMPORT_C static CDesCArray* SplitFindStringL(const TDesC& aFindString);
-
- /**
- * Splits a "name1 name2 ... <something>" into two parts:
- * "name1 name2 ..." and "something".
- * < and > characters are removed.
- * The resulting strings are appended to the given arrray.
- * Such format is used by messaging components and this function
- * is useful if a search has to be made based on both the name and
- * the phone number / email address.
- * @param aString input string
- * @param aArray array to append to
- */
- IMPORT_C static void SplitMsgContactL( const TDesC& aString, CDesCArray& aArray );
-
- /**
- * Appends the values from all matching text fields to a given array.
- * @param aFieldCollection fields to scan through
- * @param aArray destination array
- * @param aVersitName versit property name
- * @param aVersitParam versit property parameter
- */
- IMPORT_C void GetCustomFieldL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray,
- TVPbkFieldTypeName aVersitName,
- TVPbkFieldTypeParameter aVersitParam );
-
- /**
- * Returns a matching field type for the given versit name/parameter.
- * The returned list is empty if no matching field types were found.
- * @param aVersitName versit property name
- * @param aVersitParam versit property parameter
- * @return field type list, also on the cleanup stack
- */
- IMPORT_C CVPbkFieldTypeRefsList* GetCustomFieldTypeLC(
- TVPbkFieldTypeName aVersitName,
- TVPbkFieldTypeParameter aVersitParam );
-
- /**
- * Finds impp field data.
- * @param aFieldCollection fields to scan
- * @param aSchemeOnlyAray if non-null then scheme parts are appended to here
- * @param aUriOnlyArray if non-null then uri parts are appended to here
- * @param aFullArray if non-null then full field contents are appended to here
- */
- IMPORT_C void GetImppFieldL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray* aSchemeOnlyArray,
- CDesCArray* aUriOnlyArray,
- CDesCArray* aFullArray );
-
- /**
- * Finds all contacts that have a birthday on the given month/day.
- * Other components from aDate - like year, hours, etc. - are ignored.
- * @param aDate date to look for
- * @param aLinkArray links are appended to this array
- * If no matching contacts are found then aLinkArray is left untouched.
- */
- IMPORT_C void FindContactWithBirthdayL( const TTime& aDate,
- CVPbkContactLinkArray& aLinkArray );
-
-private: // from MVPbkContactStoreListObserver, MVPbkContactStoreObserver
-
- /**
- * Called when the opening process is complete, ie. all stores have
- * been reported either failed or successfully opened.
- */
- void OpenComplete();
-
- /**
- * Called when a contact store is ready for use.
- */
- void StoreReady( MVPbkContactStore& aContactStore );
-
- /**
- * Called when a contact store becomes unavailable.
- * Client may inspect the reason of the unavailability and decide whether or not
- * it will keep the store opened (ie. listen to the store events).
- * @param aContactStore The store that became unavailable.
- * @param aReason The reason why the store is unavailable.
- * This is one of the system wide error codes.
- */
- void StoreUnavailable( MVPbkContactStore& aContactStore, TInt aReason );
-
- /**
- * Called when changes occur in the contact store.
- * @see TVPbkContactStoreEvent, MVPbkContactStoreObserver.h
- *
- * @param aContactStore
- * @param aStoreEvent Event that has occured.
- */
- void HandleStoreEventL( MVPbkContactStore& aContactStore,
- TVPbkContactStoreEvent aStoreEvent );
-
-private: // from MVPbkContactFindFromStoresObserver
- /**
- * Called when find is complete on a single store. Callee takes
- * ownership of the results. In case of an error during find,
- * the aResultsFromStore may contain only partial results of the find.
- *
- * @param aStore is the store from which the contacts were searched from
- *
- * @param aResultsFromStore Array of contact links that matched the find.
- * Callee must take ownership of this object in
- * the end of the function, ie. in case the function
- * does not leave.
- */
- void FindFromStoreSucceededL( MVPbkContactStore& aStore,
- MVPbkContactLinkArray* aResultsFromStore );
-
- /**
- * This function is called if/when there were errors while searching
- * from a store.
- * @param aStore is the store from which the search was done.
- * @param aError is the error code.
- */
- void FindFromStoreFailed( MVPbkContactStore& aStore, TInt aError );
-
- /**
- * Called when find is complete.
- */
- void FindFromStoresOperationComplete();
-
-private: // from MVPbkContactFindObserver
-
- /**
- * Called when find is complete. Callee takes ownership of the results.
- * In case of an error during find, the aResults may contain only
- * partial results of the find.
- *
- * @param aResults Array of contact links that matched the find.
- * Callee must take ownership of this object in
- * the end of the function, ie. in case the function
- * does not leave.
- */
- void FindCompleteL( MVPbkContactLinkArray* aResults );
-
- /**
- * Called in case the find fails for some reason.
- *
- * @param aError One of the system wide error codes.
- */
- void FindFailed( TInt aError );
-
-private: // from MVPbkSingleContactOperationObserver
-
- /**
- * Called when operation is completed.
- *
- * @param aOperation the completed operation.
- * @param aContact the contact returned by the operation.
- * Client must take the ownership immediately.
- */
- void VPbkSingleContactOperationComplete(
- MVPbkContactOperationBase& aOperation, MVPbkStoreContact* aContact );
-
- /**
- * Called if the operation fails.
- *
- * @param aOperation the failed operation.
- * @param aError error code of the failure.
- */
- void VPbkSingleContactOperationFailed(
- MVPbkContactOperationBase& aOperation, TInt aError );
-
-private: // from MVPbkContactViewObserver
- void ContactViewReady(
- MVPbkContactViewBase& aView );
- void ContactViewUnavailable(
- MVPbkContactViewBase& aView );
- void ContactAddedToView(
- MVPbkContactViewBase& aView,
- TInt aIndex,
- const MVPbkContactLink& aContactLink );
- void ContactRemovedFromView(
- MVPbkContactViewBase& aView,
- TInt aIndex,
- const MVPbkContactLink& aContactLink );
- void ContactViewError(
- MVPbkContactViewBase& aView,
- TInt aError,
- TBool aErrorNotified );
-
-private: // Constants
-
- // Wrapper method IDs for calls that have an asynchronous version
- enum TMethodId
- {
- ENoMethod = 0,
- EMatchPhoneNumber,
- EMatchData,
- EGetStoreContact,
- EOpenStore,
- ECloseStores
- };
-
- // Wrapper method processing status.
- enum TMethodStatus
- {
- EIdle = 0,
- EExecuting,
- EFinished
- };
-
-private: // Methods
- const MVPbkStoreContactField* FindField( const MVPbkStoreContact& aContact,
- const MVPbkFieldType& aFType ) const;
- static CVPbkContactStoreUriArray* GetStoreArrayLC(
- const TDesC& (* const aFuncPtrs[])() );
- void OpenStoreL( const TDesC& (* const aFuncPtrs[])() );
- void OpenStoreL( const TDesC& (* const aFuncPtrs[])(),
- TRequestStatus& aStatus );
- void FreeOldOperation();
-
- // Copies the entries to the existing recipient array
- void CopyFindResultsL( MVPbkContactLinkArray* aResults );
-
- // Open store, code common to sync/async versions.
- void OpenStoreCommonL( const CVPbkContactStoreUriArray& aUriArray );
-
- // Match phonenumber, code common to sync/async versions.
- void MatchPhoneNumberCommonL( const TDesC& aData, TInt aDigits,
- CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags );
-
- void InitOperationL( TMethodId aApiMethod );
- void InitOperationL( TMethodId aApiMethod, TRequestStatus* aStatus );
- void InitOperation( TRequestStatus* aStatus );
- void OperationComplete( TInt ErrorCode = KErrNone );
- void OperationFailed( TInt aError );
- void CleanupNumberMatch();
- void RemoveSimilarEmailAddressesL( const TDesC& aData, CVPbkContactLinkArray& aLinkArray, const MVPbkFieldTypeList& aFieldTypes );
-
- void TryTextLookupL( const TDesC& aName, CVPbkContactLinkArray& aLinkArray );
- void TryNumberLookupL( const TDesC& aName, CVPbkContactLinkArray& aLinkArray );
-
- void PreCreateNameFieldTypesL();
- void PreCreateEmailFieldTypesL();
- void PreCreateXspIdFieldTypesL();
- void PreCreateNumberFieldTypesL();
- void PreCreateAddressFieldTypesL();
- void PreCreateWebAddressFieldTypesL();
- void PreCreateWebAddressHomeFieldTypesL();
- void PreCreateWebAddressWorkFieldTypesL();
- void PreCreateWorkAddressFieldTypesL();
- void PreCreateHomeAddressFieldTypesL();
-
- void GetTextFieldsL( const CVPbkFieldTypeRefsList& aList,
- const MVPbkStoreContactFieldCollection& aFieldCollection, CDesCArray& aArray );
-
-private: // Data
-
- // Used members
-
- RFs* iFsSession;
- TBool iFsSessionOwned;
- MVPbkStoreContact** iResultStoreContact; // result of GetStoreContact
- CVPbkContactLinkArray* iResultContactLinkArray; // result of matching operations
- TInt iResultContactLinkCnt; // number of links found in matching operations
- TRequestStatus* iClientStatus; // request status used in asynch calls
-
- // Own members
- CVPbkContactManager* iContactManager;
- MVPbkContactOperationBase* iOperation; // CM operation being processed
- CActiveSchedulerWait iASchedulerWait; // used in asynch calls
- CVPbkContactStoreUriArray* iStoreUris; // used in matching
- CVPbkPhoneNumberMatchStrategy* iMatchStrategy; // used in matching
- CVPbkPhoneNumberMatchStrategy::TConfig* iStratConfig; // used in matching
- TBool iSync; // is this wrapper call Synchronous (1) or Asynchronous (0)
- TInt iError; // error code used while processing VPbk-operations
- TBool iBackup;// contact store backup/restore in progress
- // API method ID. Needed for cleanup after method finishes.
- TMethodId iApiMethod;
- // API method status. Needed to know processing has finished.
- TMethodStatus iApiMethodStatus;
-
- CPbk2SortOrderManager* iSortOrderManager;
- MPbk2ContactNameFormatter* iNameFormatter;
-
- RPointerArray<MHgCtxContactObserver> iContactObservers; // ptrs not owned
- CVPbkFieldTypeRefsList* iNameFieldTypes;
- CVPbkFieldTypeRefsList* iEmailFieldTypes;
- CVPbkFieldTypeRefsList* iXspIdFieldTypes;
- CVPbkFieldTypeRefsList* iNumberFieldTypes;
- CVPbkFieldTypeRefsList* iAddressFieldTypes;
- CVPbkFieldTypeRefsList* iWebAddressFieldTypes;
- CVPbkFieldTypeRefsList* iWebAddressHomeFieldTypes;
- CVPbkFieldTypeRefsList* iWebAddressWorkFieldTypes;
- CVPbkFieldTypeRefsList* iWorkAddressFieldTypes;
- CVPbkFieldTypeRefsList* iHomeAddressFieldTypes;
- };
-
-/**
-* Panic codes used in CHgCtxContactMatcher.
-*
-* @since 3.1u
-*/
-class HgContactMatcherPanics
- {
-public: // API
-
- /**
- * Panic codes
- */
- enum TPanic
- {
- EPanNullPointer = 0,
- EPanInvalidParam,
- EPanInvalidOp
- };
-
-public:
-
- /**
- * Panic
- */
- static void Panic( TPanic aPanic );
- };
-
-#endif
-
-// End of File
--- a/homescreensrv_plat/context_utility_api/tsrc/inc/t_ui_context_utility_api.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
-* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: T_ui_context_utility_api test module.
-*
-*/
-
-
-
-#ifndef T_ui_context_utility_api_H
-#define T_ui_context_utility_api_H
-
-// INCLUDES
-#include "hgtestbase.h"
-#include "hgctxcontactmatcher.h"
-
-// Logging path
-_LIT( KT_ui_context_utility_apiLogPath, "\\logs\\testframework\\T_ui_context_utility_api\\" );
-// Log file
-_LIT( KT_ui_context_utility_apiLogFile, "T_ui_context_utility_api.txt" );
-
-// CLASS DECLARATION
-
-/**
-* This a T_ui_context_utility_api class.
-*/
-NONSHARABLE_CLASS(CT_ui_context_utility_api) : public CHgTestBase
- {
- public:
-
- CT_ui_context_utility_api();
-
- void ConstructL();
-
- static CT_ui_context_utility_api* NewL();
-
- void CreateEnvL();
- void DestroyEnv();
- TInt LoadTestCasesL(
- TInt& _test_case_no,
- CT_ui_context_utility_api::TCallReason aRunReason,
- TInt aTestToRun,
- RPointerArray<TTestCaseInfo>& aTestCases,
- TTestResult& aResult);
-
- ~CT_ui_context_utility_api();
-
- TInt RunTestL(
- CT_ui_context_utility_api::TCallReason aRunReason,
- TInt aTestToRun,
- RPointerArray<TTestCaseInfo>& aTestCases,
- TTestResult& aResult);
-
- RPtrHashMap<TDesC, TDesC>* GetImplHashTablePtr()
- {
- class CTestUtility : public CBase
- {
- public:
- CHgContextUtilityImpl* iImpl;
- };
-
- class CTestImplementation : CTimer
- {
- public:
- // number of pointers before iMusicContextInfo, calculate M-classes as pointers too
- TInt unneeded[12];
- RPtrHashMap<TDesC, TDesC> iMusicContextInfo;
- };
-
- // Fetch the pointer to hash table for testing purposes
- return &((CTestImplementation*)((CTestUtility*)iContextUtility)->iImpl)->iMusicContextInfo;
- }
- #define TEST_VAR_DECLARATIONS
- /**
- * all testmodule-global variables declarations are inserted here
- */
- #include "../src/T_ui_context_utility_api_cases.cpp"
- #undef TEST_VAR_DECLARATIONS
-
- // for creating test env
- CTrapCleanup* ENV_cleanup;
- TInt ENV_err;
- CEikonEnv* ENV_env;
- CAknAppUi* ENV_aknAppUI;
- };
-
-#endif // T_ui_context_utility_api_H
-
-// End of File
--- a/homescreensrv_plat/context_utility_api/tsrc/src/hgctxcontactmatcher.cpp Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2539 +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: Contact matching class
-*
-*/
-
-
-// System includes
-#include <e32base.h>
-#include <bamdesca.h>
-#include <cntitem.h>
-#include <eikenv.h>
-#include <bautils.h>
-#include <fbs.h>
-#include <imageconversion.h>
-#include <data_caging_path_literals.hrh>
-
-#include <CVPbkContactManager.h>
-#include <MVPbkContactStoreList.h>
-#include <MVPbkContactStore.h>
-#include <CVPbkContactStoreUriArray.h>
-#include <MVPbkContactLinkArray.h>
-#include <MVPbkContactLink.h>
-#include <MVPbkFieldType.h>
-#include <MVPbkStoreContact.h>
-#include <MVPbkStoreContactField.h>
-#include <MVPbkStoreContactFieldCollection.h>
-#include <MVPbkContactFieldData.h>
-#include <MVPbkContactFieldTextData.h>
-#include <MVPbkContactFieldUriData.h>
-#include <MVPbkContactFieldDateTimeData.h>
-#include <MVPbkContactFieldBinaryData.h>
-#include <MVPbkContactOperationBase.h>
-#include <MVPbkContactStoreProperties.h>
-#include <TVPbkContactStoreUriPtr.h>
-#include <VPbkContactStoreUris.h>
-#include <MPbk2ContactNameFormatter.h>
-#include <CVPbkFieldTypeSelector.h>
-#include <TVPbkFieldVersitProperty.h>
-#include <CVPbkFieldTypeRefsList.h>
-#include <TVPbkWordParserCallbackParam.h>
-#include <CVPbkContactViewDefinition.h>
-#include <MVPbkContactViewBase.h>
-#include <coemain.h>
-#include <CPbk2SortOrderManager.h>
-#include <Pbk2ContactNameFormatterFactory.h>
-
-#include "hgctxcontactmatcher.h"
-
-
-#include "hgctxutilslogging.h"
-
-
-// ================= Static Constant Data ===================
-
-typedef const TDesC& (*UriFuncPtr)();
-
-// Number match store URIs in priority order.
-// When doing number matching, order of the stores in the uri array will
-// determine which stores are searched first (sequential match). We stop
-// the search when first match is found.
-static const UriFuncPtr NumberMatchStoreUris[] =
- {
- VPbkContactStoreUris::DefaultCntDbUri,
- // If we don't manage to open some store, we remove it from our array
- VPbkContactStoreUris::SimGlobalAdnUri,
- VPbkContactStoreUris::SimGlobalSdnUri,
- NULL, // end marker
- };
-
-// All store URIs except own number store
-static const UriFuncPtr AllStoreUris[] =
- {
- VPbkContactStoreUris::DefaultCntDbUri,
- // If we don't manage to open some store, we remove it from our array
- VPbkContactStoreUris::SimGlobalAdnUri,
- VPbkContactStoreUris::SimGlobalSdnUri,
- VPbkContactStoreUris::SimGlobalFdnUri,
- NULL, // end marker
- };
-
-// Own number store URIs
-static const UriFuncPtr OwnNumberStoreUris[] =
- {
- VPbkContactStoreUris::SimGlobalOwnNumberUri,
- NULL, // end marker
- };
-
-// number of digits that must match from the right side of a phone number
-const TInt KNumberMatchLenFromRight = 7;
-
-// granularity for CDesCArray
-const TInt KArrayGranularity = 4;
-
-// YYYYMMDD:HHMMSS.MMMMMM
-_LIT(KNullTime, "11110000:010101.00000");
-
-// ================= STATIC FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// FindWordSplitterL
-// ---------------------------------------------------------
-//
-static TInt FindWordSplitterL( TAny* aParams )
- {
- TVPbkWordParserCallbackParam* parser =
- static_cast<TVPbkWordParserCallbackParam*>( aParams );
-
- const TText* ptr = parser->iStringToParse->Ptr();
- const TText* end = ptr + parser->iStringToParse->Length();
-
- const TText* startOfWord=NULL;
- for ( ; ; )
- {
- if ( ptr==end || TChar(*ptr).IsSpace() || *ptr == ',' || *ptr == ';' )
- {
- if ( startOfWord )
- {
- TPtrC addWord( startOfWord,ptr - startOfWord );
- parser->iWordArray->AppendL( addWord );
- startOfWord = NULL;
- }
- if ( ptr == end )
- {
- break;
- }
- }
- else if ( !startOfWord )
- {
- startOfWord = ptr;
- }
- ptr++;
- }
- return( KErrNone );
- }
-
-static HBufC* CombineStringsLC( CDesCArray& aArray )
- {
- TInt len = 0;
- for ( TInt i = 0, ie = aArray.Count(); i != ie; ++i )
- {
- len += aArray[i].Length() + 1;
- }
- HBufC* result = HBufC::NewLC( len );
- TPtr p( result->Des() );
- for ( TInt i = 0, ie = aArray.Count(); i != ie; ++i )
- {
- if ( i )
- {
- p.Append( ' ' );
- }
- p.Append( aArray[i] );
- }
- return result;
- }
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------------------------
-// Two-phase constructor for CHgCtxContactMatcher class.
-// ----------------------------------------------------------------------------
-EXPORT_C CHgCtxContactMatcher* CHgCtxContactMatcher::NewL(
- RFs* aFsSession )
- {
- CHgCtxContactMatcher* self = CHgCtxContactMatcher::NewLC( aFsSession );
- CleanupStack::Pop(self);
- return self;
- }
-
-// ----------------------------------------------------------------------------
-// Two-phase constructor for CHgCtxContactMatcher class.
-// ----------------------------------------------------------------------------
-EXPORT_C CHgCtxContactMatcher* CHgCtxContactMatcher::NewLC(
- RFs* aFsSession )
- {
- CHgCtxContactMatcher* self = new ( ELeave ) CHgCtxContactMatcher( aFsSession );
- CleanupStack::PushL(self);
- self->ConstructL();
- return self;
- }
-
-// ----------------------------------------------------------------------------
-// C++ destructor.
-// ----------------------------------------------------------------------------
-EXPORT_C CHgCtxContactMatcher::~CHgCtxContactMatcher()
- {
- delete iNameFieldTypes;
- delete iNumberFieldTypes;
- delete iEmailFieldTypes;
- delete iXspIdFieldTypes;
- delete iAddressFieldTypes;
- delete iWebAddressFieldTypes;
- delete iHomeAddressFieldTypes;
- delete iWorkAddressFieldTypes;
-
- FreeOldOperation();
- CleanupNumberMatch();
- delete iStoreUris;
- delete iContactManager;
- delete iSortOrderManager;
- delete iNameFormatter;
-
- if ( iClientStatus )
- {
- User::RequestComplete( iClientStatus, KErrCancel );
- }
- if ( iASchedulerWait.IsStarted() )
- {
- iASchedulerWait.AsyncStop();
- }
-
- iContactObservers.Close();
-
- if ( iFsSessionOwned && iFsSession )
- {
- iFsSession->Close();
- delete iFsSession;
- }
- }
-
-// ----------------------------------------------------------------------------
-// C++ Constructor.
-// ----------------------------------------------------------------------------
-CHgCtxContactMatcher::CHgCtxContactMatcher( RFs* aFsSession) : iFsSession( aFsSession )
- {
- }
-
-// ----------------------------------------------------------------------------
-// Second phase constructor
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::ConstructL()
- {
- if ( !iFsSession )
- {
- // The contact manager would be okay with NULL but some of our own functions
- // need an RFs.
- iFsSessionOwned = ETrue;
- iFsSession = new ( ELeave ) RFs;
- User::LeaveIfError( iFsSession->Connect() );
- }
-
- iContactManager = CVPbkContactManager::NewL(
- *CVPbkContactStoreUriArray::NewLC(), iFsSession );
- CleanupStack::PopAndDestroy(); // CVPbkContactStoreUriArray
-
- // No stores open yet
- iStoreUris = CVPbkContactStoreUriArray::NewL();
- }
-
-//******************* API-methods *********************************************
-
-// ----------------------------------------------------------------------------
-// Synchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::OpenStoreL(
- const CVPbkContactStoreUriArray& aUriArray )
- {
- InitOperationL( EOpenStore );
- OpenStoreCommonL( aUriArray );
- if ( iApiMethodStatus != EFinished )
- {
- iApiMethodStatus = EExecuting;
- // Wait until stores are open
- iASchedulerWait.Start();
- }
- User::LeaveIfError( iError );
- }
-
-// ----------------------------------------------------------------------------
-// Asynchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::OpenStoreL(
- const CVPbkContactStoreUriArray& aUriArray, TRequestStatus& aStatus )
- {
- InitOperationL( EOpenStore );
- OpenStoreCommonL( aUriArray );
- InitOperation( &aStatus );
-
- if ( iApiMethodStatus != EFinished )
- {
- iApiMethodStatus = EExecuting;
- }
- }
-
-
-// ----------------------------------------------------------------------------
-// Common code to sync/async versions.
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::OpenStoreCommonL(
- const CVPbkContactStoreUriArray& aUriArray )
- {
- if (iStoreUris->Count())
- {
- // Opening more stores when some stores are already open is not
- // supported. Support would require managing iStoreUris properly
- // so that it contains all open stores.
- User::Leave(KErrGeneral);
- }
-
- const TInt count = aUriArray.Count();
-
- for (TInt i = 0; i < count; ++i)
- {
- // Appended Uri:s to the array. If store fails to open it is removed
- // from the array. This keeps Uri's in priority order in the array.
- TVPbkContactStoreUriPtr uriPtr = aUriArray[i];
- iStoreUris->AppendL( uriPtr );
-
- iContactManager->LoadContactStoreL( uriPtr );
- }
- MVPbkContactStoreList& storeList = iContactManager->ContactStoresL();
- storeList.OpenAllL( *this );
- }
-
-// ----------------------------------------------------------------------------
-// Synchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::OpenAllStoresL()
- {
- OpenStoreL(AllStoreUris);
- }
-
-// ----------------------------------------------------------------------------
-// Asynchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::OpenAllStoresL( TRequestStatus& aStatus )
- {
- OpenStoreL(AllStoreUris, aStatus);
- }
-
-// ----------------------------------------------------------------------------
-// Synchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::OpenDefaultMatchStoresL()
- {
- OpenStoreL(NumberMatchStoreUris);
- }
-
-// ----------------------------------------------------------------------------
-// Asynchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::OpenDefaultMatchStoresL( TRequestStatus& aStatus )
- {
- OpenStoreL(NumberMatchStoreUris, aStatus);
- }
-
-// ----------------------------------------------------------------------------
-// Open OwnNumber stores.
-// Synchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::OpenOwnNumberStoresL()
- {
- OpenStoreL(OwnNumberStoreUris);
- }
-
-// ----------------------------------------------------------------------------
-// Open OwnNumber stores.
-// Asynchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::OpenOwnNumberStoresL( TRequestStatus& aStatus )
- {
- OpenStoreL(OwnNumberStoreUris, aStatus);
- }
-
-// ----------------------------------------------------------------------------
-// Close all open stores.
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::CloseStoresL()
- {
- // Closing stores does not work. MatchDataL() finds contacts from
- // closed stores.
-
- InitOperationL( ECloseStores );
-
- iApiMethodStatus = EExecuting;
- TRAPD( err, iContactManager->ContactStoresL().CloseAll( *this ) );
- iApiMethodStatus = EFinished;
- if ( err == KErrNone)
- {
- delete iStoreUris; iStoreUris = NULL;
- iStoreUris = CVPbkContactStoreUriArray::NewL();
- }
- else
- {
- User::Leave(err);
- }
- }
-
-// ----------------------------------------------------------------------------
-// Synchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::MatchPhoneNumberL(
- const TDesC& aData, TInt aDigits,
- CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags,
- CVPbkContactLinkArray& aLinkArray )
- {
- InitOperationL( EMatchPhoneNumber );
- iResultContactLinkArray = &aLinkArray;
-
- // Start asynchronous matching and wait until results are ready
- MatchPhoneNumberCommonL( aData, aDigits, aFlags );
- if ( iApiMethodStatus != EFinished )
- {
- iApiMethodStatus = EExecuting;
- iASchedulerWait.Start();
- }
- User::LeaveIfError( iError );
- }
-
-
-// ----------------------------------------------------------------------------
-// Asynchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::MatchPhoneNumberL(
- const TDesC& aData, TInt aDigits,
- CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags,
- CVPbkContactLinkArray& aLinkArray, TRequestStatus& aStatus )
- {
- InitOperationL( EMatchPhoneNumber );
- iResultContactLinkArray = &aLinkArray;
- // Start asynchronous matching
- MatchPhoneNumberCommonL( aData, aDigits, aFlags );
- InitOperation( &aStatus );
- if ( iApiMethodStatus != EFinished )
- {
- iApiMethodStatus = EExecuting;
- }
- }
-
-// ----------------------------------------------------------------------------
-// Common code for sync and async versions
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::MatchPhoneNumberCommonL(
- const TDesC& aData, TInt aDigits,
- CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags )
- {
- // Delete resources allocated for previous match
- CleanupNumberMatch();
-
- // iStoreUris is filled when stores are opened
-
- iStratConfig = new (ELeave) CVPbkPhoneNumberMatchStrategy::TConfig(
- aDigits,
- *iStoreUris,
- CVPbkPhoneNumberMatchStrategy::EVPbkSequentialMatch,
- aFlags);
- iMatchStrategy = CVPbkPhoneNumberMatchStrategy::NewL(
- *iStratConfig,
- *iContactManager,
- *this);
- // Start asynchronous matching
- iMatchStrategy->MatchL( aData );
- }
-
-
-// ----------------------------------------------------------------------------
-// Find from a store succeeded
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::FindFromStoreSucceededL( MVPbkContactStore& /*aStore*/,
- MVPbkContactLinkArray* aResultsFromStore )
- {
- __ASSERT_DEBUG( aResultsFromStore, HgContactMatcherPanics::Panic(
- HgContactMatcherPanics::EPanNullPointer ));
-
- // Take the ownership of the result immediately
- CleanupDeletePushL( aResultsFromStore );
-
- CopyFindResultsL( aResultsFromStore );
-
- CleanupStack::PopAndDestroy(); // aResultsFromStore
- }
-
-// ----------------------------------------------------------------------------
-// Copy the found results for a store into array
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::CopyFindResultsL( MVPbkContactLinkArray*
- aResults )
- {
- const TInt count = aResults->Count();
- if ( iResultContactLinkArray )
- {
- // Copy links to the member array
- for ( TInt i = 0; i < count; ++i )
- {
- iResultContactLinkArray->AppendL( aResults->At( i ).CloneLC() );
- CleanupStack::Pop(); // cloned link
- }
- }
- else
- {
- iResultContactLinkCnt += count;
- }
- }
-
-
-// ----------------------------------------------------------------------------
-// Find failed
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::FindFromStoreFailed( MVPbkContactStore& /*aStore*/, TInt /*aError*/ )
- {
- //no operation, search to continue from the other stores
- }
-
-
-// ----------------------------------------------------------------------------
-// Find complete
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::FindFromStoresOperationComplete()
- {
- if (!iResultContactLinkArray)
- {
- // Links were not copied. Result is whether any links found or not.
- OperationComplete( iResultContactLinkCnt ? KErrNone:KErrNotFound );
- }
- else
- {
- OperationComplete();
- iResultContactLinkArray = NULL;
- }
- }
-
-// ----------------------------------------------------------------------------
-// Return global list of field types.
-// ----------------------------------------------------------------------------
-EXPORT_C const MVPbkFieldTypeList& CHgCtxContactMatcher::FieldTypes() const
- {
- return iContactManager->FieldTypes();
- }
-
-// ----------------------------------------------------------------------------
-// Synchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::GetStoreContactL(
- const MVPbkContactLink& aLink, MVPbkStoreContact** aStoreContact )
- {
- InitOperationL( EGetStoreContact );
- iResultStoreContact = aStoreContact;
-
- // Start asynchronous operation and wait until results are ready
- FreeOldOperation();
- iOperation = iContactManager->RetrieveContactL( aLink, *this );
- if ( iApiMethodStatus != EFinished )
- {
- iApiMethodStatus = EExecuting;
- iASchedulerWait.Start();
- }
- User::LeaveIfError( iError );
- }
-
-// ----------------------------------------------------------------------------
-// Asynchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::GetStoreContactL(
- const MVPbkContactLink& aLink, MVPbkStoreContact** aStoreContact,
- TRequestStatus& aStatus )
- {
- InitOperationL( EGetStoreContact );
- iResultStoreContact = aStoreContact;
- // Start asynchronous operation
- FreeOldOperation();
- iOperation = iContactManager->RetrieveContactL( aLink, *this );
- InitOperation( &aStatus );
- if ( iApiMethodStatus != EFinished )
- {
- iApiMethodStatus = EExecuting;
- }
- }
-
-// ----------------------------------------------------------------------------
-// Synchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::IsOwnNumberL( const TDesC& aNumber, TBool& aResult )
- {
- InitOperationL( EMatchPhoneNumber );
-
- // Not interested in links, only whether found or not
- iResultContactLinkArray = NULL;
- iResultContactLinkCnt = 0;
-
- // Start asynchronous matching and wait until results are ready
- MatchPhoneNumberCommonL( aNumber, aNumber.Length(),
- CVPbkPhoneNumberMatchStrategy::EVPbkStopOnFirstMatchFlag );
- if ( iApiMethodStatus != EFinished )
- {
- iApiMethodStatus = EExecuting;
- iASchedulerWait.Start();
- }
- User::LeaveIfError( iError );
-
- aResult = iResultContactLinkCnt > 0;
- }
-
-// ----------------------------------------------------------------------------
-// Asynchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::IsOwnNumberL( const TDesC& aNumber,
- TRequestStatus& aStatus )
- {
- InitOperationL( EMatchPhoneNumber );
-
- // Not interested in links, only whether found or not
- iResultContactLinkArray = NULL;
- iResultContactLinkCnt = 0;
-
- // Start asynchronous matching
- MatchPhoneNumberCommonL( aNumber, aNumber.Length(),
- CVPbkPhoneNumberMatchStrategy::EVPbkStopOnFirstMatchFlag );
- InitOperation( &aStatus );
- if ( iApiMethodStatus != EFinished )
- {
- iApiMethodStatus = EExecuting;
- }
- }
-
-// ----------------------------------------------------------------------------
-// Cancel asynchronous operation
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::CancelOperation()
- {
- if (iApiMethodStatus != EExecuting)
- {
- return;
- }
-
- __ASSERT_DEBUG(!iSync, HgContactMatcherPanics::Panic(
- HgContactMatcherPanics::EPanInvalidOp));
-
- switch(iApiMethod)
- {
- case EMatchData:
- case EGetStoreContact:
- FreeOldOperation(); // deleting the operation cancels it
- break;
- case EMatchPhoneNumber:
- CleanupNumberMatch();
- break;
- default:
- ;
- }
-
- User::RequestComplete( iClientStatus, KErrCancel );
-
- iApiMethod = ENoMethod;
- iApiMethodStatus = EFinished;
- }
-
-// ----------------------------------------------------------------------------
-// GetFieldData, for EVPbkFieldStorageTypeText
-// ----------------------------------------------------------------------------
-EXPORT_C TPtrC CHgCtxContactMatcher::GetFieldDataTextL(
- const MVPbkStoreContact& aContact,
- const MVPbkFieldType& aFType ) const
- {
- TPtrC ret(KNullDesC);
- const MVPbkStoreContactField* field = FindField( aContact, aFType);
- if (field)
- {
- const MVPbkContactFieldData& fdata = field->FieldData();
- if (fdata.DataType() == EVPbkFieldStorageTypeText)
- {
- const MVPbkContactFieldTextData& fdata2 =
- MVPbkContactFieldTextData::Cast(fdata);
- ret.Set( fdata2.Text() );
- }
- else
- {
- User::Leave( KErrArgument );
- }
- }
- return ret;
- }
-
-// ----------------------------------------------------------------------------
-// GetFieldData, for EVPbkFieldStorageTypeDateTime
-// ----------------------------------------------------------------------------
-EXPORT_C TTime CHgCtxContactMatcher::GetFieldDataDateTimeL(
- const MVPbkStoreContact& aContact,
- const MVPbkFieldType& aFType ) const
- {
- TTime ret(KNullTime);
- const MVPbkStoreContactField* field = FindField( aContact, aFType);
- if (field)
- {
- const MVPbkContactFieldData& fdata = field->FieldData();
- if (fdata.DataType() == EVPbkFieldStorageTypeDateTime)
- {
- const MVPbkContactFieldDateTimeData& fdata2 =
- MVPbkContactFieldDateTimeData::Cast( fdata );
- ret = fdata2.DateTime();
- }
- else
- {
- User::Leave( KErrArgument );
- }
- }
- return ret;
- }
-
-// ----------------------------------------------------------------------------
-// GetFieldData, for EVPbkFieldStorageTypeBinary
-// ----------------------------------------------------------------------------
-EXPORT_C TPtrC8 CHgCtxContactMatcher::GetFieldDataBinaryL(
- const MVPbkStoreContact& aContact,
- const MVPbkFieldType& aFType ) const
- {
- TPtrC8 ret(KNullDesC8);
- const MVPbkStoreContactField* field = FindField( aContact, aFType);
- if (field)
- {
- const MVPbkContactFieldData& fdata = field->FieldData();
- if (fdata.DataType() == EVPbkFieldStorageTypeBinary)
- {
- const MVPbkContactFieldBinaryData& fdata2 =
- MVPbkContactFieldBinaryData::Cast( fdata );
- ret.Set( fdata2.BinaryData() );
- }
- else
- {
- User::Leave( KErrArgument );
- }
- }
- return ret;
- }
-
-
-//******************************** Private Methods ***************************
-
-// ----------------------------------------------------------------------------
-// Finds a field of given type from contact.
-// Returns pointer to field or NULL if not found.
-// ----------------------------------------------------------------------------
- const MVPbkStoreContactField* CHgCtxContactMatcher::FindField(
- const MVPbkStoreContact& aContact,
- const MVPbkFieldType& aFType ) const
- {
- const MVPbkStoreContactFieldCollection& coll = aContact.Fields();
- TInt n = coll.FieldCount();
-
- const MVPbkStoreContactField* field = NULL;
- TBool bFound = EFalse;
- for(TInt i=0; i < n && !bFound; ++i)
- {
- field = &coll.FieldAt( i );
- const MVPbkFieldType* ftype = field->MatchFieldType( 0 );
- if ( ftype )
- {
- if ( ftype->IsSame( aFType ))
- {
- bFound = ETrue;
- }
- }
- }
- if ( !bFound )
- {
- field = NULL;
- }
- return field;
- }
-
-// ----------------------------------------------------------------------------
-// Get URI array with stores
-// ----------------------------------------------------------------------------
-CVPbkContactStoreUriArray* CHgCtxContactMatcher::GetStoreArrayLC(
- const TDesC& (* const aFuncPtrs[])() )
- {
- CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
-
- // Add stores
- for(TInt i = 0; aFuncPtrs[i]; i++)
- {
- TVPbkContactStoreUriPtr uriPtr(aFuncPtrs[i]());
- uriArray->AppendL(uriPtr);
- }
- return uriArray;
- }
-
-// ----------------------------------------------------------------------------
-// Open stores. Synchronous version
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::OpenStoreL(const TDesC& (* const aFuncPtrs[])())
- {
- CVPbkContactStoreUriArray* uriArray = GetStoreArrayLC(aFuncPtrs);
-
- CHgCtxContactMatcher::OpenStoreL(*uriArray);
- CleanupStack::PopAndDestroy(uriArray);
- }
-
-// ----------------------------------------------------------------------------
-// Open stores. Asynchronous version
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::OpenStoreL(const TDesC& (* const aFuncPtrs[])(),
- TRequestStatus& aStatus)
- {
- CVPbkContactStoreUriArray* uriArray = GetStoreArrayLC(aFuncPtrs);
-
- CHgCtxContactMatcher::OpenStoreL(*uriArray, aStatus);
- CleanupStack::PopAndDestroy(uriArray);
- }
-
-// ----------------------------------------------------------------------------
-// Called when the opening process is complete,
-// ie. all stores have been reported either failed or successfully opened.
-// ----------------------------------------------------------------------------
-//
-void CHgCtxContactMatcher::OpenComplete()
- {
- TInt error = KErrNone;
- if ( iStoreUris->Count() == 0 )
- {
- // unable to open any of the specified stores
- error = KErrNotSupported;
- }
- OperationComplete( error );
- }
-
-// ----------------------------------------------------------------------------
-// Called when a contact store is ready to use.
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::StoreReady( MVPbkContactStore& /*aContactStore*/ )
- {
- }
-
-// ----------------------------------------------------------------------------
-// Called when a contact store becomes unavailable.
-// Client may inspect the reason of the unavailability and decide whether or not
-// it will keep the store opened (ie. listen to the store events).
-// @param aContactStore The store that became unavailable.
-// @param aReason The reason why the store is unavailable.
-// This is one of the system wide error codes.
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::StoreUnavailable( MVPbkContactStore& aContactStore,
- TInt /*aReason*/ )
- {
- // Remove contact store from uri list
- iStoreUris->Remove( aContactStore.StoreProperties().Uri() );
- }
-
-// ----------------------------------------------------------------------------
-// Called when changes occur in the contact store.
-// @see TVPbkContactStoreEvent
-//
-// @param aStoreEvent Event that has occured.
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::HandleStoreEventL(
- MVPbkContactStore& /*aContactStore*/,
- TVPbkContactStoreEvent aStoreEvent)
- {
- // Contact and group events can be ignored, but we pass backup events for the observer.
- switch ( aStoreEvent.iEventType )
- {
- case TVPbkContactStoreEvent::EStoreBackupBeginning:
- case TVPbkContactStoreEvent::EStoreRestoreBeginning:
- {
- iBackup = ETrue;
- break;
- }
- case TVPbkContactStoreEvent::EStoreBackupRestoreCompleted:
- {
- iBackup = EFalse;
- break;
- }
- case TVPbkContactStoreEvent::EContactAdded:
- case TVPbkContactStoreEvent::EContactDeleted:
- case TVPbkContactStoreEvent::EContactChanged:
- {
- for ( TInt i = 0, ie = iContactObservers.Count(); i != ie; ++i )
- {
- iContactObservers[i]->HandleContactEventL();
- }
- break;
- }
- default:
- break;
- }
- }
-
-
-// ----------------------------------------------------------------------------
-// Called when find is complete. Callee takes ownership of the results.
-// In case of an error during find, the aResults may contain only
-// partial results of the find.
-//
-// @param aResults Array of contact links that matched the find.
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::FindCompleteL( MVPbkContactLinkArray* aResults )
- {
- __ASSERT_DEBUG( aResults, HgContactMatcherPanics::Panic(
- HgContactMatcherPanics::EPanNullPointer ));
-
- // Take the ownership of the result immediately
- CleanupDeletePushL( aResults );
-
- CopyFindResultsL( aResults );
-
- CleanupStack::PopAndDestroy(); // aResults
-
- if (!iResultContactLinkArray)
- {
- // No need to copy links. Only interested whether found or not
- OperationComplete( iResultContactLinkCnt ? KErrNone:KErrNotFound );
- }
- else
- {
- OperationComplete();
- iResultContactLinkArray = NULL;
- }
- }
-
-// ----------------------------------------------------------------------------
-// Called in case the find fails for some reason.
-//
-// @param aError One of the system wide error codes.
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::FindFailed( TInt aError )
- {
- OperationFailed( aError );
- iResultContactLinkArray = NULL;
- }
-
-// ----------------------------------------------------------------------------
-// Free old VPbk-operation.
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::FreeOldOperation()
- {
- delete iOperation;
- iOperation = NULL;
- }
-
-// ----------------------------------------------------------------------------
-// Called when operation is completed.
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::VPbkSingleContactOperationComplete(
- MVPbkContactOperationBase& /*aOperation*/, MVPbkStoreContact* aContact)
- {
- *iResultStoreContact = aContact;
- iResultStoreContact = NULL;
- OperationComplete();
- }
-
-// ----------------------------------------------------------------------------
-// Called if the operation fails.
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::VPbkSingleContactOperationFailed(
- MVPbkContactOperationBase& /*aOperation*/, TInt aError)
- {
- OperationFailed( aError );
- }
-
-// ----------------------------------------------------------------------------
-// Set member variables for sync operation
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::InitOperationL( TMethodId aMethod )
- {
- if ( iBackup )
- {
- User::Leave( KErrAccessDenied );
- }
-
- // Check whether operation is in progress
- if ( iApiMethodStatus == EExecuting )
- {
- User::Leave( KErrInUse );
- }
-
- iSync = ETrue;
- iError = KErrNone;
- iApiMethod = aMethod;
- iApiMethodStatus = EIdle;
- }
-
-// ----------------------------------------------------------------------------
-// Set member variables for async operation
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::InitOperationL( TMethodId aMethod, TRequestStatus* aStatus )
- {
- InitOperationL( aMethod );
-
- iSync = EFalse;
- iClientStatus = aStatus;
- *iClientStatus = KRequestPending;
- }
-
-// ----------------------------------------------------------------------------
-// Set member variables for async operation
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::InitOperation( TRequestStatus* aStatus )
- {
- iSync = EFalse;
- iClientStatus = aStatus;
- *iClientStatus = KRequestPending;
- }
-
-// ----------------------------------------------------------------------------
-// Sync/async operation finished succesfully, return results to method caller.
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::OperationComplete( TInt aErrorCode )
- {
- if (iSync)
- {
- if ( iASchedulerWait.IsStarted() )
- {
- iASchedulerWait.AsyncStop();
- }
- }
- else
- {
- if ( iClientStatus )
- {
- User::RequestComplete( iClientStatus, aErrorCode );
- iClientStatus = NULL;
- }
- }
- iApiMethodStatus = EFinished;
- }
-
-// ----------------------------------------------------------------------------
-// Sync/async operation failed, return results to method caller.
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::OperationFailed( TInt aError )
- {
- iError = aError;
- OperationComplete( aError );
- }
-
-// ----------------------------------------------------------------------------
-// Free resources allocated for number matching
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::CleanupNumberMatch()
-{
- delete iMatchStrategy;
- iMatchStrategy = NULL;
-
- delete iStratConfig;
- iStratConfig = NULL;
-
- // store uris are not deleted here - opened array remains valid
- // until new set of stores is opened.
-}
-
-// ---------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetContactStoresL
-// ---------------------------------------------------------------------------
-EXPORT_C MVPbkContactStoreList& CHgCtxContactMatcher::GetContactStoresL()
- {
- return iContactManager->ContactStoresL();
- }
-
-
-// -----------------------------------------------------------------------------
-// TInt CHgCtxContactMatcher::GetName
-//
-// Returns the formatted name fo the contact
-// -----------------------------------------------------------------------------
-EXPORT_C HBufC* CHgCtxContactMatcher::GetNameL( MVPbkStoreContactFieldCollection&
- aFieldCollection )
- {
- MPbk2ContactNameFormatter& nameFormatter = ContactNameFormatterL();
-
- HBufC* formattedName = nameFormatter.GetContactTitleOrNullL( aFieldCollection,
- MPbk2ContactNameFormatter::EUseSeparator );
- return formattedName;
- }
-
-// -----------------------------------------------------------------------------
-// CVPbkContactManager& CHgCtxContactMatcher::GetContactManager( )
-// -----------------------------------------------------------------------------
-EXPORT_C CVPbkContactManager& CHgCtxContactMatcher::GetContactManager()
- {
- return *iContactManager;
- }
-
-
-// ----------------------------------------------------------------------------
-// Synchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::MatchDataL( const TDesC& aData,
- const MVPbkFieldTypeList& aFieldTypes,
- CVPbkContactLinkArray& aLinkArray)
- {
- InitOperationL( EMatchData );
- iResultContactLinkArray = &aLinkArray;
-
- // Start asynchronous matching and wait until results are ready
- FreeOldOperation();
- iOperation = iContactManager->FindL(aData, aFieldTypes, *this);
- if ( iApiMethodStatus != EFinished )
- {
- iApiMethodStatus = EExecuting;
- iASchedulerWait.Start();
- }
-
- User::LeaveIfError( iError );
- RemoveSimilarEmailAddressesL( aData, aLinkArray, aFieldTypes );
- }
-
-// ----------------------------------------------------------------------------
-// Remove contacts that do not have exactly the correct email address
-// e.g. if cbd@test.com address is requested, the for example a contact with address abcd@test.com will be removed
-// from the result.
-// This filtering is done only in the syncronous version of MatchDataL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::RemoveSimilarEmailAddressesL( const TDesC& aData, CVPbkContactLinkArray& aLinkArray, const MVPbkFieldTypeList& aFieldTypes )
- {
- TVPbkFieldVersitProperty prop;
- prop.SetName( EVPbkVersitNameEMAIL );
- // do extra checks for email addresses
-
- const MVPbkFieldType* foundType = NULL;
- // Continue only if at least one type is EVPbkVersitNameEMAIL
- TInt i;
- for ( i = 0 ; i < aFieldTypes.FieldTypeCount() ; i++ )
- {
- foundType = &(aFieldTypes.FieldTypeAt( i ));
- if ( foundType->VersitProperties().Count() > 0
- && foundType->VersitProperties()[0].Name() == prop.Name() )
- {
- break;
- }
- }
- if ( i == aFieldTypes.FieldTypeCount() )
- {
- // no email types
- return;
- }
-
- const MVPbkFieldTypeList& fieldTypeList = FieldTypes();
-
- TInt index = 0;
- TBool isExactMatch;
- while( index < aLinkArray.Count() )
- {
- MVPbkStoreContact* storeContact;
- GetStoreContactL( aLinkArray.At( index ), &storeContact );
- storeContact->PushL();
-
- isExactMatch = EFalse;
- for ( TInt i = 0; i < fieldTypeList.FieldTypeCount(); i++ )
- {
- // find the email property
- foundType = &(fieldTypeList.FieldTypeAt( i ));
- if ( foundType->VersitProperties().Count() > 0
- && foundType->VersitProperties()[0].Name() == prop.Name() )
- {
- TPtrC src = GetFieldDataTextL(*storeContact, *foundType );
- if ( aData.CompareF( src ) == 0 )
- {
- isExactMatch = ETrue;
- }
- }
- }
- if ( isExactMatch )
- {
- // go for the next contact
- index++;
- }
- else
- {
- // remove the contact, because the email address does not match the one queried.
- // the next one will take plce of this contact in the list (=do not increase index)
- aLinkArray.Delete( index );
- }
- CleanupStack::PopAndDestroy( storeContact );
- }
- }
-
-// ----------------------------------------------------------------------------
-// Asynchronous version
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::MatchDataL( const TDesC& aData,
- const MVPbkFieldTypeList& aFieldTypes,
- CVPbkContactLinkArray& aLinkArray,
- TRequestStatus& aStatus)
- {
- InitOperationL( EMatchData );
- iResultContactLinkArray = &aLinkArray;
-
- // Start asynchronous matching
- FreeOldOperation();
- iOperation = iContactManager->FindL(aData, aFieldTypes, *this);
- InitOperation( &aStatus );
- if ( iApiMethodStatus != EFinished )
- {
- iApiMethodStatus = EExecuting;
- }
- }
-// ----------------------------------------------------------------------------
-// MatchData for searchstrings
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::MatchDataL( const MDesC16Array& aSearchStrings,
- const MVPbkFieldTypeList& aFieldTypes,
- CVPbkContactLinkArray& aLinkArray,
- const TCallBack& aWordParserCallBack )
- {
- InitOperationL( EMatchData );
- iResultContactLinkArray = &aLinkArray;
-
- // Start asynchronous matching and wait here until results are ready
- FreeOldOperation();
- iOperation = iContactManager->FindL( aSearchStrings, aFieldTypes,
- *this, aWordParserCallBack );
-
- if ( iApiMethodStatus != EFinished )
- {
- iApiMethodStatus = EExecuting;
- iASchedulerWait.Start();
- }
- User::LeaveIfError( iError );
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::ContactNameFormatterL
-// ----------------------------------------------------------------------------
-EXPORT_C MPbk2ContactNameFormatter& CHgCtxContactMatcher::ContactNameFormatterL()
- {
- //first initialise, if not already initialised
- if ( !iSortOrderManager )
- {
- iSortOrderManager = CPbk2SortOrderManager::NewL( FieldTypes() );
- }
-
- if ( !iNameFormatter )
- {
- iNameFormatter = Pbk2ContactNameFormatterFactory::CreateL( FieldTypes(),
- *iSortOrderManager );
- }
- return *iNameFormatter;
- }
-
-
-// ---------------------------------------------------------------------------
-// HgContactMatcherPanics::Panic
-//
-// Panic function
-// ---------------------------------------------------------------------------
-void HgContactMatcherPanics::Panic( TPanic aPanic )
- {
- _LIT(KPanicCategory, "ContactMatcher");
- User::Panic( KPanicCategory, aPanic );
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::SplitAndMatchL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::SplitAndMatchL( const TDesC& aData,
- const MVPbkFieldTypeList& aFieldTypes,
- CVPbkContactLinkArray& aLinkArray)
- {
- CDesCArray* wordArray = SplitFindStringL( aData );
- CleanupStack::PushL( wordArray );
- TCallBack findParser( FindWordSplitterL );
- MatchDataL( *wordArray, aFieldTypes, aLinkArray, findParser );
- CleanupStack::PopAndDestroy( wordArray );
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::RegisterContactObserverL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::RegisterContactObserverL(
- MHgCtxContactObserver& aObserver )
- {
- if ( iContactObservers.Find( &aObserver ) == KErrNotFound )
- {
- iContactObservers.AppendL( &aObserver );
- }
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::UnregisterContactObserver
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::UnregisterContactObserver(
- MHgCtxContactObserver& aObserver )
- {
- TInt pos = iContactObservers.Find( &aObserver );
- if ( pos >= 0 )
- {
- iContactObservers.Remove( pos );
- }
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::LookupL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::LookupL( const TDesC& aData,
- CVPbkContactLinkArray& aLinkArray )
- {
- HGLOG_CONTEXT( LookupL, HGLOG_LOCAL );
- HGLOG1_IN( "'%S'", &aData );
-
- // Take part_A from "part_A <part_B>"
- // or part_A from "part_A".
- TPtrC input( aData );
- TInt ltPos = input.Locate( '<' );
- TInt gtPos = input.Locate( '>' );
- if ( ltPos != KErrNotFound && gtPos> ltPos )
- {
- input.Set( aData.Mid( 0, ltPos ) );
- }
- HBufC* trimmedInput = input.AllocLC();
- trimmedInput->Des().Trim();
-
- TInt oldCount = aLinkArray.Count();
- if ( IsPhoneNumberL( *trimmedInput ) )
- {
- TryNumberLookupL( *trimmedInput, aLinkArray );
- }
- else
- {
- TryTextLookupL( *trimmedInput, aLinkArray );
- }
-
- CleanupStack::PopAndDestroy( trimmedInput );
-
- if ( aLinkArray.Count() == oldCount && ltPos != KErrNotFound && gtPos > ltPos )
- {
- // lookup for part_A was not successful so try part_B
- trimmedInput = aData.Mid( ltPos + 1, gtPos - ltPos - 1 ).AllocLC();
- trimmedInput->Des().Trim();
- if ( IsPhoneNumberL( *trimmedInput ) )
- {
- TryNumberLookupL( *trimmedInput, aLinkArray );
- }
- else
- {
- TryTextLookupL( *trimmedInput, aLinkArray );
- }
- CleanupStack::PopAndDestroy( trimmedInput );
- }
-
- HGLOG1_OUT( "got %d results", aLinkArray.Count() - oldCount );
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::PreCreateNameFieldTypesL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::PreCreateNameFieldTypesL()
- {
- HGLOG_CONTEXT( PreCreateNameFieldTypesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- iNameFieldTypes = CVPbkFieldTypeRefsList::NewL();
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
-
- prop.SetName( EVPbkVersitNameFN );
- prop.SetSubField( EVPbkVersitSubFieldNone );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iNameFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try FN" );
- }
-
- prop.SetName( EVPbkVersitNameN );
- prop.SetSubField( EVPbkVersitSubFieldGivenName );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iNameFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try given name" );
- }
-
- prop.SetName( EVPbkVersitNameN );
- prop.SetSubField( EVPbkVersitSubFieldFamilyName );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iNameFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try family name" );
- }
-
- prop.SetName( EVPbkVersitNameORG );
- prop.SetSubField( EVPbkVersitSubFieldOrgName );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iNameFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try org name" );
- }
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::PreCreateEmailFieldTypesL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::PreCreateEmailFieldTypesL()
- {
- HGLOG_CONTEXT( PreCreateEmailFieldTypesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- iEmailFieldTypes = CVPbkFieldTypeRefsList::NewL();
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
-
- prop.SetName( EVPbkVersitNameEMAIL );
- prop.SetSubField( EVPbkVersitSubFieldNone );
- prop.Parameters().Reset();
- prop.Parameters().Add( EVPbkVersitParamINTERNET );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iEmailFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try general email" );
- }
-
- prop.SetName( EVPbkVersitNameEMAIL );
- prop.SetSubField( EVPbkVersitSubFieldNone );
- prop.Parameters().Reset();
- prop.Parameters().Add( EVPbkVersitParamINTERNET );
- prop.Parameters().Add( EVPbkVersitParamWORK );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iEmailFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try work email" );
- }
-
- prop.SetName( EVPbkVersitNameEMAIL );
- prop.SetSubField( EVPbkVersitSubFieldNone );
- prop.Parameters().Reset();
- prop.Parameters().Add( EVPbkVersitParamINTERNET );
- prop.Parameters().Add( EVPbkVersitParamHOME );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iEmailFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try home email" );
- }
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::PreCreateXspIdFieldTypesL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::PreCreateXspIdFieldTypesL()
- {
- HGLOG_CONTEXT( PreCreateXspIdFieldTypesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- iXspIdFieldTypes = CVPbkFieldTypeRefsList::NewL();
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
-
- prop.SetName( EVPbkVersitNameIMPP );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iXspIdFieldTypes->AppendL( *t );
- }
-
- HGLOG1_OUT( "found %d xsp id field types",
- iXspIdFieldTypes->FieldTypeCount() );
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::PreCreateNumberFieldTypesL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::PreCreateNumberFieldTypesL()
- {
- HGLOG_CONTEXT( PreCreateNumberFieldTypesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- iNumberFieldTypes = CVPbkFieldTypeRefsList::NewL();
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
-
- prop.SetName( EVPbkVersitNameTEL );
- prop.SetSubField( EVPbkVersitSubFieldNone );
- prop.Parameters().Reset();
- prop.Parameters().Add( EVPbkVersitParamCELL );
- prop.Parameters().Add( EVPbkVersitParamHOME );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iNumberFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try home mobile" );
- }
-
- prop.SetName( EVPbkVersitNameTEL );
- prop.SetSubField( EVPbkVersitSubFieldNone );
- prop.Parameters().Reset();
- prop.Parameters().Add( EVPbkVersitParamCELL );
- prop.Parameters().Add( EVPbkVersitParamWORK );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iNumberFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try work mobile" );
- }
-
- prop.SetName( EVPbkVersitNameTEL );
- prop.SetSubField( EVPbkVersitSubFieldNone );
- prop.Parameters().Reset();
- prop.Parameters().Add( EVPbkVersitParamCELL );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iNumberFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try general mobile" );
- }
-
- prop.SetName( EVPbkVersitNameTEL );
- prop.SetSubField( EVPbkVersitSubFieldNone );
- prop.Parameters().Reset();
- prop.Parameters().Add( EVPbkVersitParamHOME );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iNumberFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try home landline" );
- }
-
- prop.SetName( EVPbkVersitNameTEL );
- prop.SetSubField( EVPbkVersitSubFieldNone );
- prop.Parameters().Reset();
- prop.Parameters().Add( EVPbkVersitParamWORK );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iNumberFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try work landline" );
- }
-
- prop.SetName( EVPbkVersitNameTEL );
- prop.SetSubField( EVPbkVersitSubFieldNone );
- prop.Parameters().Reset();
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iNumberFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try general landline" );
- }
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::PreCreateAddressFieldTypesL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::PreCreateAddressFieldTypesL()
- {
- HGLOG_CONTEXT( PreCreateAddressFieldTypesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- iAddressFieldTypes = CVPbkFieldTypeRefsList::NewL();
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldCountry );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try general country" );
- }
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldRegion );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try general region" );
- }
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldLocality );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try general locality" );
- }
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldStreet );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try general street" );
- }
-
- HGLOG_OUT();
- }
-
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL()
- {
- HGLOG_CONTEXT( PreCreateWebAddressFieldTypesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- iWebAddressFieldTypes = CVPbkFieldTypeRefsList::NewL();
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
-
- prop.Parameters().Add( EVPbkVersitParamPREF );
- prop.SetName( EVPbkVersitNameURL );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iWebAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try prefered url" );
- }
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::PreCreateWebAddressHomeFieldTypesL()
- {
- HGLOG_CONTEXT( PreCreateWebAddressHomeFieldTypesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- iWebAddressHomeFieldTypes = CVPbkFieldTypeRefsList::NewL();
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
-
- prop.Parameters().Add( EVPbkVersitParamHOME );
- prop.SetName( EVPbkVersitNameURL );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iWebAddressHomeFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try home url" );
- }
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::PreCreateWebAddressWorkFieldTypesL()
- {
- HGLOG_CONTEXT( PreCreateWebAddressWorkFieldTypesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- iWebAddressWorkFieldTypes = CVPbkFieldTypeRefsList::NewL();
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
-
- prop.Parameters().Add( EVPbkVersitParamWORK );
- prop.SetName( EVPbkVersitNameURL );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iWebAddressWorkFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try work url" );
- }
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::PreCreateHomeAddressFieldTypesL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::PreCreateHomeAddressFieldTypesL()
- {
- HGLOG_CONTEXT( PreCreateHomeAddressFieldTypesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- iHomeAddressFieldTypes = CVPbkFieldTypeRefsList::NewL();
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
- prop.Parameters().Add( EVPbkVersitParamHOME );
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldCountry );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iHomeAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try home country" );
- }
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldRegion );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iHomeAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try home region" );
- }
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldLocality );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iHomeAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try home locality" );
- }
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldStreet );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iHomeAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try home street" );
- }
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::PreCreateWorkAddressFieldTypesL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::PreCreateWorkAddressFieldTypesL()
- {
- HGLOG_CONTEXT( PreCreateWorkAddressFieldTypesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- iWorkAddressFieldTypes = CVPbkFieldTypeRefsList::NewL();
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
- prop.Parameters().Add( EVPbkVersitParamWORK );
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldCountry );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iWorkAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try work country" );
- }
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldRegion );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iWorkAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try work region" );
- }
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldLocality );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iWorkAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try work locality" );
- }
-
- prop.SetName( EVPbkVersitNameADR );
- prop.SetSubField( EVPbkVersitSubFieldStreet );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- iWorkAddressFieldTypes->AppendL( *t );
- HGLOG0( HGLOG_INFO, "will try work street" );
- }
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::TryTextLookupL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::TryTextLookupL( const TDesC& aName,
- CVPbkContactLinkArray& aLinkArray )
- {
- HGLOG_CONTEXT( TryTextLookupL, HGLOG_LOCAL );
- HGLOG_IN();
-
- CVPbkFieldTypeRefsList* fieldTypes = CVPbkFieldTypeRefsList::NewL();
- CleanupStack::PushL( fieldTypes );
-
- // try name and email and ovi id fields
- if ( !iNameFieldTypes )
- {
- PreCreateNameFieldTypesL();
- }
- for ( TInt i = 0, ie = iNameFieldTypes->FieldTypeCount(); i != ie; ++i )
- {
- fieldTypes->AppendL( iNameFieldTypes->FieldTypeAt( i ) );
- }
- if ( !iEmailFieldTypes )
- {
- PreCreateEmailFieldTypesL();
- }
- for ( TInt i = 0, ie = iEmailFieldTypes->FieldTypeCount(); i != ie; ++i )
- {
- fieldTypes->AppendL( iEmailFieldTypes->FieldTypeAt( i ) );
- }
- if ( !iXspIdFieldTypes )
- {
- PreCreateXspIdFieldTypesL();
- }
- for ( TInt i = 0, ie = iXspIdFieldTypes->FieldTypeCount(); i != ie; ++i )
- {
- fieldTypes->AppendL( iXspIdFieldTypes->FieldTypeAt( i ) );
- }
-
- SplitAndMatchL( aName, *fieldTypes, aLinkArray );
-
- CleanupStack::PopAndDestroy( fieldTypes );
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::TryNumberLookupL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::TryNumberLookupL( const TDesC& aNumber,
- CVPbkContactLinkArray& aLinkArray )
- {
- HGLOG_CONTEXT( TryNumberLookupL, HGLOG_LOCAL );
- HGLOG_IN();
-
- MatchPhoneNumberL( aNumber,
- KNumberMatchLenFromRight,
- CVPbkPhoneNumberMatchStrategy::EVPbkMatchFlagsNone,
- aLinkArray );
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetTextFieldsL
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::GetTextFieldsL(
- const CVPbkFieldTypeRefsList& aList,
- const MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray )
- {
- HGLOG_CONTEXT( GetTextFieldsL, HGLOG_LOCAL );
- HGLOG_IN();
-
- for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i )
- {
- const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) );
- const MVPbkFieldType* type = field.BestMatchingFieldType();
- if ( type && aList.ContainsSame( *type ) )
- {
- const MVPbkContactFieldData& fdata( field.FieldData() );
- if ( fdata.DataType() == EVPbkFieldStorageTypeText )
- {
- const MVPbkContactFieldTextData& fdata2 =
- MVPbkContactFieldTextData::Cast( fdata );
- const TDesC& text( fdata2.Text() );
- aArray.AppendL( text );
- HGLOG1( HGLOG_INFO, "found: '%S'", &text );
- }
- }
- }
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetNumbersL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::GetNumbersL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray )
- {
- HGLOG_CONTEXT( GetNumbersL, HGLOG_LOCAL );
- HGLOG_IN();
-
- if ( !iNumberFieldTypes )
- {
- PreCreateNumberFieldTypesL();
- }
- GetTextFieldsL( *iNumberFieldTypes, aFieldCollection, aArray );
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetEmailAddressesL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::GetEmailAddressesL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray )
- {
- HGLOG_CONTEXT( GetEmailAddressesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- if ( !iEmailFieldTypes )
- {
- PreCreateEmailFieldTypesL();
- }
- GetTextFieldsL( *iEmailFieldTypes, aFieldCollection, aArray );
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetAddressesL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::GetAddressesL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray )
- {
- HGLOG_CONTEXT( GetAddressesL, HGLOG_LOCAL );
- HGLOG_IN();
-
- CDesC16ArrayFlat* arr = new ( ELeave ) CDesC16ArrayFlat( KArrayGranularity );
- CleanupStack::PushL( arr );
-
- if ( !iAddressFieldTypes )
- {
- PreCreateAddressFieldTypesL();
- }
- GetTextFieldsL( *iAddressFieldTypes, aFieldCollection, *arr );
- if ( arr->Count() )
- {
- HBufC* combined = CombineStringsLC( *arr );
- aArray.AppendL( *combined );
- HGLOG1( HGLOG_INFO, "added '%S'", combined );
- CleanupStack::PopAndDestroy( combined );
- }
-
- arr->Reset();
- if ( !iHomeAddressFieldTypes )
- {
- PreCreateHomeAddressFieldTypesL();
- }
- GetTextFieldsL( *iHomeAddressFieldTypes, aFieldCollection, *arr );
- if ( arr->Count() )
- {
- HBufC* combined = CombineStringsLC( *arr );
- aArray.AppendL( *combined );
- HGLOG1( HGLOG_INFO, "added '%S'", combined );
- CleanupStack::PopAndDestroy( combined );
- }
-
- arr->Reset();
- if ( !iWorkAddressFieldTypes )
- {
- PreCreateWorkAddressFieldTypesL();
- }
- GetTextFieldsL( *iWorkAddressFieldTypes, aFieldCollection, *arr );
- if ( arr->Count() )
- {
- HBufC* combined = CombineStringsLC( *arr );
- aArray.AppendL( *combined );
- HGLOG1( HGLOG_INFO, "added '%S'", combined );
- CleanupStack::PopAndDestroy( combined );
- }
-
- CleanupStack::PopAndDestroy( arr );
- HGLOG_OUT();
- }
-
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetWebAddressesL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::GetWebAddressesL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray,
- TWebAddressesType aType )
- {
- HGLOG_CONTEXT( GetWebAddressesL, HGLOG_LOCAL );
- HGLOG_IN();
- CVPbkFieldTypeRefsList* addressFieldTypes( NULL );
-
- switch ( aType )
- {
- case EWebAddresses:
- {
- if ( !iWebAddressFieldTypes )
- {
- PreCreateWebAddressFieldTypesL();
- }
- addressFieldTypes = iWebAddressFieldTypes;
- }
- break;
-
- case EWebAddressesHome:
- {
- if ( !iWebAddressHomeFieldTypes )
- {
- PreCreateWebAddressHomeFieldTypesL();
- }
- addressFieldTypes = iWebAddressHomeFieldTypes;
- }
- break;
-
- case EWebAddressesWork:
- {
- if ( !iWebAddressWorkFieldTypes )
- {
- PreCreateWebAddressWorkFieldTypesL();
- }
- addressFieldTypes = iWebAddressWorkFieldTypes;
- }
- break;
-
- default:
- break;
- }
-
- if( addressFieldTypes )
- {
- GetTextFieldsL( *addressFieldTypes, aFieldCollection, aArray );
- }
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetThumbnailL
-// ----------------------------------------------------------------------------
-EXPORT_C CFbsBitmap* CHgCtxContactMatcher::GetThumbnailL(
- MVPbkStoreContactFieldCollection& aFieldCollection )
- {
- HGLOG_CONTEXT( GetThumbnailL, HGLOG_LOCAL );
- HGLOG_IN();
-
- CFbsBitmap* result = 0;
- TVPbkFieldVersitProperty prop;
- prop.SetName( EVPbkVersitNamePHOTO );
- const MVPbkFieldType* t = FieldTypes().FindMatch( prop, 0 );
- if ( t )
- {
- HGLOG0( HGLOG_INFO, "photo field type found" );
- for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i )
- {
- const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) );
- const MVPbkFieldType* type = field.BestMatchingFieldType();
- if ( type && type->IsSame( *t ) )
- {
- const MVPbkContactFieldData& fdata( field.FieldData() );
- if ( fdata.DataType() == EVPbkFieldStorageTypeBinary )
- {
- HGLOG0( HGLOG_INFO, "found thumbnail" );
- const MVPbkContactFieldBinaryData& fdata2 =
- MVPbkContactFieldBinaryData::Cast( fdata );
- TPtrC8 data( fdata2.BinaryData() );
- CImageDecoder* decoder = 0;
- // DataNewL does not seem to work properly with
- // EOptionAlwaysThread, it will hang in WaitForRequest
- // for ever, at least in the panel app.
- // So write the image to a temporary file (duhhh...)
- // and use FileNewL.
- RFile f;
- TFileName tempFileName;
- iFsSession->CreatePrivatePath( EDriveC );
- iFsSession->PrivatePath( tempFileName );
- _LIT( KDriveC, "C:" );
- _LIT( KTempName, "hgctxthumb" );
- tempFileName.Insert( 0, KDriveC );
- tempFileName.Append( KTempName );
- HGLOG1( HGLOG_INFO, "tempfn='%S'", &tempFileName );
- User::LeaveIfError( f.Replace( *iFsSession, tempFileName,
- EFileWrite ) );
- f.Write( data, data.Length() );
- f.Close();
- TRAPD( err, decoder = CImageDecoder::FileNewL( *iFsSession,
- tempFileName,
- CImageDecoder::EOptionAlwaysThread ) );
- HGLOG1( HGLOG_INFO, "decoder NewL result: %d", err );
- if ( err == KErrNone )
- {
- CleanupStack::PushL( decoder );
- result = new ( ELeave ) CFbsBitmap;
- CleanupStack::PushL( result );
- TSize sz( decoder->FrameInfo().iOverallSizeInPixels );
- TDisplayMode mode( decoder->FrameInfo().iFrameDisplayMode );
- HGLOG3( HGLOG_INFO, "size=%dx%d, mode=%d", sz.iWidth,
- sz.iHeight, mode );
- User::LeaveIfError( result->Create( sz, mode ) );
-
- TRequestStatus status;
- HGLOG0( HGLOG_INFO, "starting to convert" );
- decoder->Convert( &status, *result );
- User::WaitForRequest( status );
- HGLOG1( HGLOG_INFO, "decoder Convert result: %d",
- status.Int() );
- CleanupStack::Pop( result );
- CleanupStack::PopAndDestroy( decoder );
-
- if ( status.Int() != KErrNone )
- {
- delete result;
- result = 0;
- }
- else
- {
- // stop and return the bitmap
- break;
- }
- }
- }
- }
- }
- }
-
- HGLOG_OUT();
- return result;
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::IsPhoneNumberL
-// ----------------------------------------------------------------------------
-EXPORT_C TBool CHgCtxContactMatcher::IsPhoneNumberL( const TDesC& aData )
- {
- TBool result = EFalse;
- CFindItemEngine::SFoundItem item;
- CFindItemEngine* search = CFindItemEngine::NewL( aData,
- CFindItemEngine::EFindItemSearchPhoneNumberBin );
- if ( search->ItemCount() )
- {
- search->Item( item );
- result = item.iStartPos == 0;
- }
- delete search;
- return result;
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::IsEmailAddressL
-// ----------------------------------------------------------------------------
-EXPORT_C TBool CHgCtxContactMatcher::IsEmailAddressL( const TDesC& aData )
- {
- TBool result = EFalse;
- CFindItemEngine::SFoundItem item;
- CFindItemEngine* search = CFindItemEngine::NewL( aData,
- CFindItemEngine::EFindItemSearchMailAddressBin );
- if ( search->ItemCount() )
- {
- search->Item( item );
- result = item.iStartPos == 0;
- }
- delete search;
- return result;
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetNamesForFindL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::GetNamesForFindL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray )
- {
- CVPbkFieldTypeRefsList* nameTypes = CVPbkFieldTypeRefsList::NewL();
- CleanupStack::PushL( nameTypes );
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
-
- prop.SetName( EVPbkVersitNameN );
- prop.SetSubField( EVPbkVersitSubFieldGivenName );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- nameTypes->AppendL( *t );
- }
-
- prop.SetName( EVPbkVersitNameN );
- prop.SetSubField( EVPbkVersitSubFieldFamilyName );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- nameTypes->AppendL( *t );
- }
-
- for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i )
- {
- const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) );
- t = field.MatchFieldType( 0 );
- if ( t && nameTypes->ContainsSame( *t ) )
- {
- const MVPbkContactFieldData& fdata( field.FieldData() );
- if ( fdata.DataType() == EVPbkFieldStorageTypeText )
- {
- const MVPbkContactFieldTextData& fdata2 =
- MVPbkContactFieldTextData::Cast( fdata );
- aArray.AppendL( fdata2.Text() );
- }
- }
- }
-
- CleanupStack::PopAndDestroy( nameTypes );
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetNamesForFindL
-// ----------------------------------------------------------------------------
-EXPORT_C HBufC* CHgCtxContactMatcher::GetNamesForFindL(
- MVPbkStoreContactFieldCollection& aFieldCollection )
- {
- CDesC16ArrayFlat* arr = new ( ELeave ) CDesC16ArrayFlat( KArrayGranularity );
- CleanupStack::PushL( arr );
- GetNamesForFindL( aFieldCollection, *arr );
- HBufC* result = CombineStringsLC( *arr );
- CleanupStack::Pop( result );
- CleanupStack::PopAndDestroy( arr );
- return result;
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::SplitFindStringL
-// ----------------------------------------------------------------------------
-EXPORT_C CDesCArray* CHgCtxContactMatcher::SplitFindStringL(const TDesC& aFindString)
- {
- CDesCArray* wordArray = new ( ELeave ) CDesCArrayFlat( KArrayGranularity );
- CleanupStack::PushL( wordArray );
-
- TVPbkWordParserCallbackParam parser( &aFindString, wordArray );
- FindWordSplitterL( &parser );
-
- CleanupStack::Pop(); // wordArray
- return parser.iWordArray;
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::SplitMsgContactL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::SplitMsgContactL( const TDesC& aString,
- CDesCArray& aArray )
- {
- TInt pos = aString.Locate( '<' );
- if ( pos >= 0 )
- {
- // skip spaces before '<'
- TInt endPos = pos - 1;
- while ( endPos > 0 && TChar( aString[endPos] ).IsSpace() )
- {
- --endPos;
- }
- // take the text before '<'
- aArray.AppendL( aString.Left( endPos + 1 ) );
- // take the text between '<' and '>'
- TInt closePos = aString.Locate( '>' );
- if ( closePos > pos )
- {
- aArray.AppendL( aString.Mid( pos + 1, closePos - pos - 1 ) );
- }
- }
- else
- {
- aArray.AppendL( aString );
- }
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetCustomFieldL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::GetCustomFieldL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray& aArray,
- TVPbkFieldTypeName aVersitName,
- TVPbkFieldTypeParameter aVersitParam )
- {
- HGLOG_CONTEXT( GetCustomFieldL, HGLOG_LOCAL );
- HGLOG_IN();
-
- CVPbkFieldTypeRefsList* typeList = GetCustomFieldTypeLC(
- aVersitName, aVersitParam );
-
- GetTextFieldsL( *typeList, aFieldCollection, aArray );
-
- CleanupStack::PopAndDestroy( typeList );
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetCustomFieldTypeLC
-// ----------------------------------------------------------------------------
-EXPORT_C CVPbkFieldTypeRefsList* CHgCtxContactMatcher::GetCustomFieldTypeLC(
- TVPbkFieldTypeName aVersitName,
- TVPbkFieldTypeParameter aVersitParam )
- {
- HGLOG_CONTEXT( GetCustomFieldTypeLC, HGLOG_LOCAL );
- HGLOG_IN();
-
- CVPbkFieldTypeRefsList* typeList = CVPbkFieldTypeRefsList::NewL();
- CleanupStack::PushL( typeList );
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
-
- prop.SetName( aVersitName );
- prop.Parameters().Add( aVersitParam );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- typeList->AppendL( *t );
- HGLOG0( HGLOG_INFO, "field found" );
- }
-
- HGLOG_OUT();
- return typeList;
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::GetImppFieldL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::GetImppFieldL(
- MVPbkStoreContactFieldCollection& aFieldCollection,
- CDesCArray* aSchemeOnlyArray,
- CDesCArray* aUriOnlyArray,
- CDesCArray* aFullArray )
- {
- HGLOG_CONTEXT( GetImppFieldL, HGLOG_LOCAL );
- HGLOG_IN();
-
- // this function will not build on TUBE
- CVPbkFieldTypeRefsList* typeList = CVPbkFieldTypeRefsList::NewL();
- CleanupStack::PushL( typeList );
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* t;
- prop.SetName( EVPbkVersitNameIMPP );
- t = types.FindMatch( prop, 0 );
- if ( t )
- {
- typeList->AppendL( *t );
- HGLOG0( HGLOG_INFO, "type found" );
- }
- for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i )
- {
- const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) );
- const MVPbkFieldType* type = field.BestMatchingFieldType();
- if ( type && typeList->ContainsSame( *type ) )
- {
- const MVPbkContactFieldData& fdata( field.FieldData() );
- HGLOG1( HGLOG_INFO, "field found %d", fdata.DataType() );
- if ( fdata.DataType() == EVPbkFieldStorageTypeUri )
- {
- const MVPbkContactFieldUriData& fdata2 =
- MVPbkContactFieldUriData::Cast( fdata );
- const TDesC& schemeOnly( fdata2.Scheme() );
- const TDesC& uriOnly( fdata2.Text() );
- const TDesC& fullText( fdata2.Uri() );
- HGLOG3( HGLOG_INFO, "'%S' + '%S' = '%S'",
- &schemeOnly, &uriOnly, &fullText );
- if ( aSchemeOnlyArray )
- {
- aSchemeOnlyArray->AppendL( schemeOnly );
- }
- if ( aUriOnlyArray )
- {
- aUriOnlyArray->AppendL( uriOnly );
- }
- if ( aFullArray )
- {
- aFullArray->AppendL( fullText );
- }
- }
- }
- }
- CleanupStack::PopAndDestroy( typeList );
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::FindContactWithBirthdayL
-// ----------------------------------------------------------------------------
-EXPORT_C void CHgCtxContactMatcher::FindContactWithBirthdayL(
- const TTime& aDate,
- CVPbkContactLinkArray& aLinkArray )
- {
- HGLOG_CONTEXT( FindContactWithBirthdayL, HGLOG_LOCAL );
- HGLOG1_IN( "%Ld", aDate.Int64() );
-
- // extract month and day
- TDateTime dt = aDate.DateTime();
- TInt month = dt.Month();
- TInt day = dt.Day();
- HGLOG2( HGLOG_INFO, "wanted month = %d day = %d", month, day );
-
- CVPbkFieldTypeRefsList* emptyList = CVPbkFieldTypeRefsList::NewL();
- CleanupStack::PushL( emptyList );
-
- // create view with all contacts
- CVPbkContactViewDefinition* def = CVPbkContactViewDefinition::NewLC();
- def->SetType( EVPbkContactsView );
- def->SetUriL( VPbkContactStoreUris::DefaultCntDbUri() );
- MVPbkContactViewBase* view = iContactManager->CreateContactViewLC(
- *this, *def, *emptyList );
-
- HGLOG0( HGLOG_INFO, "starting wait" );
- iASchedulerWait.Start();
- HGLOG0( HGLOG_INFO, "after wait" );
-
- // view is ready
- TInt ctCount = view->ContactCountL();
- HGLOG1( HGLOG_INFO, "contact count: %d", ctCount );
-
- // find the birthday field type
- const MVPbkFieldTypeList& types( FieldTypes() );
- TVPbkFieldVersitProperty prop;
- const MVPbkFieldType* bdayFt;
- prop.SetName( EVPbkVersitNameBDAY );
- prop.SetSubField( EVPbkVersitSubFieldNone );
- bdayFt = types.FindMatch( prop, 0 );
-
- if ( bdayFt && ctCount )
- {
- HGLOG0( HGLOG_INFO, "found bday field type" );
- TTime nullTime( KNullTime );
- // go through all contacts and check birthday field values
- for ( TInt i = 0; i < ctCount; ++i )
- {
- MVPbkContactLink* link( view->CreateLinkLC( i ) );
- MVPbkStoreContact* contact = 0;
- GetStoreContactL( *link, &contact );
- if ( contact )
- {
- HGLOG1( HGLOG_INFO, "got contact, idx %d", i );
- contact->PushL();
- TTime bday;
- bday = GetFieldDataDateTimeL( *contact, *bdayFt );
- if ( bday != nullTime )
- {
- HGLOG1( HGLOG_INFO, "found bday %Ld", bday.Int64() );
- dt = bday.DateTime();
- TInt thisMonth = dt.Month();
- TInt thisDay = dt.Day();
- HGLOG2( HGLOG_INFO, "for this contact month = %d day = %d",
- thisMonth, thisDay );
- if ( thisMonth == month && thisDay == day )
- {
- HGLOG0( HGLOG_INFO, "match" );
- aLinkArray.AppendL( link );
- link = 0;
- }
- }
- CleanupStack::PopAndDestroy(); // contact
- }
- CleanupStack::Pop(); // if matched then no ownership and link is NULL by now
- delete link;
- }
- }
-
- CleanupStack::PopAndDestroy(); // view
- CleanupStack::PopAndDestroy( def );
- CleanupStack::PopAndDestroy( emptyList );
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::ContactViewReady
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::ContactViewReady(
- MVPbkContactViewBase& aView )
- {
- HGLOG_CONTEXT( ContactViewReady, HGLOG_LOCAL );
- HGLOG_IN();
-
- if ( iASchedulerWait.IsStarted() )
- {
- iASchedulerWait.AsyncStop();
- }
-
- aView.RemoveObserver( *this );
-
- HGLOG_OUT();
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::ContactViewUnavailable
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::ContactViewUnavailable(
- MVPbkContactViewBase& /*aView*/ )
- {
- // means that view is unavailable for now
- // but ContactViewReady will be called at some point
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::ContactAddedToView
-// ----------------------------------------------------------------------------
-void CHgCtxContactMatcher::ContactAddedToView(
- MVPbkContactViewBase& /*aView*/,
- TInt /*aIndex*/,
- const MVPbkContactLink& /*aContactLink*/ )
- {
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::ContactRemovedFromView
-// ----------------------------------------------------------------------------
- void CHgCtxContactMatcher::ContactRemovedFromView(
- MVPbkContactViewBase& /*aView*/,
- TInt /*aIndex*/,
- const MVPbkContactLink& /*aContactLink*/ )
- {
- }
-
-// ----------------------------------------------------------------------------
-// CHgCtxContactMatcher::ContactViewError
-// ----------------------------------------------------------------------------
- void CHgCtxContactMatcher::ContactViewError(
- MVPbkContactViewBase& aView,
- TInt aError,
- TBool /*aErrorNotified*/ )
- {
- HGLOG_CONTEXT( ContactViewError, HGLOG_LOCAL );
- HGLOG1_IN( "aError = %d", aError );
-
- if ( iASchedulerWait.IsStarted() )
- {
- iASchedulerWait.AsyncStop();
- }
-
- aView.RemoveObserver( *this );
-
- HGLOG_OUT();
- }
-
-
-// End of File
--- a/homescreensrv_plat/context_utility_api/tsrc/src/t_ui_context_utility_api.cpp Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-/*
-* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: T_ui_context_utility_api class member functions
-*
-*/
-
-
-
-// INCLUDE FILES
-#include <Stiftestinterface.h>
-#include <aknappui.h>
-#include <cfclient.h>
-#include "hgcontextutilityimpl.h"
-#include "hgcontextutility.h"
-#include "hgcontexttypes.h"
-#include "hgtestbasemacros.h"
-#include "T_ui_context_utility_api.h"
-#include "wait.h"
-#include "hgtestbasemacros.h"
-#include <cvpbkcontactmanager.h>
-#include <mvpbkcontactstore.h>
-#include <mvpbkcontactfieldtextdata.h>
-#include <mvpbkstorecontact.h>
-#include <MVPbkContactObserver.h>
-#include <MVPbkBatchOperationObserver.h>
-#include <CVPbkContactLinkArray.h>
-#include <MVPbkContactOperationBase.h>
-#include <VPbkEng.rsg>
-#include <mdesession.h>
-#include <e32math.h>
-#include <aknappui.h>
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CT_ui_context_utility_api::CT_ui_context_utility_api
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CT_ui_context_utility_api::CT_ui_context_utility_api()
- {
- iTestDllName = _L("CT_ui_context_utility_api").AllocL();
- }
-
-// -----------------------------------------------------------------------------
-// CT_ui_context_utility_api::ConstructL
-// Symbian 2nd phase constructor can leave.
-//
-// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
-// with static buffer size parameter (aStaticBufferSize). Otherwise Logger
-// allocates memory from heap and therefore causes error situations with OOM
-// testing. For more information about STIF Logger construction, see STIF Users
-// Guide.
-// -----------------------------------------------------------------------------
-//
-void CT_ui_context_utility_api::ConstructL()
- {
- CHgTestBase::BaseConstructL( KT_ui_context_utility_apiLogPath,
- KT_ui_context_utility_apiLogFile );
- }
-
-// -----------------------------------------------------------------------------
-// CT_ui_context_utility_api::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CT_ui_context_utility_api* CT_ui_context_utility_api::NewL()
- {
- CT_ui_context_utility_api* self = new (ELeave) CT_ui_context_utility_api;
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
- return self;
- }
-
-// Destructor
-CT_ui_context_utility_api::~CT_ui_context_utility_api()
- {
-
- }
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-
-// -----------------------------------------------------------------------------
-// LibEntryL is a polymorphic Dll entry point
-// Returns: CTestModuleBase*: Pointer to Test Module object
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CTestModuleBase* LibEntryL()
- {
- return CT_ui_context_utility_api::NewL();
- }
-
-// -----------------------------------------------------------------------------
-// SetRequirements handles test module parameters(implements evolution
-// version 1 for test module's heap and stack sizes configuring).
-// Returns: TInt: Symbian error code.
-// -----------------------------------------------------------------------------
-//
-EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/,
- TUint32& /*aParameterValid*/ )
- {
- return KErrNone;
- }
-
-//// -----------------------------------------------------------------------------
-//// CT_ui_context_utility_api::RunTestL
-//// Method responsible for enumerating and running test cases (and also setup and teardown activities before
-//// and after each test case).
-//// -----------------------------------------------------------------------------
-TInt CT_ui_context_utility_api::RunTestL(
- CT_ui_context_utility_api::TCallReason aRunReason,
- TInt aTestToRun,
- RPointerArray<TTestCaseInfo>& aTestCases,
- TTestResult& aResult )
- {
- TInt _test_case_no = -1;
- //test cases, setup and teardown include
-
-
- if( aRunReason == CHgTestBase::ERunTestCase )
- {
- LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_SETUP, aTestCases, aResult);
- LoadTestCasesL(_test_case_no, aRunReason, aTestToRun, aTestCases, aResult);
- LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_TEARDOWN, aTestCases, aResult);
- CreateEnvL();
- _test_case_no = -1;
- TRAPD(
- errCode,
- LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_SETUP, aTestCases, aResult);
- LoadTestCasesL(_test_case_no, aRunReason, aTestToRun, aTestCases, aResult);
- LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_TEARDOWN, aTestCases, aResult);
- )
- DestroyEnv();
- User::LeaveIfError( errCode );
- }
- else
- {
- LoadTestCasesL(_test_case_no, aRunReason, aTestToRun, aTestCases, aResult);
- }
-
- return _test_case_no;
- }
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-void CT_ui_context_utility_api::CreateEnvL()
- {
- CActiveScheduler::Install ( NULL );
- ENV_cleanup = CTrapCleanup::New();
- TInt ENV_err = KErrNone;
- ENV_env = new CEikonEnv;
- if ( ENV_env )
- {
- TRAP( ENV_err, ENV_env->ConstructL() );
- if ( ENV_err )
- {
- return;
- }
- ENV_aknAppUI = new CAknAppUi;
- if (ENV_aknAppUI)
- {
- TRAP( ENV_err, ENV_aknAppUI->BaseConstructL( CEikAppUi::ENoAppResourceFile ) ); \
- if ( ENV_err )
- {
- return;
- }
- }
- }
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-void CT_ui_context_utility_api::DestroyEnv()
- {
- TInt KWait( 500000 );
- CActiveSchedulerWait* wait = new (ELeave) CActiveSchedulerWait();
- CPeriodic* periodic = CPeriodic::NewL( CActive::EPriorityIdle );
- periodic->Start(KWait, KWait, TCallBack( CHgTestBase::CallStop, wait ) );
- wait->Start();
- delete periodic;
- delete wait;
-
- if ( ENV_aknAppUI )
- {
- ENV_aknAppUI->PrepareToExit();
- }
- if ( ENV_env )
- {
- ENV_env->DestroyEnvironment();
- }
- if( ENV_cleanup )
- {
- delete ENV_cleanup;
- }
- CActiveScheduler::Install ( iActiveScheduler );
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-TInt CT_ui_context_utility_api::LoadTestCasesL(
- TInt& _test_case_no,
- CT_ui_context_utility_api::TCallReason aRunReason,
- TInt aTestToRun,
- RPointerArray<TTestCaseInfo>& aTestCases,
- TTestResult& aResult)
- {
-#define TEST_CASES
- #include "..\src\T_ui_context_utility_api_cases.cpp"
-#undef TEST_CASES
- return KErrNone;
- }
-// End of File
--- a/homescreensrv_plat/context_utility_api/tsrc/src/t_ui_context_utility_api_cases.cpp Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1025 +0,0 @@
-/*
-* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: T_ui_context_utility_api test module.
-*
-*/
-
-
-// DEFINITION OF GLOBAL VARIABLES
-#ifdef TEST_VAR_DECLARATIONS
-// here You can define global objects used all over code
-CHgContextUtility* iContextUtility;
-#endif
-
-// testing code starts here
-#ifdef TEST_CASES
-
-#ifndef KNAME
-#define KNAME
-_LIT(KName,"James Bond");
-#endif
-
-// STIF_SETUP defines activities needed before every test case.
-STIF_SETUP
- {
- iContextUtility = CHgContextUtility::NewL();
- return KErrNone;
- }
-
-// STIF_TEARDOWN defines activities needed after every test case
-STIF_TEARDOWN
- {
- delete iContextUtility;
- return KErrNone;
- }
-
-// a Canary test to verify test environment.
-STIF_TESTDEFINE( CanaryTest )
-{
-
-}
-
-STIF_TESTDEFINE( T_MemoryOnlyTest )
-{
- /*private implementation IsForeground
- cant be covered by tests because covered by previous condition*/
- iContextUtility->AllowPublishFromBackground( ETrue );
- iContextUtility->AllowPublishFromBackground( EFalse );
- return KErrNone;
-}
-//Test code for testing PublishContextL function call
-STIF_TESTDEFINE( T_PublishContextL )
- {
- // publish the Hg.Contact context to CF
- iContextUtility->PublishContextL( KHgCFTypeContact, KName );
- //private implementation with dalay cant be covered by test because its never called
- return KErrNone;
- }
-
-//Test code for testing T_PublishContextDelayedL function call
-STIF_TESTDEFINE( T_PublishContextDelayedL )
- {
- // publish the Hg.Contact context to CF
- iContextUtility->PublishContextDelayedL( KHgCFTypeContact, KName ,50000);
- iContextUtility->PublishContextDelayedL( KHgCFTypeContact, KName ,0);
- return KErrNone;
- }
-
-//Test code for testing GetContextL function call
-STIF_TESTDEFINE( T_GetContextL )
- {
- HBufC* icontext = iContextUtility->GetContextL( _L( "NonExistContextType" ));
-
- STIF_ASSERT_TRUE_DESC( icontext == NULL, _L( "Item found" ) );
- delete icontext;
-
- // publish the Hg.Contact context to CF
- iContextUtility->PublishContextL( KHgCFTypeContact, KName );
-
- icontext = iContextUtility->GetContextL( KHgCFTypeContact);
-
- STIF_ASSERT_TRUE_DESC( icontext != NULL, _L( "Context is not found" ) );
- delete icontext;
-
- return KErrNone;
- }
-
-//Test code for testing GetContextL function call
-STIF_TESTDEFINE( T_GetContextLWithContextSource )
- {
- HBufC* icontext = iContextUtility->GetContextL(KHgCFSource,_L( "NonExistContextType" ));
-
- STIF_ASSERT_TRUE_DESC( icontext == NULL, _L( "Item found" ) );
- delete icontext;
-
- // publish the Hg.Contact context to CF
- iContextUtility->PublishContextL( KHgCFTypeContact, KName );
-
- icontext = iContextUtility->GetContextL(KHgCFSource,KHgCFTypeContact);
-
- STIF_ASSERT_TRUE_DESC( icontext != NULL, _L( "Context is not found" ) );
- delete icontext;
-
- return KErrNone;
- }
-
-//Test code for testing spliting combined context
-STIF_TESTDEFINE( T_SplitCombinedStringL )
- {
- HBufC* val( NULL );
- _LIT( KDummyContext, "CtxUtilApiTest" );
- const TInt KArrayGranularity( 3 );
- CDesCArray* sourceArray = new( ELeave ) CDesC16ArrayFlat(KArrayGranularity);
- CDesCArray* resultArray = new( ELeave ) CDesC16ArrayFlat(KArrayGranularity);
- CleanupStack::PushL( sourceArray );
- CleanupStack::PushL( resultArray );
-
- iContextUtility->PublishContextL( KDummyContext, *sourceArray );
- //Can't be verified if current context is NULL, because could be already published
-
- sourceArray->AppendL( _L( "https://somedomain.com?param=parmaValue" ) );
- iContextUtility->PublishContextL( KDummyContext, *sourceArray );//there only one value. nothing to combine but returned value should be equal
- val = iContextUtility->GetContextL( KDummyContext );
- CleanupStack::PushL( val );
- STIF_ASSERT_TRUE( val && val->Length() );
- CHgContextUtility::SplitCombinedStringL( *val, *resultArray );
- CleanupStack::PopAndDestroy(val);
- STIF_ASSERT_TRUE( resultArray->Count() == sourceArray->Count() );
- for( TInt iter( 0 ); iter < sourceArray->Count(); ++iter )
- {
- STIF_ASSERT_TRUE( 0 == (*sourceArray)[iter].Compare((*resultArray)[iter]) );
- }
- CleanupStack::PopAndDestroy(resultArray);
-
- resultArray = new( ELeave ) CDesC16ArrayFlat(KArrayGranularity);
- CleanupStack::PushL( resultArray );
- sourceArray->AppendL( _L( "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" ));
- sourceArray->AppendL( _L( "!@#$%^&&*()/\<>[]|~,." ) );
-
- iContextUtility->PublishContextL( KDummyContext, *sourceArray );
-
- val = iContextUtility->GetContextL( KDummyContext );
- STIF_ASSERT_TRUE( val && val->Length() );
- CleanupStack::PushL(val);
- CHgContextUtility::SplitCombinedStringL( *val, *resultArray );
- CleanupStack::PopAndDestroy( val );
- STIF_ASSERT_TRUE( resultArray->Count() == sourceArray->Count() );
- for( TInt iter( 0 ); iter < sourceArray->Count(); ++iter )
- {
- STIF_ASSERT_TRUE( 0 == (*sourceArray)[iter].Compare((*resultArray)[iter]) );
- }
- CleanupStack::PopAndDestroy(resultArray);
- CleanupStack::PopAndDestroy(sourceArray);
- return KErrNone;
- }
-
-//Test code for testing PublishContextL with array argument
-STIF_TESTDEFINE( T_PublishContextLWithArray )
- {
- _LIT( KDummyContext, "CtxUtilApiTest" );
- CDesCArray* arr = new ( ELeave ) CDesC16ArrayFlat( 4 );
- CleanupStack::PushL( arr );
-
- iContextUtility->PublishContextL( KDummyContext, *arr );
-
- arr->AppendL( _L( "first item" ) );
- arr->AppendL( _L( "second item" ) );
- arr->AppendL( _L( "third item" ) );
- iContextUtility->PublishContextL( KDummyContext, *arr );
- HBufC* val = iContextUtility->GetContextL( KDummyContext );
- STIF_ASSERT_TRUE( val && val->Length() );
- delete val;
- CleanupStack::PopAndDestroy( arr );
- return KErrNone;
- }
-
-//Test code for testing PublishContextDelayedL with array argument
-STIF_TESTDEFINE( T_PublishContextDelayedLWithArray )
- {
- _LIT( KDummyContext, "CtxUtilApiTest2" );
- CDesCArray* arr = new ( ELeave ) CDesC16ArrayFlat( 4 );
- CleanupStack::PushL( arr );
- arr->AppendL( _L( "first item" ) );
- arr->AppendL( _L( "second item" ) );
- arr->AppendL( _L( "third item" ) );
- iContextUtility->PublishContextDelayedL( KDummyContext, *arr, 500000 );
- iContextUtility->PublishContextDelayedL( KDummyContext, *arr, 0 );
- iContextUtility->PublishContextDelayedL( KDummyContext, *arr, 500000 );
- CWait* wait = CWait::NewL();
- wait->Start( 2000000 );
- delete wait;
- HBufC* val = iContextUtility->GetContextL( KDummyContext );
- STIF_ASSERT_TRUE( val && val->Length() );
- delete val;
- CleanupStack::PopAndDestroy( arr );
- return KErrNone;
- }
-
-//Test code for testing RePublishWhenFgL with different arguments
-//Most probably nothing will happen because there is no CCoeEnv but
-//it should never crash.
-STIF_TESTDEFINE( T_RePublishWhenFgL )
- {
- iContextUtility->RePublishWhenFgL( ETrue );
- iContextUtility->RePublishWhenFgL( EFalse );
- iContextUtility->RePublishWhenFgL( ETrue );
- return KErrNone;
- }
-
-/* IMPORT_C void PublishContactContextL( const MVPbkStoreContact& aContact,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );*/
-STIF_TESTDEFINE( T_PublishContactContextL1 )
- {
- CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC();
- m->OpenDefaultMatchStoresL();
- CVPbkContactManager& cm( m->GetContactManager() );
- MVPbkContactStoreList& sl( m->GetContactStoresL() );
- MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC();
- const MVPbkFieldType* fieldType = m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME);
- MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType);
- MVPbkContactFieldTextData* textData = &(MVPbkContactFieldTextData::Cast(newField->FieldData()));
- _LIT(KName, "ctxutiltester");
- textData->SetTextL( KName );
- newContact->AddFieldL(newField);
- CleanupStack::Pop(newField);
- CWait* wait = CWait::NewLC();
- struct TDummyObs : public MVPbkContactObserver
- {
- CWait* iWait;
- TDummyObs( CWait* aWait ) : iWait( aWait ) { }
- void ContactOperationCompleted(TContactOpResult /*aResult*/)
- {
- iWait->Stop();
- }
- void ContactOperationFailed(TContactOp /*aOpCode*/,
- TInt /*aErrorCode*/,
- TBool /*aErrorNotified*/) { }
- } dummyObs( wait );
- newContact->CommitL( dummyObs );
- wait->Start( 2000000 );
- CleanupStack::PopAndDestroy( wait );
-
- iContextUtility->PublishContactContextL( *newContact, 0 );
- iContextUtility->PublishContactContextL( *newContact, 500000 );
- wait = CWait::NewL();
- wait->Start( 2000000 );
- delete wait;
- HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact);
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- delete ctx;
-
- CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC();
- ca->AppendL( newContact->CreateLinkLC() );
- CleanupStack::Pop();
- wait = CWait::NewL();
- struct TDummyObs2 : public MVPbkBatchOperationObserver
- {
- CWait* iWait;
- TDummyObs2( CWait* aWait ) : iWait( aWait ) { }
- void StepComplete(
- MVPbkContactOperationBase& /*aOperation*/,
- TInt /*aStepSize*/ ) { }
- TBool StepFailed(
- MVPbkContactOperationBase& /*aOperation*/,
- TInt /*aStepSize*/, TInt /*aError*/ )
- {
- return EFalse;
- }
- void OperationComplete(
- MVPbkContactOperationBase& /*aOperation*/ )
- {
- iWait->Stop();
- }
- } dummyObs2( wait );
- MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 );
- CleanupDeletePushL( op );
- wait->Start( 2000000 );
- delete wait;
- CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m
-
- return KErrNone;
- }
-
-/* IMPORT_C void PublishContactContextL( const MVPbkContactLink& aContactLink,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );*/
-STIF_TESTDEFINE( T_PublishContactContextL2 )
- {
- CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC();
- m->OpenDefaultMatchStoresL();
- CVPbkContactManager& cm( m->GetContactManager() );
- MVPbkContactStoreList& sl( m->GetContactStoresL() );
- MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC();
- const MVPbkFieldType* fieldType = m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME);
- MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType);
- MVPbkContactFieldTextData* textData = &(MVPbkContactFieldTextData::Cast(newField->FieldData()));
- _LIT(KName, "ctxutiltester");
- textData->SetTextL( KName );
- newContact->AddFieldL(newField);
- CleanupStack::Pop(newField);
- CWait* wait = CWait::NewL();
- struct TDummyObs : public MVPbkContactObserver
- {
- CWait* iWait;
- TDummyObs( CWait* aWait ) : iWait( aWait ) { }
- void ContactOperationCompleted(TContactOpResult /*aResult*/)
- {
- iWait->Stop();
- }
- void ContactOperationFailed(TContactOp /*aOpCode*/,
- TInt /*aErrorCode*/,
- TBool /*aErrorNotified*/){ }
- } dummyObs( wait );
- newContact->CommitL( dummyObs );
- wait->Start( 2000000 );
- delete wait;
-
- CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC();
- ca->AppendL( newContact->CreateLinkLC() );
- CleanupStack::Pop();
-
- iContextUtility->PublishContactContextL( ca->At( 0 ), 0 );
- iContextUtility->PublishContactContextL( ca->At( 0 ), 500000 );
- wait = CWait::NewL();
- wait->Start( 2000000 );
- delete wait;
- HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact);
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- delete ctx;
-
- wait = CWait::NewL();
- struct TDummyObs2 : public MVPbkBatchOperationObserver
- {
- CWait* iWait;
- TDummyObs2( CWait* aWait ) : iWait( aWait ) { }
- void StepComplete(
- MVPbkContactOperationBase& /*aOperation*/,
- TInt /*aStepSize*/ ) { }
- TBool StepFailed(
- MVPbkContactOperationBase& /*aOperation*/,
- TInt /*aStepSize*/, TInt /*aError*/ )
- {
- return EFalse;
- }
- void OperationComplete(
- MVPbkContactOperationBase& /*aOperation*/ ) { iWait->Stop(); }
- } dummyObs2( wait );
- MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 );
- CleanupDeletePushL( op );
- wait->Start( 2000000 );
- delete wait;
-
- // test with (surely) non-existing link
- iContextUtility->PublishContactContextL( ca->At( 0 ) );
- wait = CWait::NewL();
- wait->Start( 2000000 );
- delete wait;
-
- CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m
-
- return KErrNone;
- }
-
-/* IMPORT_C void PublishContactContextL( const TDesC& aContactName,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );*/
-STIF_TESTDEFINE( T_PublishContactContextL3 )
- {
- iContextUtility->PublishContactContextL( KName );
- HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact);
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- delete ctx;
-
- iContextUtility->PublishContactContextL( KName, 500000 );
- iContextUtility->PublishContactContextL( KName, 500000 );
- iContextUtility->PublishContactContextL( KName, 500000 );
- ctx = iContextUtility->GetContextL( KHgCFTypeContact);
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- delete ctx;
-
- return KErrNone;
- }
-
-/* IMPORT_C void PublishContactContextL(
- const RPointerArray<MVPbkStoreContact>& aContacts,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );*/
-STIF_TESTDEFINE( T_PublishContactContextL4 )
- {
- CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC();
- m->OpenDefaultMatchStoresL();
- CVPbkContactManager& cm( m->GetContactManager() );
- MVPbkContactStoreList& sl( m->GetContactStoresL() );
- MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC();
- const MVPbkFieldType* fieldType = m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME);
- MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType);
- MVPbkContactFieldTextData* textData = &(MVPbkContactFieldTextData::Cast(newField->FieldData()));
- _LIT(KName, "ctxutiltester");
- textData->SetTextL( KName );
- newContact->AddFieldL(newField);
- CleanupStack::Pop(newField);
- CWait* wait = CWait::NewL();
- struct TDummyObs : public MVPbkContactObserver
- {
- CWait* iWait;
- TDummyObs( CWait* aWait ) : iWait( aWait ) { }
- void ContactOperationCompleted(TContactOpResult /*aResult*/) { iWait->Stop(); }
- void ContactOperationFailed(TContactOp /*aOpCode*/, TInt /*aErrorCode*/, TBool /*aErrorNotified*/) { }
- } dummyObs( wait );
- newContact->CommitL( dummyObs );
- wait->Start( 2000000 );
- delete wait;
-
- RPointerArray<MVPbkStoreContact> pa;
- CleanupClosePushL( pa );
- pa.AppendL( newContact );
- iContextUtility->PublishContactContextL( pa, 0 );
- iContextUtility->PublishContactContextL( pa, 500000 );
- CleanupStack::PopAndDestroy( &pa );
- wait = CWait::NewL();
- wait->Start( 2000000 );
- delete wait;
- HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact);
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- delete ctx;
-
- RPointerArray<MVPbkStoreContact> pa2;
- CleanupClosePushL( pa2 );
- pa2.AppendL( newContact );
- pa2.AppendL( newContact );
- pa2.AppendL( newContact );
- pa2.AppendL( newContact );
- iContextUtility->PublishContactContextL( pa2, 500000 );
- iContextUtility->PublishContactContextL( pa2, 0 );
- CleanupStack::PopAndDestroy( &pa2 );
- wait = CWait::NewL();
- wait->Start( 2000000 );
- delete wait;
- ctx = iContextUtility->GetContextL( KHgCFTypeContact);
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- delete ctx;
-
- CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC();
- ca->AppendL( newContact->CreateLinkLC() );
- CleanupStack::Pop();
- wait = CWait::NewL();
- struct TDummyObs2 : public MVPbkBatchOperationObserver
- {
- CWait* iWait;
- TDummyObs2( CWait* aWait ) : iWait( aWait ) { }
- void StepComplete(
- MVPbkContactOperationBase& /*aOperation*/,
- TInt /*aStepSize*/ ) { }
- TBool StepFailed(
- MVPbkContactOperationBase& /*aOperation*/,
- TInt /*aStepSize*/, TInt /*aError*/ )
- {
- return EFalse;
- }
- void OperationComplete(
- MVPbkContactOperationBase& /*aOperation*/ ) { iWait->Stop(); }
- } dummyObs2( wait );
- MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 );
- CleanupDeletePushL( op );
- wait->Start( 2000000 );
- delete wait;
- CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m
-
- return KErrNone;
- }
-
-/* IMPORT_C void PublishContactContextL(
- const RPointerArray<MVPbkContactLink>& aContactLinks,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );*/
-STIF_TESTDEFINE( T_PublishContactContextL5 )
- {
- CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC();
- m->OpenDefaultMatchStoresL();
- CVPbkContactManager& cm( m->GetContactManager() );
- MVPbkContactStoreList& sl( m->GetContactStoresL() );
- MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC();
- const MVPbkFieldType* fieldType =
- m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME);
- MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType);
- MVPbkContactFieldTextData* textData =
- &(MVPbkContactFieldTextData::Cast(newField->FieldData()));
- _LIT(KName, "ctxutiltester");
- textData->SetTextL( KName );
- newContact->AddFieldL(newField);
- CleanupStack::Pop(newField);
- CWait* wait = CWait::NewL();
- struct TDummyObs : public MVPbkContactObserver
- {
- CWait* iWait;
- TDummyObs( CWait* aWait ) : iWait( aWait ) { }
- void ContactOperationCompleted(TContactOpResult /*aResult*/)
- {
- iWait->Stop();
- }
- void ContactOperationFailed(TContactOp /*aOpCode*/,
- TInt /*aErrorCode*/,
- TBool /*aErrorNotified*/) { }
- } dummyObs( wait );
- newContact->CommitL( dummyObs );
- wait->Start( 2000000 );
- delete wait;
-
- CVPbkContactLinkArray* pa = CVPbkContactLinkArray::NewLC();
- pa->AppendL( newContact->CreateLinkLC() );
- CleanupStack::Pop();
- iContextUtility->PublishContactContextL( *pa, 0 );
- iContextUtility->PublishContactContextL( *pa, 500000 );
- CleanupStack::PopAndDestroy( pa );
- wait = CWait::NewL();
- wait->Start( 2000000 );
- delete wait;
- HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact);
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- delete ctx;
-
- CVPbkContactLinkArray* pa2 = CVPbkContactLinkArray::NewLC();
- pa2->AppendL( newContact->CreateLinkLC() );
- CleanupStack::Pop();
- pa2->AppendL( newContact->CreateLinkLC() );
- CleanupStack::Pop();
- pa2->AppendL( newContact->CreateLinkLC() );
- CleanupStack::Pop();
- iContextUtility->PublishContactContextL( *pa2, 500000 );
- iContextUtility->PublishContactContextL( *pa2, 0 );
- CleanupStack::PopAndDestroy( pa2 );
- wait = CWait::NewL();
- wait->Start( 2000000 );
- delete wait;
- ctx = iContextUtility->GetContextL( KHgCFTypeContact);
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- delete ctx;
-
- CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC();
- ca->AppendL( newContact->CreateLinkLC() );
- CleanupStack::Pop();
- wait = CWait::NewL();
- struct TDummyObs2 : public MVPbkBatchOperationObserver
- {
- CWait* iWait;
- TDummyObs2( CWait* aWait ) : iWait( aWait ) { }
- void StepComplete(
- MVPbkContactOperationBase& /*aOperation*/,
- TInt /*aStepSize*/ ) { }
- TBool StepFailed(
- MVPbkContactOperationBase& /*aOperation*/,
- TInt /*aStepSize*/, TInt /*aError*/ )
- {
- return EFalse;
- }
- void OperationComplete(
- MVPbkContactOperationBase& /*aOperation*/ ) { iWait->Stop(); }
- } dummyObs2( wait );
- MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 );
- CleanupDeletePushL( op );
- wait->Start( 2000000 );
- delete wait;
- CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m
-
- return KErrNone;
- }
-
-/*IMPORT_C void PublishContactContextL( const MDesCArray& aContactNames,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );*/
-STIF_TESTDEFINE( T_PublishContactContextL6 )
- {
- CDesCArray* arr = new ( ELeave ) CDesC16ArrayFlat( 4 );
- CleanupStack::PushL( arr );
- arr->AppendL( _L( "first item" ) );
- arr->AppendL( _L( "second item" ) );
- arr->AppendL( _L( "third item" ) );
- iContextUtility->PublishContactContextL( *arr );
- iContextUtility->PublishContactContextL( *arr, 500000 );
- iContextUtility->PublishContactContextL( *arr );
- CleanupStack::PopAndDestroy( arr );
- return KErrNone;
- }
-
-/* IMPORT_C void PublishTextContextL( const TDesC& aText,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );*/
-STIF_TESTDEFINE( T_PublishTextContextL )
- {
- iContextUtility->PublishTextContextL( KNullDesC, 100 );
- iContextUtility->PublishTextContextL( _L("fbngiuwetghorb rteogvhetui gherigth" ) );
- iContextUtility->PublishTextContextL( KNullDesC );
- iContextUtility->PublishTextContextL( _L("+35442754") );
- iContextUtility->PublishTextContextL( _L("35442754") );
- iContextUtility->PublishTextContextL( _L("abcdef@ghijk.com") );
- iContextUtility->PublishTextContextL( _L(" " ) );
- return KErrNone;
- }
-
-/* IMPORT_C void PublishUrlContextL( const TDesC& aUrl,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );*/
-STIF_TESTDEFINE( T_PublishUrlContextL )
- {
- _LIT( KNokiaDomain, "http://www.nokia.com" );
- _LIT( KSomeDomain, "http://www.somedomain.com" );
- iContextUtility->PublishUrlContextL( KNokiaDomain, 1000 );
- iContextUtility->PublishUrlContextL( KSomeDomain );
- iContextUtility->PublishUrlContextL( KNokiaDomain );
- HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeUrl );
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- STIF_ASSERT_TRUE( 0 == ctx->Compare( KNokiaDomain ) );
- delete ctx;
- return KErrNone;
- }
-
-/* IMPORT_C void PublishTimeContextL( const TTime& aTime,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );*/
-STIF_TESTDEFINE( T_PublishTimeContextL )
- {
- TTime t( 0 );
- iContextUtility->PublishTimeContextL( t, 100 );
- iContextUtility->PublishTimeContextL( t );
- HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeActiveDate );
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- delete ctx;
- return KErrNone;
- }
-
-/* IMPORT_C void PublishPhotoContextL( const TDesC& aFilename,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );*/
-STIF_TESTDEFINE( T_PublishPhotoContextL )
- {
- _LIT( KJpegPath, "c:\\image.jpg" );
- _LIT( KPngPath, "c:\\image.png" );
- iContextUtility->PublishPhotoContextL( KJpegPath, 100 );
- iContextUtility->PublishPhotoContextL( KPngPath, 0 );
- iContextUtility->PublishPhotoContextL( KJpegPath );
- HBufC* ctx = iContextUtility->GetContextL( KHgCFTypePhoto );
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- STIF_ASSERT_TRUE( 0 == ctx->Compare(KJpegPath) );
- delete ctx;
-
- iContextUtility->PublishPhotoContextL( KPngPath, 100000 );
- ctx = iContextUtility->GetContextL( KHgCFTypePhoto );
- STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) );
- STIF_ASSERT_TRUE( 0 == ctx->Compare(KJpegPath) );
- delete ctx;
- return KErrNone;
- }
-
-/* IMPORT_C void PublishPhotoContextL( TItemId aMdeItemId,
- CMdESession& aMdeSession,
- const TTimeIntervalMicroSeconds32& aDelay = 0 );*/
-STIF_TESTDEFINE( T_PublishPhotoContextL2 )
- {
- CWait* wait = CWait::NewLC();
- struct TObs : public MMdESessionObserver {
- CWait* iWait;
- TObs( CWait* aWait ) : iWait( aWait ) { }
- void HandleSessionOpened( CMdESession& /*aSession*/, TInt /*aError*/ ) { iWait->Stop(); }
- void HandleSessionError( CMdESession& /*aSession*/, TInt /*aError*/ ) { }
- } mdeobs( wait );
- CMdESession* s = CMdESession::NewLC( mdeobs );
- wait->Start( 5000000 );
- // invalid item id
- TRAPD( err, iContextUtility->PublishPhotoContextL( 0, *s ) );
- STIF_ASSERT_TRUE( err != KErrNone ); // leave should have occured
- for ( TInt i = 0; i < 100; ++i )
- {
- TRAP_IGNORE( iContextUtility->PublishPhotoContextL( TItemId( i ), *s ) );
- }
- CleanupStack::PopAndDestroy( 2 );
- return KErrNone;
- }
-
-/* IMPORT_C void PublishTvContextL( const TDesC& aChannelName,
- const TDesC& aProgramName, const TDesC& aProgramDescription,
- const TDesC& aGenre ); */
-STIF_TESTDEFINE( T_PublishTvContextL )
- {
- _LIT( K1, "channel A" );
- _LIT( K2, "program X" );
- _LIT( K3, "very interesting program" );
- iContextUtility->PublishTvContextL( K1, K2, K3, KNullDesC );
- iContextUtility->PublishTvContextL( K1, K2, K3, KNullDesC );
- iContextUtility->PublishTvContextL( K1, K2, KNullDesC, KNullDesC );
- HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeTvProgramName );
- STIF_ASSERT_TRUE_DESC( ctx != NULL && !ctx->Compare( K2 ),
- _L( "Context not found" ) );
- delete ctx;
-
- iContextUtility->PublishTvContextL( KNullDesC, K2, KNullDesC, KNullDesC );
- iContextUtility->PublishTvContextL( KNullDesC, KNullDesC, KNullDesC, KNullDesC );
- iContextUtility->PublishTvContextL( KNullDesC, K2, KNullDesC, KNullDesC );
- iContextUtility->PublishTvContextL( KNullDesC, KNullDesC, KNullDesC, _L("movie") );
- ctx = iContextUtility->GetContextL( KHgCFTypeTvChannelName );
- STIF_ASSERT_TRUE_DESC( ctx != NULL && !ctx->Compare( KHgCFValueUnknownInfo ),
- _L( "Context not found" ) );
- delete ctx;
- return KErrNone;
- }
-
-/* IMPORT_C void PublishServiceIdL( const TDesC& aServiceId,
- const TDesC& aAccountId,
- const TTimeIntervalMicroSeconds32& aDelay = 0 ); */
-STIF_TESTDEFINE( T_PublishServiceIdL )
- {
- iContextUtility->PublishServiceIdL( _L("Ovi"), _L("someid") );
- iContextUtility->PublishServiceIdL( _L("Ovi"), _L("someid"), 1000000 );
- iContextUtility->PublishServiceIdL( _L("Ovi"), _L("someid") );
- }
-
-/* IMPORT_C void AddMusicContextInfoL(
- const TDesC& aKey,
- const TDesC& aData ); */
-STIF_TESTDEFINE( T_AddMusicContextInfoL )
- {
- // Fetch the pointer to hash table for testing purposes
- RPtrHashMap<TDesC, TDesC>* hash = GetImplHashTablePtr();
- _LIT( KPlaying, "Playing" );
- _LIT( KArtist, "Hans Zimmer");
- _LIT( KTitle, "Why so serious" );
- _LIT( KAlbum, "Dark Knight" );
- _LIT( KGenre, "Soundtrack" );
-
- STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L("There is stuff in the list!") );
- STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicState ) == NULL, _L( "State in the list!" ) );
- STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicArtist ) == NULL, _L( "Artist in the list!" ) );
- STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicTitle ) == NULL, _L( "Title in the list!" ) );
- STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicAlbum ) == NULL, _L( "Album in the list!" ) );
- STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicAlbumArt ) == NULL, _L( "Art in the list!" ) );
- STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicUri ) == NULL, _L( "Uri in the list!" ) );
- STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicGenre ) == NULL, _L( "Genre in the list!" ) );
- STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicType ) == NULL, _L( "Type in the list!" ) );
-
- // No room for empty keys
- TRAPD( err, iContextUtility->AddMusicContextInfoL( KNullDesC, KPlaying ) );
- STIF_ASSERT_TRUE_DESC( err == KErrNotFound, _L( "Empty key didn't cause leave!" ) );
- STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L( "There is stuff in the list!" ) );
-
- // Fill all values and test they will be there.
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicState, KPlaying );
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicArtist, KArtist );
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicTitle, KTitle );
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbum, KAlbum );
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbumArt, KHgCFValueUnknownInfo );
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicUri, KNullDesC );
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicGenre, KGenre );
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicType, KHgCFValueMusicTypePlayer );
-
- STIF_ASSERT_TRUE_DESC( hash->Count() == 8, _L( "List should contain 8 items." ) );
- STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicState )->CompareC( KPlaying ),
- _L( "Wrong state in the table!" ) );
- STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicArtist )->CompareC( KArtist ),
- _L( "Wrong artist in the table!" ) );
- STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicTitle )->CompareC( KTitle ),
- _L( "Wrong title in the table!" ) );
- STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicAlbum )->CompareC( KAlbum ),
- _L( "Wrong album in the table!" ) );
- STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicAlbumArt )->CompareC( KHgCFValueUnknownInfo ),
- _L( "Wrong art in the table!" ) );
- STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicUri )->CompareC( KHgCFValueUnknownInfo ),
- _L( "Wrong uri in the table!" ) );
- STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicGenre )->CompareC( KGenre ),
- _L( "Wrong genre in the table!" ) );
- STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicType )->CompareC( KHgCFValueMusicTypePlayer ),
- _L( "Wrong type in the table!" ) );
-
- // An attempt to add same key twice, causes problems.
- TRAP( err, iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicState, KPlaying ) );
- STIF_ASSERT_TRUE_DESC( err == KErrAlreadyExists, _L( "Adding same key should cause a leave!" ) );
- STIF_ASSERT_TRUE_DESC( hash->Count() == 8, _L( "List should contain 8 items!" ) );
-
- return KErrNone;
- }
-
-/** IMPORT_C void PublishMusicContextL(
- const TTimeIntervalMicroSeconds32& aDelay = 0 ); */
-STIF_TESTDEFINE( T_PublishMusicContextL )
- {
- RPtrHashMap<TDesC, TDesC>* hash = GetImplHashTablePtr();
- _LIT( KPlaying, "Playing" );
- _LIT( KArtist, "John Williams");
- _LIT( KTitle, "Raiders March" );
- _LIT( KAlbum, "Raiders of the Lost Ark" );
-
- STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L( "There is stuff in the list!" ) );
- TRAPD( err, iContextUtility->PublishMusicContextL() );
- STIF_ASSERT_TRUE_DESC( err == KErrNotReady, _L( "No point to publish anything, when list is empty!" ) );
-
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicState, KPlaying );
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicArtist, KArtist );
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicTitle, KTitle );
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbum, KAlbum );
- iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbumArt, KHgCFValueUnknownInfo );
-
- iContextUtility->PublishMusicContextL();
- STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L( "There is stuff in the list!" ) );
-
- HBufC* musicState = iContextUtility->GetContextL( KHgCFTypeMusicState );
- HBufC* musicArtist = iContextUtility->GetContextL( KHgCFTypeMusicArtist );
- HBufC* musicTitle = iContextUtility->GetContextL( KHgCFTypeMusicTitle );
- HBufC* musicAlbum = iContextUtility->GetContextL( KHgCFTypeMusicAlbum );
- HBufC* musicAlbumArt = iContextUtility->GetContextL( KHgCFTypeMusicAlbumArt );
- HBufC* musicGeneralUri = iContextUtility->GetContextL( KHgCFTypeMusicUri );
- HBufC* musicGenre = iContextUtility->GetContextL( KHgCFTypeMusicGenre );
- HBufC* musicType = iContextUtility->GetContextL( KHgCFTypeMusicType );
-
- STIF_ASSERT_TRUE_DESC( musicState != NULL
- && !musicState->Compare( KPlaying ), _L( "Music context not found" ) );
- STIF_ASSERT_TRUE_DESC( musicArtist != NULL
- && !musicArtist->Compare( KArtist ), _L( "Artist context not found" ) );
- STIF_ASSERT_TRUE_DESC( musicTitle != NULL
- && !musicTitle->Compare( KTitle ), _L( "Title context not found" ) );
- STIF_ASSERT_TRUE_DESC( musicAlbum != NULL
- && !musicAlbum->Compare( KAlbum ), _L( "Album context not found" ) );
- STIF_ASSERT_TRUE_DESC( musicAlbumArt != NULL
- && !musicAlbumArt->Compare( KHgCFValueUnknownInfo ), _L( "Art context not found" ) );
- STIF_ASSERT_TRUE_DESC( musicGeneralUri != NULL
- && !musicGeneralUri->Compare( KHgCFValueUnknownInfo ), _L( "Uri context not found" ) );
- STIF_ASSERT_TRUE_DESC( musicGenre != NULL
- && !musicGenre->Compare( KHgCFValueUnknownInfo ), _L( "Genre context not found" ) );
- STIF_ASSERT_TRUE_DESC( musicType != NULL
- && !musicType->Compare( KHgCFValueUnknownInfo ), _L( "Type context not found" ) );
-
- delete musicState;
- delete musicArtist;
- delete musicTitle;
- delete musicAlbum;
- delete musicAlbumArt;
- delete musicGeneralUri;
- delete musicGenre;
- delete musicType;
-
- return KErrNone;
- }
-
-STIF_TESTDEFINE( T_PublishRadioContextL )
- {
- _LIT( KTestRadioName, "radio test name" );
- _LIT( KTestRadioUrl, "radio test url" );
- _LIT( KTestRadioFrequency, "radio test frequency" );
- _LIT( KTestRadioRDSPI, "radio test rdspi" );
-
- HBufC* ctxRadioName = NULL;
- HBufC* ctxRadioUrl = NULL;
- HBufC* ctxRadioFrequency = NULL;
- HBufC* ctxRadioRDSPI = NULL;
-
- RArray<TPtrC> testData;
- CleanupClosePushL(testData);
-
- // Empty Values
- iContextUtility->PublishRadioContextL(KNullDesC, KNullDesC, KNullDesC, KNullDesC);
- ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName);
- ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl);
- ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency);
- ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI);
- STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && !ctxRadioName->Compare( KHgCFValueUnknownInfo ),
- _L( "Empty value: ctxRadioName error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && !ctxRadioUrl->Compare( KHgCFValueUnknownInfo ),
- _L( "Empty value: ctxRadioUrl error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && !ctxRadioFrequency->Compare( KHgCFValueUnknownInfo ),
- _L( "Empty value: ctxRadioFrequency error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && !ctxRadioRDSPI->Compare( KHgCFValueUnknownInfo ),
- _L( "Empty value: ctxRadioRDSPI error." ) );
- delete ctxRadioName;
- delete ctxRadioUrl;
- delete ctxRadioFrequency;
- delete ctxRadioRDSPI;
-
- // One value
- testData.Reset();
- testData.ReserveL(16);
- for(TInt i = 0; i < 12; i++)
- {
- testData.AppendL(KNullDesC());
- }
- testData.Insert(KTestRadioName(), 0);
- testData.Insert(KTestRadioUrl(), 5);
- testData.Insert(KTestRadioFrequency(), 10);
- testData.Insert(KTestRadioRDSPI(), 15);
- for(TInt i = 0; i < 16; i += 4)
- {
- iContextUtility->PublishRadioContextL(testData[i], testData[i+1], testData[i+2], testData[i+3]);
- ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName);
- ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl);
- ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency);
- ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI);
- STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL &&
- !ctxRadioName->Compare( testData[i].Length() ? testData[i] : KHgCFValueUnknownInfo() ),
- _L( "One value: ctxRadioName error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL &&
- !ctxRadioUrl->Compare( testData[i+1].Length() ? testData[i+1] : KHgCFValueUnknownInfo() ),
- _L( "One value: ctxRadioUrl error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL &&
- !ctxRadioFrequency->Compare( testData[i+2].Length() ? testData[i+2] : KHgCFValueUnknownInfo() ),
- _L( "One value: ctxRadioFrequency error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL &&
- !ctxRadioRDSPI->Compare( testData[i+3].Length() ? testData[i+3] : KHgCFValueUnknownInfo() ),
- _L( "One value: ctxRadioRDSPI error." ) );
- delete ctxRadioName;
- delete ctxRadioUrl;
- delete ctxRadioFrequency;
- delete ctxRadioRDSPI;
- }
-
- // Two values
- testData.Reset();
- testData.ReserveL(24);
- for(TInt i = 0; i < 12; i++)
- {
- testData.AppendL(KNullDesC());
- }
- testData.Insert(KTestRadioName(), 0);
- testData.Insert(KTestRadioUrl(), 1);
- testData.Insert(KTestRadioName(), 4);
- testData.Insert(KTestRadioFrequency(), 6);
- testData.Insert(KTestRadioName(), 8);
- testData.Insert(KTestRadioRDSPI(), 11);
- testData.Insert(KTestRadioUrl(), 13);
- testData.Insert(KTestRadioFrequency(), 14);
- testData.Insert(KTestRadioUrl(), 17);
- testData.Insert(KTestRadioRDSPI(), 19);
- testData.Insert(KTestRadioFrequency(), 22);
- testData.Insert(KTestRadioRDSPI(), 23);
- for(TInt i = 0; i < 24; i += 4)
- {
- iContextUtility->PublishRadioContextL(testData[i], testData[i+1], testData[i+2], testData[i+3]);
- ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName);
- ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl);
- ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency);
- ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI);
- STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL &&
- !ctxRadioName->Compare( testData[i].Length() ? testData[i] : KHgCFValueUnknownInfo() ),
- _L( "Two values: ctxRadioName error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL &&
- !ctxRadioUrl->Compare( testData[i+1].Length() ? testData[i+1] : KHgCFValueUnknownInfo() ),
- _L( "Two values: ctxRadioUrl error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL &&
- !ctxRadioFrequency->Compare( testData[i+2].Length() ? testData[i+2] : KHgCFValueUnknownInfo() ),
- _L( "Two values: ctxRadioFrequency error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL &&
- !ctxRadioRDSPI->Compare( testData[i+3].Length() ? testData[i+3] : KHgCFValueUnknownInfo() ),
- _L( "Two values: ctxRadioRDSPI error." ) );
- delete ctxRadioName;
- delete ctxRadioUrl;
- delete ctxRadioFrequency;
- delete ctxRadioRDSPI;
- }
-
- // Three values
- testData.Reset();
- testData.ReserveL(16);
- for(TInt i = 0; i < 4; i++)
- {
- testData.AppendL(KTestRadioName());
- testData.AppendL(KTestRadioUrl());
- testData.AppendL(KTestRadioFrequency());
- testData.AppendL(KTestRadioRDSPI());
- }
- testData.Remove(3);
- testData.Insert(KNullDesC(), 3);
- testData.Remove(6);
- testData.Insert(KNullDesC(), 6);
- testData.Remove(9);
- testData.Insert(KNullDesC(), 9);
- testData.Remove(12);
- testData.Insert(KNullDesC(), 12);
- for(TInt i = 0; i < 16; i += 4)
- {
- iContextUtility->PublishRadioContextL(testData[i], testData[i+1], testData[i+2], testData[i+3]);
- ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName);
- ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl);
- ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency);
- ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI);
- STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL &&
- !ctxRadioName->Compare( testData[i].Length() ? testData[i] : KHgCFValueUnknownInfo() ),
- _L( "Three values: ctxRadioName error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL &&
- !ctxRadioUrl->Compare( testData[i+1].Length() ? testData[i+1] : KHgCFValueUnknownInfo() ),
- _L( "Three values: ctxRadioUrl error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL &&
- !ctxRadioFrequency->Compare( testData[i+2].Length() ? testData[i+2] : KHgCFValueUnknownInfo() ),
- _L( "Three values: ctxRadioFrequency error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL &&
- !ctxRadioRDSPI->Compare( testData[i+3].Length() ? testData[i+3] : KHgCFValueUnknownInfo() ),
- _L( "Three values: ctxRadioRDSPI error." ) );
- delete ctxRadioName;
- delete ctxRadioUrl;
- delete ctxRadioFrequency;
- delete ctxRadioRDSPI;
- }
-
- // Four values
- iContextUtility->PublishRadioContextL(KTestRadioName, KTestRadioUrl, KTestRadioFrequency, KTestRadioRDSPI);
- ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName);
- ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl);
- ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency);
- ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI);
- STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && !ctxRadioName->Compare( KTestRadioName ),
- _L( "Four values: ctxRadioName error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && !ctxRadioUrl->Compare( KTestRadioUrl ),
- _L( "Four values: ctxRadioUrl error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && !ctxRadioFrequency->Compare( KTestRadioFrequency ),
- _L( "Four values: ctxRadioFrequency error." ) );
- STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && !ctxRadioRDSPI->Compare( KTestRadioRDSPI ),
- _L( "Four values: ctxRadioRDSPI error." ) );
- delete ctxRadioName;
- delete ctxRadioUrl;
- delete ctxRadioFrequency;
- delete ctxRadioRDSPI;
-
- CleanupStack::PopAndDestroy(&testData);
-
- return KErrNone;
- }
-
-#endif
-
-// end of file
--- a/homescreensrv_plat/context_utility_api/tsrc/src/wait.cpp Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
-* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: CWait class implementation
-*
-*/
-
-
-#include "wait.h"
-
-// CONSTANTS
-
-_LIT( KPanicCat, "ActTimSche" );
-
-enum TPanicReason
- {
- EAlreadyStarted
- };
-
-LOCAL_C void Panic( TInt aCode )
- {
- User::Panic( KPanicCat, aCode );
- }
-
-// MEMBER FUNCTIONS
-
-CWait* CWait::NewL()
- {
-
- CWait* self =
- CWait::NewLC();
- CleanupStack::Pop( self );
-
- return self;
- }
-
-CWait* CWait::NewLC()
- {
-
- CWait* self =
- new( ELeave ) CWait;
- CleanupStack::PushL( self );
- self->ConstructL();
-
- return self;
- }
-
-CWait::CWait():
- CTimer( EPriorityStandard )
- {
-
- // Double check if base class adds active object into scheduler
- if( !IsAdded() )
- {
- CActiveScheduler::Add( this );
- }
- }
-
-void CWait::ConstructL()
- {
-
- // Do base constructions
- CTimer::ConstructL();
-
- // Initialize active scheduler wait
- iWait = new( ELeave ) CActiveSchedulerWait;
- }
-
-// Destructor
-CWait::~CWait()
- {
-
- Cancel();
- delete iWait;
- }
-
-// METHODS
-
-//-----------------------------------------------------------------------------
-// CWait::Start
-//-----------------------------------------------------------------------------
-//
-void CWait::Start(
- const TTimeIntervalMicroSeconds32& aInterval )
- {
-
- __ASSERT_ALWAYS( !IsActive(), Panic( EAlreadyStarted ) );
-
- After( aInterval );
- iWait->Start();
- }
-
-//-----------------------------------------------------------------------------
-// CWait::Stop
-//-----------------------------------------------------------------------------
-//
-void CWait::Stop()
- {
-
- Cancel();
- }
-
-//-----------------------------------------------------------------------------
-// CWait::RunL
-//-----------------------------------------------------------------------------
-//
-void CWait::RunL()
- {
-
- // Double check that wait really started
- if( iWait->IsStarted() )
- {
- iWait->AsyncStop();
- }
- }
-
-//-----------------------------------------------------------------------------
-// CWait::DoCancel
-//-----------------------------------------------------------------------------
-//
-void CWait::DoCancel()
- {
-
- // Double check that wait really started
- CTimer::DoCancel();
- if( iWait->IsStarted() )
- {
- iWait->AsyncStop();
- }
- }
-
-
-// end of file
--- a/homescreensrv_plat/context_utility_api/tsrc/src/wait.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +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: CWait class declaration.
-*
-*/
-
-
-
-#ifndef C_WAIT_H
-#define C_WAIT_H
-
-#include <e32base.h>
-
-/**
-* Timed active scheduler wait.
-* This class wraps inside a timer and scheduler wait.
-* Wait will be automatically stopped after specified time.
-*/
-NONSHARABLE_CLASS( CWait ): public CTimer
- {
- public: // Constructors and destructor
-
- // Two-phased constructor.
- static CWait* NewL();
- static CWait* NewLC();
-
- // Destructor.
- virtual ~CWait();
-
- public: // New methods
-
- /**
- * Starts waiting in the scheduler.
- * Wait will be automatically stopped after aInterval amount
- * of time has passed.
- *
- * @param aInterval Interval after wait will be stopped.
- * @return None
- */
- void Start( const TTimeIntervalMicroSeconds32& aInterval );
-
- /**
- * Stops scheduler wait.
- *
- * @param None
- * @return None
- */
- void Stop();
-
- private: // From base classes
-
- // @see CActive
- void RunL();
-
- // @see CActive
- void DoCancel();
-
- private:
-
- CWait();
- void ConstructL();
-
- private: // Data
-
- // Own: Active scheduler wait
- CActiveSchedulerWait* iWait;
- };
-
-#endif
--- a/homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbase.cpp Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,281 +0,0 @@
-/*
-* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: hgtestbase class member functions
-*
-*/
-
-
-
-// INCLUDE FILES
-#include <Stiftestinterface.h>
-#include "hgtestbase.h"
-#include <e32math.h>
-#include <e32math.h>
-#include <aknappui.h>
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CHgTestBase::CHgTestBase
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CHgTestBase::CHgTestBase()
- {
- }
-
-// -----------------------------------------------------------------------------
-// CHgTestBase::ConstructL
-// Symbian 2nd phase constructor can leave.
-//
-// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
-// with static buffer size parameter (aStaticBufferSize). Otherwise Logger
-// allocates memory from heap and therefore causes error situations with OOM
-// testing. For more information about STIF Logger construction, see STIF Users
-// Guide.
-// -----------------------------------------------------------------------------
-//
-void CHgTestBase::BaseConstructL( const TDesC& aTestPath,
- const TDesC& aTestFile )
- {
- iLog = CStifLogger::NewL( aTestPath,
- aTestFile);
-
- // Sample how to use logging
- _LIT( KLogStart, "Logging starts!" );
- iLog->Log( KLogStart );
-
- iVersionLogged = EFalse;
- iNumberOfTestCases = 0;
-
- // Construct active scheduler
- iActiveScheduler = new ( ELeave ) CActiveScheduler;
-
- // Install active scheduler
- // We don't need to check whether an active scheduler is already installed
- // as this is a new thread, so there won't be one
- CActiveScheduler::Install ( iActiveScheduler );
- }
-
-// Destructor
-CHgTestBase::~CHgTestBase()
- {
-
- delete iTestDllName;
- delete iLog;
- //delete ENV_cleanup;
- delete iActiveScheduler;
- }
-
-// -----------------------------------------------------------------------------
-// CHgTestBase::InitL
-// InitL is used to initialize the Test Module.
-// -----------------------------------------------------------------------------
-//
-TInt CHgTestBase::InitL(
- TFileName& /*aIniFile*/,
- TBool /*aFirstTime*/ )
- {
- return KErrNone;
-
- }
-
-// -----------------------------------------------------------------------------
-// CHgTestBase::GetTestCasesL
-// GetTestCases is used to inquire test cases from the Test Module. Test
-// cases are stored to array of test cases. The Test Framework will be
-// the owner of the data in the RPointerArray after GetTestCases return
-// and it does the memory deallocation.
-// -----------------------------------------------------------------------------
-//
-TInt CHgTestBase::GetTestCasesL(
- const TFileName& /*aConfig*/,
- RPointerArray<TTestCaseInfo>& aTestCases )
- {
- TTestResult dummyResult;
- return MainTestL(CHgTestBase::EEnumerateTestCases, -1, aTestCases, dummyResult);
- }
-
-// -----------------------------------------------------------------------------
-// CHgTestBase::OOMTestQueryL
-// Used to check if a particular test case should be run in OOM conditions and
-// which memory allocations should fail.
-// -----------------------------------------------------------------------------
-//
-TBool CHgTestBase::OOMTestQueryL(
- const TFileName& /* aTestCaseFile */,
- const TInt /*aCaseNumber*/,
- TOOMFailureType& /* aFailureType */,
- TInt& /*aFirstMemFailure*/,
- TInt& /*aLastMemFailure*/ )
- {
- return EFalse;
- }
-
-// -----------------------------------------------------------------------------
-// CHgTestBase::OOMTestInitializeL
-// Used to perform the test environment setup for a particular OOM test case.
-// Test Modules may use the initialization file to read parameters for Test
-// Module initialization but they can also have their own configure file or
-// some other routine to initialize themselves.
-//
-// NOTE: User may add implementation for OOM test environment initialization.
-// Usually no implementation is required.
-// -----------------------------------------------------------------------------
-//
-void CHgTestBase::OOMTestInitializeL(
- const TFileName& /* aTestCaseFile */,
- const TInt /* aCaseNumber */ )
- {
- }
-
-// -----------------------------------------------------------------------------
-// CHgTestBase::OOMHandleWarningL
-// In some cases the heap memory allocation should be skipped, either due to
-// problems in the OS code or components used by the code being tested, or even
-// inside the tested components which are implemented this way on purpose (by
-// design), so it is important to give the tester a way to bypass allocation
-// failures.
-//
-// NOTE: User may add implementation for OOM test warning handling. Usually no
-// implementation is required.
-// -----------------------------------------------------------------------------
-//
-void CHgTestBase::OOMHandleWarningL(
- const TFileName& /* aTestCaseFile */,
- const TInt /* aCaseNumber */,
- TInt& /* aFailNextValue */ )
- {
- }
-
-// -----------------------------------------------------------------------------
-// CHgTestBase::OOMTestFinalizeL
-// Used to perform the test environment cleanup for a particular OOM test case.
-//
-// NOTE: User may add implementation for OOM test environment finalization.
-// Usually no implementation is required.
-// -----------------------------------------------------------------------------
-//
-void CHgTestBase::OOMTestFinalizeL(
- const TFileName& /* aTestCaseFile */,
- const TInt /* aCaseNumber */ )
- {
- }
-
-void CHgTestBase::SendTestModuleVersion( const TDesC& aModuleName )
- {
- TVersion moduleVersion;
- moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR;
- moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR;
- moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD;
-
- TBool newVersionOfMethod = ETrue;
- TestModuleIf().SendTestModuleVersion(moduleVersion, aModuleName, newVersionOfMethod);
- }
-
-// -----------------------------------------------------------------------------
-// CHgTestBase::RunTestCaseL
-// RunTestCaseL is used to run an individual test case specified
-// by aTestCase. Test cases that can be run may be requested from
-// Test Module by GetTestCases method before calling RunTestCase.
-// -----------------------------------------------------------------------------
-//
-TInt CHgTestBase::RunTestCaseL(
- const TInt aCaseNumber,
- const TFileName& /*aConfig*/,
- TTestResult& aResult )
- {
- if(!iVersionLogged)
- {
- CHgTestBase::SendTestModuleVersion( *iTestDllName );
- iVersionLogged = ETrue;
- }
-
- RPointerArray<TTestCaseInfo> aTestCases; //temporary
-
- /**
- * SetupL is responsible for inicialization of all fields (etc.) common for all testcases
- * MainTestL starts required testcase
- * TeardownL destroys all data that was created by SetupL
- */
- TInt errSetup = KErrNone;
- TInt errTestcase = KErrNone;
-
- if(aCaseNumber > iNumberOfTestCases)
- return KErrNotFound;
-
- __UHEAP_MARK;
-
- //TRAP(errSetup, MainTestL(CHgTestBase::ERunTestCase, STIF_RUN_SETUP, aTestCases, aResult);
- TRAP(errTestcase, MainTestL(CHgTestBase::ERunTestCase, aCaseNumber, aTestCases, aResult));
- // MainTestL(CHgTestBase::ERunTestCase, STIF_RUN_TEARDOWN, aTestCases, aResult));
-
- __UHEAP_MARKEND;
-
- if(errTestcase != KErrNone)
- {
- aResult.SetResult(errTestcase, _L("Testcase failed"));
- }
- if(errSetup != KErrNone)
- {
- aResult.SetResult(errSetup, _L("Setup or teardown failed"));
- }
-
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CHgTestBase::MainTestL
-// Method responsible for enumerating and running test cases (and also setup and teardown activities before
-// and after each test case).
-// -----------------------------------------------------------------------------
-//
-TInt CHgTestBase::MainTestL(CHgTestBase::TCallReason aRunReason,
- TInt aTestToRun,
- RPointerArray<TTestCaseInfo>& aTestCases,
- TTestResult& aResult )
- {
- if(aRunReason == CHgTestBase::ERunTestCase)
- {
- if(aTestToRun < 0)
- {
- iLog->Log(_L("Running setup or teardown"));
- }
- else
- {
- iLog->Log(_L("Running test case #%d"), aTestToRun);
- }
- }
- else
- {
- iLog->Log(_L("Enumerating test cases."));
- }
-
- TInt result = -1;
-
- // this method must be implemented in the test case
- result = RunTestL( aRunReason, aTestToRun, aTestCases, aResult );
-
- if(aRunReason != CHgTestBase::ERunTestCase)
- {
- iNumberOfTestCases = result;
- iLog->Log(_L("Enumeration completed."));
- }
-
- // Test case was executed
- return KErrNone;
- }
-
-// End of File
--- a/homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbase.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/*
-* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: hgtestbase module.
-*
-*/
-
-
-#include <e32svr.h>
-#include "StifTestModule.h"
-#include <StifLogger.h>
-
-#include "hgtestbasemacros.h"
-
-// MACROS
-#define TEST_MODULE_VERSION_MAJOR 0
-#define TEST_MODULE_VERSION_MINOR 0
-#define TEST_MODULE_VERSION_BUILD 0
-
-// CLASS DECLARATION
-
-// FORWARD DECLARATIONS
-class CHgTestClass;
-class CEikonEnv;
-class CAknAppUi;
-
-// DATA TYPES
-typedef TInt (CHgTestClass::* TestFunction)(TTestResult&);
-
-/**
-* An internal structure containing a test case name and
-* the pointer to function doing the test
-*/
-class TCaseInfoInternal
-{
-public:
- const TText* iCaseName;
- TestFunction iMethod;
- TBool iIsOOMTest;
- TInt iFirstMemoryAllocation;
- TInt iLastMemoryAllocation;
-};
-
-// CLASS DECLARATION
-
-/**
-* A structure containing a test case name and
-* the pointer to function doing the test
-*/
-class TCaseInfo
-{
-public:
- TPtrC iCaseName;
- TestFunction iMethod;
- TBool iIsOOMTest;
- TInt iFirstMemoryAllocation;
- TInt iLastMemoryAllocation;
-
-TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
- {
- };
-
-};
-
-class CHgTestBase : public CTestModuleBase
-{
-
-public: //Enums
- // Reason for running test method
- enum TCallReason
- {
- EEnumerateTestCases,
- ERunTestCase,
- };
-
-public: // Constructors and destructor
- /**
- * Destructor.
- */
- virtual ~CHgTestBase();
-
-public: // New functions
- static TInt CallStop( TAny* aWait )
- {
- (static_cast<CActiveSchedulerWait*>(aWait))->AsyncStop();
- }
-public: // Functions from base classes
-
- /**
- * From CTestModuleBase InitL is used to initialize the
- * test class object. It is called once for every instance of
- * TestModule test class object after its creation.
- * @param aIniFile Initialization file for the test module (optional)
- * @param aFirstTime Flag is true when InitL is executed for first
- * created instance of test class object
- * @return Symbian OS error code
- */
- TInt InitL( TFileName& aIniFile, TBool aFirstTime );
-
- /**
- * From CTestModuleBase GetTestCasesL is used to inquiry test cases
- * from test class object.
- * @param aTestCaseFile Test case file (optional)
- * @param aTestCases Array of TestCases returned to test framework
- * @return Symbian OS error code
- */
- TInt GetTestCasesL( const TFileName& aTestCaseFile,
- RPointerArray<TTestCaseInfo>& aTestCases );
-
-
- /**
- * From CTestModuleBase; OOMTestQueryL is used to specify is particular
- * test case going to be executed using OOM conditions
- * @param aTestCaseFile Test case file (optional)
- * @param aCaseNumber Test case number (optional)
- * @param aFailureType OOM failure type (optional)
- * @param aFirstMemFailure The first heap memory allocation failure value (optional)
- * @param aLastMemFailure The last heap memory allocation failure value (optional)
- * @return TBool
- */
- virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */,
- const TInt /* aCaseNumber */,
- TOOMFailureType& aFailureType,
- TInt& /* aFirstMemFailure */,
- TInt& /* aLastMemFailure */ );
-
- /**
- * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
- * test environment
- * @param aTestCaseFile Test case file (optional)
- * @param aCaseNumber Test case number (optional)
- * @return None
- */
- virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */,
- const TInt /* aCaseNumber */ );
-
- /**
- * From CTestModuleBase; OOMHandleWarningL
- * @param aTestCaseFile Test case file (optional)
- * @param aCaseNumber Test case number (optional)
- * @param aFailNextValue FailNextValue for OOM test execution (optional)
- * @return None
- *
- * User may add implementation for OOM test warning handling. Usually no
- * implementation is required.
- */
- virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
- const TInt /* aCaseNumber */,
- TInt& /* aFailNextValue */);
-
- /**
- * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
- * test environment
- * @param aTestCaseFile Test case file (optional)
- * @param aCaseNumber Test case number (optional)
- * @return None
- *
- */
- virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */,
- const TInt /* aCaseNumber */ );
-
- /**
- * Method used to log version of test module
- */
- void SendTestModuleVersion( const TDesC& aTestPath );
-
-private:
- /**
- * From CTestModuleBase RunTestCaseL is used to run an individual
- * test case.
- * @param aCaseNumber Test case number
- * @param aTestCaseFile Test case file (optional)
- * @param aResult Test case result returned to test framework (PASS/FAIL)
- * @return Symbian OS error code (test case execution error, which is
- * not reported in aResult parameter as test case failure).
- */
- TInt RunTestCaseL( const TInt aCaseNumber,
- const TFileName& aTestCaseFile,
- TTestResult& aResult );
-
- /**
- * Method containing all test cases, setup and teardown sections.
- */
- TInt MainTestL(CHgTestBase::TCallReason aRunReason, TInt aTestToRun, RPointerArray<TTestCaseInfo>& aTestCases,
- TTestResult& aResult);
-
-protected:
-
- /**
- * C++ default constructor.
- */
- CHgTestBase();
-
- /**
- * By default Symbian 2nd phase constructor is private.
- */
- void BaseConstructL( const TDesC& aTestPath,
- const TDesC& aTestFile );
-
- /**
- * Put here the #include of the test cases cpp file
- */
- virtual TInt RunTestL(
- CHgTestBase::TCallReason aRunReason,
- TInt aTestToRun,
- RPointerArray<TTestCaseInfo>& aTestCases,
- TTestResult& aResult) = 0;
-
-protected: // Data
- // Pointer to test (function) to be executed
- TestFunction iMethod;
-
- // Pointer to logger
- CStifLogger * iLog;
-
- // Flag saying if version of test module was already sent
- TBool iVersionLogged;
- // Total number of test cases
- TInt iNumberOfTestCases;
- HBufC16* iTestDllName;
- // activescheduler for connecting
- CActiveScheduler* iActiveScheduler;
-};
--- a/homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbasemacros.h Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +0,0 @@
-/*
-* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: hgtestbasemacros test module.
-*
-*/
-
-
-
-#ifndef hgtestbasemacros_H
-#define hgtestbasemacros_H
-
-_LIT( KAssertFailedEquals, "AssertEquals Failed [F:%s][L:%d]" );
-_LIT( KAssertFailedNotEquals, "AssertNotEquals Failed [F:%s][L:%d]" );
-_LIT( KAssertFailedNull, "AssertNull Failed [F:%s][L:%d]" );
-_LIT( KAssertFailedNotNull, "AssertNotNull Failed [F:%s][L:%d]" );
-_LIT( KAssertFailedSame, "AssertSame Failed [F:%s][L:%d]" );
-_LIT( KAssertFailedNotSame, "AssertNotSame Failed [F:%s][L:%d]" );
-_LIT( KAssertFailedTrue, "AssertTrue Failed [F:%s][L:%d]" );
-_LIT( KAssertFailedFalse, "AssertFalse Failed [F:%s][L:%d]" );
-_LIT( KAssertFailedNotLeaves, "AssertNotLeaves Failed [F:%s][L:%d]" );
-_LIT( KAssertFailedLeaves, "AssertLeaves Failed [F:%s][L:%d]" );
-_LIT( KAssertFailedLeavesWith, "AssertLeavesWith Failed [F:%s][L:%d]" );
-
-
-#ifdef _UNICODE
- #define __STIF_WIDEN2(x) L ## x
- #define __STIF_WIDEN(x) __STIF_WIDEN2(x)
- #define __STIF_DBG_FILE__ __STIF_WIDEN(__FILE__)
-#else
- #define __STIF_DBG_FILE__ __FILE__
-#endif
-
-
-// Logs to the STIF log file AND to the RDebug
-#define STIF_LOG( aMessage ) \
- iLog->Log( _L( aMessage ) ); RDebug::Print( _L( aMessage ) );
-
-
-// Defines a separate test case which consists of two blocks - one for enumeration of test cases
-// second for running the testcase.
-#define STIF_TESTDEFINE( aTestName ) \
-_test_case_no++; \
-if( aRunReason == CHgTestBase::EEnumerateTestCases ) \
- { \
- TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo(); \
- CleanupStack::PushL( newCase ); \
- newCase->iCaseNumber = _test_case_no; \
- newCase->iTitle.Copy( _L( #aTestName ) ); \
- User::LeaveIfError(aTestCases.Append ( newCase ) ); \
- CleanupStack::Pop( newCase ); \
- } \
-else if(aRunReason == CHgTestBase::ERunTestCase && _test_case_no == aTestToRun)
-
-#define STIF_RUN_SETUP -1
-#define STIF_RUN_TEARDOWN -2
-
-// Defines a setup section of MainTestL method
-#define STIF_SETUP \
- if( aRunReason == CHgTestBase::ERunTestCase && aTestToRun == STIF_RUN_SETUP )
-
-// Defines a teardown section of MainTestL method
-#define STIF_TEARDOWN \
- if( aRunReason == CHgTestBase::ERunTestCase && aTestToRun == STIF_RUN_TEARDOWN )
-
-/*********************************************************************************
- * Assert Macros
- *********************************************************************************/
-#define __STIF_ASSERT_SHARED( aFunction, aMessage ) \
- if(!aFunction) \
- { \
- iLog->Log( aMessage, __STIF_DBG_FILE__, __LINE__ );\
- aResult.SetResult( KErrGeneral, _L("Testcase failed"));\
- User::Leave( KErrGeneral );\
- }
-
-#define __STIF_ASSERT_SHARED_DESC( aFunction, aMessage, aDesc ) \
- if(!aFunction) \
- { \
- iLog->Log( aMessage, __STIF_DBG_FILE__, __LINE__ );\
- aResult.SetResult( KErrGeneral, aDesc );\
- User::Leave( KErrGeneral );\
- } \
- else \
- { \
- aResult.SetResult( KErrNone, aDesc ); \
- }
-
-
-
-#define STIF_ASSERT_EQUALS( aExpected, aActual ) \
- __STIF_ASSERT_SHARED( AssertEquals( aExpected, aActual ) , KAssertFailedEquals );
-
-#define STIF_ASSERT_EQUALS_DESC( aExpected, aActual, aDescription ) \
- __STIF_ASSERT_SHARED_DESC( AssertEquals( aExpected, aActual ) , KAssertFailedEquals, aDescription );
-
-#define STIF_ASSERT_NOT_EQUALS( aExpected, aActual ) \
- __STIF_ASSERT_SHARED( !AssertEquals( aExpected, aActual ) , KAssertFailedNotEquals );
-
-#define STIF_ASSERT_NOT_EQUALS_DESC( aExpected, aActual, aDescription ) \
- __STIF_ASSERT_SHARED_DESC( !AssertEquals( aExpected, aActual ) , KAssertFailedNotEquals, aDescription );
-
-#define STIF_ASSERT_NULL( aPtr ) \
- __STIF_ASSERT_SHARED( AssertNull( aPtr ), KAssertFailedNull );
-
-#define STIF_ASSERT_NULL_DESC( aPtr, aDescription ) \
- __STIF_ASSERT_SHARED_DESC( AssertNull( aPtr ), KAssertFailedNull, aDescription );
-
-#define STIF_ASSERT_NOT_NULL( aPtr ) \
- __STIF_ASSERT_SHARED( !AssertNull( aPtr ), KAssertFailedNotNull );
-
-#define STIF_ASSERT_NOT_NULL_DESC( aPtr, aDescription ) \
- __STIF_ASSERT_SHARED_DESC( !AssertNull( aPtr ), KAssertFailedNotNull, aDescription );
-
-#define STIF_ASSERT_SAME( aExpectedPtr, aActualPtr ) \
- __STIF_ASSERT_SHARED( AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedSame );
-
-#define STIF_ASSERT_SAME_DESC( aExpectedPtr, aActualPtr, aDescription ) \
- __STIF_ASSERT_SHARED_DESC( AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedSame, aDescription );
-
-#define STIF_ASSERT_NOT_SAME( aExpectedPtr, aActualPtr) \
- __STIF_ASSERT_SHARED( !AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedNotSame );
-
-#define STIF_ASSERT_NOT_SAME_DESC( aExpectedPtr, aActualPtr, aDescription ) \
- __STIF_ASSERT_SHARED_DESC( !AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedNotSame, aDescription );
-
-#define STIF_ASSERT_TRUE( aCondition ) \
- __STIF_ASSERT_SHARED( AssertTrue( aCondition ), KAssertFailedTrue );
-
-#define STIF_ASSERT_TRUE_DESC( aCondition, aDescription ) \
- __STIF_ASSERT_SHARED_DESC( AssertTrue( aCondition ), KAssertFailedTrue, aDescription );
-
-#define STIF_ASSERT_FALSE( aCondition ) \
- __STIF_ASSERT_SHARED( !AssertTrue( aCondition ), KAssertFailedFalse );
-
-#define STIF_ASSERT_FALSE_DESC( aCondition, aDescription ) \
- __STIF_ASSERT_SHARED_DESC( !AssertTrue( aCondition), KAssertFailedFalse, aDescription );
-
-// Eclosing block is used to create the scope for the __leaveValue
-#define STIF_ASSERT_NOT_LEAVES( aStatement ) \
- { \
- TRAPD( __leaveValue, aStatement ); \
- __STIF_ASSERT_SHARED( AssertEquals( __leaveValue, KErrNone ), KAssertFailedNotLeaves ); \
- }
-
-#define STIF_ASSERT_NOT_LEAVES_DESC( aStatement, aDescription ) \
- { \
- TRAPD( __leaveValue, aStatement ); \
- __STIF_ASSERT_SHARED_DESC( AssertEquals( __leaveValue, KErrNone ), KAssertFailedNotLeaves, aDescription ); \
- }
-
-// Eclosing block is used to create the scope for the __leaveValue
-#define STIF_ASSERT_LEAVES( aStatement ) \
- { \
- TRAPD( __leaveValue, aStatement ); \
- __STIF_ASSERT_SHARED( !AssertEquals( __leaveValue, KErrNone ), KAssertFailedLeaves ); \
- }
-
-#define STIF_ASSERT_LEAVES_DESC( aStatement, aDescription ) \
- { \
- TRAPD( __leaveValue, aStatement ); \
- __STIF_ASSERT_SHARED_DESC( !AssertEquals( __leaveValue, KErrNone ), KAssertFailedLeaves, aDescription ); \
- }
-
-// Eclosing block is used to create the scope for the __leaveValue
-#define STIF_ASSERT_LEAVES_WITH( aLeaveCode, aStatement ) \
- { \
- TRAPD( __leaveValue, aStatement ); \
- __STIF_ASSERT_SHARED( AssertEquals( __leaveValue, aLeaveCode ), KAssertFailedLeaves ); \
- }
-
-#define STIF_ASSERT_LEAVES_WITH_DESC( aLeaveCode, aStatement, aDescription ) \
- { \
- TRAPD( __leaveValue, aStatement ); \
- __STIF_ASSERT_SHARED_DESC( AssertEquals( __leaveValue, aLeaveCode ), KAssertFailedLeaves, aDescription ); \
- }
-
-#define STIF_ASSERT_PANIC( aPanicCode, aStatement ) \
- { \
- TestModuleIf().SetExitReason( CTestModuleIf::EPanic, aPanicCode ); \
- aStatement; \
- }
-
-#define STIF_ASSERT_PANIC_DESC( aPanicCode, aStatement, aDescription ) \
- { \
- TestModuleIf().SetExitReason( CTestModuleIf::EPanic, aPanicCode ); \
- aResult.SetResult(KErrNone, aDescription); \
- aStatement; \
- }
-#include "sitfunitutils.inl"
-
-#endif
--- a/homescreensrv_plat/context_utility_api/tsrc/testbase/sitfunitutils.inl Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: inline functions for the STIFUnit utils
-*
-*/
-
-
-template <class T>
-inline TBool AssertEquals(const T& aExpected, const T& aActual)
-/**
- * AssertEquals
- *
- * @prototype
- * @test
- *
- * @param aExpected - Expected result
- * @param aActual - Actual result
- * @return - True if equal
- */
- {
- if( aExpected==aActual )
- {
- return ETrue;
- }
- return EFalse;
- }
-
-template <class T>
-inline TBool AssertNull(const T* aPtr)
-/**
- * AssertNull
- *
- * @prototype
- * @test
- *
- * @param aPtr - Pointer
- * @return - True if NULL
- */
- {
- if( aPtr==NULL )
- {
- return ETrue;
- }
- return EFalse;
- }
-
-template <class T>
-inline TBool AssertSame(const T* aExpectedPtr, const T* aActualPtr)
-/**
- * AssertSame
- *
- * @prototype
- * @test
- *
- * @param aExpectedPtr - Expected pointer
- * @param aActualPtr - Actual pointer
- * @return - True if equal
- */
- {
- if( aExpectedPtr==aActualPtr )
- {
- return ETrue;
- }
- return EFalse;
- }
-
-inline TBool AssertTrue(const TBool& aCondition)
-/**
- * AssertTrue
- *
- * @prototype
- * @test
- *
- * @param aCondition - Condition
- * @return - True if aCondition is true
- */
- {
- if( !aCondition )
- {
- return EFalse;
- }
- return ETrue;
- }
-
-// End of File
--- a/homescreensrv_plat/context_utility_api/ui_context_utility_api.metaxml Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-<?xml version="1.0" ?>
-<api id="7e268187c80d6b7d592393c2e770c2c3" dataversion="2.0">
- <name>UI Context Utility API</name>
- <description>Utility API for publishing context to the Context Framework</description>
- <type>c++</type>
- <collection>contextengine</collection>
- <libs>
- <lib name="hgcontextutility.lib" />
- </libs>
- <release category="platform" />
- <attributes>
- <!-- This indicates whether the api provedes separate html documentation -->
- <!-- or is the additional documentation generated from headers. -->
- <!-- If you are unsure then the value is "no" -->
- <htmldocprovided>no</htmldocprovided>
- <adaptation>no</adaptation>
- </attributes>
-</api>
--- a/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisher.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisher.h Wed Mar 31 22:04:35 2010 +0300
@@ -203,7 +203,8 @@
/**
* Method publishes the provided widget.
* Widget needs to be published in order for the content
- * to be seen by the HS.
+ * to be seen by the HS. For correct behaviour during publishing, events received
+ * from HS must be handled appropriately.
*
* @code
* HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver );
--- a/homescreensrv_plat/idlefw_api/inc/aifwstatehandler.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/idlefw_api/inc/aifwstatehandler.h Wed Mar 31 22:04:35 2010 +0300
@@ -67,15 +67,7 @@
* @param aState State to change
*/
virtual void ChangePluginState( TAiFwState aState ) = 0;
-
- /**
- * Queries whether online state is in use
- * by any of the currently loaded plugin.
- *
- * @since S60 5.2
- * @return ETrue if online/offline state needed, EFalse otherwise
- */
- virtual TBool OnlineStateInUse() const = 0;
+
};
#endif // M_AIFWSTATEHANDLER_H
--- a/homescreensrv_plat/sapi_contentpublishing/inc/cpclient.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_contentpublishing/inc/cpclient.h Wed Mar 31 22:04:35 2010 +0300
@@ -114,13 +114,21 @@
*
* @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier
* @param aInParamList input parameter list (filter)
- * @param aOutParamList output action_map
* @param aCmdOptions options for the command
*/
void ExecuteActionL( const CLiwGenericParamList& aInParamList,
TUint aCmdOptions );
/**
+ * Send command to server to ExecuteMultipleActions
+ *
+ * @param aInParamList input parameter list (filter)
+ * @param aCmdOptions options for the command
+ */
+ void ExecuteMultipleActionsL(
+ const CLiwGenericParamList& aInParamList, TUint aCmdOptions);
+
+ /**
* Check second param from IDataSource interface
*
* @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier
@@ -129,7 +137,15 @@
*/
void CheckMapL( const CLiwGenericParamList& aInParamList,
const TDesC8& aKey );
-
+
+ /**
+ * Check proper data is passed as parameter to ExecuteMultipleActions
+ *
+ * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier
+ * @param aList generic list containing input parameters
+ */
+ void CheckMultiExecuteInputParamsL(const CLiwGenericParamList& aList);
+
private:
/**
--- a/homescreensrv_plat/sapi_contentpublishing/inc/cpclientsession.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_contentpublishing/inc/cpclientsession.h Wed Mar 31 22:04:35 2010 +0300
@@ -118,6 +118,16 @@
void ExecuteActionL( const CCPLiwMap& aMap, TUint aOptions = 0 );
/**
+ * Pass ExecuteMultipleActionsL request to the server
+ *
+ * @since S60 v 5.0
+ * @param aList const reference to the input list
+ * @param aOptions Command options.
+ */
+ void ExecuteMultipleActionsL( const CLiwGenericParamList& aList,
+ TUint aOptions = 0 );
+
+ /**
* Pass GetChangeInfoData request to server
* @param aBuf reference to the input list
* @return error code
--- a/homescreensrv_plat/sapi_contentpublishing/src/ccontentpublishinginterface.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_contentpublishing/src/ccontentpublishinginterface.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -90,12 +90,16 @@
CP_DEBUG( _L8("CContentPublishingInterface::ProcessCommandL") );
if ( aCmdName.CompareF( KExecuteAction ) == 0 )
- {
- iCPClient->ExecuteActionL( aInParamList, aCmdOptions );
- }
- else
- {
- CDataSourceInterface::ProcessCommandL(aCmdName,
- aInParamList, aOutParamList, aCmdOptions, aCallback);
- }
+ {
+ iCPClient->ExecuteActionL( aInParamList, aCmdOptions );
+ }
+ else if ( aCmdName.CompareF( KExecuteMultipleActions ) == 0 )
+ {
+ iCPClient->ExecuteMultipleActionsL( aInParamList, aCmdOptions );
+ }
+ else
+ {
+ CDataSourceInterface::ProcessCommandL(aCmdName,
+ aInParamList, aOutParamList, aCmdOptions, aCallback);
+ }
}
--- a/homescreensrv_plat/sapi_contentpublishing/src/cpclient.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_contentpublishing/src/cpclient.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -96,6 +96,7 @@
CLiwGenericParamList& aOutParamList )
{
CP_DEBUG( _L8("CCPClient::GetListL()") );
+ CP_EXTENDED_DEBUG( "GetListL()" , aInParamList );
CheckMapL( aInParamList, KFilter );
CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList );
inMapForServer->PushL( );
@@ -113,6 +114,7 @@
TUint aCmdOptions )
{
CP_DEBUG( _L8("CCPClient::AddL()") );
+ CP_EXTENDED_DEBUG( "Add()" , aInParamList );
CheckMapL( aInParamList, KItem );
CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ) ;
inMapForServer->PushL( );
@@ -128,6 +130,7 @@
void CCPClient::DeleteL( const CLiwGenericParamList& aInParamList )
{
CP_DEBUG( _L8("CCPClient::DeleteL()") );
+ CP_EXTENDED_DEBUG( "Delete()" , aInParamList );
CheckMapL( aInParamList, KData );
CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList );
inMapForServer->PushL( );
@@ -144,6 +147,7 @@
const CLiwGenericParamList& aInParamList, TInt32 aTransactionId )
{
CP_DEBUG( _L8("CCPClient::RegisterObserverL()") );
+ CP_EXTENDED_DEBUG( "RegisterObserver()" , aInParamList );
CheckMapL( aInParamList, KFilter );
CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList );
inMapForServer->PushL( );
@@ -163,6 +167,7 @@
void CCPClient::UnregisterObserversL( const CLiwGenericParamList& aInParamList )
{
CP_DEBUG( _L8("CCPClient::UnregisterObservers()") );
+ CP_EXTENDED_DEBUG( "UnregisterObservers()" , aInParamList );
if ( !iActiveNotifier )
{
User::Leave( KErrNotFound );
@@ -198,7 +203,8 @@
void CCPClient::ExecuteActionL( const CLiwGenericParamList& aInParamList,
TUint aCmdOptions)
{
- CP_DEBUG( _L8("CCPClient::RegisterObserverL()") );
+ CP_DEBUG( _L8("CCPClient::ExecuteActionL()") );
+ CP_EXTENDED_DEBUG( "ExecuteAction()" , aInParamList );
CheckMapL( aInParamList, KFilter );
CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList );
inMapForServer->PushL( );
@@ -211,6 +217,19 @@
//
// -----------------------------------------------------------------------------
//
+void CCPClient::ExecuteMultipleActionsL(
+ const CLiwGenericParamList& aInParamList, TUint aCmdOptions)
+ {
+ CP_DEBUG( _L8("CCPClient::ExecuteMultipleActionsL()") );
+ CP_EXTENDED_DEBUG( "ExecuteMultipleActionsL()" , aInParamList );
+ CheckMultiExecuteInputParamsL(aInParamList);
+ iServerClient.ExecuteMultipleActionsL( aInParamList, aCmdOptions );
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
void CCPClient::CheckMapL( const CLiwGenericParamList& aInParamList,
const TDesC8& aKey )
{
@@ -225,3 +244,20 @@
}
}
}
+
+// -----------------------------------------------------------------------------
+//
+// --------------- --------------------------------------------------------------
+//
+void CCPClient::CheckMultiExecuteInputParamsL(
+ const CLiwGenericParamList& aList)
+ {
+ const TLiwGenericParam* param = NULL;
+ TInt pos(0);
+ param = aList.FindFirst(pos, KFilters);
+ User::LeaveIfError(pos); //leaves if not found
+ if (param->Value().TypeId() != LIW::EVariantTypeList)
+ {
+ User::Leave(KErrBadName);
+ }
+ }
--- a/homescreensrv_plat/sapi_contentpublishing/src/cpclientsession.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_contentpublishing/src/cpclientsession.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -161,6 +161,29 @@
//
// -----------------------------------------------------------------------------
//
+void RCPServerClient::ExecuteMultipleActionsL(
+ const CLiwGenericParamList& aList, TUint aOptions)
+ {
+ CP_DEBUG( _L8("RCPServerClient::ExecuteMultipleActionsL()") );
+ TIpcArgs args;
+ TInt size = aList.Size();
+ HBufC8* datadesc = HBufC8::NewLC( size );
+ TPtr8 ptr = datadesc->Des();
+ RDesWriteStream datastrm( ptr );
+ CleanupClosePushL(datastrm);
+ aList.ExternalizeL(datastrm);
+ datastrm.CommitL();
+ args.Set( KDescriptorPosition, &*datadesc );
+ args.Set( KOptionsPosition, static_cast<TInt>( aOptions ) );
+ User::LeaveIfError(SendReceive(ECpServerExecuteMultipleActions, args));
+ CleanupStack::PopAndDestroy(&datastrm);
+ CleanupStack::PopAndDestroy(datadesc);
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
void RCPServerClient::DeleteL( const CCPLiwMap& aMap )
{
CP_DEBUG( _L8("RCPServerClient::DeleteL()") );
--- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/bwins/hspsserviceu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/bwins/hspsserviceu.def Wed Mar 31 22:04:35 2010 +0300
@@ -1,25 +1,25 @@
EXPORTS
- ?GetPluginListL@CHspsPersonalisationService@@QAEXAAVTDesC8@@0KAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 1 NONAME ; void CHspsPersonalisationService::GetPluginListL(class TDesC8 &, class TDesC8 &, unsigned long, class CArrayPtrFlat<class ChspsODT> &)
+ ?RestoreConfigurationsL@CHspsPersonalisationService@@QAEXHH@Z @ 1 NONAME ; void CHspsPersonalisationService::RestoreConfigurationsL(int, int)
?GetODTL@CHspsConfigurationService@@QAEXH@Z @ 2 NONAME ; void CHspsConfigurationService::GetODTL(int)
?GetAppConfListL@CHspsPersonalisationService@@QAEXHKAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 3 NONAME ; void CHspsPersonalisationService::GetAppConfListL(int, unsigned long, class CArrayPtrFlat<class ChspsODT> &)
?SetConfStateL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@00@Z @ 4 NONAME ; void CHspsPersonalisationService::SetConfStateL(int, class TDesC8 &, class TDesC8 &, class TDesC8 &)
?InvalidateODT@CHspsConfigurationService@@QAEXXZ @ 5 NONAME ; void CHspsConfigurationService::InvalidateODT(void)
?RemovePluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 6 NONAME ; void CHspsPersonalisationService::RemovePluginL(int, class TDesC8 &)
?SetActiveAppConfL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 7 NONAME ; void CHspsPersonalisationService::SetActiveAppConfL(int, class TDesC8 &)
- ?RestoreActiveAppConfL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 8 NONAME ; void CHspsPersonalisationService::RestoreActiveAppConfL(int, class TDesC8 &)
- ?AddPluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@00AAH@Z @ 9 NONAME ; void CHspsPersonalisationService::AddPluginL(int, class TDesC8 &, class TDesC8 &, class TDesC8 &, int &)
- ?SetLogBus@CHspsConfigurationService@@QAEXPAVChspsLogBus@@@Z @ 10 NONAME ; void CHspsConfigurationService::SetLogBus(class ChspsLogBus *)
- ?GetAppUidL@CHspsConfigurationService@@QAEXAAH@Z @ 11 NONAME ; void CHspsConfigurationService::GetAppUidL(int &)
- ?MovePluginsL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@AAV?$CArrayFixFlat@H@@@Z @ 12 NONAME ; void CHspsPersonalisationService::MovePluginsL(int, class TDesC8 &, class CArrayFixFlat<int> &)
- ?RegisterObserverL@CHspsConfigurationService@@QAEHPAVCHspsReqNotifCallback@@@Z @ 13 NONAME ; int CHspsConfigurationService::RegisterObserverL(class CHspsReqNotifCallback *)
- ?GetDOML@CHspsConfigurationService@@QAEAAVChspsDomDocument@@XZ @ 14 NONAME ; class ChspsDomDocument & CHspsConfigurationService::GetDOML(void)
- ?NewL@CHspsConfigurationService@@SAPAV1@XZ @ 15 NONAME ; class CHspsConfigurationService * CHspsConfigurationService::NewL(void)
- ?NewL@CHspsPersonalisationService@@SAPAV1@XZ @ 16 NONAME ; class CHspsPersonalisationService * CHspsPersonalisationService::NewL(void)
- ?SetPluginSettingsL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@AAVChspsDomDocument@@H@Z @ 17 NONAME ; void CHspsPersonalisationService::SetPluginSettingsL(int, class TDesC8 &, class ChspsDomDocument &, int)
- ?GetFamilyL@CHspsConfigurationService@@QAEXAAK@Z @ 18 NONAME ; void CHspsConfigurationService::GetFamilyL(unsigned long &)
- ?ReplacePluginL@CHspsPersonalisationService@@QAEXHABVTDesC8@@0@Z @ 19 NONAME ; void CHspsPersonalisationService::ReplacePluginL(int, class TDesC8 const &, class TDesC8 const &)
- ?GetPluginOdtL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@PAVChspsODT@@@Z @ 20 NONAME ; void CHspsPersonalisationService::GetPluginOdtL(int, class TDesC8 &, class ChspsODT *)
- ?SetActivePluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 21 NONAME ; void CHspsPersonalisationService::SetActivePluginL(int, class TDesC8 &)
- ?UnRegisterObserverL@CHspsConfigurationService@@QAEXXZ @ 22 NONAME ; void CHspsConfigurationService::UnRegisterObserverL(void)
- ?RestoreConfigurationsL@CHspsPersonalisationService@@QAEXHH@Z @ 23 NONAME ; void CHspsPersonalisationService::RestoreConfigurationsL(int, int)
+ ?GetPluginListL@CHspsPersonalisationService@@QAEXAAVTDesC8@@0KHAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 8 NONAME ; void CHspsPersonalisationService::GetPluginListL(class TDesC8 &, class TDesC8 &, unsigned long, int, class CArrayPtrFlat<class ChspsODT> &)
+ ?RestoreActiveAppConfL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 9 NONAME ; void CHspsPersonalisationService::RestoreActiveAppConfL(int, class TDesC8 &)
+ ?AddPluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@00AAH@Z @ 10 NONAME ; void CHspsPersonalisationService::AddPluginL(int, class TDesC8 &, class TDesC8 &, class TDesC8 &, int &)
+ ?SetLogBus@CHspsConfigurationService@@QAEXPAVChspsLogBus@@@Z @ 11 NONAME ; void CHspsConfigurationService::SetLogBus(class ChspsLogBus *)
+ ?GetAppUidL@CHspsConfigurationService@@QAEXAAH@Z @ 12 NONAME ; void CHspsConfigurationService::GetAppUidL(int &)
+ ?MovePluginsL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@AAV?$CArrayFixFlat@H@@@Z @ 13 NONAME ; void CHspsPersonalisationService::MovePluginsL(int, class TDesC8 &, class CArrayFixFlat<int> &)
+ ?RegisterObserverL@CHspsConfigurationService@@QAEHPAVCHspsReqNotifCallback@@@Z @ 14 NONAME ; int CHspsConfigurationService::RegisterObserverL(class CHspsReqNotifCallback *)
+ ?GetDOML@CHspsConfigurationService@@QAEAAVChspsDomDocument@@XZ @ 15 NONAME ; class ChspsDomDocument & CHspsConfigurationService::GetDOML(void)
+ ?NewL@CHspsConfigurationService@@SAPAV1@XZ @ 16 NONAME ; class CHspsConfigurationService * CHspsConfigurationService::NewL(void)
+ ?NewL@CHspsPersonalisationService@@SAPAV1@XZ @ 17 NONAME ; class CHspsPersonalisationService * CHspsPersonalisationService::NewL(void)
+ ?SetPluginSettingsL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@AAVChspsDomDocument@@H@Z @ 18 NONAME ; void CHspsPersonalisationService::SetPluginSettingsL(int, class TDesC8 &, class ChspsDomDocument &, int)
+ ?GetFamilyL@CHspsConfigurationService@@QAEXAAK@Z @ 19 NONAME ; void CHspsConfigurationService::GetFamilyL(unsigned long &)
+ ?ReplacePluginL@CHspsPersonalisationService@@QAEXHABVTDesC8@@0@Z @ 20 NONAME ; void CHspsPersonalisationService::ReplacePluginL(int, class TDesC8 const &, class TDesC8 const &)
+ ?GetPluginOdtL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@PAVChspsODT@@@Z @ 21 NONAME ; void CHspsPersonalisationService::GetPluginOdtL(int, class TDesC8 &, class ChspsODT *)
+ ?SetActivePluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 22 NONAME ; void CHspsPersonalisationService::SetActivePluginL(int, class TDesC8 &)
+ ?UnRegisterObserverL@CHspsConfigurationService@@QAEXXZ @ 23 NONAME ; void CHspsConfigurationService::UnRegisterObserverL(void)
--- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/eabi/hspsserviceu.def Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/eabi/hspsserviceu.def Wed Mar 31 22:04:35 2010 +0300
@@ -13,17 +13,17 @@
_ZN27CHspsPersonalisationService13GetPluginOdtLEiR6TDesC8P8ChspsODT @ 12 NONAME
_ZN27CHspsPersonalisationService13RemovePluginLEiR6TDesC8 @ 13 NONAME
_ZN27CHspsPersonalisationService13SetConfStateLEiR6TDesC8S1_S1_ @ 14 NONAME
- _ZN27CHspsPersonalisationService14GetPluginListLER6TDesC8S1_mR13CArrayPtrFlatI8ChspsODTE @ 15 NONAME
+ _ZN27CHspsPersonalisationService14GetPluginListLER6TDesC8S1_miR13CArrayPtrFlatI8ChspsODTE @ 15 NONAME
_ZN27CHspsPersonalisationService14ReplacePluginLEiRK6TDesC8S2_ @ 16 NONAME
_ZN27CHspsPersonalisationService15GetAppConfListLEimR13CArrayPtrFlatI8ChspsODTE @ 17 NONAME
_ZN27CHspsPersonalisationService16SetActivePluginLEiR6TDesC8 @ 18 NONAME
_ZN27CHspsPersonalisationService17SetActiveAppConfLEiR6TDesC8 @ 19 NONAME
_ZN27CHspsPersonalisationService18SetPluginSettingsLEiR6TDesC8R16ChspsDomDocumenti @ 20 NONAME
_ZN27CHspsPersonalisationService21RestoreActiveAppConfLEiR6TDesC8 @ 21 NONAME
- _ZN27CHspsPersonalisationService4NewLEv @ 22 NONAME
- _ZTI25CHspsConfigurationService @ 23 NONAME
- _ZTI27CHspsPersonalisationService @ 24 NONAME
- _ZTV25CHspsConfigurationService @ 25 NONAME
- _ZTV27CHspsPersonalisationService @ 26 NONAME
- _ZN27CHspsPersonalisationService22RestoreConfigurationsLEii @ 27 NONAME
+ _ZN27CHspsPersonalisationService22RestoreConfigurationsLEii @ 22 NONAME
+ _ZN27CHspsPersonalisationService4NewLEv @ 23 NONAME
+ _ZTI25CHspsConfigurationService @ 24 NONAME
+ _ZTI27CHspsPersonalisationService @ 25 NONAME
+ _ZTV25CHspsConfigurationService @ 26 NONAME
+ _ZTV27CHspsPersonalisationService @ 27 NONAME
--- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspspersonalisationservice.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspspersonalisationservice.h Wed Mar 31 22:04:35 2010 +0300
@@ -87,12 +87,14 @@
* @param aInterface Interface of the requested plugins.
* @param aType Type of the requested plugins.
* @param aFamily Requested plugin configuration family
+ * @param aCopyLogos Controls whether to copy logos to client's private folder
* @param aList List of plugins ODT headers.
*/
IMPORT_C void GetPluginListL(
TDesC8& aInterface,
TDesC8& aType,
TUint32 aFamily,
+ const TBool aCopyLogos,
CArrayPtrFlat<ChspsODT>& aList
);
--- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspspersonalisationservice.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspspersonalisationservice.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -76,6 +76,7 @@
TDesC8& aInterface,
TDesC8& aType,
TUint32 aFamily,
+ const TBool aCopyLogos,
CArrayPtrFlat<ChspsODT>& aList )
{
// Setup a mask for finding plugins with defined interface
@@ -96,6 +97,7 @@
TInt err = iHspsClient->hspsGetHeaders(
*searchMask,
+ aCopyLogos,
aList );
CleanupStack::PopAndDestroy( searchMask );
@@ -270,6 +272,7 @@
// Get application configurations
User::LeaveIfError( iHspsClient->hspsGetHeaders(
*searchMask,
+ EFalse,
aList ) );
CleanupStack::PopAndDestroy( searchMask );
--- a/homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwvocabulary.hrh Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwvocabulary.hrh Wed Mar 31 22:04:35 2010 +0300
@@ -87,6 +87,7 @@
_LIT8( KHspsLiwNotification, "notification" );
_LIT8( KHspsLiwId, "id" );
_LIT8( KHspsLiwType, "type" );
+_LIT8( KHspsLiwCopyLogos, "copylogos" );
_LIT8( KHspsLiwInterface, "interface" );
_LIT8( KHspsLiwUid, "uid" );
_LIT8( KHspsLiwName, "name" );
--- a/homescreensrv_plat/sapi_homescreenplugin/src/hspsconfigurationif.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/src/hspsconfigurationif.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -424,8 +424,9 @@
TInt pos;
TPtrC8 interface;
TPtrC8 type;
+ TBool copyLogos = EFalse;
const TLiwGenericParam* inParam;
- TLiwVariant inParamVariant;
+ TLiwVariant inParamVariant;
// Get interface parameter (mandatory)
pos = 0;
@@ -433,43 +434,58 @@
pos,
KHspsLiwInterface );
- if( inParam )
- {
- inParamVariant = inParam->Value();
- interface.Set( inParamVariant.AsData() );
-
- // Get type parameter (optional)
- pos = 0;
- inParam = aInParamList.FindFirst(
- pos,
- KHspsLiwType );
- if ( inParam )
- {
- inParamVariant = inParam->Value();
- type.Set( inParamVariant.AsData() );
- }
-
- // Get headers list of defined interface
- TUint32 family;
- iHspsConfigurationService->GetFamilyL( family );
- CArrayPtrFlat<ChspsODT>* list =
- new ( ELeave )CArrayPtrFlat<ChspsODT>( KHeaderListGranularity );
- CleanupStack::PushL( TCleanupItem( DeleteArrayItems, list ) );
- iHspsPersonalisationService->GetPluginListL(
- interface,
- type,
- family,
- *list );
-
- // Create GetPlugins output parameters
- CHspsLiwUtilities::GetPluginsOutputL( *list, aOutParamList );
- CleanupStack::PopAndDestroy( list );
- }
- else
+ if( !inParam )
{
// Invalid method call
User::Leave( KErrArgument );
}
+
+ inParamVariant = inParam->Value();
+ interface.Set( inParamVariant.AsData() );
+
+ // Get type parameter (optional)
+ pos = 0;
+ inParam = aInParamList.FindFirst(
+ pos,
+ KHspsLiwType );
+ if ( inParam )
+ {
+ inParamVariant = inParam->Value();
+ type.Set( inParamVariant.AsData() );
+ }
+
+ // Get copylogos parameter (optional)
+ pos = 0;
+ inParam = aInParamList.FindFirst(
+ pos,
+ KHspsLiwCopyLogos );
+ if ( inParam )
+ {
+ inParamVariant = inParam->Value();
+ copyLogos = inParamVariant.AsTBool();
+ }
+
+ // Get headers list of defined interface
+ TUint32 family;
+ iHspsConfigurationService->GetFamilyL( family );
+
+ CArrayPtrFlat<ChspsODT>* list =
+ new ( ELeave )CArrayPtrFlat<ChspsODT>( KHeaderListGranularity );
+ CleanupStack::PushL( TCleanupItem( DeleteArrayItems, list ) );
+
+ // Get headers list of defined interface
+ iHspsPersonalisationService->GetPluginListL(
+ interface,
+ type,
+ family,
+ copyLogos,
+ *list );
+
+ // Create GetPlugins output parameters
+ CHspsLiwUtilities::GetPluginsOutputL( *list, aOutParamList );
+
+ CleanupStack::PopAndDestroy( list );
+
}
// -----------------------------------------------------------------------------
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hsps.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hsps.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -555,9 +555,9 @@
TInt err = testThread.Create(
_L( "TestStep" ),
HSPSTestStepThread,
- 0x5000, // 20kB
- KDefaultHeapSize,
- KDefaultHeapSize,
+ 0xA000, // 40kB
+ KDefaultHeapSize * 2, // 2 times of base size
+ KDefaultHeapSize * 8, // 8 times of base size - needed by Eunit
( TAny* )&data,
EOwnerProcess );
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_armv5.pkg Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_armv5.pkg Wed Mar 31 22:04:35 2010 +0300
@@ -108,6 +108,7 @@
"../testthemes/finnish_widget/manifest.dat"-"c:/data/mt_hsps/finnish_widget/manifest.dat"
"../testthemes/finnish_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/finnish_widget/widgetconfiguration.xml"
"../testthemes/finnish_widget/common.jpg"-"c:/data/mt_hsps/finnish_widget/common.jpg"
+"../testthemes/finnish_widget/dummy.mif"-"c:/data/mt_hsps/finnish_widget/dummy.mif"
"../testthemes/finnish_widget/0/locale.dtd"-"c:/data/mt_hsps/finnish_widget/0/locale.dtd"
"../testthemes/finnish_widget/9/locale.dtd"-"c:/data/mt_hsps/finnish_widget/9/locale.dtd"
"../testthemes/finnish_widget/0/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/0/localizedbg.jpg"
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_winscw.pkg Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_winscw.pkg Wed Mar 31 22:04:35 2010 +0300
@@ -108,6 +108,7 @@
"../testthemes/finnish_widget/manifest.dat"-"c:/data/mt_hsps/finnish_widget/manifest.dat"
"../testthemes/finnish_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/finnish_widget/widgetconfiguration.xml"
"../testthemes/finnish_widget/common.jpg"-"c:/data/mt_hsps/finnish_widget/common.jpg"
+"../testthemes/finnish_widget/dummy.mif"-"c:/data/mt_hsps/finnish_widget/dummy.mif"
"../testthemes/finnish_widget/0/locale.dtd"-"c:/data/mt_hsps/finnish_widget/0/locale.dtd"
"../testthemes/finnish_widget/9/locale.dtd"-"c:/data/mt_hsps/finnish_widget/9/locale.dtd"
"../testthemes/finnish_widget/0/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/0/localizedbg.jpg"
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_9.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_9.h Wed Mar 31 22:04:35 2010 +0300
@@ -510,7 +510,117 @@
// - Version 1.0
// - Item count (LE)
10,
-2,0,0,0,
+3,0,0,0,
+// - pluginConf::resources
+// - Version 1.0
+// - List item starts
+10,
+0,0,0,0,
+// - object[0]
+// - Version 1.0
+// - Variant value type, EVariantTypeMap
+10,
+8,
+// - object[0] map
+// - Version 1.0
+// - Item count (LE)
+10,
+4,0,0,0,
+// - object[0]::name
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'n','a','m','e',
+// - object[0]::name
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+9,0,0,0,
+38,
+'d','u','m','m','y','.','m','i','f',
+// - object[0]::path
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'p','a','t','h',
+// - object[0]::path
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+37,0,0,0,
+150,
+'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','4','\\','1','.','0','\\','s','o','u','r','c','e','s','\\',
+// - object[0]::mediatype
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+9,0,0,0,
+38,
+'m','e','d','i','a','t','y','p','e',
+// - object[0]::mediatype
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+0,0,0,0,
+2,
+// - Object[0]::tag
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+3,0,0,0,
+14,
+'t','a','g',
+// - Object[0]::tag
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+4,0,0,0,
+18,
+'l','o','g','o',
// - pluginConf::resources
// - Version 1.0
// - List item starts
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_1.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_1.h Wed Mar 31 22:04:35 2010 +0300
@@ -128,7 +128,7 @@
// - Version 1.0
// - Item count (LE)
10,
-6,0,0,0,
+7,0,0,0,
// - plugins[0]::uid
// - Variant name
// - Version 1.0
@@ -272,6 +272,30 @@
5,
0,0,0,0,
2,
+// - plugins[0]::logo
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'l','o','g','o',
+// - plugins[0]::logo
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+55,0,0,0,
+222,
+'m','i','f','(','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','4','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')',
// GetPlugins(Output)::plugins
// - Version 1.0
// - List item starts
@@ -452,10 +476,9 @@
// - Variant value
10,
5,
-75,0,0,0,
-93,
-2,
-'m','i','f','(','c',':','\\','p','r','i','v','a','t','e','\\','2','0','0','0','0','F','B','1','\\','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')',
+55,0,0,0,
+222,
+'m','i','f','(','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')',
// GetPlugins(Output)::plugins
// - Version 1.0
// - List item starts
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_3.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_3.h Wed Mar 31 22:04:35 2010 +0300
@@ -321,10 +321,9 @@
// - Variant value
10,
5,
-75,0,0,0,
-93,
-2,
-'m','i','f','(','c',':','\\','p','r','i','v','a','t','e','\\','2','0','0','0','0','F','B','1','\\','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')',
+55,0,0,0,
+222,
+'m','i','f','(','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')',
// GetPlugins(Output)::plugins
// - Version 1.0
// - List item starts
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_4.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_4.h Wed Mar 31 22:04:35 2010 +0300
@@ -150,7 +150,7 @@
// - Version 1.0
// - Item count (LE)
10,
-6,0,0,0,
+7,0,0,0,
// - plugins[0]::uid
// - Variant name
// - Version 1.0
@@ -294,6 +294,30 @@
5,
0,0,0,0,
2,
+// - object[0]::path
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'l','o','g','o',
+// - object[0]::path
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+55,0,0,0,
+222,
+'m','i','f','(','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','4','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')',
// GetPlugins(Output)::plugins
// - Version 1.0
// - List item starts
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_8.h Wed Mar 31 22:04:35 2010 +0300
@@ -0,0 +1,658 @@
+/*
+* 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: Test case GetPlugins(8) test data
+*
+*/
+
+
+#ifndef C_MT_HSPS_GETPLUGINS_8_H
+#define C_MT_HSPS_GETPLUGINS_8_H
+
+/*
+GetPlugins(8)
+----------------
+
+Test purpose
+Verify that logo files are copied to client’s private folder.
+
+Pre-conditions
+There must be installed test themes for Active Idle application and Operator configuration must be set as active
+
+Test steps
+Test step 1:
+• Input:
+ GetPlugins(“0x0998”, “widget”,“True” )
+• Expected output
+ Plugin list holding the widget configurations, logo files should exist in the target directory
+*/
+
+// Test step 1 method:
+
+const TUint8 getplugins_8_ts_1_method[] = "GetPlugins";
+
+// Test step 1 input:
+
+const TUint8 getplugins_8_ts_1_input[] = {
+// GetPlugins(Input)
+// - Version 1.0
+// - Item count (LE)
+10,
+3,0,0,0,
+// - GetPlugins(Input)::interface
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+9,0,0,0,
+38,
+'i','n','t','e','r','f','a','c','e',
+// - GetPlugins(Input)::interface
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+5,0,0,0,
+22,
+'0','x','9','9','8',
+// - GetPlugins(Input)::type
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'t','y','p','e',
+// - GetPlugins(Input)::type
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+6,0,0,0,
+26,
+'w','i','d','g','e','t',
+// - GetPlugins(Input)::copylogos
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+9,0,0,0,
+38,
+'c','o','p','y','l','o','g','o','s',
+// - GetPlugins(Input)::copylogos
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeTBool
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+11,
+1,0,0,0,
+6,
+'1'
+};
+
+// Test step 1 output:
+
+const TUint8 getplugins_8_ts_1_output[] = {
+// GetPluginConf(Output)
+// - Version 1.0
+// - Item count (LE)
+10,
+1,0,0,0,
+// GetPlugins(Output)::plugins
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+7,0,0,0,
+30,
+'p','l','u','g','i','n','s',
+// GetPlugins(Output)::plugins
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeList
+10,
+7,
+// GetPlugins(Output)::plugins
+// - Version 1.0
+// - Item count (LE)
+10,
+3,0,0,0,
+// GetPlugins(Output)::plugins
+// - Version 1.0
+// - List item starts
+10,
+0,0,0,0,
+// - plugins[0]
+// - Version 1.0
+// - Variant value type, EVariantTypeMap
+10,
+8,
+// - plugins[0] map
+// - Version 1.0
+// - Item count (LE)
+10,
+7,0,0,0,
+// - plugins[0]::uid
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+3,0,0,0,
+14,
+'u','i','d',
+// - plugins[0]::uid
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+10,0,0,0,
+42,
+'0','x','2','0','0','0','b','1','3','2',
+// - plugins[0]::interface
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+9,0,0,0,
+38,
+'i','n','t','e','r','f','a','c','e',
+// - plugins[0]::interface
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+5,0,0,0,
+22,
+'0','x','9','9','8',
+// - plugins[0]::type
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'t','y','p','e',
+// - plugins[0]::type
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+6,0,0,0,
+26,
+'w','i','d','g','e','t',
+// - plugins[0]::name
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'n','a','m','e',
+// - plugins[0]::name
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+16,0,0,0,
+66,
+'F','i','n','n','i','s','h',' ','-',' ','W','i','d','g','e','t',
+// - plugins[0]::multiinstance
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+13,0,0,0,
+54,
+'m','u','l','t','i','i','n','s','t','a','n','c','e',
+// - plugins[0]::multiinstance
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+1,0,0,0,
+6,
+'1',
+// - plugins[0]::description
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'d','e','s','c',
+// - plugins[0]::description
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+0,0,0,0,
+2,
+// - plugins[0]::logo
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'l','o','g','o',
+// - plugins[0]::logo
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+75,0,0,0,
+93,
+2,
+'m','i','f','(','c',':','\\','p','r','i','v','a','t','e','\\','2','0','0','0','0','F','B','1','\\','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','4','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')',
+// GetPlugins(Output)::plugins
+// - Version 1.0
+// - List item starts
+10,
+0,0,0,0,
+// - plugins[1]
+// - Version 1.0
+// - Variant value type, EVariantTypeMap
+10,
+8,
+// - plugins[1] map
+// - Version 1.0
+// - Item count (LE)
+10,
+6,0,0,0,
+// - plugins[1]::uid
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+3,0,0,0,
+14,
+'u','i','d',
+// - plugins[1]::uid
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+10,0,0,0,
+42,
+'0','x','2','0','0','0','b','1','2','0',
+// - plugins[1]::interface
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+9,0,0,0,
+38,
+'i','n','t','e','r','f','a','c','e',
+// - plugins[1]::interface
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+5,0,0,0,
+22,
+'0','x','9','9','8',
+// - plugins[1]::type
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'t','y','p','e',
+// - plugins[1]::type
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+6,0,0,0,
+26,
+'w','i','d','g','e','t',
+// - plugins[1]::name
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'n','a','m','e',
+// - plugins[1]::name
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+16,0,0,0,
+66,
+'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t',
+// - plugins[1]::multiinstance
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+13,0,0,0,
+54,
+'m','u','l','t','i','i','n','s','t','a','n','c','e',
+// - plugins[1]::multiinstance
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+1,0,0,0,
+6,
+'1',
+// - plugins[1]::description
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'d','e','s','c',
+// - plugins[1]::description
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+0,0,0,0,
+2,
+// GetPlugins(Output)::plugins
+// - Version 1.0
+// - List item starts
+10,
+0,0,0,0,
+// - plugins[2]
+// - Version 1.0
+// - Variant value type, EVariantTypeMap
+10,
+8,
+// - plugins[2] map
+// - Version 1.0
+// - Item count (LE)
+10,
+6,0,0,0,
+// - plugins[2]::uid
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+3,0,0,0,
+14,
+'u','i','d',
+// - plugins[2]::uid
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+10,0,0,0,
+42,
+'0','x','2','0','0','0','b','1','0','2',
+// - plugins[2]::interface
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+9,0,0,0,
+38,
+'i','n','t','e','r','f','a','c','e',
+// - plugins[2]::interface
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+5,0,0,0,
+22,
+'0','x','9','9','8',
+// - plugins[2]::type
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'t','y','p','e',
+// - plugins[2]::type
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+6,0,0,0,
+26,
+'w','i','d','g','e','t',
+// - plugins[2]::name
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'n','a','m','e',
+// - plugins[2]::name
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+14,0,0,0,
+58,
+'W','i','d','g','e','t',' ','C','o','n','f',' ','#','1',
+// - plugins[2]::multiinstance
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+13,0,0,0,
+54,
+'m','u','l','t','i','i','n','s','t','a','n','c','e',
+// - plugins[2]::multiinstance
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+1,0,0,0,
+6,
+'1',
+// - plugins[2]::description
+// - Variant name
+// - Version 1.0
+// - Semantic ID (LE)
+// - Variant name length (LE)
+// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 )
+// - Variant name
+10,
+12,0,0,0,
+4,0,0,0,
+18,
+'d','e','s','c',
+// - plugins[2]::description
+// - Variant value
+// - Version 1.0
+// - Variant value type, EVariantTypeDesC
+// - Variant value length (LE)
+// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 )
+// - Variant value
+10,
+5,
+0,0,0,0,
+2
+};
+
+#endif // C_MT_HSPS_GETPLUGINS_8_H
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h Wed Mar 31 22:04:35 2010 +0300
@@ -154,6 +154,11 @@
*/
void GetPlugins_7_L();
/**
+ * Test case function for test case GetPlugins(8)
+ * See HSPS module test specification
+ */
+ void GetPlugins_8_L();
+ /**
* Test case function for test case GetPluginList(1)
* See HSPS module test specification
*/
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -47,6 +47,7 @@
#include "mt_hsps_getplugins_5.h"
#include "mt_hsps_getplugins_6.h"
#include "mt_hsps_getplugins_7.h"
+#include "mt_hsps_getplugins_8.h"
// get plugin list
#include "mt_hsps_getpluginlist_1.h"
#include "mt_hsps_getpluginlist_2.h"
@@ -129,6 +130,7 @@
_LIT( KMinimalResourceFile2, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\viewnavigationrules.xml" );
_LIT( KMinimalResourceFile3, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\resource.file" );
_LIT( KMinimalResourceFile4, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\picture.jpeg" );
+_LIT( KFinnishMifLogo, "c:\\private\\20000fb1\\2456\\270513751\\536916274\\1.0\\sources\\dummy.mif" );
// ======== LOCAL FUNCTIONS ====================================================
@@ -816,8 +818,38 @@
( TUint8* )getplugins_7_ts_1_input,
( TUint8* )getplugins_7_ts_1_output );
EUNIT_PRINT( _L8( "Test step passed" ) );
- }
-
+ }
+
+//------------------------------------------------------------------------------
+// Test case: GetPlugins(8)
+//------------------------------------------------------------------------------
+void MT_CHSPSConfigurationIf::GetPlugins_8_L()
+ {
+ // Pre conditions
+ // Set active configuration to Minimal configuration
+ EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Operator" ) );
+ SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfOperator );
+ // Attach to HSPS
+ EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) );
+ AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid );
+
+ // Test step 1: fetch widget plugins and copy logos files
+ EUNIT_PRINT( _L8( "Test step 1" ) );
+ RunTestStepSyncL(
+ ( TUint8* )getplugins_8_ts_1_method,
+ ( TUint8* )getplugins_8_ts_1_input,
+ ( TUint8* )getplugins_8_ts_1_output );
+
+ EUNIT_PRINT( _L8( "post condition check for resource file copy" ) );
+ ResetResources();
+ // Check that the logo file was copied
+ AddResourceL( KFinnishMifLogo, 4608 );
+ CheckResourcesL();
+ EUNIT_PRINT( _L8( "post condition check for resource copy passed" ) );
+
+ EUNIT_PRINT( _L8( "Test step passed" ) );
+ }
+
//------------------------------------------------------------------------------
// Test case: GetPluginList(1)
//------------------------------------------------------------------------------
@@ -2651,11 +2683,20 @@
CFileMan::EOverWrite ) );
// Wait until configuration is installed
- User::After( 5000000 );
+ User::After( 8000000 );
// Make sure "InstalledWidget" is installed
if ( !BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) )
{
+ // Installation failed - remove imports to be able to re-run the test again
+ // The ChspsThemeServer::HandleConfigurationImportsL does handle newly
+ // added files only
+ User::LeaveIfError( fileManager->RmDir( _L( "c:\\private\\200159c0\\import\\0998\\" ) ) );
+ fileManager->Attribs( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133.dat" ),
+ 0, KEntryAttReadOnly, TTime( 0 ) ); // TTime(0) = preserve original time stamp.
+ User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) );
+
+ // Leave - the test was not successfull
User::Leave( KErrGeneral );
}
@@ -2673,7 +2714,7 @@
User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) );
// Removing of *.dat file causes configuration uninstallation
// Wait until configuration is uninstalled
- User::After( 5000000 );
+ User::After( 8000000 );
// Make sure "InstalledWidget" is uninstalled
if ( BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) )
@@ -3172,6 +3213,13 @@
SetupL, GetPlugins_7_L, Teardown )
EUNIT_TEST(
+ "GetPlugins(8)",
+ "IConfiguration",
+ "GetPlugins",
+ "FUNCTIONALITY",
+ SetupL, GetPlugins_8_L, Teardown )
+
+ EUNIT_TEST(
"GetPluginList(1)",
"IConfiguration",
"GetPluginList",
Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/dummy.mif has changed
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,9 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
<!-- application|view|widget|template -->
<type>widget</type>
@@ -20,6 +24,8 @@
<shortname>FinnishWidget</shortname>
<version>1.0</version>
+ <filelogo>mif(dummy.mif 1 2)</filelogo>
+
<!-- Configuration -->
<filexml>widgetconfiguration.xml</filexml>
@@ -34,4 +40,4 @@
<fileresource>localizedbg.jpg</fileresource>
</localization>
-</package>
\ No newline at end of file
+</package>
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,6 +1,10 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
+
<!-- application|view|widget|template -->
<type>widget</type>
@@ -32,4 +36,4 @@
<fileresource>widget.bmp</fileresource>
</localization>
-</package>
\ No newline at end of file
+</package>
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,6 +1,10 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
+
<!-- application|view|widget|template -->
<type>widget</type>
@@ -32,4 +36,4 @@
<fileresource>widget.bmp</fileresource>
</localization>
-</package>
\ No newline at end of file
+</package>
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/root/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/root/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,9 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
<!-- application|view|widget|template -->
<type>application</type>
@@ -31,4 +35,4 @@
<!-- Locale specific resources -->
-</package>
\ No newline at end of file
+</package>
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,6 +1,10 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
+
<type>view</type>
<!-- Interface UID -->
@@ -31,4 +35,4 @@
<fileresource mediatype="mime_type">resource.file</fileresource>
<fileresource mediatype="mime_type">picture.jpeg</fileresource>
-</package>
\ No newline at end of file
+</package>
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/widget/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/widget/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,9 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
<type>widget</type>
@@ -27,4 +31,4 @@
<!-- Locale independent/common resources -->
-</package>
\ No newline at end of file
+</package>
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/root/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/root/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,9 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
<!-- application|view|widget|template -->
<type>application</type>
@@ -32,4 +36,4 @@
<!-- Locale specific resources -->
-</package>
\ No newline at end of file
+</package>
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,9 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
<type>view</type>
@@ -27,4 +31,4 @@
<!-- Name of the localization files -->
<filedtd>locale.dtd</filedtd>
-</package>
\ No newline at end of file
+</package>
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,9 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
<!-- application|view|widget|template -->
<type>application</type>
@@ -33,4 +37,4 @@
<!-- Locale specific resources -->
<localization/>
-</package>
\ No newline at end of file
+</package>
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,9 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
<!-- application|view|widget|template -->
<type>view</type>
@@ -34,4 +38,4 @@
<fileresource mediatype="mime_type">hs_logoz.jpg</fileresource>
</localization>
-</package>
\ No newline at end of file
+</package>
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,9 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
<!-- application|view|widget|template -->
<type>view</type>
@@ -30,4 +34,4 @@
<fileresource mediatype="mime_type">view2.bmp</fileresource>
-</package>
\ No newline at end of file
+</package>
--- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/manifest.dat Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/manifest.dat Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,9 @@
<?xml version="1.0"?>
-<package version="0.3">
+<package version="2.0">
+
+ <!-- Set both two families for unit tests -->
+ <family>qhd_tch</family>
+ <family>vga_tch</family>
<!-- application|view|widget|template -->
<type>widget</type>
@@ -32,4 +36,4 @@
<!-- Locale specific resources -->
-</package>
\ No newline at end of file
+</package>
--- a/idlefw/group/aifw.mmp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/group/aifw.mmp Wed Mar 31 22:04:35 2010 +0300
@@ -34,6 +34,8 @@
SOURCE aistatemanager.cpp
SOURCE aistateprovider.cpp
SOURCE aiecomobserver.cpp
+SOURCE aicpscommandbuffer.cpp
+SOURCE aicpsexecuteparam.cpp
// Active Idle Framework shared sources
SOURCEPATH ../src/common
@@ -53,6 +55,8 @@
LIBRARY apparc.lib apgrfx.lib
LIBRARY ws32.lib cone.lib commonengine.lib
LIBRARY cenrepnotifhandler.lib
+LIBRARY liwServiceHandler.lib
+LIBRARY swiutils.lib
// S60 Dependencies
LIBRARY avkon.lib
@@ -70,3 +74,4 @@
LIBRARY flogger.lib
DEFFILE aifwu.def
+
--- a/idlefw/group/aiutils.mmp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/group/aiutils.mmp Wed Mar 31 22:04:35 2010 +0300
@@ -17,7 +17,6 @@
#include <platform_paths.hrh>
#include <data_caging_paths.hrh>
-//#include <platform/mw/aisystemuids.hrh>
TARGET aiutils.dll
TARGETTYPE dll
@@ -26,11 +25,11 @@
CAPABILITY CAP_GENERAL_DLL
SOURCEPATH ../src/utility
-SOURCE aiutility.cpp
-SOURCE caipspropertyobserver.cpp
-SOURCE caistrparser.cpp
-SOURCE caiplugintool.cpp
-SOURCE caicontentitemarrayiterator.cpp
+SOURCE aiutility.cpp
+SOURCE caipspropertyobserver.cpp
+SOURCE caistrparser.cpp
+SOURCE caiplugintool.cpp
+SOURCE caicontentitemarrayiterator.cpp
SOURCE contentprioritymap.cpp
SOURCE aipluginsettingsimpl.cpp
@@ -40,5 +39,5 @@
MW_LAYER_SYSTEMINCLUDE
LIBRARY euser.lib
-LIBRARY charconv.lib
+LIBRARY charconv.lib
--- a/idlefw/hslaunch/src/hslaunch.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/hslaunch/src/hslaunch.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -16,6 +16,7 @@
*/
#include <e32property.h>
+#include <e32debug.h>
#include "hslaunch.h"
// ========================= DECLARATIONS ==================================
@@ -260,36 +261,36 @@
// -----------------------------------------------------------------------------
//
void CHsLaunch::ProcessEnded( const TExitType& aExitType,
- const TInt /*aExitReason*/,
+ const TInt aExitReason,
const TExitCategoryName& /*aExitCategory*/ )
{
- // Only respond to panic. EExitTerminate and EExitKill are ignored.
- if( aExitType != EExitPanic )
- {
- return;
- }
-
TInt crashCount = 0;
TInt error = RProperty::Get( KPSCategoryUid,
KPSCrashCountKey,
crashCount );
- if( error == KErrNone )
+ // increment crash count in cenrep if the process has panic'd or killed with
+ // an error code
+ if( aExitType == EExitPanic ||
+ ( aExitType == EExitKill && aExitReason != KErrNone ) )
{
- crashCount++;
- error = RProperty::Set( KPSCategoryUid,
- KPSCrashCountKey,
- crashCount );
- }
-
- if( error == KErrNone )
- {
- User::After( KSleepOnRetry );
- Activate();
- }
- else
- {
- ShutdownApp( error );
+ if( error == KErrNone )
+ {
+ crashCount++;
+ error = RProperty::Set( KPSCategoryUid,
+ KPSCrashCountKey,
+ crashCount );
+ }
+
+ if( error == KErrNone )
+ {
+ User::After( KSleepOnRetry );
+ Activate();
+ }
+ else
+ {
+ ShutdownApp( error );
+ }
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/idlefw/inc/framework/aicpsexecuteparam.h Wed Mar 31 22:04:35 2010 +0300
@@ -0,0 +1,141 @@
+/*
+* 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: CPS Execute parameter
+ *
+*/
+
+
+#ifndef AICPSEXECUTEPARAM_H
+#define AICPSEXECUTEPARAM_H
+
+// System includes
+#include <e32base.h>
+
+// User includes
+
+// Forward declarations
+class CLiwGenericParamList;
+// Constants
+
+/**
+ * CPS Execute Command Parameter
+ *
+ * @since S60 5.2
+ */
+
+/**
+ * Holds parameters to execute the CPS excute command
+ *
+ * @since S60 5.2
+ */
+NONSHARABLE_CLASS( CAiCpsExecuteParam ) : public CBase
+ {
+public:
+ // constructors and destructor
+
+ /**
+ * Two-phased constructors.
+ */
+ static CAiCpsExecuteParam* NewL( );
+ static CAiCpsExecuteParam* NewLC();
+
+ /**
+ * Destructor.
+ */
+ ~CAiCpsExecuteParam();
+
+private:
+ // constructors
+
+ /**
+ * C++ default constructor
+ */
+ CAiCpsExecuteParam();
+
+ /**
+ * 2nd phase constructor
+ */
+ void ConstructL( );
+
+public:
+ // new functions
+
+ /**
+ * Gets plugin id
+ *
+ * @since S60 5.2
+ * @return plugin id
+ */
+ const TDesC& PluginId() const;
+
+ /**
+ * Returns the input parameter list for Execute command
+ * it will leave the CLiwGenericParamList object in the stack
+ *
+ * @since S60 5.2
+ * @return generic parameter list
+ */
+ CLiwGenericParamList* InParamListLC();
+
+ /**
+ * Adds a actions to the action list
+ *
+ * @since S60 5.2
+ * @param aAction actions to add
+ */
+ void AddActionL(const TDesC8& aAction);
+
+ /**
+ * Sets the filter values
+ * This method always over write the previous filters vlaues.
+ *
+ * @since S60 5.2
+ * @param aMap filter map
+ */
+ void SetFilterL(CLiwDefaultMap* aMap);
+
+ /**
+ * Sets Registry type
+ * This method always over write the previous retgistry type.
+ *
+ * @since S60 5.2
+ * @param aRegistryType type of cps registry
+ */
+ void SetRegistryTypeL(const TDesC& aRegistryType);
+
+ /**
+ * Sets the plugin id
+ * This method always over write the previous plugin id.
+ *
+ * @since S60 5.2
+ * @param aPluginId actions to add
+ */
+ void SetPluginIdL(const TDesC& aPluginId);
+
+private:
+ // data
+ /** Plugin Id, owned.*/
+ HBufC* iPluginId;
+ /** Registry type, owned. */
+ HBufC* iRegistryType;
+ /** Filters, owned.*/
+ HBufC* iPublisher;
+ HBufC* iContentType;
+ HBufC* iContentId;
+
+ /** action trigger list, owned. */
+ RPointerArray<HBufC8> iActions;
+ };
+
+#endif /* AICPSEXECUTEPARAM_H */
--- a/idlefw/inc/framework/aipluginfactory.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/inc/framework/aipluginfactory.h Wed Mar 31 22:04:35 2010 +0300
@@ -29,6 +29,7 @@
// Forward declarations
class CAiUiControllerManager;
class CAiStateManager;
+class MAiCpsCommandBuffer;
class CHsContentPublisher;
class THsPublisherInfo;
@@ -77,7 +78,16 @@
*/
void DestroyPlugin(
const THsPublisherInfo& aPublisherInfo );
-
+
+ /**
+ * Destroy plugin
+ *
+ * @since S60 5.2
+ * @param aUid Implementation UID of a plugin to destroy.
+ */
+ void DestroyPlugin(
+ const TUid& aUid );
+
/**
* Finds plugin by publisher info.
*
@@ -105,7 +115,15 @@
* @return Pointer to plugin, NULL if not found. Factory keeps plugin's ownership.
*/
CHsContentPublisher* PluginByName( const TDesC& aName ) const;
-
+
+ /**
+ * Sets cps command buffer
+ *
+ * @since S60 5.2
+ * @param aCommanddBuffer Command buffer
+ */
+ void SetCommandBuffer( MAiCpsCommandBuffer* aCommanddBuffer );
+
private:
// private constructors
@@ -134,15 +152,14 @@
const THsPublisherInfo& aPublisherInfo );
RPointerArray< CHsContentPublisher >& Publishers() const;
-
- void ResolvePluginsToUpgradeL(
- RArray< THsPublisherInfo >& aArray );
-
+
private:
// data
/** UI Controller Manager, Not owned */
CAiUiControllerManager& iUiControllerManager;
+ /** Cps command buffer, Not owned */
+ MAiCpsCommandBuffer* iCommandBuffer;
/** Array of loaded data plugins, Owned */
mutable RPointerArray< CHsContentPublisher > iPublishers;
/** Ecom implementation info, Owned */
--- a/idlefw/inc/framework/aistatemanager.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/inc/framework/aistatemanager.h Wed Mar 31 22:04:35 2010 +0300
@@ -22,6 +22,7 @@
// System includes
#include <e32base.h>
#include <babitflags.h>
+#include <AknProgressDialog.h> // for MProgressDialogCallback
// User includes
#include <aifwdefs.h>
@@ -29,8 +30,10 @@
// Forward declarations
class CAiPluginFactory;
+class CAiCpsCommandBuffer;
class CHsContentPublisher;
class THsPublisherInfo;
+class CAknWaitDialog;
/**
* State Manager
@@ -40,7 +43,8 @@
* @since S60 5.0
*/
NONSHARABLE_CLASS( CAiStateManager ) : public CBase,
- public MAiStateObserver
+ public MAiStateObserver,
+ public MProgressDialogCallback
{
private:
// Data types
@@ -113,13 +117,14 @@
/**
* @see MAiStateObserver
*/
- void NotifyUpdatePlugins();
+ void NotifyReloadPlugins();
+
/**
* @see MAiStateObserver
*/
- TBool OnlineStateInUse() const;
-
+ void NotifyReleasePlugins( const RArray<TUid>& aUidList );
+
private:
// new functions
@@ -187,19 +192,53 @@
* @since S60 5.2
*/
void DestroyPlugins();
-
+
+ /**
+ * Starts wait dialog with progress bar.
+ */
+ void StartWaitDialogL();
+
+ /**
+ * Stops wait dialog with progress bar.
+ */
+ void StopWaitDialogL();
+
+ /**
+ * Callback method from MProgressDialogCallback interface.
+ * Gets called when a dialog is dismissed.
+ * @param aButtonId Id of the pushed button.
+ */
+ void DialogDismissedL( TInt aButtonId );
+
+ /**
+ * Flushes cps command buffer
+ *
+ * @since S60 5.2
+ */
+ void FlushCommandBuffer();
+
private:
// data
/** Plugin Factory, Not owned */
CAiPluginFactory& iFactory;
+ /** CPS Command buffer, Owned */
+ CAiCpsCommandBuffer* iCommandBuffer;
/** Current state */
TState iCurrentState;
/** Flags */
TBitFlags32 iFlags;
/** Halted flag */
TBool iHalt;
-
+ /**
+ * Own.
+ * Pointer to wait dialog.
+ */
+ CAknWaitDialog* iWaitDialog;
+
+ /** List of plugins which should be reloaded */
+ RArray<THsPublisherInfo> iReloadPlugins;
+
private:
// friend classes
--- a/idlefw/inc/framework/aistateobserver.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/inc/framework/aistateobserver.h Wed Mar 31 22:04:35 2010 +0300
@@ -67,20 +67,20 @@
TAiFwDestroyReason aReason ) = 0;
/**
- * Notifies to update content publishers after Ecom registry change.
+ * Notifies to reload previously released plugins
*
* @since S60 5.2
*/
- virtual void NotifyUpdatePlugins() = 0;
+ virtual void NotifyReloadPlugins() = 0;
/**
- * Queries whether online state is in use
- * by any of the currently loaded plugin.
+ * Notifies that defined ECom plugins should be released to enable
+ * plugin upgrade
*
* @since S60 5.2
- * @return ETrue if online/offline state needed, EFalse otherwise
*/
- virtual TBool OnlineStateInUse() const = 0;
+ virtual void NotifyReleasePlugins( const RArray<TUid>& aUidList ) = 0;
+
};
#endif // _AISTATEOBSERVER_H
--- a/idlefw/inc/framework/aistateprovider.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/inc/framework/aistateprovider.h Wed Mar 31 22:04:35 2010 +0300
@@ -164,16 +164,13 @@
*/
void ChangePluginState( TAiFwState aState );
- /**
- * @see MAiFwStateHandler
- */
- TBool OnlineStateInUse() const;
-
private:
// new functions
static TInt BackupRestoreEvent( TAny* aAny );
-
+
+ static TInt SwiUidListEvent( TAny* aAny );
+
private:
// data
@@ -190,8 +187,10 @@
/** Backup Restore observer, Owned */
MAiPSPropertyObserver* iBackupRestoreObserver;
/** Flag to indicate whether state providing is started */
- TBool iStarted;
-
+ TBool iStarted;
+ /** SWI UID list observer, owned */
+ MAiPSPropertyObserver* iSwiUidListObserver;
+
private:
// friend classes
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/idlefw/inc/framework/caicpscommandbuffer.h Wed Mar 31 22:04:35 2010 +0300
@@ -0,0 +1,150 @@
+/*
+* 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: Cps command buffer
+*
+*/
+
+
+#ifndef C_CAICPSCOMMANDBUFFER_H
+#define C_CAICPSCOMMANDBUFFER_H
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include <aicpscommandbuffer.h>
+
+// Forward declarations
+class CLiwGenericParamList;
+class CLiwServiceHandler;
+class CLiwCriteriaItem;
+class CAiCpsExecuteParam;
+class MLiwInterface;
+
+/**
+ * AI Cps command buffer
+ *
+ * @ingroup group_aifw
+ * @lib aifw
+ * @since S60 v5.2
+ */
+NONSHARABLE_CLASS( CAiCpsCommandBuffer ) : public CBase,
+ public MAiCpsCommandBuffer
+ {
+public:
+ // constructors and destructor
+
+ /**
+ * Two-phased constructors.
+ */
+ static CAiCpsCommandBuffer* NewL();
+ static CAiCpsCommandBuffer* NewLC();
+
+ /**
+ * Destructor.
+ */
+ ~CAiCpsCommandBuffer();
+
+private:
+ // constructors
+
+ /**
+ * C++ default constructor
+ */
+ CAiCpsCommandBuffer();
+
+ /**
+ * 2nd phase constructor
+ */
+ void ConstructL();
+
+public:
+ // new function
+
+ /**
+ * Flushes command buffer
+ *
+ * @since S60 v5.2
+ */
+ void Flush();
+
+private:
+ // from MAiCpsCommandBuffer
+
+ /**
+ * @see MAiCpsCommandBuffer
+ */
+ void AddCommand( const TDesC& aPluginId, const TDesC& aType,
+ CLiwDefaultMap* aFilter, const TDesC8& aAction);
+
+private:
+ // new functions
+ /**
+ * Gets the CPS interface
+ *
+ * @since S60 5.2
+ */
+ void GetCPSInterfaceL();
+
+ /**
+ * Adds a CPS command execute commnad for a spcific Plugin
+ * Note: aType and Filter will overwrite the previous value
+ *
+ * @since S60 5.2
+ * @param aPluginId plugin id.
+ * @param aType type of the cps registry.
+ * @param aFilter filter values.
+ * @param aAction action trigger.
+ */
+ void DoAddCommandL(const TDesC& aPluginId,const TDesC& aType,
+ CLiwDefaultMap* aFilter, const TDesC8& aAction );
+
+ /**
+ * Flush all the CPS execute commands..
+ *
+ * @since S60 5.2
+ */
+ void DoFlushL();
+
+private:
+ // data
+ /**
+ * SAPI service handler.
+ * Owned.
+ */
+ CLiwServiceHandler* iServiceHandler;
+
+ /**
+ * CPS SAPI service.
+ * Owned.
+ */
+ CLiwCriteriaItem* iCpsService;
+
+ /**
+ * Provides hsps services.
+ * Owned.
+ */
+ MLiwInterface* iCpsInterface;
+
+ /**
+ * Plugins execute parameter array
+ * Owned.
+ */
+ RPointerArray<CAiCpsExecuteParam> iPlugins;
+ };
+
+#endif // C_CAICPSCOMMANDBUFFER_H
+
+// End of file
+
--- a/idlefw/loc/aifw.loc Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/loc/aifw.loc Wed Mar 31 22:04:35 2010 +0300
@@ -39,3 +39,9 @@
// r: 3.2
//
#define qtn_idle_theme_error_notloaded "Error in theme."
+
+// d: Wait/progress note text that is shown when backup or restore process is ongoing.
+// l: popup_note_wait_window
+// w:
+// r: TB9.2
+#define qtn_hs_backup_use_prevented "Home screen is not in use during backup or restore operation. Wait to finish."
--- a/idlefw/plugins/devicestatus/group/aidevstaplg.mmp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/devicestatus/group/aidevstaplg.mmp Wed Mar 31 22:04:35 2010 +0300
@@ -84,6 +84,7 @@
LIBRARY aiutils.lib
LIBRARY flogger.lib
LIBRARY bafl.lib
+LIBRARY profileengine.lib
// End of file
--- a/idlefw/plugins/devicestatus/inc/aioperatornamepublisher.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/devicestatus/inc/aioperatornamepublisher.h Wed Mar 31 22:04:35 2010 +0300
@@ -22,12 +22,15 @@
// System includes
#include <e32base.h>
#include <AknUtils.h>
+#include <MProEngProfileActivationObserver.h>
// User includes
#include "aidevicestatuspublisher.h"
#include "ainetworkinfoobserver.h"
// Forward declarations
+class MProfileEngine;
+class MProEngNotifyHandler;
class CAiNetworkInfoListener;
class MAiDeviceStatusContentObserver;
class CHsContentPublisher;
@@ -45,7 +48,8 @@
*/
NONSHARABLE_CLASS( CAiOperatorNamePublisher ) : public CBase,
public MAiDeviceStatusPublisher,
- public MAiNetworkInfoObserver
+ public MAiNetworkInfoObserver,
+ public MProEngProfileActivationObserver
{
public:
@@ -78,6 +82,13 @@
const TNWInfo& aInfo,
const TBool aShowOpInd );
+private:
+ // from MProEngProfileActivationObserver
+
+ /**
+ * @see MProEngProfileActivationObserver
+ */
+ void HandleProfileActivatedL( TInt aProfileId );
private:
@@ -167,6 +178,10 @@
TPtrC iNetworkIdentityName;
/** Flag to indicate if the content is suspended */
TBool iSuspended;
+ /** Profile engine, owned */
+ MProfileEngine* iProfileEngine;
+ /** Profile change notifier, owned */
+ MProEngNotifyHandler* iProfileNotifier;
};
#endif // C_AIOPERATORPROVIDERNAMEPUBLISHER_H
--- a/idlefw/plugins/devicestatus/src/aioperatornamepublisher.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/devicestatus/src/aioperatornamepublisher.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -20,6 +20,11 @@
#include <centralrepository.h>
#include <avkondomainpskeys.h>
#include <e32property.h>
+#include <ProEngFactory.h>
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfilename.h>
+#include <MProEngNotifyHandler.h>
#include <aidevstaplgres.rsg>
#include "aioperatornamepublisher.h"
@@ -36,6 +41,7 @@
const TInt KBitShiftByFour = 4;
const TInt KIsDigitLowLimit = 0;
const TInt KIsDigitHighLimit = 10;
+const TInt KOfflineProfileId = 5;
LOCAL_C void AppendDigit( TDes& aCode, TInt aValue )
{
@@ -75,6 +81,9 @@
{
iListener = CAiNetworkInfoListener::InstanceL();
iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
+ iProfileEngine = CreateProfileEngineL();
+ iProfileNotifier = ProEngFactory::NewNotifyHandlerL();
+ iProfileNotifier->RequestProfileActivationNotificationsL( *this );
}
@@ -100,6 +109,15 @@
iPeriodic->Cancel();
delete iPeriodic;
}
+ if ( iProfileNotifier )
+ {
+ iProfileNotifier->CancelAll();
+ delete iProfileNotifier;
+ }
+ if( iProfileEngine )
+ {
+ iProfileEngine->Release();
+ }
}
@@ -125,10 +143,13 @@
}
else
{
- TRAP_IGNORE (
- iPrioritizer->TryToCleanL( *iBroadcaster,
- EAiDeviceStatusContentNetworkIdentity,
- iPriority ));
+ if ( iProfileEngine->ActiveProfileId() != KOfflineProfileId )
+ {
+ TRAP_IGNORE (
+ iPrioritizer->TryToCleanL( *iBroadcaster,
+ EAiDeviceStatusContentNetworkIdentity,
+ iPriority ));
+ }
}
}
@@ -153,6 +174,19 @@
return;
}
+ if ( iProfileEngine->ActiveProfileId() == KOfflineProfileId )
+ {
+ MProfile* profile = iProfileEngine->ActiveProfileLC();
+ const MProfileName& name = profile->ProfileName();
+ iPrioritizer->TryToPublishL( *iBroadcaster,
+ EAiDeviceStatusContentNetworkIdentity,
+ name.Name(),
+ iPriority );
+ iSuccess = ETrue;
+ CleanupStack::PopAndDestroy();//profile
+ return;
+ }
+
if( aClean )
{
iPrioritizer->TryToCleanL( *iBroadcaster,
@@ -732,3 +766,8 @@
}
}
+void CAiOperatorNamePublisher::HandleProfileActivatedL( TInt /*aProfileId*/ )
+ {
+ RefreshL( EFalse );
+ }
+
--- a/idlefw/plugins/mcsplugin/commoninc/mcspluginwatcher.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/commoninc/mcspluginwatcher.h Wed Mar 31 22:04:35 2010 +0300
@@ -86,15 +86,6 @@
void WatchNotify( MMCSPluginWatcherObserver* aObserver );
/**
- * StopAndWatch
- *
- * @param aOperation
- * @param aWaitScheduler
- */
- void StopAndWatch( CMenuOperation* aOperation,
- CActiveSchedulerWait* aWaitScheduler );
-
- /**
* GetStatus
*/
TInt GetStatus();
@@ -130,12 +121,6 @@
* Owned
*/
CMenuOperation* iOperation;
-
- /**
- * Wait scheduler
- * Not owned
- */
- CActiveSchedulerWait* iWaitScheduler;
/**
* Observer reference
--- a/idlefw/plugins/mcsplugin/commonsrc/mcspluginwatcher.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/commonsrc/mcspluginwatcher.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -79,15 +79,6 @@
SetActive();
}
-void CMCSPluginWatcher::StopAndWatch( CMenuOperation* aOperation,
- CActiveSchedulerWait* aWaitScheduler )
- {
- __ASSERT_DEBUG( KRequestPending == iStatus.Int(), User::Invariant() );
- iWaitScheduler = aWaitScheduler;
- iOperation = aOperation;
- SetActive();
- }
-
// ---------------------------------------------------------------------------
// Inherited from CActive class
// ---------------------------------------------------------------------------
@@ -100,11 +91,7 @@
{
iObserver->HandleNotifyL();
}
- if ( iWaitScheduler && iWaitScheduler->IsStarted() )
- {
- Cancel();
- iWaitScheduler->AsyncStop();
- }
+
//CActiveScheduler::Stop();
}
--- a/idlefw/plugins/mcsplugin/group/mcsplugin.mmp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/group/mcsplugin.mmp Wed Mar 31 22:04:35 2010 +0300
@@ -78,7 +78,7 @@
LIBRARY eikdlg.lib
LIBRARY commonengine.lib
LIBRARY favouritesengine.lib
-
+LIBRARY viewcli.lib
LIBRARY gfxtrans.lib
// End of File
--- a/idlefw/plugins/mcsplugin/group/mcspluginsettings.mmp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/group/mcspluginsettings.mmp Wed Mar 31 22:04:35 2010 +0300
@@ -58,36 +58,27 @@
APP_LAYER_SYSTEMINCLUDE
MW_LAYER_SYSTEMINCLUDE
-LIBRARY euser.lib
-LIBRARY ecom.lib
-LIBRARY avkon.lib
-LIBRARY bafl.lib
-LIBRARY cone.lib
-LIBRARY efsrv.lib
-LIBRARY eikcoctl.lib
-LIBRARY eikcore.lib
-LIBRARY cdlengine.lib
-//LIBRARY centralrepository.lib
-LIBRARY cenrepnotifhandler.lib // CCenRepNotifyHandler
-LIBRARY gsframework.lib // For base classes
-LIBRARY gslistbox.lib // For CGSListBoxItemTextArray
-LIBRARY gsecomplugin.lib
-LIBRARY commonengine.lib // For RConeResourceLoader
-LIBRARY inetprotutil.lib // For TUriParser
-//LIBRARY apgrfx.lib // For RApaLsSession
-//LIBRARY apparc.lib // For TApaAppInfo
-LIBRARY msgs.lib // For Message Server
-LIBRARY platformenv.lib // For PathInfo
-LIBRARY hlplch.lib // for HlpLauncher
-LIBRARY featmgr.lib // For feature manager
-LIBRARY favouritesengine.lib
-//LIBRARY javaregistryclient.lib // For JavaRegistry
-#ifdef __WEB_WIDGETS
-//LIBRARY widgetregistryclient.lib
-#endif
+LIBRARY euser.lib
+LIBRARY ecom.lib
+LIBRARY avkon.lib
+LIBRARY bafl.lib
+LIBRARY cone.lib
+LIBRARY efsrv.lib
+LIBRARY eikcoctl.lib
+LIBRARY eikcore.lib
+LIBRARY cdlengine.lib
+LIBRARY cenrepnotifhandler.lib // CCenRepNotifyHandler
+LIBRARY gsframework.lib // For base classes
+LIBRARY gslistbox.lib // For CGSListBoxItemTextArray
+LIBRARY gsecomplugin.lib
+LIBRARY commonengine.lib // For RConeResourceLoader
+LIBRARY inetprotutil.lib // For TUriParser
+LIBRARY msgs.lib // For Message Server
+LIBRARY platformenv.lib // For PathInfo
+LIBRARY hlplch.lib // for HlpLauncher
+LIBRARY featmgr.lib // For feature manager
+LIBRARY favouritesengine.lib
-// Debugging dependencies
-//LIBRARY flogger.lib
LIBRARY mcsmenu.lib
LIBRARY hspluginsettings.lib
LIBRARY aiutils.lib
--- a/idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -231,19 +231,14 @@
}
else if ( param.Find( KParamValueMailbox ) != KErrNotFound ) // Mailbox
{
- TBool attrExists = ETrue;
TInt pos = param.Locate( TChar( ':' ) ) + 1;
TPtrC mailboxId = param.Mid( pos );
-
- if ( attrExists )
- {
- TInt number;
- TLex16 lextmp( mailboxId );
- lextmp.Val( number );
- TUid uId = TUid::Uid( number );
- const TVwsViewId viewId( TUid::Uid( KMCSCmailUidValue ), TUid::Uid( KMCSCmailMailboxViewIdValue ) );
- iVwsSession->CreateActivateViewEvent( viewId, uId, KNullDesC8() );
- }
+ TInt number;
+ TLex16 lextmp( mailboxId );
+ lextmp.Val( number );
+ TUid uId = TUid::Uid( number );
+ const TVwsViewId viewId( TUid::Uid( KMCSCmailUidValue ), TUid::Uid( KMCSCmailMailboxViewIdValue ) );
+ iVwsSession->CreateActivateViewEvent( viewId, uId, KNullDesC8() );
}
else if ( param.Find( KMenuAttrParamLogs ) != KErrNotFound )
{
--- a/idlefw/plugins/mcsplugin/publisher/inc/mcsplugin.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/publisher/inc/mcsplugin.h Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-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"
@@ -29,7 +29,8 @@
class MAiContentObserver;
class MAiContentItemIterator;
class CMCSPluginEngine;
-class TMCSData;
+class CMCSData;
+
/**
* @ingroup group_mcsplugin
@@ -123,7 +124,7 @@
/**
* Publishes content for one menu item
*/
- void PublishLItemL( MAiContentObserver& aObserver, TMCSData& aDataItem, TInt aIndex );
+ void PublishLItemL( MAiContentObserver& aObserver, CMCSData& aDataItem, TInt aIndex );
/**
* Delete content model
--- a/idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -26,23 +26,25 @@
#include <hspluginsettings.h>
#include <propertymap.h>
#include <mcsmenu.h>
-#include <msvapi.h> // For MMsvSessionObserver
class TMenuItem;
class CMCSPluginEngine;
-class CMCSPluginWatcher;
-
/**
* @ingroup group_mcsplugin
*
- * TMCData class
+ * Stores the MCS Menu Items and keeps track whether
+ * item needs to be published or not.
*
* @since S60 v9.1
*/
-class TMCSData
+NONSHARABLE_CLASS( CMCSData ) : public CBase
{
public:
+ CMCSData();
+
+ ~CMCSData();
+
/**
* SetMenuItem
*
@@ -56,8 +58,28 @@
* @return TMenuItem
*/
TMenuItem& MenuItem();
+
+ /**
+ * Name of the item.
+ */
+ TDesC& Name();
+
+ /**
+ * Set name of the item,
+ */
+ void SetNameL( const TDesC& aName );
/**
+ * Value of the item. Used for bookmark url.
+ */
+ TDesC& Value();
+
+ /*
+ * Set value of the item.
+ */
+ void SetValueL( const TDesC& aValue );
+
+ /**
* SetDirty
*
* @param aDirty
@@ -77,6 +99,16 @@
* iMenuItem
*/
TMenuItem iMenuItem;
+
+ /**
+ * Item name, own
+ */
+ HBufC* iName;
+
+ /**
+ * Item value, own
+ */
+ HBufC* iValue;
/**
* iDirty
@@ -91,9 +123,8 @@
*
* @since
*/
-class CMCSPluginData : public CBase,
- public HSPluginSettingsIf::MHomeScreenSettingsObserver,
- public MMsvSessionObserver
+NONSHARABLE_CLASS( CMCSPluginData ) : public CBase,
+ public HSPluginSettingsIf::MHomeScreenSettingsObserver
{
public:
@@ -131,23 +162,15 @@
* @param aIndex
* @return TMCSData&
*/
- TMCSData& DataItemL( TInt aIndex );
+ CMCSData& DataItemL( TInt aIndex );
/**
- * ReplaceMenuItemL
+ * Saves 'Undefined' menu item into settings when mailbox is deleted
*
* @param aIndex
* @param aMenuItem
*/
- void ReplaceMenuItemL( const TInt& aIndex, TMenuItem& aMenuItem );
-
- /**
- * SaveSettingsL
- *
- * @param aIndex
- * @param aMenuItem
- */
- void SaveSettingsL( const TInt& aIndex, CMenuItem& aMenuItem );
+ void SaveUndefinedItemL( const TInt& aIndex );
/**
* DataCount
@@ -157,10 +180,15 @@
TInt DataCount(){ return iData.Count();};
/**
- * UpdateDataL
+ * Gets the instance specific settings from HSPS and creates data items
*/
void UpdateDataL();
+ /**
+ * Removes data item from data list and saves new setting into HSPS
+ */
+ void RemoveDataL( TInt aId );
+
// From MHomeScreenSettingsObserver
/**
* SettingsChangedL
@@ -173,28 +201,6 @@
void SettingsChangedL( const TDesC8& aEvent, const TDesC8& aPluginName,
const TDesC8& aPluginUid, const TDesC8& aPluginId );
- /**
- * CreateRunTimeMenuItemsL
- * @param void
- * @return void
- */
- void CreateRuntimeMenuItemsL();
-
- // from base class MMsvSessionObserver
-
- /**
- * Handles an event from the message server.
- * Not used, but must be defined to be able to use the messaging server.
- *
- * @since S60 v3.2
- * @param aEvent Indicates the event type.
- * @param aArg1 Event type-specific argument value
- * @param aArg2 Event type-specific argument value
- * @param aArg3 Event type-specific argument value
- */
- void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
- TAny* aArg3 );
-
private:
/**
@@ -206,24 +212,49 @@
void ConstructL();
/**
- * CreateMenuItemL
+ * GetMenuDataL
* @param aProperties
* @return TMenuItem
*/
- TMenuItem CreateMenuItemL(
+ CMCSData* GetMenuDataL(
RPointerArray<HSPluginSettingsIf::CPropertyMap>& aProperties );
+
+ /**
+ * Get bookmark data item
+ * @param aView, used for bookmark url
+ * @param aParam, used for bookmark name
+ * @param aData, is filled with appropriate values
+ */
+ void GetBkmDataL( const TDesC8& aView, const TDesC8& aParam, CMCSData& aData );
/**
- * GetMCSPluginFolderIdL
- *
- * @return TInt
+ * Get folder data item
+ * @param aParam, is used for folder id (in MCS)
+ * @param aData, is filled with appropriate values
+ */
+ void GetFolderData( const TDesC8& aParam, CMCSData& aData );
+
+ /**
+ * Get mailbox data item
+ * @param aUid, uid of the mailbox in messaging application
+ * @param aParam, name of the mailbox
+ * @param aData, is filled with appropriate values
*/
- TInt GetMCSPluginFolderIdL();
+ void GetMailboxDataL( const TDesC8& aUid, const TDesC8& aParam, CMCSData& aData );
+
+ /**
+ * Get MCS data item
+ * @param aProperties, Properties are used to filter correct item from MCS.
+ * @param aData, is filled with appropriate values
+ */
+ void GetMCSDataL(
+ RPointerArray<HSPluginSettingsIf::CPropertyMap>& aProperties, CMCSData& aData );
+
private: // data
// Menu items, which are defined in settings
// Own
- RArray<TMCSData> iData;
+ RPointerArray<CMCSData> iData;
// Plugin settings. NOT OWNED!
HSPluginSettingsIf::CHomescreenSettings* iPluginSettings;
@@ -234,17 +265,9 @@
// Reference to instance uid of HSPS widget
const TDesC8& iInstanceUid;
- // MCS asynchronous operation watcher, owned
- CMCSPluginWatcher* iSaveWatcher;
-
// MCS resource handle, owned
RMenu iMenu;
-
- /**
- * Message server session
- * Own.
- */
- CMsvSession* iMsvSession;
+
};
#endif // CMCSPLUGINDATA_H
--- a/idlefw/plugins/mcsplugin/publisher/inc/mcspluginengine.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/publisher/inc/mcspluginengine.h Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -22,8 +22,8 @@
// System includes
#include <e32base.h>
#include <mcsmenu.h>
+#include <mcsmenuitem.h>
#include <mcsmenunotifier.h>
-#include <mcsmenuitem.h>
#include <msvapi.h>
// User includes
@@ -32,9 +32,10 @@
// Forward declarations
class CGulIcon;
class CMCSPluginData;
-class TMCSData;
+class CMCSData;
class CMCSPlugin;
+
/**
* @ingroup group_mcsplugin
*
@@ -84,19 +85,12 @@
// new functions
/**
- * Called during plugin desctruction
- * Decrements reference counters of all run-time generated items
- * and deletes those which have reference counter == 0
- */
- void CleanMCSItemsL();
-
- /**
* Gets the menu data.
*
* @param aIndex
* @return TMCSData&
*/
- TMCSData& MenuDataL( const TInt& aIndex );
+ CMCSData& MenuDataL( const TInt& aIndex );
/** Gets the menu item count
*
@@ -118,8 +112,8 @@
* @param aMenuItem
* @return CMenuItem*
*/
- CMenuItem* FetchMenuItemL( const TMenuItem& aMenuItem );
-
+ CMenuItem* FetchMenuItemL( CMCSData& aData);
+
/**
* Returns icon for given menu item and given attribute
*
@@ -156,23 +150,6 @@
* ShowSettingsL
*/
void ShowSettingsL();
-
- /**
- * Helper method. Adds a given constant to a value of reference counter
- *
- * @param aItem A Menu Item to update
- * @param aValueToAdd A constant to add
- * @return The actual value of updated reference count
- */
- TInt UpdateMenuItemsRefCountL(
- CMenuItem* aItem, const TInt aValueToAdd );
-
- /**
- * CreateRuntimeMenuItemsL
- * @param void
- * @return void
- */
- void CreateRuntimeMenuItemsL();
private:
// from MMCSPluginWatcherObserver
@@ -221,6 +198,24 @@
TBool ConstructMenuItemForIconL(
const TDesC& aPath, CMenuItem& aMenuItem );
+ /**
+ * Creates bookmark specific MCS menu item.
+ */
+ CMenuItem* CreateBkmItemL( CMCSData& aData );
+
+ /**
+ * Creates mailbox specific MCS menu item.
+ */
+ CMenuItem* CreateMailboxItemL( CMCSData& aData );
+
+ void LaunchFolderItemL( CMCSData& aData );
+
+ void LaunchBookmarkItemL( CMCSData& aData );
+
+ void LaunchMailboxItemL( CMCSData& aData );
+
+ void LaunchMCSItemL( CMCSData& aData );
+
private:
// data
@@ -253,4 +248,3 @@
#endif // CMCSPLUGINENGINE_H
// End of file
-
--- a/idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -23,8 +23,8 @@
// User includes
#include <aicontentobserver.h>
+#include <aistrcnv.h>
#include <aiutility.h>
-#include <aistrcnv.h>
#include "mcspluginuids.hrh"
#include "mcsplugin.h"
#include "mcsplugindata.h"
@@ -150,16 +150,14 @@
// ----------------------------------------------------------------------------
//
void CMCSPlugin::PublishLItemL( MAiContentObserver& aObserver,
- TMCSData& aData, TInt aIndex )
+ CMCSData& aData, TInt aIndex )
{
if( !aData.IsDirty() )
{
return;
}
- CMenuItem* item = NULL;
- TRAP_IGNORE ( item = iEngine->FetchMenuItemL( aData.MenuItem() ) );
-
+ CMenuItem* item = iEngine->FetchMenuItemL( aData );
CleanupStack::PushL( item );
// One widget item has iDataCount number of elements
@@ -197,12 +195,9 @@
//
// ----------------------------------------------------------------------------
//
-void CMCSPlugin::Start( TStartReason aReason )
+void CMCSPlugin::Start( TStartReason /*aReason*/ )
{
- if ( aReason == EPluginStartup )
- {
- TRAP_IGNORE( iEngine->CreateRuntimeMenuItemsL() );
- }
+
}
// ----------------------------------------------------------------------------
@@ -210,12 +205,9 @@
//
// ----------------------------------------------------------------------------
//
-void CMCSPlugin::Stop( TStopReason aReason )
+void CMCSPlugin::Stop( TStopReason /*aReason*/ )
{
- if( aReason == EPluginShutdown )
- {
- TRAP_IGNORE( iEngine->CleanMCSItemsL() );
- }
+
}
// ----------------------------------------------------------------------------
--- a/idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -18,12 +18,6 @@
#include <mcsmenufilter.h>
#include <itemmap.h>
#include <aistrcnv.h>
-#include <favouritesdbobserver.h>
-#include <favouritesdb.h>
-#include <msvuids.h> // For KMsvRootIndexEntryIdValue
-
-#include <mcsmenuitem.h>
-#include <mcsmenufilter.h>
#include "mcsplugindata.h"
#include "mcspluginengine.h"
@@ -36,24 +30,16 @@
_LIT8( KProperNameParam, "param" );
_LIT8( KProperNameUid, "uid" );
_LIT8( KProperNameView, "view" );
+_LIT8( KProperNameLocked, "locked" );
_LIT8( KProperValueFolder, "folder" );
_LIT8( KProperValueBookmark, "bookmark" );
_LIT8( KProperValueAppl, "application" );
-
-_LIT( KMailboxUid, "0x100058c5" );
-_LIT8( KMailboxUid8, "0x100058c5" );
-_LIT( KMenuMailboxIconId, "16388" );
-_LIT( KMenuMailboxMaskId, "16389" );
+_LIT8( KProperValueMailbox, "mailbox" );
+_LIT8( KMenuAttrUndefUid, "0x99999991" );
-_LIT( KUrl, "url" );
-_LIT( KMenuIconFile, "aimcsplugin.mif" );
-_LIT( KMenuBookmarkIconId, "16386" );
-_LIT( KMenuBookmarkMaskId, "16387" );
-_LIT( KInitialRefCount, "1" );
-_LIT( KMenuAttrRefcount, "ref_count" );
_LIT( KMyMenuData, "matrixmenudata" );
-_LIT( KMenuTypeShortcut, "menu:shortcut" );
-_LIT( KMenuAttrParameter, "param" );
+_LIT( KMenuTypeMailbox, "menu:mailbox" );
+
#define KMCSCmailMtmUidValue 0x2001F406
@@ -68,26 +54,101 @@
// ======== MEMBER FUNCTIONS ========
-void TMCSData::SetMenuItem( TMenuItem& aMenuItem )
+// ---------------------------------------------------------------------------
+// Default constructor
+// ---------------------------------------------------------------------------
+//
+CMCSData::CMCSData()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CMCSData::~CMCSData()
+ {
+ delete iName;
+ delete iValue;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMCSData::SetMenuItem( TMenuItem& aMenuItem )
{
iMenuItem = aMenuItem;
}
-TMenuItem& TMCSData::MenuItem()
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TMenuItem& CMCSData::MenuItem()
{
return iMenuItem;
}
-void TMCSData::SetDirty( TBool aDirty )
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TDesC& CMCSData::Name()
+ {
+ return *iName;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMCSData::SetNameL( const TDesC& aName )
+ {
+ delete iName;
+ iName = NULL;
+ iName = aName.AllocL();
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TDesC& CMCSData::Value()
+ {
+ return *iValue;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMCSData::SetValueL( const TDesC& aValue )
+ {
+ delete iValue;
+ iValue = NULL;
+ iValue = aValue.AllocL();
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMCSData::SetDirty( TBool aDirty )
{
iDirty = aDirty;
}
-TBool TMCSData::IsDirty() const
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CMCSData::IsDirty() const
{
return iDirty;
}
+
// ---------------------------------------------------------------------------
// Symbian 2nd phase constructor can leave
// ---------------------------------------------------------------------------
@@ -117,7 +178,6 @@
//
void CMCSPluginData::ConstructL()
{
- iMsvSession = CMsvSession::OpenAsObserverL( *this );
iPluginSettings = CHomescreenSettings::Instance();
if( iPluginSettings == NULL )
{
@@ -125,8 +185,6 @@
}
iPluginSettings->AddObserverL( this );
- iSaveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation );
-
iMenu.OpenL( KMyMenuData );
UpdateDataL();
@@ -142,12 +200,8 @@
{
iPluginSettings->RemoveObserver( this );
}
-
- iData.Close();
+ iData.ResetAndDestroy();
iMenu.Close();
-
- delete iSaveWatcher;
- delete iMsvSession;
}
// ---------------------------------------------------------------------------
@@ -168,15 +222,13 @@
CItemMap* itemMap = settings[ i ];
RPointerArray<HSPluginSettingsIf::CPropertyMap>& properties
= itemMap->Properties();
- TMenuItem item = CreateMenuItemL( properties );
- TMCSData data;
+ CMCSData* data = GetMenuDataL( properties );
if ( wasEmpty )
{
// list of shortcut slot was empty
// we append the shortcut data slots one-by-one to the list
- data.SetMenuItem( item );
- data.SetDirty( ETrue );
+ data->SetDirty( ETrue );
iData.AppendL( data );
}
else
@@ -185,24 +237,44 @@
// if menuitem id has changed, replace the item and
// set as dirty
TInt id = -1;
- id = iData[ i ].MenuItem().Id();
+ id = iData[ i ]->MenuItem().Id();
- if ( item.Id() != id )
+ if ( data->MenuItem().Id() != id )
{
- data.SetMenuItem( item );
- data.SetDirty( ETrue );
+ data->SetDirty( ETrue );
+ CMCSData* oldData = iData[i];
iData.Remove( i );
+ delete oldData;
iData.InsertL( data, i );
}
}
}
-
- CleanupStack::PopAndDestroy(); // settingsCleanupItem
+ CleanupStack::PopAndDestroy(); // settingsCleanupItem
}
+// ---------------------------------------------------------------------------
+// Removes obsolete data and saves 'Undefined' item to HSPS
+// Used when active mailbox is deleted from system.
+// ---------------------------------------------------------------------------
+//
+void CMCSPluginData::RemoveDataL( TInt aId )
+ {
+ TInt count = iData.Count();
+ for( TInt i = 0; i < count; i++ )
+ {
+ CMCSData* data = iData[i];
+ if( data->MenuItem().Type() == KMenuTypeMailbox &&
+ data->MenuItem().Id() == aId )
+ {
+ iData[i]->MenuItem().SetId( KErrNotFound );
+ iData[i]->SetDirty( ETrue );
+ SaveUndefinedItemL( i );
+ }
+ }
+ }
// ---------------------------------------------------------------------------
-//
+// Call back from Homescreen settings
// ---------------------------------------------------------------------------
//
void CMCSPluginData::SettingsChangedL( const TDesC8& /*aEvent*/, const TDesC8& /*aPluginName*/,
@@ -218,7 +290,127 @@
// Gets the menu item from engine using the setting properties as filter
// ---------------------------------------------------------------------------
//
-TMenuItem CMCSPluginData::CreateMenuItemL( RPointerArray<HSPluginSettingsIf::CPropertyMap>& aProperties )
+CMCSData* CMCSPluginData::GetMenuDataL( RPointerArray<HSPluginSettingsIf::CPropertyMap>& aProperties )
+ {
+ TPtrC8 type;
+ TPtrC8 uid;
+ TPtrC8 view;
+ TPtrC8 param;
+
+ // first we need to check the item type
+ for ( TInt i = 0; i < aProperties.Count(); i++ )
+ {
+ if ( aProperties[i]->Name() == KProperNameType )
+ {
+ type.Set( aProperties[i]->Value());
+ }
+ else if( aProperties[i]->Name() == KProperNameUid)
+ {
+ uid.Set( aProperties[i]->Value());
+ }
+ else if( aProperties[i]->Name() == KProperNameView)
+ {
+ view.Set( aProperties[i]->Value());
+ }
+ else if( aProperties[i]->Name() == KProperNameParam )
+ {
+ param.Set( aProperties[i]->Value());
+ }
+ }
+ CMCSData* data = new ( ELeave ) CMCSData();
+ CleanupStack::PushL( data );
+ if( type == KProperValueBookmark )
+ {
+ GetBkmDataL( view, param, *data );
+ }
+ else if( type == KProperValueFolder )
+ {
+ GetFolderData( param, *data );
+ }
+ else if( type == KProperValueMailbox )
+ {
+ GetMailboxDataL( uid, param, *data );
+ }
+ else
+ {
+ GetMCSDataL( aProperties, *data );
+ }
+ CleanupStack::Pop( data );
+ return data;
+ }
+
+// ---------------------------------------------------------------------------
+// Creates bookmark data item.
+// ---------------------------------------------------------------------------
+//
+void CMCSPluginData::GetBkmDataL( const TDesC8& aView, const TDesC8& aParam, CMCSData& aData )
+ {
+ TMenuItem item;
+ item.SetType( KMenuTypeUrl );
+ aData.SetMenuItem( item );
+
+ HBufC* view( NULL );
+ view = AiUtility::CopyToBufferL( view, aView );
+ CleanupStack::PushL( view );
+ aData.SetValueL( *view );
+ CleanupStack::PopAndDestroy( view );
+
+ HBufC* param( NULL );
+ param = AiUtility::CopyToBufferL( param, aParam );
+ CleanupStack::PushL( param );
+ aData.SetNameL( *param );
+ CleanupStack::PopAndDestroy( param );
+ }
+
+// ---------------------------------------------------------------------------
+// Creates folder data item.
+// ---------------------------------------------------------------------------
+//
+void CMCSPluginData::GetFolderData( const TDesC8& aParam, CMCSData& aData )
+ {
+ // In folder case, we have to extract id from
+ // param attribute and return item with this id
+ // convert id to integer
+ TInt id;
+ TLex8 lextmp( aParam);
+ lextmp.Val( id );
+
+ TMenuItem item;
+ item.SetType( KMenuTypeFolder );
+ item.SetId( id );
+ aData.SetMenuItem( item );
+ }
+
+// ---------------------------------------------------------------------------
+// Creates mailbox data item.
+// ---------------------------------------------------------------------------
+//
+void CMCSPluginData::GetMailboxDataL( const TDesC8& aUid, const TDesC8& aParam, CMCSData& aData )
+ {
+ TInt id( KErrNotFound );
+ TLex8 lextmp( aUid);
+ lextmp.Val( id );
+
+ TMenuItem item;
+ item.SetType( KMenuTypeMailbox );
+ item.SetId( id );
+ aData.SetMenuItem( item );
+
+ HBufC* param( NULL );
+ param = AiUtility::CopyToBufferL( param, aParam );
+ CleanupStack::PushL( param );
+
+ aData.SetNameL( *param );
+
+ CleanupStack::PopAndDestroy( param );
+ }
+
+// ---------------------------------------------------------------------------
+// Gets data item from MCS
+// ---------------------------------------------------------------------------
+//
+void CMCSPluginData::GetMCSDataL( RPointerArray<HSPluginSettingsIf::CPropertyMap>& aProperties,
+ CMCSData& aData)
{
CMenuFilter* filter = CMenuFilter::NewLC();
@@ -226,25 +418,10 @@
// Criterias will be added to filter if setting defines them
filter->DoNotHaveAttributeL( KMenuAttrView );
filter->DoNotHaveAttributeL( KMenuAttrParam );
- TBool isFolder = EFalse;
- // first, we need to check if the item is folder
- for ( TInt i = 0; i < aProperties.Count(); i++ )
- {
- if ( aProperties[i]->Name() == KProperNameType )
- {
- if ( aProperties[i]->Value() == KProperValueFolder )
- {
- isFolder = ETrue;
- }
- break;
- }
- }
-
// then add all property/value pairs to the filter
for ( TInt i = 0; i < aProperties.Count(); i++ )
{
-
// skip the type property
if( aProperties[i]->Name() == KProperNameType )
{
@@ -260,29 +437,7 @@
if ( value->Length() != 0 )
{
- // in case of folder, we just have to extract
- // id from param attribute and return item with this id
- if ( aProperties[i]->Name() == KProperNameParam && isFolder )
- {
- TMenuItem item;
- // convert id to integer
- TInt id;
- TLex16 lextmp( value->Ptr() );
- lextmp.Val( id );
- item.SetType( KMenuTypeFolder );
- item.SetId( id );
-
- CleanupStack::PopAndDestroy( value );
- CleanupStack::PopAndDestroy( name );
- CleanupStack::PopAndDestroy( filter );
-
- return item;
- }
- else
- {
- // otherwise, we just add name/value into filter
- filter->HaveAttributeL( *name, *value );
- }
+ filter->HaveAttributeL( *name, *value );
}
CleanupStack::PopAndDestroy( value );
CleanupStack::PopAndDestroy( name );
@@ -293,407 +448,65 @@
TMenuItem item = iEngine.FindMenuItemL( *filter );
CleanupStack::PopAndDestroy( filter );
- return item;
+ aData.SetMenuItem( item );
}
// ---------------------------------------------------------------------------
// Returns menu item for given index
// ---------------------------------------------------------------------------
//
-TMCSData& CMCSPluginData::DataItemL( TInt aIndex )
+CMCSData& CMCSPluginData::DataItemL( TInt aIndex )
{
if( aIndex < 0 || aIndex >= iData.Count())
{
User::Leave( KErrArgument );
}
- return iData[aIndex];
+ return *iData[aIndex];
}
// ---------------------------------------------------------------------------
-// Replaces menuitem in data instance
+// Save the undefined item.
// ---------------------------------------------------------------------------
//
-void CMCSPluginData::ReplaceMenuItemL( const TInt& aIndex, TMenuItem& aMenuItem )
- {
- TMCSData& data = iData[aIndex];
- data.SetMenuItem( aMenuItem );
- data.SetDirty( ETrue );
- }
-
-// ---------------------------------------------------------------------------
-// Save the setting persistently to HSPS
-// TODO HSPS setting api should be changed so that items and properties can
-// be added/removed dynamically. Now widgetconfiguration.xml must have all the
-// properties for every item even though property is not used.
-// It makes this function more compolicated.
-// ---------------------------------------------------------------------------
-//
-void CMCSPluginData::SaveSettingsL( const TInt& aIndex, CMenuItem& aMenuItem )
+void CMCSPluginData::SaveUndefinedItemL( const TInt& aIndex )
{
RPointerArray<CItemMap> settingItems;
CleanupClosePushL( settingItems );
iPluginSettings->GetSettingsL( iInstanceUid, settingItems );
if ( aIndex >= 0 && aIndex < settingItems.Count() )
{
- TBool exists( EFalse );
- CItemMap* itemMap = settingItems[aIndex];
+ CItemMap* itemMap = settingItems[ aIndex ];
RPointerArray<HSPluginSettingsIf::CPropertyMap> properties;
properties = itemMap->Properties();
- for ( TInt i= 0; i < properties.Count(); i++ )
+ for ( TInt i = 0; i < properties.Count(); i++ )
{
- if ( properties[i]->Name() == KProperNameType )
+ if ( properties[ i ]->Name() == KProperNameType )
{
- TPtrC type = aMenuItem.Type();
- if ( type == KMenuTypeUrl )
- {
- properties[i]->SetValueL( KProperValueBookmark );
- }
- else
- {
- properties[i]->SetValueL( KProperValueAppl );
- }
+ properties[ i ]->SetValueL( KProperValueAppl );
}
- else if ( properties[i]->Name() == KProperNameUid )
+ else if ( properties[ i ]->Name() == KProperNameUid )
{
- TPtrC uid = aMenuItem.GetAttributeL( KMenuAttrUid, exists );
- if ( exists )
- {
- HBufC8* uid8( NULL );
- uid8 = AiUtility::CopyToBufferL( uid8, uid );
- CleanupStack::PushL( uid8 );
- properties[i]->SetValueL( *uid8 );
- CleanupStack::PopAndDestroy( uid8 );
- }
- else
- {
- properties[i]->SetValueL( KNullDesC8 );
- }
+ properties[ i ]->SetValueL( KMenuAttrUndefUid );
}
- else if ( properties[i]->Name() == KProperNameView )
+ else if ( properties[ i ]->Name() == KProperNameView )
{
- TPtrC view = aMenuItem.GetAttributeL( KMenuAttrView, exists );
- if ( exists )
- {
- HBufC8* view8( NULL );
- view8 = AiUtility::CopyToBufferL( view8, view );
- CleanupStack::PushL( view8 );
- properties[i]->SetValueL( *view8 );
- CleanupStack::PopAndDestroy( view8 );
- }
- else
- {
- properties[i]->SetValueL( KNullDesC8 );
- }
+ properties[ i ]->SetValueL( KNullDesC8 );
}
- else if ( properties[i]->Name() == KProperNameParam )
+ else if ( properties[ i ]->Name() == KProperNameParam )
{
- TPtrC param = aMenuItem.GetAttributeL( KMenuAttrParam, exists );
- if ( exists )
- {
- HBufC8* param8( NULL );
- param8 = AiUtility::CopyToBufferL( param8, param );
- CleanupStack::PushL( param8 );
- properties[i]->SetValueL( *param8 );
- CleanupStack::PopAndDestroy( param8 );
- }
- else
- {
- properties[i]->SetValueL( KNullDesC8 );
- }
+ properties[ i ]->SetValueL( KNullDesC8 );
+ }
+ else if ( properties[ i ]->Name() == KProperNameLocked )
+ {
+ properties[i]->SetValueL( KNullDesC8 );
}
}
}
- // ETrue tells that changes are stored also to plugin reference
+ // ETrue tells that modified settings are stored also to plugin reference
iPluginSettings->SetSettingsL( iInstanceUid, settingItems, ETrue );
- CleanupStack::PopAndDestroy( &settingItems );
- }
-
-// ---------------------------------------------------------------------------
-// Gets MCS Plugin folder ID. This hidden folder in matrixmenudata.xml is used
-// for storing run-time generated menuitems
-// ---------------------------------------------------------------------------
-//
-TInt CMCSPluginData::GetMCSPluginFolderIdL()
- {
- TInt folderId;
-
- _LIT( KMCSFolder, "mcsplugin_folder" );
+ CleanupStack::Pop( &settingItems );
+ settingItems.ResetAndDestroy();
- CMenuItem* item( NULL );
- CMenuFilter* filter = CMenuFilter::NewL();
- CleanupStack::PushL( filter );
- filter->SetType( KMenuTypeFolder );
- filter->HaveAttributeL( KMenuAttrLongName, KMCSFolder );
-
- const TInt rootId = iMenu.RootFolderL();
- RArray<TMenuItem> itemArray;
- CleanupClosePushL( itemArray );
- iMenu.GetItemsL( itemArray, rootId, filter, ETrue );
- if ( itemArray.Count() > 0 )
- {
- item = CMenuItem::OpenL( iMenu, itemArray[0] );
- folderId = item->Id();
- }
- else
- {
- folderId = iMenu.RootFolderL();
- }
- CleanupStack::PopAndDestroy( &itemArray );
- CleanupStack::PopAndDestroy( filter );
-
- delete item;
-
- return folderId;
}
-// ---------------------------------------------------------------------------
-// Creates runtime generated menuitems (bookmarks/mailboxes if they
-// it does not exist yet in MCS. If they do, their ref_count is incremented.
-// Called during Plugin startup.
-// ---------------------------------------------------------------------------
-//
-void CMCSPluginData::CreateRuntimeMenuItemsL()
- {
-
- // start mailboxes observing and get the number of
- // mailboxes defined in the device
-
- TMsvId entryID = KMsvRootIndexEntryIdValue;
- CMsvEntry* rootEntry = iMsvSession->GetEntryL( entryID );
- TInt mailboxCount = rootEntry->Count();
- CleanupStack::PushL( rootEntry );
-
- RPointerArray<CItemMap> settings;
- TCleanupItem settingsCleanupItem( ItemMapArrayCleanupFunc, &settings );
- CleanupStack::PushL( settingsCleanupItem );
- iPluginSettings->GetSettingsL( iInstanceUid, settings );
-
- RFavouritesSession bookmarkSess;
- RFavouritesDb bookmarkDb;
-
- User::LeaveIfError( bookmarkSess.Connect() );
- User::LeaveIfError( bookmarkDb.Open( bookmarkSess, KBrowserBookmarks ));
-
- TInt count = settings.Count();
- for( TInt i = 0; i < count; i++ )
- {
- CItemMap* itemMap = settings[i];
- RPointerArray<HSPluginSettingsIf::CPropertyMap>& properties
- = itemMap->Properties();
-
- TPtrC8 uid8, type, param8;
-
- for( TInt j = 0; j < properties.Count(); j++ )
- {
-
- if( properties[j]->Name() == KProperNameType )
- {
- type.Set( properties[j]->Value() );
- }
- else if ( properties[j]->Name() == KProperNameUid )
- {
- uid8.Set( properties[j]->Value() );
- }
- else if ( properties[j]->Name() == KProperNameParam )
- {
- param8.Set( properties[j]->Value() );
- }
- }
-
- if( type == KProperValueBookmark )
- {
-
- // The shortcut is a bookmark
- TMenuItem menuItem = CreateMenuItemL( properties );
-
- CActiveSchedulerWait* wait =
- new ( ELeave ) CActiveSchedulerWait;
- CleanupStack::PushL( wait );
-
- if( menuItem.Id() == 0 )
- {
- TLex8 uidLex( uid8.Mid( 1, uid8.Length() - 2 ) );
- TUint32 id;
- uidLex.Val(id, EHex);
-
- CFavouritesItem* bkmItem = CFavouritesItem::NewLC();
- TInt bcount = bookmarkDb.Get( TInt32( id ), *bkmItem );
-
- HBufC *uid( NULL );
- uid = AiUtility::CopyToBufferL( uid, uid8 );
- CleanupStack::PushL( uid );
-
- CMenuItem* newItem = CMenuItem::CreateL( iMenu,
- KMenuTypeUrl,
- GetMCSPluginFolderIdL(),
- 0 );
- CleanupStack::PushL( newItem );
-
- newItem->SetAttributeL( KMenuAttrUid, *uid );
- newItem->SetAttributeL( KMenuAttrLongName, bkmItem->Name() );
- newItem->SetAttributeL( KMenuAttrIconFile, KMenuIconFile );
- newItem->SetAttributeL( KMenuAttrIconId, KMenuBookmarkIconId );
- newItem->SetAttributeL( KMenuAttrMaskId, KMenuBookmarkMaskId );
- newItem->SetAttributeL( KMenuAttrRefcount, KInitialRefCount );
- newItem->SetAttributeL( KUrl , bkmItem->Url() );
-
- CMenuOperation* op = newItem->SaveL( iSaveWatcher->iStatus );
-
- iSaveWatcher->StopAndWatch( op, wait );
-
- // Start the nested scheduler loop.
- wait->Start();
-
- SaveSettingsL( i, *newItem );
-
- CleanupStack::PopAndDestroy( newItem );
- CleanupStack::PopAndDestroy( uid );
- CleanupStack::PopAndDestroy( bkmItem );
- }
- else
- {
- CMenuItem* item = CMenuItem::OpenL( iMenu, menuItem );
- CleanupStack::PushL( item );
- if ( iEngine.UpdateMenuItemsRefCountL( item, 1 ) > 0 )
- {
- CMenuOperation* op = item->SaveL( iSaveWatcher->iStatus );
- iSaveWatcher->StopAndWatch( op, wait );
- // Start the nested scheduler loop.
- wait->Start();
- SaveSettingsL( i, *item );
- }
- CleanupStack::PopAndDestroy( item );
- }
-
- CleanupStack::PopAndDestroy( wait );
- wait = NULL;
- }
-
- else if ( uid8 == KMailboxUid8 && mailboxCount > 0 )
- {
- // The shortcut is a Mailbox
-
- TMenuItem menuItem = CreateMenuItemL( properties );
-
- CActiveSchedulerWait* wait =
- new ( ELeave ) CActiveSchedulerWait;
- CleanupStack::PushL( wait );
-
- if ( menuItem.Id() == 0 )
- {
- // mailbox menuitem does not exist yet. We have to create it
- // first, we try to find its ID among existing mailboxes:bì
-
- // extract Mailbox ID from HSPS
- TInt pos = param8.Locate( TChar( ':' ) ) + 1;
- TPtrC8 mailboxId8 = param8.Mid( pos );
-
- HBufC *mailboxId( NULL );
- mailboxId = AiUtility::CopyToBufferL( mailboxId, mailboxId8 );
- CleanupStack::PushL( mailboxId );
-
- // compare ID with existing mailboxes
- rootEntry->SetSortTypeL( TMsvSelectionOrdering(
- KMsvGroupByType | KMsvGroupByStandardFolders,
- EMsvSortByDetailsReverse, ETrue ) );
-
- TBuf<255> boxId;
- TBool found = EFalse;
- TInt index = rootEntry->Count();
-
- while ( !found && --index >= 0 )
- {
- const TMsvEntry& tentry = ( *rootEntry )[ index ];
- if ( tentry.iMtm.iUid == KMCSCmailMtmUidValue )
- {
- boxId.Num( tentry.Id() );
- if ( boxId == *mailboxId )
- {
- found = ETrue;
- }
- }
- }
-
- CleanupStack::PopAndDestroy( mailboxId );
-
- // mailbox still exists in Mail application
- // we have to create a new menuitem
- if ( found )
- {
-
- // get the mailbox name
- const TMsvEntry& tentry = ( *rootEntry )[ index ];
- TPtrC name = tentry.iDetails;
-
- HBufC *param( NULL );
- param = AiUtility::CopyToBufferL( param, param8 );
- CleanupStack::PushL( param );
-
- // create a new menuitem with ref_count 1
- CMenuItem* newItem = CMenuItem::CreateL( iMenu,
- KMenuTypeShortcut,
- GetMCSPluginFolderIdL(),
- 0 );
- CleanupStack::PushL( newItem );
-
- // mailbox is a shortcut item with "mailbox:mailboxID" parameter
- newItem->SetAttributeL( KMenuAttrUid, KMailboxUid );
- newItem->SetAttributeL( KMenuAttrLongName, name );
- newItem->SetAttributeL( KMenuAttrParameter, *param );
- newItem->SetAttributeL( KMenuAttrRefcount, KInitialRefCount );
-
- // setting icon for the shortcut
- newItem->SetAttributeL( KMenuAttrIconFile, KMenuIconFile );
- newItem->SetAttributeL( KMenuAttrIconId, KMenuMailboxIconId );
- newItem->SetAttributeL( KMenuAttrMaskId, KMenuMailboxMaskId );
-
- CMenuOperation* op = newItem->SaveL( iSaveWatcher->iStatus );
- iSaveWatcher->StopAndWatch( op, wait );
-
- // Start the nested scheduler loop.
- wait->Start();
-
- SaveSettingsL( i, *newItem );
-
- CleanupStack::PopAndDestroy( newItem );
- CleanupStack::PopAndDestroy( param );
- }
- }
- else
- {
- // mailbox menu item already exists -> increment ref_count by 1
- CMenuItem* item = CMenuItem::OpenL( iMenu, menuItem );
- CleanupStack::PushL( item );
- if ( iEngine.UpdateMenuItemsRefCountL( item, 1 ) > 0 )
- {
- CMenuOperation* op = item->SaveL( iSaveWatcher->iStatus );
- iSaveWatcher->StopAndWatch( op, wait );
-
- // Start the nested scheduler loop.
- wait->Start();
- SaveSettingsL( i, *item );
- }
- CleanupStack::PopAndDestroy( item );
- }
- CleanupStack::PopAndDestroy( wait );
- wait = NULL;
-
- }
- }
- CleanupStack::PopAndDestroy(); // settingsCleanupItem
- CleanupStack::PopAndDestroy( rootEntry );
- }
-
-// ---------------------------------------------------------------------------
-// From class MMsvSessionObserver.
-// Handles an event from the message server.
-// ---------------------------------------------------------------------------
-//
-void CMCSPluginData::HandleSessionEventL(
- TMsvSessionEvent /*aEvent*/,
- TAny* /*aArg1*/,
- TAny* /*aArg2*/,
- TAny* /*aArg3*/ )
- {
-
- }
+// End of file
--- a/idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-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"
@@ -15,31 +15,28 @@
*
*/
-
// System includes
#include <gulicon.h>
-#include <AknsItemID.h>
#include <gslauncher.h>
-#include <mcsmenuitem.h>
#include <mcsmenufilter.h>
#include <mcsmenuoperation.h>
#include <mcsmenuiconutility.h>
-#include <activefavouritesdbnotifier.h>
-#include <favouritesitemlist.h>
#include <bautils.h>
#include <StringLoader.h>
#include <aknnotedialog.h>
-#include <AknsConstants.h>
-#include <avkon.rsg>
#include <mcspluginres.rsg>
-#include <apgtask.h>
#include <apgcli.h>
#include <apacmdln.h>
#include <gfxtranseffect/gfxtranseffect.h>
#include <akntranseffect.h>
+#include <schemehandler.h>
+#include <viewcli.h> // For CVwsSessionWrapper
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <viewclipartner.h>
+#endif
+#include <aisystemuids.hrh>
// User includes
-#include <aisystemuids.hrh>
#include "mcspluginengine.h"
#include "mcsplugin.h"
#include "mcsplugindata.h"
@@ -52,21 +49,29 @@
_LIT( KResourceDrive, "Z:" );
_LIT( KResourceFile, "mcspluginres.rsc" );
_LIT( KResPath, "\\resource\\" );
-_LIT( KMenuAttrRefcount, "ref_count" );
_LIT( KMMApplication, "mm://" );
_LIT( KHideExit2, "&exit=hide" );
_LIT( KSetFocusString, "!setfocus?applicationgroup_name=" );
_LIT( KApplicationGroupName, "applicationgroup_name" );
_LIT( KIcon, "icon" );
_LIT( KMenuAttrUndefUid, "0x99999991" );
+_LIT( KMenuIconFile, "aimcsplugin.mif" );
+_LIT( KMenuBookmarkIconId, "16386" );
+_LIT( KMenuBookmarkMaskId, "16387" );
+_LIT( KMenuMailboxIconId, "16388" );
+_LIT( KMenuMailboxMaskId, "16389" );
+_LIT( KMenuTypeMailbox, "menu:mailbox" );
+_LIT( KPrefix, "0x" );
const TUid KHomescreenUid = { AI_UID3_AIFW_COMMON };
const TUid KMMUid = { 0x101F4CD2 };
+const TUid KMCSCmailUidValue = { 0x2001E277 };
+const TUid KMCSCmailMailboxViewIdValue = { 0x2 };
+const TUid KBrowserUid = { 0x10008D39 };
// ======== LOCAL FUNCTIONS ========
// ----------------------------------------------------------------------------
// NextIdToken
-//
// ----------------------------------------------------------------------------
//
static TPtrC NextIdToken( TLex& aLexer )
@@ -82,6 +87,65 @@
return aLexer.MarkedToken();
}
+// ----------------------------------------------------------------------------
+// Shows note dailog, with the given resource.
+// ----------------------------------------------------------------------------
+//
+static void ShowNoteDlgL( TInt aResource )
+ {
+ HBufC* temp = StringLoader::LoadLC( aResource );
+
+ CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog(
+ CAknNoteDialog::EConfirmationTone,
+ CAknNoteDialog::ENoTimeout );
+ CleanupStack::PushL( dialog );
+ dialog->SetTextL( temp->Des() );
+ dialog->ExecuteDlgLD( R_MCS_DISABLE_OPEN_ITEM_DLG );
+ CleanupStack::Pop( dialog );
+ CleanupStack::PopAndDestroy( temp );
+ }
+
+// ----------------------------------------------------------------------------
+// Parses uid in Hexadecimal format from the given string.
+// ----------------------------------------------------------------------------
+//
+TUid ParseHexUidFromString(const TDesC& aUidString )
+ {
+ TUid uid( KNullUid );
+ const TInt pos( aUidString.FindF( KPrefix ) );
+
+ if ( pos != KErrNotFound )
+ {
+ TLex lex( aUidString.Mid( pos + KPrefix().Length() ) );
+
+ // Hex parsing needs unsigned int
+ TUint32 value( 0 );
+ const TInt parseResult( lex.Val( value, EHex ) );
+
+ if ( parseResult == KErrNone )
+ {
+ TInt32 value32( value );
+ uid.iUid = value32;
+ }
+ }
+ return uid;
+ }
+
+// ----------------------------------------------------------------------------
+// Start transition effect. User has launched the application with the given uid.
+// ----------------------------------------------------------------------------
+//
+void StartEffect( TUid aUid )
+ {
+ //start a full screen effect
+ GfxTransEffect::BeginFullScreen(
+ AknTransEffect::EApplicationStart,
+ TRect(),
+ AknTransEffect::EParameterType,
+ AknTransEffect::GfxTransParam( aUid,
+ AknTransEffect::TParameter::EActivateExplicitContinue ));
+ }
+
// ============================ MEMBER FUNCTIONS ===============================
// ----------------------------------------------------------------------------
// CMCSPluginEngine::CMCSPluginEngine
@@ -136,7 +200,6 @@
filter->HaveAttributeL( KMenuAttrUid, KMenuAttrUndefUid );
iUndefinedItemHeader = FindMenuItemL( *filter );
CleanupStack::PopAndDestroy( filter );
- filter = NULL;
iUndefinedItem = CMenuItem::OpenL( iMenu, iUndefinedItemHeader );
}
@@ -152,17 +215,11 @@
delete iPluginData;
iMenu.Close();
- //iWatcher->Cancel();
delete iWatcher;
-
CCoeEnv::Static()->DeleteResourceFile( iResourceOffset );
- if ( iUndefinedItem )
- {
- delete iUndefinedItem;
- iUndefinedItem = NULL;
- }
+ delete iUndefinedItem;
}
// ---------------------------------------------------------------------------
@@ -183,9 +240,7 @@
iNotifyWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::ENotify );
iNotifier.Notify( 0,
- RMenuNotifier::EItemsAddedRemoved |
- RMenuNotifier::EItemsReordered |
- RMenuNotifier::EItemAttributeChanged,
+ RMenuNotifier::EItemsAddedRemoved,
iNotifyWatcher->iStatus );
iNotifyWatcher->WatchNotify( this );
}
@@ -218,7 +273,7 @@
//
// ---------------------------------------------------------------------------
//
-TMCSData& CMCSPluginEngine::MenuDataL( const TInt& aIndex )
+CMCSData& CMCSPluginEngine::MenuDataL( const TInt& aIndex )
{
return iPluginData->DataItemL( aIndex );
}
@@ -263,9 +318,62 @@
// Returns the actual menu item for the given header.
// ---------------------------------------------------------------------------
//
-CMenuItem* CMCSPluginEngine::FetchMenuItemL( const TMenuItem& aMenuItem )
+CMenuItem* CMCSPluginEngine::FetchMenuItemL( CMCSData& aData )
+ {
+ if( aData.MenuItem().Type() == KMenuTypeUrl )
+ {
+ return CreateBkmItemL( aData );
+ }
+ else if( aData.MenuItem().Type() == KMenuTypeMailbox )
+ {
+ return CreateMailboxItemL( aData);
+ }
+ else
+ {
+ CMenuItem* item = NULL;
+ TRAP_IGNORE( item = CMenuItem::OpenL( iMenu, aData.MenuItem().Id() ) );
+ return item;
+ }
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CMenuItem* CMCSPluginEngine::CreateBkmItemL( CMCSData& aData )
{
- return CMenuItem::OpenL( iMenu, aMenuItem );
+ CMenuItem* item( NULL );
+ if( aData.MenuItem().Id() != KErrNotFound )
+ {
+ item = CMenuItem::CreateL( iMenu, KMenuTypeUrl, 0, 0 );
+ CleanupStack::PushL( item );
+ item->SetAttributeL( KMenuAttrLongName, aData.Name() );
+ item->SetAttributeL( KMenuAttrIconFile, KMenuIconFile );
+ item->SetAttributeL( KMenuAttrIconId, KMenuBookmarkIconId );
+ item->SetAttributeL( KMenuAttrMaskId, KMenuBookmarkMaskId );
+ CleanupStack::Pop( item );
+ }
+ return item;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CMenuItem* CMCSPluginEngine::CreateMailboxItemL( CMCSData& aData )
+ {
+ CMenuItem* item( NULL );
+ if( aData.MenuItem().Id() != KErrNotFound )
+ {
+ item = CMenuItem::CreateL( iMenu, KMenuTypeMailbox, 0, 0 );
+ CleanupStack::PushL( item );
+ item->SetAttributeL( KMenuAttrLongName, aData.Name() );
+ item->SetAttributeL( KMenuAttrIconFile, KMenuIconFile );
+ item->SetAttributeL( KMenuAttrIconId, KMenuMailboxIconId );
+ item->SetAttributeL( KMenuAttrMaskId, KMenuMailboxMaskId );
+ CleanupStack::Pop( item );
+ }
+ return item;
}
// ---------------------------------------------------------------------------
@@ -283,14 +391,7 @@
// check if item exists in MCS
if ( aMenuItem )
{
- TInt id = aMenuItem->Id();
-
- // because the flags might have changed, we have
- // to get a fresh copy of menu item from Menu Server
- CMenuItem* mi = CMenuItem::OpenL( iMenu, id );
- TUint32 flags = mi->Flags();
- delete mi;
-
+ TUint32 flags = aMenuItem->Flags();
TUint32 isHidden = flags & TMenuItem::EHidden;
TUint32 isMissing = flags & TMenuItem::EMissing;
@@ -358,14 +459,7 @@
// check if item exists in MCS
if ( aMenuItem )
{
- TInt id = aMenuItem->Id();
-
- // because the flags might have changed, we have
- // to get a fresh copy of the menu item from Menu Server
- CMenuItem* mi = CMenuItem::OpenL( iMenu, id );
- TUint32 flags = mi->Flags();
- delete mi;
-
+ TUint32 flags = aMenuItem->Flags();
TUint32 isHidden = flags & TMenuItem::EHidden;
TUint32 isMissing = flags & TMenuItem::EMissing;
@@ -407,51 +501,172 @@
{
if ( iBackupRestore )
{
- HBufC* temp = StringLoader::LoadLC( R_MCS_DISABLE_OPEN_ITEM );
+ ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM );
+ return;
+ }
+
+ CMCSData& dataItem( iPluginData->DataItemL( aIndex ) );
+ // run item based on its type
+ TPtrC type( dataItem.MenuItem().Type());
+
+ // run folder
+ if ( type == KMenuTypeFolder )
+ {
+ LaunchFolderItemL( dataItem );
+ }
+ else if( type == KMenuTypeUrl )
+ {
+ LaunchBookmarkItemL( dataItem );
+ }
+ else if( type == KMenuTypeMailbox )
+ {
+ LaunchMailboxItemL( dataItem );
+ }
+ else
+ {
+ LaunchMCSItemL( dataItem );
+ }
+ }
- CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog(
- CAknNoteDialog::EConfirmationTone,
- CAknNoteDialog::ENoTimeout );
- CleanupStack::PushL( dialog );
- dialog->SetTextL( temp->Des() );
- dialog->ExecuteDlgLD( R_MCS_DISABLE_OPEN_ITEM_DLG );
- CleanupStack::Pop( dialog );
- CleanupStack::PopAndDestroy( temp );
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMCSPluginEngine::LaunchFolderItemL( CMCSData& aData )
+ {
+ CMenuItem* item = NULL;
+ TRAP_IGNORE( item = CMenuItem::OpenL( iMenu, aData.MenuItem().Id() ) );
+
+ // item does not exist at all in MCS
+ if ( item == NULL )
+ {
+ ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING );
+ return;
+ }
+
+ CleanupStack::PushL( item );
+
+ StartEffect( KMMUid );
+
+ // message for MM application
+ HBufC8* message;
+
+ // prepare message for launching folder
+ TBool hasApplicationGroupName( EFalse );
+
+ TPtrC applicationGroupName( item->GetAttributeL(
+ KApplicationGroupName, hasApplicationGroupName ) );
+
+ if ( !hasApplicationGroupName )
+ {
return;
}
+ message = HBufC8::NewLC( KMMApplication().Length() +
+ KSetFocusString().Length() +
+ applicationGroupName.Length() +
+ KHideExit2().Length() );
+
+ message->Des().Copy( KMMApplication );
+ message->Des().Append( KSetFocusString );
+ message->Des().Append( applicationGroupName );
+ message->Des().Append( KHideExit2 );
+
+ // find MM application
+ TApaTaskList taskList( CCoeEnv::Static()->WsSession() );
+ TApaTask task( taskList.FindApp( KMMUid ) );
+
+ if ( task.Exists() )
+ {
+ // MM is already running in background - send APA Message
+ task.SendMessage(
+ TUid::Uid( KUidApaMessageSwitchOpenFileValue ), *message );
+ }
+ else
+ {
+ // MM not running yet - use Command Line Tail
+ RApaLsSession appArcSession;
+ CleanupClosePushL( appArcSession );
+
+ User::LeaveIfError( appArcSession.Connect() );
+
+ TApaAppInfo appInfo;
+ TInt err( appArcSession.GetAppInfo( appInfo, KMMUid ) );
+
+ if ( err == KErrNone )
+ {
+ CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
+ cmdLine->SetExecutableNameL( appInfo.iFullName );
+ cmdLine->SetCommandL( EApaCommandRun );
+ cmdLine->SetTailEndL( *message );
+ appArcSession.StartApp( *cmdLine );
+ CleanupStack::PopAndDestroy( cmdLine );
+ }
+ CleanupStack::PopAndDestroy( &appArcSession );
+ }
+ CleanupStack::PopAndDestroy( message );
+ CleanupStack::PopAndDestroy( item );
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMCSPluginEngine::LaunchBookmarkItemL( CMCSData& aData )
+ {
+ StartEffect( KBrowserUid );
+
+ CSchemeHandler* urlHandler = CSchemeHandler::NewL( aData.Value());
+ CleanupStack::PushL( urlHandler );
+ urlHandler->HandleUrlStandaloneL();
+ CleanupStack::PopAndDestroy( urlHandler );
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMCSPluginEngine::LaunchMailboxItemL( CMCSData& aData )
+ {
+ TInt id( aData.MenuItem().Id());
+ if ( id == KErrNotFound )
+ {
+ ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING );
+ return;
+ }
+
+ StartEffect( KMCSCmailUidValue );
+
+ TUid uId = TUid::Uid( id );
+ const TVwsViewId viewId( KMCSCmailUidValue, KMCSCmailMailboxViewIdValue );
+ CVwsSessionWrapper* vwsSession = CVwsSessionWrapper::NewL();
+ vwsSession->CreateActivateViewEvent( viewId, uId, KNullDesC8() );
+ delete vwsSession;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CMCSPluginEngine::LaunchMCSItemL( CMCSData& aData )
+ {
if( iWatcher->IsActive())
{
return;
}
-
- TMCSData& dataItem( iPluginData->DataItemL( aIndex ) );
-
CMenuItem* item = NULL;
- TRAP_IGNORE( item = CMenuItem::OpenL( iMenu, dataItem.MenuItem().Id() ) );
+ TRAP_IGNORE( item = CMenuItem::OpenL( iMenu, aData.MenuItem().Id() ) );
// item does not exist at all in MCS
if ( item == NULL )
{
- HBufC* temp = StringLoader::LoadLC( R_MCS_DISABLE_OPEN_ITEM_MISSING );
-
- CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog(
- CAknNoteDialog::EConfirmationTone,
- CAknNoteDialog::ENoTimeout );
- CleanupStack::PushL( dialog );
- dialog->SetTextL( temp->Des() );
- dialog->ExecuteDlgLD( R_MCS_DISABLE_OPEN_ITEM_DLG );
- CleanupStack::Pop( dialog );
- CleanupStack::PopAndDestroy( temp );
- temp = NULL;
-
+ ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING );
return;
}
CleanupStack::PushL( item );
-
+
TBool attrExists = ETrue;
-
TPtrC uid = item->GetAttributeL( KMenuAttrUid, attrExists );
// trying to run hidden or missing application (e.g. unistalled app
@@ -463,136 +678,19 @@
if ( ( attrExists && uid == KMenuAttrUndefUid ) || isHidden || isMissing )
{
CleanupStack::PopAndDestroy( item );
-
- HBufC* temp = StringLoader::LoadLC( R_MCS_DISABLE_OPEN_ITEM_MISSING );
-
- CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog(
- CAknNoteDialog::EConfirmationTone,
- CAknNoteDialog::ENoTimeout );
- CleanupStack::PushL( dialog );
- dialog->SetTextL( temp->Des() );
- dialog->ExecuteDlgLD( R_MCS_DISABLE_OPEN_ITEM_DLG );
- CleanupStack::Pop( dialog );
- CleanupStack::PopAndDestroy( temp );
- temp = NULL;
-
+ ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING );
return;
}
-
- // run item based on its type
- TPtrC type( item->Type() );
-
- // run folder
- if ( type == KMenuTypeFolder )
- {
- // message for MM application
- HBufC8* message;
-
- // prepare message for launching folder
- TBool hasApplicationGroupName( EFalse );
-
- TPtrC applicationGroupName( item->GetAttributeL(
- KApplicationGroupName, hasApplicationGroupName ) );
-
- if ( !hasApplicationGroupName )
- {
- CleanupStack::PopAndDestroy( item );
- return;
- }
-
- message = HBufC8::NewLC( KMMApplication().Length() +
- KSetFocusString().Length() +
- applicationGroupName.Length() +
- KHideExit2().Length() );
-
- message->Des().Copy( KMMApplication );
- message->Des().Append( KSetFocusString );
- message->Des().Append( applicationGroupName );
- message->Des().Append( KHideExit2 );
-
- // find MM application
- TApaTaskList taskList( CCoeEnv::Static()->WsSession() );
- TApaTask task( taskList.FindApp( KMMUid ) );
-
- if ( task.Exists() )
- {
- // MM is already running in background - send APA Message
- task.SendMessage(
- TUid::Uid( KUidApaMessageSwitchOpenFileValue ), *message );
- }
- else
- {
- // MM not running yet - use Command Line Tail
- RApaLsSession appArcSession;
- CleanupClosePushL( appArcSession );
-
- User::LeaveIfError( appArcSession.Connect() );
-
- TApaAppInfo appInfo;
- TInt err( appArcSession.GetAppInfo( appInfo, KMMUid ) );
-
- if ( err == KErrNone )
- {
- CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
- cmdLine->SetExecutableNameL( appInfo.iFullName );
- cmdLine->SetCommandL( EApaCommandRun );
- cmdLine->SetTailEndL( *message );
- appArcSession.StartApp( *cmdLine );
- CleanupStack::PopAndDestroy( cmdLine );
- }
-
- CleanupStack::PopAndDestroy( &appArcSession );
- }
-
- CleanupStack::PopAndDestroy( message );
- }
- else
- {
- TBool exists( EFalse );
-
- TPtrC desc( item->GetAttributeL( KMenuAttrUid, exists ) );
-
- if ( exists )
- {
- _LIT( KPrefix, "0x" );
-
- const TInt pos( desc.FindF( KPrefix ) );
-
- if ( pos != KErrNotFound )
- {
- TLex lex( desc.Mid( pos + KPrefix().Length() ) );
-
- // Hex parsing needs unsigned int
- TUint32 value( 0 );
- const TInt parseResult( lex.Val( value, EHex ) );
-
- if ( parseResult == KErrNone )
- {
- TUid uid( KNullUid );
- TInt32 value32( value );
- uid.iUid = value32;
-
- if ( uid != KNullUid )
- {
- //start a full screen effect
- GfxTransEffect::BeginFullScreen(
- AknTransEffect::EApplicationStart,
- TRect(),
- AknTransEffect::EParameterType,
- AknTransEffect::GfxTransParam( uid,
- AknTransEffect::TParameter::EActivateExplicitContinue ) );
- }
- }
- }
- }
-
- // run application/shortcut/bookmark
- CMenuOperation* operation( item->HandleCommandL(
- KMenuCmdOpen, KNullDesC8, iWatcher->iStatus ) );
-
- iWatcher->Watch( operation );
+
+ if ( attrExists )
+ {
+ StartEffect( ParseHexUidFromString( uid ));
}
+ // run application/shortcut
+ CMenuOperation* operation( item->HandleCommandL(
+ KMenuCmdOpen, KNullDesC8, iWatcher->iStatus ) );
+ iWatcher->Watch( operation );
CleanupStack::PopAndDestroy( item );
}
@@ -607,23 +705,16 @@
for ( TInt i = 0; i < count; i++ )
{
- TMCSData& data( iPluginData->DataItemL( i ) );
+ CMCSData& data( iPluginData->DataItemL( i ) );
data.SetDirty( ETrue );
}
-
// Notification must be activated again
iNotifyWatcher->Cancel();
-
iNotifier.Notify( 0,
- RMenuNotifier::EItemsAddedRemoved |
- RMenuNotifier::EItemsReordered |
- RMenuNotifier::EItemAttributeChanged,
+ RMenuNotifier::EItemsAddedRemoved,
iNotifyWatcher->iStatus );
iNotifyWatcher->WatchNotify( this );
-
- // Publish changed data
- iPlugin.PublishL();
}
// ---------------------------------------------------------------------------
@@ -632,14 +723,18 @@
// ---------------------------------------------------------------------------
//
void CMCSPluginEngine::HandleSessionEventL( TMsvSessionEvent aEvent,
- TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+ TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/)
{
switch ( aEvent )
{
case EMsvEntriesDeleted:
- // fall-through intended here
- case EMsvEntriesChanged:
{
+ CMsvEntrySelection* sel = static_cast<CMsvEntrySelection*>( aArg1 );
+ TInt count( sel->Count());
+ for( TInt i = 0; i < count; i++ )
+ {
+ iPluginData->RemoveDataL( sel->At( i ) );
+ }
}
break;
default:
@@ -667,9 +762,7 @@
TUid uid = {AI_UID_ECOM_IMPLEMENTATION_SETTINGS_MCSPLUGIN};
CGSLauncher* launcher = CGSLauncher::NewLC();
-
launcher->LaunchGSViewL ( uid, KHomescreenUid, iInstanceUid );
-
CleanupStack::PopAndDestroy( launcher );
}
@@ -682,12 +775,10 @@
CMenuItem& aMenuItem )
{
TInt pos( aPath.Locate( ':' ) );
-
if ( pos == KErrNotFound )
{
pos = aPath.Length();
}
-
TPtrC skin( aPath.Left( pos ) );
TInt sf( skin.FindF( KSkin ) );
@@ -697,7 +788,6 @@
}
TPtrC temp( skin.Mid( sf + KSkin().Length() ) );
-
TLex input( temp );
input.SkipSpace();
@@ -705,15 +795,11 @@
{
input.Inc();
}
-
TPtrC majorId( NextIdToken( input ) );
TPtrC minorId( NextIdToken( input ) );
aMenuItem.SetAttributeL( KMenuAttrIconSkinMajorId, majorId );
aMenuItem.SetAttributeL( KMenuAttrIconSkinMinorId, minorId );
-
- //TPtrC mif = aPath.Mid( pos + 1 );
- //TInt mf = mif.FindF( KMif );
if ( aPath.Length() > pos &&
( aPath.Mid( pos + 1 ).FindF( KMif ) != KErrNotFound ) )
@@ -721,8 +807,6 @@
TPtrC mif( aPath.Mid( pos + 1 ) );
TInt mf( mif.FindF( KMif ) );
- //TPtrC temp1 = mif.Mid( mf+ KMif().Length());
-
TLex input1( mif.Mid( mf + KMif().Length() ) );
input1.SkipSpace();
@@ -743,124 +827,4 @@
return ETrue;
}
-// ---------------------------------------------------------------------------
-// CMCSPluginEngine::CleanMCSItemsL
-// Called during plugin desctruction
-// Decrements reference counters of all run-time generated items
-// and deletes those which have reference counter == 0
-// ---------------------------------------------------------------------------
-//
-void CMCSPluginEngine::CleanMCSItemsL()
- {
- iNotifier.Close();
- delete iNotifyWatcher;
- iNotifyWatcher = NULL;
-
- const TInt count( iPluginData->DataCount() );
-
- for( TInt i = 0; i < count; i++ )
- {
- TMCSData& data( iPluginData->DataItemL(i) );
-
- CMenuItem* menuItem = CMenuItem::OpenL( iMenu, data.MenuItem().Id() );
-
- if ( !menuItem )
- {
- continue;
- }
-
- CleanupStack::PushL( menuItem );
-
- // check if ref_count attribute exists
- TBool exists( EFalse );
-
- TPtrC param( menuItem->GetAttributeL( KMenuAttrRefcount, exists ) );
-
- if( exists )
- {
- const TInt references( UpdateMenuItemsRefCountL( menuItem, -1 ) );
-
- // Create a nested loop inside CActiveScheduler.
- CActiveSchedulerWait* wait =
- new ( ELeave ) CActiveSchedulerWait;
- CleanupStack::PushL( wait );
-
- if( references > 0 )
- {
- // if counter is still > 0, update its value in MCS
- CMenuOperation* op = menuItem->SaveL( iWatcher->iStatus );
- iWatcher->StopAndWatch( op, wait );
-
- // Start the nested scheduler loop.
- wait->Start();
- }
- else
- {
- // counter reached 0 -> item is not referenced by any shortcut
- // so remove it from MCS
- if( !iWatcher->IsActive() )
- {
- CMenuOperation* op =
- iMenu.RemoveL( menuItem->Id(), iWatcher->iStatus );
- iWatcher->StopAndWatch( op, wait );
-
- // Start the nested scheduler loop.
- wait->Start();
- }
- }
-
- CleanupStack::PopAndDestroy( wait );
- wait = NULL;
- }
-
- CleanupStack::PopAndDestroy( menuItem );
- menuItem = NULL;
- }
- }
-
-
-// ---------------------------------------------------------------------------
-// CMCSPluginEngine::UpdateMenuItemsRefCountL
-// Adds a given constant to a value of reference counter
-// ---------------------------------------------------------------------------
-//
-TInt CMCSPluginEngine::UpdateMenuItemsRefCountL( CMenuItem* aItem,
- const TInt aValueToAdd )
- {
- TBool exists( EFalse );
- CleanupStack::PushL( aItem );
- TPtrC param( aItem->GetAttributeL( KMenuAttrRefcount, exists ) );
- CleanupStack::Pop( aItem );
-
- if ( exists )
- {
- TInt references;
- TLex16 lextmp( param );
- lextmp.Val( references );
- references += aValueToAdd;
- TBuf<128> buf;
- buf.NumUC( references );
-
- // set new ref_count
- CleanupStack::PushL( aItem );
- aItem->SetAttributeL( KMenuAttrRefcount, buf);
- CleanupStack::Pop( aItem );
-
- // return new ref_count
- return references;
- }
-
- return -1;
- }
-
-// ---------------------------------------------------------------------------
-// Creates bookmark menu item if it does not exist
-// ---------------------------------------------------------------------------
-//
-void CMCSPluginEngine::CreateRuntimeMenuItemsL()
- {
- iPluginData->CreateRuntimeMenuItemsL();
- }
-
// End of file
-
--- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.h Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -122,15 +122,6 @@
*/
CMCSPluginSettingsContainer* Container();
- /**
- * Check if view is activate
- * @since S60 5.1
- * @return ETrue if activated, EFalse otherwise
- */
- TBool Activated() const;
-
-protected:
-
private: // From MEikMenuObserver
/**
@@ -168,15 +159,6 @@
*/
void HandleListBoxSelectionL();
- /**
- * DoHandleListBoxSelectionL
- *
- * @param aAny
- * @return TInt
- */
- static TInt DoHandleListBoxSelectionL( TAny* aAny );
-
-
private: // data
/**
--- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -21,55 +21,12 @@
#include <e32base.h>
#include <bamdesca.h> // For MDesCArray
-#include <apgcli.h> // For RApaLsSession
#include <msvapi.h> // For MMsvSessionObserver
-#include <apgnotif.h> // For MApaAppListServObserver
#include <mcsmenu.h> // For MenuContentService
#include <propertymap.h>// For HSPS settings property map
-/**
- * @ingroup group_mcsplugin
- *
- * Observer interface for application list events
- *
- * @since S60 v3.2
- */
-class MMCSPluginListObserver
-{
-public:
-
- /**
- * AppList event codes
- */
- enum TScutListEvent
- {
- EAppListReady,
- EAppListUpdated,
- EBkmListUpdated
- };
-
- /**
- * Callback for application list events
- *
- * @since S60 v3.2
- * @param aEvent AppList event code
- * @param aAdded ETrue if applications were added, EFalse if removed
- */
- virtual void HandleScutListEventL(
- TScutListEvent aEvent, TBool aAdded ) = 0;
-
- // virtual TBool IsHidden(const TUid& aAppUid) const = 0;
-
-};
-
struct TSettingItem;
-/**
- * Application list for settings listbox
- *
- * @since S60 v3.2
- */
-
-class CMCSPluginWatcher;
+class CMenuItem;
/**
* @ingroup group_mcsplugin
@@ -78,7 +35,7 @@
*
* @since S60 v9.1
*/
-class CMCSPluginSettingsAppList : public CBase, //public CActive
+class CMCSPluginSettingsAppList : public CBase,
public MDesCArray, public MMsvSessionObserver
{
@@ -143,14 +100,14 @@
TAny* aArg3 );
/**
- * Starts the asynchronous appliation list initialization
+ * Starts the asynchronous application list initialization
*
* @since S60 v3.2
*/
void StartL();
/**
- * FindItemL
+ * Finds item from item array based on property values.
*
* @since S60
* @param aProperties
@@ -160,21 +117,18 @@
aProperties );
/**
- *
+ * Returns menu item from list, based on given index
*
* @since S60
- * @param
+ * @param aIndex List index
* @return
*/
- CMenuItem& ItemL(const TInt& aIndex );
+ CMenuItem* ItemL(const TInt& aIndex );
+
/**
- * RemoveMenuItemL
- *
- * @param aIndex
+ * Returns title for undefined item
*/
- void RemoveMenuItemL( TInt aIndex );
-
-protected:
+ TPtrC UndefinedText() { return *iUndefinedText; };
private:
/**
@@ -215,20 +169,6 @@
*/
void AddMailboxL( const TDesC& aMailbox, const TDesC& aMailboxId );
- /**
- * GetID of MCS Plugin Folder
- *
- * @return TInt
- */
- TInt GetMCSPluginFolderIdL();
-
- /**
- * Update menu items
- *
- * @return TInt
- */
- TInt UpdateMenuItemsRefCountL( CMenuItem* aItem, TInt aValueToAdd );
-
private: // data
/**
@@ -242,47 +182,20 @@
* Own.
*/
CMsvSession* iMsvSession;
-
- /**
- * Registered observer for application list events
- */
- //MMCSPluginListObserver& iObserver;
-
- /**
- * A flag indicating if the app list should observe changes
- */
- TBool iObserving;
-
/**
* iMenu
*/
RMenu iMenu;
/**
- * iSaveWatcher
- */
- CMCSPluginWatcher* iSaveWatcher;
-
- /**
- * iUpdateWatcher
- */
- CMCSPluginWatcher* iUpdateWatcher;
-
- /**
- * iRemoveWatcher
- */
- CMCSPluginWatcher* iRemoveWatcher;
-
- /**
- * iMCSPluginFolderId
- */
- TInt iMCSPluginFolderId;
-
-public:
- /**
- * Name of "Undefined" application
+ * Name of "Undefined" application, own
*/
HBufC* iUndefinedText;
+
+ /*
+ * Undefined MCS item, own
+ */
+ CMenuItem* iUndefinedItem;
};
#endif // CMCSPLUGINSETTINGSAPPLIST_H
--- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsbkmlist.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsbkmlist.h Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -21,15 +21,10 @@
#include <e32base.h>
#include <bamdesca.h> // For MDesCArray
-#include <favouritesdbobserver.h> // For MFavouritesDbObserver
#include <favouritesdb.h> // For RFavouritesDb
-#include <favouritesitemlist.h> // For CFavouritesItemList
#include <mcsmenu.h> // For MenuContentService
+#include <propertymap.h>
-class CActiveFavouritesDbNotifier;
-class CAiScutSettingsItem;
-class CMCSPluginSettingsModel;
-class CMCSPluginWatcher;
struct TSettingItem;
/**
* @ingroup group_mcsplugin
@@ -110,18 +105,10 @@
* @param aParams On return, the bookmark parameters
* @param aCaption On return, the bookmark caption
* @return KErrNotFound if the bookmark cannot be found, KErrNone otherwise
- */
- //TInt GetDataByIndex(TInt aIndex, TPtrC& aParams, TPtrC& aCaption) const;
-
+ */
TSettingItem FindItemL(
RPointerArray<HSPluginSettingsIf::CPropertyMap>& aProperties );
-
- /**
- * Remove menu item
- *
- * @param aIndex
- */
- void RemoveMenuItemL( TInt aIndex );
+
protected:
@@ -147,13 +134,6 @@
const TDesC& aUrl, TBookmarkType aType );
/**
- * Updates the bookmark list
- *
- * @since S60 v3.2
- */
- void UpdateBkmListL();
-
- /**
* Get bookmarks from favourites
*/
void GetBookmarksFromFavouritesL();
@@ -185,23 +165,6 @@
CMenuItem* MCSMenuItemL( const TDesC& aUid,const TDesC& aName,
const TDesC& aUrl );
- /**
- * GetMCSPluginFolderIdL
- *
- * @return TInt
- */
- TInt GetMCSPluginFolderIdL();
-
- /**
- * UpdateMenuItemsRefCountL
- *
- * @param aItem
- * @param aValueToAdd
- * @return TInt
- */
- TInt UpdateMenuItemsRefCountL( CMenuItem* aItem, TInt aValueToAdd );
-
-
private:
/**
@@ -289,9 +252,6 @@
*/
void ConstructL( const TDesC& aUid, const TDesC& aCaption);
- private: // data
-
-
};
private: // data
@@ -302,15 +262,13 @@
*/
RPointerArray<CBkmListItem> iListItems;
- // Runtime created CMenuItems must be stored, because those are refered
+ /**
+ * Runtime created CMenuItems must be stored,
+ * because those are refered later, own.
+ */
RPointerArray<CMenuItem> iMenuItems;
/**
- * A flag indicating if the bookmark list should observe changes
- */
- TBool iObserving;
-
- /**
* Bookmark database session.
* Own.
*/
@@ -324,30 +282,9 @@
/**
* iMenu
+ * Own.
*/
RMenu iMenu;
-
- /**
- * Save watcher
- */
-
- CMCSPluginWatcher* iSaveWatcher;
-
- /**
- * Update watcher
- */
- CMCSPluginWatcher* iUpdateWatcher;
-
- /**
- * Remove watcher
- */
- CMCSPluginWatcher* iRemoveWatcher;
-
- /**
- * MCS plugin folder ID
- */
- TInt iMCSPluginFolderId;
-
};
#endif // CMCSPLUGINSETTINGSBKMLIST_H
--- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingscontainer.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingscontainer.h Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -83,13 +83,6 @@
void HandleHelpCommandL();
/**
- * Dialog showing changed
- *
- * @since S60 v3.2
- */
- TBool IsChangeDialogShowing();
-
- /**
* Close change dialog
*
* @since S60 v3.2
@@ -199,7 +192,7 @@
/**
* Checks if there is a need to update the middle softkey label.
*/
- void CheckMiddleSoftkeyLabelL();
+ void CheckMiddleSoftkeyLabel();
// From MFavouritesDbObserver
/**
--- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsmodel.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsmodel.h Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -22,18 +22,16 @@
// External includes
#include <e32base.h>
#include <bamdesca.h> // For MDesCArray
-#include <badesca.h>
#include <hspluginsettings.h>
#include <propertymap.h>
-// Internal includes
-#include "mcspluginsettingsapplist.h"
-#include "mcspluginsettingsbkmlist.h"
-
// Forward declaration
class CCoeEnv;
+class CMenuItem;
+class CMCSPluginSettingsAppList;
+class CMCSPluginSettingsBkmList;
+class CMCSPluginSettings;
class CMCSPluginSettingsContainer;
-class CMCSPluginSettings;
class HSPluginSettingsIf::CItemMap;
/**
@@ -42,7 +40,8 @@
enum TSettingType
{
EApplication,
- EBookmark
+ EBookmark,
+ EMailbox
};
/**
@@ -165,14 +164,12 @@
*
* @param aPluginId
*/
- void UpdateSettingsContainerL( const TDesC8& aPluginId );
-
+ void SetPluginIdL( const TDesC8& aPluginId );
+
/**
- * Update settings model
- *
- * @param aPluginId
- */
- void UpdateSettingModelL( const TDesC8& aPluginId );
+ * Read settings from HSPS and update settings list
+ */
+ void UpdateSettingsL();
private:
@@ -190,7 +187,7 @@
void ConstructL();
/**
- * ListBoxLineL
+ * ListBoxLine for list
*
* @param aCaption
* @param aIndex
@@ -199,7 +196,7 @@
TPtrC ListBoxLineL( const TDesC& aCaption, TInt aIndex ) const;
/**
- * ItemL
+ * Returns setting item based on properties.
*
* @param aProperties
* @return TSettingItem
@@ -225,15 +222,10 @@
TBool SettingLockedL(
RPointerArray<HSPluginSettingsIf::CPropertyMap>& aProperties );
- /**
- * Update settings
- *
- * @param aPluginId
- */
- void UpdateSettingsL( const TDesC8& aPluginId );
+
/**
- * Save settings
+ * Save settings into HSPS
*
* @param aIndex
* @param aMenuItem
@@ -248,13 +240,20 @@
*/
RArray<TSettingItem> iSettings;
- // Homescreen settings API. NOT OWNED!
+ /**
+ * Homescreen settings API. Not owned.
+ */
HSPluginSettingsIf::CHomescreenSettings* iPluginSettings;
+ /**
+ * HSPS settings id.
+ */
HBufC8* iPluginId;
- // Stores the text which is drawn by listbox
- // Listbox takes only reference
+ /**
+ * Stores the text which is drawn by listbox
+ * Listbox takes only reference, own.
+ */
mutable HBufC* iListBoxLine;
/**
--- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettings.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettings.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -16,19 +16,13 @@
*/
#include <ecom/implementationproxy.h>
-#include <e32std.h>
#include <eikmenup.h>
#include <eikbtgpc.h>
-#include <StringLoader.h>
#include <gsfwviewuids.h>
#include <gsprivatepluginproviderids.h>
-#include <bautils.h>
#include <pathinfo.h>
#include <featmgr.h>
-#include <e32property.h> // For RProperty
-#include <activeidle2domainpskeys.h> // For KPSUidActiveIdle2
-#include <avkon.rsg>
#include <mcspluginsettingsres.rsg>
#include <aisystemuids.hrh>
@@ -156,8 +150,8 @@
case EAknSoftkeyBack:
if (iAppUi->View(KGSMainViewUid))
{
- // if we are in GS activate parent plugin view (standby view)...
- iAppUi->ActivateLocalViewL(KGSPrslnPluginUid);
+ // if we are in GS activate parent plugin view (standby view)...
+ iAppUi->ActivateLocalViewL(KGSPrslnPluginUid);
}
else
{
@@ -181,7 +175,7 @@
// ----------------------------------------------------------------------------
//
void CMCSPluginSettings::DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage)
-{
+ {
CEikButtonGroupContainer* cba = Cba();
if (cba)
@@ -196,11 +190,12 @@
}
cba->DrawDeferred();
}
- iModel->UpdateSettingModelL( aCustomMessage);
- CGSBaseView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage);
-
- iModel->UpdateSettingsContainerL( aCustomMessage );
-}
+ iModel->UpdateAppListL();
+ iModel->UpdateBkmListL();
+ iModel->SetPluginIdL( aCustomMessage );
+ iModel->UpdateSettingsL();
+ CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
+ }
// ----------------------------------------------------------------------------
// From CAknView
@@ -208,11 +203,9 @@
// ----------------------------------------------------------------------------
//
void CMCSPluginSettings::DoDeactivate()
-{
+ {
CGSBaseView::DoDeactivate();
-
- iModel->SetContainer(Container());
-}
+ }
// ----------------------------------------------------------------------------
// From MEikMenuObserver
@@ -236,7 +229,7 @@
}
// ---------------------------------------------------------------------------
-// From CGSPluginInterface. 256
+// From CGSPluginInterface
// ---------------------------------------------------------------------------
//
void CMCSPluginSettings::GetCaptionL(TDes& aCaption) const
@@ -295,13 +288,4 @@
Container()->HandleChangeCommandL();
}
-// ---------------------------------------------------------------------------
-// Returns if container exists or not
-// ---------------------------------------------------------------------------
-//
-TBool CMCSPluginSettings::Activated() const
- {
- return iContainer ? ETrue : EFalse;
- }
-
// End of File.
--- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsapplist.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsapplist.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -15,32 +15,18 @@
*
*/
-
-#include <e32cmn.h>
-#include <msvuids.h> // For KMsvRootIndexEntryIdValue
-#include <SenduiMtmUids.h>
-#include <StringLoader.h>
#include <aistrcnv.h>
-#include <featmgr.h>
#include <mcsmenuitem.h>
#include <mcsmenufilter.h>
#include "mcspluginsettingsapplist.h"
-#include "mcspluginsettingsmodel.h"
-#include "mcspluginwatcher.h"
+#include "mcspluginsettingsmodel.h" // For TSettingItem
_LIT( KMyMenuData, "matrixmenudata" );
_LIT( KMenuTypeShortcut, "menu:shortcut" );
-_LIT( KMenuAttrRefcount, "ref_count" );
-_LIT( KMenuParamMailbox, "mailbox:" );
+_LIT( KMenuTypeMailbox, "menu:mailbox" );
_LIT( KMenuAttrParameter, "param" );
_LIT( KMenuAttrLocked, "locked" );
-_LIT( KMenuIconFile, "aimcsplugin.mif" );
-_LIT( KMenuIconId, "16388" );
-_LIT( KMenuMaskId, "16389" );
-_LIT( KMailboxUid, "0x100058c5" );
-_LIT( KInitialRefCount, "1" );
-_LIT( KMCSFolder, "mcsplugin_folder" );
_LIT8( KItemLocked, "locked");
_LIT8( KProperValueFolder, "folder" );
_LIT( KMenuAttrUndefUid, "0x99999991" );
@@ -56,7 +42,6 @@
//
CMCSPluginSettingsAppList::CMCSPluginSettingsAppList()
{
- iMCSPluginFolderId = 0;
}
// ---------------------------------------------------------------------------
@@ -68,9 +53,6 @@
iMsvSession = CMsvSession::OpenAsObserverL(*this);
iMenu.OpenL( KMyMenuData );
- iSaveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation );
- iUpdateWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation );
- iRemoveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation );
// Get "Undefined" icon and text
CMenuFilter* filter = CMenuFilter::NewL();
@@ -84,19 +66,16 @@
RArray<TMenuItem> items;
CleanupClosePushL( items );
iMenu.GetItemsL( items, root, filter, ETrue );
- TMenuItem undefItem;
if ( items.Count() > 0 )
{
- undefItem = items[ 0 ];
- CMenuItem* undefinedItem = CMenuItem::OpenL( iMenu, undefItem );
+ iUndefinedItem = CMenuItem::OpenL( iMenu, items[ 0 ] );
iUndefinedText = NULL;
- if ( undefinedItem )
+ if ( iUndefinedItem )
{
- TBool exists( KErrNotFound );
- CleanupStack::PushL( undefinedItem );
- TPtrC undefined = undefinedItem->GetAttributeL( KMenuItemLongName, exists );
+ TBool exists( KErrNotFound );//CleanupStack::PushL( undefinedItem );
+ TPtrC undefined = iUndefinedItem->GetAttributeL( KMenuItemLongName, exists );
if ( exists )
{
@@ -107,7 +86,6 @@
{
iUndefinedText = KNullDesC().Alloc();
}
- CleanupStack::PopAndDestroy( undefinedItem );
}
}
@@ -138,15 +116,9 @@
iListItems.ResetAndDestroy();
iMenu.Close();
- delete iSaveWatcher;
- delete iUpdateWatcher;
- delete iRemoveWatcher;
- if ( iUndefinedText )
- {
- delete iUndefinedText;
- iUndefinedText = NULL;
- }
+ delete iUndefinedText;
+ delete iUndefinedItem;
}
// ---------------------------------------------------------------------------
@@ -296,82 +268,19 @@
return settingItem;
}
-
// ---------------------------------------------------------------------------
-// Returns menuitems at given index. Since this method is called during
-// adding the item to the Desktop widget, we also have to increment
-// ref_count attribute if the item is run-time generated (i.e. Mailbox)
+// Returns menuitems at given index.
// ---------------------------------------------------------------------------
//
-CMenuItem& CMCSPluginSettingsAppList::ItemL( const TInt& aIndex )
+CMenuItem* CMCSPluginSettingsAppList::ItemL( const TInt& aIndex )
{
-
CMenuItem* menuItem( NULL );
-
- // check if index in within the list boundaries
+ // check if index is within the list boundaries
if ( aIndex >= 0 && aIndex < iListItems.Count() )
{
-
menuItem = iListItems[ aIndex ];
-
- TBool hasParam = EFalse;
- CleanupStack::PushL( menuItem );
- TPtrC param = menuItem->GetAttributeL( KMenuAttrParameter, hasParam );
- CleanupStack::Pop( menuItem );
-
- // if item is a mailbox, add it to MCS
- // (if it is not already there)
- if ( hasParam && param.Find( KMenuParamMailbox ) != KErrNotFound )
- {
-
- // set up a filter for finding the mailbox
- // with given ID in MCS
- CMenuFilter* filter = CMenuFilter::NewL();
- CleanupStack::PushL( filter );
-
- filter->SetType( KMenuTypeShortcut );
- filter->HaveAttributeL( KMenuAttrParameter, param );
-
- // search menu from the Root folder with the filter
- const TInt rootId = iMenu.RootFolderL();
- RArray<TMenuItem> itemArray;
- CleanupClosePushL( itemArray );
- iMenu.GetItemsL( itemArray, rootId, filter, ETrue );
-
- // save the number of findings
- TInt count( itemArray.Count() );
-
- // if MenuItem does not exist in MCS
- if ( count == 0 )
- {
- // save the item into Matrixmenudata.xml
- // the "op" variable is cleaned up by iSaveWatcher when asynchronous
- // operation finishes
- CleanupStack::PushL( menuItem );
- CMenuOperation* op = menuItem->SaveL( iSaveWatcher->iStatus );
- CleanupStack::Pop( menuItem );
- iSaveWatcher->Watch( op );
- }
- else
- {
- // Item already exists in MCS
- // If it has reference counter, increment it before returning.
- CMenuItem* itm = CMenuItem::OpenL( iMenu, itemArray[ 0 ] );
-
- TInt newRefCount = UpdateMenuItemsRefCountL( itm, 1 );
- if ( newRefCount > -1 )
- {
- CleanupStack::PushL( itm );
- CMenuOperation* op = itm->SaveL( iSaveWatcher->iStatus );
- CleanupStack::PopAndDestroy( itm );
- iSaveWatcher->Watch( op );
- }
- }
- CleanupStack::PopAndDestroy( &itemArray );
- CleanupStack::PopAndDestroy( filter );
- }
}
- return *menuItem;
+ return menuItem;
}
// ---------------------------------------------------------------------------
@@ -403,8 +312,7 @@
CMenuFilter* filter = CMenuFilter::NewL();
CleanupStack::PushL( filter );
- // skip run-time generated items
- filter->DoNotHaveAttributeL( KMenuAttrRefcount );
+ // skip locked items
filter->DoNotHaveAttributeL( KMenuAttrLocked );
const TInt rootId = iMenu.RootFolderL();
RArray<TMenuItem> itemArray;
@@ -460,8 +368,6 @@
//
void CMCSPluginSettingsAppList::AddMailboxesL()
{
-
- iListItems.ResetAndDestroy();
CMsvEntry* rootEntry = GetRootEntryL();
CleanupStack::PushL(rootEntry);
TBuf<255> mailboxId;
@@ -494,175 +400,19 @@
void CMCSPluginSettingsAppList::AddMailboxL( const TDesC& aMailbox,
const TDesC& aMailboxId )
{
- // prepare param value
- HBufC* params = HBufC::NewLC( KMenuParamMailbox().Length() + aMailboxId.Length() );
- params->Des().Copy( KMenuParamMailbox );
- params->Des().Append( aMailboxId );
- TPtrC paramValue( params->Des() );
-
- TLinearOrder<CMenuItem> sortMethod( CMCSPluginSettingsAppList::CompareNameL );
- CMenuItem* newItem = CMenuItem::CreateL( iMenu,
- KMenuTypeShortcut,
- GetMCSPluginFolderIdL(),
- 0 );
- CleanupStack::PushL( newItem );
+ TLinearOrder<CMenuItem> sortMethod( CMCSPluginSettingsAppList::CompareNameL );
+ CMenuItem* newItem = CMenuItem::CreateL( iMenu, KMenuTypeMailbox, 0, 0 );
+ CleanupStack::PushL( newItem );
- // mailbox is a shortcut item with "mailbox:mailboxID" parameter
- newItem->SetAttributeL( KMenuAttrUid, KMailboxUid );
- newItem->SetAttributeL( KMenuAttrLongName, aMailbox );
- newItem->SetAttributeL( KMenuAttrParameter, paramValue );
- newItem->SetAttributeL( KMenuAttrRefcount, KInitialRefCount );
+ // mailbox is a shortcut item with "mailbox:mailboxID" parameter
+ newItem->SetAttributeL( KMenuAttrUid, aMailboxId );
+ newItem->SetAttributeL( KMenuAttrLongName, aMailbox );
+ // Mailbox name is saved to settings into param field.
+ newItem->SetAttributeL( KMenuAttrParameter, aMailbox );
- // setting icon for the shortcut
- newItem->SetAttributeL( KMenuAttrIconFile, KMenuIconFile );
- newItem->SetAttributeL( KMenuAttrIconId, KMenuIconId );
- newItem->SetAttributeL( KMenuAttrMaskId, KMenuMaskId );
-
- // append the item into iListItems lists
- User::LeaveIfError( iListItems.InsertInOrderAllowRepeats( newItem, sortMethod ) );
- CleanupStack::Pop( newItem );
- CleanupStack::PopAndDestroy( params );
+ // append the item into iListItems lists
+ User::LeaveIfError( iListItems.InsertInOrderAllowRepeats( newItem, sortMethod ) );
+ CleanupStack::Pop( newItem );
}
-// ---------------------------------------------------------------------------
-// Removes run-time generated menuitem (i.e. Mailbox) from MCS
-// If the item at given index is not run-time generated, return
-// ---------------------------------------------------------------------------
-//
-void CMCSPluginSettingsAppList::RemoveMenuItemL( TInt aIndex )
- {
-
- if ( aIndex < 0 || aIndex > iListItems.Count() - 1 )
- {
- return;
- }
-
- CMenuItem* menuItem = iListItems[ aIndex ];
-
- TBool hasParam = ETrue;
- TPtrC param = menuItem->GetAttributeL( KMenuAttrParameter, hasParam );
-
- if ( !hasParam )
- {
- // nothing to do
- return;
- }
-
- // set up a filter for finding the mailbox
- // with given ID in MCS
- CMenuFilter* filter = CMenuFilter::NewL();
- CleanupStack::PushL( filter );
-
- filter->SetType( KMenuTypeShortcut );
- filter->HaveAttributeL( KMenuAttrParameter, param );
-
- // search menu from the Root folder with the filter
- const TInt rootId = iMenu.RootFolderL();
- RArray<TMenuItem> itemArray;
- CleanupClosePushL( itemArray );
- iMenu.GetItemsL( itemArray, rootId, filter, ETrue );
-
- // save the number of findings
- TInt count( itemArray.Count() );
-
- if ( count > 0 )
- {
- // Item already exists in MCS
- // If it has reference counter, increment it before returning.
- CMenuItem* itm = CMenuItem::OpenL( iMenu, itemArray[ 0 ] );
-
- // decrement ref_count attribute
- TInt newRefCount = UpdateMenuItemsRefCountL( itm, -1 );
- if ( newRefCount > 0 )
- {
- CleanupStack::PushL( itm );
- CMenuOperation* op = itm->SaveL( iUpdateWatcher->iStatus );
- CleanupStack::Pop( itm );
- iUpdateWatcher->Watch( op );
- }
- else if ( newRefCount == 0 )
- {
- // counter reached 0 -> item is not referenced by any shortcut
- // so remove it from MCS
- if ( iRemoveWatcher->IsActive() )
- {
- return;
- }
- CMenuOperation* op = iMenu.RemoveL( itm->Id(), iRemoveWatcher->iStatus );
- iRemoveWatcher->Watch( op );
- }
- delete itm;
- }
- CleanupStack::PopAndDestroy( &itemArray );
- CleanupStack::PopAndDestroy( filter );
- }
-
-// ---------------------------------------------------------------------------
-// Gets MCS Plugin folder ID. This hidden folder in matrixmenudata.xml is used
-// for storing run-time generated menuitems
-// ---------------------------------------------------------------------------
-//
-TInt CMCSPluginSettingsAppList::GetMCSPluginFolderIdL()
- {
-
- if ( iMCSPluginFolderId == 0 )
- {
- CMenuItem* item( NULL );
- CMenuFilter* filter = CMenuFilter::NewL();
- CleanupStack::PushL( filter );
- filter->SetType( KMenuTypeFolder );
- filter->HaveAttributeL( KMenuAttrLongName, KMCSFolder );
- const TInt rootId = iMenu.RootFolderL();
- RArray<TMenuItem> itemArray;
- CleanupClosePushL( itemArray );
- iMenu.GetItemsL( itemArray, rootId, filter, ETrue );
- if ( itemArray.Count() > 0 )
- {
- item = CMenuItem::OpenL( iMenu, itemArray[ 0 ] );
- iMCSPluginFolderId = item->Id();
- }
- else
- {
- iMCSPluginFolderId = iMenu.RootFolderL();
- }
- CleanupStack::PopAndDestroy( &itemArray );
- CleanupStack::PopAndDestroy( filter );
- delete item;
- }
- return iMCSPluginFolderId;
-
- }
-
-// ---------------------------------------------------------------------------
-// Helper method for updating ref_count attribute of run-time generated
-// menuitems
-// ---------------------------------------------------------------------------
-//
-TInt CMCSPluginSettingsAppList::UpdateMenuItemsRefCountL( CMenuItem* aItem,
- TInt aValueToAdd )
- {
-
- TBool exists = EFalse;
- CleanupStack::PushL( aItem );
- TPtrC param = aItem->GetAttributeL( KMenuAttrRefcount, exists );
- CleanupStack::Pop( aItem );
- if ( exists )
- {
- TInt references;
- TLex16 lextmp( param );
- lextmp.Val( references );
- references += aValueToAdd;
- TBuf<128> buf;
- buf.NumUC( references );
- // set new ref_count
- CleanupStack::PushL( aItem );
- aItem->SetAttributeL( KMenuAttrRefcount, buf );
- CleanupStack::Pop( aItem );
- // return new ref_count
- return references;
- }
- return -1;
- }
-
-
// End of File.
--- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsbkmlist.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsbkmlist.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -15,32 +15,19 @@
*
*/
-
-#include <StringLoader.h>
-#include <activefavouritesdbnotifier.h> // For CActiveFavouritesDbNotifier
+#include <favouritesitemlist.h>
#include <aistrcnv.h>
#include <mcsmenufilter.h>
#include <mcsmenuitem.h>
-#include <mcsmenuoperation.h>
-#include <mcspluginsettingsres.rsg>
#include "mcspluginsettingsmodel.h"
-#include "mcspluginsettingsapplist.h"
#include "mcspluginsettingsbkmlist.h"
-#include "mcspluginwatcher.h"
-#include "debug.h"
_LIT( KMyMenuData, "matrixmenudata" );
_LIT( KMenuUrl, "menu:url" );
-_LIT( KMenuIconFile, "aimcsplugin.mif" );
-_LIT( KMenuIconId, "16386" );
-_LIT( KMenuMaskId, "16387" );
_LIT( KUrl, "url" );
_LIT8( KUid, "uid" );
-_LIT( KMenuAttrRefcount, "ref_count" );
-_LIT( KInitialRefCount, "1" );
-_LIT( KMCSFolder, "mcsplugin_folder" );
-
+_LIT( KMenuAttrParameter, "param" );
// ======== MEMBER FUNCTIONS ========
@@ -51,7 +38,6 @@
//
CMCSPluginSettingsBkmList::CMCSPluginSettingsBkmList()
{
- iMCSPluginFolderId = 0;
}
// ---------------------------------------------------------------------------
@@ -64,10 +50,6 @@
User::LeaveIfError(iBookmarkDb.Open(iBookmarkSess, KBrowserBookmarks));
iMenu.OpenL( KMyMenuData );
GetBookmarkListL();
-
- iSaveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation );
- iUpdateWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation );
- iRemoveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation );
}
// ---------------------------------------------------------------------------
@@ -94,9 +76,6 @@
iBookmarkDb.Close();
iBookmarkSess.Close();
iMenu.Close();
- delete iSaveWatcher;
- delete iUpdateWatcher;
- delete iRemoveWatcher;
}
// ---------------------------------------------------------------------------
@@ -132,7 +111,7 @@
TSettingItem CMCSPluginSettingsBkmList::FindItemL( RPointerArray<HSPluginSettingsIf::CPropertyMap>& aProperties )
{
TInt index( KErrNotFound );
- TSettingItem settingItem = { KErrNotFound, EBookmark };
+ TSettingItem settingItem = { KErrNotFound, EBookmark, EFalse };
for( TInt i= 0; i < aProperties.Count(); i++ )
{
if( aProperties[i]->Name() == KUid )
@@ -218,17 +197,8 @@
TPtrC uid = menuItem->GetAttributeL( KMenuAttrUid, exists );
TPtrC name = menuItem->GetAttributeL( KMenuAttrLongName, exists );
TPtrC url = menuItem->GetAttributeL( KUrl, exists );
-
- // Check if bookmark is already present in Bookmark list.
- // This may happen in case of Favourite Bookmarks that were
- // previously added to MCS.
- // If it is, do not add it to Bookmark list anymore.
-
- TBool isRuntimeGenerated = EFalse;
- menuItem->GetAttributeL( KMenuAttrRefcount, isRuntimeGenerated );
-
- // if is not runtime generated and url exists, add it
- if ( !isRuntimeGenerated && exists )
+ // if exists, add it
+ if ( exists )
{
AddBookmarkL( uid, name, url, EMCSBookmark );
}
@@ -251,11 +221,8 @@
CMenuItem* menuItem( NULL );
CBkmListItem* listItem = iListItems[aIndex];
if ( listItem->iType == EFavBookmark )
- {
- TPtrC uid = *listItem->iUid;
- TPtrC name = *listItem->iCaption;
- TPtrC url = *listItem->iUrl;
- menuItem = CreateMenuItemL( uid, name, url );
+ {
+ menuItem = CreateMenuItemL( *listItem->iUid, *listItem->iCaption, *listItem->iUrl );
}
else
{
@@ -265,52 +232,6 @@
}
// ---------------------------------------------------------------------------
-// Removes the menu item from MCS if it was created in runtime i.e. type is EFavBookmark.
-// Favourite bookmarks have ref_count attribute, which is decremented everytime
-// the bookmark is removed from some shortcut. When this counter reaches 0,
-// its MenuItem is removed from MCS.
-// ---------------------------------------------------------------------------
-//
-void CMCSPluginSettingsBkmList::RemoveMenuItemL( TInt aIndex )
- {
-
- if ( aIndex < 0 || aIndex > iListItems.Count() - 1 )
- {
- return;
- }
-
- CBkmListItem* listItem = iListItems[aIndex];
- if( listItem->iType == EFavBookmark )
- {
- CMenuItem* menuItem = MCSMenuItemL( *listItem->iUid, *listItem->iCaption, *listItem->iUrl );
- if ( !menuItem )
- {
- return;
- }
- // decrement ref_count attribute
- TInt newRefCount = UpdateMenuItemsRefCountL( menuItem, -1 );
- if ( newRefCount > 0 )
- {
- CleanupStack::PushL( menuItem );
- CMenuOperation* op = menuItem->SaveL( iUpdateWatcher->iStatus );
- CleanupStack::Pop( menuItem );
- iUpdateWatcher->Watch( op );
- }
- else if ( newRefCount == 0 )
- {
- // counter reached 0 -> item is not referenced by any shortcut
- // so remove it from MCS
- if ( iRemoveWatcher->IsActive() )
- {
- return;
- }
- CMenuOperation* op = iMenu.RemoveL( menuItem->Id(), iRemoveWatcher->iStatus );
- iRemoveWatcher->Watch( op );
- }
- }
- }
-
-// ---------------------------------------------------------------------------
// Tries to find menuitem with given UID, Name and Url in MCS,
// If it does not exist, it is created and saved there.
// If it exists already, ref_count attribute is incremented.
@@ -320,46 +241,15 @@
const TDesC& aName,
const TDesC& aUrl )
{
- // try to search item in MCS
- CMenuItem* item = MCSMenuItemL( aUid, aName, aUrl );
-
- if ( item == NULL )
- {
- // Item does not exist in MCS yet.
- // We will add a new one with reference counter set to 1.
- CMenuItem* newItem = CMenuItem::CreateL( iMenu,
- KMenuTypeUrl,
- GetMCSPluginFolderIdL(), 0 );
- CleanupStack::PushL( newItem );
-
- newItem->SetAttributeL( KMenuAttrUid, aUid );
- newItem->SetAttributeL( KMenuAttrLongName, aName );
- newItem->SetAttributeL( KMenuAttrIconFile, KMenuIconFile );
- newItem->SetAttributeL( KMenuAttrIconId, KMenuIconId );
- newItem->SetAttributeL( KMenuAttrMaskId, KMenuMaskId );
- newItem->SetAttributeL( KMenuAttrRefcount, KInitialRefCount );
- newItem->SetAttributeL( KUrl , aUrl );
-
- CMenuOperation* op = newItem->SaveL( iSaveWatcher->iStatus );
- iSaveWatcher->Watch( op );
- iMenuItems.AppendL( newItem );
- CleanupStack::Pop( newItem );
- return newItem;
- }
- else
- {
- // Item already exists in MCS
- // If it has reference counter, increment it before returning.
- TInt newRefCount = UpdateMenuItemsRefCountL( item, 1 );
- if ( newRefCount > -1 )
- {
- CleanupStack::PushL( item );
- CMenuOperation* op = item->SaveL( iSaveWatcher->iStatus );
- CleanupStack::Pop( item );
- iSaveWatcher->Watch( op );
- }
- }
- return item;
+ CMenuItem* newItem = CMenuItem::CreateL( iMenu, KMenuTypeUrl, 0, 0 );
+ CleanupStack::PushL( newItem );
+ newItem->SetAttributeL( KMenuAttrUid, aUid );
+ newItem->SetAttributeL( KMenuAttrLongName, aName );
+ newItem->SetAttributeL( KMenuAttrView, aUrl );
+ newItem->SetAttributeL( KMenuAttrParameter, aName );
+ iMenuItems.AppendL( newItem );
+ CleanupStack::Pop( newItem );
+ return newItem;
}
// ---------------------------------------------------------------------------
@@ -416,15 +306,6 @@
}
// ---------------------------------------------------------------------------
-// Updates the bookmark list.
-// ---------------------------------------------------------------------------
-//
-void CMCSPluginSettingsBkmList::UpdateBkmListL()
- {
- GetBookmarkListL();
- }
-
-// ---------------------------------------------------------------------------
//Nested class to store individual bookmark list items
// ---------------------------------------------------------------------------
//
@@ -486,70 +367,5 @@
return TPtrC(*iCaption);
}
-// ---------------------------------------------------------------------------
-// Gets MCS Plugin folder ID. This hidden folder in matrixmenudata.xml is used
-// for storing run-time generated menuitems
-// ---------------------------------------------------------------------------
-//
-TInt CMCSPluginSettingsBkmList::GetMCSPluginFolderIdL()
- {
- if ( iMCSPluginFolderId == 0 )
- {
- CMenuItem* item( NULL );
- CMenuFilter* filter = CMenuFilter::NewL();
- CleanupStack::PushL( filter );
- filter->SetType( KMenuTypeFolder );
- filter->HaveAttributeL( KMenuAttrLongName, KMCSFolder );
- const TInt rootId = iMenu.RootFolderL();
- RArray<TMenuItem> itemArray;
- CleanupClosePushL( itemArray );
- iMenu.GetItemsL( itemArray, rootId, filter, ETrue );
- if ( itemArray.Count() > 0 )
- {
- item = CMenuItem::OpenL( iMenu, itemArray[0] );
- iMCSPluginFolderId = item->Id();
- }
- else
- {
- iMCSPluginFolderId = iMenu.RootFolderL();
- }
- CleanupStack::PopAndDestroy( &itemArray );
- CleanupStack::PopAndDestroy( filter );
- delete item;
- }
- return iMCSPluginFolderId;
- }
-
-// ---------------------------------------------------------------------------
-// Helper method for updating ref_count attribute of run-time generated
-// menuitems
-// ---------------------------------------------------------------------------
-//
-TInt CMCSPluginSettingsBkmList::UpdateMenuItemsRefCountL( CMenuItem* aItem,
- TInt aValueToAdd )
- {
-
- TBool exists = EFalse;
- CleanupStack::PushL( aItem );
- TPtrC param = aItem->GetAttributeL( KMenuAttrRefcount, exists );
- CleanupStack::Pop( aItem );
- if ( exists )
- {
- TInt references;
- TLex16 lextmp( param );
- lextmp.Val( references );
- references += aValueToAdd;
- TBuf<128> buf;
- buf.NumUC( references );
-
- // set new ref_count
- CleanupStack::PushL( aItem );
- aItem->SetAttributeL( KMenuAttrRefcount, buf );
- CleanupStack::Pop( aItem );
- // return new ref_count
- return references;
- }
- return -1;
- }
// End of File.
--- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -15,27 +15,19 @@
*
*/
-
-#include <aknlists.h>
-#include <AknWaitDialog.h>
#include <aknnotewrappers.h>
-#include <eikbtgpc.h>
-#include <gslistbox.h>
-#include <gsfwviewuids.h>
+#include <aknlistquerydialog.h>
+#include <e32cmn.h>
#include <aknradiobuttonsettingpage.h>
-#include <akntextsettingpage.h>
-#include <centralrepository.h>
#include <StringLoader.h>
-
#include <csxhelp/ai.hlp.hrh>
#include <hlplch.h>
-
-// For CActiveFavouritesDbNotifier
-#include <activefavouritesdbnotifier.h>
+#include <activefavouritesdbnotifier.h>
#include <mcspluginsettingsres.rsg>
#include "mcspluginsettingscontainer.h"
#include "mcspluginsettingsmodel.h"
+#include "mcspluginsettingsapplist.h"
#include "mcspluginsettingsbkmlist.h"
#include "mcspluginsettings.hrh"
#include "mcspluginuids.hrh"
@@ -61,7 +53,7 @@
iListBox = new (ELeave) CAknSettingStyleListBox;
BaseConstructL(aRect, R_AI_MCS_SETTINGS_VIEW_TITLE, NULL);
StartObservingL();
- CheckMiddleSoftkeyLabelL();
+ CheckMiddleSoftkeyLabel();
}
// ---------------------------------------------------------------------------
@@ -88,9 +80,7 @@
{
iNotifyWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::ENotify );
iNotifier.Notify( 0,
- RMenuNotifier::EItemsAddedRemoved |
- RMenuNotifier::EItemsReordered |
- RMenuNotifier::EItemAttributeChanged,
+ RMenuNotifier::EItemsAddedRemoved,
iNotifyWatcher->iStatus );
iNotifyWatcher->WatchNotify( this );
}
@@ -238,15 +228,6 @@
}
// ---------------------------------------------------------------------------
-// Helper method which indicates if the Applist or Bkmlist is showing
-// ---------------------------------------------------------------------------
-//
-TBool CMCSPluginSettingsContainer::IsChangeDialogShowing()
-{
- return ( iAppListDialog || iBkmListDialog );
-}
-
-// ---------------------------------------------------------------------------
// Method for closing change dialog (app or bkm) if it is beeing shown
// ---------------------------------------------------------------------------
//
@@ -292,7 +273,7 @@
}
iListBox->SetCurrentItemIndex( aIndex );
- CheckMiddleSoftkeyLabelL();
+ CheckMiddleSoftkeyLabel();
}
// ---------------------------------------------------------------------------
@@ -314,11 +295,8 @@
// fall-through intended here
case EMsvEntriesChanged:
{
- if ( IsChangeDialogShowing() )
- {
- CloseChangeDialog();
- }
iModel->UpdateAppListL();
+ iModel->UpdateSettingsL();
}
break;
default:
@@ -335,22 +313,13 @@
{
iListBox->ConstructL(this, EAknListBoxSelectionList);
// Set empty listbox's text.
- if (iModel->MdcaCount() == 0)
- {
- HBufC* text = iCoeEnv->AllocReadResourceLC(R_AI_MCS_SETTINGS_TXT_ALL_FIXED);
- iListBox->View()->SetListEmptyTextL(*text);
- CleanupStack::PopAndDestroy(text);
- }
- else
- {
- iListBox->View()->SetListEmptyTextL(KNullDesC);
- }
+ iListBox->View()->SetListEmptyTextL(KNullDesC);
iListBox->Model()->SetItemTextArray(iModel);
iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
}
// ---------------------------------------------------------------------------
-// Chandles a setting change command to select application from a list.
+// Handles a setting change command to select application from a list.
// ---------------------------------------------------------------------------
//
TBool CMCSPluginSettingsContainer::HandleAppListChangeCommandL( const TInt& aIndex,
@@ -372,7 +341,7 @@
if (iAppListDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged) &&
index != oldIndex)
{
- changed = iModel->ReplaceItemL( iListBox->CurrentItemIndex(), index , EApplication );
+ changed = iModel->ReplaceItemL( aSettingIndex, index , EApplication );
}
CleanupStack::PopAndDestroy( title );
@@ -403,7 +372,7 @@
if (iBkmListDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged) &&
index != oldIndex)
{
- changed = iModel->ReplaceItemL( iListBox->CurrentItemIndex(), index , EBookmark );
+ changed = iModel->ReplaceItemL( aSettingIndex, index , EBookmark );
}
CleanupStack::PopAndDestroy( title );
@@ -451,7 +420,7 @@
// Checks if there is a need to update the middle softkey label.
// ---------------------------------------------------------------------------
//
-void CMCSPluginSettingsContainer::CheckMiddleSoftkeyLabelL()
+void CMCSPluginSettingsContainer::CheckMiddleSoftkeyLabel()
{
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
if (cba)
@@ -475,10 +444,7 @@
// fall-through intended here
case RDbNotifier::ERollback :
{
- if ( IsChangeDialogShowing() )
- {
- CloseChangeDialog();
- }
+ CloseChangeDialog();
iModel->UpdateBkmListL();
}
break;
@@ -494,18 +460,15 @@
//
void CMCSPluginSettingsContainer::HandleNotifyL()
{
- if ( IsChangeDialogShowing() )
- {
- CloseChangeDialog();
- }
+ CloseChangeDialog();
+
iModel->UpdateAppListL();
+ ResetCurrentListL(0);
// Notification must be activated again
iNotifyWatcher->Cancel();
iNotifier.Notify( 0,
- RMenuNotifier::EItemsAddedRemoved |
- RMenuNotifier::EItemsReordered |
- RMenuNotifier::EItemAttributeChanged,
+ RMenuNotifier::EItemsAddedRemoved,
iNotifyWatcher->iStatus );
iNotifyWatcher->WatchNotify( this );
}
--- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 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"
@@ -18,22 +18,18 @@
#include <eikenv.h>
#include <itemmap.h>
#include <mhomescreensettingsif.h>
-
#include <aistrcnv.h>
#include <StringLoader.h>
#include <uri16.h>
#include <mcspluginsettingsres.rsg>
-
+#include <mcsmenuitem.h>
-#include "mcspluginsettings.h"
#include "mcspluginsettingsmodel.h"
+#include "mcspluginsettingsapplist.h"
+#include "mcspluginsettingsbkmlist.h"
#include "mcspluginsettingscontainer.h"
-#include "debug.h"
-
-#include <mcsmenuitem.h>
-
/**
* Line format for the settings list box
*/
@@ -51,6 +47,8 @@
_LIT8( KProperValueSuite, "suite" );
_LIT8( KProperValueBookmark, "bookmark" );
_LIT8( KProperValueAppl, "application" );
+_LIT8( KProperValueMailbox, "mailbox" );
+_LIT( KMenuTypeMailbox, "menu:mailbox" );
using namespace HSPluginSettingsIf;
@@ -147,7 +145,7 @@
// ---------------------------------------------------------------------------
//
void CMCSPluginSettingsModel::ConstructL()
-{
+ {
CHomescreenSettings::InitializeL( KAppUid );
iPluginSettings = CHomescreenSettings::Instance();
@@ -155,31 +153,24 @@
{
User::Leave( KErrUnknown );
}
-
- iAppList = CMCSPluginSettingsAppList::NewL();
- iAppList->StartL();
- iBkmList = CMCSPluginSettingsBkmList::NewL();
-}
-
+ }
// ---------------------------------------------------------------------------
// Gets the latest settings from HSPS and updates
// ---------------------------------------------------------------------------
//
-void CMCSPluginSettingsModel::UpdateSettingsL( const TDesC8& aPluginId )
+void CMCSPluginSettingsModel::UpdateSettingsL()
{
- if( !iPlugin.Activated() )
+ if( !iPluginId )
{
return;
}
- if( iPluginId )
+ if (iContainer)
{
- delete iPluginId;
- iPluginId = NULL;
+ iContainer->CloseChangeDialog();
}
- iPluginId = aPluginId.AllocL();
-
+
iSettings.Reset();
RPointerArray<CItemMap> settingItems;
CleanupClosePushL( settingItems );
@@ -197,38 +188,11 @@
}
CleanupStack::Pop( &settingItems );
settingItems.ResetAndDestroy();
- }
-
-// ---------------------------------------------------------------------------
-// Gets the latest settings from HSPS and updates
-// ---------------------------------------------------------------------------
-//
-void CMCSPluginSettingsModel::UpdateSettingModelL( const TDesC8& aPluginId )
- {
- if( iPluginId )
+
+ if (iContainer)
{
- delete iPluginId;
- iPluginId = NULL;
+ iContainer->ResetCurrentListL(0);
}
- iPluginId = aPluginId.AllocL();
-
- iSettings.Reset();
- RPointerArray<CItemMap> settingItems;
- CleanupClosePushL( settingItems );
-
- iPluginSettings->GetSettingsL( *iPluginId, settingItems );
-
- TInt count = settingItems.Count();
- for ( TInt i = 0; i < count; i++ )
- {
- CItemMap* itemMap = settingItems[i];
- RPointerArray<HSPluginSettingsIf::CPropertyMap> properties;
- properties = itemMap->Properties();
- TSettingItem item = ItemL( properties );
- iSettings.AppendL( item );
- }
- CleanupStack::Pop( &settingItems );
- settingItems.ResetAndDestroy();
}
// ---------------------------------------------------------------------------
@@ -241,7 +205,7 @@
TSettingItem setting = { KErrNotFound, EApplication , EFalse };
TSettingType type = SettingTypeL( aProperties );
- if ( type == EApplication )
+ if ( type == EApplication || type == EMailbox )
{
setting = iAppList->FindItemL( aProperties );
}
@@ -308,7 +272,6 @@
return EFalse;
}
-
// ---------------------------------------------------------------------------
// Saves menuitem to HSPS to the given shortcut index
// ---------------------------------------------------------------------------
@@ -347,6 +310,10 @@
{
properties[ i ]->SetValueL( KProperValueSuite );
}
+ else if( type == KMenuTypeMailbox )
+ {
+ properties[ i ]->SetValueL( KProperValueMailbox );
+ }
else
{
properties[ i ]->SetValueL( KProperValueAppl );
@@ -448,24 +415,13 @@
// Updates settings container.
// ---------------------------------------------------------------------------
//
-void CMCSPluginSettingsModel::UpdateSettingsContainerL( const TDesC8& aPluginId )
-{
- if (iContainer)
+void CMCSPluginSettingsModel::SetPluginIdL( const TDesC8& aPluginId )
{
- if (iContainer->IsChangeDialogShowing())
- {
- iContainer->CloseChangeDialog();
- }
+ delete iPluginId;
+ iPluginId = NULL;
+ iPluginId = aPluginId.AllocL();
}
- UpdateSettingsL( aPluginId );
-
- if (iContainer)
- {
- iContainer->ResetCurrentListL(0);
- }
-}
-
// ---------------------------------------------------------------------------
// From MDesCArray
// Returns the number of descriptor elements in a descriptor array.
@@ -491,11 +447,11 @@
if ( iSettings[aIndex].type == EApplication )
{
// first, we need to check if the item is missing
- // (application unistaled or mmc card removed)
+ // (application uninstalled or mmc card removed)
// If it is, we return "Undefined" application name instead
if ( iSettings[ aIndex ].id == KErrNotFound )
{
- const TDesC& caption = iAppList->iUndefinedText->Des();
+ const TDesC& caption = iAppList->UndefinedText();
TPtrC line;
TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) )
return line;
@@ -557,35 +513,19 @@
{
if (aSettingIndex >= 0 && aSettingIndex < iSettings.Count())
{
- TSettingItem oldItem = iSettings[ aSettingIndex ];
iSettings[ aSettingIndex ].id = aId;
iSettings[ aSettingIndex ].type = aType;
if ( aType == EApplication )
{
- CMenuItem& item = iAppList->ItemL( aId );
- SaveSettingsL( aSettingIndex, item );
+ CMenuItem* item = iAppList->ItemL( aId );
+ SaveSettingsL( aSettingIndex, *item );
}
else
{
CMenuItem& item = iBkmList->ItemL( aId );
SaveSettingsL( aSettingIndex, item );
}
-
- // Old setting type is bookmark. Remove bookmark item from MCS
- // if it was created in runtime.
- if ( oldItem.type == EBookmark )
- {
- iBkmList->RemoveMenuItemL( oldItem.id );
- }
-
- // Old setting type is application.
- // Remove app item from MCS if it was created in runtime (mailbox).
- if ( oldItem.type == EApplication )
- {
- iAppList->RemoveMenuItemL( oldItem.id );
- }
-
return ETrue;
}
return EFalse;
@@ -623,9 +563,13 @@
// ---------------------------------------------------------------------------
//
void CMCSPluginSettingsModel::UpdateAppListL()
-{
+ {
+ if( !iAppList )
+ {
+ iAppList = CMCSPluginSettingsAppList::NewL();
+ }
iAppList->StartL();
-}
+ }
// ---------------------------------------------------------------------------
// Updates bookmark list
--- a/idlefw/plugins/profileplugin/src/caiprofileengine.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/profileplugin/src/caiprofileengine.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -215,26 +215,35 @@
TInt generalProfileIndex(
profileNamesArray->FindById( KGeneralProfileId ) );
- swapProfileName =
- profileNamesArray->MdcaPoint( generalProfileIndex ).AllocLC() ;
+ if( generalProfileIndex > KErrNotFound )
+ {
+ swapProfileName =
+ profileNamesArray->MdcaPoint( generalProfileIndex ).AllocLC() ;
+ }
}
else
{
TInt silentProfileIndex(
profileNamesArray->FindById( KSilentProfileId ) );
- swapProfileName =
- profileNamesArray->MdcaPoint( silentProfileIndex ).AllocLC() ;
+ if( silentProfileIndex > KErrNotFound )
+ {
+ swapProfileName =
+ profileNamesArray->MdcaPoint( silentProfileIndex ).AllocLC() ;
+ }
}
- TPtrC swapProfileNamePtr( *swapProfileName );
-
- HBufC* activateProfileString( StringLoader::LoadLC(
- R_AI_PERS_PROF_TOGGLE, swapProfileNamePtr ) );
-
- SetSwapProfileNameL( *activateProfileString );
+ if( swapProfileName )
+ {
+ HBufC* activateProfileString( StringLoader::LoadLC(
+ R_AI_PERS_PROF_TOGGLE, swapProfileName->Des() ) );
+
+ SetSwapProfileNameL( *activateProfileString );
+
+ CleanupStack::PopAndDestroy( 2 ); // swapProfileName, activateProfileString
+ }
- CleanupStack::PopAndDestroy( 5 ); //profile, profileName, // profileNamesArray, swapProfileName, activateProfileString
+ CleanupStack::PopAndDestroy( 3 ); //profile, profileName, profileNamesArray,
}
// ----------------------------------------------------------------------------
--- a/idlefw/plugins/sapidataplugin/inc/sapidata.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/sapidataplugin/inc/sapidata.h Wed Mar 31 22:04:35 2010 +0300
@@ -33,6 +33,7 @@
class CSapiDataObserver;
class CSapiDataPlugin;
class MAiContentObserver;
+class MAiCpsCommandBuffer;
/**
* @ingroup group_sapidataplugin
@@ -150,7 +151,15 @@
* @param aStatus new status of the publisher
* @return void
*/
- void ChangePublisherStatusL(const TDesC& aStatus);
+ void ChangePublisherStatusL(const TDesC8& aStatus);
+
+ /**
+ * Change the publisher status with list of actions
+ *
+ * @param aActionsList new list of status for the publisher
+ * @return void
+ */
+ void ChangePublisherStatusL(CLiwDefaultList* aActionsList);
/**
* Triggers active event with KNoNotification option.
@@ -183,7 +192,7 @@
*
* @param aStartupReason A reason
*/
- void SetStartupReasonL(const TDesC& aStartupReason);
+ void SetStartupReasonL(const TDesC8& aStartupReason);
/**
* Execute the command to get the data from CPS
@@ -349,9 +358,18 @@
*/
void SetUpdateNeeded(TBool aStatus);
+ /**
+ * Sets property value.
+ *
+ * @since S60 5.2
+ * @param aAny - contains pointer to command buffer.
+ */
+ void SetCommandBuffer(TAny* aAny);
+
private:
// data
-
+ /** CPS Command Buffer Interface, Not Owned */
+ MAiCpsCommandBuffer* iCpsExecute;
/** Subscriber interface, owned */
MLiwInterface* iInterface;
/** Data Observer to CPS content registry, owned */
@@ -373,7 +391,7 @@
/** content id, owned */
HBufC* iContentId;
/** Startup reason, owned */
- HBufC* iStartupReason;
+ HBufC8* iStartupReason;
/** Reference of the sapi data plugin, not owned */
CSapiDataPlugin* iPlugin;
/** Menu item names, owned */
@@ -387,3 +405,4 @@
#endif // SAPIDATA_H
// End of file
+
--- a/idlefw/plugins/sapidataplugin/inc/sapidataplugin.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/sapidataplugin/inc/sapidataplugin.h Wed Mar 31 22:04:35 2010 +0300
@@ -148,6 +148,11 @@
/**
* @see CHsContentPublisher
*/
+ void SetProperty( TProperty aProperty, TAny* aAny );
+
+ /**
+ * @see CHsContentPublisher
+ */
TAny* GetProperty( TProperty aProperty );
/**
@@ -265,7 +270,6 @@
private:
// data
-
/** Iterator for plugin content, owned */
MAiContentItemIterator* iContent;
/** Array of content observers, owned */
@@ -291,3 +295,4 @@
#endif // SAPIDATAPLUGIN_H
// End of file
+
--- a/idlefw/plugins/sapidataplugin/inc/sapidatapluginconst.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/sapidataplugin/inc/sapidatapluginconst.h Wed Mar 31 22:04:35 2010 +0300
@@ -48,6 +48,7 @@
_LIT( KPubData, "publisher" );
_LIT( KCpData_PubData, "cp_data:publisher");
+_LIT8( KPluginId, "plugin_id");
_LIT8( KFilter, "filter" );
_LIT8( KDataMap, "data_map");
_LIT8( KActionTrigger, "action_trigger" );
@@ -78,19 +79,20 @@
_LIT( KUpdate, "update" );
_LIT(KWidget, "hswidget");
-_LIT( KDeActive, "deactive");
-_LIT( KActive, "active");
-_LIT( KSystemStartup, "systemstartup");
-_LIT( KPageStartup, "pagestartup");
-_LIT( KPluginStartup, "pluginstartup");
-_LIT( KSuspend , "suspend");
-_LIT( KResume, "resume");
-_LIT( KSystemShutdown, "systemshutdown");
-_LIT( KPageShutdown, "pageshutdown");
-_LIT( KPluginShutdown, "pluginshutdown");
-_LIT( KOnLine, "online");
-_LIT( KOffLine, "offline");
-_LIT( KInActive, "inactive");
+_LIT8( KDeActive, "deactive");
+_LIT8( KActive, "active");
+_LIT8( KSystemStartup, "systemstartup");
+_LIT8( KPageStartup, "pagestartup");
+_LIT8( KPluginStartup, "pluginstartup");
+_LIT8( KSuspend , "suspend");
+_LIT8( KResume, "resume");
+_LIT8( KSystemShutdown, "systemshutdown");
+_LIT8( KPageShutdown, "pageshutdown");
+_LIT8( KPluginShutdown, "pluginshutdown");
+_LIT8( KOnLine, "online");
+_LIT8( KOffLine, "offline");
+_LIT8( KInActive, "inactive");
+
// reserved extension for retrieving mask handle
_LIT8( KMask, "_mask");
--- a/idlefw/plugins/sapidataplugin/src/sapidata.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/sapidataplugin/src/sapidata.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -22,6 +22,7 @@
#include <utf.h>
// User includes
+#include <aicpscommandbuffer.h>
#include "sapidata.h"
#include "sapidatapluginconst.h"
#include "sapidataobserver.h"
@@ -103,9 +104,6 @@
void CSapiData::ConstructL(CSapiDataPlugin* aPlugin)
{
iPlugin = aPlugin;
- iCommandName = NULL;
- iContentId = NULL;
- iContentType = NULL;
iUpdateNeeded = EFalse;
}
@@ -145,6 +143,7 @@
delete iServiceHandler;
iServiceHandler = NULL;
}
+ iCpsExecute = NULL;
iMenuItems.ResetAndDestroy();
iMenuTriggers.ResetAndDestroy();
iItemList.ResetAndDestroy();
@@ -266,7 +265,7 @@
// SetStartupReasonL
// ---------------------------------------------------------------------------
//
-void CSapiData::SetStartupReasonL(const TDesC& aStartupReason)
+void CSapiData::SetStartupReasonL(const TDesC8& aStartupReason)
{
delete iStartupReason;
iStartupReason = NULL;
@@ -570,27 +569,24 @@
void CSapiData::ExecuteCommandL(const TDesC& aRegistry, CLiwDefaultMap* aInFilter,
CLiwGenericParamList* aOutParamList)
{
- CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL();
-
- TLiwGenericParam type( KType, TLiwVariant( aRegistry ) );
- inParamList->AppendL( type );
-
- //append filter to input param
- TLiwGenericParam item( KFilter, TLiwVariant( aInFilter ));
- inParamList->AppendL( item );
-
- // execute service.It is assumed that iInterface is already initiated
- if(iInterface)
- {
- iInterface->ExecuteCmdL( *iCommandName, *inParamList, *aOutParamList);
- }
- else
- {
- User::Leave( KErrNotSupported );
- }
- type.Reset();
- item.Reset();
- inParamList->Reset();
+ if( iInterface == NULL )
+ {
+ User::Leave( KErrNotSupported );
+ }
+ CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL();
+
+ TLiwGenericParam type( KType, TLiwVariant( aRegistry ) );
+ inParamList->AppendL( type );
+
+ //append filter to input param
+ TLiwGenericParam item( KFilter, TLiwVariant( aInFilter ));
+ inParamList->AppendL( item );
+
+ // execute service.It is assumed that iInterface is already initiated
+ iInterface->ExecuteCmdL( *iCommandName, *inParamList, *aOutParamList);
+ type.Reset();
+ item.Reset();
+ inParamList->Reset();
}
// ---------------------------------------------------------------------------
@@ -599,6 +595,10 @@
//
void CSapiData::ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger )
{
+ if( iInterface == NULL )
+ {
+ User::Leave( KErrNotSupported );
+ }
HBufC8* triggerName = HBufC8::NewLC( KSAPIContentNameMaxLength );
CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL();
@@ -721,45 +721,59 @@
}
// ---------------------------------------------------------------------------
-// PublisherStatusL
+// ChangePublisherStatusL
// ---------------------------------------------------------------------------
//
-void CSapiData::ChangePublisherStatusL(const TDesC& aStatus)
+void CSapiData::ChangePublisherStatusL(const TDesC8& aStatus)
{
+ if( iCpsExecute == NULL )
+ {
+ User::Leave( KErrNotSupported );
+ }
+
if ( aStatus == KResume && iUpdateNeeded )
{
iPlugin->PublishL();
iUpdateNeeded = EFalse;
}
+ CLiwDefaultMap* filter = CreateFilterLC( KWidget() );
+ // Add execute command triggers. Idle framework will execute
+ iCpsExecute->AddCommand( *iContentId, KPubData, filter, aStatus );
+ CleanupStack::PopAndDestroy( filter );
+
+ }
+
+// ---------------------------------------------------------------------------
+// ChangePublisherStatusL
+// ---------------------------------------------------------------------------
+//
+void CSapiData::ChangePublisherStatusL(CLiwDefaultList* aActionsList)
+ {
+ if( iInterface == NULL )
+ {
+ User::Leave( KErrNotSupported );
+ }
CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL();
CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL();
- HBufC8* triggerName = CnvUtfConverter::ConvertFromUnicodeToUtf8L(aStatus);
- CleanupStack::PushL( triggerName );
-
+
+ TLiwGenericParam pluginId( KPluginId, TLiwVariant( iContentId ) );
+ inParamList->AppendL( pluginId );
TLiwGenericParam type( KType, TLiwVariant( KPubData ) );
inParamList->AppendL( type );
-
+
CLiwDefaultMap* filter = CreateFilterLC( KWidget() );
- filter->InsertL(KActionTrigger, TLiwVariant(triggerName->Des()) );
-
+ // add list of action triggers to execute
+ filter->InsertL(KActionTrigger, TLiwVariant(aActionsList) );
+
TLiwGenericParam item( KFilter, TLiwVariant( filter ));
inParamList->AppendL( item );
-
- if(iInterface)
- {
- iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList);
- }
- else
- {
- User::Leave( KErrNotSupported );
- }
-
+ iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList);
CleanupStack::PopAndDestroy( filter );
- CleanupStack::PopAndDestroy( triggerName );
+ outParamList->Reset();
inParamList->Reset();
- outParamList->Reset();
- }
+
+ }
// ---------------------------------------------------------------------------
// TriggerActiveL
@@ -767,29 +781,29 @@
//
void CSapiData::TriggerActiveL()
{
-
- CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL();
- CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL();
-
- TLiwGenericParam type( KType, TLiwVariant( KPubData ) );
- inParamList->AppendL( type );
-
- CLiwDefaultMap* filter = CreateFilterLC( KAll(), KAll() );
- filter->InsertL(KActionTrigger, TLiwVariant( KActive() ));
-
- TLiwGenericParam item( KFilter, TLiwVariant( filter ));
- inParamList->AppendL( item );
if(iInterface)
- {
- iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList, KDisableNotification );
+ {
+ CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL();
+ CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL();
+
+ TLiwGenericParam type( KType, TLiwVariant( KPubData ) );
+ inParamList->AppendL( type );
+
+ CLiwDefaultMap* filter = CreateFilterLC( KAll(), KAll() );
+ filter->InsertL(KActionTrigger, TLiwVariant( KActive() ));
+
+ TLiwGenericParam item( KFilter, TLiwVariant( filter ));
+ inParamList->AppendL( item );
+ iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList, KDisableNotification );
+
+ CleanupStack::PopAndDestroy( filter );
+ inParamList->Reset();
+ outParamList->Reset();
}
else
{
User::Leave( KErrNotSupported );
}
- CleanupStack::PopAndDestroy( filter );
- inParamList->Reset();
- outParamList->Reset();
}
// ---------------------------------------------------------------------------
// UpdatePublisherStatusL
@@ -798,31 +812,34 @@
void CSapiData::UpdatePublisherStatusL( TDesC& aPublisher )
{
if ( aPublisher == iPublisher )
- {
- // Resend the plugin status to publisher
- ChangePublisherStatusL( KActive );
+ {
+ // Resend the plugin status to publisher
+ CLiwDefaultList* actionsToLaunch = CLiwDefaultList::NewLC();
+ actionsToLaunch->AppendL( TLiwVariant( KActive ));
if( iStartupReason->Length() != 0 )
{
- ChangePublisherStatusL( *iStartupReason );
+ actionsToLaunch->AppendL( TLiwVariant( *iStartupReason ));
}
-
if ( iPlugin->IsActive() )
{
- ChangePublisherStatusL( KResume );
+ actionsToLaunch->AppendL( TLiwVariant( KResume ));
}
else
{
- ChangePublisherStatusL( KSuspend );
+ actionsToLaunch->AppendL(TLiwVariant( KSuspend ));
}
// forward the network status if it uses.
if ( iPlugin->NetworkStatus() == CSapiDataPlugin::EOnline )
{
- ChangePublisherStatusL( KOnLine );
+ actionsToLaunch->AppendL(TLiwVariant( KOnLine ));
}
else if ( iPlugin->NetworkStatus() == CSapiDataPlugin::EOffline )
{
- ChangePublisherStatusL( KOffLine );
+ actionsToLaunch->AppendL(TLiwVariant( KOffLine ));
}
+
+ ChangePublisherStatusL( actionsToLaunch );
+ CleanupStack::PopAndDestroy( actionsToLaunch );
}
}
@@ -912,3 +929,14 @@
{
iUpdateNeeded = aStatus;
}
+
+// ---------------------------------------------------------------------------
+// SetCommandBuffer
+// ---------------------------------------------------------------------------
+//
+void CSapiData::SetCommandBuffer(TAny* aAny)
+ {
+ iCpsExecute = reinterpret_cast <MAiCpsCommandBuffer* > ( aAny );
+ }
+
+// End of file
--- a/idlefw/plugins/sapidataplugin/src/sapidataobserver.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/sapidataplugin/src/sapidataobserver.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -19,7 +19,7 @@
#include <liwservicehandler.h>
#include <liwvariant.h>
#include <liwgenericparam.h>
-#include <S32MEM.H>
+#include <s32mem.h>
#include "sapidata.h"
#include "sapidataobserver.h"
#include "sapidatapluginconst.h"
--- a/idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -34,6 +34,7 @@
#include <aipspropertyobserver.h>
#include <aipluginsettings.h>
#include <activeidle2domainpskeys.h>
+#include <debug.h>
#include "sapidatapluginconst.h"
#include "sapidatapluginuids.hrh"
@@ -78,7 +79,7 @@
// ---------------------------------------------------------------------------
//
CSapiDataPlugin::CSapiDataPlugin()
- : iNetworkStatus( EUnknown ), iPluginState( ENone )
+ : iNetworkStatus( EUnknown ), iPluginState( ENone )
{
}
@@ -101,16 +102,9 @@
CSapiDataPlugin::~CSapiDataPlugin()
{
// deactivate the publishers
- if ( iData )
- {
- TRAP_IGNORE( iData->ChangePublisherStatusL( KDeActive ));
-
- delete iData;
- }
-
+ delete iData;
iObservers.Close();
Release( iContent );
-
iDataArray.ResetAndDestroy();
if ( iContentModel )
@@ -124,7 +118,6 @@
}
iIconArray.Reset();
-
iRfs.Close();
}
@@ -152,9 +145,8 @@
// Release memory of the published text
iDataArray.ResetAndDestroy();
// Release memory of the published icons
- iIconArray.Reset();
-
- }
+ iIconArray.Reset();
+ }
}
// ---------------------------------------------------------------------------
@@ -359,13 +351,18 @@
}
// ---------------------------------------------------------------------------
-//Refresh a specific image of text in the widget
+//Refresh a specific image or text in the widget
// ---------------------------------------------------------------------------
//
void CSapiDataPlugin::RefreshL( TDesC& aContentType,
TDesC& aOperation,
CLiwDefaultMap* aDataMap )
- {
+ {
+ __PRINTS("*** CSapiDataPlugin::RefreshL ***");
+
+ __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x, content type: %S, operation: %S" ),
+ &PublisherInfo().Name(), PublisherInfo().Uid().iUid, &aContentType, &aOperation );
+
const TInt observerCount( iObservers.Count() );
const TInt transactionId = reinterpret_cast<TInt>( this );
@@ -398,6 +395,8 @@
iDataArray.ResetAndDestroy();
iIconArray.Reset();
}
+
+ __PRINTS("*** CSapiDataPlugin::RefreshL - done ***");
}
// ---------------------------------------------------------------------------
@@ -455,6 +454,11 @@
{
TRAP_IGNORE( iData->ChangePublisherStatusL( KPluginShutdown ));
}
+
+ if ( iData )
+ {
+ TRAP_IGNORE( iData->ChangePublisherStatusL( KDeActive ));
+ }
}
// ----------------------------------------------------------------------------
@@ -633,6 +637,18 @@
}
// ----------------------------------------------------------------------------
+// CSapiDataPlugin::SetProperty
+//
+// ----------------------------------------------------------------------------
+//
+void CSapiDataPlugin::SetProperty( TProperty aProperty, TAny* aAny )
+ {
+ if (aProperty == ECpsCmdBuffer )
+ {
+ iData->SetCommandBuffer( aAny );
+ }
+ }
+// ----------------------------------------------------------------------------
// CSapiDataPlugin::GetProperty
//
// ----------------------------------------------------------------------------
--- a/idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -34,6 +34,7 @@
#include <aipspropertyobserver.h>
#include <aipluginsettings.h>
#include <activeidle2domainpskeys.h>
+#include <debug.h>
#include "wrtdatapluginconst.h"
#include "wrtdatapluginuids.hrh"
@@ -443,11 +444,16 @@
}
// ---------------------------------------------------------------------------
-//Refresh a specific image of text in the widget
+//Refresh a specific image or text in the widget
// ---------------------------------------------------------------------------
//
void CWrtDataPlugin::RefreshL( TDesC16& aOperation, CLiwDefaultMap* aDataMap )
{
+ __PRINTS("*** CWrtDataPlugin::RefreshL ***");
+
+ __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x, operation: %S" ),
+ &PublisherInfo().Name(), PublisherInfo().Uid().iUid, &aOperation );
+
TInt observers( iObservers.Count() );
TInt transactionId = reinterpret_cast<TInt>( this );
@@ -476,6 +482,8 @@
// Release memory of the published icons
iIconArray.Reset();
}
+
+ __PRINTS("*** CWrtDataPlugin::RefreshL - done ***");
}
// ---------------------------------------------------------------------------
--- a/idlefw/plugins/wsplugin/group/aiwsplugin.mmp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/wsplugin/group/aiwsplugin.mmp Wed Mar 31 22:04:35 2010 +0300
@@ -57,4 +57,6 @@
LIBRARY aiutils.lib
+LIBRARY serviceprovidersettings.lib
+
// End of File
--- a/idlefw/plugins/wsplugin/inc/numerickeyhandler.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/wsplugin/inc/numerickeyhandler.h Wed Mar 31 22:04:35 2010 +0300
@@ -84,6 +84,12 @@
void SetQwertyMode( TInt aValue );
void SetInputLanguage( TInt aValue );
+
+ TBool AllowAlphaNumericMode() const;
+
+ TBool VoIPSupported() const;
+
+ TBool EasyDialingEnabled() const;
// from base class MCenRepNotifyHandlerCallback
--- a/idlefw/plugins/wsplugin/src/numerickeyhandler.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/plugins/wsplugin/src/numerickeyhandler.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -24,6 +24,10 @@
#include <centralrepository.h>
#include <w32adll.h>
+#include <easydialingcrkeys.h>
+#include <spsettings.h>
+#include <featmgr.h>
+
#include <PtiEngine.h>
#include <activeidle2domainpskeys.h>
#include <AvkonInternalCRKeys.h>
@@ -153,11 +157,11 @@
TBool CNumericKeyHandler::CheckPostToTarget(const TRawEvent& aRawEvent ) const
{
const TInt scanCode = aRawEvent.ScanCode();
+ const TUint modifiers = iUiState->Modifiers();
if ( iQwertyMode )
{
- // Don't pass the check if shift is pressed.
- const TUint modifiers = iUiState->Modifiers();
+ // Don't pass the check if shift is pressed.
if(( modifiers & EModifierShift ) == 0 )
{
TInt numericKeysCount = iNumericKeys.Count();
@@ -190,7 +194,15 @@
}
}
}
- return EFalse;
+
+ // Homescreen should open dialer also with alpha characters, if dialer is in
+ // mode that accepts alpha characters into number entry (ou1cimx1#299396)
+
+ const TInt KPhoneKeyStart = 33;
+ const TInt KPhoneKeyEnd = 127;
+
+ return ( ( AllowAlphaNumericMode() ) && ( ( scanCode >= KPhoneKeyStart &&
+ scanCode <= KPhoneKeyEnd ) || modifiers & EModifierSpecial ) );
}
@@ -296,15 +308,73 @@
iInputLanguage = aValue;
}
+/**
+ * Check alpha numeric mode.
+ */
+TBool CNumericKeyHandler::AllowAlphaNumericMode() const
+ {
+ return ( EasyDialingEnabled() || VoIPSupported() );
+ }
+
+/**
+ * Check if voip supported.
+ */
+TBool CNumericKeyHandler::VoIPSupported() const
+ {
+ TBool voipSupported( EFalse );
+ CSPSettings* serviceProviderSettings( NULL );
+
+ TRAP_IGNORE( serviceProviderSettings = CSPSettings::NewL() );
+
+ if ( serviceProviderSettings )
+ {
+ voipSupported = serviceProviderSettings->IsFeatureSupported(
+ ESupportInternetCallFeature );
+
+ delete serviceProviderSettings;
+ }
+
+ return voipSupported;
+ }
+
+/**
+ * Check if easy dialing enabled.
+ */
+TBool CNumericKeyHandler::EasyDialingEnabled() const
+ {
+ TBool easyDialingEnabled( EFalse );
+ if ( FeatureManager::FeatureSupported(
+ KFeatureIdProductIncludesHomeScreenEasyDialing ) )
+ {
+ CRepository* cenrep( NULL );
+ TInt easyDialingSetting;
+
+ TRAP_IGNORE( cenrep = CRepository::NewL( KCRUidEasyDialSettings ) );
+
+ if ( cenrep )
+ {
+ TInt err = cenrep->Get( KEasyDialing, easyDialingSetting );
+ if ( !err && easyDialingSetting )
+ {
+ easyDialingEnabled = ETrue;
+ }
+
+ delete cenrep;
+ }
+ }
+
+ return easyDialingEnabled;
+ }
+
void CNumericKeyHandler::HandleNotifyGeneric(TUint32 aKey)
- {
- if( aKey == KAknFepInputTxtLang )
- {
- TInt newValue = iInputLanguage;
- iInputLanguageRepository->Get( KAknFepInputTxtLang, newValue );
- HandleInputLanguageChanged( newValue );
- }
- }
+ {
+ if( aKey == KAknFepInputTxtLang )
+ {
+ TInt newValue = iInputLanguage;
+ iInputLanguageRepository->Get( KAknFepInputTxtLang, newValue );
+ HandleInputLanguageChanged( newValue );
+ }
+ }
void CNumericKeyHandler::HandleNotifyError
(TUint32 /*aKey*/, TInt /*aError*/, CCenRepNotifyHandler* /*aHandler*/)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/idlefw/src/framework/aicpscommandbuffer.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -0,0 +1,257 @@
+/*
+* 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: Cps command buffer
+*
+*/
+
+
+// System includes
+
+// User includes
+#include <debug.h>
+#include <liwservicehandler.h>
+#include <liwvariant.h>
+#include <liwgenericparam.h>
+
+#include "caicpscommandbuffer.h"
+#include "aicpsexecuteparam.h"
+
+// Constants
+_LIT8( KCPSConfigurationIf, "IContentPublishing" );
+_LIT8( KCPS, "Service.ContentPublishing" );
+_LIT8( KExecuteAction, "ExecuteAction" );
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+// ---------------------------------------------------------------------------
+// CAiCpsCommandBuffer::CAiCpsCommandBuffer
+//
+// ---------------------------------------------------------------------------
+//
+CAiCpsCommandBuffer::CAiCpsCommandBuffer()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsCommandBuffer::ConstructL
+//
+// ---------------------------------------------------------------------------
+//
+void CAiCpsCommandBuffer::ConstructL()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsCommandBuffer::NewL
+//
+// ---------------------------------------------------------------------------
+//
+CAiCpsCommandBuffer* CAiCpsCommandBuffer::NewL()
+ {
+ CAiCpsCommandBuffer* self = CAiCpsCommandBuffer::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsCommandBuffer::NewLC
+//
+// ---------------------------------------------------------------------------
+//
+CAiCpsCommandBuffer* CAiCpsCommandBuffer::NewLC()
+ {
+ CAiCpsCommandBuffer* self = new ( ELeave ) CAiCpsCommandBuffer;
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsCommandBuffer::~CAiCpsCommandBuffer
+//
+// ---------------------------------------------------------------------------
+//
+CAiCpsCommandBuffer::~CAiCpsCommandBuffer()
+ {
+ // Flush any pending commands
+ Flush();
+ if ( iCpsInterface )
+ {
+ // Close interface
+ iCpsInterface->Close();
+ }
+
+ if ( iServiceHandler && iCpsService )
+ {
+ // Detach services from the handler
+ RCriteriaArray interestList;
+
+ TRAP_IGNORE( interestList.AppendL( iCpsService );
+ iServiceHandler->DetachL( interestList ); );
+
+ interestList.Reset();
+ }
+
+ delete iCpsService;
+ delete iServiceHandler;
+
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsCommandBuffer::GetCPSInterfaceL
+//
+// ---------------------------------------------------------------------------
+//
+void CAiCpsCommandBuffer::GetCPSInterfaceL()
+ {
+ iServiceHandler = CLiwServiceHandler::NewL();
+
+ RCriteriaArray interestList;
+
+ // Attach to CPS:
+ iCpsService = CLiwCriteriaItem::NewL( 1, KCPSConfigurationIf, KCPS );
+ iCpsService->SetServiceClass( TUid::Uid( KLiwClassBase ) );
+
+ interestList.AppendL( iCpsService );
+ iServiceHandler->AttachL( interestList );
+ interestList.Reset();
+
+ CLiwGenericParamList& inParamList( iServiceHandler->InParamListL() );
+ CLiwGenericParamList& outParamList( iServiceHandler->OutParamListL() );
+
+ iServiceHandler->ExecuteServiceCmdL(
+ *iCpsService,
+ inParamList,
+ outParamList );
+
+ TInt pos( 0 );
+
+ outParamList.FindFirst( pos, KCPSConfigurationIf );
+
+ if ( pos != KErrNotFound )
+ {
+ iCpsInterface = (outParamList)[pos].Value().AsInterface();
+ inParamList.Reset();
+ outParamList.Reset();
+ }
+ else
+ {
+ inParamList.Reset();
+ outParamList.Reset();
+ User::Leave( KErrNotFound );
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsCommandBuffer::AddCommand
+//
+// ---------------------------------------------------------------------------
+//
+void CAiCpsCommandBuffer::AddCommand( const TDesC& aPluginId,
+ const TDesC& aType, CLiwDefaultMap* aFilter,
+ const TDesC8& aAction )
+ {
+ __PRINTS( "CAiCpsCommandBuffer::AddCommand, start" );
+
+ TRAP_IGNORE( DoAddCommandL( aPluginId, aType, aFilter, aAction ) );
+
+ __PRINTS( "CAiCpsCommandBuffer::AddCommand - done" );
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsCommandBuffer::DoAddCommandL
+//
+// ---------------------------------------------------------------------------
+//
+void CAiCpsCommandBuffer::DoAddCommandL( const TDesC& aPluginId,
+ const TDesC& aType, CLiwDefaultMap* aFilter,
+ const TDesC8& aAction )
+ {
+ TInt found = KErrNotFound;
+ for (TInt i=0; i< iPlugins.Count(); i++)
+ {
+ if ( aPluginId == iPlugins[i]->PluginId() )
+ {
+ found = i;
+ break;
+ }
+ }
+
+ if ( found != KErrNotFound )
+ {
+ iPlugins[found]->AddActionL( aAction );
+ }
+ else
+ {
+ CAiCpsExecuteParam* param = CAiCpsExecuteParam::NewLC();
+ param->SetPluginIdL( aPluginId );
+ param->SetRegistryTypeL( aType );
+ param->SetFilterL( aFilter );
+ param->AddActionL( aAction );
+ iPlugins.AppendL( param );
+ CleanupStack::Pop( param );
+ }
+
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsCommandBuffer::Flush
+//
+// ---------------------------------------------------------------------------
+//
+void CAiCpsCommandBuffer::Flush()
+ {
+ __PRINTS( "CAiCpsCommandBuffer::Flush, start" );
+ if ( iPlugins.Count() > 0 )
+ {
+ TRAP_IGNORE( DoFlushL() );
+ }
+ __PRINTS( "CAiCpsCommandBuffer::Flush - done" );
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsCommandBuffer::DoFlushL
+//
+// ---------------------------------------------------------------------------
+//
+void CAiCpsCommandBuffer::DoFlushL()
+ {
+ if ( !iCpsInterface )
+ {
+ GetCPSInterfaceL();
+ }
+
+ if(iCpsInterface)
+ {
+ TInt pluginCount = iPlugins.Count();
+ for (TInt i=0; i < pluginCount; i++ )
+ {
+ CLiwGenericParamList* inParamList = iPlugins[i]->InParamListLC();
+ CLiwGenericParamList* outParamList = CLiwGenericParamList::NewLC();
+ __PRINTS( "CAiCpsCommandBuffer::DoFlush : Execute" );
+ iCpsInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList);
+
+ CleanupStack::PopAndDestroy( outParamList );
+ CleanupStack::PopAndDestroy( inParamList );
+ }
+ }
+ else
+ {
+ User::Leave( KErrNotSupported );
+ }
+ iPlugins.ResetAndDestroy();
+ }
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/idlefw/src/framework/aicpsexecuteparam.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -0,0 +1,203 @@
+/*
+* 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: CPS Execute parameter object
+*
+*/
+
+
+// System includes
+
+// User includes
+#include <debug.h>
+#include <liwvariant.h>
+#include <liwgenericparam.h>
+#include "aicpsexecuteparam.h"
+
+// Constants
+_LIT8( KPublisherId, "publisher" );
+_LIT8( KContentType, "content_type" );
+_LIT8( KContentId, "content_id" );
+_LIT8( KPluginId, "plugin_id");
+_LIT8( KType, "type");
+_LIT8( KFilter, "filter" );
+_LIT8( KActionTrigger, "action_trigger" );
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+// ---------------------------------------------------------------------------
+// CAiCpsExecuteParam::CAiCpsExecuteParam
+//
+// ---------------------------------------------------------------------------
+//
+CAiCpsExecuteParam::CAiCpsExecuteParam()
+ {
+
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsExecuteParam::ConstructL
+//
+// ---------------------------------------------------------------------------
+//
+void CAiCpsExecuteParam::ConstructL( )
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsExecuteParam::NewL
+//
+// ---------------------------------------------------------------------------
+//
+CAiCpsExecuteParam* CAiCpsExecuteParam::NewL()
+ {
+ CAiCpsExecuteParam* self = CAiCpsExecuteParam::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsExecuteParam::NewLC
+//
+// ---------------------------------------------------------------------------
+//
+CAiCpsExecuteParam* CAiCpsExecuteParam::NewLC()
+ {
+ CAiCpsExecuteParam* self = new ( ELeave ) CAiCpsExecuteParam;
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+// ---------------------------------------------------------------------------
+// CAiCpsExecuteParam::~CAiCpsExecuteParam
+//
+// ---------------------------------------------------------------------------
+//
+CAiCpsExecuteParam::~CAiCpsExecuteParam()
+ {
+ delete iPluginId;
+ delete iRegistryType;
+ delete iPublisher;
+ delete iContentType;
+ delete iContentId;
+ iActions.ResetAndDestroy();
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsExecuteParam::PluginId
+//
+// ---------------------------------------------------------------------------
+//
+const TDesC& CAiCpsExecuteParam::PluginId() const
+ {
+ return *iPluginId;
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsExecuteParam::InParamListLC
+//
+// ---------------------------------------------------------------------------
+//
+CLiwGenericParamList* CAiCpsExecuteParam::InParamListLC()
+ {
+ CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC();
+
+ TLiwGenericParam pluginId( KPluginId, TLiwVariant( iPluginId ) );
+ paramList->AppendL( pluginId );
+ TLiwGenericParam type( KType, TLiwVariant( iRegistryType ) );
+ paramList->AppendL( type );
+
+ CLiwDefaultMap* filter = CLiwDefaultMap::NewLC();
+ filter->InsertL( KPublisherId, TLiwVariant(iPublisher ));
+ filter->InsertL( KContentId, TLiwVariant(iContentId ));
+ filter->InsertL( KContentType, TLiwVariant(iContentType ));
+
+ CLiwDefaultList* actionsToLaunch = CLiwDefaultList::NewLC();
+ for ( TInt i=0; i< iActions.Count(); i++)
+ {
+ actionsToLaunch->AppendL( TLiwVariant( *iActions[i]));
+ }
+ filter->InsertL(KActionTrigger, TLiwVariant(actionsToLaunch) );
+
+ TLiwGenericParam item( KFilter, TLiwVariant( filter ));
+ paramList->AppendL( item );
+ CleanupStack::PopAndDestroy( actionsToLaunch );
+ CleanupStack::PopAndDestroy( filter );
+ return paramList;
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsExecuteParam::SetFilterL
+//
+// ---------------------------------------------------------------------------
+//
+void CAiCpsExecuteParam::SetFilterL(CLiwDefaultMap* aMap)
+ {
+ delete iPublisher;
+ delete iContentType;
+ delete iContentId;
+ iPublisher = NULL;
+ iContentType = NULL;
+ iContentId = NULL;
+
+ TLiwVariant variant;
+ if ( aMap->FindL(KPublisherId, variant ))
+ {
+ iPublisher = variant.AsDes().AllocL();
+ }
+ if ( aMap->FindL(KContentType, variant ))
+ {
+ iContentType= variant.AsDes().AllocL();
+ }
+ if ( aMap->FindL(KContentId, variant ))
+ {
+ iContentId= variant.AsDes().AllocL();
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsExecuteParam::SetRegistryTypeL
+//
+// ---------------------------------------------------------------------------
+//
+void CAiCpsExecuteParam::SetRegistryTypeL(const TDesC& aRegistryType)
+ {
+ delete iRegistryType;
+ iRegistryType = NULL;
+ iRegistryType = aRegistryType.AllocL();
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsExecuteParam::SetPluginIdL
+//
+// ---------------------------------------------------------------------------
+//
+void CAiCpsExecuteParam::SetPluginIdL(const TDesC& aPluginId)
+ {
+ delete iPluginId;
+ iPluginId = NULL;
+ iPluginId = aPluginId.AllocL();
+ }
+
+// ---------------------------------------------------------------------------
+// CAiCpsExecuteParam::AddActionL
+//
+// ---------------------------------------------------------------------------
+//
+void CAiCpsExecuteParam::AddActionL(const TDesC8& aAction)
+ {
+ iActions.Append(aAction.AllocL());
+ }
+
+// End of file
--- a/idlefw/src/framework/aipluginfactory.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/src/framework/aipluginfactory.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -233,7 +233,32 @@
__PRINTS( "*** CAiPluginFactory::DestroyPlugin: Done ***" );
}
+
+// ----------------------------------------------------------------------------
+// CAiPluginFactory::DestroyPlugin()
+//
+// ----------------------------------------------------------------------------
+//
+void CAiPluginFactory::DestroyPlugin( const TUid& aUid )
+ {
+ __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Start ***" );
+
+ CHsContentPublisher* plugin( PluginByUid( aUid ) );
+
+ while ( plugin )
+ {
+ iPublishers.Remove( iPublishers.Find( plugin ) );
+ __PRINT( __DBG_FORMAT(
+ "CAiPluginFactory::DestroyPlugin: name: %S" ), &plugin->PublisherInfo().Name() );
+
+ delete plugin;
+ plugin = NULL;
+ }
+
+ __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Done ***" );
+ }
+
// ----------------------------------------------------------------------------
// CAiPluginFactory::CreatePluginL()
//
@@ -254,6 +279,8 @@
CleanupStack::PushL( plugin );
+ plugin->SetProperty( CHsContentPublisher::ECpsCmdBuffer, iCommandBuffer );
+
__TIME( "FW: Subscribe content observers",
SubscribeContentObserversL( *plugin, aPublisherInfo ) );
@@ -390,58 +417,13 @@
}
// ----------------------------------------------------------------------------
-// CAiPluginFactory::ResolvePluginsToUpgradeL()
+// CAiPluginFactory::SetCommandBuffer()
//
// ----------------------------------------------------------------------------
//
-void CAiPluginFactory::ResolvePluginsToUpgradeL(
- RArray< THsPublisherInfo >& aArray )
+void CAiPluginFactory::SetCommandBuffer( MAiCpsCommandBuffer* aCommandBuffer )
{
- RImplInfoPtrArray ecomPlugins;
- CleanupResetAndDestroyPushL( ecomPlugins );
-
- REComSession::ListImplementationsL(
- KInterfaceUidHsContentPlugin, ecomPlugins );
-
- for ( TInt i = 0; i < ecomPlugins.Count(); i++ )
- {
- CImplementationInformation* newInformation( ecomPlugins[i] );
-
- for( TInt j = 0; j < iEComPlugins.Count(); j++ )
- {
- CImplementationInformation* oldInformation( iEComPlugins[j] );
-
- if( newInformation->ImplementationUid() == oldInformation->ImplementationUid() )
- {
- if( newInformation->Version() != oldInformation->Version() )
- {
- for ( TInt k = 0; k < iPublishers.Count(); k++ )
- {
- const THsPublisherInfo& info(
- iPublishers[k]->PublisherInfo() );
-
- if ( info.Uid() == newInformation->ImplementationUid() )
- {
- __PRINT( __DBG_FORMAT( "\t[I]\t Plug-in to update uid=%x name=%S namespace=%S, version update %d to %d"),
- info.Uid(), &(info.Name()), &(info.Namespace()), oldInformation->Version(), newInformation->Version() );
-
- aArray.Append( info );
- }
- }
-
- break;
- }
- }
- }
- }
-
- CleanupStack::PopAndDestroy( &ecomPlugins );
-
- // Update ecom plugin array
- iEComPlugins.ResetAndDestroy();
-
- REComSession::ListImplementationsL(
- KInterfaceUidHsContentPlugin, iEComPlugins );
+ iCommandBuffer = aCommandBuffer;
}
// End of file
--- a/idlefw/src/framework/aistatemanager.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/src/framework/aistatemanager.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -20,15 +20,21 @@
// User includes
#include <hscontentpublisher.h>
#include <aifwdefs.h>
+#include <AknWaitDialog.h>
+#include <bautils.h>
+#include <ConeResLoader.h>
+#include <debug.h>
+#include "caicpscommandbuffer.h"
#include "aipluginfactory.h"
#include "aistatemanager.h"
-#include "debug.h"
+#include <homescreen.rsg>
-// Constants
-_LIT( KOnlineOffline, "online_offline" );
+_LIT( KResourceDrive, "Z:" );
+_LIT( KResourceFile, "homescreen.rsc" );
+_LIT( KResourcePath, "\\resource\\apps\\" );
// ======== LOCAL FUNCTIONS ========
// ----------------------------------------------------------------------------
@@ -114,6 +120,12 @@
//
CAiStateManager::~CAiStateManager()
{
+ if( iWaitDialog )
+ {
+ delete iWaitDialog;
+ }
+ delete iCommandBuffer;
+ iReloadPlugins.Close();
}
// ----------------------------------------------------------------------------
@@ -133,6 +145,9 @@
//
void CAiStateManager::ConstructL()
{
+ iCommandBuffer = CAiCpsCommandBuffer::NewL();
+
+ iFactory.SetCommandBuffer( iCommandBuffer );
}
// ----------------------------------------------------------------------------
@@ -246,9 +261,12 @@
if ( retval == KErrNone )
{
CHsContentPublisher* plugin( iFactory.PluginByInfo( aPublisherInfo ) );
-
- // Do startup state transition
- StartPlugin( *plugin, StartReason( aReason ) );
+
+ if( plugin )
+ {
+ // Do startup state transition
+ StartPlugin( *plugin, StartReason( aReason ) );
+ }
}
__TIME_ENDMARK( "CAiStateManager::NotifyLoadPlugin, construction", time );
@@ -286,55 +304,21 @@
}
// ----------------------------------------------------------------------------
-// CAiStateManager::NotifyUpdatePlugins()
+// CAiStateManager::NotifyReloadPlugins()
//
// ----------------------------------------------------------------------------
//
-void CAiStateManager::NotifyUpdatePlugins()
+void CAiStateManager::NotifyReloadPlugins()
{
- __PRINTS( "CAiStateManager::NotifyUpdatePlugins" );
-
- RArray< THsPublisherInfo > publishers;
-
- // Get plugins which has upgrade available
- TRAP_IGNORE( iFactory.ResolvePluginsToUpgradeL( publishers ) );
-
- for ( TInt i = 0; i < publishers.Count(); i++ )
- {
- THsPublisherInfo info( publishers[i] );
-
- // Update by destroy - load sequence
- NotifyDestroyPlugin( info, EAiFwSystemShutdown );
- NotifyLoadPlugin( info, EAiFwSystemStartup );
+ __PRINTS( "CAiStateManager::NotifyReloadPlugins" );
+
+ for ( TInt i = 0; i < iReloadPlugins.Count(); i++ )
+ {
+ // Reload plugin
+ NotifyLoadPlugin( iReloadPlugins[ i ], EAiFwSystemStartup );
}
- publishers.Reset();
-
- __PRINTS( "CAiStateManager::NotifyUpdatePlugins, done" );
- }
-
-// ----------------------------------------------------------------------------
-// CAiStateManager::OnlineStateInUse()
-//
-// ----------------------------------------------------------------------------
-//
-TBool CAiStateManager::OnlineStateInUse() const
- {
- __PRINTS( "CAiStateManager::OnlineStateInUse" );
-
- RPointerArray< CHsContentPublisher >& plugins( iFactory.Publishers() );
-
- for( TInt i = 0; i < plugins.Count(); i++ )
- {
- CHsContentPublisher* plugin( plugins[i] );
-
- if ( plugin->HasMenuItem( KOnlineOffline() ) )
- {
- return ETrue;
- }
- }
-
- return EFalse;
+ __PRINTS( "CAiStateManager::NotifyReloadPlugins, done" );
}
// ----------------------------------------------------------------------------
@@ -405,6 +389,8 @@
plugin->Suspend( CHsContentPublisher::EBackground ) );
}
}
+
+ FlushCommandBuffer();
}
else
{
@@ -439,6 +425,8 @@
}
}
+ FlushCommandBuffer();
+
__TIME_ENDMARK( "CAiStateManager::ProcessGeneralThemeChange, done", time );
}
@@ -454,6 +442,15 @@
iHalt = aStart;
+ if ( aStart )
+ {
+ TRAP_IGNORE( StartWaitDialogL() );
+ }
+ else
+ {
+ TRAP_IGNORE( StopWaitDialogL() );
+ }
+
RPointerArray< CHsContentPublisher >& plugins( iFactory.Publishers() );
for( TInt i = 0; i < plugins.Count(); i++ )
@@ -473,6 +470,8 @@
}
}
}
+
+ FlushCommandBuffer();
__TIME_ENDMARK( "CAiStateManager::ProcessBackupRestore, done", time );
}
@@ -501,6 +500,8 @@
plugin->SetOffline();
}
}
+
+ FlushCommandBuffer();
}
// ----------------------------------------------------------------------------
@@ -544,6 +545,8 @@
aPlugin.SetOffline() );
}
+ FlushCommandBuffer();
+
__PRINTS( "CAiStateManager::StartPlugin - done" );
}
@@ -569,6 +572,8 @@
aPlugin.Stop( aReason );
+ FlushCommandBuffer();
+
__PRINTS( "CAiStateManager::StopPlugin - done" );
}
@@ -592,10 +597,111 @@
StopPlugin( *plugin, CHsContentPublisher::ESystemShutdown );
}
+ FlushCommandBuffer();
+
// Finally get rid of all plugins
plugins.ResetAndDestroy();
__TIME_ENDMARK( "CAiStateManager::DestroyPlugins, done", time );
}
+// ----------------------------------------------------------------------------
+// CAiStateManager::FlushCommandBuffer();()
+//
+// ----------------------------------------------------------------------------
+//
+void CAiStateManager::FlushCommandBuffer()
+ {
+ __PRINTS( "CAiStateManager::FlushCommandBuffer, start" );
+
+ if ( iCommandBuffer )
+ {
+ __TIME( "CAiStateManager::FlushCommandBuffer, flush",
+
+ iCommandBuffer->Flush() );
+ }
+
+ __PRINTS( "CAiStateManager::FlushCommandBuffer - done" );
+ }
+
+// ----------------------------------------------------------------------------
+// CAiStateManager::NotifyReleasePlugins()
+//
+// ----------------------------------------------------------------------------
+//
+void CAiStateManager::NotifyReleasePlugins( const RArray<TUid>& aUidList )
+ {
+ __PRINTS( "CAiStateManager::NotifyReleasePlugins" );
+
+ iReloadPlugins.Reset();
+
+ for ( TInt i = 0; i < aUidList.Count(); i++ )
+ {
+ CHsContentPublisher* plugin = iFactory.PluginByUid( aUidList[ i ] );
+ if ( plugin )
+ {
+ StopPlugin( *plugin, CHsContentPublisher::ESystemShutdown );
+ THsPublisherInfo info = plugin->PublisherInfo();
+ iReloadPlugins.Append( info );
+ iFactory.DestroyPlugin( aUidList[ i ] );
+ }
+ }
+ __PRINTS( "CAiStateManager::NotifyReleasePlugins: return void" );
+ }
+
+// ----------------------------------------------------------------------------
+// CAiStateManager::StartWaitDialogL()
+//
+// ----------------------------------------------------------------------------
+//
+void CAiStateManager::StartWaitDialogL()
+ {
+ RConeResourceLoader resourceLoader( *CCoeEnv::Static() );
+ TFullName fileName( KResourceDrive );
+ fileName.Append( KResourcePath );
+ fileName.Append( KResourceFile );
+
+ // Get language of resource file.
+ BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), fileName );
+
+ // Open resource file.
+ resourceLoader.OpenL( fileName );
+
+ if( iWaitDialog )
+ {
+ delete iWaitDialog;
+ iWaitDialog = NULL;
+ }
+
+ // For the wait dialog
+ iWaitDialog = new (ELeave) CAknWaitDialog(
+ REINTERPRET_CAST( CEikDialog**, &iWaitDialog ) );
+ iWaitDialog->SetCallback( this );
+ iWaitDialog->ExecuteLD( R_HOMESCREEN_WAIT_DIALOG );
+ resourceLoader.Close();
+ }
+
+// ----------------------------------------------------------------------------
+// CAiStateManager::StopWaitDialogL()
+//
+// ----------------------------------------------------------------------------
+//
+void CAiStateManager::StopWaitDialogL()
+ {
+ if( iWaitDialog )
+ {
+ iWaitDialog->ProcessFinishedL();
+ }
+ }
+
+// ----------------------------------------------------------------------------
+// CAiStateManager::DialogDismissedL()
+//
+// ----------------------------------------------------------------------------
+//
+void CAiStateManager::DialogDismissedL(TInt /*aButtonId*/)
+ {
+ // No implementation required.
+ }
+
// End of file
--- a/idlefw/src/framework/aistateprovider.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/src/framework/aistateprovider.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -19,6 +19,9 @@
#include <AknDef.h>
#include <connect/sbdefs.h>
#include <e32property.h>
+#include <swi/swispubsubdefs.h>
+#include <swi/swiutils.h>
+#include <sacls.h> // KSWIUidsCurrentlyBeingProcessed
// User includes
#include <aipspropertyobserver.h>
@@ -29,6 +32,8 @@
#include "aistateprovider.h"
+#include "debug.h"
+
// Constants
// ======== LOCAL FUNCTIONS ========
@@ -113,7 +118,11 @@
iBackupRestoreObserver = AiUtility::CreatePSPropertyObserverL(
TCallBack( BackupRestoreEvent, this ),
KUidSystemCategory, conn::KUidBackupRestoreKey );
-
+
+ iSwiUidListObserver = AiUtility::CreatePSPropertyObserverL(
+ TCallBack( SwiUidListEvent, this ),
+ KUidSystemCategory, KSWIUidsCurrentlyBeingProcessed );
+
User::LeaveIfError( iSkinSrv.Connect( this ) );
iEcomObserver = CAiEcomObserver::NewL();
@@ -152,7 +161,10 @@
Release( iBackupRestoreObserver );
iBackupRestoreObserver = NULL;
-
+
+ Release( iSwiUidListObserver );
+ iSwiUidListObserver = NULL;
+
delete iLightObserver;
iLightObserver = NULL;
}
@@ -238,7 +250,9 @@
//
void CAiStateProvider::NotifyEcomRegistryChanged()
{
- iObserver.NotifyUpdatePlugins();
+ __PRINTS( "CAiStateProvider::NotifyEcomRegistryChanged" );
+ iObserver.NotifyReloadPlugins();
+ __PRINTS( "CAiStateProvider::NotifyEcomRegistryChanged - return void" );
}
// ----------------------------------------------------------------------------
@@ -277,16 +291,6 @@
}
// ----------------------------------------------------------------------------
-// CAiStateProvider::OnlineStateInUse()
-//
-// ----------------------------------------------------------------------------
-//
-TBool CAiStateProvider::OnlineStateInUse() const
- {
- return iObserver.OnlineStateInUse();
- }
-
-// ----------------------------------------------------------------------------
// CAiStateProvider::BackupRestoreEvent()
//
// ----------------------------------------------------------------------------
@@ -315,5 +319,23 @@
return KErrNone;
}
+// ----------------------------------------------------------------------------
+// CAiStateProvider::SwiUidLIstEvent()
+//
+// ----------------------------------------------------------------------------
+//
+/* static */ TInt CAiStateProvider::SwiUidListEvent( TAny* aAny )
+ {
+ CAiStateProvider* self = static_cast< CAiStateProvider* >( aAny );
+
+ RArray<TUid> uidList;
+ if ( KErrNone == Swi::GetAllUids( uidList ) )
+ {
+ self->iObserver.NotifyReleasePlugins( uidList );
+ }
+
+ return KErrNone;
+ }
+
// End of file
--- a/idlefw/src/framework/homescreen.rss Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/src/framework/homescreen.rss Wed Mar 31 22:04:35 2010 +0300
@@ -60,3 +60,24 @@
#endif // __SCALABLE_ICONS
};
}
+
+RESOURCE DIALOG r_homescreen_wait_dialog
+ {
+ flags = EAknWaitNoteFlags;
+ buttons = R_AVKON_SOFTKEYS_EMPTY;
+ items =
+ {
+ DLG_LINE
+ {
+ type = EAknCtNote;
+ id = EGeneralNote;
+ control= AVKON_NOTE
+ {
+ layout = EWaitLayout;
+ singular_label = qtn_hs_backup_use_prevented;
+ animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+ };
+ }
+ };
+ }
+
--- a/idlefw/src/idleint/aiuiidleintegration.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/src/idleint/aiuiidleintegration.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -17,12 +17,14 @@
// System includes
+#include <startupdomainpskeys.h>
#include <coeaui.h>
#include <eikenv.h>
#include <AknIncallBubbleNotify.h>
#include <aknsoundsystem.h>
#include <AknDef.h>
#include <ctsydomainpskeys.h>
+#include <apgtask.h>
// User includes
#include <aisystemuids.hrh>
@@ -65,7 +67,9 @@
delete iIncallBubble;
- Release( iCallStatusObserver );
+ Release( iCallStatusObserver );
+
+ Release( iUiStartupStateObserver );
}
// ----------------------------------------------------------------------------
@@ -119,8 +123,13 @@
KPSUidCtsyCallInformation,
KCTsyCallState );
- ActivateUI();
-
+ iUiStartupStateObserver = AiUtility::CreatePSPropertyObserverL(
+ TCallBack( HandleUiStartupStateChange, this ),
+ KPSUidStartup,
+ KPSStartupUiPhase );
+
+ HandleUiStartupStateChange( this );
+
__TIME_ENDMARK( "CAiUiIdleIntegrationImpl::ConstructL, done", time );
}
@@ -130,11 +139,22 @@
//
void CAiUiIdleIntegrationImpl::ActivateUI()
{
- __TICK( "CAiUiIdleIntegrationImpl::ActivateUI - HandleActivateUI" );
+ __TICK( "CAiUiIdleIntegrationImpl::ActivateUI" );
+
+ Release( iUiStartupStateObserver );
+ iUiStartupStateObserver = NULL;
iAiFwEventHandler->HandleActivateUI();
- __PRINTS( "CAiUiIdleIntegrationImpl::ActivateUI - HandleActivateUI done" );
+ RWsSession& wsSession( iEikEnv.WsSession() );
+
+ TApaTaskList taskList( wsSession );
+
+ TApaTask task( taskList.FindApp( TUid::Uid( AI_UID3_AIFW_EXE ) ) );
+
+ task.BringToForeground();
+
+ __PRINTS( "*** CAiUiIdleIntegrationImpl::ActivateUI - done" );
}
// ----------------------------------------------------------------------------
@@ -148,6 +168,8 @@
if ( type == KAknFullOrPartialForegroundGained )
{
+ __PRINTS( "*** CAiUiIdleIntegrationImpl::HandleWsEventL - Foreground" );
+
if ( !iForeground )
{
iForeground = ETrue;
@@ -157,6 +179,8 @@
}
else if ( type == KAknFullOrPartialForegroundLost )
{
+ __PRINTS( "*** CAiUiIdleIntegrationImpl::HandleWsEventL - Background" );
+
if ( iForeground )
{
iForeground = EFalse;
@@ -243,21 +267,21 @@
TInt CAiUiIdleIntegrationImpl::HandleCallEvent( TAny* aPtr )
{
__ASSERT_DEBUG( aPtr,
- AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) );
+ AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) );
CAiUiIdleIntegrationImpl* self =
- static_cast<CAiUiIdleIntegrationImpl*>( aPtr );
+ static_cast< CAiUiIdleIntegrationImpl* >( aPtr );
TInt callStatus( EPSCTsyCallStateNone );
TInt err( self->iCallStatusObserver->Get( callStatus ) );
- if( err == KErrNone )
+ if ( err == KErrNone )
{
// Call ongoing => show bubble if not showing already
TBool allowed = EFalse;
- if( !self->iIncallBubbleAllowed &&
+ if ( !self->iIncallBubbleAllowed &&
self->iForeground &&
( callStatus > EPSCTsyCallStateNone ) )
{
@@ -265,22 +289,21 @@
TRAP( err,
self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) );
-
-
- if( err == KErrNone )
+
+ if ( err == KErrNone )
{
self->iIncallBubbleAllowed = allowed;
}
}
// No call ongoing => hide if bubble is visible
- else if( self->iIncallBubbleAllowed && callStatus <= EPSCTsyCallStateNone )
+ else if ( self->iIncallBubbleAllowed && callStatus <= EPSCTsyCallStateNone )
{
allowed = EFalse;
TRAP( err,
self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) );
- if( err == KErrNone )
+ if ( err == KErrNone )
{
self->iIncallBubbleAllowed = allowed;
}
@@ -290,5 +313,33 @@
return err;
}
-// End of file.
+// ----------------------------------------------------------------------------
+// CAiUiIdleIntegrationImpl::HandleUiStartupStateChange()
+// ----------------------------------------------------------------------------
+//
+TInt CAiUiIdleIntegrationImpl::HandleUiStartupStateChange( TAny *aPtr )
+ {
+ __ASSERT_DEBUG( aPtr,
+ AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) );
+
+ CAiUiIdleIntegrationImpl* self =
+ static_cast< CAiUiIdleIntegrationImpl* >( aPtr );
+ if ( !self->iUiStartupPhaseOk )
+ {
+ TInt state( 0 );
+
+ self->iUiStartupStateObserver->Get( state );
+
+ if ( state == EStartupUiPhaseAllDone )
+ {
+ self->iUiStartupPhaseOk = ETrue;
+
+ self->ActivateUI();
+ }
+ }
+
+ return KErrNone;
+ }
+
+// End of file
--- a/idlefw/src/idleint/aiuiidleintegrationimpl.h Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/src/idleint/aiuiidleintegrationimpl.h Wed Mar 31 22:04:35 2010 +0300
@@ -68,6 +68,8 @@
static TInt HandleCallEvent( TAny *aPtr );
+ static TInt HandleUiStartupStateChange( TAny *aPtr );
+
private:
// data
@@ -94,6 +96,13 @@
* Owned
*/
MAiPSPropertyObserver* iCallStatusObserver;
+
+ /**
+ * Ui startup state
+ * Owned
+ */
+ MAiPSPropertyObserver* iUiStartupStateObserver;
+
/**
* Framework event handler. For notifying critical startup over.
* Not owned.
@@ -101,7 +110,8 @@
MAiFwEventHandler* iAiFwEventHandler;
TBool iForeground;
- TBool iIncallBubbleAllowed;
+ TBool iIncallBubbleAllowed;
+ TBool iUiStartupPhaseOk;
};
#endif // C_AIUIIDLEINTEGRATION_H
--- a/idlefw/src/utility/caipspropertyobserver.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/idlefw/src/utility/caipspropertyobserver.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -38,7 +38,7 @@
CPSPropertyObserver::CPSPropertyObserver( TCallBack aCallBack,
TUid aCategory,
TInt aKey )
- : CActive( EPriorityStandard ),
+ : CActive( EPriorityHigh ),
iCallBack( aCallBack ),
iCategory( aCategory ),
iKey( aKey )
Binary file menucontentsrv/conf/s60mcs.confml has changed
--- a/menucontentsrv/group/mcsmenusrv.mmp Mon Mar 15 12:41:53 2010 +0200
+++ b/menucontentsrv/group/mcsmenusrv.mmp Wed Mar 31 22:04:35 2010 +0300
@@ -12,7 +12,7 @@
* Contributors:
*
* Description:
-* Version : %version: ou1s60ui#5.1.8 % << Don't touch! Updated by Synergy at check-out.
+* Version : %version: sa1spcx1#5.1.9 % << Don't touch! Updated by Synergy at check-out.
*
*/
@@ -22,6 +22,8 @@
#include <data_caging_paths.hrh>
#include "../inc/menuuid.hrh"
+EPOCHEAPSIZE 4000 3000000
+
TARGET mcsmenuserver.exe
TARGETTYPE exe
UID 0x1000008c MENU_SRV_UID3
@@ -42,6 +44,5 @@
LIBRARY euser.lib
LIBRARY mcsmenu.lib
LIBRARY mcsmenuutils.lib
-LIBRARY MemMan.lib
--- a/menucontentsrv/srvsrc/menusrvmain.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/menucontentsrv/srvsrc/menusrvmain.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -16,7 +16,6 @@
*/
// INCLUDE FILES
-#include <mw/MemoryManager.h>
#include "menusrv.h"
// ==================== LOCAL FUNCTIONS ====================
@@ -27,10 +26,5 @@
*/
GLDEF_C TInt E32Main()
{
- RAllocator* iAllocator = MemoryManager::SwitchToFastAllocator();
-
- TInt err = RunMenuServer();
-
- MemoryManager::CloseFastAllocator(iAllocator);
- return err;
+ return RunMenuServer();
}
--- a/package_definition.xml Mon Mar 15 12:41:53 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
- <package id="homescreensrv" name="Home Screen Services" levels="plugin framework server generic specific">
- <collection id="contentpublishingsrv" name="Content Publishing Service" level="server">
- <component id="contentpublishingutils" filter="s60" name="Content Publishing Utils">
- <unit bldFile="contentpublishingsrv/contentpublishingutils/group"/>
- <!-- should only have one bld.inf, does the below need to be #included in the above ? -->
- <unit bldFile="contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group"/>
- </component>
- <component id="contentpublishingserver" filter="s60" name="Content Publishing Server">
- <unit bldFile="contentpublishingsrv/contentpublishingserver/group"/>
- </component>
- <component id="contentharvester" filter="s60" name="Content Harvester">
- <unit bldFile="contentpublishingsrv/contentharvester/group"/>
- </component>
- <component id="contentpublishingsrv_build" filter="s60" name="Content Publishing Service Build">
- <unit bldFile="contentpublishingsrv/group"/>
- </component>
- </collection>
- <collection id="backsteppingsrv" name="Back Stepping Service" level="server">
- <component id="bsengine" name="Back Stepping Engine" filter="s60">
- <unit bldFile="backsteppingsrv/group"/>
- </component>
- </collection>
- <collection id="xcfw" name="XML Content Framework" level="framework">
- <component id="xcfw_build" filter="s60" name="XML Content Framework Build">
- <unit bldFile="xcfw/group"/>
- </component>
- </collection>
- <collection id="homescreenpluginsrv" name="Home Screen Plugin Service" level="plugin">
- <component id="hspsdefinitionengine" filter="s60" name="HS Plugin Service Definition Engine">
- <unit bldFile="homescreenpluginsrv/hspsdefinitionengine/group"/>
- </component>
- <component id="hspsdom" filter="s60" name="HS Plugin Service DOM">
- <unit bldFile="homescreenpluginsrv/hspsdom/group"/>
- </component>
- <component id="hspspluginregistry" filter="s60" name="HS Plugin Registry">
- <unit bldFile="homescreenpluginsrv/hspspluginregistry/group"/>
- </component>
- <component id="hspsmanager" filter="s60" name="HS Plugin Service Manager">
- <unit bldFile="homescreenpluginsrv/hspsmanager/group"/>
- </component>
- <component id="hspsodt" filter="s60" name="HS Plugin Service Object Description Tree">
- <unit bldFile="homescreenpluginsrv/hspsodt/group"/>
- </component>
- <component id="hspsresource" filter="s60" name="HS Plugin Server Resource">
- <unit bldFile="homescreenpluginsrv/hspsresource/group"/>
- </component>
- <component id="hspsresult" filter="s60" name="HS Plugin Server Result">
- <unit bldFile="homescreenpluginsrv/hspsresult/group"/>
- </component>
- <component id="hspstools" filter="s60" name="HS Server Tools">
- <unit bldFile="homescreenpluginsrv/hspstools/group"/>
- </component>
- <component id="homescreenpluginsrv_build" filter="s60" name="HS Plugin Service Build">
- <unit bldFile="homescreenpluginsrv/group"/>
- </component>
- </collection>
- <collection id="idlefw" name="Idle Framework" level="framework">
- <component id="idlefw_plugins" filter="s60" name="Idle Framework Plugins" class="plugin">
- <unit bldFile="idlefw/plugins/group"/>
- <!-- does the next need to be #included? -->
- <!-- <unit bldFile="idlefw/plugins/pslnactiveidleplugin/group"/> -->
- </component>
- <component id="idlefw_build" filter="s60" name="Idle Framework Build">
- <unit bldFile="idlefw/group"/>
- </component>
- </collection>
- <collection id="menucontentsrv" name="Menu Content Service" level="generic">
- <component id="menusatinterface" filter="s60" name="Menu SAT Interface">
- <unit bldFile="menucontentsrv/menusatinterface/group"/>
- </component>
- <component id="menucontentsrv_build" filter="s60" name="Menu Content Service Build">
- <unit bldFile="menucontentsrv/group"/>
- </component>
- </collection>
- <collection id="homescreensrv_info" name="Home Screen Services Info" level="specific">
- <component id="homescreensrv_plat" filter="s60" name="Home Screen Services Platform Interfaces" class="api">
- <unit bldFile="homescreensrv_plat/group"/>
- <!-- should the following be #included in the above? -->
- <!-- <unit bldFile="homescreensrv_plat/action_handler_plugin_api/tsrc/group"/> -->
- <!-- <unit bldFile="homescreensrv_plat/content_harvester_plugin_api/tsrc/group"/> -->
- <!-- <unit bldFile="homescreensrv_plat/hs_widget_publisher_api/tsrc/group"/> -->
- <!-- <unit bldFile="homescreensrv_plat/menu_content_service_api/tsrc/group"/> -->
- <!-- <unit bldFile="homescreensrv_plat/menu_sat_interface_api/tsrc/group"/> -->
- </component>
- </collection>
- </package>
-</SystemDefinition>