widget/cocoa/OSXNotificationCenter.h

branch
TOR_BUG_9701
changeset 10
ac0c01689b40
equal deleted inserted replaced
-1:000000000000 0:301a82f64a85
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 OSXNotificationCenter_h
7 #define OSXNotificationCenter_h
8
9 #import <Foundation/Foundation.h>
10 #include "nsIAlertsService.h"
11 #include "imgINotificationObserver.h"
12 #include "nsITimer.h"
13 #include "nsTArray.h"
14 #include "mozilla/RefPtr.h"
15
16 @class mozNotificationCenterDelegate;
17
18 namespace mozilla {
19
20 class OSXNotificationInfo;
21
22 class OSXNotificationCenter : public nsIAlertsService,
23 public imgINotificationObserver,
24 public nsITimerCallback
25 {
26 public:
27 NS_DECL_ISUPPORTS
28 NS_DECL_NSIALERTSSERVICE
29 NS_DECL_IMGINOTIFICATIONOBSERVER
30 NS_DECL_NSITIMERCALLBACK
31
32 OSXNotificationCenter();
33 virtual ~OSXNotificationCenter();
34
35 nsresult Init();
36 void CloseAlertCocoaString(NSString *aAlertName);
37 void OnClick(NSString *aAlertName);
38 void ShowPendingNotification(OSXNotificationInfo *osxni);
39
40 private:
41 mozNotificationCenterDelegate *mDelegate;
42 nsTArray<nsRefPtr<OSXNotificationInfo> > mActiveAlerts;
43 nsTArray<nsRefPtr<OSXNotificationInfo> > mPendingAlerts;
44 };
45
46 } // namespace mozilla
47
48 #endif // OSXNotificationCenter_h

mercurial