KHtml

kjs_proxy.h
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (C) 1999 Harri Porten ([email protected])
4  * Copyright (C) 2001 Peter Kelly ([email protected])
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
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef _KJS_PROXY_H_
22 #define _KJS_PROXY_H_
23 
24 #include <QVariant>
25 #include <QString>
26 #include <wtf/RefPtr.h>
27 
28 class KHTMLPart;
29 
30 namespace DOM
31 {
32 class Node;
33 class NodeImpl;
34 class EventListener;
35 class Event;
36 }
37 
38 namespace KJS
39 {
40 class List;
41 class Interpreter;
42 class Completion;
43 class ScriptInterpreter;
44 }
45 
46 namespace KJSDebugger
47 {
48 class DebugWindow;
49 }
50 
51 namespace khtml
52 {
53 class ChildFrame;
54 }
55 
56 /**
57  * @internal
58  *
59  * @short Proxy class serving as interface when being dlopen'ed.
60  */
61 class KJSProxy
62 {
63 public:
64  KJSProxy(khtml::ChildFrame *frame);
65  ~KJSProxy();
66 
67  QVariant evaluate(QString filename, int baseLine, const QString &, const DOM::Node &n,
68  KJS::Completion *completion = nullptr);
69  void clear();
70 
71  DOM::EventListener *createHTMLEventHandler(QString sourceUrl, QString name, QString code, DOM::NodeImpl *node, bool svg = false);
72  void finishedWithEvent(const DOM::Event &event);
73  KJS::Interpreter *interpreter();
74 
75  bool isRunningScript();
76 
77  void setDebugEnabled(bool enabled);
78  bool debugEnabled() const;
79  void showDebugWindow(bool show = true);
80 
81  bool paused() const;
82 
83  void setEventHandlerLineno(int lineno)
84  {
85  m_handlerLineno = lineno;
86  }
87 
88  // Helper method, to access the private KHTMLPart::jScript()
89  static KJSProxy *proxy(KHTMLPart *part);
90 private:
91  void initScript();
92  void applyUserAgent();
93 
94  khtml::ChildFrame *m_frame;
95  int m_handlerLineno;
96 
97  KJS::ScriptInterpreter *m_script;
98 #ifdef KJS_DEBUGGER
99  WTF::RefPtr<KJSDebugger::DebugWindow> m_debugWindow;
100 #endif
101  bool m_debugEnabled;
102  int m_running;
103 #ifndef NDEBUG
104  static int s_count;
105 #endif
106 };
107 
108 #endif
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:278
This file is part of the HTML rendering engine for KDE.
Proxy class serving as interface when being dlopen&#39;ed.
Definition: kjs_proxy.h:61
This class is khtml&#39;s main class.
Definition: khtml_part.h:208
We inherit from Interpreter, to save a pointer to the HTML part that the interpreter runs for...
Definition: kjs_binding.h:96
Introduced in DOM Level 2.
Definition: dom2_events.h:69
This library provides a full-featured HTML parser and widget.
Introduced in DOM Level 2.
Definition: dom2_events.h:116
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.