Bug 1507750 - Compare the flexbox state for any changes before updating on reflows...
[gecko.git] / toolkit / xre / nsINativeAppSupport.idl
blob663ebec69eab939df06ba7614ae58f742dae0709
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 /* nsINativeAppSupport
10 * This "pseudo" (in the XPCOM sense) interface provides for
11 * platform-specific general application support:
12 * o It manages the details of the simple DDE communication
13 * supported on the Win32 platform (it is the addition of this
14 * item that prompted the creation of this interface.
16 * Due to the nature of the beast, this interface is not a full-blown
17 * XPCOM component. The primary reason is that objects that implement
18 * this interface generally must be operational *before* XPCOM (or any
19 * of the rest of Mozilla) are initialized. As a result, this
20 * interface is instantiated by somewhat unconventional means.
22 * To create the implementor of this interface, you call the function
23 * NS_CreateNativeAppSupport. This is done in the startup code
24 * in nsAppRunner.cpp
26 * The interface provides these functions:
27 * start - You call this to inform the native app support that the
28 * application is starting. In addition, it serves as a
29 * query as to whether the application should continue to
30 * run.
32 * If the returned boolean result is PR_FALSE, then the
33 * application should exit without further processing. In
34 * such cases, the returned nsresult indicates whether the
35 * reason to exit is due to an error or not.
37 * Win32 Note: In the case of starting a second instance
38 * of this executable, this function will return
39 * PR_FALSE and nsresult==NS_OK. This means that
40 * the command line arguments have been
41 * successfully passed to the instance of the
42 * application acting as a DDE server.
44 * stop - You call this to inform the native app support that the
45 * application *wishes* to terminate. If the returned boolean
46 * value is PR_FALSE, then the application should continue
47 * (as if there were still additional top-level windows open).
49 * Win32 Note: If this is the instance of the application
50 * acting as the DDE server, and there are current
51 * DDE conversations active with other instances
52 * acting as DDE clients, then this function will
53 * return PR_FALSE.
55 * quit - Like Stop, but this method *forces* termination (or more
56 * precisely, indicates that the application is about to be
57 * terminated regardless of what a call to Stop might have
58 * returned.
60 * This method is intended to be called when the user selects
61 * the "Quit" option (close all windows and exit).
63 * Win32 Note: Stop is problematic in the case of "Quit" (close
64 * all windows and exit the application) because
65 * either we don't Quit or (potentially) we lose
66 * requests coming from other instances of the
67 * application. The strategy is to give preference
68 * to the user's explicit Quit request. In the
69 * unlikely event that a request is pending from
70 * another instance of the application, then such
71 * requests are essentially ignored. This is
72 * roughly equivalent to handling that request by
73 * opening a new window, followed by immediately
74 * closing it. Since this is the same as if the
75 * request came in immediately before the Quit
76 * call (versus immediately after it), no harm.
78 * There is an exposure here: Upon return from this
79 * function, any DDE connect request (for Mozilla)
80 * will fail and other instances of the application
81 * will start up as a DDE server. In that case,
82 * those instances may do things that conflict with
83 * the subsequent shutting down of the instance that
84 * is quitting. For this reason, the call to Quit
85 * should be deferred as long as possible.
87 * onLastWindowClosing - Called when the last window is closed. Used as a
88 * "soft" shutdown, passwords are flushed.
91 interface nsIXULWindow;
93 [scriptable, uuid(5fdf8480-1f98-11d4-8077-00600811a9c3)]
94 interface nsINativeAppSupport : nsISupports {
95 // Startup/shutdown.
96 boolean start();
97 void enable();
98 boolean stop();
99 void quit();
101 void onLastWindowClosing();
102 void ReOpen();