Back to index

lightning-sunbird  0.9+nobinonly
nsIEventQueueService.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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  *   Rick Potts <rpotts@netscape.com>
00024  *   David Matiskella <davidm@netscape.com>
00025  *   David Hyatt <hyatt@netscape.com>
00026  *   Suresh Duddi <dp@netscape.com>
00027  *   Scott Collins <scc@netscape.com>
00028  *   Dan Matejka <danm@netscape.com>
00029  *   Doug Turner <dougt@netscape.com>
00030  *   Ray Whitmer <rayw@netscape.com>
00031  *   Dan Mosedale <dmose@mozilla.org>
00032  *
00033  * Alternatively, the contents of this file may be used under the terms of
00034  * either of the GNU General Public License Version 2 or later (the "GPL"),
00035  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00036  * in which case the provisions of the GPL or the LGPL are applicable instead
00037  * of those above. If you wish to allow use of your version of this file only
00038  * under the terms of either the GPL or the LGPL, and not to allow others to
00039  * use your version of this file under the terms of the MPL, indicate your
00040  * decision by deleting the provisions above and replace them with the notice
00041  * and other provisions required by the GPL or the LGPL. If you do not delete
00042  * the provisions above, a recipient may use your version of this file under
00043  * the terms of any one of the MPL, the GPL or the LGPL.
00044  *
00045  * ***** END LICENSE BLOCK ***** */
00046 
00047 #include "nsISupports.idl"
00048 #include "nsIEventQueue.idl"
00049 
00050 %{C++
00051 #include "prthread.h"
00052 #include "plevent.h"
00053 
00054 /* be761f00-a3b0-11d2-996c-0080c7cb1080 */
00055 #define NS_EVENTQUEUESERVICE_CID \
00056 { 0xbe761f00, 0xa3b0, 0x11d2, \
00057   {0x99, 0x6c, 0x00, 0x80, 0xc7, 0xcb, 0x10, 0x80} }
00058 
00059 #define NS_EVENTQUEUESERVICE_CONTRACTID "@mozilla.org/event-queue-service;1"
00060 #define NS_EVENTQUEUESERVICE_CLASSNAME "Event Queue Service"
00061 
00062 #define NS_CURRENT_THREAD    ((PRThread*)0)
00063 #define NS_CURRENT_EVENTQ    ((nsIEventQueue*)0)
00064 
00065 #define NS_UI_THREAD         ((PRThread*)1)
00066 #define NS_UI_THREAD_EVENTQ  ((nsIEventQueue*)1)
00067 
00068 %}
00069 
00070 /* a forward decl */
00071 interface nsIThread;
00072 
00073 [scriptable, uuid(a6cf90dc-15b3-11d2-932e-00805f8add32)]
00074 interface nsIEventQueueService : nsISupports
00075 {
00083   void createThreadEventQueue();
00084 
00090   void createMonitoredThreadEventQueue();
00091 
00100   void destroyThreadEventQueue();
00101 
00102   nsIEventQueue createFromIThread(in nsIThread aThread, 
00103                               in boolean aNative);
00104                                
00105   [noscript] nsIEventQueue createFromPLEventQueue(in PLEventQueuePtr 
00106                                             aPLEventQueue);
00107 
00108   // Add a new event queue for the current thread, making it the "current"
00109   // queue. Return that queue, addrefed.
00110   nsIEventQueue pushThreadEventQueue();
00111 
00112   // release and disable the queue
00113   void popThreadEventQueue(in nsIEventQueue aQueue);
00114 
00115   [noscript] nsIEventQueue getThreadEventQueue(in PRThreadPtr aThread);
00116 
00132   [noscript] nsIEventQueue resolveEventQueue(in nsIEventQueue queueOrConstant);
00133 
00146   nsIEventQueue getSpecialEventQueue(in long aQueue);
00147 
00148   const long CURRENT_THREAD_EVENT_QUEUE = 0;
00149   const long UI_THREAD_EVENT_QUEUE = 1;
00150 
00151 };