williamr@4: /* williamr@4: * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). williamr@4: * All rights reserved. williamr@4: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@4: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: * williamr@4: * Initial Contributors: williamr@4: * Nokia Corporation - initial contribution. williamr@4: * williamr@4: * Contributors: williamr@4: * williamr@4: * Description: Definition of dm constants/exported methods williamr@4: * This is part of remotemgmt_plat. williamr@4: */ williamr@4: williamr@4: williamr@4: #ifndef __SMLDMADAPTER_H__ williamr@4: #define __SMLDMADAPTER_H__ williamr@4: williamr@4: #include williamr@4: #include williamr@4: williamr@4: class MSmlDmDDFObject; williamr@4: class MSmlDmCallback; williamr@4: class RWriteStream; williamr@4: williamr@4: /** ECOM interface uid for DM plugin adapters */ williamr@4: #define KSmlDMInterfaceUid 0x102018B4 williamr@4: williamr@4: /** Maximum length of a URI segment supported by the DM framework */ williamr@4: #define KSmlMaxURISegLen 32 williamr@4: williamr@4: struct TSmlDmMappingInfo williamr@4: /** williamr@4: The struct combines an URI segment to a LUID in a device. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: { williamr@4: /** The URI segment. When using this structure, a path of the URI segment must be known */ williamr@4: TBufC8 iURISeg; williamr@4: williamr@4: /** Local UID in the device */ williamr@4: TPtrC8 iURISegLUID; williamr@4: }; williamr@4: williamr@4: class MSmlDmAdapter williamr@4: /** williamr@4: Abstract Device Management adapter. Implementations of this interface are able to map settings williamr@4: in device stores to portions of the Device Management Tree. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: { williamr@4: public: //enums williamr@4: williamr@4: /** An enumeration of the error codes which may be returned by DM adapters. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: enum TError williamr@4: { williamr@4: /** The command was successful */ williamr@4: EOk = 0, williamr@4: /** The command failed because no setting exists in the store which corresponds to the williamr@4: URI or LUID passed to the adapter */ williamr@4: ENotFound, williamr@4: /** The command failed because the setting can't take the value being passed to the adapter */ williamr@4: EInvalidObject, williamr@4: /** The command failed because the setting already exists in the store */ williamr@4: EAlreadyExists, williamr@4: /** The command failed because the setting value is too large to be accommodated in the store */ williamr@4: ETooLargeObject, williamr@4: /** The command failed because the disk on which the device store resides is full */ williamr@4: EDiskFull, williamr@4: /** The command failed for an unspecified reason */ williamr@4: EError, williamr@4: /** The command could not be rolled back successfully */ williamr@4: ERollbackFailed, williamr@4: /** The command failed because the setting is being used by another client */ williamr@4: EObjectInUse, williamr@4: /** The command failed because no memory could be allocated */ williamr@4: ENoMemory, williamr@4: /** The command succesfully committed */ williamr@4: ECommitOK, williamr@4: /** The command rolled back succesfully */ williamr@4: ERollbackOK, williamr@4: /** The commit of command failed */ williamr@4: ECommitFailed, williamr@4: ENotAllowed, williamr@4: EAcceptedForProcessing, williamr@4: williamr@4: EExecSuccess, williamr@4: EExecClientError, williamr@4: EExecUserCancelled, williamr@4: EExecDownloadFailed, williamr@4: EExecAltDwnldAuthFail, williamr@4: EExecDownFailOOM, williamr@4: EExecInstallFailed, williamr@4: EExecInstallOOM, williamr@4: EExecPkgValidationFail, williamr@4: EExecRemoveFailed, williamr@4: EExecActivateFailed, williamr@4: EExecDeactivateFailed, williamr@4: EExecNotImplemented, williamr@4: EExecUndefError, williamr@4: EExecOperationReject, williamr@4: EExecAltDwnldSrvError, williamr@4: EExecAltDwnldSrvUnavailable williamr@4: williamr@4: }; williamr@4: williamr@4: public: williamr@4: /** williamr@4: The function returns current version of the DDF. williamr@4: By asking current DDF versions from adapters DM Module can control williamr@4: possible changes in the data structure and send the changed DDF williamr@4: description to a management server. williamr@4: This function is always called after DDFStructureL. williamr@4: @param aVersion DDF version of the adapter. (filled by the adapter) williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void DDFVersionL( CBufBase& aVersion ) = 0; williamr@4: williamr@4: /** williamr@4: The function for filling the DDF structure of the adapter williamr@4: This function is only called once, immediately after the adapter is created. williamr@4: @param aDDFObject Reference to root object. A DM adapter starts filling williamr@4: the data structure by calling AddChildObjectL to the root object and williamr@4: so describes the DDF of the adapter. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void DDFStructureL( MSmlDmDDFObject& aDDF ) = 0; williamr@4: williamr@4: /** williamr@4: The function creates new leaf objects, or replaces data in existing leaf williamr@4: objects. The information about the success of the command should be williamr@4: returned by calling SetStatusL function of MSmlDmCallback callback williamr@4: interface. This makes it possible to buffer the commands. However, all williamr@4: the status codes for buffered commands must be returned at the latest when williamr@4: the adapter's CompleteOutstandingCmdsL() is called. williamr@4: @param aURI URI of the object williamr@4: @param aLUID LUID of the object (if the adapter has earlier returned a williamr@4: LUID to the DM Module). For new objects, this is the LUID williamr@4: inherited through the parent node. williamr@4: @param aObject Data of the object. williamr@4: @param aType MIME type of the object williamr@4: @param aStatusRef Reference to correct command, i.e. this reference williamr@4: must be used when calling the SetStatusL of this command williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, williamr@4: const TDesC8& aObject, const TDesC8& aType, williamr@4: TInt aStatusRef ) = 0; williamr@4: williamr@4: /** williamr@4: The function creates new leaf objects, or replaces data in existing leaf williamr@4: objects, in the case where data is large enough to be streamed. The williamr@4: information about the success of the command should be returned by calling williamr@4: SetStatusL function of MSmlDmCallback callback interface. This makes it williamr@4: possible to buffer the commands. However, all the status codes for buffered williamr@4: commands must be returned at the latest when the CompleteOutstandingCmdsL() williamr@4: of adapter is called. williamr@4: @param aURI URI of the object williamr@4: @param aLUID LUID of the object (if the adapter has earlier returned a williamr@4: LUID to the DM Module). For new objects, this is the LUID williamr@4: inherited through the parent node. williamr@4: @param aStream Data of the object. Adapter should create write stream williamr@4: and return, when data is written to stream by DM agent, williamr@4: StreamCommittedL() is called by DM engine williamr@4: @param aType MIME type of the object williamr@4: @param aStatusRef Reference to correct command, i.e. this reference williamr@4: must be used when calling the SetStatusL of this williamr@4: command. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, williamr@4: RWriteStream*& aStream, const TDesC8& aType, williamr@4: TInt aStatusRef ) = 0; williamr@4: williamr@4: /** williamr@4: The function deletes an object and its child objects. The SetStatusL williamr@4: should be used as described in UpdateLeafObjectL() williamr@4: @param aURI URI of the object williamr@4: @param aLUID LUID of the object (if the adapter have earlier returned williamr@4: LUID to the DM Module). williamr@4: @param aStatusRef Reference to correct command, i.e. this reference must williamr@4: be used when calling the SetStatusL of this command. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID, williamr@4: TInt aStatusRef ) = 0; williamr@4: williamr@4: /** williamr@4: The function fetches data of a leaf object. The SetStatusL should be used williamr@4: as described in UpdateLeafObjectL(). The data is returned by using the williamr@4: SetResultsL function of MSmlCallback callback interface, and may be streamed. williamr@4: @param aURI URI of the object williamr@4: @param aLUID LUID of the object (if the adapter have earlier williamr@4: returned LUID to the DM Module). williamr@4: @param aType MIME type of the object williamr@4: @param aResultsRef Reference to correct results, i.e. this reference williamr@4: must be used when returning the result by calling williamr@4: the SetResultsL. williamr@4: @param aStatusRef Reference to correct command, i.e. this reference williamr@4: must be used when calling the SetStatusL of this williamr@4: command. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, williamr@4: const TDesC8& aType, TInt aResultsRef, williamr@4: TInt aStatusRef ) = 0; williamr@4: williamr@4: /** williamr@4: The function fetches the size of the data of a leaf object. The size is williamr@4: in bytes, and must reflect the number of bytes that will be transferred williamr@4: when the framework calls FetchLeafObjectL. The SetStatusL should be used williamr@4: as described in FetchLeafObjectL(). The size value is returned by using williamr@4: the SetResultsL function of MSmlCallback callback interface, and must be williamr@4: a decimal integer expressed as a string, eg. "1234". williamr@4: Results from this call MUST NOT be streamed. williamr@4: @param aURI URI of the object williamr@4: @param aLUID LUID of the object (if the adapter have earlier williamr@4: returned LUID to the DM Module). williamr@4: @param aType MIME type of the object williamr@4: @param aResultsRef Reference to correct results, i.e. this reference williamr@4: must be used when returning the result by calling williamr@4: the SetResultsL. williamr@4: @param aStatusRef Reference to correct command, i.e. this reference williamr@4: must be used when calling the SetStatusL of this williamr@4: command. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void FetchLeafObjectSizeL( const TDesC8& aURI, const TDesC8& aLUID, williamr@4: const TDesC8& aType, TInt aResultsRef, williamr@4: TInt aStatusRef ) = 0; williamr@4: /** williamr@4: The function fetches URI list. An adapter returns the list of URI segments williamr@4: under the given URI be separated by slash ("/"). The URI segment names for williamr@4: new objects must be given by the adapter. williamr@4: The list is returned by calling the SetResultsL function of MSmlCallback williamr@4: callback interface. Results from this call MUST NOT be streamed. williamr@4: @param aParentURI URI of the parent object williamr@4: @param aParentLUID LUID of the parent object (if the williamr@4: adapter have earlier returned LUID to williamr@4: the DM Module). williamr@4: @param aPreviousURISegmentList URI list with mapping LUID information, williamr@4: which is known by DM engine. An adapter williamr@4: can use this information when verifying williamr@4: if old objects still exists. An adapter williamr@4: also knows what objects are new to DM williamr@4: engine and can provide LUID mapping for williamr@4: them. aPreviousURISegmentList parameter williamr@4: (see above) helps to recognise new williamr@4: objects. williamr@4: @param aResultsRef Reference to correct results, i.e. this williamr@4: reference must be used when returning williamr@4: the result by calling the SetResultsL. williamr@4: @param aStatusRef Reference to correct command, i.e. this williamr@4: reference must be used when calling the williamr@4: SetStatusL of this command. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void ChildURIListL( const TDesC8& aURI, const TDesC8& aLUID, williamr@4: const CArrayFix& aPreviousURISegmentList, williamr@4: TInt aResultsRef, TInt aStatusRef ) = 0; williamr@4: williamr@4: /** williamr@4: The function adds node object. In some cases an implementation of the williamr@4: function may be empty function, if the node object does not need concrete williamr@4: database update. Still this function may be helpful to an adapter, i.e. in williamr@4: passing mapping LUID of the node to DM Module. The SetStatusL should be williamr@4: used as described in UpdateLeafObjectL() williamr@4: @param aURI URI of the object williamr@4: @param aParentLUID LUID of the parent object (if the adapter have williamr@4: earlier returned LUID to the DM Module). williamr@4: @param aStatusRef Reference to correct command, i.e. this reference williamr@4: must be used when calling the SetStatusL of this williamr@4: command. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID, williamr@4: TInt aStatusRef )=0; williamr@4: williamr@4: /** williamr@4: The function implements execute command. The information about the success williamr@4: of the command should be returned by calling SetStatusL function of williamr@4: MSmlDmCallback callback interface. This makes it possible to buffer the williamr@4: commands. williamr@4: However, all the status codes for buffered commands must be returned at williamr@4: the latest when the CompleteOutstandingCmdsL() of adapter is called. williamr@4: @param aURI URI of the command williamr@4: @param aLUID LUID of the object (if the adapter have earlier williamr@4: returned LUID to the DM Module). williamr@4: @param aArgument Argument for the command williamr@4: @param aType MIME type of the object williamr@4: @param aStatusRef Reference to correct command, i.e. this reference williamr@4: must be used when calling the SetStatusL of this williamr@4: command. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, williamr@4: const TDesC8& aArgument, const TDesC8& aType, williamr@4: TInt aStatusRef ) = 0; williamr@4: williamr@4: /** williamr@4: The function implements execute command. The information about the williamr@4: success of the command should be returned by calling SetStatusL function williamr@4: of MSmlDmCallback callback interface. This makes it possible to buffer the williamr@4: commands. williamr@4: However, all the status codes for buffered commands must be returned at williamr@4: the latest when the CompleteOutstandingCmdsL() of adapter is called. williamr@4: @param aURI URI of the command williamr@4: @param aLUID LUID of the object (if the adapter have earlier williamr@4: returned LUID to the DM Module). williamr@4: @param aStream Argument for the command. Adapter should create williamr@4: write stream and return, when data is written to williamr@4: stream by DM agent, StreamCommittedL() is called by williamr@4: DM engine williamr@4: @param aType MIME type of the object williamr@4: @param aStatusRef Reference to correct command, i.e. this reference williamr@4: must be used when calling the SetStatusL of this williamr@4: command. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, williamr@4: RWriteStream*& aStream, const TDesC8& aType, williamr@4: TInt aStatusRef ) = 0; williamr@4: williamr@4: /** williamr@4: The function implements copy command. The information about the success of williamr@4: the command should be returned by calling SetStatusL function of williamr@4: MSmlDmCallback callback interface. This makes it possible to buffer the williamr@4: commands. williamr@4: However, all the status codes for buffered commands must be returned at williamr@4: the latest when the CompleteOutstandingCmdsL() of adapter is called. williamr@4: @param aTargetURI Target URI for the command williamr@4: @param aSourceLUID LUID of the target object (if one exists, and if the adapter williamr@4: has earlier returned a LUID to the DM Module). williamr@4: @param aSourceURI Source URI for the command williamr@4: @param aSourceLUID LUID of the source object (if the adapter has williamr@4: earlier returned a LUID to the DM Module). williamr@4: @param aType MIME type of the objects williamr@4: @param aStatusRef Reference to correct command, i.e. this reference williamr@4: must be used when calling the SetStatusL of this williamr@4: command. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void CopyCommandL( const TDesC8& aTargetURI, const TDesC8& aTargetLUID, williamr@4: const TDesC8& aSourceURI, const TDesC8& aSourceLUID, williamr@4: const TDesC8& aType, TInt aStatusRef ) = 0; williamr@4: williamr@4: /** williamr@4: The function indicates start of Atomic command. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void StartAtomicL() = 0; williamr@4: williamr@4: /** williamr@4: The function indicates successful end of Atomic command. The adapter williamr@4: should commit all changes issued between StartAtomicL() and williamr@4: CommitAtomicL() williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void CommitAtomicL() = 0; williamr@4: williamr@4: /** williamr@4: The function indicates unsuccessful end of Atomic command. The adapter williamr@4: should rollback all changes issued between StartAtomicL() and williamr@4: RollbackAtomicL(). If rollback fails for a command, adapter should use williamr@4: SetStatusL() to indicate it. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void RollbackAtomicL() = 0; williamr@4: williamr@4: /** williamr@4: Returns ETrue if adapter supports streaming otherwise EFalse. williamr@4: @param aItemSize size limit for stream usage williamr@4: @return TBool ETrue for streaming support williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual TBool StreamingSupport( TInt& aItemSize ) = 0; williamr@4: williamr@4: /** williamr@4: Called when stream returned from UpdateLeafObjectL or ExecuteCommandL has williamr@4: been written to and committed. Not called when fetching item. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void StreamCommittedL() = 0; williamr@4: williamr@4: /** williamr@4: The function tells the adapter that all the commands of the message that williamr@4: can be passed to the adapter have now been passed. This indciates that williamr@4: the adapter must supply status codes and results to any buffered commands. williamr@4: This must be done at latest by the time this function returns. williamr@4: This function is used at the end of SyncML messages, and during processing williamr@4: of Atomic. In the case of Atomic processing, the function will be williamr@4: followed by a call to CommitAtomicL or RollbackAtomicL. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void CompleteOutstandingCmdsL() = 0; williamr@4: }; williamr@4: williamr@4: williamr@4: class TSmlDmAccessTypes williamr@4: /** williamr@4: This class sets the access types which are allowed for a DM object. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: { williamr@4: public: williamr@4: enum williamr@4: /** williamr@4: This enumeration describes the possible access types for a DM object williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: { williamr@4: /** The DM Command Add is permitted on this DM object */ williamr@4: EAccessType_Add = 0x01, williamr@4: /** The DM Command Copy is permitted on this DM object */ williamr@4: EAccessType_Copy = 0x02, williamr@4: /** The DM Command Delete is permitted on this DM object */ williamr@4: EAccessType_Delete = 0x04, williamr@4: /** The DM Command Exec is permitted on this DM object */ williamr@4: EAccessType_Exec = 0x08, williamr@4: /** The DM Command Get is permitted on this DM object */ williamr@4: EAccessType_Get = 0x10, williamr@4: /** The DM Command Replace is permitted on this DM object */ williamr@4: EAccessType_Replace = 0x20 williamr@4: }; williamr@4: public: williamr@4: inline TSmlDmAccessTypes(); williamr@4: inline void SetAdd(); williamr@4: inline void SetCopy(); williamr@4: inline void SetDelete(); williamr@4: inline void SetExec(); williamr@4: inline void SetGet(); williamr@4: inline void SetReplace(); williamr@4: inline TUint8 GetACL(); williamr@4: inline void Reset(); williamr@4: williamr@4: private: williamr@4: TUint8 iACL; williamr@4: }; williamr@4: williamr@4: williamr@4: williamr@4: class CSmlDmAdapter : public CBase, public MSmlDmAdapter williamr@4: /** williamr@4: The class CSmlDmAdapter is an ECOM interface for Device Management adapter plugins. williamr@4: This interface which must be implemented by every DM plugin adapter williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: williamr@4: { williamr@4: public: williamr@4: inline static CSmlDmAdapter* NewL( const TUid& aImplementationUid, williamr@4: MSmlDmCallback& aDmCallback ); williamr@4: inline virtual ~CSmlDmAdapter(); williamr@4: williamr@4: protected: williamr@4: inline CSmlDmAdapter(TAny* aEcomArguments); williamr@4: inline MSmlDmCallback& Callback(); williamr@4: williamr@4: private: williamr@4: /** ECOM framework requires this ID in object destructor williamr@4: @internalTechnology williamr@4: @prototype williamr@4: */ williamr@4: TUid iDtor_ID_Key; williamr@4: williamr@4: /** The DM Framework's callback for returning command results and data williamr@4: @internalTechnology williamr@4: @prototype williamr@4: */ williamr@4: MSmlDmCallback& iCallback; williamr@4: }; williamr@4: williamr@4: class MSmlDmCallback williamr@4: /** williamr@4: This class is callback interface which is implemented in DM Module. An williamr@4: instance is passed by reference as an argument to the CSmlDmAdapter::NewL() williamr@4: function. This interface is mostly used for returning results and status williamr@4: codes for completed commands to the DM framework. The interface also has williamr@4: functionality for mapping LUIDs and fetching from other parts of the DM Tree. williamr@4: The adapter does not necessarily need to use any other functions but the williamr@4: SetStatusL and SetResultsL, if it handles the LUID mapping itself. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: { williamr@4: public: williamr@4: /** williamr@4: The function is used to return the data in case of FetchLeafObjectL(), williamr@4: FetchLeafObjectSizeL() and ChildURIListL() functions. It should not be williamr@4: called where the DM command has failed, i.e. the error code returned in williamr@4: SetStatusL is something other than EOk. williamr@4: @param aResultsRef Reference to correct command williamr@4: @param aObject The data which should be returned williamr@4: @param aType MIME type of the object williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void SetResultsL( TInt aResultsRef, CBufBase& aObject, williamr@4: const TDesC8& aType ) = 0; williamr@4: williamr@4: /** williamr@4: The function is used to return the data in case of FetchLeafObjectL() and williamr@4: ChildURIListL() functions, where the size of the data being returned is williamr@4: large enough for the Adapter to stream it. This function should not be williamr@4: called when command was failed, i.e. the error code returned in SetStatusL williamr@4: is something other than EOk. williamr@4: @param aResultsRef Reference to correct command williamr@4: @param aStream Large data which should be returned, DM engine williamr@4: closes stream when it has read all the data williamr@4: @param aType MIME type of the object williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void SetResultsL( TInt aResultsRef, RReadStream*& aStream, williamr@4: const TDesC8& aType ) = 0; williamr@4: williamr@4: /** williamr@4: The function returns information about the Add,Update,Delete and Fetch williamr@4: commands success to DM engine. The reference to correct command must be williamr@4: used when calling the SetStatusL function, the reference is got from the williamr@4: argument of the command functions. The SetStatusL function must be called williamr@4: separately for every single command. williamr@4: @param aStatusRef Reference to correct command williamr@4: @param aErrorCode Information about the command success williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void SetStatusL( TInt aStatusRef, williamr@4: MSmlDmAdapter::TError aErrorCode ) = 0; williamr@4: williamr@4: /** williamr@4: The function passes map information to DM Module. This function is called williamr@4: for a new management object, both for node objects and for leaf objects. williamr@4: In addition if ChildURIListL() function has returned new objects a mapping williamr@4: information of the new objects must be passed. A mapping is treated as williamr@4: inheritable. If the mapping is not set with this function, the mapping williamr@4: LUID of the parent object is passed in following commands to the object. williamr@4: @param aURI URI of the object. williamr@4: @param aLUID LUID of the object. LUID must contain the all information, williamr@4: which is needed for retrieve the invidual object from the williamr@4: database. Typically it is ID for the database table. In williamr@4: more complicated structures it can be combination of IDs, williamr@4: which represent path to the object. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void SetMappingL( const TDesC8& aURI, const TDesC8& aLUID ) = 0; williamr@4: williamr@4: /** williamr@4: The function is used to make a fetch to other adapters. The most common williamr@4: use is to make a fetch to the AP adapter, because when managing the access williamr@4: points, the data comes as URI. For example, there are ToNAPId field in williamr@4: some adapters, and data to it can be something like AP/IAPidx, and then williamr@4: the link to AP adapter is needed. williamr@4: Using FetchLinkL causes the DM Framework to make a Get request to the williamr@4: appropriate DM adapter. The receiving adapter MUST complete the Get williamr@4: request synchronously. williamr@4: @param aURI URI of the object. williamr@4: @param aData Reference to data, i.e. data is returned here williamr@4: @param aStatus The status of fetch command is returned here williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void FetchLinkL( const TDesC8& aURI, CBufBase& aData, williamr@4: MSmlDmAdapter::TError& aStatus ) = 0; williamr@4: williamr@4: /** williamr@4: The function returns the LUID which is mapped to aURI. If LUID is not williamr@4: found, the function allocates a null length string, i.e. the function williamr@4: allocates memory in every case. williamr@4: @param aURI URI of the object. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual HBufC8* GetLuidAllocL( const TDesC8& aURI ) = 0; williamr@4: williamr@4: /** williamr@4: The function is used to remove a mapped URI. Returns the error code about mapping removal. williamr@4: @param aAdapterId Settings Adapter id williamr@4: @param aURI Mapped Uri williamr@4: @param aChildAlso Indicates the child nodes removal williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual TInt RemoveMappingL( TUint32 aAdapterId, const TDesC8& aURI, TBool aChildAlso ) = 0; williamr@4: }; williamr@4: williamr@4: williamr@4: class MSmlDmDDFObject williamr@4: /** williamr@4: This class structure includes DDF description. When used as an argument in DM williamr@4: Adapters Interface each adapter fills its own branch of DDF Tree to the data williamr@4: structure. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: { williamr@4: public: williamr@4: williamr@4: enum TDFFormat williamr@4: /** williamr@4: The possible formats of a node. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: { williamr@4: /** Base64 encoded */ williamr@4: EB64, williamr@4: /** Boolean */ williamr@4: EBool, williamr@4: /** Character data */ williamr@4: EChr, williamr@4: /** Integer */ williamr@4: EInt, williamr@4: /** A DM Tree interior node */ williamr@4: ENode, williamr@4: /** No data */ williamr@4: ENull, williamr@4: /** XML character data*/ williamr@4: EXml, williamr@4: /** Binary data */ williamr@4: EBin, williamr@4: /** Date data */ williamr@4: EDate, williamr@4: /** Time data */ williamr@4: ETime, williamr@4: /** Float */ williamr@4: EFloat williamr@4: }; williamr@4: williamr@4: enum TOccurence williamr@4: /** williamr@4: The possible occurrences of a node. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: { williamr@4: /** The node appears exactly once */ williamr@4: EOne, williamr@4: /** The node is optional and may appear zero or once */ williamr@4: EZeroOrOne, williamr@4: /** The node is optional and may appear zero or more times */ williamr@4: EZeroOrMore, williamr@4: /** The node is mandatory and may appear once or more times */ williamr@4: EOneOrMore, williamr@4: /** The node is optional and may appear between once and 'N' times */ williamr@4: EZeroOrN, williamr@4: /** The node is mandatory and may appear between once and 'N' times */ williamr@4: EOneOrN williamr@4: }; williamr@4: williamr@4: enum TScope williamr@4: /** williamr@4: The possible scopes of a node. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: { williamr@4: /** The node is permanent in the DM Tree */ williamr@4: EPermanent, williamr@4: /** The node is created at run-time in the DM Tree */ williamr@4: EDynamic williamr@4: }; williamr@4: williamr@4: /** williamr@4: The function sets permitted access types property to the object. Access williamr@4: types property is a mandatory element. If this function is not called all williamr@4: accesses are denied. williamr@4: @param aAccessTypes Access types property. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void SetAccessTypesL( TSmlDmAccessTypes aAccessTypes )=0; williamr@4: williamr@4: /** williamr@4: The function sets a default value property to the object. Default value williamr@4: is not a mandatory element. If this function is not called, it means that williamr@4: the default value property is not set at all. williamr@4: @param aDefaultValue Default value property. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void SetDefaultValueL( const TDesC8& aDefaultValue )=0; williamr@4: williamr@4: /** williamr@4: The function sets a description property to the object. Description is williamr@4: not a mandatory element. If this function is not called, it means that the williamr@4: description property value is not set at all. williamr@4: @param aDescription Description property. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void SetDescriptionL( const TDesC8& aDescription )=0; williamr@4: williamr@4: /** williamr@4: The function sets a format property to the object. Format is a mandatory williamr@4: element. If this function is not called for node element, Format is set as williamr@4: 'node'. For leaf elements this function must be called. williamr@4: @param aFormat Format property. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void SetDFFormatL( TDFFormat aFormat )= 0; williamr@4: williamr@4: /** williamr@4: The function sets an occurence property to the object. If this function williamr@4: is not called, an occurence is set as TOccurence::EOne. williamr@4: @param aOccurence Occurence property. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void SetOccurenceL( TOccurence aOccurence ) =0; williamr@4: williamr@4: /** williamr@4: The function sets a scope property to the object. If this function is not williamr@4: called, the scope is set as TScope::EDynamic. williamr@4: @param aScope Scope property. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void SetScopeL( TScope aScope ) = 0; williamr@4: williamr@4: /** williamr@4: The function sets a title property to the object. Title is not a mandatory williamr@4: element. If this function is not called, it means that a Title property williamr@4: value is not set at all. williamr@4: @param aTitle DFTitle property. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void SetDFTitleL( const TDesC8& aTitle ) = 0; williamr@4: williamr@4: /** williamr@4: The function sets a MIME type property to the object. MIME Type is a williamr@4: mandatory element for leaf objects. If this function is not called (for williamr@4: node elements), it means that the MIME type property value is not set at williamr@4: all. williamr@4: @param aMimeType MIME type property. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual void AddDFTypeMimeTypeL( const TDesC8& aMimeType ) = 0; williamr@4: williamr@4: /** williamr@4: The function sets an object as an object group. If this function is not williamr@4: called, it means that the object is not an object group. Object group is a williamr@4: term used with for the node in the management tree that is used as a williamr@4: container for other object groups, container for management objects or a williamr@4: container for both object groups and management objects. The term 'object williamr@4: group' is not used when talked about the nodes which are part of williamr@4: the management object itself. williamr@4: @publishedPartner williamr@4: @withdrawn - This is not supported. MSmlDmDDFObject::AddChildObjectGroupL williamr@4: * must be used instead of AddChildObjectL,SetAsObjectGroup. williamr@4: */ williamr@4: virtual void SetAsObjectGroup() = 0; williamr@4: williamr@4: /** williamr@4: The function adds a child object and sets name of the URI segment, which williamr@4: is used by the DM server. The highest object must be directly under root. williamr@4: An adapter is not able to set properties of the root object. The aNodeName williamr@4: argument should be an empty string, when the name is not fixed in DDF, williamr@4: i.e. in case of dynamic nodes. williamr@4: @param aNodeName The name of the node williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual MSmlDmDDFObject& AddChildObjectL(const TDesC8& aNodeName) = 0; williamr@4: williamr@4: /** williamr@4: The function adds a child object, to be used as an object group. As an williamr@4: object group, there is no node name (these nodes are 'unnamed' in the DDF). williamr@4: Object group is a term used with for nodes in the management tree that are williamr@4: used as a container for other object groups, container for management williamr@4: objects or a container for both object groups and management objects. The williamr@4: term 'object group' is not used when referring to nodes which are part williamr@4: of the management object itself. williamr@4: @publishedPartner williamr@4: @prototype williamr@4: */ williamr@4: virtual MSmlDmDDFObject& AddChildObjectGroupL() = 0; williamr@4: }; williamr@4: williamr@4: #include "smldmadapter.inl" williamr@4: williamr@4: #endif // __SMLDMADAPTER_H__