Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / base / IntlUtils.h
blob51531e614041b6f8d216803a66d6c86fa7118ceb
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/. */
6 #ifndef mozilla_dom_IntlUtils_h
7 #define mozilla_dom_IntlUtils_h
9 #include "mozilla/dom/IntlUtilsBinding.h"
10 #include "nsWrapperCache.h"
11 #include "xpcprivate.h"
13 class nsPIDOMWindowInner;
15 namespace mozilla::dom {
17 #ifdef XP_WIN
18 # undef GetLocaleInfo
19 #endif
21 class IntlUtils final : public nsISupports, public nsWrapperCache {
22 public:
23 explicit IntlUtils(nsPIDOMWindowInner* aWindow);
25 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
26 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(IntlUtils)
28 nsPIDOMWindowInner* GetParentObject() const { return mWindow; }
30 JSObject* WrapObject(JSContext* aCx,
31 JS::Handle<JSObject*> aGivenProto) override;
33 void GetDisplayNames(const Sequence<nsString>& aLocales,
34 const mozilla::dom::DisplayNameOptions& aOptions,
35 mozilla::dom::DisplayNameResult& aResult,
36 mozilla::ErrorResult& aError);
38 void GetLocaleInfo(const Sequence<nsString>& aLocales,
39 mozilla::dom::LocaleInfo& aResult,
40 mozilla::ErrorResult& aError);
42 bool IsAppLocaleRTL();
44 private:
45 ~IntlUtils();
47 nsCOMPtr<nsPIDOMWindowInner> mWindow;
50 } // namespace mozilla::dom
51 #endif