epoc32/include/mw/senbaseattribute.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:        Class offers basic implementation of an XML attribute
    15 *
    16 */
    17 
    18 
    19 
    20 
    21 
    22 
    23 
    24 
    25 #ifndef SEN_BASE_ATTRIBUTE_H
    26 #define SEN_BASE_ATTRIBUTE_H
    27 
    28 //  INCLUDES
    29 #include <e32base.h>
    30 #include <s32strm.h>
    31 
    32 // CLASS DECLARATION
    33 
    34 /**
    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.
    39 *  @lib SenXML.dll
    40 *  @since Series60 3.0
    41 */
    42 class CSenBaseAttribute : public CBase
    43     {
    44     public:  // Constructors and destructor
    45 
    46         /**
    47          *  Basic two-phased constructor.
    48          *  @since Series60 3.0
    49          *  @param aName:   Name of the attribute
    50          *  @param aValue:  Attribute's value.
    51          *  Leave codes:    
    52          *      KErrSenInvalidCharacters if aName contains illegal characters.      
    53          *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
    54          */
    55         IMPORT_C static CSenBaseAttribute* NewL(const TDesC8& aName,
    56                                                 const TDesC8& aValue);
    57 
    58         /**
    59          *  Basic constructor.
    60          *  @since Series60 3.0
    61          *  @param aQName:  Qualified name of the attribute
    62          *  @param aName:   Name of the attribute
    63          *  @param aValue:  Attribute's value.
    64          *  Leave codes:    
    65          *      KErrSenInvalidCharacters if aName or aQName contain 
    66          *      illegal characters.     
    67          *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
    68          */
    69         IMPORT_C static CSenBaseAttribute* NewL(const TDesC8& aQName,
    70                                                 const TDesC8& aName,
    71                                                 const TDesC8& aValue);
    72             
    73         /**
    74         * Destructor.
    75         */
    76         IMPORT_C virtual ~CSenBaseAttribute();
    77         
    78         // New functions
    79         
    80         /**
    81          * Getter for the attribute name.
    82          * @since Series60 3.0
    83          * @return the attribute name.
    84          */
    85         virtual const TDesC8& Name() const;
    86 
    87         /**
    88          * Getter for the attribute value.
    89          * @since Series60 3.0
    90          * @return the attribute value.
    91          */
    92         virtual const TDesC8& Value() const;
    93         
    94         /**
    95          * Setter for the attribute value.
    96          * @since Series60 3.0
    97          * @param aValue:   value to be set
    98          * @return the new value.
    99          */
   100         virtual const TDesC8& SetValueL(const TDesC8& aValue);
   101     
   102     protected:  
   103     
   104         /**
   105         * C++ default constructor
   106         * @since Series60 3.0
   107         */
   108         IMPORT_C CSenBaseAttribute();
   109     
   110         /**
   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)
   119          */
   120         IMPORT_C void BaseConstructL(const TDesC8& aName,
   121                                     const TDesC8& aValue);
   122 
   123         /**
   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)
   131         */
   132         IMPORT_C void BaseConstructL(const TDesC8& aName,
   133                                      const TDesC8& aQName,
   134                                      const TDesC8& aValue);
   135         
   136     private:    // Data
   137         HBufC8* ipName;
   138         HBufC8* ipValue;
   139     };
   140 
   141 #endif // SEN_BASE_ATTRIBUTE_H
   142 
   143 // End of File
   144