|
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/. */ |
|
5 |
|
6 #ifndef nsAlertsService_h__ |
|
7 #define nsAlertsService_h__ |
|
8 |
|
9 #include "nsIAlertsService.h" |
|
10 #include "nsCOMPtr.h" |
|
11 #include "nsXULAlerts.h" |
|
12 |
|
13 #ifdef XP_WIN |
|
14 typedef enum tagMOZ_QUERY_USER_NOTIFICATION_STATE { |
|
15 QUNS_NOT_PRESENT = 1, |
|
16 QUNS_BUSY = 2, |
|
17 QUNS_RUNNING_D3D_FULL_SCREEN = 3, |
|
18 QUNS_PRESENTATION_MODE = 4, |
|
19 QUNS_ACCEPTS_NOTIFICATIONS = 5, |
|
20 QUNS_QUIET_TIME = 6, |
|
21 QUNS_IMMERSIVE = 7 |
|
22 } MOZ_QUERY_USER_NOTIFICATION_STATE; |
|
23 |
|
24 extern "C" { |
|
25 // This function is Windows Vista or later |
|
26 typedef HRESULT (__stdcall *SHQueryUserNotificationStatePtr)(MOZ_QUERY_USER_NOTIFICATION_STATE *pquns); |
|
27 } |
|
28 #endif // defined(XP_WIN) |
|
29 |
|
30 class nsAlertsService : public nsIAlertsService, |
|
31 public nsIAlertsProgressListener |
|
32 { |
|
33 public: |
|
34 NS_DECL_NSIALERTSPROGRESSLISTENER |
|
35 NS_DECL_NSIALERTSSERVICE |
|
36 NS_DECL_ISUPPORTS |
|
37 |
|
38 nsAlertsService(); |
|
39 virtual ~nsAlertsService(); |
|
40 |
|
41 protected: |
|
42 bool ShouldShowAlert(); |
|
43 nsXULAlerts mXULAlerts; |
|
44 }; |
|
45 |
|
46 #endif /* nsAlertsService_h__ */ |