KHTML
QualifiedName.h
Go to the documentation of this file.00001 /* 00002 * This file is part of the DOM implementation for KDE. 00003 * 00004 * Copyright (C) 2005 Apple Computer, Inc. 00005 * Copyright (C) 2008 Vyacheslav Tokarev (tsjoker@gmail.com) 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Library General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Library General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Library General Public License 00018 * along with this library; see the file COPYING.LIB. If not, write to 00019 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 * Boston, MA 02110-1301, USA. 00021 * 00022 */ 00023 #ifndef _DOM_QUALIFIEDNAME_h_ 00024 #define _DOM_QUALIFIEDNAME_h_ 00025 00026 #include "misc/idstring.h" 00027 #include "misc/htmlnames.h" 00028 00029 namespace DOM { 00030 00031 /*class DOMString; 00032 class PrefixName; 00033 class LocalName; 00034 class NamespaceName;*/ 00035 00036 class QualifiedName { 00037 public: 00038 QualifiedName() {} 00039 QualifiedName(PrefixName prefix, LocalName localName, NamespaceName namespaceURI) : m_namespace(namespaceURI), m_prefix(prefix), m_localName(localName) {} 00040 QualifiedName(const DOMString& prefix, const DOMString& localName, const DOMString& namespaceURI); 00041 QualifiedName(int prefix, int localName, int namespaceName); 00042 //QualifiedName(DOMString namespaceURI, DOMString prefix, DOMString localName); 00043 QualifiedName(quint32 id, PrefixName prefix); 00044 ~QualifiedName() {} 00045 00046 QualifiedName(const QualifiedName& name); 00047 const QualifiedName& operator=(const QualifiedName& name); 00048 00049 bool operator==(const QualifiedName& other) const; 00050 //inline bool operator!=(const QualifiedName& other) const { return (m_prefix != other.prefixId() || m_localName != other.localNameId() || m_namespace != other.namespaceNameId()); } 00051 00052 bool matches(const QualifiedName& other) const; 00053 00054 inline bool hasPrefix() const; 00055 void setPrefix(const PrefixName& prefix); 00056 void setPrefix(const DOMString& prefix); 00057 00058 inline PrefixName prefixId() const { return m_prefix; } 00059 inline LocalName localNameId() const { return m_localName; } 00060 inline NamespaceName namespaceNameId() const { return m_namespace; } 00061 unsigned id() const; 00062 00063 DOMString tagName() const; 00064 00065 DOMString prefix() const; 00066 DOMString localName() const; 00067 DOMString namespaceURI() const; 00068 00069 DOMString toString() const; 00070 00071 private: 00072 NamespaceName m_namespace; 00073 PrefixName m_prefix; 00074 LocalName m_localName; 00075 }; 00076 00077 } 00078 00079 #endif 00080 // kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;