Back to index

lightning-sunbird  0.9+nobinonly
nsIEventQueue.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Mozilla Communicator client code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   David Hyatt <hyatt@netscape.com>
00024  *   Suresh Duddi <dp@netscape.com>
00025  *   Doug Turner <dougt@netscape.com>
00026  *   Judson Valeski <valeski@netscape.com>
00027  *   Dan Matejka <danm@netscape.com>
00028  *   Ray Whitmer <rayw@netscape.com>
00029  *   Dan Mosedale <dmose@mozilla.org>
00030  *
00031  * Alternatively, the contents of this file may be used under the terms of
00032  * either of the GNU General Public License Version 2 or later (the "GPL"),
00033  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00034  * in which case the provisions of the GPL or the LGPL are applicable instead
00035  * of those above. If you wish to allow use of your version of this file only
00036  * under the terms of either the GPL or the LGPL, and not to allow others to
00037  * use your version of this file under the terms of the MPL, indicate your
00038  * decision by deleting the provisions above and replace them with the notice
00039  * and other provisions required by the GPL or the LGPL. If you do not delete
00040  * the provisions above, a recipient may use your version of this file under
00041  * the terms of any one of the MPL, the GPL or the LGPL.
00042  *
00043  * ***** END LICENSE BLOCK ***** */
00044 
00045 #include "nsIEventTarget.idl"
00046 
00047 %{C++
00048 #include "prthread.h"
00049 
00050 // {13D86C61-00A9-11d3-9F2A-00400553EEF0}
00051 #define NS_EVENTQUEUE_CID \
00052 { 0x13d86c61, 0xa9, 0x11d3, { 0x9f, 0x2a, 0x0, 0x40, 0x5, 0x53, 0xee, 0xf0 } }
00053 
00054 #define NS_EVENTQUEUE_CONTRACTID "@mozilla.org/event-queue;1"
00055 #define NS_EVENTQUEUE_CLASSNAME "Event Queue"
00056 
00057 %}
00058 
00059 // some forward decls
00060 //
00061 [ptr] native PLEventQueuePtr(PLEventQueue);
00062 [ptr] native PRThreadPtr(PRThread);
00063 native PRStatus(PRStatus);
00064 [ref] native PRBoolRef(PRBool);
00065 native PLHandleEventProc(PLHandleEventProc);
00066 native PLDestroyEventProc(PLDestroyEventProc);
00067 
00068 [scriptable, uuid(176AFB41-00A4-11d3-9F2A-00400553EEF0)]
00069 interface nsIEventQueue : nsIEventTarget
00070 {
00071     [noscript] void initEvent(in PLEventPtr aEvent, 
00072                               in voidPtr owner, 
00073                               in PLHandleEventProc handler, 
00074                               in PLDestroyEventProc destructor);
00075     
00076     [noscript] void postSynchronousEvent(in PLEventPtr aEvent, 
00077                                          out voidPtr aResult);
00078        
00079     boolean pendingEvents();
00080     void processPendingEvents();
00081     void eventLoop();
00082     
00083     [noscript] void eventAvailable(in PRBoolRef aResult);
00084     [noscript] PLEventPtr getEvent();
00085     [noscript] void handleEvent(in PLEventPtr aEvent);
00086     [noscript] PLEventPtr waitForEvent();
00087 
00088     [notxpcom] PRInt32 getEventQueueSelectFD();
00089 
00090     void init(in boolean aNative);
00091     [noscript] void initFromPRThread(in PRThreadPtr thread, 
00092                                      in boolean aNative);
00093     [noscript] void initFromPLQueue(in PLEventQueuePtr aQueue);
00094 
00095     void enterMonitor();
00096     void exitMonitor();
00097 
00102     [noscript] void revokeEvents(in voidPtr owner);
00103     [noscript] PLEventQueuePtr getPLEventQueue();
00104 
00105     boolean isQueueNative();
00106 
00107     // effectively kill the queue. warning: the queue is allowed to delete
00108     // itself any time after this.
00109     void stopAcceptingEvents();
00110 };
00111