Bug 1832850 - Part 3: Remove an unnecessary include and some unnecessary forward...
[gecko.git] / intl / l10n / FluentResource.h
blob56e7f8198bbdc25a96838e9b7e14e53501e59c99
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_intl_l10n_FluentResource_h
8 #define mozilla_intl_l10n_FluentResource_h
10 #include "mozilla/dom/BindingDeclarations.h"
11 #include "nsCycleCollectionParticipant.h"
12 #include "nsWrapperCache.h"
13 #include "mozilla/dom/FluentBinding.h"
14 #include "mozilla/intl/FluentBindings.h"
16 namespace mozilla {
17 namespace intl {
19 class FluentResource : public nsWrapperCache {
20 public:
21 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(FluentResource)
22 NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(FluentResource)
24 FluentResource(nsISupports* aParent, const ffi::FluentResource* aRaw);
25 FluentResource(nsISupports* aParent, const nsACString& aSource);
27 static already_AddRefed<FluentResource> Constructor(
28 const dom::GlobalObject& aGlobal, const nsACString& aSource);
30 JSObject* WrapObject(JSContext* aCx,
31 JS::Handle<JSObject*> aGivenProto) override;
32 nsISupports* GetParentObject() const { return mParent; }
34 const ffi::FluentResource* Raw() const { return mRaw; }
36 protected:
37 virtual ~FluentResource() = default;
39 nsCOMPtr<nsISupports> mParent;
40 RefPtr<const ffi::FluentResource> mRaw;
41 bool mHasErrors;
44 } // namespace intl
45 } // namespace mozilla
47 #endif