Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / reporting / DeprecationReportBody.h
blob9476899b1298d263cc3cac7b7707e6c18669e60b
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
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_DeprecationReportBody_h
8 #define mozilla_dom_DeprecationReportBody_h
10 #include "mozilla/dom/Nullable.h"
11 #include "mozilla/dom/ReportBody.h"
12 #include "nsString.h"
14 namespace mozilla::dom {
16 class DeprecationReportBody final : public ReportBody {
17 public:
18 DeprecationReportBody(nsIGlobalObject* aGlobal, const nsAString& aId,
19 const Nullable<uint64_t>& aDate,
20 const nsAString& aMessage, const nsAString& aSourceFile,
21 const Nullable<uint32_t>& aLineNumber,
22 const Nullable<uint32_t>& aColumnNumber);
24 JSObject* WrapObject(JSContext* aCx,
25 JS::Handle<JSObject*> aGivenProto) override;
27 void GetId(nsAString& aId) const;
29 Nullable<uint64_t> GetAnticipatedRemoval() const;
31 void GetMessage(nsAString& aMessage) const;
33 void GetSourceFile(nsAString& aSourceFile) const;
35 Nullable<uint32_t> GetLineNumber() const;
37 Nullable<uint32_t> GetColumnNumber() const;
39 protected:
40 void ToJSON(JSONWriter& aJSONWriter) const override;
42 private:
43 ~DeprecationReportBody();
45 const nsString mId;
46 const Nullable<uint64_t> mDate;
47 const nsString mMessage;
48 const nsString mSourceFile;
49 const Nullable<uint32_t> mLineNumber;
50 const Nullable<uint32_t> mColumnNumber;
53 } // namespace mozilla::dom
55 #endif // mozilla_dom_DeprecationReportBody_h