nsIEventQueueService

IID:a6cf90dc-15b3-11d2-932e-00805f8add32
Inherits From:nsISupports

This interface is intended to be used as a service. To create an object implementing this interface:

var obj = Components.classes["@mozilla.org/event-queue-service;1"].
            getService(Components.interfaces.nsIEventQueueService);

This interface is implemented by the following components:


Constants

PRInt32 CURRENT_THREAD_EVENT_QUEUE = 0
PRInt32 UI_THREAD_EVENT_QUEUE = 1

Methods

nsIEventQueue createFromIThread ( nsIThread thread , PRBool native ) [noscript] nsIEventQueue createFromPLEventQueue ( PLEventQueuePtr* PLEventQueue ) void createMonitoredThreadEventQueue ( ) void createThreadEventQueue ( ) void destroyThreadEventQueue ( ) nsIEventQueue getSpecialEventQueue ( PRInt32 queue ) [noscript] nsIEventQueue getThreadEventQueue ( PRThreadPtr* thread ) void popThreadEventQueue ( nsIEventQueue queue ) nsIEventQueue pushThreadEventQueue ( ) [noscript] nsIEventQueue resolveEventQueue ( nsIEventQueue queueOrConstant )

nsIEventQueue createFromIThread ( nsIThread thread , PRBool native )

Arguments:
thread
native

nsIEventQueue createFromPLEventQueue ( PLEventQueuePtr* PLEventQueue )

Arguments:
PLEventQueue

void createMonitoredThreadEventQueue ( )

Creates and hold a monitored event queue for the current thread. "Monitored" queues have no callback processing mechanism.

Returns:
NS_OK on success, or a host of failure indications

void createThreadEventQueue ( )

Creates and holds a native event queue for the current thread. "Native" queues have an associated callback mechanism which is automatically triggered when an event is posted. See plevent.c for details.

Returns:
NS_OK on success, or a host of failure indications

void destroyThreadEventQueue ( )

Somewhat misnamed, this method releases the service's hold on the event queue(s) for this thread. Subsequent attempts to access this thread's queue (GetThreadEventQueue, for example) may fail, though the queue itself will be destroyed only after all references to it are released and the queue itself is no longer actively processing events.

Returns:
nonsense.

nsIEventQueue getSpecialEventQueue ( PRInt32 queue )

Returns the appropriate special event queue, AddRef()ed. Really just a scriptable version of ResolveEventQueue.

Arguments:
queue
Returns:
nsIEventQueue, AddRef()ed

nsIEventQueue getThreadEventQueue ( PRThreadPtr* thread )

Arguments:
thread

void popThreadEventQueue ( nsIEventQueue queue )

Arguments:
queue

nsIEventQueue pushThreadEventQueue ( )


nsIEventQueue resolveEventQueue ( nsIEventQueue queueOrConstant )

Check for any "magic" event queue constants (NS_CURRENT_EVENTQ, NS_UI_THREAD_EVENTQ) and return the real event queue that they represent, AddRef()ed. Otherwise, return the event queue passed in, AddRef()ed. This is not scriptable because the arguments in question may be magic constants rather than real nsIEventQueues.

Arguments:
queueOrConstant
Returns:
a real event queue, AddRef()ed

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com