1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include
"nsISupports.idl"
11 template
<class T
> struct already_AddRefed
;
14 * After the default timezone changes, this topic is notified. Some systems may
15 * not support monitoring timezone.
17 #define DEFAULT_TIMEZONE_CHANGED_OBSERVER_TOPIC
"default-timezone-changed"
21 * Interface for the native event system layer. This interface is designed
22 * to be used on the main application thread only.
24 [uuid(7cd5c71d
-223b
-4afe
-931d
-5eedb1f2b01f
)]
25 interface nsIAppShell
: nsISupports
28 * Enter an event loop. Don't leave until exit() is called.
33 * Exit the handle event loop
38 * Give hint to native event queue notification mechanism. If the native
39 * platform needs to tradeoff performance vs. native event starvation this
40 * hint tells the native dispatch code which to favor. The default is to
41 * prevent native event starvation.
43 * Calls to this function may be nested. When the number of calls that pass
44 * PR_TRUE is subtracted from the number of calls that pass PR_FALSE is
45 * greater than 0, performance is given precedence over preventing event
48 * The starvationDelay arg is only used when favorPerfOverStarvation is
49 * PR_FALSE. It is the amount of time in milliseconds to wait before the
50 * PR_FALSE actually takes effect.
52 void favorPerformanceHint
(in boolean favorPerfOverStarvation
,
53 in unsigned long starvationDelay
);
56 * Suspends the use of additional platform-specific methods (besides the
57 * nsIAppShell->run() event loop) to run Gecko events on the main
58 * application thread. Under some circumstances these "additional methods"
59 * can cause Gecko event handlers to be re-entered, sometimes leading to
60 * hangs and crashes. Calls to suspendNative() and resumeNative() may be
61 * nested. On some platforms (those that don't use any "additional
62 * methods") this will be a no-op. Does not (in itself) stop Gecko events
63 * from being processed on the main application thread. But if the
64 * nsIAppShell->run() event loop is blocked when this call is made, Gecko
65 * events will stop being processed until resumeNative() is called (even
66 * if a plugin or library is temporarily processing events on a nested
72 * Resumes the use of additional platform-specific methods to run Gecko
73 * events on the main application thread. Calls to suspendNative() and
74 * resumeNative() may be nested. On some platforms this will be a no-op.
79 * The current event loop nesting level.
81 readonly attribute
unsigned long eventloopNestingLevel
;