kjs_proxy.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _KJS_PROXY_H_
00023 #define _KJS_PROXY_H_
00024
00025 #include <qvariant.h>
00026 #include <qstring.h>
00027 #include <sys/time.h>
00028
00029 class KHTMLPart;
00030
00031 namespace DOM {
00032 class Node;
00033 class NodeImpl;
00034 class EventListener;
00035 class Event;
00036 }
00037
00038 namespace KJS {
00039 class List;
00040 class Interpreter;
00041 class Completion;
00042 class KJSDebugWin;
00043 }
00044
00045 namespace khtml {
00046 class ChildFrame;
00047 }
00048
00054 class KJSProxy {
00055 public:
00056 KJSProxy() { m_handlerLineno = 0; }
00057 virtual ~KJSProxy() { }
00058 virtual QVariant evaluate(QString filename, int baseLine, const QString &, const DOM::Node &n,
00059 KJS::Completion *completion = 0) = 0;
00060 virtual void clear() = 0;
00061 virtual DOM::EventListener *createHTMLEventHandler(QString sourceUrl, QString name, QString code, DOM::NodeImpl* node) = 0;
00062 virtual void finishedWithEvent(const DOM::Event &event) = 0;
00063 virtual KJS::Interpreter *interpreter() = 0;
00064
00065 virtual void setDebugEnabled(bool enabled) = 0;
00066 virtual void showDebugWindow(bool show=true) = 0;
00067 virtual bool paused() const = 0;
00068 virtual void dataReceived() = 0;
00069
00070 void setEventHandlerLineno(int lineno) { m_handlerLineno = lineno; }
00071
00072 khtml::ChildFrame *m_frame;
00073 int m_handlerLineno;
00074
00075
00076 static KJSProxy *proxy( KHTMLPart *part );
00077 };
00078
00079 class KJSCPUGuard {
00080 public:
00081 KJSCPUGuard() {}
00082 void start(unsigned int msec=5000, unsigned int i_msec=10000);
00083 void stop();
00084 private:
00085 void (*oldAlarmHandler)(int);
00086 static void alarmHandler(int);
00087 static bool confirmTerminate();
00088 itimerval oldtv;
00089 };
00090
00091 #endif
|