1 /* 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FOUNDATION_DMSERVER_DISPLAY_MANAGER_SERVICE_INNER_H 17 #define FOUNDATION_DMSERVER_DISPLAY_MANAGER_SERVICE_INNER_H 18 19 #include <vector> 20 21 #include <pixel_map.h> 22 #include <system_ability.h> 23 24 #include "abstract_display.h" 25 #include "cutout_info.h" 26 #include "display_change_listener.h" 27 #include "rsscreen_change_listener.h" 28 #include "singleton_delegator.h" 29 #include "wm_single_instance.h" 30 #include "window_info_queried_listener.h" 31 32 namespace OHOS::Rosen { 33 class DisplayManagerServiceInner { 34 WM_DECLARE_SINGLE_INSTANCE(DisplayManagerServiceInner); 35 36 public: 37 std::vector<sptr<DisplayInfo>> GetAllDisplays() const; 38 DisplayId GetDefaultDisplayId() const; 39 sptr<DisplayInfo> GetDefaultDisplay() const; 40 sptr<DisplayInfo> GetDisplayById(DisplayId displayId) const; 41 std::vector<DisplayId> GetAllDisplayIds() const; 42 uint32_t GetRSScreenNum() const; 43 sptr<ScreenInfo> GetScreenInfoByDisplayId(DisplayId displayId) const; 44 ScreenId GetScreenGroupIdByDisplayId(DisplayId displayId) const; 45 sptr<SupportedScreenModes> GetScreenModesByDisplayId(DisplayId displayId) const; 46 std::shared_ptr<Media::PixelMap> GetDisplaySnapshot(DisplayId) const; 47 void UpdateRSTree(DisplayId displayId, DisplayId parentDisplayId, std::shared_ptr<RSSurfaceNode>& surfaceNode, 48 bool isAdd, bool isMultiDisplay); 49 void RegisterDisplayChangeListener(sptr<IDisplayChangeListener> listener); 50 bool SetOrientationFromWindow(DisplayId displayId, Orientation orientation); 51 bool SetRotationFromWindow(DisplayId displayId, Rotation targetRotation); 52 void SetGravitySensorSubscriptionEnabled(); 53 void RegisterWindowInfoQueriedListener(const sptr<IWindowInfoQueriedListener>& listener); 54 void RegisterRSScreenChangeListener(const sptr<IRSScreenChangeListener>& listener); 55 sptr<CutoutInfo> GetCutoutInfo(DisplayId displayId) const; 56 }; 57 } // namespace OHOS::Rosen 58 59 #endif // FOUNDATION_DMSERVER_DISPLAY_MANAGER_SERVICE_H