widget/cocoa/OSXNotificationCenter.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/cocoa/OSXNotificationCenter.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef OSXNotificationCenter_h
    1.10 +#define OSXNotificationCenter_h
    1.11 +
    1.12 +#import <Foundation/Foundation.h>
    1.13 +#include "nsIAlertsService.h"
    1.14 +#include "imgINotificationObserver.h"
    1.15 +#include "nsITimer.h"
    1.16 +#include "nsTArray.h"
    1.17 +#include "mozilla/RefPtr.h"
    1.18 +
    1.19 +@class mozNotificationCenterDelegate;
    1.20 +
    1.21 +namespace mozilla {
    1.22 +
    1.23 +class OSXNotificationInfo;
    1.24 +
    1.25 +class OSXNotificationCenter : public nsIAlertsService,
    1.26 +                              public imgINotificationObserver,
    1.27 +                              public nsITimerCallback
    1.28 +{
    1.29 +public:
    1.30 +  NS_DECL_ISUPPORTS
    1.31 +  NS_DECL_NSIALERTSSERVICE
    1.32 +  NS_DECL_IMGINOTIFICATIONOBSERVER
    1.33 +  NS_DECL_NSITIMERCALLBACK
    1.34 +
    1.35 +  OSXNotificationCenter();
    1.36 +  virtual ~OSXNotificationCenter();
    1.37 +
    1.38 +  nsresult Init();
    1.39 +  void CloseAlertCocoaString(NSString *aAlertName);
    1.40 +  void OnClick(NSString *aAlertName);
    1.41 +  void ShowPendingNotification(OSXNotificationInfo *osxni);
    1.42 +
    1.43 +private:
    1.44 +  mozNotificationCenterDelegate *mDelegate;
    1.45 +  nsTArray<nsRefPtr<OSXNotificationInfo> > mActiveAlerts;
    1.46 +  nsTArray<nsRefPtr<OSXNotificationInfo> > mPendingAlerts;
    1.47 +};
    1.48 +
    1.49 +} // namespace mozilla
    1.50 +
    1.51 +#endif // OSXNotificationCenter_h

mercurial