Home | History | Annotate | Download | only in js
      1 /*
      2  *  Copyright (C) 2001 Peter Kelly (pmk (at) post.com)
      3  *  Copyright (C) 2003, 2008, 2009 Apple Inc. All rights reserved.
      4  *
      5  *  This library is free software; you can redistribute it and/or
      6  *  modify it under the terms of the GNU Lesser General Public
      7  *  License as published by the Free Software Foundation; either
      8  *  version 2 of the License, or (at your option) any later version.
      9  *
     10  *  This library is distributed in the hope that it will be useful,
     11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13  *  Lesser General Public License for more details.
     14  *
     15  *  You should have received a copy of the GNU Lesser General Public
     16  *  License along with this library; if not, write to the Free Software
     17  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
     18  */
     19 
     20 #ifndef JSLazyEventListener_h
     21 #define JSLazyEventListener_h
     22 
     23 #include "JSEventListener.h"
     24 #include "PlatformString.h"
     25 
     26 namespace WebCore {
     27 
     28     class Node;
     29 
     30     class JSLazyEventListener : public JSEventListener {
     31     public:
     32         static PassRefPtr<JSLazyEventListener> create(const String& functionName, const String& eventParameterName, const String& code, Node* node, const String& sourceURL, int lineNumber, JSC::JSObject* wrapper, DOMWrapperWorld* isolatedWorld)
     33         {
     34             return adoptRef(new JSLazyEventListener(functionName, eventParameterName, code, node, sourceURL, lineNumber, wrapper, isolatedWorld));
     35         }
     36         virtual ~JSLazyEventListener();
     37 
     38     private:
     39         JSLazyEventListener(const String& functionName, const String& eventParameterName, const String& code, Node*, const String& sourceURL, int lineNumber, JSC::JSObject* wrapper, DOMWrapperWorld* isolatedWorld);
     40 
     41         virtual JSC::JSObject* initializeJSFunction(ScriptExecutionContext*) const;
     42         virtual bool wasCreatedFromMarkup() const { return true; }
     43 
     44         mutable String m_functionName;
     45         mutable String m_eventParameterName;
     46         mutable String m_code;
     47         mutable String m_sourceURL;
     48         int m_lineNumber;
     49         Node* m_originalNode;
     50     };
     51 
     52 } // namespace WebCore
     53 
     54 #endif // JSEventListener_h
     55