epoc32/include/mw/sennamespace.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 sennamespace.h
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:        Implementation of XML namespace functionality
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef SEN_NAME_SPACE_H
       
    26 #define SEN_NAME_SPACE_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include <e32base.h>
       
    30 #include <s32mem.h>
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 * Implementation of XML namespace functionality
       
    36 * All data is in UTF-8 form.
       
    37 * @lib SenXML.dll
       
    38 * @since Series60 3.0
       
    39 */
       
    40 class CSenNamespace :   public CBase
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43         
       
    44         /**
       
    45          * Basic constructor.
       
    46          * @param   aPrefix The prefix for the namespace.
       
    47          * @param   aUri    The namespace uri for the namespace.
       
    48          */
       
    49         IMPORT_C static CSenNamespace* NewL(const TDesC8& aPrefix,
       
    50                                             const TDesC8& aUri);
       
    51         /**
       
    52          * Basic constructor.
       
    53          * @param   aPrefix The prefix for the namespace.
       
    54          * @param   aUri    The namespace uri for the namespace.
       
    55          */
       
    56         IMPORT_C static CSenNamespace* NewLC(const TDesC8& aPrefix,
       
    57                                              const TDesC8& aUri);
       
    58         /**
       
    59          * Basic constructor.
       
    60          * @param   aUri    The namespace uri for the namespace.
       
    61          */
       
    62         IMPORT_C static CSenNamespace* NewL(const TDesC8& aUri);
       
    63 
       
    64         /**
       
    65          * Basic constructor.
       
    66          * @param   aUri    The namespace uri for the namespace.
       
    67          */
       
    68         IMPORT_C static CSenNamespace* NewLC(const TDesC8& aUri);
       
    69 
       
    70         /**
       
    71         * Destructor.
       
    72         */
       
    73         IMPORT_C virtual ~CSenNamespace();
       
    74         
       
    75     public: // New functions
       
    76         
       
    77         /**
       
    78          * Getter for the URI of the namespace object.
       
    79          * @return  The URI
       
    80          */
       
    81         IMPORT_C const TDesC8& URI() const;
       
    82 
       
    83         /**
       
    84          * Getter for the prefix of the namespace object.
       
    85          * @return  The prefix
       
    86          */
       
    87         IMPORT_C const TDesC8& Prefix() const;
       
    88 
       
    89         /**
       
    90          * Setter for the URI of the namespace object.
       
    91          * @param aUri  The URI.
       
    92          */
       
    93         IMPORT_C void SetUriL(const TDesC8& aUri);
       
    94 
       
    95         /**
       
    96          * Setter for the prefix of the namespace object.
       
    97          * @param aPrefix   The prefix.
       
    98          */
       
    99         IMPORT_C void SetPrefixL(const TDesC8& aPrefix);
       
   100 
       
   101         /**
       
   102          * Method for comparing the namespace object to other prefix 
       
   103          * and URI.
       
   104          * @param aOtherPrefix  The prefix to be compared to
       
   105          * @param aOtherUri     The URI to be compared to.
       
   106          * @return ETrue if both of the parameters were matching to the 
       
   107          *               object's corresponding ones. EFalse otherwise
       
   108          */
       
   109         IMPORT_C TBool Compare(const TDesC8& aOtherPrefix,
       
   110                                const TDesC8& aOtherUri) const;
       
   111 
       
   112         /**
       
   113          * Method for comparing the namespace object to other namespace 
       
   114          * object.
       
   115          * @param aOtherNamespace       The namespace to be compared to.
       
   116          * @return ETrue if the given namespace has same URI and prefix as the
       
   117          *              current one. EFalse otherwise.
       
   118          */
       
   119         IMPORT_C TBool Compare(const CSenNamespace& aOtherNamespace) const;
       
   120         
       
   121         /**
       
   122          * Method for comparing the namespace object to other namespace 
       
   123          * object. Differs from Compare(...) methods so that this one
       
   124          * compares only URIs.
       
   125          * @return  ETrue   if the given namespace has the same URI as 
       
   126          *                  the current one. EFalse otherwise.
       
   127          */
       
   128         IMPORT_C TBool MatchesL(const CSenNamespace& aOtherNamespace) const;
       
   129 
       
   130         /**
       
   131          * Method to ask this namespace object to write itself into a 
       
   132          * writestream. Doesn't write anything if no URI has been set.
       
   133          * @param aWs   The writestream where object should be written.
       
   134          */
       
   135         IMPORT_C void InsertL(RBufWriteStream& aWs);
       
   136     
       
   137     private:
       
   138 
       
   139         /**
       
   140         * C++ default constructor.
       
   141         */
       
   142         CSenNamespace();
       
   143 
       
   144         /**
       
   145         * By default Symbian 2nd phase constructor is private.
       
   146         */
       
   147         void ConstructL(const TDesC8& aPrefix, const TDesC8& aUri);
       
   148 
       
   149     private: // Data
       
   150         HBufC8* ipPrefix;
       
   151         HBufC8* ipUri;
       
   152     };
       
   153 
       
   154 #endif // SEN_NAME_SPACE_H
       
   155 
       
   156 // End of File
       
   157 
       
   158 
       
   159