Bug 1842773 - Part 18: Update TypedArray length, byteLength, and byteOffset accesses...
[gecko.git] / widget / uikit / nsScreenManager.h
blob0d19728264261284d230820e400985935f3aeb5e
1 /* -*- Mode: C++; tab-width: 4; 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 nsScreenManager_h_
7 #define nsScreenManager_h_
9 #include "nsBaseScreen.h"
10 #include "nsIScreenManager.h"
11 #include "nsCOMPtr.h"
12 #include "nsRect.h"
14 @class UIScreen;
16 class UIKitScreen : public nsBaseScreen {
17 public:
18 explicit UIKitScreen(UIScreen* screen);
19 ~UIKitScreen() {}
21 NS_IMETHOD GetId(uint32_t* outId) override {
22 *outId = 0;
23 return NS_OK;
26 NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth,
27 int32_t* aHeight) override;
28 NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth,
29 int32_t* aHeight) override;
30 NS_IMETHOD GetRectDisplayPix(int32_t* aLeft, int32_t* aTop, int32_t* aWidth,
31 int32_t* aHeight) override;
32 NS_IMETHOD GetAvailRectDisplayPix(int32_t* aLeft, int32_t* aTop,
33 int32_t* aWidth, int32_t* aHeight) override;
34 NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth) override;
35 NS_IMETHOD GetColorDepth(int32_t* aColorDepth) override;
36 NS_IMETHOD GetContentsScaleFactor(double* aContentsScaleFactor) override;
37 NS_IMETHOD GetDefaultCSSScaleFactor(double* aScaleFactor) override {
38 return GetContentsScaleFactor(aScaleFactor);
41 private:
42 UIScreen* mScreen;
45 class UIKitScreenManager : public nsIScreenManager {
46 public:
47 UIKitScreenManager();
49 NS_DECL_ISUPPORTS
51 NS_DECL_NSISCREENMANAGER
53 static LayoutDeviceIntRect GetBounds();
55 private:
56 virtual ~UIKitScreenManager() {}
57 // TODO: support >1 screen, iPad supports external displays
58 nsCOMPtr<nsIScreen> mScreen;
61 #endif // nsScreenManager_h_