toolkit/components/alerts/nsAlertsService.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/alerts/nsAlertsService.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     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 nsAlertsService_h__
    1.10 +#define nsAlertsService_h__
    1.11 +
    1.12 +#include "nsIAlertsService.h"
    1.13 +#include "nsCOMPtr.h"
    1.14 +#include "nsXULAlerts.h"
    1.15 +
    1.16 +#ifdef XP_WIN
    1.17 +typedef enum tagMOZ_QUERY_USER_NOTIFICATION_STATE {
    1.18 +    QUNS_NOT_PRESENT = 1,
    1.19 +    QUNS_BUSY = 2,
    1.20 +    QUNS_RUNNING_D3D_FULL_SCREEN = 3,
    1.21 +    QUNS_PRESENTATION_MODE = 4,
    1.22 +    QUNS_ACCEPTS_NOTIFICATIONS = 5,
    1.23 +    QUNS_QUIET_TIME = 6,
    1.24 +    QUNS_IMMERSIVE = 7
    1.25 +} MOZ_QUERY_USER_NOTIFICATION_STATE;
    1.26 +
    1.27 +extern "C" {
    1.28 +// This function is Windows Vista or later
    1.29 +typedef HRESULT (__stdcall *SHQueryUserNotificationStatePtr)(MOZ_QUERY_USER_NOTIFICATION_STATE *pquns);
    1.30 +}
    1.31 +#endif // defined(XP_WIN)
    1.32 +
    1.33 +class nsAlertsService : public nsIAlertsService,
    1.34 +                        public nsIAlertsProgressListener
    1.35 +{
    1.36 +public:
    1.37 +  NS_DECL_NSIALERTSPROGRESSLISTENER
    1.38 +  NS_DECL_NSIALERTSSERVICE
    1.39 +  NS_DECL_ISUPPORTS
    1.40 +
    1.41 +  nsAlertsService();
    1.42 +  virtual ~nsAlertsService();
    1.43 +
    1.44 +protected:
    1.45 +  bool ShouldShowAlert();
    1.46 +  nsXULAlerts mXULAlerts;
    1.47 +};
    1.48 +
    1.49 +#endif /* nsAlertsService_h__ */

mercurial