KHtml

QualifiedName.h
1 /*
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright (C) 2005 Apple Computer, Inc.
5  * Copyright (C) 2008 Vyacheslav Tokarev ([email protected])
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  */
23 #ifndef _DOM_QUALIFIEDNAME_h_
24 #define _DOM_QUALIFIEDNAME_h_
25 
26 #include "misc/idstring.h"
27 #include "misc/htmlnames.h"
28 
29 namespace DOM
30 {
31 
32 /*class DOMString;
33 class PrefixName;
34 class LocalName;
35 class NamespaceName;*/
36 
37 class QualifiedName
38 {
39 public:
40  QualifiedName() {}
41  QualifiedName(PrefixName prefix, LocalName localName, NamespaceName namespaceURI) : m_namespace(namespaceURI), m_prefix(prefix), m_localName(localName) {}
42  QualifiedName(const DOMString &prefix, const DOMString &localName, const DOMString &namespaceURI);
43  QualifiedName(int prefix, int localName, int namespaceName);
44  //QualifiedName(DOMString namespaceURI, DOMString prefix, DOMString localName);
45  QualifiedName(quint32 id, PrefixName prefix);
46  ~QualifiedName() {}
47 
48  QualifiedName(const QualifiedName &name);
49  const QualifiedName &operator=(const QualifiedName &name);
50 
51  bool operator==(const QualifiedName &other) const;
52  //inline bool operator!=(const QualifiedName& other) const { return (m_prefix != other.prefixId() || m_localName != other.localNameId() || m_namespace != other.namespaceNameId()); }
53 
54  bool matches(const QualifiedName &other) const;
55 
56  inline bool hasPrefix() const;
57  void setPrefix(const PrefixName &prefix);
58  void setPrefix(const DOMString &prefix);
59 
60  inline PrefixName prefixId() const
61  {
62  return m_prefix;
63  }
64  inline LocalName localNameId() const
65  {
66  return m_localName;
67  }
68  inline NamespaceName namespaceNameId() const
69  {
70  return m_namespace;
71  }
72  unsigned id() const;
73 
74  DOMString tagName() const;
75 
76  DOMString prefix() const;
77  DOMString localName() const;
78  DOMString namespaceURI() const;
79 
80  DOMString toString() const;
81 
82 private:
83  NamespaceName m_namespace;
84  PrefixName m_prefix;
85  LocalName m_localName;
86 };
87 
88 }
89 
90 #endif
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
This library provides a full-featured HTML parser and widget.
char * toString(const T &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:06 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.