Line data Source code
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/. */
5 :
6 : #ifndef nsSystemAlertsService_h__
7 : #define nsSystemAlertsService_h__
8 :
9 : #include "nsIAlertsService.h"
10 : #include "nsDataHashtable.h"
11 : #include "nsCOMPtr.h"
12 :
13 : class nsAlertsIconListener;
14 :
15 0 : class nsSystemAlertsService : public nsIAlertsService
16 : {
17 : public:
18 : NS_DECL_NSIALERTSSERVICE
19 : NS_DECL_ISUPPORTS
20 :
21 : nsSystemAlertsService();
22 :
23 : nsresult Init();
24 :
25 : bool IsActiveListener(const nsAString& aAlertName,
26 : nsAlertsIconListener* aListener);
27 : void RemoveListener(const nsAString& aAlertName,
28 : nsAlertsIconListener* aListener);
29 :
30 : protected:
31 : virtual ~nsSystemAlertsService();
32 :
33 : void AddListener(const nsAString& aAlertName,
34 : nsAlertsIconListener* aListener);
35 :
36 : nsDataHashtable<nsStringHashKey, nsAlertsIconListener*> mActiveListeners;
37 : };
38 :
39 : #endif /* nsSystemAlertsService_h__ */
|