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_DM_SCREEN_GROUP_H 17 #define FOUNDATION_DM_SCREEN_GROUP_H 18 19 #include <refbase.h> 20 #include <vector> 21 #include "screen.h" 22 23 namespace OHOS::Rosen { 24 class ScreenGroupInfo; 25 enum class ScreenCombination : uint32_t { 26 SCREEN_ALONE, 27 SCREEN_EXPAND, 28 SCREEN_MIRROR, 29 }; 30 31 class ScreenGroup : public Screen { 32 friend class ScreenManager; 33 public: 34 ~ScreenGroup(); 35 ScreenGroup(const ScreenGroup&) = delete; 36 ScreenGroup(ScreenGroup&&) = delete; 37 ScreenGroup& operator=(const ScreenGroup&) = delete; 38 ScreenGroup& operator=(ScreenGroup&&) = delete; 39 40 /** 41 * @brief Get the screenCombination type of the screen group. 42 * 43 * @return ScreenCombination type of the screen group. 44 */ 45 ScreenCombination GetCombination() const; 46 47 /** 48 * @brief Get the child screen ids. 49 * 50 * @return Child screen ids. 51 */ 52 std::vector<ScreenId> GetChildIds() const; 53 54 /** 55 * @brief Get the child screen positions. 56 * 57 * @return Child screen positions. 58 */ 59 std::vector<Point> GetChildPositions() const; 60 61 private: 62 // No more methods or variables can be defined here. 63 explicit ScreenGroup(sptr<ScreenGroupInfo> info); 64 void UpdateScreenGroupInfo(sptr<ScreenGroupInfo> info) const; 65 void UpdateScreenGroupInfo() const; 66 class Impl; 67 sptr<Impl> pImpl_; 68 }; 69 } // namespace OHOS::Rosen 70 71 #endif // FOUNDATION_DM_SCREEN_GROUP_H