kjs_proxy.h
00001
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 class KJSDebugWin;
00031
00032 namespace DOM {
00033 class Node;
00034 class EventListener;
00035 class Event;
00036 };
00037
00038 namespace KJS {
00039 class List;
00040 class Interpreter;
00041 }
00042
00048 class KJSProxy {
00049 public:
00050 KJSProxy() { m_handlerLineno = 0; }
00051 virtual ~KJSProxy() { }
00052 virtual QVariant evaluate(QString filename, int baseLine, const QString &, const DOM::Node &n) = 0;
00053 virtual void clear() = 0;
00054 virtual DOM::EventListener *createHTMLEventHandler(QString sourceUrl, QString code) = 0;
00055 virtual void finishedWithEvent(const DOM::Event &event) = 0;
00056 virtual KJS::Interpreter *interpreter() = 0;
00057
00058 virtual void setDebugEnabled(bool enabled) = 0;
00059 virtual bool paused() const = 0;
00060 virtual void setSourceFile(QString url, QString code) = 0;
00061 virtual void appendSourceFile(QString url, QString code) = 0;
00062
00063 void setEventHandlerLineno(int lineno) { m_handlerLineno = lineno; }
00064
00065 KHTMLPart *m_part;
00066 int m_handlerLineno;
00067
00068
00069 static KJSProxy *proxy( KHTMLPart *part );
00070 };
00071
00072 class KJSCPUGuard {
00073 public:
00074 KJSCPUGuard() {}
00075 void start(unsigned int msec=5000, unsigned int i_msec=10000);
00076 void stop();
00077 private:
00078 void (*oldAlarmHandler)(int);
00079 static void alarmHandler(int);
00080 itimerval oldtv;
00081 };
00082
00083 #endif
This file is part of the documentation for kdelibs Version 3.1.0.