Search completed in 1.21 seconds.
2 results for "nsiprivatedomevent":
Creating Custom Events That Can Pass Data
Mozilla › Developer guide › Creating Custom Events That Can Pass Data
his: if (aEventType.LowerCaseEqualsLiteral("nsmyevent")){ //note: the lowercase is important! nsDOMEvent* it = new nsDOMMyEvent(aPresContext, aEvent); if (nsnull == it) { return NS_ERROR_OUT_OF_MEMORY; } return CallQueryInterface(it, aDOMEvent); } In general though I'd strongly recommend using a function the way that everyone else does. You can find the prototypes for the function in nsIPrivateDOMEvent. Your event In order for your event to work you must do the following: Create a scriptable interface called nsIDOM{YourEventName} inheriting from nsIDOMEvent. A good place to put this .idl is in mozilla/dom/public/idl/events/. #include "nsIDOMEvent.idl" [scriptable, uuid(08bea243-8a7b-4554-9ee9-70d7785d741b)] interface nsIDOMMyEvent: nsIDOMEvent { //put members here! }; Implement the inter...
...ddRefs(event)); //create the event event->InitEvent(NS_LITERAL_STRING("nsDOMMyEvent"), PR_TRUE, PR_TRUE); //initialize it tWindow = do_QueryInterface(aWindow); //use the window for a target. myEvent = do_QueryInterface(event); myEvent->SetMyProperty(45); //set my property of my event to (e.g.) 45. PRBool defaultActionEnabledWin; PRBool defaultActionEnabledDoc; nsCOMPtr<nsIPrivateDOMEvent> privEvt(do_QueryInterface(event)); privEvt->SetTrusted(PR_TRUE); //make the event trusted tWindow->DispatchEvent(event, &defaultActionEnabledWin); //dispatch it (i.e. send it out into the wild) ...
nsIDOMEvent
Mozilla › Tech › XPCOM › Reference › Interface › nsIDOMEvent
Everything marked as Gecko 16.0 was previously available in that interface. See bug 761613. ...