kjs_proxy.h 1.85 KB
Newer Older
kocienda's avatar
kocienda committed
1 2 3
/*
 *  This file is part of the KDE libraries
 *  Copyright (C) 1999 Harri Porten (porten@kde.org)
4
 *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
kocienda's avatar
kocienda committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

darin's avatar
darin committed
21 22
#ifndef KJS_PROXY_H
#define KJS_PROXY_H
kocienda's avatar
kocienda committed
23

darin's avatar
darin committed
24
class DeprecatedString;
kocienda's avatar
kocienda committed
25

26
namespace KJS {
darin's avatar
darin committed
27
    class JSValue;
28 29 30 31 32
    class ScriptInterpreter;
}

namespace WebCore {

darin's avatar
darin committed
33 34
class String;
class Event;
darin's avatar
darin committed
35 36
class EventListener;
class Frame;
darin's avatar
darin committed
37
class Node;
kocienda's avatar
kocienda committed
38

darin's avatar
darin committed
39
class KJSProxy {
kocienda's avatar
kocienda committed
40
public:
darin's avatar
darin committed
41 42 43
    KJSProxy(Frame*);
    ~KJSProxy();
    KJS::JSValue* evaluate(const String& filename, int baseLine, const String& code, Node*);
darin's avatar
darin committed
44
    void clear(bool clearWindowProperties);
darin's avatar
darin committed
45
    EventListener* createHTMLEventHandler(const String& functionName, const String& code, Node*);
46
#if SVG_SUPPORT
darin's avatar
darin committed
47
    EventListener* createSVGEventHandler(const String& functionName, const String& code, Node*);
48
#endif
darin's avatar
darin committed
49
    void finishedWithEvent(Event*);
eseidel's avatar
eseidel committed
50 51
    KJS::ScriptInterpreter *interpreter();
    void setEventHandlerLineno(int lineno) { m_handlerLineno = lineno; }
kocienda's avatar
kocienda committed
52

ggaren's avatar
ggaren committed
53
    void initScriptIfNeeded();
kocienda's avatar
kocienda committed
54

darin's avatar
darin committed
55 56
    bool haveInterpreter() const { return m_script; }

eseidel's avatar
eseidel committed
57 58
private:
    KJS::ScriptInterpreter* m_script;
mjs's avatar
mjs committed
59
    Frame *m_frame;
eseidel's avatar
eseidel committed
60
    int m_handlerLineno;
61
};
kocienda's avatar
kocienda committed
62

63 64
}

kocienda's avatar
kocienda committed
65
#endif