KHtml

html_elementimpl.h
1 /*
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright (C) 1999 Lars Knoll ([email protected])
5  * (C) 1999 Antti Koivisto ([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 HTML_ELEMENTIMPL_H
24 #define HTML_ELEMENTIMPL_H
25 
26 #include "xml/dom_elementimpl.h"
27 
28 namespace DOM
29 {
30 
31 class DOMString;
32 class DocumentFragment;
33 
34 class HTMLElementImpl : public ElementImpl
35 {
36 public:
37  HTMLElementImpl(DocumentImpl *doc);
38 
39  virtual ~HTMLElementImpl();
40 
41  bool isHTMLElement() const override
42  {
43  return true;
44  }
45 
46  bool isInline() const override;
47 
48  Id id() const override = 0;
49  DOMString namespaceURI() const override;
50 
51  void parseAttribute(AttributeImpl *token) override;
52 
53  void addCSSLength(int id, const DOMString &value, bool numOnly = false, bool multiLength = false);
54  void addCSSProperty(int id, const DOMString &value);
55  void addCSSProperty(int id, int value);
56  void addHTMLColor(int id, const DOMString &c);
57  void removeCSSProperty(int id);
58 
59  void recalcStyle(StyleChange) override;
60 
61  DOMString innerHTML() const;
62  DOMString innerText() const;
63  DocumentFragment createContextualFragment(const DOMString &html);
64  void setInnerHTML(const DOMString &html, int &exceptioncode);
65  void setInnerText(const DOMString &text, int &exceptioncode);
66 
67  virtual DOMString contentEditable() const;
68  virtual void setContentEditable(AttributeImpl *attr);
69  virtual void setContentEditable(const DOMString &enabled);
70 
71  DOMString toString() const override;
72 
73 protected:
74  // for IMG, OBJECT and APPLET
75  void addHTMLAlignment(DOMString alignment);
76 };
77 
78 class HTMLGenericElementImpl : public HTMLElementImpl
79 {
80 public:
81  HTMLGenericElementImpl(DocumentImpl *doc, ushort i);
82  HTMLGenericElementImpl(DocumentImpl *doc, LocalName name);
83 
84  virtual ~HTMLGenericElementImpl();
85 
86  Id id() const override
87  {
88  return m_localName.id();
89  }
90 
91 protected:
92  LocalName m_localName;
93 };
94 
95 } //namespace
96 
97 #endif
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
int64_t Id
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:01 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.