Bug 1779627 - Migrate toolkit/components/mozintl/mozIntl.jsm to esm; r=nordzilla
[gecko.git] / widget / windows / WindowsUIUtils.h
blob5bdde8eadb7956643fb3f280f9e8b8e325ebe6e0
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_widget_WindowsUIUtils_h__
7 #define mozilla_widget_WindowsUIUtils_h__
9 #include "nsIWindowsUIUtils.h"
10 #include "nsString.h"
11 #include "nsColor.h"
12 #include "mozilla/Maybe.h"
13 #include "mozilla/MozPromise.h"
15 using SharePromise =
16 mozilla::MozPromise<bool, nsresult, /* IsExclusive */ true>;
18 namespace mozilla {
19 enum class ColorScheme : uint8_t;
22 class WindowsUIUtils final : public nsIWindowsUIUtils {
23 public:
24 NS_DECL_ISUPPORTS
25 NS_DECL_NSIWINDOWSUIUTILS
27 WindowsUIUtils();
29 static RefPtr<SharePromise> Share(nsAutoString aTitle, nsAutoString aText,
30 nsAutoString aUrl);
32 static void UpdateInTabletMode();
33 static bool GetInTabletMode();
35 // Gets the system accent color, or one of the darker / lighter variants
36 // (darker = -1/2/3, lighter=+1/2/3, values outside of that range are
37 // disallowed).
38 static mozilla::Maybe<nscolor> GetAccentColor(int aTone = 0);
39 static mozilla::Maybe<nscolor> GetSystemColor(mozilla::ColorScheme, int);
41 // Use LookAndFeel for a cached getter.
42 static bool ComputeOverlayScrollbars();
43 static double ComputeTextScaleFactor();
45 protected:
46 ~WindowsUIUtils();
49 #endif // mozilla_widget_WindowsUIUtils_h__