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/. */
6 #ifndef mozilla_dom_mobilemessage_MobileMessageCallback_h
7 #define mozilla_dom_mobilemessage_MobileMessageCallback_h
9 #include "nsIMobileMessageCallback.h"
11 #include "DOMRequest.h"
13 class nsIDOMMozMmsMessage
;
18 namespace mobilemessage
{
20 class MobileMessageCallback MOZ_FINAL
: public nsIMobileMessageCallback
24 NS_DECL_NSIMOBILEMESSAGECALLBACK
26 explicit MobileMessageCallback(DOMRequest
* aDOMRequest
);
27 explicit MobileMessageCallback(Promise
* aPromise
);
30 ~MobileMessageCallback();
32 nsRefPtr
<DOMRequest
> mDOMRequest
;
33 nsRefPtr
<Promise
> mPromise
;
35 nsresult
NotifySuccess(JS::Handle
<JS::Value
> aResult
, bool aAsync
= false);
36 nsresult
NotifySuccess(nsISupports
*aMessage
, bool aAsync
= false);
37 nsresult
NotifyError(int32_t aError
, DOMError
*aDetailedError
= nullptr, bool aAsync
= false);
40 } // namespace mobilemessage
42 } // namespace mozilla
44 #endif // mozilla_dom_mobilemessage_MobileMessageCallback_h