2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Class offers basic implementation of an XML attribute
25 #ifndef SEN_BASE_ATTRIBUTE_H
26 #define SEN_BASE_ATTRIBUTE_H
35 * Class offers basic implementation of an XML attribute
36 * XML attribute is a name-value pair type value object,
37 * which may or may not have a namespace prefix. Note
38 * that both name and value may contain a namespace prefix.
42 class CSenBaseAttribute : public CBase
44 public: // Constructors and destructor
47 * Basic two-phased constructor.
49 * @param aName: Name of the attribute
50 * @param aValue: Attribute's value.
52 * KErrSenInvalidCharacters if aName contains illegal characters.
53 * KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
55 IMPORT_C static CSenBaseAttribute* NewL(const TDesC8& aName,
56 const TDesC8& aValue);
61 * @param aQName: Qualified name of the attribute
62 * @param aName: Name of the attribute
63 * @param aValue: Attribute's value.
65 * KErrSenInvalidCharacters if aName or aQName contain
67 * KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
69 IMPORT_C static CSenBaseAttribute* NewL(const TDesC8& aQName,
71 const TDesC8& aValue);
76 IMPORT_C virtual ~CSenBaseAttribute();
81 * Getter for the attribute name.
83 * @return the attribute name.
85 virtual const TDesC8& Name() const;
88 * Getter for the attribute value.
90 * @return the attribute value.
92 virtual const TDesC8& Value() const;
95 * Setter for the attribute value.
97 * @param aValue: value to be set
98 * @return the new value.
100 virtual const TDesC8& SetValueL(const TDesC8& aValue);
105 * C++ default constructor
106 * @since Series60 3.0
108 IMPORT_C CSenBaseAttribute();
111 * Following BaseConstructL methods should be called from the deriving
112 * classes ConstructL() methods. Parameter info is found in the
113 * corresponding NewL-methods.
114 * @since Series60 3.0
115 * @param aName is the name of this attribute. Cannot contain characters
116 * that are illegal in XML (like basic entities in decoded form)
117 * @param aValue is the value of this attribute. Cannot contain characters
118 * that are illegal in XML (like basic entities in decoded form)
120 IMPORT_C void BaseConstructL(const TDesC8& aName,
121 const TDesC8& aValue);
124 * @since Series60 3.0
125 * @param aName is the name of this attribute. Cannot contain characters
126 * that are illegal in XML (like basic entities in decoded form)
127 * @param aQName is the qualified, prefixed name of this XML attribute.
128 * Cannot contain characters which are illegal in XML.
129 * @param aValue is the value of this attribute. Cannot contain characters
130 * that are illegal in XML (like basic entities in decoded form)
132 IMPORT_C void BaseConstructL(const TDesC8& aName,
133 const TDesC8& aQName,
134 const TDesC8& aValue);
141 #endif // SEN_BASE_ATTRIBUTE_H