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 "display_change_listener.h" 26 #include "wm_single_instance.h" 27 #include "singleton_delegator.h" 28 29 namespace OHOS::Rosen { 30 class DisplayManagerServiceInner { 31 WM_DECLARE_SINGLE_INSTANCE(DisplayManagerServiceInner); 32 33 public: 34 std::vector<sptr<DisplayInfo>> GetAllDisplays() const; 35 DisplayId GetDefaultDisplayId() const; 36 sptr<DisplayInfo> GetDefaultDisplay() const; 37 sptr<DisplayInfo> GetDisplayById(DisplayId displayId) const; 38 std::vector<DisplayId> GetAllDisplayIds() const; 39 ScreenId GetRSScreenId(DisplayId displayId) const; 40 sptr<ScreenInfo> GetScreenInfoByDisplayId(DisplayId displayId) const; 41 sptr<SupportedScreenModes> GetScreenModesByDisplayId(DisplayId displayId) const; 42 std::shared_ptr<Media::PixelMap> GetDisplaySnapshot(DisplayId) const; 43 void UpdateRSTree(DisplayId displayId, std::shared_ptr<RSSurfaceNode>& surfaceNode, bool isAdd); 44 void RegisterDisplayChangeListener(sptr<IDisplayChangeListener> listener); 45 bool SetOrientationFromWindow(DisplayId displayId, Orientation orientation); 46 }; 47 } // namespace OHOS::Rosen 48 49 #endif // FOUNDATION_DMSERVER_DISPLAY_MANAGER_SERVICE_H