Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / toolkit / components / startup / src / nsAppStartup.h
blobd3c4a88e8b8fdf07bb81acdfd019e62c4ad1b27e
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
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/
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.
15 * The Original Code is Mozilla Communicator client code. This file was split
16 * from xpfe/appshell/src/nsAppShellService.h
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 1998
21 * the Initial Developer. All Rights Reserved.
23 * Contributor(s):
24 * Benjamin Smedberg <bsmedberg@covad.net>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either of the GNU General Public License Version 2 or later (the "GPL"),
28 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #ifndef nsAppStartup_h__
41 #define nsAppStartup_h__
43 #include "nsIAppStartup.h"
44 #include "nsIWindowCreator2.h"
45 #include "nsIObserver.h"
46 #include "nsWeakReference.h"
48 #include "nsINativeAppSupport.h"
49 #include "nsIAppShell.h"
51 struct PLEvent;
53 // {7DD4D320-C84B-4624-8D45-7BB9B2356977}
54 #define NS_TOOLKIT_APPSTARTUP_CID \
55 { 0x7dd4d320, 0xc84b, 0x4624, { 0x8d, 0x45, 0x7b, 0xb9, 0xb2, 0x35, 0x69, 0x77 } }
58 class nsAppStartup : public nsIAppStartup,
59 public nsIWindowCreator2,
60 public nsIObserver,
61 public nsSupportsWeakReference
63 public:
64 NS_DECL_ISUPPORTS
65 NS_DECL_NSIAPPSTARTUP
66 NS_DECL_NSIWINDOWCREATOR
67 NS_DECL_NSIWINDOWCREATOR2
68 NS_DECL_NSIOBSERVER
70 nsAppStartup();
71 nsresult Init();
73 private:
74 ~nsAppStartup() { }
76 void AttemptingQuit(PRBool aAttempt);
77 void CloseAllWindows();
78 inline PRInt32 RealQuitStoppers();
80 friend class nsAppExitEvent;
82 nsCOMPtr<nsIAppShell> mAppShell;
84 PRInt32 mConsiderQuitStopper; // if > 0, Quit(eConsiderQuit) fails
85 PRPackedBool mRunning; // Have we started the main event loop?
86 PRPackedBool mShuttingDown; // Quit method reentrancy check
87 PRPackedBool mAttemptingQuit; // Quit(eAttemptQuit) still trying
88 PRPackedBool mRestart; // Quit(eRestart)
91 #endif // nsAppStartup_h__