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 #ifndef OSXNotificationCenter_h
7 #define OSXNotificationCenter_h
9 #import <Foundation/Foundation.h>
10 #include "nsIAlertsService.h"
12 #include "mozilla/RefPtr.h"
14 // mozNotificationCenterDelegate is used to access the macOS notification
15 // center. It is not related to the DesktopNotificationCenter object, which was
16 // removed in bug 952453. While there are no direct references to this class
17 // elsewhere, removing this will cause push notifications on macOS to stop
19 @
class mozNotificationCenterDelegate
;
23 class OSXNotificationInfo
;
25 class OSXNotificationCenter
: public nsIAlertsService
,
26 public nsIAlertsIconData
,
27 public nsIAlertsDoNotDisturb
,
28 public nsIAlertNotificationImageListener
{
31 NS_DECL_NSIALERTSSERVICE
32 NS_DECL_NSIALERTSICONDATA
33 NS_DECL_NSIALERTSDONOTDISTURB
34 NS_DECL_NSIALERTNOTIFICATIONIMAGELISTENER
36 OSXNotificationCenter();
39 void CloseAlertCocoaString(NSString
* aAlertName
);
40 void OnActivate(NSString
* aAlertName
,
41 NSUserNotificationActivationType aActivationType
,
42 unsigned long long aAdditionalActionIndex
);
43 void ShowPendingNotification(OSXNotificationInfo
* osxni
);
46 virtual ~OSXNotificationCenter();
49 mozNotificationCenterDelegate
* mDelegate
;
50 nsTArray
<RefPtr
<OSXNotificationInfo
> > mActiveAlerts
;
51 nsTArray
<RefPtr
<OSXNotificationInfo
> > mPendingAlerts
;
52 bool mSuppressForScreenSharing
;
55 } // namespace mozilla
57 #endif // OSXNotificationCenter_h