2009-11-13 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / plugin / firefox / ff-common.h
blobfd008f709f08ec88db9135cd41165919d4b8b96c
1 #ifndef FF_COMMON
2 #define FF_COMMON
4 // define this here so that protypes.h isn't included (and doesn't
5 // muck with our npapi.h)
6 #define NO_NSPR_10_SUPPORT
8 #include "plugin-class.h"
10 #include <nsCOMPtr.h>
11 #include <nsIDOMElement.h>
12 #include <nsIDOMRange.h>
13 #include <nsIDOMDocumentRange.h>
14 #include <nsIDOMDocument.h>
15 #include <nsIDOMWindow.h>
16 #include <nsStringAPI.h>
18 // Events
19 #include <nsIDOMEvent.h>
20 #include <nsIDOMMouseEvent.h>
21 #include <nsIDOMEventTarget.h>
22 #include <nsIDOMEventListener.h>
25 #ifdef DEBUG
26 #define DEBUG_WARN_NOTIMPLEMENTED(x) printf ("not implemented: (%s)\n" G_STRLOC, x)
27 #define d(x) x
28 #else
29 #define DEBUG_WARN_NOTIMPLEMENTED(x)
30 #define d(x)
31 #endif
33 // debug helper
34 #define ds(x)
36 #define STR_FROM_VARIANT(v) ((char *) NPVARIANT_TO_STRING (v).utf8characters)
38 static const MoonNameIdMapping
39 dom_event_mapping[] = {
40 { "stoppropagation", MoonId_StopPropagation },
41 { "preventdefault", MoonId_PreventDefault },
42 { "detail", MoonId_Detail}
45 struct FFDomEvent : MoonlightObject {
46 FFDomEvent (NPP instance) : MoonlightObject (instance) { }
48 virtual bool GetProperty (int id, NPIdentifier unmapped, NPVariant *result);
49 virtual bool Invoke (int id, NPIdentifier name,
50 const NPVariant *args, uint32_t argCount, NPVariant *result);
52 nsIDOMEvent * event;
55 struct FFDomEventType : MoonlightObjectType {
56 FFDomEventType ();
59 extern FFDomEventType *FFDomEventClass;
61 #endif