CRLSXDM Class Reference
class CRLSXDM : public CActive |
This class is used for RLS XDM. Refer to OMA 'Resource List Server (RLS) XDM Specification'. The class maintains a so called current path information, which can be manipulated using specific functions. The elements adding, removing, getting etc are performed on current path. However, 'service' uri nodes related functions are always treated on document root. The class also applies restrictions on adding elements on certain paths, to comply with OMA specifications. Some servers does not allow empty 'list' or 'service' uri nodes, the class provides functions to delete those from the whole document.
rlspresxdm.lib
- Since
- S60 3.2
Public Member Functions |
---|
| ~CRLSXDM() |
IMPORT_C TInt | AddElementL(const TDesC &, const TDesC &, const TDesC &) |
IMPORT_C TInt | AddServiceURIL(const TDesC &) |
IMPORT_C void | CancelUpdateL() |
IMPORT_C void | DeleteAll() |
IMPORT_C TInt | DeleteAllEmptyLists(MRLSPresXDMAsyncHandler *const ) |
IMPORT_C void | DeleteAllEmptyServiceUrisL() |
IMPORT_C void | GetCurrentPathL(CDesCArray &) |
IMPORT_C TInt | GetDisplayName(const TDesC &, const TDesC &, TPtrC8 &) |
IMPORT_C void | GetElementsL(const TDesC &, CDesCArray &) |
IMPORT_C void | GetServiceUrisL(CDesCArray &) |
IMPORT_C TBool | IsElementExist(const TDesC &, const TDesC &) |
IMPORT_C TBool | IsExistServiceURI(const TDesC &) |
IMPORT_C TPtrC | NegotiatedServiceUri() |
IMPORT_C CRLSXDM * | NewL(const TInt) |
IMPORT_C CRLSXDM * | NewLC(const TInt) |
IMPORT_C TInt | RemoveElementL(const TDesC &, const TDesC &) |
IMPORT_C TInt | RemoveServiceURIL(const TDesC &) |
IMPORT_C TInt | RenameListL(const TDesC &, const TDesC &) |
IMPORT_C TInt | SetCurrentpathL(const MDesCArray &) |
IMPORT_C void | SwitchOutFromList() |
IMPORT_C TInt | SwitchToListL(const TDesC &) |
IMPORT_C TInt | SwitchToServiceURIL(const TDesC &) |
IMPORT_C TInt | UpdateAllFromServerL(MRLSPresXDMAsyncHandler *const ) |
IMPORT_C TInt | UpdateDisplayNameL(const TDesC &, const TDesC &, const TDesC &) |
IMPORT_C TInt | UpdateToServerL(MRLSPresXDMAsyncHandler *const ) |
Private Member Functions |
---|
| CRLSXDM() |
void | AddLeafElementL(const TDesC &, const TDesC &, CXdmDocumentNode *const ) |
void | AddNonLeafElementL(const TDesC &, const TDesC &, const TDesC &, CXdmDocumentNode *const ) |
void | AddPackageL() |
void | ConstructL(const TInt) |
void | CreateRootIfNeededL() |
void | DeleteEmptyListsL() |
void | DoCancel() |
void | DoParseNegotiatedServiceUriL(CXdmDocumentNode *) |
TInt
| GetDisplayNameInt(const TDesC &, const TDesC &, TPtrC8 &, CXdmDocumentNode *const ) |
CXdmDocumentNode * | GetLeafChild(const TDesC &, const TDesC &, CXdmDocumentNode *const ) |
void | GetLeafElementsL(const TDesC &, CDesCArray &, CXdmDocumentNode *const ) |
CXdmDocumentNode * | GetNonLeafChild(const TDesC &, const TDesC &, CXdmDocumentNode *const ) |
void | GetNonLeafElementAttrName(const TDesC &, TDes &) |
void | GetNonLeafElementsL(const TDesC &, CDesCArray &, CXdmDocumentNode *const ) |
TBool
| IsNonLeafElementValid(const TDesC &) |
CXdmDocumentNode * | IsServiceUriExist(const TDesC &, CXdmDocumentNode *) |
void | RemovePackageL() |
TInt
| RunError(TInt) |
void | RunL() |
TInt
| UpdateDisplayNameIntL(const TDesC &, const TDesC &, const TDesC &, CXdmDocumentNode *const ) |
Constructor & Destructor Documentation
Member Functions Documentation
AddElementL(const TDesC &, const TDesC &, const TDesC &)
IMPORT_C TInt | AddElementL | ( | const TDesC & | aElementType, |
| const TDesC & | aData, |
| const TDesC & | aDisplayName |
| ) | |
Adds an element to current path, only 'list' and 'resource-list' elements can be added to the root of ServiceURI, to add any of other elements current path should be inside an existing list. aDisplayName is optional and KNullDesC can be provided if display name is not desired. Note that leaf element type can not have display-name so in that case display-name is always discarded.
Parameters
const TDesC & aElementType | |
const TDesC & aData | name in case of list, value of element's attribute for other elements. In case of resource-list this is the link. |
const TDesC & aDisplayName | display name of the element, use KNullDesC if display-name is not required. |
AddLeafElementL(const TDesC &, const TDesC &, CXdmDocumentNode *const)
Adds a leaf element to current path, only 'resource-list' element can be added to the root of ServiceURI. This functions doesnt care whether element already exist or not.
AddNonLeafElementL(const TDesC &, const TDesC &, const TDesC &, CXdmDocumentNode *const)
Adds a non leaf element to current path, only 'list' element can be added to the root of ServiceURI, to add any of other possible elements current path should be inside an existing list. This functions doesnt care whether element already exist or not.
Parameters
const TDesC & aElementType | |
const TDesC & aData | name in case of list, value of element's attribute for other elements. |
const TDesC & aDisplayName | display name of the element |
CXdmDocumentNode *const aTargetNode | pointer to target node |
AddPackageL()
void | AddPackageL | ( | ) | [private] |
Adds the compulsory package node to current service uri in case no current uri found, does nothing. This function needed because some servers wants package as the last child node of service uri node.
AddServiceURIL(const TDesC &)
IMPORT_C TInt | AddServiceURIL | ( | const TDesC & | aServiceURI | ) | |
Parameters
const TDesC & aServiceURI | |
CancelUpdateL()
IMPORT_C void | CancelUpdateL | ( | ) | |
Cancels document update to/from server if going on. This results in HandleRLSUpdateCancelL on completion.
ConstructL(const TInt)
void | ConstructL | ( | const TInt | aSettingId | ) | [private] |
CreateRootIfNeededL()
void | CreateRootIfNeededL | ( | ) | [private] |
Creates the document root if needed
DeleteAll()
Delete all data by deleting all service uris. It also resets the path.
DeleteAllEmptyLists(MRLSPresXDMAsyncHandler *const)
Async. function. Deletes all lists in the document which doesnt have any lists or entries. This function is very useful with the servers which doesnt accept empty lists. Note that as a side effect of this call, the path information is deleted. Results in HandleRLSDeleteAllEmptyListsL upon completion. If empty service-uris also needed to be deleted, DeleteAllEmptyServiceUrisL must be called after calling this function.
DeleteAllEmptyServiceUrisL()
IMPORT_C void | DeleteAllEmptyServiceUrisL | ( | ) | |
Deletes all service-uris in the document which doesnt have any lists. This function is very useful with the servers which doesnt accept empty service uris. Note that as a side effect of this call, the path information is deleted. If emtpy lists also needed to be deleted, DeleteAllEmptyListsL must be called before calling this function.
DeleteEmptyListsL()
void | DeleteEmptyListsL | ( | ) | [private] |
Internal function for deleting empty lists, keep called by RunL until all lists are deleted.
DoCancel()
void | DoCancel | ( | ) | [private, virtual] |
DoParseNegotiatedServiceUriL(CXdmDocumentNode *)
Parse Serice URI negotiation response body and save it into iNegotiatedServiceUri.
GetCurrentPathL(CDesCArray &)
This gives complete hierarchy of the current path. The first element of the array will be ServiceURI, and after that will be child lists, The current list name is the last element of the array.
GetDisplayName(const TDesC &, const TDesC &, TPtrC8 &)
Gets display name of an element. Only applicable to those elements which can have a display name.
Parameters
const TDesC & aElementType | |
const TDesC & aData | name in case of list, value of element's attribute for other elements. |
TPtrC8 & aDisplayName | display name of the element |
GetDisplayNameInt(const TDesC &, const TDesC &, TPtrC8 &, CXdmDocumentNode *const)
Gets display name of a non leaf element.
Parameters
const TDesC & aElementType | |
const TDesC & aData | name in case of list, value of element's attribute for other elements. |
TPtrC8 & aDisplayName | display name of the element |
CXdmDocumentNode *const aTargetNode | pointer to target node |
GetElementsL(const TDesC &, CDesCArray &)
Get all elements of same type at given node path
Parameters
const TDesC & aElementType | |
CDesCArray & aValues | array of data values. 'name' in case of list or value of element's attribute for other element types. |
GetLeafChild(const TDesC &, const TDesC &, CXdmDocumentNode *const)
Get list's leaf child. These includes getting of resource-list and packages
GetLeafElementsL(const TDesC &, CDesCArray &, CXdmDocumentNode *const)
Get all elements of same type at given node path
Parameters
const TDesC & aElementType | |
CDesCArray & aValues | array of data values. 'name' in case of list or value of element's attribute for other element types. |
CXdmDocumentNode *const aTargetNode | pointer to target node |
GetNonLeafChild(const TDesC &, const TDesC &, CXdmDocumentNode *const)
Get list's non-leaf child. These includes getting of list, entry external and entry ref.
Parameters
const TDesC & aChildName | |
const TDesC & aAttrValue | value of attribute to match with |
CXdmDocumentNode *const aTargetNode | pointer to target node |
GetNonLeafElementAttrName(const TDesC &, TDes &)
void | GetNonLeafElementAttrName | ( | const TDesC & | aElementName, |
| TDes & | aAttrName |
| ) | [private] |
Return the attribute name used for the element. Only valid for non-leaf elements.
Parameters
const TDesC & aElementName | |
TDes & aAttrName | name of the attribute returns here |
GetNonLeafElementsL(const TDesC &, CDesCArray &, CXdmDocumentNode *const)
Get all elements of same type at given node path
Parameters
const TDesC & aElementType | |
CDesCArray & aValues | array of data values. 'name' in case of list or value of element's attribute for other element types. |
CXdmDocumentNode *const aTargetNode | pointer to target node |
GetServiceUrisL(CDesCArray &)
IMPORT_C void | GetServiceUrisL | ( | CDesCArray & | aServiceUris | ) | |
Get all Service Uri(s) in current document
IsElementExist(const TDesC &, const TDesC &)
IMPORT_C TBool | IsElementExist | ( | const TDesC & | aElementType, |
| const TDesC & | aData |
| ) | |
Is element exist on the current path
Parameters
const TDesC & aElementType | |
const TDesC & aData | name in case of list, value of element's attribute for other elements. |
IsExistServiceURI(const TDesC &)
IMPORT_C TBool | IsExistServiceURI | ( | const TDesC & | aServiceURI | ) | |
Return ETrue if service URI is exist with given name
Parameters
const TDesC & aServiceURI | |
IsNonLeafElementValid(const TDesC &)
TBool
| IsNonLeafElementValid | ( | const TDesC & | aElementName | ) | [private] |
Validates the given non-leaf element.
Parameters
const TDesC & aElementName | |
IsServiceUriExist(const TDesC &, CXdmDocumentNode *)
Return pointer to serviceUri and its attribute value
NegotiatedServiceUri()
IMPORT_C TPtrC | NegotiatedServiceUri | ( | ) | |
Accessor for the last negotiated RLS service URI. URI is Zero length if the last HTTP PUT did not receive HTTP 409 error or if there was no <alt-value> value in the response body.
NewLC(const TInt)
Create CRLSXDM, leaves pointer to stack
RemoveElementL(const TDesC &, const TDesC &)
IMPORT_C TInt | RemoveElementL | ( | const TDesC & | aElementType, |
| const TDesC & | aData |
| ) | |
Removes the given element from the current path
Parameters
const TDesC & aElementType | |
const TDesC & aData | name in case of list, value of element's attribute for other elements. |
RemovePackageL()
void | RemovePackageL | ( | ) | [private] |
Removes the compulsory package node to current service uri in case no current uri found, does nothing. This function needed because some servers wants package as the last child node of service uri node.
RemoveServiceURIL(const TDesC &)
IMPORT_C TInt | RemoveServiceURIL | ( | const TDesC & | aServiceURI | ) | |
Removes a service URI (and all lists/Entries it holds). Current path will be reset if this service exists in current path
Parameters
const TDesC & aServiceURI | |
RenameListL(const TDesC &, const TDesC &)
IMPORT_C TInt | RenameListL | ( | const TDesC & | aListName, |
| const TDesC & | aListNewName |
| ) | |
Parameters
const TDesC & aListName | |
const TDesC & aListNewName | |
RunError(TInt)
TInt
| RunError | ( | TInt | aError | ) | [private, virtual] |
RunL()
void | RunL | ( | ) | [private, virtual] |
SetCurrentpathL(const MDesCArray &)
IMPORT_C TInt | SetCurrentpathL | ( | const MDesCArray & | aListsNames | ) | |
Set the current path according to given hierarchy. The first element of the array must be the ServiceURI, with child lists to follow. The target list name is the last element of the array. If the list is not found according to the given heirarchy, the current path will not be changed and KErrNotFound will be returned. An empty array will cause the path to be completely empty.
Parameters
const MDesCArray & aListsNames | |
SwitchOutFromList()
IMPORT_C void | SwitchOutFromList | ( | ) | |
Switch out from current list, if path is already service-uri level nothing will happed. This corresponds to gettting out from a directory. The Current path changes if successful
SwitchToListL(const TDesC &)
IMPORT_C TInt | SwitchToListL | ( | const TDesC & | aListName | ) | |
Switch into given list. After this the given list will become currently pointed list (path), and all operations will be performed in this path. This corresponds to entering into a directory in DOS
SwitchToServiceURIL(const TDesC &)
IMPORT_C TInt | SwitchToServiceURIL | ( | const TDesC & | aServiceURI | ) | |
Switch into given service URI. After this the given ServiceURI will become currently pointed URI, and all operations will be performed on this URI. This corresponds to entering into a disk in DOS
Parameters
const TDesC & aServiceURI | |
UpdateAllFromServerL(MRLSPresXDMAsyncHandler *const)
Updates all information (document) from server. This results in HandleRLSUpdateFromServerL on completion.
UpdateDisplayNameIntL(const TDesC &, const TDesC &, const TDesC &, CXdmDocumentNode *const)
Updates display name of an element.
Parameters
const TDesC & aElementType | |
const TDesC & aData | name in case of list, value of element's attribute for other elements. |
const TDesC & aDisplayName | display name of the element |
CXdmDocumentNode *const aTargetNode | pointer to target node |
UpdateDisplayNameL(const TDesC &, const TDesC &, const TDesC &)
IMPORT_C TInt | UpdateDisplayNameL | ( | const TDesC & | aElementType, |
| const TDesC & | aData, |
| const TDesC & | aDisplayName |
| ) | |
Updates display name of an element.
Parameters
const TDesC & aElementType | |
const TDesC & aData | name in case of list, value of element's attribute for other elements. |
const TDesC & aDisplayName | display name of the element |
UpdateToServerL(MRLSPresXDMAsyncHandler *const)
Updates information (document) to server. This results in HandleRLSUpdateToServerL on completion.
Member Data Documentation
MRLSPresXDMAsyncHandler * iAsyncHandler
RPointerArray< CXdmDocumentNode > iListPointerPath
HBufC * iNegotiatedServiceUri
HBufC * | iNegotiatedServiceUri | [private] |
Negotiated RLS service URI Own
CXdmDocument * iRLSDocument
CXdmProtocolInfo * iXDMProtocolInfo
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.