Bug 1550519 - Show a translucent parent highlight when a subgrid is highlighted....
[gecko.git] / dom / base / DOMError.h
blob0d4e3f9d8f7ce5b7ff36d2bd27d5557a3aa9cc15
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_domerror_h__
8 #define mozilla_dom_domerror_h__
10 #include "mozilla/Attributes.h"
11 #include "nsWrapperCache.h"
12 #include "nsCOMPtr.h"
13 #include "nsString.h"
15 #define DOMERROR_IID \
16 { \
17 0x220cb63f, 0xa37d, 0x4ba4, { \
18 0x8e, 0x31, 0xfc, 0xde, 0xec, 0x48, 0xe1, 0x66 \
19 } \
22 class nsPIDOMWindowInner;
24 namespace mozilla {
26 class ErrorResult;
28 namespace dom {
30 class GlobalObject;
32 class DOMError : public nsISupports, public nsWrapperCache {
33 nsCOMPtr<nsPIDOMWindowInner> mWindow;
34 nsString mName;
35 nsString mMessage;
37 protected:
38 virtual ~DOMError();
40 public:
41 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
42 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMError)
44 NS_DECLARE_STATIC_IID_ACCESSOR(DOMERROR_IID)
46 // aWindow can be null if this DOMError is not associated with a particular
47 // window.
49 explicit DOMError(nsPIDOMWindowInner* aWindow);
51 DOMError(nsPIDOMWindowInner* aWindow, nsresult aValue);
53 DOMError(nsPIDOMWindowInner* aWindow, const nsAString& aName);
55 DOMError(nsPIDOMWindowInner* aWindow, const nsAString& aName,
56 const nsAString& aMessage);
58 nsPIDOMWindowInner* GetParentObject() const { return mWindow; }
60 virtual JSObject* WrapObject(JSContext* aCx,
61 JS::Handle<JSObject*> aGivenProto) override;
63 static already_AddRefed<DOMError> Constructor(const GlobalObject& global,
64 const nsAString& name,
65 const nsAString& message,
66 ErrorResult& aRv);
68 void GetName(nsString& aRetval) const { aRetval = mName; }
70 void GetMessage(nsString& aRetval) const { aRetval = mMessage; }
73 NS_DEFINE_STATIC_IID_ACCESSOR(DOMError, DOMERROR_IID)
75 } // namespace dom
76 } // namespace mozilla
78 #endif // mozilla_dom_domerror_h__