Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef OSXNotificationCenter_h |
michael@0 | 7 | #define OSXNotificationCenter_h |
michael@0 | 8 | |
michael@0 | 9 | #import <Foundation/Foundation.h> |
michael@0 | 10 | #include "nsIAlertsService.h" |
michael@0 | 11 | #include "imgINotificationObserver.h" |
michael@0 | 12 | #include "nsITimer.h" |
michael@0 | 13 | #include "nsTArray.h" |
michael@0 | 14 | #include "mozilla/RefPtr.h" |
michael@0 | 15 | |
michael@0 | 16 | @class mozNotificationCenterDelegate; |
michael@0 | 17 | |
michael@0 | 18 | namespace mozilla { |
michael@0 | 19 | |
michael@0 | 20 | class OSXNotificationInfo; |
michael@0 | 21 | |
michael@0 | 22 | class OSXNotificationCenter : public nsIAlertsService, |
michael@0 | 23 | public imgINotificationObserver, |
michael@0 | 24 | public nsITimerCallback |
michael@0 | 25 | { |
michael@0 | 26 | public: |
michael@0 | 27 | NS_DECL_ISUPPORTS |
michael@0 | 28 | NS_DECL_NSIALERTSSERVICE |
michael@0 | 29 | NS_DECL_IMGINOTIFICATIONOBSERVER |
michael@0 | 30 | NS_DECL_NSITIMERCALLBACK |
michael@0 | 31 | |
michael@0 | 32 | OSXNotificationCenter(); |
michael@0 | 33 | virtual ~OSXNotificationCenter(); |
michael@0 | 34 | |
michael@0 | 35 | nsresult Init(); |
michael@0 | 36 | void CloseAlertCocoaString(NSString *aAlertName); |
michael@0 | 37 | void OnClick(NSString *aAlertName); |
michael@0 | 38 | void ShowPendingNotification(OSXNotificationInfo *osxni); |
michael@0 | 39 | |
michael@0 | 40 | private: |
michael@0 | 41 | mozNotificationCenterDelegate *mDelegate; |
michael@0 | 42 | nsTArray<nsRefPtr<OSXNotificationInfo> > mActiveAlerts; |
michael@0 | 43 | nsTArray<nsRefPtr<OSXNotificationInfo> > mPendingAlerts; |
michael@0 | 44 | }; |
michael@0 | 45 | |
michael@0 | 46 | } // namespace mozilla |
michael@0 | 47 | |
michael@0 | 48 | #endif // OSXNotificationCenter_h |