CSenElement Class Reference

class CSenElement : public CBase
Abstract class definition of XML element SenXML.dll
Since
Series60 3.0

Inherits from

Public Member Functions
voidAddAttrL(const TDesC8 &, const TDesC8 &)
voidAddAttributesL(const RAttributeArray &)
CSenElement &AddElementL(CSenElement &)
CSenElement &AddElementL(const TDesC8 &, const TDesC8 &)
CSenElement &AddElementL(const TDesC8 &, const TDesC8 &, const TDesC8 &)
CSenElement &AddElementL(const TDesC8 &)
const CSenNamespace *AddNamespaceL(const TDesC8 &, const TDesC8 &)
const CSenNamespace *AddNamespaceL(CSenNamespace &, TBool)
MSenElement *AsElement()
HBufC8 *AsXmlL()
HBufC *AsXmlUnicodeL()
const TDesC8 *AttrValue(const TDesC8 &)
RPointerArray< CSenBaseAttribute > &AttributesL()
CSenElement *Child(TInt)
TBool ConsistsOfL(MSenElement &)
TPtrC8 Content()
HBufC *ContentUnicodeL()
RWriteStream &ContentWriteStreamL()
voidCopyFromL(CSenElement &)
CSenElement *CreateElementL(const TDesC8 &, const TDesC8 &)
CSenElement *DetachL()
CSenElement *Element(const TDesC8 &)
CSenElement *Element(const TDesC8 &, const TDesC8 &)
TInt ElementsL(RPointerArray< CSenElement > &, const TDesC8 &, const TDesC8 &)
TInt ElementsL(RPointerArray< CSenElement > &, const TDesC8 &)
RPointerArray< CSenElement > &ElementsL()
TBool HasContent()
CSenElement &InsertElementL(CSenElement &, const CSenElement &)
const TDesC8 &LocalName()
const CSenNamespace *Namespace()
const CSenNamespace *Namespace(const TDesC8 &)
const CSenNamespace *Namespace(const TDesC8 &, const TDesC8 &)
const CSenNamespace *Namespace(const TDesC8 &, const TBool)
const TDesC8 &NamespaceURI()
RPointerArray< CSenNamespace > &NamespacesL()
const TDesC8 &NsPrefix()
CSenElement *Parent()
CSenElement *RemoveElement(CSenElement &)
CSenElement *RemoveElement(const TDesC8 &, const TDesC8 &)
CSenElement *RemoveElement(const TDesC8 &)
CSenElement *ReplaceElementL(CSenElement &)
MSenElement &Root()
voidSet(const TDesC8 &, const TDesC8 &, const TDesC8 &)
TPtrC8 SetContentL(const TDesC8 &)
voidSetNamespaceL(const TDesC8 &)
voidSetNamespaceL(const TDesC8 &, const TDesC8 &)
CSenElement *SetParent(CSenElement *)
voidSetPrefixL(const TDesC8 &)
voidWriteAsXMLToL(RWriteStream &)
voidWriteNamespacesToL(RWriteStream &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()

Member Functions Documentation

AddAttrL(const TDesC8 &, const TDesC8 &)

voidAddAttrL(const TDesC8 &aName,
const TDesC8 &aValue
)[pure virtual]
Adds an attribute. If attribute is already existing, the value of the attribute will be replaced.
Since
Series60 3.0

Parameters

const TDesC8 & aNameName of the attribute to be added.
const TDesC8 & aValueValue of the attribute to be added.

AddAttributesL(const RAttributeArray &)

voidAddAttributesL(const RAttributeArray &apAttrs)[pure virtual]
Adds new attributes to the element.
Since
Series60 3.0

Parameters

const RAttributeArray & apAttrs

AddElementL(CSenElement &)

CSenElement &AddElementL(CSenElement &aElement)[pure virtual]
Adds an Element to the children elements. Sets this element to be the new parent of the given element.
Since
Series60 3.0

Parameters

CSenElement & aElement

AddElementL(const TDesC8 &, const TDesC8 &)

CSenElement &AddElementL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName
)[pure virtual]
Constructs and adds a new element to the children elements. Sets this element to be the new parent of the given element.
Since
Series60 3.0

Parameters

const TDesC8 & aNsUrinamespace URI of the new element
const TDesC8 & aLocalNamelocal name of the new element

AddElementL(const TDesC8 &, const TDesC8 &, const TDesC8 &)

CSenElement &AddElementL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName,
const TDesC8 &aQName
)[pure virtual]
Constructs and adds a new element to the children elements. Sets this element to be the new parent of the given element.
Since
Series60 3.0
KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.

Parameters

const TDesC8 & aNsUrinamespace URI of the new element
const TDesC8 & aLocalNamelocal name of the new element
const TDesC8 & aQNamequalified name of the new element

AddElementL(const TDesC8 &)

CSenElement &AddElementL(const TDesC8 &aLocalName)[pure virtual]
Constructs and adds a new element to the children elements. Sets this element to be the new parent of the given element. Note: Element is created with no specific namespace, default namespace of some of the upper level elements are in effect if there is such a namespace.
Since
Series60 3.0
KErrSenZeroLengthDescriptor if aLocalName is zero length.

Parameters

const TDesC8 & aLocalNamelocal name of the new element

AddNamespaceL(const TDesC8 &, const TDesC8 &)

const CSenNamespace *AddNamespaceL(const TDesC8 &aPrefix,
const TDesC8 &aUri
)[pure virtual]
Method for adding a namespace for the Element.
Since
Series60 3.0

Parameters

const TDesC8 & aPrefix
const TDesC8 & aUri

AddNamespaceL(CSenNamespace &, TBool)

const CSenNamespace *AddNamespaceL(CSenNamespace &aNewNamespace,
TBoolaCheckInParent
)[pure virtual]
Adds a namespace declaration. If this element (or its parent if parameter aCheckInParent is ETrue) already has a namespace with the same prefix and URI the given namespace is not added.
Since
Series60 3.0

Parameters

CSenNamespace & aNewNamespace
TBool aCheckInParent

AsElement()

MSenElement *AsElement()[pure virtual]
Offers the M-class interface pointer to this XML element.
Since
Series60 3.0

AsXmlL()

HBufC8 *AsXmlL()[pure virtual]
Gets the element as an XML buffer. Buffer will contain all the child elements.
Since
Series60 3.0

AsXmlUnicodeL()

HBufC *AsXmlUnicodeL()[pure virtual]
Gets the element as an unicode (UCS2) XML buffer. Buffer will contain all the child elements.
Since
Series60 3.0

AttrValue(const TDesC8 &)

const TDesC8 *AttrValue(const TDesC8 &aName)[pure virtual]
Gets the value of the given attribute.
Since
Series60 3.0

Parameters

const TDesC8 & aName

AttributesL()

RPointerArray< CSenBaseAttribute > &AttributesL()[pure virtual]
Gets all the attributes of this element in an array.
Since
Series60 3.0

Child(TInt)

CSenElement *Child(TIntaIndex)[pure virtual]
Gets a child element from a specified index.
Since
Series60 3.0

Parameters

TInt aIndex

ConsistsOfL(MSenElement &)

TBool ConsistsOfL(MSenElement &aCandidate)[pure virtual]
Checks if element matches to another element by it's content and child elements. Element can contain more data than the given pattern.
Since
Series60 3.0

Parameters

MSenElement & aCandidateThe pattern to be matched. Must contain same or less data for match to come true.

Content()

TPtrC8 Content()const [pure virtual]
Getter for the content of the element.
Since
Series60 3.0

ContentUnicodeL()

HBufC *ContentUnicodeL()const [pure virtual]
Getter for the content of the element, Unicode (UCS2) version
Since
Series60 3.0

ContentWriteStreamL()

RWriteStream &ContentWriteStreamL()[pure virtual]
Gets the write stream for the content for easy appending. Writing 8-bit (UTF-8) string to the returned stream will be appended to the content.
Since
Series60 3.0

CopyFromL(CSenElement &)

voidCopyFromL(CSenElement &aSource)[pure virtual]
Copies content from given element to this element appending to the existing content if there is any.
Since
Series60 3.0

Parameters

CSenElement & aSourceThe source element.

CreateElementL(const TDesC8 &, const TDesC8 &)

CSenElement *CreateElementL(const TDesC8 &aNsPrefix,
const TDesC8 &aLocalName
)[pure virtual]
Create a new element ready for adding or insertion. If the given namespace prefix is not declared yet the element will not be created and NULL will be returned.
Since
Series60 3.0

Parameters

const TDesC8 & aNsPrefix
const TDesC8 & aLocalName

DetachL()

CSenElement *DetachL()[pure virtual]
Detach the element from its parent. If the element, or one of its children, is dependent on a namespace declared in the scope of the parent copy those namespace declarations to this element.
Since
Series60 3.0

Element(const TDesC8 &)

CSenElement *Element(const TDesC8 &aLocalName)[pure virtual]
Gets the child element with the specified local name. Assumes that namespace is the same as this parent element.
Since
Series60 3.0

Parameters

const TDesC8 & aLocalNameis the XML localname of the requested child element

Element(const TDesC8 &, const TDesC8 &)

CSenElement *Element(const TDesC8 &aNsUri,
const TDesC8 &aLocalName
)[pure virtual]
Gets the child element with the specified local name and namespace URI.
Since
Series60 3.0

Parameters

const TDesC8 & aNsUriis the XML namespace of the requested child element
const TDesC8 & aLocalNameis the XML localname of the requested child element

ElementsL(RPointerArray< CSenElement > &, const TDesC8 &, const TDesC8 &)

TInt ElementsL(RPointerArray< CSenElement > &aElementArray,
const TDesC8 &aNsUri,
const TDesC8 &aLocalName
)[pure virtual]
Get a list of direct children element that have the given name and namespace.
Since
Series60 3.0

Parameters

RPointerArray< CSenElement > & aElementArrayRPointerArray that will hold matching elements
const TDesC8 & aNsUri
const TDesC8 & aLocalName

ElementsL(RPointerArray< CSenElement > &, const TDesC8 &)

TInt ElementsL(RPointerArray< CSenElement > &aElementArray,
const TDesC8 &aLocalName
)[pure virtual]
Get a list of direct children element that have the given name and same namespace as this parent Element.
Since
Series60 3.0

Parameters

RPointerArray< CSenElement > & aElementArrayRPointerArray that will hold matching elements
const TDesC8 & aLocalName

ElementsL()

RPointerArray< CSenElement > &ElementsL()[pure virtual]
Since
Series60 3.0

HasContent()

TBool HasContent()const [pure virtual]
Method for checking if the element has any content within.
Since
Series60 3.0

InsertElementL(CSenElement &, const CSenElement &)

CSenElement &InsertElementL(CSenElement &aInsertedElement,
const CSenElement &aBeforeElement
)[pure virtual]
Insert an Element into the list of children elements so that the inserted Element is placed right before the aBeforeElement. If aBeforeElement is not found, element will be appended to the last position. Function leaves if error occurs in inserting.
Since
Series60 3.0

Parameters

CSenElement & aInsertedElementthe element to be inserted. Ownership is transferred.
const CSenElement & aBeforeElementthe element which will be right next to the element just inserted.

LocalName()

const TDesC8 &LocalName()const [pure virtual]
Getter for local name.
Since
Series60 3.0

Namespace()

const CSenNamespace *Namespace()[pure virtual]
Getter for Element's namespace.
Since
Series60 3.0

Namespace(const TDesC8 &)

const CSenNamespace *Namespace(const TDesC8 &aNsPrefix)[pure virtual]
Since
Series60 3.0

Parameters

const TDesC8 & aNsPrefix

Namespace(const TDesC8 &, const TDesC8 &)

const CSenNamespace *Namespace(const TDesC8 &aNsPrefix,
const TDesC8 &aUri
)[pure virtual]
Get namespace that is declared for the given prefix and namespace URI within the scope of this element.
Since
Series60 3.0

Parameters

const TDesC8 & aNsPrefixThe prefix used to search
const TDesC8 & aUriThe namespace URI used to search.

Namespace(const TDesC8 &, const TBool)

const CSenNamespace *Namespace(const TDesC8 &aNsPrefix,
const TBoolaCheckInParent
)[pure virtual]
Since
Series60 3.0

Parameters

const TDesC8 & aNsPrefixThe prefix used to search
const TBool aCheckInParentThe flag indicating whether to check parent's namespaces too if not found in the current element. ETrue to check, EFalse for not to check.

NamespaceURI()

const TDesC8 &NamespaceURI()const [pure virtual]
Getter for namespace URI.
Since
Series60 3.0

NamespacesL()

RPointerArray< CSenNamespace > &NamespacesL()[pure virtual]
Gets all the namespaces of this element in an array.
Since
Series60 3.0

NsPrefix()

const TDesC8 &NsPrefix()const [pure virtual]
Getter for namespace prefix of this element.
Since
Series60 3.0

Parent()

CSenElement *Parent()[pure virtual]
Gets the parent element of this element.
Since
Series60 3.0

RemoveElement(CSenElement &)

CSenElement *RemoveElement(CSenElement &aElement)[pure virtual]
Remove an element from the childs.
Since
Series60 3.0

Parameters

CSenElement & aElement

RemoveElement(const TDesC8 &, const TDesC8 &)

CSenElement *RemoveElement(const TDesC8 &aNsUri,
const TDesC8 &aLocalName
)[pure virtual]
Remove an element from the childs.
Since
Series60 3.0

Parameters

const TDesC8 & aNsUri
const TDesC8 & aLocalName

RemoveElement(const TDesC8 &)

CSenElement *RemoveElement(const TDesC8 &aLocalName)[pure virtual]
Remove a child element.
Since
Series60 3.0
The caller takes ownership of the removed element.

Parameters

const TDesC8 & aLocalName

ReplaceElementL(CSenElement &)

CSenElement *ReplaceElementL(CSenElement &aElement)[pure virtual]

Replaces a child element with another element. Element's local name and namespace URI will be used to check whether or not that element matches with any existing child. If no matching child element is found this method will add a new child element.

Since
Series60 3.0

Parameters

CSenElement & aElement

Root()

MSenElement &Root()[pure virtual]
Gets the root element. If no parent element, returns this element.
Since
Series60 3.0

Set(const TDesC8 &, const TDesC8 &, const TDesC8 &)

voidSet(const TDesC8 &aNamespaceURI,
const TDesC8 &aLocalName,
const TDesC8 &aQName
)[pure virtual]
(Re-) Set the name and namespace of this Element. The element will be given the localName in the the given namespace. A prefix will be computed from the qualified name. This method should be used with care and is mainly intended for protected use in implementations.
Since
Series60 3.0

Parameters

const TDesC8 & aNamespaceURIThe new namespace URI.
const TDesC8 & aLocalNameThe new local name.
const TDesC8 & aQNameThe new qualified name.

SetContentL(const TDesC8 &)

TPtrC8 SetContentL(const TDesC8 &aContent)[pure virtual]
Sets the content to the element. Old content is overwritten.
Since
Series60 3.0

Parameters

const TDesC8 & aContentThe content to be set. Can be KNullDesC8.

SetNamespaceL(const TDesC8 &)

voidSetNamespaceL(const TDesC8 &aNsUri)[pure virtual]
Setter for Element's namespace URI.
Since
Series60 3.0

Parameters

const TDesC8 & aNsUri

SetNamespaceL(const TDesC8 &, const TDesC8 &)

voidSetNamespaceL(const TDesC8 &aNsPrefix,
const TDesC8 &aNsUri
)[pure virtual]
Setter for Element's namespace URI.
Since
Series60 3.0

Parameters

const TDesC8 & aNsPrefix
const TDesC8 & aNsUri

SetParent(CSenElement *)

CSenElement *SetParent(CSenElement *apParent)[pure virtual]

From MSenElement Sets the parent element to this element. Notice that the element is not automatically added as a child of the parent. Parent's AddElementL() must be called to achieve that.

Since
Series60 3.0

Parameters

CSenElement * apParent

SetPrefixL(const TDesC8 &)

voidSetPrefixL(const TDesC8 &aPrefix)[pure virtual]
Setter for namespace prefix of this element.
Since
Series60 3.0

Parameters

const TDesC8 & aPrefix

WriteAsXMLToL(RWriteStream &)

voidWriteAsXMLToL(RWriteStream &aWriteStream)[pure virtual]
Element writes itself to a write stream using UTF-8 character-set encoding.
Since
Series60 3.0

Parameters

RWriteStream & aWriteStreamThe stream to write to.

WriteNamespacesToL(RWriteStream &)

voidWriteNamespacesToL(RWriteStream &aWriteStream)[pure virtual]
Element writes its namespaces to a write stream using UTF-8 character-set encoding.
Since
Series60 3.0

Parameters

RWriteStream & aWriteStreamThe stream to write to.