• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • khtml
  • svg
SVGElementInstance.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
3
4 This file is part of the KDE project
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#ifndef SVGElementInstance_h
23#define SVGElementInstance_h
24
25#if ENABLE(SVG)
26
27/*#include "EventTarget.h"*/
28#include "Document.h" //khtml
29
30#include <wtf/RefPtr.h>
31#include <wtf/PassRefPtr.h>
32
33namespace WebCore {
34 class SVGElement;
35 class SVGUseElement;
36 class SVGElementInstanceList;
37
38 class SVGElementInstance /*: public EventTarget*/ {
39 public:
40 SVGElementInstance(SVGUseElement*, PassRefPtr<SVGElement> originalElement);
41 virtual ~SVGElementInstance();
42
43 // 'SVGElementInstance' functions
44 SVGElement* correspondingElement() const;
45 SVGUseElement* correspondingUseElement() const;
46
47 SVGElementInstance* parentNode() const;
48 PassRefPtr<SVGElementInstanceList> childNodes();
49
50 SVGElementInstance* previousSibling() const;
51 SVGElementInstance* nextSibling() const;
52
53 SVGElementInstance* firstChild() const;
54 SVGElementInstance* lastChild() const;
55
56 // Internal usage only!
57 SVGElement* shadowTreeElement() const;
58 void setShadowTreeElement(SVGElement*);
59
60 // Model the TreeShared concept, integrated within EventTarget inheritance.
61 virtual void refEventTarget() { ++m_refCount; }
62 virtual void derefEventTarget() { if (--m_refCount <= 0 && !m_parent) delete this; }
63 // khtml compat
64 virtual void ref() { refEventTarget(); }
65 virtual void deref() { derefEventTarget(); }
66
67 bool hasOneRef() { return m_refCount == 1; }
68 int refCount() const { return m_refCount; }
69
70 void setParent(SVGElementInstance* parent) { m_parent = parent; }
71 SVGElementInstance* parent() const { return m_parent; }
72
73 // SVGElementInstance supports both toSVGElementInstance and toNode since so much mouse handling code depends on toNode returning a valid node.
74 virtual EventTargetNode* toNode();
75 virtual SVGElementInstance* toSVGElementInstance();
76
77 virtual void addEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
78 virtual void removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture);
79 virtual bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&, bool tempEvent = false);
80
81 private:
82 SVGElementInstance(const SVGElementInstance&);
83 SVGElementInstance& operator=(const SVGElementInstance&);
84
85 private: // Helper methods
86 friend class SVGUseElement;
87 void appendChild(PassRefPtr<SVGElementInstance> child);
88
89 friend class SVGStyledElement;
90 void updateInstance(SVGElement*);
91
92 private:
93 int m_refCount;
94 SVGElementInstance* m_parent;
95
96 SVGUseElement* m_useElement;
97 RefPtr<SVGElement> m_element;
98 SVGElement* m_shadowTreeElement;
99
100 SVGElementInstance* m_previousSibling;
101 SVGElementInstance* m_nextSibling;
102
103 SVGElementInstance* m_firstChild;
104 SVGElementInstance* m_lastChild;
105 };
106
107} // namespace WebCore
108
109#endif // ENABLE(SVG)
110#endif
111
112// vim:ts=4:noet
deref
void deref()
ref
void ref()
WebCore
Definition: CSSHelper.h:7
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal