JSLazyEventListener.h [plain text]
#ifndef JSLazyEventListener_h
#define JSLazyEventListener_h
#include "JSEventListener.h"
#include "PlatformString.h"
namespace WebCore {
class Node;
class JSLazyEventListener : public JSProtectedEventListener {
public:
enum LazyEventListenerType {
HTMLLazyEventListener
#if ENABLE(SVG)
, SVGLazyEventListener
#endif
};
static PassRefPtr<JSLazyEventListener> create(LazyEventListenerType type, const String& functionName, const String& code, JSDOMGlobalObject* globalObject, Node* node, int lineNumber)
{
return adoptRef(new JSLazyEventListener(type, functionName, code, globalObject, node, lineNumber));
}
private:
JSLazyEventListener(LazyEventListenerType, const String& functionName, const String& code, JSDOMGlobalObject*, Node*, int lineNumber);
virtual JSC::JSObject* function() const;
virtual bool wasCreatedFromMarkup() const { return true; }
void parseCode() const;
mutable String m_functionName;
mutable String m_code;
mutable bool m_parsed;
int m_lineNumber;
Node* m_originalNode;
LazyEventListenerType m_type;
};
}
#endif // JSEventListener_h