widget/cocoa/OSXNotificationCenter.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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/. */
     6 #ifndef OSXNotificationCenter_h
     7 #define OSXNotificationCenter_h
     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"
    16 @class mozNotificationCenterDelegate;
    18 namespace mozilla {
    20 class OSXNotificationInfo;
    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
    32   OSXNotificationCenter();
    33   virtual ~OSXNotificationCenter();
    35   nsresult Init();
    36   void CloseAlertCocoaString(NSString *aAlertName);
    37   void OnClick(NSString *aAlertName);
    38   void ShowPendingNotification(OSXNotificationInfo *osxni);
    40 private:
    41   mozNotificationCenterDelegate *mDelegate;
    42   nsTArray<nsRefPtr<OSXNotificationInfo> > mActiveAlerts;
    43   nsTArray<nsRefPtr<OSXNotificationInfo> > mPendingAlerts;
    44 };
    46 } // namespace mozilla
    48 #endif // OSXNotificationCenter_h

mercurial