--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmDeviceManagement/bwinscw/XdmDeviceManagementAdapterU.DEF Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+ ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmDeviceManagement/data/10275112.rss Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* 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: ECOM / SmlDmAdapter / OMA XDM Device Management Adapter
+*
+*/
+
+
+
+
+#include <registryinfo.rh>
+#include "../inc/xdmdmuid.h"
+
+RESOURCE REGISTRY_INFO theRegistryInfo
+ {
+ dll_uid = KXdmDmDllUid; // The DLL's 3rd UID.
+ interfaces =
+ {
+ INTERFACE_INFO
+ {
+ interface_uid = KSmlDMInterfaceUid; // KSmlDMInterfaceUid, DM interface
+ implementations =
+ {
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = KXdmDmImplUid; // DM OMA XDM implementation UID
+ version_no = 1;
+ display_name = "";
+ default_data = "";
+ opaque_data = "";
+ }
+ };
+ }
+ };
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmDeviceManagement/eabi/XdmDeviceManagementAdapterU.DEF Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,5 @@
+EXPORTS
+ _Z24ImplementationGroupProxyRi @ 1 NONAME
+ _ZTI13CXdmDMAdapter @ 2 NONAME ; #<TI>#
+ _ZTV13CXdmDMAdapter @ 3 NONAME ; #<VT>#
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmDeviceManagement/group/bld.inf Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* 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: XDM Engine build file
+*
+*/
+
+
+
+PRJ_PLATFORMS
+//--------------------
+DEFAULT
+
+//--------------------
+PRJ_MMPFILES
+//--------------------
+
+xdmdevicemanagementadapter.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmDeviceManagement/group/xdmdevicemanagementadapter.mmp Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* 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: OMA XDM Device Management adapter
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+
+TARGET xdmdevicemanagementadapter.dll
+TARGETTYPE PLUGIN
+UID 0x10009D8D 0x10275112
+CAPABILITY CAP_ECOM_PLUGIN
+VENDORID VID_DEFAULT
+
+
+SOURCEPATH ../src
+SOURCE xdmdmadaptergroupproxy.cpp
+SOURCE xdmdmadapter.cpp
+
+SOURCEPATH ../data
+START RESOURCE 10275112.rss
+TARGET xdmdevicemanagementadapter.rsc
+END
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE /epoc32/include/ecom
+
+
+USERINCLUDE ../inc
+
+
+LIBRARY euser.lib
+LIBRARY ecom.lib
+LIBRARY xdmsettingsapi.lib
+LIBRARY charconv.lib
+LIBRARY nsmldmclientserverutils.lib
+
+DEBUGLIBRARY flogger.lib
+
+#if defined( ARMCC )
+ DEFFILE ../eabi/
+#elif defined ( WINSCW )
+ deffile ../bwinscw/
+#elif defined (WINS )
+ deffile ../BWINS/
+#endif
+
+// End of File
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmDeviceManagement/inc/xdmdmadapter.h Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,329 @@
+/*
+* 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: DM OMA XDM Settings Adapter
+ *
+*/
+
+
+
+
+
+#ifndef __XDMDMADAPTER_H__
+#define __XDMDMADAPTER_H__
+
+#include <e32base.h>
+#include <smldmadapter.h>
+#include <XdmSettingsApi.h>
+
+
+// LITERALS
+_LIT8( KXdmDmNodeName, "OMA_XDM" );
+_LIT8( KXdmDmAppId, "APPID" );
+_LIT8( KXdmDmName, "NAME" );
+_LIT8( KXdmDmProviderId, "PROVIDER-ID" );
+_LIT8( KXdmDmToConRef, "ToConRef" );
+_LIT8( KXdmDmConRef, "ConRef" );
+_LIT8( KXdmDmSip, "SIP" );
+_LIT8( KXdmDmToNapId, "TO-NAPID" );
+_LIT8( KXdmDmAP, "AP" );
+_LIT8( KXdmDmUri, "URI" );
+_LIT8( KXdmDmAAuthName, "AAUTHNAME" );
+_LIT8( KXdmDmAAuthSecret, "AAUTHSECRET" );
+_LIT8( KXdmDmAAuthType, "AAUTHTYPE" );
+
+_LIT8( KXdmDmNodeNameDescription, "The interior object holds all OMA XDM objects" );
+_LIT8( KXdmDmAppIdDescription, "The identity of the application service" );
+_LIT8( KXdmDmNameDescription, "Application name which is to be displayed in the user's equipment" );
+_LIT8( KXdmDmProviderIdDescription, "Provides an identifier for the service provider" );
+_LIT8( KXdmDmUriDescription, "Defines the root of all XDM resources" );
+_LIT8( KXdmDmAAuthNameDescription, "Defines the user name for XDMC authentication using HTTP digest" );
+_LIT8( KXdmDmAAuthSecretDescription, "Defines the password for XDMC authentication using HTTP digest" );
+_LIT8( KXdmDmAAuthTypeDescription, "Defines the authentication type for XDMC authentication" );
+_LIT8( KXdmDmDynamicDescription, "Placeholder for one or more connectivity parameters" );
+_LIT8( KXdmDmToConRefDescription, "Refers to a collection of connectivity definitions" );
+_LIT8( KXdmDmConRefDescription, "Indicates the linkage to connectivity parameters" );
+_LIT8( KXdmDmSipDescription, "Reference to SIP DM Object" );
+_LIT8( KXdmDmToNapIdDescription, "Reference to the connection used for the XCAP traffic" );
+
+_LIT8( KXdmDDFVersion, "1.0" );
+_LIT8( KXdmDmTextPlain, "text/plain" );
+_LIT8( KXdmDmUriDotSlash, "./" );
+_LIT8( KXdmDmSeparator, "/" );
+_LIT8( KXdmDmSipLinkPrefix, "./SIP" );
+_LIT( KXdmDefaultId, "-1" );
+_LIT( KXdmDmStartBracket, "(" );
+_LIT( KXdmDmCloseBracket, ")" );
+
+_LIT( KXdmDmLogDir, "Xdm" );
+_LIT( KXdmDmLogFile, "XdmDm.txt" );
+
+// CONSTANTS
+const TInt KXdmDmLogBufferMaxSize = 2000;
+const TInt KXdmDefaultResultSize = 255;
+const TInt KXdmDmLevel = 2;
+const TInt KXdmDmIdTableSize = 16;
+const TInt KXdmDmHexLength = 8;
+const TInt KXdmDmMaxIntLength = 10; // max length of 32bit integer
+const TUint8 KXdmDmObjectSizeWidth = 4;
+const TUint8 KXdmDmSeparatorDef = 0x2f; // forward slash
+
+
+/**
+* The main class of the OMA XDM DM adapter. Handles
+* requests of fetching and updating settings sets and
+* settings items.
+*/
+class CXdmDMAdapter : public CSmlDmAdapter
+ {
+ public:
+ // Adapter interface from CSmlDmAdapter
+ static CXdmDMAdapter* NewL( MSmlDmCallback* aDmCallback );
+
+ ~CXdmDMAdapter();
+
+ void DDFVersionL( CBufBase& aDDFVersion );
+
+ void DDFStructureL( MSmlDmDDFObject& aDDF );
+
+ void UpdateLeafObjectL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ const TDesC8& aObject,
+ const TDesC8& aType,
+ TInt aStatusRef );
+
+ void DeleteObjectL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ const TInt aStatusRef );
+
+ void FetchLeafObjectL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ const TDesC8& aType,
+ const TInt aResultsRef,
+ const TInt aStatusRef );
+
+ void ChildURIListL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList,
+ const TInt aResultsRef,
+ const TInt aStatusRef );
+
+ void AddNodeObjectL( const TDesC8& aUri,
+ const TDesC8& aParentLUID,
+ const TInt aStatusRef );
+
+ void UpdateLeafObjectL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ RWriteStream*& aStream,
+ const TDesC8& aType,
+ const TInt aStatusRef );
+
+ void FetchLeafObjectSizeL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ const TDesC8& aType,
+ const TInt aResultsRef,
+ const TInt aStatusRef );
+
+ void ExecuteCommandL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ const TDesC8& aArgument,
+ const TDesC8& aType,
+ const TInt aStatusRef );
+
+ void ExecuteCommandL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ RWriteStream*& aStream,
+ const TDesC8& aType,
+ const TInt aStatusRef );
+
+ void CopyCommandL( const TDesC8& aTargetURI,
+ const TDesC8& aTargetLUID,
+ const TDesC8& aSourceURI,
+ const TDesC8& aSourceLUID,
+ const TDesC8& aType,
+ TInt aStatusRef );
+
+ void StartAtomicL();
+ void CommitAtomicL();
+ void RollbackAtomicL();
+ TBool StreamingSupport( TInt& aItemSize);
+ void StreamCommittedL();
+ void CompleteOutstandingCmdsL();
+
+ /**
+ * Log writing
+ * DEBUG only
+ */
+ #ifdef _DEBUG
+ static void WriteToLog( TRefByValue<const TDesC8> aFmt,... );
+ #endif
+
+
+ private:
+
+ /**
+ * Default constructor
+ * @param aDmCallback Pointer to callback interface
+ */
+ CXdmDMAdapter( MSmlDmCallback* aDmCallback );
+
+
+ /**
+ * Fetches an object from the given uri
+ * @param aUri Uri to the fetched object
+ * @param aObject The result is inserted to this buffer
+ * @return Error code
+ */
+ CSmlDmAdapter::TError FetchObjectL( const TDesC8& aUri,
+ CBufBase& aObject,
+ TInt aSettingsId );
+
+ /**
+ * Updates the parameters of given DDF node
+ * @param aNode The node to update.
+ * @param aAccTypes Access types of the node.
+ * @param aOccurrence Occurrance of the node.
+ * @param aScope Scope of the node.
+ * @param aFormat Format of the node.
+ * @param aDescription A description of the node.
+ */
+ void FillNodeInfoL( MSmlDmDDFObject& aNode,
+ TSmlDmAccessTypes aAccTypes,
+ MSmlDmDDFObject::TOccurence aOccurrence,
+ MSmlDmDDFObject::TScope aScope,
+ MSmlDmDDFObject::TDFFormat aFormat,
+ const TDesC8& aDescription);
+
+ /**
+ * Get property from settings storage
+ * @param aSettingsId unique id of the settings set
+ * @param aProperty type of asked property
+ * @param aObject returns property value
+ * @return CSmlDmAdapter::EOk if successfull
+ */
+ CSmlDmAdapter::TError GetPropertyL( TInt aSettingsId,
+ TXdmSettingsProperty aProperty,
+ CBufBase& aObject );
+
+ /**
+ * Create/update settings property
+ * @param aSettingsId unique id of the settings set
+ * @param aProperty type of property
+ * @param aObject property value
+ * @return CSmlDmAdapter::EOk if successfull
+ */
+ CSmlDmAdapter::TError UpdatePropertyL( TInt aSettingsId,
+ TXdmSettingsProperty aProperty,
+ const TDesC8& aObject );
+ /**
+ * Find IAP id based on uri
+ * @param aUri uri of the wanted object
+ * @return id or KErrNotFound
+ */
+ TInt IapIdFromURIL( const TDesC8& aUri );
+
+ /**
+ * Find uri based on IAP id
+ * @param aId value stored to xdm settings
+ * @return uri or NULL
+ */
+ HBufC8* URIFromIapIdL( TInt aId );
+
+ /**
+ * Find SIP id based on uri
+ * @param aUri uri of the wanted object
+ * @return id or KErrNotFound
+ */
+ TInt GetSipIdL( const TDesC8& aUri );
+
+ /**
+ * Finds uri based on SIP id, updates result
+ * @param aSettingsId xdm settings id
+ * @param aObject object to be updated
+ * @return Ok or Error
+ */
+ CXdmDMAdapter::TError FetchSipConRefL( TInt aSettingsId,
+ CBufBase& aObject );
+
+ /**
+ * Find settings id
+ * @param aLUID luid of the wanted object
+ * @param aUri uri of the wanted object
+ * @return id or KErrNotFound
+ */
+ TInt FindSettingsIdL( const TDesC8& aLUID, const TDesC8& aUri );
+
+ /**
+ * Checks if the settings name is already in use,
+ * creates a unique name if needed
+ * @param aName name of the settings
+ * @return unique name
+ */
+ HBufC* CheckExistingNamesLC( const TDesC8& aName );
+
+
+ /**
+ * Compares strings
+ * @param aLeft first string
+ * @param aRight second string
+ * @return True if the strings are identical
+ */
+ TBool Match( const TDesC8& aLeft, const TDesC8& aRight );
+
+
+ /**
+ * Converts descriptor to int
+ * @param aSource descriptor to be converted
+ * @return TInt converted value
+ */
+ TInt DesToInt( const TDesC& aSource ) const;
+
+ /**
+ * Converts descriptor to int
+ * @param aSource descriptor to be converted
+ * @return TInt converted value
+ */
+ TInt DesToInt( const TDesC8& aSource ) const;
+
+ /**
+ * Converts int to descriptor
+ * @param aSource int to be converted
+ * @return HBufC8* converted value
+ */
+ HBufC8* IntToDes8LC( const TInt aSource );
+
+ /**
+ * Converts 16-bit descriptor to 8-bit
+ * @param aSource descriptor to be converted
+ * @return HBufC8* converted value
+ */
+ HBufC8* ConvertLC( const TDesC& aSource );
+
+ /**
+ * Converts 8-bit descriptor to 16-bit
+ * @param aSource descriptor to be converted
+ * @return HBufC* converted value
+ */
+ HBufC* ConvertLC( const TDesC8& aSource );
+
+
+
+ private: // Data
+
+
+
+ };
+
+#endif // __XDMDMADAPTER_H__
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmDeviceManagement/inc/xdmdmuid.h Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* 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: Uids for XDM DM
+*
+*/
+
+
+
+
+#ifndef __XDMDMUID__
+#define __XDMDMUID__
+
+// Device Management ECOM plugin interface
+#define KSmlDMInterfaceUid 0x102018B4
+
+// XDM Device management DLL uid
+#define KXdmDmDllUid 0x10275112
+
+// XDM DM implementation UID
+#define KXdmDmImplUid 0x10275113
+
+
+
+#endif // __XDMDMUID__
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmDeviceManagement/src/xdmdmadapter.cpp Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,1244 @@
+/*
+* 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: DM OMA XDM Settings Adapter
+ *
+*/
+
+
+
+
+#include <implementationproxy.h>
+#include <utf.h>
+#include <nsmldmuri.h>
+#include <XdmSettingsApi.h>
+#include <XdmSettingsCollection.h>
+#include <XdmSettingsProperty.h>
+#include "xdmdmadapter.h"
+
+#ifdef _DEBUG
+ #include <flogger.h>
+#endif
+
+
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::NewL( )
+// -----------------------------------------------------------------------------
+//
+CXdmDMAdapter* CXdmDMAdapter::NewL( MSmlDmCallback* aDmCallback )
+ {
+ CXdmDMAdapter* self = new (ELeave) CXdmDMAdapter( aDmCallback );
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::NewL(): end") );
+#endif
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::CXdmDMAdapter()
+// -----------------------------------------------------------------------------
+//
+CXdmDMAdapter::CXdmDMAdapter( MSmlDmCallback* aDmCallback ) :
+CSmlDmAdapter( aDmCallback )
+ {
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::CXdmDMAdapter()") );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::~CXdmDMAdapter()
+// -----------------------------------------------------------------------------
+//
+CXdmDMAdapter::~CXdmDMAdapter()
+ {
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::~CXdmDMAdapter()") );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::DDFVersionL
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::DDFVersionL( CBufBase& aDDFVersion )
+ {
+ aDDFVersion.InsertL( 0, KXdmDDFVersion );
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::DDFVersionL(TDes& aDDFVersion)") );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::DDFStructureL
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::DDFStructureL( MSmlDmDDFObject& aDDF )
+ {
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::DDFStructureL(): begin") );
+#endif
+
+ // For OMA_XDM
+ TSmlDmAccessTypes accTypeGet;
+ accTypeGet.SetGet();
+
+ // For OMA_XDM/<X>
+ TSmlDmAccessTypes accTypeAll;
+ accTypeAll.SetAdd();
+ accTypeAll.SetGet();
+ accTypeAll.SetReplace();
+ accTypeAll.SetDelete();
+
+ // For leaf nodes
+ TSmlDmAccessTypes accTypeNoDelete;
+ accTypeNoDelete.SetAdd();
+ accTypeNoDelete.SetGet();
+ accTypeNoDelete.SetReplace();
+
+ // ./OMA_XDM
+ MSmlDmDDFObject& omaXdmNode = aDDF.AddChildObjectL( KXdmDmNodeName );
+ FillNodeInfoL( omaXdmNode, accTypeGet, MSmlDmDDFObject::EOne,
+ MSmlDmDDFObject::EPermanent, MSmlDmDDFObject::ENode,
+ KXdmDmNodeNameDescription );
+
+ // ./OMA_XDM/<X>
+ MSmlDmDDFObject& rtNode = omaXdmNode.AddChildObjectGroupL();
+ FillNodeInfoL( rtNode, accTypeAll, MSmlDmDDFObject::EOneOrMore,
+ MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::ENode,
+ KXdmDmDynamicDescription );
+
+ // ./OMA_XDM/<X>/APPID
+ MSmlDmDDFObject& appIdNode = rtNode.AddChildObjectL( KXdmDmAppId );
+ FillNodeInfoL( appIdNode, accTypeNoDelete, MSmlDmDDFObject::EZeroOrOne,
+ MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr,
+ KXdmDmAppIdDescription );
+
+ // ./OMA_XDM/<X>/NAME
+ MSmlDmDDFObject& nameNode = rtNode.AddChildObjectL( KXdmDmName );
+ FillNodeInfoL( nameNode, accTypeNoDelete, MSmlDmDDFObject::EZeroOrOne,
+ MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr,
+ KXdmDmNameDescription );
+
+ // ./OMA_XDM/<X>/PROVIDER-ID
+ MSmlDmDDFObject& provIdNode = rtNode.AddChildObjectL( KXdmDmProviderId );
+ FillNodeInfoL( provIdNode, accTypeNoDelete,MSmlDmDDFObject::EZeroOrOne,
+ MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr,
+ KXdmDmProviderIdDescription );
+
+ // ./OMA_XDM/<X>/ToConRef
+ MSmlDmDDFObject& toConRefNode = rtNode.AddChildObjectL( KXdmDmToConRef );
+ FillNodeInfoL( toConRefNode, accTypeNoDelete, MSmlDmDDFObject::EZeroOrOne,
+ MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::ENode,
+ KXdmDmToConRefDescription);
+
+ // ./OMA_XDM/<X>/ToConRef/<X> (TO-NAPID)
+ MSmlDmDDFObject& napIdNode = toConRefNode.AddChildObjectL( KXdmDmToNapId );
+ FillNodeInfoL( napIdNode, accTypeNoDelete, MSmlDmDDFObject::EZeroOrOne,
+ MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::ENode,
+ KXdmDmToNapIdDescription );
+
+ // ./OMA_XDM/<X>/ToConRef/TO-NAPID/ConRef
+ MSmlDmDDFObject& napIdRefNode = napIdNode.AddChildObjectL( KXdmDmConRef );
+ FillNodeInfoL( napIdRefNode, accTypeNoDelete, MSmlDmDDFObject::EZeroOrOne,
+ MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr,
+ KXdmDmConRefDescription );
+
+ // ./OMA_XDM/<X>/ToConRef/<X> (SIP)
+ MSmlDmDDFObject& sipNode = toConRefNode.AddChildObjectL( KXdmDmSip );
+ FillNodeInfoL( sipNode, accTypeNoDelete, MSmlDmDDFObject::EZeroOrOne,
+ MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::ENode,
+ KXdmDmSipDescription );
+
+ // ./OMA_XDM/<X>/ToConRef/SIP/ConRef
+ MSmlDmDDFObject& sipRefNode = sipNode.AddChildObjectL( KXdmDmConRef );
+ FillNodeInfoL( sipRefNode, accTypeNoDelete, MSmlDmDDFObject::EZeroOrOne,
+ MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr,
+ KXdmDmConRefDescription );
+
+ // ./OMA_XDM/<X>/URI
+ MSmlDmDDFObject& uriNode = rtNode.AddChildObjectL( KXdmDmUri );
+ FillNodeInfoL( uriNode, accTypeNoDelete, MSmlDmDDFObject::EOne,
+ MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr,
+ KXdmDmUriDescription );
+
+ // ./OMA_XDM/<X>/AAUTHNAME
+ MSmlDmDDFObject& userIdNode = rtNode.AddChildObjectL( KXdmDmAAuthName );
+ FillNodeInfoL( userIdNode, accTypeNoDelete, MSmlDmDDFObject::EZeroOrOne,
+ MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr,
+ KXdmDmAAuthNameDescription );
+
+ // ./OMA_XDM/<X>/AAUTHSECRET
+ MSmlDmDDFObject& pwdNode = rtNode.AddChildObjectL( KXdmDmAAuthSecret );
+ FillNodeInfoL( pwdNode, accTypeNoDelete, MSmlDmDDFObject::EZeroOrOne,
+ MSmlDmDDFObject::EDynamic,MSmlDmDDFObject::EChr,
+ KXdmDmAAuthSecretDescription );
+
+ // ./OMA_XDM/<X>/AAUTHTYPE
+ MSmlDmDDFObject& authTypeNode = rtNode.AddChildObjectL( KXdmDmAAuthType );
+ FillNodeInfoL( authTypeNode, accTypeNoDelete, MSmlDmDDFObject::EZeroOrOne,
+ MSmlDmDDFObject::EDynamic,MSmlDmDDFObject::EChr,
+ KXdmDmAAuthTypeDescription );
+
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::DDFStructureL(): end") );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::ChildURIListL
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::ChildURIListL( const TDesC8& aUri,
+ const TDesC8& /*aLUID*/,
+ const CArrayFix<TSmlDmMappingInfo>&
+ /*aPreviousURISegmentList*/,
+ const TInt aResultsRef,
+ const TInt aStatusRef )
+ {
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::ChildURIListL(): begin") );
+#endif
+
+ CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk;
+
+ CBufBase* currentList = CBufFlat::NewL( 1 );
+ CleanupStack::PushL( currentList ); // << currentList
+
+ const TPtrC8 lastUriSeg = NSmlDmURI::LastURISeg( aUri );
+ TBuf8<KSmlMaxURISegLen> segmentName;
+
+ // ./OMA_XDM
+ if( Match( lastUriSeg, KXdmDmNodeName ) )
+ {
+ RArray<TInt> settingIds;
+ CleanupClosePushL( settingIds ); // << settingIds
+ CDesCArray* names = TXdmSettingsApi::CollectionNamesLC( settingIds ); // << names
+ TInt idCount = settingIds.Count();
+ for( TInt i(0); i < idCount; i++ )
+ {
+ segmentName.Copy( KNullDesC8 );
+ segmentName.AppendNum( settingIds[i] );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+ }
+ Callback().SetResultsL( aResultsRef, *currentList, KNullDesC8 );
+ Callback().SetStatusL( aStatusRef, retValue );
+ CleanupStack::PopAndDestroy( 3, currentList ); // >>> settingIds, names, currentList
+ return;
+ }
+
+ // ./OMA_XDM/X
+ if( NSmlDmURI::NumOfURISegs( aUri ) == KXdmDmLevel )
+ {
+ segmentName.Copy( KXdmDmAppId );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+
+ segmentName.Copy( KXdmDmName );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+
+ segmentName.Copy( KXdmDmProviderId );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+
+ segmentName.Copy( KXdmDmToConRef );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+
+ segmentName.Copy( KXdmDmUri );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+
+ segmentName.Copy( KXdmDmAAuthName );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+
+ segmentName.Copy( KXdmDmAAuthSecret );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+
+ segmentName.Copy( KXdmDmAAuthType );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+ }
+
+ // ./OMA_XDM/X/ToConRef
+ else if ( Match( lastUriSeg, KXdmDmToConRef ) )
+ {
+ segmentName.Copy( KXdmDmSip );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+
+ segmentName.Copy( KXdmDmToNapId );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+ }
+
+ // ./OMA_XDM/X/ToConRef/SIP
+ else if( Match( lastUriSeg, KXdmDmSip ) )
+ {
+ segmentName.Copy( KXdmDmConRef );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+ }
+
+ // ./OMA_XDM/X/ToConRef/TO-NAPID
+ else if( Match ( lastUriSeg, KXdmDmToNapId ) )
+ {
+ segmentName.Copy( KXdmDmConRef );
+ currentList->InsertL( currentList->Size(), segmentName );
+ currentList->InsertL( currentList->Size(), KXdmDmSeparator );
+ }
+ else
+ {
+ // if none of asked nodes found return error.
+ retValue = CSmlDmAdapter::ENotFound;
+ }
+
+ Callback().SetResultsL( aResultsRef, *currentList, KNullDesC8 );
+ Callback().SetStatusL( aStatusRef, retValue );
+ CleanupStack::PopAndDestroy( currentList ); // >>> currentList
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::ChildURIListL(): end") );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::FetchLeafObjectL
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::FetchLeafObjectL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ const TDesC8& aType,
+ const TInt aResultsRef,
+ const TInt aStatusRef )
+ {
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::FetchLeafObjectL(): begin") );
+#endif
+
+ TInt settingsId = FindSettingsIdL( aLUID, aUri );
+
+ CBufBase* result = CBufFlat::NewL( KXdmDefaultResultSize );
+ CleanupStack::PushL( result ); // << result
+ CSmlDmAdapter::TError status = FetchObjectL( aUri, *result, settingsId );
+ if( status == CSmlDmAdapter::EOk )
+ {
+ Callback().SetResultsL( aResultsRef, *result, aType );
+ }
+ Callback().SetStatusL( aStatusRef, status );
+ CleanupStack::PopAndDestroy( result ); // >>> result
+
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::FetchLeafObjectL(): end") );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CSmlDmAdapter::TError FetchObjectL
+// -----------------------------------------------------------------------------
+//
+CSmlDmAdapter::TError CXdmDMAdapter::FetchObjectL( const TDesC8& aUri,
+ CBufBase& aObject,
+ TInt aSettingsId )
+ {
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::FetchObjectL(): begin") );
+#endif
+ CSmlDmAdapter::TError status = CSmlDmAdapter::EOk;
+
+ TXdmSettingsProperty property ( EXdmPropNotFound );
+ TPtrC8 lastUriSeg = NSmlDmURI::LastURISeg( aUri );
+ // APPID
+ if( Match( lastUriSeg, KXdmDmAppId ) )
+ {
+ property = EXdmPropAppId;
+ }
+ // NAME
+ else if( Match( lastUriSeg, KXdmDmName ) )
+ {
+ property = EXdmPropName;
+ }
+ // PROVIDER-ID
+ else if( Match( lastUriSeg, KXdmDmProviderId ) )
+ {
+ property = EXdmPropProvId;
+ }
+ // URI
+ else if( Match( lastUriSeg, KXdmDmUri) )
+ {
+ property = EXdmPropUri;
+ }
+ // AAUTHNAME
+ else if( Match( lastUriSeg, KXdmDmAAuthName) )
+ {
+ property = EXdmPropAuthName;
+ }
+ // AAUTHSECRET
+ else if( Match( lastUriSeg, KXdmDmAAuthSecret) )
+ {
+ property = EXdmPropAuthSecret;
+ }
+ // AAUTHTYPE
+ else if( Match( lastUriSeg, KXdmDmAAuthType ) )
+ {
+ property = EXdmPropAuthType;
+ }
+ // ToConRef/SIP/ConRef
+ // ToConRef/TO-NAPID/ConRef
+ else if( Match( lastUriSeg, KXdmDmConRef) )
+ {
+ TPtrC8 conRefUri = NSmlDmURI::RemoveLastSeg( aUri );
+ TPtrC8 lastConRefSeg = NSmlDmURI::LastURISeg( conRefUri );
+
+ if( Match( lastConRefSeg, KXdmDmSip ) )
+ {
+ return FetchSipConRefL( aSettingsId, aObject );
+ }
+ else if( Match( lastConRefSeg, KXdmDmToNapId ) )
+ {
+ HBufC* value = NULL;
+ TInt error( KErrNone );
+ TRAP( error, ( value = TXdmSettingsApi::PropertyL( aSettingsId, EXdmPropToNapId ) ) );
+ if ( error == KErrNone )
+ {
+ CleanupStack::PushL( value ); // << value
+ TInt iapId = DesToInt( *value );
+ CleanupStack::PopAndDestroy( value ); // >>> value
+ HBufC8* uri = URIFromIapIdL( iapId );
+ if( uri )
+ {
+ CleanupStack::PushL( uri ); // << uri
+ aObject.InsertL( 0, uri->Des() );
+ status = CSmlDmAdapter::EOk;
+ CleanupStack::PopAndDestroy( uri ); // uri
+ }
+ else
+ {
+ status = CSmlDmAdapter::ENotFound;
+ }
+ return status;
+ }
+ }
+ }
+ else
+ {
+ status = CSmlDmAdapter::ENotFound;
+ }
+ // known property
+ if ( status == CSmlDmAdapter::EOk )
+ {
+ status = GetPropertyL( aSettingsId, property, aObject );
+ }
+
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::FetchObjectL(): end") );
+#endif
+ return status;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::FetchLeafObjectSizeL
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::FetchLeafObjectSizeL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ const TDesC8& aType,
+ const TInt aResultsRef,
+ const TInt aStatusRef )
+ {
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::FetchLeafObjectSizeL(): begin") );
+#endif
+
+ TInt settingsId = FindSettingsIdL( aLUID, aUri );
+
+ CBufBase* result = CBufFlat::NewL( KXdmDefaultResultSize );
+ CleanupStack::PushL( result );
+ CSmlDmAdapter::TError status = FetchObjectL( aUri, *result, settingsId );
+
+ if( status == CSmlDmAdapter::EOk )
+ {
+ TInt objSizeInBytes = result->Size();
+
+ TBuf8<KXdmDmObjectSizeWidth> stringObjSizeInBytes;
+ stringObjSizeInBytes.Num( objSizeInBytes );
+
+ result->Reset();
+ result->InsertL( 0, stringObjSizeInBytes );
+
+ Callback().SetResultsL( aResultsRef, *result, aType );
+ }
+
+ Callback().SetStatusL( aStatusRef, status );
+ CleanupStack::PopAndDestroy( result ); // >>> result
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::FetchLeafObjectSizeL(): end") );
+ #endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::UpdateLeafObjectL()
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::UpdateLeafObjectL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ const TDesC8& aObject,
+ const TDesC8& /*aType*/,
+ const TInt aStatusRef )
+ {
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::UpdateLeafObjectL(): begin") );
+#endif
+ CSmlDmAdapter::TError status = CSmlDmAdapter::EOk;
+
+ TInt settingsId = FindSettingsIdL( aLUID, aUri );
+
+ TXdmSettingsProperty property;
+ TPtrC8 lastUriSeg = NSmlDmURI::LastURISeg( aUri );
+ // APPID
+ if( Match( lastUriSeg, KXdmDmAppId ) )
+ {
+ property = EXdmPropAppId;
+ }
+ // NAME
+ else if( Match( lastUriSeg, KXdmDmName ) )
+ {
+ // first check if the new value is same as earlier
+ HBufC* current = NULL;
+ TInt error( KErrNone );
+ TRAP( error, ( current = TXdmSettingsApi::PropertyL( settingsId, EXdmPropName ) ) );
+ if ( error == KErrNone )
+ {
+ TBool same ( EFalse );
+ CleanupStack::PushL( current ); // << current
+ HBufC8* current8 = ConvertLC( *current ); // << current8
+ if ( Match( current8->Des(), aObject ) )
+ {
+ same = ETrue;
+ }
+ CleanupStack::PopAndDestroy( 2, current8 ); // >>> current, current8
+ if ( same )
+ {
+ Callback().SetStatusL( aStatusRef, status );
+ return;
+ }
+ }
+ // if the name is already in use, new name with index is created
+ HBufC* value = CheckExistingNamesLC( aObject ); // << value
+ TRAP( error, TXdmSettingsApi::UpdatePropertyL( settingsId, *value, EXdmPropName ) );
+ CleanupStack::PopAndDestroy( value ); // >>> value
+ if ( error != KErrNone )
+ {
+ status = CSmlDmAdapter::ENotFound;
+ }
+ Callback().SetStatusL( aStatusRef, status );
+ return;
+ }
+ // PROVIDER-ID
+ else if( Match( lastUriSeg, KXdmDmProviderId ) )
+ {
+ property = EXdmPropProvId;
+ }
+ // URI
+ else if( Match( lastUriSeg, KXdmDmUri) )
+ {
+ property = EXdmPropUri;
+ }
+ // AAUTHNAME
+ else if( Match( lastUriSeg, KXdmDmAAuthName) )
+ {
+ property = EXdmPropAuthName;
+ }
+ // AAUTHSECRET
+ else if( Match( lastUriSeg, KXdmDmAAuthSecret) )
+ {
+ property = EXdmPropAuthSecret;
+ }
+ // AAUTHTYPE
+ else if( Match( lastUriSeg, KXdmDmAAuthType ) )
+ {
+ property = EXdmPropAuthType;
+ }
+ // ToConRef/TO-NAPID/ConRef
+ // ToConRef/SIP/ConRef
+ else if( Match( lastUriSeg, KXdmDmConRef ) )
+ {
+ TPtrC8 conRefUri = NSmlDmURI::RemoveLastSeg( aUri );
+ TPtrC8 lastConRefSeg = NSmlDmURI::LastURISeg( conRefUri );
+ if( Match( lastConRefSeg, KXdmDmToNapId ) )
+ {
+ TInt iapId = IapIdFromURIL( aObject );
+ HBufC8* idBuf = IntToDes8LC( iapId ); // << idBuf
+ status = UpdatePropertyL( settingsId, EXdmPropToNapId, *idBuf );
+ CleanupStack::PopAndDestroy( idBuf ); // >>> idBuf
+ Callback().SetStatusL( aStatusRef, status );
+ #ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::UpdateLeafObjectL(): TO_NAPID/ConRef end") );
+ #endif
+ return;
+ }
+ else if( Match( lastConRefSeg, KXdmDmSip ) )
+ {
+ TInt sipId = GetSipIdL( aObject );
+ HBufC8* idBuf = IntToDes8LC( sipId ); // << idBuf
+ status = UpdatePropertyL( settingsId, EXdmPropToAppRef, *idBuf );
+ CleanupStack::PopAndDestroy( idBuf ); // >>> idBuf
+ Callback().SetStatusL( aStatusRef, status );
+ #ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::UpdateLeafObjectL(): SIP/ConRef end") );
+ #endif
+ return;
+ }
+ else
+ {
+ status = CSmlDmAdapter::ENotFound;
+ }
+ }
+ else
+ {
+ status = CSmlDmAdapter::ENotFound;
+ }
+ // known property
+ if ( status == CSmlDmAdapter::EOk )
+ {
+ status = UpdatePropertyL( settingsId, property, aObject );
+ }
+
+ Callback().SetStatusL( aStatusRef, status );
+
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::UpdateLeafObjectL(): end") );
+ #endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::AddNodeObjectL
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::AddNodeObjectL( const TDesC8& aUri,
+ const TDesC8& /*aParentLUID*/,
+ const TInt aStatusRef )
+ {
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::AddNodeObjectL(): begin") );
+#endif
+
+ CSmlDmAdapter::TError status = CSmlDmAdapter::EError;
+ if ( Match( NSmlDmURI::RemoveLastSeg( aUri ), KXdmDmNodeName ) )
+ {
+ // create new set
+ CXdmSettingsCollection* collection = new ( ELeave ) CXdmSettingsCollection;
+ CleanupStack::PushL( collection ); // << collection
+ collection->AppendL( KXdmDefaultId, EXdmPropSettingsId );
+ TInt id = TXdmSettingsApi::CreateCollectionL( *collection );
+ HBufC8* luid = IntToDes8LC( id ); // << luid
+ Callback().SetMappingL( aUri, *luid );
+ CleanupStack::PopAndDestroy( 2, luid ); // >>> collection, luid
+ status = CSmlDmAdapter::EOk;
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::AddNodeObjectL(): Settings created id=%d"), id );
+#endif
+ }
+ Callback().SetStatusL( aStatusRef, status );
+
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::AddNodeObjectL(): end") );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::DeleteObjectL
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::DeleteObjectL( const TDesC8& aUri,
+ const TDesC8& aLUID,
+ const TInt aStatusRef )
+ {
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::DeleteObjectL( ): begin") );
+#endif
+
+ CSmlDmAdapter::TError status = CSmlDmAdapter::EError;
+ if ( Match( NSmlDmURI::RemoveLastSeg( aUri ), KXdmDmNodeName ) )
+ {
+ TInt id = FindSettingsIdL( aLUID, aUri );
+ TInt error (KErrNone );
+ TRAP( error, TXdmSettingsApi::RemoveCollectionL( id ) );
+ if ( error == KErrNone )
+ {
+ status = CSmlDmAdapter::EOk;
+ }
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::DeleteObjectL(): Settings deleted id=%d"), id );
+#endif
+ }
+ Callback().SetStatusL( aStatusRef, status );
+
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::DeleteObjectL( ): end") );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::UpdateLeafObjectL
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::UpdateLeafObjectL( const TDesC8& /*aUri*/,
+ const TDesC8& /*aLUID*/,
+ RWriteStream*& /*aStream*/,
+ const TDesC8& /*aType*/,
+ const TInt aStatusRef )
+ {
+ // Update from stream not used
+ Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError );
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::ExecuteCommandL()
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::ExecuteCommandL( const TDesC8& /*aUri*/,
+ const TDesC8& /*aLUID*/,
+ const TDesC8& /*aArgument*/,
+ const TDesC8& /*aType*/,
+ const TInt aStatusRef )
+ {
+ // Not supported
+ Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError );
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::ExecuteCommandL()
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::ExecuteCommandL( const TDesC8& /*aUri*/,
+ const TDesC8& /*aLUID*/,
+ RWriteStream*& /*aStream*/,
+ const TDesC8& /*aType*/,
+ const TInt aStatusRef )
+ {
+ // Not supported
+ Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError );
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::CopyCommandL()
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::CopyCommandL( const TDesC8& /*aTargetURI*/,
+ const TDesC8& /*aTargetLUID*/,
+ const TDesC8& /*aSourceURI*/,
+ const TDesC8& /*aSourceLUID*/,
+ const TDesC8& /*aType*/,
+ TInt aStatusRef )
+ {
+ // Not supported
+ Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError );
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::StartAtomicL()
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::StartAtomicL()
+ {
+ // Not supported
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::CommitAtomicL()
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::CommitAtomicL()
+ {
+ // Not supported
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::RollbackAtomicL()
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::RollbackAtomicL()
+ {
+ // Not supported
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::StreamingSupport()
+// -----------------------------------------------------------------------------
+//
+TBool CXdmDMAdapter::StreamingSupport( TInt& /*aItemSize*/ )
+ {
+ return EFalse;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::StreamCommittedL()
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::StreamCommittedL()
+ {
+ // Not supported
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::CompleteOutstandingCmdsL()
+// -----------------------------------------------------------------------------
+//
+void CXdmDMAdapter::CompleteOutstandingCmdsL()
+ {
+#ifdef _DEBUG
+ WriteToLog(_L8("CXdmDMAdapter::CompleteOutstandingCmdsL()") );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::GetPropertyL
+// -----------------------------------------------------------------------------
+//
+CSmlDmAdapter::TError CXdmDMAdapter::GetPropertyL( TInt aSettingsId,
+ TXdmSettingsProperty aProperty,
+ CBufBase& aObject )
+ {
+ HBufC* value = NULL;
+ TInt error( KErrNone );
+ TRAP( error, ( value = TXdmSettingsApi::PropertyL( aSettingsId, aProperty ) ) );
+ if ( error == KErrNone )
+ {
+ CleanupStack::PushL( value ); // << value
+ HBufC8* utfValue = ConvertLC( *value ); // << utfValue
+ aObject.InsertL( 0, *utfValue );
+ CleanupStack::PopAndDestroy( 2, utfValue ); // >>> value, utfValue
+ return CSmlDmAdapter::EOk;
+ }
+ return CSmlDmAdapter::ENotFound;
+ }
+
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::UpdatePropertyL
+// -----------------------------------------------------------------------------
+//
+CSmlDmAdapter::TError CXdmDMAdapter::UpdatePropertyL( TInt aSettingsId,
+ TXdmSettingsProperty aProperty,
+ const TDesC8& aObject )
+ {
+ HBufC* value = ConvertLC( aObject ); // << value
+ TInt error( KErrNone );
+ TRAP( error, TXdmSettingsApi::UpdatePropertyL( aSettingsId, *value, aProperty ) );
+ CleanupStack::PopAndDestroy( value ); // >>> value
+
+ if ( error == KErrNone )
+ {
+ return CSmlDmAdapter::EOk;
+ }
+ return CSmlDmAdapter::ENotFound;
+ }
+
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::FillNodeInfoL
+// ------------------------------------------------------------------------------
+//
+void CXdmDMAdapter::FillNodeInfoL( MSmlDmDDFObject& aNode,
+ TSmlDmAccessTypes aAccTypes,
+ MSmlDmDDFObject::TOccurence aOccurrence,
+ MSmlDmDDFObject::TScope aScope,
+ MSmlDmDDFObject::TDFFormat aFormat,
+ const TDesC8& aDescription)
+ {
+ aNode.SetAccessTypesL( aAccTypes );
+ aNode.SetOccurenceL( aOccurrence );
+ aNode.SetScopeL( aScope );
+ aNode.SetDFFormatL( aFormat );
+
+ if( aFormat != MSmlDmDDFObject::ENode )
+ {
+ aNode.AddDFTypeMimeTypeL( KXdmDmTextPlain );
+ }
+ aNode.SetDescriptionL( aDescription );
+ }
+
+
+// ----------------------------------------------------------------------------
+// CXdmDMAdapter::IapIdFromURIL
+// ----------------------------------------------------------------------------
+//
+TInt CXdmDMAdapter::IapIdFromURIL( const TDesC8& aUri )
+ {
+ TInt id( KErrNotFound );
+ MSmlDmAdapter::TError status( MSmlDmAdapter::EError );
+ CBufBase* result = CBufFlat::NewL(1);
+ CleanupStack::PushL( result ); // << result
+
+ TPtrC8 uri = NSmlDmURI::RemoveDotSlash( aUri );
+ // Request the identifier
+ Callback().FetchLinkL( uri, *result, status );
+
+ if( status == MSmlDmAdapter::EOk )
+ {
+ HBufC8* luid = Callback().GetLuidAllocL( uri );
+ if ( luid && luid->Length() )
+ {
+ id = DesToInt( *luid );
+ }
+ delete luid;
+ luid = NULL;
+ }
+
+ CleanupStack::PopAndDestroy( result ); // >>> result
+ return id;
+ }
+
+// ----------------------------------------------------------------------------
+// CXdmDMAdapter::URIFromIapIdL
+// ----------------------------------------------------------------------------
+//
+HBufC8* CXdmDMAdapter::URIFromIapIdL( TInt aId )
+ {
+ CBufBase *allIds = CBufFlat::NewL(KXdmDmIdTableSize);
+ CleanupStack::PushL( allIds ); // << allIds
+ MSmlDmAdapter::TError status;
+ // Fetch all IAP ids
+ Callback().FetchLinkL( KXdmDmAP, *allIds, status );
+
+ if ( status == MSmlDmAdapter::EOk )
+ {
+ TInt index(0);
+ TInt segStart(0);
+ while ( index != KErrNotFound )
+ {
+ // Get pointer from segStart
+ TPtrC8 allIdsPtr = allIds->Ptr(segStart).Mid(0);
+ // Find the end of the segment
+ index = allIdsPtr.Locate('/');
+ HBufC8* uriSeg = NULL;
+ // This is the last one
+ if ( index == KErrNotFound )
+ {
+ TPtrC8 uriSeg8Ptr = allIds->Ptr(segStart);
+ uriSeg = uriSeg8Ptr.AllocLC(); // << uriSeg
+ }
+ else
+ {
+ TPtrC8 uriSeg8Ptr = allIds->Ptr(segStart).Mid( 0, index );
+ uriSeg = uriSeg8Ptr.AllocLC(); // << uriSeg8Ptr
+ }
+ // Construct the uri
+ HBufC8* uri = HBufC8::NewLC( KXdmDmAP().Length()
+ + KXdmDmSeparator().Length()
+ + uriSeg->Length() ); // << uri
+ TPtr8 uriPtr = uri->Des();
+ uriPtr.Format( KXdmDmAP );
+ uriPtr.Append( KXdmDmSeparator );
+ uriPtr.Append( *uriSeg );
+ // Get the luid from the uri
+ HBufC8* luid = Callback().GetLuidAllocL( uriPtr );
+ if ( luid && luid->Length() > 0 )
+ {
+ // No need to push luid to the CleanupStack
+ TInt id = DesToInt( luid->Des() );
+ delete luid;
+ luid = NULL;
+ if ( id == aId )
+ {
+ // The correct one found
+ CleanupStack::Pop(); // >>> uri
+ CleanupStack::PopAndDestroy( 2, allIds ); // >>> uriSeg, allIds
+ return uri;
+ }
+ }
+ // This was wrong, delete and get the next one
+ CleanupStack::PopAndDestroy( 2, uriSeg ); // >>> uri, uriSeg
+ segStart += index + 1;
+ }
+ }
+ CleanupStack::PopAndDestroy( allIds ); // >>> allIds
+ return NULL;
+ }
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::GetSipIdL
+// -----------------------------------------------------------------------------
+//
+TInt CXdmDMAdapter::GetSipIdL( const TDesC8& aUri )
+ {
+
+ CSmlDmAdapter::TError status = EOk;
+ CBufBase* result = CBufFlat::NewL(1);
+ CleanupStack::PushL( result ); // << result
+
+ TPtrC8 uri = NSmlDmURI::RemoveDotSlash( aUri );
+ // Request the sip settings identifier
+ Callback().FetchLinkL( uri, *result, status);
+
+ if( status == EOk )
+ {
+ TUint32 id( 0 );
+ TPtrC8 hexIndex = uri.Right( KXdmDmHexLength );
+ TLex8 lexer( hexIndex );
+ lexer.Val( id, EHex );
+ CleanupStack::PopAndDestroy( result ); // >>> result
+ return id;
+ }
+ CleanupStack::PopAndDestroy( result ); // >>> result
+ return KErrNotFound;
+ }
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::FetchSipConRefL
+// -----------------------------------------------------------------------------
+//
+CSmlDmAdapter::TError CXdmDMAdapter::FetchSipConRefL( TInt aSettingsId,
+ CBufBase& aObject)
+ {
+
+ CSmlDmAdapter::TError status = CSmlDmAdapter::EOk;
+ TInt sipSettingsId( KErrNotFound );
+
+ HBufC* value = NULL;
+ TInt error( KErrNone );
+ TRAP( error, ( value = TXdmSettingsApi::PropertyL( aSettingsId, EXdmPropToAppRef ) ) );
+ if ( error == KErrNone )
+ {
+ sipSettingsId = DesToInt( *value );
+ delete value;
+ value = NULL;
+ }
+
+ if( sipSettingsId != KErrNotFound )
+ {
+ CBufBase* result = CBufFlat::NewL(1);
+ CleanupStack::PushL(result); // << result
+
+ // Request all the sip settings identifiers
+ Callback().FetchLinkL( KXdmDmSip, *result, status);
+
+ if( status == EOk )
+ {
+ TPtr8 uriSeg8Ptr = result->Ptr(0);
+
+ HBufC8* uriSegBuffer = uriSeg8Ptr.AllocL();
+ CleanupStack::PushL( uriSegBuffer ); // << uriSegBuffer
+
+ TPtr8 uriSegBufferPtr = uriSegBuffer->Des();
+
+ TInt numOfUriSegs = NSmlDmURI::NumOfURISegs(uriSeg8Ptr);
+
+ // Check if the SIP settings id match with one of the found
+ // SIP settings identifiers
+ while( numOfUriSegs > 1)
+ {
+ uriSegBufferPtr = NSmlDmURI::RemoveLastSeg(uriSegBufferPtr);
+
+ TPtrC8 hexIndex = uriSegBufferPtr.Right(KXdmDmHexLength);
+
+ TUint32 id(0);
+ TLex8 lexer(hexIndex);
+ if( lexer.Val(id, EHex) == KErrNone )
+ {
+ if( id == sipSettingsId )
+ {
+ TPtrC8 lastUriSegSip = NSmlDmURI::LastURISeg(uriSegBufferPtr);
+
+ // Total length of the sip settings link where one is for
+ // the separator
+ TInt sipLinkLength = KXdmDmSip().Length() +
+ KXdmDmSeparator().Length() +
+ lastUriSegSip.Length();
+ HBufC8* sipLink = HBufC8::NewLC( sipLinkLength ); // <<< sipLink
+
+ TPtr8 sipLinkPtr = sipLink->Des();
+ sipLinkPtr.Append( KXdmDmSip );
+ sipLinkPtr.Append( KXdmDmSeparator );
+ sipLinkPtr.Append( lastUriSegSip );
+
+ aObject.InsertL( 0, sipLinkPtr );
+
+ CleanupStack::PopAndDestroy( sipLink ); // >>> sipLink
+ break;
+ }
+ }
+
+ numOfUriSegs -= 1;
+ }
+
+ CleanupStack::PopAndDestroy( uriSegBuffer ); // >>> uriSegBuffer
+ }
+
+ CleanupStack::PopAndDestroy( result ); // >>> result
+ }
+ else
+ {
+ status = CSmlDmAdapter::ENotFound;
+ }
+
+ return status;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::FindSettingsIdL
+// -----------------------------------------------------------------------------
+//
+TInt CXdmDMAdapter::FindSettingsIdL( const TDesC8& aLUID, const TDesC8& aUri )
+ {
+ TInt settingsId(0);
+ if ( aLUID.Length() > 0 )
+ {
+ settingsId = DesToInt( aLUID );
+ return settingsId;
+ }
+ else
+ {
+ TPtrC8 name = NSmlDmURI:: URISeg( aUri, KXdmDmLevel );
+ settingsId = DesToInt( name );
+ HBufC8* luid = IntToDes8LC( settingsId ); // << luid
+ Callback().SetMappingL( aUri, *luid );
+ CleanupStack::PopAndDestroy( luid ); // luid
+ return settingsId;
+ }
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::CheckExistingNamesLC()
+// -----------------------------------------------------------------------------
+//
+HBufC* CXdmDMAdapter::CheckExistingNamesLC( const TDesC8& aName )
+ {
+ TBool ready( EFalse );
+ RArray<TInt> settingIds;
+ CleanupClosePushL( settingIds ); // << settingIds
+ CDesCArray* settingNames = TXdmSettingsApi::CollectionNamesLC( settingIds ); // << settingNames
+ TInt index( 0 );
+ TBuf<512> tempName;
+ while ( !ready )
+ {
+ TBool found ( EFalse );
+ TInt count = settingNames->MdcaCount();
+ tempName.Copy( aName );
+ if ( index > 0 )
+ {
+ tempName.Append( KXdmDmStartBracket );
+ tempName.AppendNumFixedWidth( index, EDecimal, 2 );
+ tempName.Append( KXdmDmCloseBracket );
+ }
+ for ( TInt i(0); i < count && !found; i++ )
+ {
+ if ( !settingNames->MdcaPoint(i).CompareF( tempName ) )
+ {
+ found = ETrue;
+ index++;
+ }
+ }
+ if ( !found )
+ {
+ ready = ETrue;
+ }
+ }
+ CleanupStack::PopAndDestroy( 2 ); // >>> settingNames, settingIds
+ HBufC* newName = tempName.AllocLC(); // << newName
+ return newName;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::Match
+// -----------------------------------------------------------------------------
+//
+TBool CXdmDMAdapter::Match( const TDesC8& aLeft, const TDesC8& aRight )
+ {
+ if ( !aLeft.Compare( aRight ) )
+ {
+ return ETrue;
+ }
+ return EFalse;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::ConvertLC
+// -----------------------------------------------------------------------------
+//
+HBufC8* CXdmDMAdapter::ConvertLC( const TDesC& aSource )
+ {
+ HBufC8* destination = HBufC8::NewLC( aSource.Length() ); // << destination
+ TPtr8 bufferPtr = destination->Des();
+ CnvUtfConverter::ConvertFromUnicodeToUtf8( bufferPtr, aSource );
+ return destination;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmDMAdapter::ConvertLC
+// -----------------------------------------------------------------------------
+//
+HBufC* CXdmDMAdapter::ConvertLC( const TDesC8& aSource )
+ {
+ HBufC* destination = HBufC::NewLC( aSource.Length() ); // << destination
+ TPtr bufferPtr = destination->Des();
+ CnvUtfConverter::ConvertToUnicodeFromUtf8( bufferPtr, aSource );
+ return destination;
+ }
+// ----------------------------------------------------------------------------
+// CXdmDMAdapter::DesToInt
+// ----------------------------------------------------------------------------
+TInt CXdmDMAdapter::DesToInt( const TDesC& aSource ) const
+ {
+ TLex16 lex( aSource );
+ TInt value ( KErrNotFound );
+ lex.Val( value );
+ return value;
+ }
+
+// ----------------------------------------------------------------------------
+// CXdmDMAdapter::DesToInt
+// ----------------------------------------------------------------------------
+TInt CXdmDMAdapter::DesToInt( const TDesC8& aSource ) const
+ {
+ TLex8 lex( aSource );
+ TInt value ( KErrNotFound );
+ lex.Val( value );
+ return value;
+ }
+
+// ----------------------------------------------------------------------------
+// CXdmDMAdapter::IntToDes8LC
+// ----------------------------------------------------------------------------
+HBufC8* CXdmDMAdapter::IntToDes8LC( const TInt aSource )
+ {
+ // 10 = max length of 32bit integer
+ HBufC8* buf = HBufC8::NewLC( KXdmDmMaxIntLength ); // << buf
+ TPtr8 ptrBuf = buf->Des();
+ ptrBuf.Num( aSource );
+ return buf;
+ }
+
+// ----------------------------------------------------
+// CXdmDMAdapter::WriteToLog
+// DEBUG only
+// ----------------------------------------------------
+//
+#ifdef _DEBUG
+void CXdmDMAdapter::WriteToLog( TRefByValue<const TDesC8> aFmt,... )
+ {
+ VA_LIST list;
+ VA_START( list, aFmt );
+ TBuf8<KXdmDmLogBufferMaxSize> buf;
+ buf.FormatList( aFmt, list );
+ RFileLogger::Write( KXdmDmLogDir, KXdmDmLogFile, EFileLoggingModeAppend, buf );
+ }
+#endif
+
+// End of File
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmDeviceManagement/src/xdmdmadaptergroupproxy.cpp Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* 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: Table of plugins for ECom
+*
+*/
+
+
+
+
+
+// INCLUDE FILES
+#include <implementationproxy.h>
+
+#include "xdmdmadapter.h"
+#include "xdmdmuid.h"
+
+
+// -----------------------------------------------------------------------------
+// TImplementationProxy ImplementationTable[]
+// Needed because of ECOM architecture
+// -----------------------------------------------------------------------------
+const TImplementationProxy ImplementationTable[] =
+ {
+#ifdef __EABI__
+ IMPLEMENTATION_PROXY_ENTRY( KXdmDmImplUid, CXdmDMAdapter::NewL )
+#else
+ { { KXdmDmImplUid }, CXdmDMAdapter::NewL },
+#endif
+ };
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy()
+// Needed because of ECOM architecture
+// -----------------------------------------------------------------------------
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt&
+ aTableCount )
+ {
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+#ifdef _DEBUG
+ CXdmDMAdapter::WriteToLog(_L8( "CXdmDMAdapter:ImplementationGroupProxy") );
+#endif
+ return ImplementationTable;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/BWINSCW/XdmProvisioningU.DEF Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+ ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/data/1028237A.rss Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* 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: XDM Provisioning Adapter
+*
+*/
+
+
+
+
+#include "registryinfo.rh"
+#include "../inc/xdmprovuid.h"
+
+//Declares the interface implementations provided
+RESOURCE REGISTRY_INFO XdmProvisioningInfo
+ {
+ dll_uid = KXdmProvAdapterDll;
+ interfaces =
+ {
+ INTERFACE_INFO
+ {
+ interface_uid = KXdmProvAdapterInterface;
+ implementations =
+ {
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = KXdmProvAdapterImplementation;
+ version_no = 1;
+ display_name = "XDM Provisioning Plugin||Copyright © 2006 Nokia Ltd. All rights reserved.";
+ default_data = "";
+ opaque_data = "";
+ }
+ };
+ }
+ };
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/data/xdmprovisioningtexts.rss Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* 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: Resource definitions of texts visible to user.
+*
+*/
+
+
+
+
+// INCLUDES
+#include <badef.rh>
+#include <xdmprovisioningadapter.loc>
+
+// RESOURCE DEFINITIONS
+RESOURCE LBUF r_qtn_sm_head_connection
+ {
+ txt = qtn_sm_head_connection;
+ }
+
+RESOURCE LBUF r_qtn_xdm_provisioning_name
+ {
+ txt = qtn_xdm_provisioning_name;
+ }
+
+// End of File
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/eabi/XdmProvisioningU.DEF Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,7 @@
+EXPORTS
+ _Z24ImplementationGroupProxyRi @ 1 NONAME
+ _ZTI12CXdmProvItem @ 2 NONAME ; #<TI>#
+ _ZTI15CXdmProvAdapter @ 3 NONAME ; #<TI>#
+ _ZTV12CXdmProvItem @ 4 NONAME ; #<VT>#
+ _ZTV15CXdmProvAdapter @ 5 NONAME ; #<VT>#
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/group/bld.inf Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* 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: XDM Engine build file
+*
+*/
+
+
+
+PRJ_PLATFORMS
+//--------------------
+DEFAULT
+
+//--------------------
+PRJ_MMPFILES
+//--------------------
+
+xdmprovisioning.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/group/xdmprovisioning.mmp Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* 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: XDM Provisioning Adapter
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+// needed for RESOURCE_FILES_DIR
+#include <data_caging_paths.hrh>
+
+
+
+TARGET xdmprovisioning.dll
+TARGETTYPE PLUGIN
+UID 0x10009D8D 0x1028237A
+CAPABILITY CAP_ECOM_PLUGIN
+VENDORID VID_DEFAULT
+
+SOURCEPATH ../src
+
+SOURCE xdmprovitem.cpp
+SOURCE xdmprovadapter.cpp
+SOURCE xdmprovadaptergroupproxy.cpp
+
+SOURCEPATH ../data
+START RESOURCE 1028237A.rss
+ TARGET xdmprovisioning.rsc
+END
+
+
+START RESOURCE xdmprovisioningtexts.rss
+HEADER
+TARGET xdmprovisioningtexts.rsc
+TARGETPATH RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+
+USERINCLUDE ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE /epoc32/include/ecom
+
+LIBRARY ecom.lib
+LIBRARY euser.lib
+LIBRARY xdmsettingsapi.lib
+LIBRARY provisioningengine.lib
+LIBRARY commdb.lib
+
+
+DEBUGLIBRARY flogger.lib
+
+
+
+
+
+#if defined( ARMCC )
+ DEFFILE ../eabi/
+#elif defined ( WINSCW )
+ deffile ../BWINSCW/
+#endif
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/inc/xdmprovadapter.h Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,117 @@
+/*
+* 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: XDM OMA Provisioning Adapter class
+*
+*/
+
+
+
+
+#ifndef __XDMPROVADAPTER_H__
+#define __XDMPROVADAPTER_H__
+
+// INCLUDES
+#include <CWPAdapter.h>
+
+// FORWARD DECLARATIONS
+class CXdmProvItem;
+class CWPCharacteristic;
+
+// CONSTANTS
+#ifdef _DEBUG
+_LIT( KXdmProvAdapterLogDir, "Xdm" );
+_LIT( KXdmProvAdapterLogFile, "XdmProvAdapter.txt" );
+const TInt KXdmProvAdapterBufferMaxSize = 2000;
+#endif
+
+const TInt KXdmProvIntMaxLength = 10; // max length of 32bit integer
+
+_LIT8( KXdmProvAppId8, "ap0003" );
+_LIT8( KXdmProvSipIdentifier, "w9010" );
+
+// CLASS DECLARATION
+
+class CXdmProvAdapter : public CWPAdapter
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Two-phased constructor.
+ */
+ static CXdmProvAdapter* NewL();
+
+ /**
+ * Destructor.
+ */
+ ~CXdmProvAdapter();
+
+#ifdef _DEBUG
+ /**
+ * Writes logs to file.
+ */
+ static void WriteToLog( TRefByValue<const TDesC8> aFmt,... );
+#endif
+
+ private: // from CWPAdapter
+
+ TInt ItemCount() const;
+ const TDesC16& SummaryTitle( TInt aIndex ) const;
+ const TDesC16& SummaryText( TInt aIndex ) const;
+ void SaveL( TInt aItem );
+ TBool CanSetAsDefault( TInt aItem ) const;
+ void SetAsDefaultL( TInt aItem );
+ TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor );
+ void VisitL( CWPCharacteristic& aCharacteristic);
+ void VisitL( CWPParameter& aParameter );
+ void VisitLinkL( CWPCharacteristic& aLink );
+ void SettingsSavedL ( const TDesC8& aAppIdOfSavingItem,
+ const TDesC8& aAppRef,
+ const TDesC8& aStorageIdValue);
+ void SavingFinalizedL();
+
+ void GetSavingInfoL( TInt aIndex,
+ RPointerArray<HBufC8>& aSavingInfo );
+
+
+
+ private:
+
+ /**
+ * C++ default constructor.
+ */
+ CXdmProvAdapter();
+
+ /**
+ * By default Symbian 2nd phase constructor is private.
+ */
+ void ConstructL();
+
+
+ private:
+
+ // Default name for settings
+ HBufC* iDefaultName;
+
+ // Title for XDM settings
+ HBufC* iTitle;
+
+ // XdmItems
+ RPointerArray<CXdmProvItem> iProvItems;
+
+
+ };
+
+#endif // __XDMPROVADAPTER_H__
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/inc/xdmprovitem.h Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,212 @@
+/*
+* 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: Provisioning item for parsing and saving XDM settings
+*
+*/
+
+
+
+
+#ifndef __XDMPROVITEM_H__
+#define __XDMPROVITEM_H__
+
+// INCLUDES
+#include <CWPAdapter.h>
+
+// FORWARD DECLARATIONS
+class CWPCharacteristic;
+class CWPParameter;
+
+_LIT( KXdmProvAppId, "ap0003" );
+_LIT( KXdmProvAppRef, "APPREF" );
+_LIT( KXdmProvToAppRef, "TO-APPREF" );
+_LIT( KXdmProvStartBracket, "(" );
+_LIT( KXdmProvCloseBracket, ")" );
+
+const TInt KXdmProvIdLength = 10;
+const TInt KXdmProvNameLength = 40;
+const TInt KXdmProvBufLength = 512;
+
+/**
+* Xdm settings item for provisioning.
+*
+* @since S60 3.2
+*/
+class CXdmProvItem : public CBase, public MWPVisitor
+ {
+ public:
+
+ /**
+ * Two-phased constructor.
+ */
+ static CXdmProvItem* NewL();
+
+ /**
+ * Destructor.
+ */
+ virtual ~CXdmProvItem();
+
+
+ private: // From MWPVisitor
+
+ void VisitL( CWPCharacteristic& aCharacteristic );
+
+ void VisitL( CWPParameter& aParameter );
+
+ void VisitLinkL( CWPCharacteristic& aLink );
+
+ public:
+
+ /**
+ * Validates the provisioning item for mandatory fields
+ * @return ETrue if correct item
+ */
+ TBool Validate() const;
+
+ /**
+ * Saves the provisioned settings
+ * @return KErrNone if successfull
+ */
+ TInt SaveL();
+
+ /**
+ * Returns name of the provisioning item
+ * @return Name or KNullDesC
+ */
+ const TDesC& Name() const;
+
+ /**
+ * Returns application id of the provisioning item
+ * @return ApplicationId or KNullDesC
+ */
+ const TDesC& ApplicationId() const;
+
+ /**
+ * Returns id of the created settings
+ * @return The id or KErrNotFound if not yet saved
+ */
+ TInt XdmSettingsId() const;
+
+ /**
+ * Returns value of the APPREF of the provisioning item
+ * @return iAppRef or KNullDesC
+ */
+ const TDesC& AppReference() const;
+
+ /**
+ * Returns the application references from this item to other
+ * applications
+ * @return Array of references
+ */
+ const RArray<TPtrC>& ToAppReferences() const;
+
+
+ /**
+ * Set SIP settings id
+ * @param aStorageIdValue Settings id
+ */
+ void SetSipSettingsIdL( const TDesC8& aStorageIdValue );
+
+ /**
+ * Set name of the access point
+ * @param aLink
+ */
+ void SetNapDefL ( CWPCharacteristic& aLink );
+
+ private:
+
+
+ /**
+ * C++ default constructor.
+ */
+ CXdmProvItem();
+
+ /**
+ * Determines and saves named parameter
+ * @param aName Name of the parameter
+ * @param aValue Value of the parameter
+ */
+ void DetermineNamedParameter( const TDesC& aName,
+ const TDesC& aValue );
+
+ /**
+ * Finds the access point id from CommsDb
+ * based on access poin name
+ */
+ void FindAccessPointIdL ();
+
+ /**
+ * Checks that the settings name is not in use.
+ * Creates new name with index if needed.
+ */
+ void CheckExistingNamesL( );
+
+ private:
+
+
+ // The allocated id for the saved settings
+ TInt iXdmSettingsId;
+
+ // APPID
+ TPtrC iAppId;
+
+ // APPNAME
+ TPtrC iAppName;
+
+ // PROVIDER-ID
+ TPtrC iProviderId;
+
+ // TO-APPREF
+ HBufC* iSipReference;
+
+ // TO-NAPID
+ TPtrC iToNapId;
+
+ // Access point id
+ HBufC* iNapId;
+
+ // Name of the access point
+ TPtrC iNapName;
+
+ // APPREF
+ TPtrC iAppRef;
+
+ // URI
+ TPtrC iXcapRootUri;
+
+ // AAUTHNAME
+ TPtrC iUserName;
+
+ // AAUTHSECRET
+ TPtrC iPassword;
+
+ // AAUTHTYPE
+ TPtrC iAuthType;
+
+ // Flag indicating wheather settings are saved
+ TBool iSettingsSaved;
+
+ // Application references
+ RArray<TPtrC> iToAppReferences;
+
+
+ };
+
+#endif // __XDMPROVITEM_H__
+
+// End of File
+
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/inc/xdmprovuid.h Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Uids for Xdm Provisioning
+*
+*/
+
+
+
+
+#ifndef __XDMPROVISIONINGUID__
+#define __XDMPROVISIONINGUID__
+
+// XDM Provisioning Adapter ECOM plugin interface
+#define KXdmProvAdapterDll 0x1028237A
+
+// ECOM plugin interface for all provisioning adapters
+#define KXdmProvAdapterInterface 0x101F84D5
+
+// XDM Provisioning Adapter implementation
+#define KXdmProvAdapterImplementation 0x1028237B
+
+#endif // __XDMPROVISIONINGUID__
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/loc/xdmprovisioningadapter.loc Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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: This file contains all logical names for
+* XDM Provisioning Adapter.
+*
+*/
+
+
+
+
+// LOCALISATION STRINGS
+
+//d: Summary title for Xdm provisioning entries.
+//l: msg_body_pane/opt
+//
+#define qtn_sm_head_connection "Connection settings"
+
+
+//d: Default name for new Xdm server settings.
+//l: msg_body_pane/opt
+//
+#define qtn_xdm_provisioning_name "New XDM settings"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/src/xdmprovadapter.cpp Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,375 @@
+/*
+* 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: XDM Provisioning Adapter implementation.
+*
+*/
+
+
+
+
+
+// INCLUDE FILES
+#include <CWPCharacteristic.h>
+#include <WPAdapterUtil.h>
+#include <xdmprovisioningtexts.rsg>
+#include <XdmSettingsApi.h>
+
+#include "xdmprovitem.h"
+#include "xdmprovadapter.h"
+
+
+#ifdef _DEBUG
+ #include <flogger.h>
+#endif
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::CXdmProvAdapter
+//
+// -----------------------------------------------------------------------------
+//
+CXdmProvAdapter::CXdmProvAdapter():
+iDefaultName( NULL ),
+iTitle( NULL ),
+iProvItems( 1 )
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CXdmProvAdapter::ConstructL()
+ {
+ // AdapterUtil needs the name of the resource file without the prefix and
+ // the path returned by Dll::FileName. Note that Dll::FileName is an
+ // undocumented method.
+ //
+ _LIT( KXdmAdapterName, "xdmprovisioningtexts"); // xdmprovisioningtexts.rss
+ TFileName fileName;
+ Dll::FileName(fileName);
+
+ iTitle = WPAdapterUtil::ReadHBufCL( fileName,
+ KXdmAdapterName,
+ R_QTN_SM_HEAD_CONNECTION);
+ iDefaultName = WPAdapterUtil::ReadHBufCL( fileName,
+ KXdmAdapterName,
+ R_QTN_XDM_PROVISIONING_NAME);
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CXdmProvAdapter* CXdmProvAdapter::NewL()
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::NewL" ) );
+#endif
+ CXdmProvAdapter* self = new(ELeave) CXdmProvAdapter;
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop();
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::~CXdmProvAdapter
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CXdmProvAdapter::~CXdmProvAdapter()
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::~CXdmProvAdapter" ) );
+#endif
+ delete iTitle;
+ delete iDefaultName;
+ iProvItems.ResetAndDestroy();
+ iProvItems.Close();
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::ItemCount
+// -----------------------------------------------------------------------------
+//
+TInt CXdmProvAdapter::ItemCount() const
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::ItemCount returns %d" ), iProvItems.Count());
+#endif
+ return iProvItems.Count();
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::SummaryTitle
+// -----------------------------------------------------------------------------
+//
+const TDesC16& CXdmProvAdapter::SummaryTitle(TInt /*aIndex*/) const
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::SummaryTitle" ) );
+#endif
+ return *iTitle;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::SummaryText
+// -----------------------------------------------------------------------------
+//
+const TDesC16& CXdmProvAdapter::SummaryText( TInt aIndex ) const
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::SummaryText" ) );
+#endif
+ TInt count = iProvItems.Count();
+ if( aIndex < count )
+ {
+ if( 0 < iProvItems[aIndex]->Name().Length() )
+ {
+ return iProvItems[aIndex]->Name();
+ }
+ }
+ return *iDefaultName;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::SaveL
+// -----------------------------------------------------------------------------
+//
+void CXdmProvAdapter::SaveL( TInt aItem )
+ {
+ if ( aItem < iProvItems.Count() - 1 )
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::SaveL leaves with KErrArgument" ) );
+#endif
+ User::Leave ( KErrArgument );
+ }
+ iProvItems[aItem]->SaveL();
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::SaveL done" ) );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::CanSetAsDefault
+// -----------------------------------------------------------------------------
+//
+TBool CXdmProvAdapter::CanSetAsDefault( TInt /*aItem*/ ) const
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::CanSetAsDefault" ) );
+#endif
+ return EFalse;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::SetAsDefaultL
+// -----------------------------------------------------------------------------
+//
+void CXdmProvAdapter::SetAsDefaultL( TInt /*aItem*/ )
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::SetAsDefaultL" ) );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::DetailsL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CXdmProvAdapter::DetailsL( TInt /*aItem*/, MWPPairVisitor& /*aVisitor*/ )
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::DetailsL" ) );
+#endif
+ return KErrNotSupported;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::VisitL
+// -----------------------------------------------------------------------------
+//
+void CXdmProvAdapter::VisitL( CWPCharacteristic& aCharacteristic )
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::VisitL( CWPCharacteristic& aCharacteristic)" ) );
+#endif
+ if( KWPApplication == aCharacteristic.Type() )
+ {
+ CXdmProvItem* item = CXdmProvItem::NewL();
+ CleanupStack::PushL( item ); // << item
+ aCharacteristic.AcceptL( *item );
+
+ if( item->Validate() )
+ {
+ iProvItems.AppendL( item );
+ CleanupStack::Pop( item ); // >> item
+ }
+ else
+ {
+ CleanupStack::PopAndDestroy( item ); // >>> item
+ }
+ }
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::VisitL
+// -----------------------------------------------------------------------------
+//
+void CXdmProvAdapter::VisitL( CWPParameter& /*aParameter*/ )
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::VisitL( CWPParameter& /*aParameter*/" ) );
+#endif
+ // Not used.
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::VisitLinkL
+// -----------------------------------------------------------------------------
+//
+void CXdmProvAdapter::VisitLinkL( CWPCharacteristic& /*aLink*/ )
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::VisitLinkL( CWPCharacteristic& aLink" ) );
+#endif
+ // Not used.
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::SettingsSavedL
+//
+// -----------------------------------------------------------------------------
+void CXdmProvAdapter::SettingsSavedL( const TDesC8& aAppIdOfSavingItem,
+ const TDesC8& aAppRef,
+ const TDesC8& aStorageIdValue )
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::SettingsSavedL" ) );
+#endif
+ // Convert aAppRef
+ HBufC* appRef16 = HBufC::NewLC( aAppRef.Length() ); // << aAppRef16
+ appRef16->Des().Copy( aAppRef );
+
+ // Offer application references to all provisioned XDM settings
+ TInt provItemsCount( iProvItems.Count() );
+ for( TInt i(0); i < provItemsCount; i++ )
+ {
+ CXdmProvItem* item = iProvItems[i];
+ const RArray<TPtrC>& toAppRefs = item->ToAppReferences();
+
+ // Find application reference that is being offered
+ TInt toAppRefsCount( toAppRefs.Count() );
+ for( TInt j(0); j < toAppRefsCount; j++ )
+ {
+ const TDesC& toAppRef = toAppRefs[j];
+ if( !toAppRef.Compare( *appRef16 ) )
+ {
+ // Set correct application reference
+ if( !aAppIdOfSavingItem.Compare( KXdmProvSipIdentifier ) )
+ {
+ item->SetSipSettingsIdL( aStorageIdValue );
+ break;
+ }
+ }
+ }
+ }
+ CleanupStack::PopAndDestroy( appRef16 ); // >>> appRef16
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::GetSavingInfoL
+//
+// -----------------------------------------------------------------------------
+void CXdmProvAdapter::GetSavingInfoL( TInt aIndex,
+ RPointerArray<HBufC8>& aSavingInfo )
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::GetSavingInfoL" ) );
+#endif
+ if ( aIndex < iProvItems.Count() - 1 )
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::GetSavingInfoL leaves with KErrArgument" ) );
+#endif
+ User::Leave ( KErrArgument );
+ }
+ TInt length ( iProvItems[aIndex]->AppReference().Length() );
+ // if the APPREF exists
+ if ( 0 < length )
+ {
+ // APPID into place [0].
+ TPtrC8 appId ( KXdmProvAppId8 );
+ HBufC8* appIdBuf = appId.AllocLC(); // << appIdBuf
+ aSavingInfo.AppendL( appIdBuf );
+ CleanupStack::Pop( appIdBuf ); // >> appIdBuf
+ appIdBuf = NULL;
+
+ // APPREF into place [1].
+ HBufC8* appRefBuf = HBufC8::NewLC( length ); // << appRefBuf
+ TPtr8 appRef = appRefBuf->Des();
+ appRef.Copy( iProvItems[aIndex]->AppReference() );
+ aSavingInfo.AppendL( appRefBuf );
+ CleanupStack::Pop( appRefBuf ); // >> appRefBuf
+ appRefBuf = NULL;
+
+ // Xdm settings id into place [2].
+ HBufC8* idBuf = HBufC8::NewLC( KXdmProvIntMaxLength ); // << idBuf
+ TPtr8 id = idBuf->Des();
+ id.Num( iProvItems[aIndex]->XdmSettingsId() );
+ aSavingInfo.AppendL( idBuf );
+ CleanupStack::Pop( idBuf ); // >> idBuf
+ idBuf = NULL;
+ }
+
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::GetSavingInfoL done" ) );
+#endif
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvAdapter::SavingFinalizedL()
+//
+// -----------------------------------------------------------------------------
+void CXdmProvAdapter::SavingFinalizedL()
+ {
+#ifdef _DEBUG
+ WriteToLog( _L8( "CXdmProvAdapter::SavingFinalizedL" ) );
+#endif
+ }
+
+
+// ----------------------------------------------------
+// CXdmProvAdapter::WriteToLog
+// _DEBUG only
+// ----------------------------------------------------
+//
+#ifdef _DEBUG
+void CXdmProvAdapter::WriteToLog( TRefByValue<const TDesC8> aFmt,... )
+ {
+ VA_LIST list;
+ VA_START( list, aFmt );
+ TBuf8<KXdmProvAdapterBufferMaxSize> buf;
+ buf.FormatList( aFmt, list );
+ RFileLogger::Write( KXdmProvAdapterLogDir, KXdmProvAdapterLogFile, EFileLoggingModeAppend, buf );
+ }
+#endif
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/src/xdmprovadaptergroupproxy.cpp Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* 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: Table of plugins for ECom
+*
+*/
+
+
+
+
+
+// INCLUDE FILES
+#include <implementationproxy.h>
+
+#include "xdmprovadapter.h"
+#include "xdmprovuid.h"
+
+
+// CONSTANTS
+const TImplementationProxy KImplementationTable[] =
+ {
+#ifdef __EABI__
+ IMPLEMENTATION_PROXY_ENTRY( KXdmProvAdapterImplementation, CXdmProvAdapter::NewL )
+#else
+ { { KXdmProvAdapterImplementation }, CXdmProvAdapter::NewL },
+#endif
+ };
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+ {
+ aTableCount = sizeof( KImplementationTable ) / sizeof( TImplementationProxy );
+ return KImplementationTable;
+ }
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmProvisioning/src/xdmprovitem.cpp Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,500 @@
+/*
+* 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: Provisioning item.
+*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <CWPParameter.h>
+#include <CWPCharacteristic.h>
+#include <commdb.h>
+#include <XdmSettingsCollection.h>
+#include <XdmSettingsApi.h>
+
+#include "xdmprovitem.h"
+
+#ifdef _DEBUG
+ #include "xdmprovadapter.h"
+#endif
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::CXdmProvItem
+//
+// -----------------------------------------------------------------------------
+//
+CXdmProvItem::CXdmProvItem():
+ iXdmSettingsId( KErrNotFound ),
+ iAppId( KNullDesC ),
+ iAppName( KNullDesC ),
+ iProviderId( KNullDesC ),
+ iSipReference( NULL ),
+ iToNapId( KNullDesC ),
+ iNapId( NULL ),
+ iNapName( KNullDesC ),
+ iAppRef( KNullDesC ),
+ iXcapRootUri( KNullDesC ),
+ iUserName( KNullDesC ),
+ iPassword( KNullDesC ),
+ iAuthType( KNullDesC ),
+ iSettingsSaved( EFalse )
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CXdmProvItem* CXdmProvItem::NewL()
+ {
+ CXdmProvItem* self = new (ELeave) CXdmProvItem();
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::~CXdmProvItem
+// -----------------------------------------------------------------------------
+//
+CXdmProvItem::~CXdmProvItem()
+ {
+ iToAppReferences.Close();
+ delete iSipReference;
+ delete iNapId;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::Validate
+// -----------------------------------------------------------------------------
+//
+TBool CXdmProvItem::Validate() const
+ {
+ if ( !iAppId.Length() )
+ {
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::Validate iAppId missing" ) );
+#endif
+ return EFalse;
+ }
+ else if ( iAppId.Compare( KXdmProvAppId ) )
+ {
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::Validate wrong iAppId" ) );
+#endif
+ return EFalse;
+ }
+ else if ( !iAppName.Length() )
+ {
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::Validate iAppName missing" ) );
+#endif
+ return EFalse;
+ }
+ else if ( !iToNapId.Length() )
+ {
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::Validate iNapId missing" ) );
+#endif
+ return EFalse;
+ }
+ else if ( !iXcapRootUri.Length() )
+ {
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::Validate iXcapRootUri missing" ) );
+#endif
+ return EFalse;
+ }
+ else
+ {
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::Validate returns true" ) );
+#endif
+ return ETrue;
+ }
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::Name
+// -----------------------------------------------------------------------------
+//
+const TDesC& CXdmProvItem::Name() const
+ {
+ return iAppName;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::ApplicationId
+// -----------------------------------------------------------------------------
+//
+const TDesC& CXdmProvItem::ApplicationId() const
+ {
+ return iAppId;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::XdmSettingsId
+// -----------------------------------------------------------------------------
+//
+TInt CXdmProvItem::XdmSettingsId() const
+ {
+ return iXdmSettingsId;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::AppReference
+// -----------------------------------------------------------------------------
+//
+const TDesC& CXdmProvItem::AppReference() const
+ {
+ return iAppRef;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::SaveL
+// -----------------------------------------------------------------------------
+//
+TInt CXdmProvItem::SaveL()
+ {
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::SaveL" ) );
+#endif
+
+ if( !iSettingsSaved )
+ {
+ CXdmSettingsCollection* settings = new (ELeave) CXdmSettingsCollection();
+ CleanupStack::PushL( settings ); // << settings
+ settings->AppendL( iAppId, EXdmPropAppId );
+ CheckExistingNamesL();
+ settings->AppendL( iAppName, EXdmPropName );
+ settings->AppendL( iProviderId, EXdmPropProvId );
+ FindAccessPointIdL();
+ settings->AppendL( *iNapId, EXdmPropToNapId );
+ if( iSipReference )
+ {
+ settings->AppendL( *iSipReference, EXdmPropToAppRef );
+ }
+ settings->AppendL( iXcapRootUri, EXdmPropUri );
+ settings->AppendL( iUserName, EXdmPropAuthName );
+ settings->AppendL( iPassword, EXdmPropAuthSecret );
+ settings->AppendL( iAuthType, EXdmPropAuthType );
+ iXdmSettingsId = TXdmSettingsApi::CreateCollectionL( *settings );
+ CleanupStack::PopAndDestroy( settings ); // >>> settings
+ iSettingsSaved = ETrue;
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::SaveL settings saved" ) );
+#endif
+ }
+
+ return KErrNone;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::ToAppReferences
+// -----------------------------------------------------------------------------
+//
+const RArray<TPtrC>& CXdmProvItem::ToAppReferences() const
+ {
+ return iToAppReferences;
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::VisitL
+// -----------------------------------------------------------------------------
+//
+void CXdmProvItem::VisitL( CWPCharacteristic& aCharacteristic )
+ {
+ if ( KWPResource == aCharacteristic.Type( ) )
+ {
+ aCharacteristic.AcceptL( *this );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::VisitL CWPCharacteristic" ) );
+#endif
+ }
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::VisitL
+// -----------------------------------------------------------------------------
+//
+void CXdmProvItem::VisitL( CWPParameter& aParameter )
+ {
+#ifdef _DEBUG
+ HBufC8* value = HBufC8::NewLC( aParameter.Value().Length() ); // << value
+ TPtr8 bufferPtr = value->Des();
+ bufferPtr.Copy( aParameter.Value() );
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::VisitL CWPParameter aParameter.Value() =%S" ), &bufferPtr );
+ CleanupStack::PopAndDestroy( value ); // >>> value
+#endif
+ switch( aParameter.ID() )
+ {
+ case EWPParameterAppID:
+ {
+ iAppId.Set( aParameter.Value() );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::EWPParameterAppID" ) );
+#endif
+ }
+ break;
+
+ case EWPParameterProviderID:
+ {
+ iProviderId.Set( aParameter.Value() );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::EWPParameterProviderID" ) );
+#endif
+ }
+ break;
+
+ case EWPParameterName:
+ {
+ iAppName.Set( aParameter.Value() );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::EWPParameterName" ) );
+#endif
+ }
+ break;
+
+ case EWPParameterToAppRef:
+ {
+ iToAppReferences.Append( aParameter.Value() );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::EWPParameterToAppRef" ) );
+#endif
+ }
+ break;
+
+ case EWPParameterToNapID:
+ {
+ iToNapId.Set( aParameter.Value() );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::EWPParameterToNapID" ) );
+#endif
+ }
+ break;
+
+ case EWPParameterURI:
+ {
+ iXcapRootUri.Set( aParameter.Value() );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::EWPParameterURI" ) );
+#endif
+ }
+ break;
+
+ case EWPParameterAAuthName:
+ {
+ iUserName.Set( aParameter.Value() );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::EWPParameterAAuthName" ) );
+#endif
+ }
+ break;
+
+ case EWPParameterAAuthSecret:
+ {
+ iPassword.Set( aParameter.Value() );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::EWPParameterAAuthSecret" ) );
+#endif
+ }
+ break;
+
+ case EWPParameterAAuthType:
+ {
+ iAuthType.Set( aParameter.Value() );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::EWPParameterAAuthType" ) );
+#endif
+ }
+ break;
+
+ case EWPParameterAppRef:
+ {
+ iAppRef.Set( aParameter.Value() );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::EWPParameterAppRef" ) );
+#endif
+ }
+ break;
+ default:
+ {
+ DetermineNamedParameter( aParameter.Name(), aParameter.Value() );
+ }
+ break;
+ }
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::DetermineNamedParameter
+// -----------------------------------------------------------------------------
+//
+void CXdmProvItem::DetermineNamedParameter( const TDesC& aName, const TDesC& aValue )
+ {
+ if ( !aName.Compare( KXdmProvAppRef ) )
+ {
+ iAppRef.Set( aValue );
+ }
+ else if ( !aName.Compare( KXdmProvToAppRef ) )
+ {
+ iToAppReferences.Append( aValue );
+ }
+ }
+// -----------------------------------------------------------------------------
+// CXdmProvItem::VisitLinkL
+// -----------------------------------------------------------------------------
+//
+void CXdmProvItem::VisitLinkL( CWPCharacteristic& aLink )
+ {
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::VisitLinkL" ) );
+#endif
+ if( KWPNapDef == aLink.Type() )
+ {
+ // check that this is the correct one
+ CArrayFix<TPtrC>* napId = new (ELeave) CArrayFixFlat<TPtrC>(1);
+ CleanupStack::PushL( napId ); // << napId
+ aLink.ParameterL( EWPParameterNapID, napId );
+ if ( 0 < napId->Count() )
+ {
+ if ( !napId->At(0).Compare( iToNapId ) )
+ {
+ SetNapDefL( aLink );
+ }
+ }
+ CleanupStack::PopAndDestroy( napId ); // >>> napId
+ }
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::SetNapDefL
+// -----------------------------------------------------------------------------
+//
+void CXdmProvItem::SetNapDefL ( CWPCharacteristic& aLink )
+ {
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::SetNapDefL" ) );
+#endif
+ // find the name of the access point
+ CArrayFix<TPtrC>* name = new (ELeave) CArrayFixFlat<TPtrC>(1);
+ CleanupStack::PushL( name ); // << name
+ aLink.ParameterL( EWPParameterName, name );
+ if ( name->Count() > 0 )
+ {
+ iNapName.Set( name->At(0) );
+ }
+ CleanupStack::PopAndDestroy( name ); // >>> name
+
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::SetNapDefL done" ) );
+#endif
+ }
+// -----------------------------------------------------------------------------
+// CXdmProvItem::SetSipSettingsIdL
+// -----------------------------------------------------------------------------
+//
+void CXdmProvItem::SetSipSettingsIdL( const TDesC8& aStorageIdValue )
+ {
+ delete iSipReference;
+ iSipReference = NULL;
+ iSipReference = HBufC::NewL( aStorageIdValue.Length() );
+ iSipReference->Des().Copy( aStorageIdValue );
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::FindAccessPointIdL
+// -----------------------------------------------------------------------------
+//
+void CXdmProvItem::FindAccessPointIdL ()
+ {
+
+ TInt result( KErrNone );
+ TUint32 idNum;
+ TBuf<KXdmProvNameLength> name;
+ // Get IAP names and ids from the database
+ CCommsDatabase* commsDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+ CleanupStack::PushL( commsDb ); // << commsDb
+ commsDb->ShowHiddenRecords();
+ CCommsDbTableView* view = commsDb->OpenTableLC( TPtrC( IAP ) ); // << view
+ result = view->GotoFirstRecord();
+
+ while( KErrNone == result )
+ {
+ view->ReadTextL( TPtrC( COMMDB_NAME ), name );
+ if ( KErrNotFound != name.Find( iNapName ) )
+ {
+ view->ReadUintL( TPtrC( COMMDB_ID ), idNum );
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::FindAccessPointIdL IAP found id=%d" ), idNum );
+#endif
+ }
+ result = view->GotoNextRecord();
+ }
+#ifdef _DEBUG
+ CXdmProvAdapter::WriteToLog( _L8( "CXdmProvItem::FindAccessPointIdL IAP using id=%d" ), idNum );
+#endif
+ CleanupStack::PopAndDestroy( 2, commsDb ); // >>> view, commsDb
+ TBuf<KXdmProvIdLength> id;
+ id.AppendNum( idNum, EDecimal );
+ delete iNapId;
+ iNapId = NULL;
+ iNapId = id.AllocL();
+ }
+
+// -----------------------------------------------------------------------------
+// CXdmProvItem::CheckExistingNamesL()
+// -----------------------------------------------------------------------------
+//
+void CXdmProvItem::CheckExistingNamesL( )
+ {
+ TBool ready( EFalse );
+ RArray<TInt> settingIds;
+ CleanupClosePushL( settingIds ); // << settingIds
+ CDesCArray* settingNames = TXdmSettingsApi::CollectionNamesLC( settingIds ); // << settingNames
+ TInt index( 0 );
+ while ( !ready )
+ {
+ TBool found ( EFalse );
+ TInt count = settingNames->MdcaCount();
+ TBuf<KXdmProvBufLength> tempName;
+ tempName.Copy( iAppName );
+ if ( index > 0 )
+ {
+ tempName.Append( KXdmProvStartBracket );
+ tempName.AppendNumFixedWidth( index, EDecimal, 2 );
+ tempName.Append( KXdmProvCloseBracket );
+ }
+ for ( TInt i(0); i < count && !found; i++ )
+ {
+ if ( !settingNames->MdcaPoint(i).CompareF( tempName ) )
+ {
+ found = ETrue;
+ index++;
+ }
+ }
+ if ( !found )
+ {
+ ready = ETrue;
+ iAppName.Set( tempName );
+ }
+ }
+ // only number used in next function, type of RArray
+ CleanupStack::PopAndDestroy( 2 ); // >>> settingNames, settingIds
+ }
+
+
+// End of File
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmSettingsApi/BWINSCW/XdmSettingsApiU.DEF Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,20 @@
+EXPORTS
+ ??0CXdmSettingsCollection@@QAE@XZ @ 1 NONAME ; CXdmSettingsCollection::CXdmSettingsCollection(void)
+ ??1CXdmSettingsCollection@@UAE@XZ @ 2 NONAME ; CXdmSettingsCollection::~CXdmSettingsCollection(void)
+ ??1CXdmSettingsProperty@@UAE@XZ @ 3 NONAME ; CXdmSettingsProperty::~CXdmSettingsProperty(void)
+ ?AppendL@CXdmSettingsCollection@@QAEXABVTDesC16@@W4TXdmSettingsProperty@@@Z @ 4 NONAME ; void CXdmSettingsCollection::AppendL(class TDesC16 const &, enum TXdmSettingsProperty)
+ ?CollectionNamesLC@TXdmSettingsApi@@SAPAVCDesC16Array@@AAV?$RArray@H@@@Z @ 5 NONAME ; class CDesC16Array * TXdmSettingsApi::CollectionNamesLC(class RArray<int> &)
+ ?Count@CXdmSettingsCollection@@QBEHXZ @ 6 NONAME ; int CXdmSettingsCollection::Count(void) const
+ ?CreateCollectionL@TXdmSettingsApi@@SAHABVCXdmSettingsCollection@@@Z @ 7 NONAME ; int TXdmSettingsApi::CreateCollectionL(class CXdmSettingsCollection const &)
+ ?CreatePropertyL@TXdmSettingsApi@@SAXHABVTDesC16@@W4TXdmSettingsProperty@@@Z @ 8 NONAME ; void TXdmSettingsApi::CreatePropertyL(int, class TDesC16 const &, enum TXdmSettingsProperty)
+ ?Property@CXdmSettingsCollection@@QBE?AVTPtrC16@@W4TXdmSettingsProperty@@@Z @ 9 NONAME ; class TPtrC16 CXdmSettingsCollection::Property(enum TXdmSettingsProperty) const
+ ?Property@CXdmSettingsCollection@@QBEABVCXdmSettingsProperty@@H@Z @ 10 NONAME ; class CXdmSettingsProperty const & CXdmSettingsCollection::Property(int) const
+ ?PropertyL@TXdmSettingsApi@@SAPAVHBufC16@@HW4TXdmSettingsProperty@@@Z @ 11 NONAME ; class HBufC16 * TXdmSettingsApi::PropertyL(int, enum TXdmSettingsProperty)
+ ?PropertyName@CXdmSettingsProperty@@QBE?AW4TXdmSettingsProperty@@XZ @ 12 NONAME ; enum TXdmSettingsProperty CXdmSettingsProperty::PropertyName(void) const
+ ?PropertyValue@CXdmSettingsProperty@@QBE?AVTPtrC16@@XZ @ 13 NONAME ; class TPtrC16 CXdmSettingsProperty::PropertyValue(void) const
+ ?RemoveCollectionL@TXdmSettingsApi@@SAXH@Z @ 14 NONAME ; void TXdmSettingsApi::RemoveCollectionL(int)
+ ?RemoveL@CXdmSettingsCollection@@QAEXW4TXdmSettingsProperty@@@Z @ 15 NONAME ; void CXdmSettingsCollection::RemoveL(enum TXdmSettingsProperty)
+ ?RemovePropertyL@TXdmSettingsApi@@SAXHW4TXdmSettingsProperty@@@Z @ 16 NONAME ; void TXdmSettingsApi::RemovePropertyL(int, enum TXdmSettingsProperty)
+ ?SettingsCollectionL@TXdmSettingsApi@@SAPAVCXdmSettingsCollection@@H@Z @ 17 NONAME ; class CXdmSettingsCollection * TXdmSettingsApi::SettingsCollectionL(int)
+ ?UpdatePropertyL@TXdmSettingsApi@@SAXHABVTDesC16@@W4TXdmSettingsProperty@@@Z @ 18 NONAME ; void TXdmSettingsApi::UpdatePropertyL(int, class TDesC16 const &, enum TXdmSettingsProperty)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmSettingsApi/eabi/XdmSettingsApiU.DEF Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,24 @@
+EXPORTS
+ _ZN15TXdmSettingsApi15CreatePropertyLEiRK7TDesC1620TXdmSettingsProperty @ 1 NONAME
+ _ZN15TXdmSettingsApi15RemovePropertyLEi20TXdmSettingsProperty @ 2 NONAME
+ _ZN15TXdmSettingsApi15UpdatePropertyLEiRK7TDesC1620TXdmSettingsProperty @ 3 NONAME
+ _ZN15TXdmSettingsApi17CollectionNamesLCER6RArrayIiE @ 4 NONAME
+ _ZN15TXdmSettingsApi17CreateCollectionLERK22CXdmSettingsCollection @ 5 NONAME
+ _ZN15TXdmSettingsApi17RemoveCollectionLEi @ 6 NONAME
+ _ZN15TXdmSettingsApi19SettingsCollectionLEi @ 7 NONAME
+ _ZN15TXdmSettingsApi9PropertyLEi20TXdmSettingsProperty @ 8 NONAME
+ _ZN22CXdmSettingsCollection7AppendLERK7TDesC1620TXdmSettingsProperty @ 9 NONAME
+ _ZN22CXdmSettingsCollection7RemoveLE20TXdmSettingsProperty @ 10 NONAME
+ _ZN22CXdmSettingsCollectionC1Ev @ 11 NONAME
+ _ZN22CXdmSettingsCollectionC2Ev @ 12 NONAME
+ _ZN22CXdmSettingsCollectionD0Ev @ 13 NONAME
+ _ZN22CXdmSettingsCollectionD1Ev @ 14 NONAME
+ _ZN22CXdmSettingsCollectionD2Ev @ 15 NONAME
+ _ZNK20CXdmSettingsProperty12PropertyNameEv @ 16 NONAME
+ _ZNK20CXdmSettingsProperty13PropertyValueEv @ 17 NONAME
+ _ZNK22CXdmSettingsCollection5CountEv @ 18 NONAME
+ _ZNK22CXdmSettingsCollection8PropertyE20TXdmSettingsProperty @ 19 NONAME
+ _ZNK22CXdmSettingsCollection8PropertyEi @ 20 NONAME
+ _ZTI22CXdmSettingsCollection @ 21 NONAME ; #<TI>#
+ _ZTV22CXdmSettingsCollection @ 22 NONAME ; #<VT>#
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmSettingsApi/group/XdmSettingsApi.mmp Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: XDM Engine settings API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+TARGET xdmsettingsapi.dll
+UID 0x1000008d 0x010000DC
+CAPABILITY CAP_GENERAL_DLL
+VENDORID VID_DEFAULT
+TARGETTYPE DLL
+
+SOURCEPATH ../src
+
+SOURCE XdmSettingsApi.cpp
+SOURCE XdmSettingsProperty.cpp
+SOURCE XdmSettingsCollection.cpp
+
+USERINCLUDE ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY bafl.lib
+LIBRARY euser.lib
+LIBRARY centralrepository.lib
+LIBRARY flogger.lib
+
+#if defined( ARMCC )
+DEFFILE ../eabi/
+#elif defined ( WINSCW )
+deffile ../BWINSCW/
+#elif defined (WINS )
+deffile ../BWINS/
+#endif
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmSettingsApi/group/bld.inf Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: XDM Engine build file
+*
+*/
+
+
+
+PRJ_PLATFORMS
+//--------------------
+DEFAULT
+
+//--------------------
+PRJ_MMPFILES
+//--------------------
+XdmSettingsApi.mmp
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmSettingsApi/src/XdmSettingsApi.cpp Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,525 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: XDM Engine settings API
+*
+*/
+
+
+
+#include <flogger.h>
+#include <centralrepository.h>
+#include "XdmSettingsApi.h"
+#include "XdmSettingsProperty.h"
+#include "XdmSettingsCollection.h"
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::CreateCollectionL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TXdmSettingsApi::CreateCollectionL( const CXdmSettingsCollection& aCollection )
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( "TXdmSettingsApi::CreateCollectionL()" ) );
+ #endif
+ TInt error = KErrArgument;
+ CRepository* repository = CRepository::NewL( KCRUidXdmEngine );
+ CleanupStack::PushL( repository );
+ TInt row = LastRow( repository );
+ TInt count = aCollection.Count();
+ __ASSERT_DEBUG( count > 0, User::Leave( KErrArgument ) );
+ for( TInt i = 0;i < count;i++ )
+ {
+ const CXdmSettingsProperty& prop = aCollection.Property( i );
+ TInt32 column = prop.PropertyName();
+ //Don't let the client set the settings ID, since
+ //this might create conflicting IDs in the repository
+ if( column != KXdmSettingsId )
+ {
+ //Now merge row & column
+ TInt32 newKey = ( row * 0x100 ) | column;
+ error = repository->Create( newKey, prop.PropertyValue() );
+ #ifdef _DEBUG
+ HBufC8* buf = HBufC8::NewLC( prop.PropertyValue().Length() );
+ buf->Des().Copy( prop.PropertyValue() );
+ TPtrC8 des( buf->Des() );
+ WriteToLog( _L8( " New key [0x%08x] created - Name: %d Value: %S" ), newKey, column, &des );
+ CleanupStack::PopAndDestroy(); //buf
+ #endif
+ }
+ }
+ error = CreateUniqueIdL( repository, row );
+ #ifdef _DEBUG
+ WriteToLog( _L8( " New settings ID created - ID: %d Error: %d" ), row, error );
+ #endif
+ CleanupStack::PopAndDestroy(); //repository
+ return error == KErrNone ? row : error;
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::RemoveCollectionL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void TXdmSettingsApi::RemoveCollectionL( TInt aSettingsId )
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( "TXdmSettingsApi::RemoveCollectionL() - ID: %d" ), aSettingsId );
+ #endif
+ CRepository* repository = CRepository::NewL( KCRUidXdmEngine );
+ CleanupStack::PushL( repository );
+ TInt row = FindRowL( aSettingsId, repository );
+ if( row >= KErrNone )
+ {
+ TInt32 key = -1;
+ TInt error = KErrNone;
+ for( TInt i = 0;i < KXdmPropertyCount;i++ )
+ {
+ key = ( row * 0x100 ) | i;
+ error = repository->Delete( key );
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Key %x deleted - Error: %d" ), key, error );
+ #endif
+ }
+ }
+ else User::Leave( KErrNotFound );
+ CleanupStack::PopAndDestroy();
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::CreatePropertyL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void TXdmSettingsApi::CreatePropertyL( TInt aSettingsId,
+ const TDesC& aPropertyValue,
+ TXdmSettingsProperty aPropertyName )
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( "TXdmSettingsApi::UpdatePropertyL()" ) );
+ WriteToLog( _L8( " Property: %d" ), aPropertyName );
+ WriteToLog( _L8( " Property set ID: %d" ), aSettingsId );
+ WriteToLog( _L8( " Property value: %S" ), &aPropertyValue );
+ #endif
+ TInt error = KErrNotFound;
+ CRepository* repository = CRepository::NewL( KCRUidXdmEngine );
+ CleanupStack::PushL( repository );
+ TInt row = FindRowL( aSettingsId, repository );
+ if( row >= 0 )
+ {
+ TInt32 key = ( row * 0x100 ) | aPropertyName;
+ error = repository->Create( key, aPropertyValue );
+ if( error != KErrNone )
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Create() failed with %d" ), error );
+ #endif
+ User::Leave( error );
+ }
+ }
+ else //No keys or too many
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Property set not found - Error: %d" ), row );
+ #endif
+ User::Leave( error );
+ }
+ CleanupStack::PopAndDestroy(); //repository
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::UpdatePropertyL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void TXdmSettingsApi::UpdatePropertyL( TInt aSettingsId,
+ const TDesC& aPropertyValue,
+ TXdmSettingsProperty aPropertyName )
+
+ {
+ #ifdef _DEBUG
+ HBufC8* value = HBufC8::NewLC( aPropertyValue.Length() );
+ TPtr8 prop( value->Des() );
+ prop.Copy( aPropertyValue );
+ WriteToLog( _L8( "TXdmSettingsApi::UpdatePropertyL()" ) );
+ WriteToLog( _L8( " Settings ID: %d" ), aSettingsId );
+ WriteToLog( _L8( " Property name: %d" ), aPropertyName );
+ WriteToLog( _L8( " Property value: %S" ), &prop );
+ CleanupStack::PopAndDestroy(); //value
+ #endif
+ TInt error = KErrAlreadyExists;
+ CRepository* repository = CRepository::NewL( KCRUidXdmEngine );
+ CleanupStack::PushL( repository );
+ RArray<TUint32> keys = FindByIdL( aSettingsId, repository );
+ CleanupClosePushL( keys );
+ TInt count = keys.Count();
+ if( count == 1 )
+ {
+ TInt32 row = ( keys[0] & 0xFFFFFF00 ) / 0x100;
+ TInt32 key = ( row * 0x100 ) | aPropertyName;
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Key to update: 0x%08x" ), key );
+ #endif
+ error = repository->Set( key, aPropertyValue );
+ if( error != KErrNone )
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Set() failed with %d, try Create()" ), error );
+ #endif
+ error = repository->Create( key, aPropertyValue );
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Create() completed with %d" ), error );
+ #endif
+ }
+ }
+ else //No keys or too many
+ {
+ #ifdef _DEBUG
+ TBuf<32> errBuf;
+ count > 0 ? errBuf.Append( _L( "Too many results" ) ) :
+ errBuf.Append( _L( "No results found" ) );
+ WriteToLog( _L8( " * Error - %S: %d" ), &errBuf, count );
+ #endif
+ TInt error = count > 0 ? KErrGeneral : KErrNotFound;
+ User::Leave( error );
+ }
+ CleanupStack::PopAndDestroy( 2 ); //keys, repository
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::RemovePropertyL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void TXdmSettingsApi::RemovePropertyL( TInt aSettingsId,
+ TXdmSettingsProperty aPropertyName )
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( "TXdmSettingsApi::RemovePropertyL() - ID: %d" ), aSettingsId );
+ #endif
+ TInt error = KErrNotFound;
+ CRepository* repository = CRepository::NewL( KCRUidXdmEngine );
+ CleanupStack::PushL( repository );
+ TInt row = FindRowL( aSettingsId, repository );
+ if( row >= 0 )
+ {
+ TInt32 key = ( row * 0x100 ) | aPropertyName;
+ error = repository->Delete( key );
+ if( error != KErrNone )
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Delete() failed with %d" ), error );
+ #endif
+ User::Leave( error );
+ }
+ }
+ else //No keys or too many
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Property set not found - Error: %d" ), row );
+ #endif
+ User::Leave( error );
+ }
+ CleanupStack::PopAndDestroy(); //repository
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::CreateUniqueIdL
+//
+// ---------------------------------------------------------
+//
+TInt TXdmSettingsApi::CreateUniqueIdL( CRepository* aRepository, TInt aRow )
+ {
+ TBuf<10> numBuf;
+ numBuf.Zero();
+ numBuf.AppendNum( aRow );
+ TInt error = KErrNone;
+ RArray<TUint32> keys;
+ CleanupClosePushL( keys );
+ const TInt32 KPartialIdMask = 0x000000FF;
+ error = aRepository->FindEqL( KXdmSettingsId, KPartialIdMask, numBuf, keys );
+ __ASSERT_DEBUG( error == KErrNotFound, User::Panic( _L( "CXdmSettingsApi" ), 1 ) );
+ TInt32 newKey = ( aRow * 0x100 ) | KXdmSettingsId;
+ error = aRepository->Create( newKey, numBuf );
+ CleanupStack::PopAndDestroy(); //keys
+ return error;
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::LastRow
+//
+// ---------------------------------------------------------
+//
+TInt TXdmSettingsApi::LastRow( CRepository* aRepository )
+ {
+ RArray<TUint32> keys;
+ CleanupClosePushL( keys );
+ const TInt32 KPartialNameMask = 0x000000FF;
+ TInt error = aRepository->FindL( KXdmSettingsId, KPartialNameMask, keys );
+ TInt count = keys.Count();
+ //Must check for existing IDs
+ if( count > 0 )
+ {
+ TInt exists = FindRowL( count, aRepository );
+ while( exists != KErrNotFound )
+ {
+ count++;
+ exists = FindRowL( count, aRepository );
+ }
+ }
+ CleanupStack::PopAndDestroy(); //keys
+ return count;
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::FindRowL
+//
+// ---------------------------------------------------------
+//
+TInt TXdmSettingsApi::FindRowL( TInt aSettingsId,
+ CRepository* aRepository )
+ {
+ TUint32 rowNum = 0;
+ RArray<TUint32> keys;
+ CleanupClosePushL( keys );
+ TBuf<10> numBuf;
+ numBuf.AppendNum( aSettingsId );
+ const TInt32 KPartialNameMask = 0x000000FF;
+ TInt error = aRepository->FindEqL( KXdmSettingsId, KPartialNameMask, numBuf, keys );
+ if( error == KErrNone && keys.Count() == 1 )
+ {
+ //Extract row part from the key
+ TInt row = keys[0] & 0xFFFFFF00;
+ //e.g. 0x00000400 => 0x00000004
+ rowNum = row / 0x100;
+ }
+ CleanupStack::PopAndDestroy(); //keys
+ return error == KErrNone ? rowNum : error;
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::FindByIdL
+//
+// ---------------------------------------------------------
+//
+RArray<TUint32> TXdmSettingsApi::FindByIdL( TInt aSettingsId, CRepository* aRepository )
+ {
+ const TInt32 KPartialKeyMask = 0x000000FF;
+ RArray<TUint32> keys;
+ CleanupClosePushL( keys );
+ TBuf<15> numBuf;
+ numBuf.AppendNum( aSettingsId );
+ TInt error = aRepository->FindEqL( KXdmSettingsId, KPartialKeyMask, numBuf, keys );
+ CleanupStack::Pop(); //keys
+ return keys;
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::FindByTypeL
+//
+// ---------------------------------------------------------
+//
+RArray<TUint32> TXdmSettingsApi::FindByTypeL( CRepository* aRepository,
+ TXdmSettingsProperty aSingleProp )
+ {
+ const TInt32 KPartialKeyMask = 0x000000FF;
+ RArray<TUint32> keys;
+ CleanupClosePushL( keys );
+ TInt error = aRepository->FindL( aSingleProp, KPartialKeyMask, keys );
+ CleanupStack::Pop(); //keys
+ return keys;
+ }
+
+// ----------------------------------------------------------
+// TXdmSettingsApi::WriteToLog
+//
+// ----------------------------------------------------------
+//
+void TXdmSettingsApi::WriteToLog( TRefByValue<const TDesC8> aFmt,... )
+ {
+ VA_LIST list;
+ VA_START( list, aFmt );
+ TBuf8<KXdmSettingsLogBufferMaxSize> buf;
+ buf.FormatList( aFmt, list );
+ RFileLogger::Write( KXdmSettingsLogDir, KXdmSettingsLogFile,
+ EFileLoggingModeAppend, buf );
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::CollectionNamesL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CDesCArray* TXdmSettingsApi::CollectionNamesLC( RArray<TInt>& aSettingIds )
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( "TXdmSettingsApi::CollectionNamesL()" ) );
+ #endif
+ TInt error = KErrNone;
+ CDesCArrayFlat* propertySet = new ( ELeave ) CDesCArrayFlat( 10 );
+ CleanupStack::PushL( propertySet );
+ CRepository* repository = CRepository::NewL( KCRUidXdmEngine );
+ CleanupStack::PushL( repository );
+ RArray<TUint32> nameKeys = FindByTypeL( repository, EXdmPropName );
+ CleanupClosePushL( nameKeys );
+ RArray<TUint32> idKeys = FindByTypeL( repository, EXdmPropSettingsId );
+ CleanupClosePushL( idKeys );
+ #ifdef _DEBUG
+ WriteToLog( _L8( " ID key count: %d" ), idKeys.Count() );
+ WriteToLog( _L8( " Name key count: %d" ), nameKeys.Count() );
+ #endif
+ TInt count = nameKeys.Count();
+ if( count > 0 )
+ {
+ TInt numId = 0;
+ HBufC* name = NULL;
+ TBuf<10> identifier;
+ for( TInt i = 0;i < count;i++ )
+ {
+ identifier.Zero();
+ name = HBufC::NewLC( NCentralRepositoryConstants::KMaxUnicodeStringLength );
+ TPtr desc( name->Des());
+ error = repository->Get( nameKeys[i], desc );
+ error = repository->Get( idKeys[i], identifier );
+ if( error == KErrNone && desc.Length() > 0 && identifier.Length() > 0 )
+ {
+ #ifdef _DEBUG
+ HBufC8* eightName = HBufC8::NewLC( desc.Length() );
+ TPtr8 eightDesc( eightName->Des() );
+ eightDesc.Copy( desc );
+ WriteToLog( _L8( " Collection no. %d - Name: %S ID: %S" ), i, &eightDesc, &identifier );
+ CleanupStack::PopAndDestroy(); //eightName
+ #endif
+ propertySet->AppendL( desc );
+ TLex id( identifier );
+ error = id.Val( numId );
+ aSettingIds.Append( error == KErrNone ? numId : error );
+ }
+ else
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Fetching of the name no. %d failed with: %d" ), i, error );
+ #endif
+ }
+ CleanupStack::PopAndDestroy(); //name
+ }
+ }
+ CleanupStack::PopAndDestroy( 3 ); //idKeys, nameKeys, repository
+ return propertySet;
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::SettingsCollectionLC
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CXdmSettingsCollection* TXdmSettingsApi::SettingsCollectionL( TInt aSettingsId )
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( "TXdmSettingsApi::SettingsCollectionL() - ID: %d" ), aSettingsId );
+ #endif
+ CXdmSettingsCollection* collection = NULL;
+ CRepository* repository = CRepository::NewL( KCRUidXdmEngine );
+ CleanupStack::PushL( repository );
+ TInt row = FindRowL( aSettingsId, repository );
+ if( row >= KErrNone )
+ {
+ TInt32 key = -1;
+ HBufC* buf = NULL;
+ TInt error = KErrNone;
+ collection = new ( ELeave ) CXdmSettingsCollection();
+ CleanupStack::PushL( collection );
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Data in the specified colletion: " ) );
+ #endif
+ for( TInt i = 0;i < KXdmPropertyCount;i++ )
+ {
+ key = ( row * 0x100 ) | i;
+ buf = HBufC::NewLC( NCentralRepositoryConstants::KMaxUnicodeStringLength );
+ TPtr desc( buf->Des() );
+ error = repository->Get( key, desc );
+ if( error == KErrNone )
+ {
+ #ifdef _DEBUG
+ HBufC8* eight = HBufC8::NewLC( desc.Length() );
+ TPtr8 eightDesc( eight->Des() );
+ eightDesc.Copy( desc );
+ WriteToLog( _L8( " Property %d [0x%08x]: %S" ), i, key, &eightDesc );
+ CleanupStack::PopAndDestroy(); //eight
+ #endif
+ collection->AppendL( desc, ( TXdmSettingsProperty )i );
+ }
+ CleanupStack::PopAndDestroy(); //buf
+ }
+ CleanupStack::Pop(); //collection
+ }
+ else
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Could not find the collection, leaves with KErrNotFound" ) );
+ #endif
+ User::Leave( KErrNotFound );
+ }
+ CleanupStack::PopAndDestroy(); //repository
+ return collection;
+ }
+
+// ---------------------------------------------------------
+// TXdmSettingsApi::PropertyL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C HBufC* TXdmSettingsApi::PropertyL( TInt aSettingsId,
+ TXdmSettingsProperty aSingleProp )
+ {
+ #ifdef _DEBUG
+ WriteToLog( _L8( "TXdmSettingsApi::PropertyLC()" ) );
+ WriteToLog( _L8( " Property: %d" ), &aSingleProp );
+ WriteToLog( _L8( " Property set ID: %d" ), aSettingsId );
+ #endif
+ HBufC* buf = NULL;
+ TInt error = KErrGeneral;
+ CRepository* repository = CRepository::NewL( KCRUidXdmEngine );
+ CleanupStack::PushL( repository );
+ RArray<TUint32> keys = FindByIdL( aSettingsId, repository );
+ CleanupClosePushL( keys );
+ TInt count = keys.Count();
+ if( count == 1 ) //This is the normal case
+ {
+ TInt32 row = ( keys[0] & 0xFFFFFF00 ) / 0x100;
+ TInt32 key = ( row * 0x100 ) | aSingleProp;
+ buf = HBufC::NewL( NCentralRepositoryConstants::KMaxUnicodeStringLength );
+ TPtr desc( buf->Des() );
+ error = repository->Get( key, desc );
+ #ifdef _DEBUG
+ WriteToLog( _L8( " Error: %d" ), error );
+ #endif
+ }
+ else //No keys or too many
+ {
+ #ifdef _DEBUG
+ TBuf8<32> errBuf;
+ count > 0 ? errBuf.Append( _L8( "Too many results" ) ) :
+ errBuf.Append( _L8( "No results found" ) );
+ WriteToLog( _L8( " * Error - %S: %d" ), &errBuf, count );
+ #endif
+ error = count > 0 ? KErrGeneral : KErrNotFound;
+ User::Leave( error );
+ }
+ CleanupStack::PopAndDestroy( 2 ); //keys, repository
+ return buf;
+ }
+
+// End of File
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmSettingsApi/src/XdmSettingsCollection.cpp Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: XDM Engine settings collection
+*
+*/
+
+
+
+#include "XdmSettingsApi.h"
+#include "XdmSettingsProperty.h"
+#include "XdmSettingsCollection.h"
+
+// ---------------------------------------------------------
+// CXdmSettingsCollection::SetPropCollectionL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CXdmSettingsCollection::CXdmSettingsCollection()
+ {
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsCollection::~CXdmSettingsCollection
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CXdmSettingsCollection::~CXdmSettingsCollection()
+ {
+ iPropCollection.ResetAndDestroy();
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsCollection::Property
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TPtrC CXdmSettingsCollection::Property( TXdmSettingsProperty aProperty ) const
+ {
+ CXdmSettingsProperty* property = Find( aProperty );
+ return property ? property->PropertyValue(): TPtrC();
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsCollection::Property
+//
+// ---------------------------------------------------------
+//
+EXPORT_C const CXdmSettingsProperty& CXdmSettingsCollection::Property( TInt aIndex ) const
+ {
+ __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iPropCollection.Count(),
+ User::Panic( _L( "CXdmSettingsCollection" ), 0 ) );
+ return *iPropCollection[aIndex];
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsCollection::Count
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CXdmSettingsCollection::Count() const
+ {
+ return iPropCollection.Count();
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsCollection::AppendL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CXdmSettingsCollection::AppendL( const TDesC& aPropertyValue,
+ TXdmSettingsProperty aPropertyName )
+ {
+ CXdmSettingsProperty* prop = CXdmSettingsProperty::NewL( aPropertyValue, aPropertyName );
+ CleanupStack::PushL( prop );
+ User::LeaveIfError( iPropCollection.Append( prop ) );
+ CleanupStack::Pop(); //property
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsCollection::RemoveL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CXdmSettingsCollection::RemoveL( TXdmSettingsProperty aPropertyName )
+ {
+ CXdmSettingsProperty* property = Find( aPropertyName );
+ if( property )
+ {
+ TInt index = iPropCollection.Find( property );
+ iPropCollection.Remove( index );
+ delete property;
+ property = NULL;
+ }
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsCollection::Find
+//
+// ---------------------------------------------------------
+//
+CXdmSettingsProperty* CXdmSettingsCollection::Find( TXdmSettingsProperty aProperty ) const
+ {
+ TBool found = EFalse;
+ CXdmSettingsProperty* property = NULL;
+ const TInt count = iPropCollection.Count();
+ for( TInt i = 0;!found && i < count;i++ )
+ {
+ if( iPropCollection[i]->PropertyName() == aProperty )
+ {
+ found = ETrue;
+ property = iPropCollection[i];
+ }
+ }
+ return property;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/XdmSettingsApi/src/XdmSettingsProperty.cpp Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: XDM Engine settings property
+*
+*/
+
+
+
+#include "XdmSettingsApi.h"
+#include "XdmSettingsProperty.h"
+
+// ---------------------------------------------------------
+// CXdmSettingsProperty::SetPropCollectionL
+//
+// ---------------------------------------------------------
+//
+CXdmSettingsProperty::CXdmSettingsProperty( TXdmSettingsProperty aPropertyName ) :
+ iPropertyName( aPropertyName )
+ {
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsProperty::ConstructL
+//
+// ---------------------------------------------------------
+//
+void CXdmSettingsProperty::ConstructL( const TDesC& aPropertyValue )
+ {
+ iPropertyValue = HBufC::NewL( aPropertyValue.Length() );
+ iPropertyValue->Des().Copy( aPropertyValue );
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsProperty::SetPropCollectionL
+//
+// ---------------------------------------------------------
+//
+CXdmSettingsProperty::~CXdmSettingsProperty()
+ {
+ delete iPropertyValue;
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsProperty::SetPropCollectionL
+//
+// ---------------------------------------------------------
+//
+CXdmSettingsProperty* CXdmSettingsProperty::NewL( const TDesC& aPropertyValue,
+ TXdmSettingsProperty aPropertyName )
+ {
+ CXdmSettingsProperty* self = new ( ELeave ) CXdmSettingsProperty( aPropertyName );
+ CleanupStack::PushL( self );
+ self->ConstructL( aPropertyValue );
+ CleanupStack::Pop();
+ return self;
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsProperty::SetPropertyL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TXdmSettingsProperty CXdmSettingsProperty::PropertyName() const
+ {
+ return iPropertyName;
+ }
+
+// ---------------------------------------------------------
+// CXdmSettingsProperty::SetPropertyL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TPtrC CXdmSettingsProperty::PropertyValue() const
+ {
+ return iPropertyValue != NULL ? iPropertyValue->Des() : TPtrC();
+ }
+
+
+
+
+// End of File
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/group/bld.inf Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: XDM Engine build file
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+//--------------------
+PRJ_PLATFORMS
+//--------------------
+DEFAULT
+
+//--------------------
+PRJ_EXPORTS
+//--------------------
+
+// LOC (note: This would be better in XdmProvisioning's bld.inf, but since it is not used, it is here.)
+../XdmProvisioning/loc/xdmprovisioningadapter.loc MW_LAYER_LOC_EXPORT_PATH(xdmprovisioningadapter.loc)
+//--------------------
+PRJ_MMPFILES
+//--------------------
+
+../XdmSettingsApi/group/XdmSettingsApi.mmp
+../XdmProvisioning/group/xdmprovisioning.mmp
+../XdmDeviceManagement/group/xdmdevicemanagementadapter.mmp
+
+
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/rom/XdmEngine.iby Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: XDM Engine rom file
+*
+*/
+
+
+
+
+#ifndef __XDMENGINE_IBY__
+#define __XDMENGINE_IBY__
+
+#ifdef __XDM
+ file=ABI_DIR\BUILD_DIR\XdmSettingsApi.dll SHARED_LIB_DIR\XdmSettingsApi.dll
+ ECOM_PLUGIN( XdmDeviceManagementAdapter.dll, 10275112.rsc)
+ ECOM_PLUGIN( XdmProvisioning.dll, 1028237A.rsc)
+#endif //__XDM
+
+#endif //__XDMENGINE_IBY__
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/XDMEngine/rom/XdmEngineResources.iby Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Application resource files for ROM image compilation.
+*
+*/
+
+
+
+#ifndef __XDMENGINE_RESOURCES_IBY__
+#define __XDMENGINE_RESOURCES_IBY__
+
+//
+// Settings provisioning adapter plugin resources
+//
+data=DATAZ_\RESOURCE_FILES_DIR\XdmProvisioningTexts.RSC RESOURCE_FILES_DIR\XdmProvisioningTexts.RSC
+
+#endif //__XDMENGINE_RESOURCES_IBY__
+
+// End of file
--- a/group/bld.inf Wed Aug 18 10:10:28 2010 +0300
+++ b/group/bld.inf Thu Sep 02 20:50:11 2010 +0300
@@ -18,3 +18,5 @@
#include "../pressrv_plat/group/bld.inf"
+#include "../XDMEngine/group/bld.inf"
+//#include "../simpleengine/group/bld.inf"
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0">
+ <package id="legacypresence" name="Legacy Presence Services" levels="engine fw ui">
+ <collection id="pressrv_plat" name="Legacy Presence Services Platform Interfaces" level="ui">
+ <component id="presence_list_api" name="Presence List API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/presence_list_api/presence_list_api.metaxml"/>
+ <unit bldFile="pressrv_plat/presence_list_api/group"/>
+ </component>
+ <component id="watcher_info_api" name="Watcher Info API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/watcher_info_api/watcher_info_api.metaxml"/>
+ <unit bldFile="pressrv_plat/watcher_info_api/group"/>
+ </component>
+ <component id="simple_documents_api" name="SIMPLE Documents API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/simple_documents_api/simple_documents_api.metaxml"/>
+ <unit bldFile="pressrv_plat/simple_documents_api/group"/>
+ </component>
+ <component id="authorization_api" name="Authorization API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/authorization_api/authorization_api.metaxml"/>
+ <unit bldFile="pressrv_plat/authorization_api/group"/>
+ </component>
+ <component id="xdm_protocol_plugin_api" name="XDM Protocol Plug-in API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/xdm_protocol_plugin_api/xdm_protocol_plugin_api.metaxml"/>
+ <unit bldFile="pressrv_plat/xdm_protocol_plugin_api/group"/>
+ </component>
+ <component id="watcher_api" name="Watcher API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/watcher_api/watcher_api.metaxml"/>
+ <unit bldFile="pressrv_plat/watcher_api/group"/>
+ </component>
+ <component id="xdm_api" name="XDM API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/xdm_api/xdm_api.metaxml"/>
+ <unit bldFile="pressrv_plat/xdm_api/group"/>
+ </component>
+ <component id="registration_api" name="Registration API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/registration_api/registration_api.metaxml"/>
+ <unit bldFile="pressrv_plat/registration_api/group"/>
+ </component>
+ <component id="publisher_api" name="Publisher API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/publisher_api/publisher_api.metaxml"/>
+ <unit bldFile="pressrv_plat/publisher_api/group"/>
+ </component>
+ <component id="messaging_connection_manager_api" name="Messaging Connection Manager API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/messaging_connection_manager_api/messaging_connection_manager_api.metaxml"/>
+ <unit bldFile="pressrv_plat/messaging_connection_manager_api/group"/>
+ </component>
+ <component id="xdm_settings_api" name="XDM Settings API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/xdm_settings_api/xdm_settings_api.metaxml"/>
+ <unit bldFile="pressrv_plat/xdm_settings_api/group"/>
+ </component>
+ <component id="simple_settings_api" name="SIMPLE Settings API" class="api" filter="s60">
+ <meta rel="Api" href="pressrv_plat/simple_settings_api/simple_settings_api.metaxml"/>
+ <unit bldFile="pressrv_plat/simple_settings_api/group"/>
+ </component>
+ <component id="simple_instant_msg_api" name="Simple Instant Msg API" class="api" filter="s60">
+ <unit bldFile="pressrv_plat/simple_instant_msg_api/group"/>
+ </component>
+ </collection>
+ </package>
+</SystemDefinition>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml Thu Sep 02 20:50:11 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="mw"/>