williamr@2: /* williamr@2: * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Implementation of XML namespace functionality williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef SEN_NAME_SPACE_H williamr@2: #define SEN_NAME_SPACE_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Implementation of XML namespace functionality williamr@2: * All data is in UTF-8 form. williamr@2: * @lib SenXML.dll williamr@2: * @since Series60 3.0 williamr@2: */ williamr@2: class CSenNamespace : public CBase williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Basic constructor. williamr@2: * @param aPrefix The prefix for the namespace. williamr@2: * @param aUri The namespace uri for the namespace. williamr@2: */ williamr@2: IMPORT_C static CSenNamespace* NewL(const TDesC8& aPrefix, williamr@2: const TDesC8& aUri); williamr@2: /** williamr@2: * Basic constructor. williamr@2: * @param aPrefix The prefix for the namespace. williamr@2: * @param aUri The namespace uri for the namespace. williamr@2: */ williamr@2: IMPORT_C static CSenNamespace* NewLC(const TDesC8& aPrefix, williamr@2: const TDesC8& aUri); williamr@2: /** williamr@2: * Basic constructor. williamr@2: * @param aUri The namespace uri for the namespace. williamr@2: */ williamr@2: IMPORT_C static CSenNamespace* NewL(const TDesC8& aUri); williamr@2: williamr@2: /** williamr@2: * Basic constructor. williamr@2: * @param aUri The namespace uri for the namespace. williamr@2: */ williamr@2: IMPORT_C static CSenNamespace* NewLC(const TDesC8& aUri); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CSenNamespace(); williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Getter for the URI of the namespace object. williamr@2: * @return The URI williamr@2: */ williamr@2: IMPORT_C const TDesC8& URI() const; williamr@2: williamr@2: /** williamr@2: * Getter for the prefix of the namespace object. williamr@2: * @return The prefix williamr@2: */ williamr@2: IMPORT_C const TDesC8& Prefix() const; williamr@2: williamr@2: /** williamr@2: * Setter for the URI of the namespace object. williamr@2: * @param aUri The URI. williamr@2: */ williamr@2: IMPORT_C void SetUriL(const TDesC8& aUri); williamr@2: williamr@2: /** williamr@2: * Setter for the prefix of the namespace object. williamr@2: * @param aPrefix The prefix. williamr@2: */ williamr@2: IMPORT_C void SetPrefixL(const TDesC8& aPrefix); williamr@2: williamr@2: /** williamr@2: * Method for comparing the namespace object to other prefix williamr@2: * and URI. williamr@2: * @param aOtherPrefix The prefix to be compared to williamr@2: * @param aOtherUri The URI to be compared to. williamr@2: * @return ETrue if both of the parameters were matching to the williamr@2: * object's corresponding ones. EFalse otherwise williamr@2: */ williamr@2: IMPORT_C TBool Compare(const TDesC8& aOtherPrefix, williamr@2: const TDesC8& aOtherUri) const; williamr@2: williamr@2: /** williamr@2: * Method for comparing the namespace object to other namespace williamr@2: * object. williamr@2: * @param aOtherNamespace The namespace to be compared to. williamr@2: * @return ETrue if the given namespace has same URI and prefix as the williamr@2: * current one. EFalse otherwise. williamr@2: */ williamr@2: IMPORT_C TBool Compare(const CSenNamespace& aOtherNamespace) const; williamr@2: williamr@2: /** williamr@2: * Method for comparing the namespace object to other namespace williamr@2: * object. Differs from Compare(...) methods so that this one williamr@2: * compares only URIs. williamr@2: * @return ETrue if the given namespace has the same URI as williamr@2: * the current one. EFalse otherwise. williamr@2: */ williamr@2: IMPORT_C TBool MatchesL(const CSenNamespace& aOtherNamespace) const; williamr@2: williamr@2: /** williamr@2: * Method to ask this namespace object to write itself into a williamr@2: * writestream. Doesn't write anything if no URI has been set. williamr@2: * @param aWs The writestream where object should be written. williamr@2: */ williamr@2: IMPORT_C void InsertL(RBufWriteStream& aWs); williamr@2: williamr@2: private: williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: */ williamr@2: CSenNamespace(); williamr@2: williamr@2: /** williamr@2: * By default Symbian 2nd phase constructor is private. williamr@2: */ williamr@2: void ConstructL(const TDesC8& aPrefix, const TDesC8& aUri); williamr@2: williamr@2: private: // Data williamr@2: HBufC8* ipPrefix; williamr@2: HBufC8* ipUri; williamr@2: }; williamr@2: williamr@2: #endif // SEN_NAME_SPACE_H williamr@2: williamr@2: // End of File williamr@2: williamr@2: williamr@2: