VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/xpcom/threads/nsIEventQueueService.idl@ 106112

Last change on this file since 106112 was 106112, checked in by vboxsync, 4 weeks ago

libs/xpcom: Fix building code using the XPCOM SDK bindings outside of VirtualBox, ticketref:22714 bugref:10773

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.8 KB
Line 
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is Mozilla Communicator client code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 * Rick Potts <rpotts@netscape.com>
24 * David Matiskella <davidm@netscape.com>
25 * David Hyatt <hyatt@netscape.com>
26 * Suresh Duddi <dp@netscape.com>
27 * Scott Collins <scc@netscape.com>
28 * Dan Matejka <danm@netscape.com>
29 * Doug Turner <dougt@netscape.com>
30 * Ray Whitmer <rayw@netscape.com>
31 * Dan Mosedale <dmose@mozilla.org>
32 *
33 * Alternatively, the contents of this file may be used under the terms of
34 * either of the GNU General Public License Version 2 or later (the "GPL"),
35 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
36 * in which case the provisions of the GPL or the LGPL are applicable instead
37 * of those above. If you wish to allow use of your version of this file only
38 * under the terms of either the GPL or the LGPL, and not to allow others to
39 * use your version of this file under the terms of the MPL, indicate your
40 * decision by deleting the provisions above and replace them with the notice
41 * and other provisions required by the GPL or the LGPL. If you do not delete
42 * the provisions above, a recipient may use your version of this file under
43 * the terms of any one of the MPL, the GPL or the LGPL.
44 *
45 * ***** END LICENSE BLOCK ***** */
46
47#include "nsISupports.idl"
48#include "nsIEventQueue.idl"
49
50%{C++
51#include "plevent.h"
52
53#ifdef VBOX
54# include <iprt/thread.h>
55#else
56typedef struct RTTHREADINT *RTTHREAD;
57#endif
58
59/* be761f00-a3b0-11d2-996c-0080c7cb1080 */
60#define NS_EVENTQUEUESERVICE_CID \
61{ 0xbe761f00, 0xa3b0, 0x11d2, \
62 {0x99, 0x6c, 0x00, 0x80, 0xc7, 0xcb, 0x10, 0x80} }
63
64#define NS_EVENTQUEUESERVICE_CONTRACTID "@mozilla.org/event-queue-service;1"
65#define NS_EVENTQUEUESERVICE_CLASSNAME "Event Queue Service"
66
67#define NS_CURRENT_THREAD ((RTTHREAD)0)
68#define NS_CURRENT_EVENTQ ((nsIEventQueue*)0)
69
70#define NS_UI_THREAD ((RTTHREAD)1)
71#define NS_UI_THREAD_EVENTQ ((nsIEventQueue*)1)
72
73%}
74
75[scriptable, uuid(a6cf90dc-15b3-11d2-932e-00805f8add32)]
76interface nsIEventQueueService : nsISupports
77{
78 /**
79 * Creates and holds a native event queue for the current thread.
80 * "Native" queues have an associated callback mechanism which is
81 * automatically triggered when an event is posted. See plevent.c for
82 * details.
83 * @return NS_OK on success, or a host of failure indications
84 */
85 void createThreadEventQueue();
86
87 /**
88 * Creates and hold a monitored event queue for the current thread.
89 * "Monitored" queues have no callback processing mechanism.
90 * @return NS_OK on success, or a host of failure indications
91 */
92 void createMonitoredThreadEventQueue();
93
94 /**
95 * Somewhat misnamed, this method releases the service's hold on the event
96 * queue(s) for this thread. Subsequent attempts to access this thread's
97 * queue (GetThreadEventQueue, for example) may fail, though the queue itself
98 * will be destroyed only after all references to it are released and the
99 * queue itself is no longer actively processing events.
100 * @return nonsense.
101 */
102 void destroyThreadEventQueue();
103
104 [noscript] nsIEventQueue createFromIThread(in RTTHREAD aThread,
105 in boolean aNative);
106
107 [noscript] nsIEventQueue createFromPLEventQueue(in PLEventQueuePtr
108 aPLEventQueue);
109
110 // Add a new event queue for the current thread, making it the "current"
111 // queue. Return that queue, addrefed.
112 nsIEventQueue pushThreadEventQueue();
113
114 // release and disable the queue
115 void popThreadEventQueue(in nsIEventQueue aQueue);
116
117 [noscript] nsIEventQueue getThreadEventQueue(in RTTHREAD aThread);
118
119 /**
120 * @deprecated in favor of getSpecialEventQueue, since that's
121 * scriptable and this isn't.
122 *
123 * Check for any "magic" event queue constants (NS_CURRENT_EVENTQ,
124 * NS_UI_THREAD_EVENTQ) and return the real event queue that they
125 * represent, AddRef()ed. Otherwise, return the event queue passed
126 * in, AddRef()ed. This is not scriptable because the arguments in
127 * question may be magic constants rather than real nsIEventQueues.
128 *
129 * @arg queueOrConstant either a real event queue or a magic
130 * constant to be resolved
131 *
132 * @return a real event queue, AddRef()ed
133 */
134 [noscript] nsIEventQueue resolveEventQueue(in nsIEventQueue queueOrConstant);
135
136 /**
137 * Returns the appropriate special event queue, AddRef()ed. Really
138 * just a scriptable version of ResolveEventQueue.
139 *
140 * @arg aQueue Either CURRENT_THREAD_EVENT_QUEUE or
141 * UI_THREAD_EVENT_QUEUE
142 * @return The requested nsIEventQueue, AddRef()ed
143 * @exception NS_ERROR_NULL_POINTER Zero pointer passed in for return value
144 * @exception NS_ERROR_ILLEGAL_VALUE Bogus constant passed in aQueue
145 * @exception NS_ERROR_FAILURE Error while calling
146 * GetThreadEventQueue()
147 */
148 nsIEventQueue getSpecialEventQueue(in long aQueue);
149
150 const long CURRENT_THREAD_EVENT_QUEUE = 0;
151 const long UI_THREAD_EVENT_QUEUE = 1;
152
153};
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette