1 /* 2 * Copyright (c) 2025 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 ONSCREEN_MANAGER_H 17 #define ONSCREEN_MANAGER_H 18 19 #include <functional> 20 #include <memory> 21 22 #include "nocopyable.h" 23 24 #include "devicestatus_common.h" 25 #include "on_screen_data.h" 26 27 namespace OHOS { 28 namespace Msdp { 29 namespace DeviceStatus { 30 namespace OnScreen { 31 class OnScreenManager { 32 public: 33 /** 34 * @brief Obtains a <b>OnScreenManager</b> instance. 35 * @return Returns a <b>OnScreenManager</b> instance. 36 * @since 20 37 */ 38 static OnScreenManager &GetInstance(); 39 40 /** 41 * @brief Get page content. 42 * @param option page content option 43 * @param pageContent page content obtained by interface 44 * @return Returns <b>0</b> if the operation is successful; returns a non-zero value otherwise. 45 * @since 20 46 */ 47 int32_t GetPageContent(const ContentOption& option, PageContent& pageContent); 48 49 /** 50 * @brief Send control event to control screen action 51 * @param event control event 52 * @return Returns <b>0</b> if the operation is successful; returns a non-zero value otherwise. 53 * @since 20 54 */ 55 int32_t SendControlEvent(const ControlEvent& event); 56 private: 57 OnScreenManager() = default; 58 DISALLOW_COPY_AND_MOVE(OnScreenManager); 59 }; 60 } // namespace OnScreen 61 } // namespace DeviceStatus 62 } // namespace Msdp 63 } // namespace OHOS 64 #endif // ON_SCREEN_MANAGER_H