1 /* 2 * Copyright (c) 2021 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 INTERFACES_INNERKITS_WMSERVICE_WINDOW_MANAGER_SERVICE_TYPE_H 17 #define INTERFACES_INNERKITS_WMSERVICE_WINDOW_MANAGER_SERVICE_TYPE_H 18 19 #include <functional> 20 21 #include <display_type.h> 22 #include <promise.h> 23 #include <window_manager_type.h> 24 25 namespace OHOS { 26 enum WMSDisplayDirection { 27 WMS_DISPLAY_DIRECTION_DOWN = 0, 28 WMS_DISPLAY_DIRECTION_LEFT = 1, 29 WMS_DISPLAY_DIRECTION_UP = 2, 30 WMS_DISPLAY_DIRECTION_RIGHT = 3, 31 }; 32 33 using DisplayDirectionChangeFunc = std::function<void(WMSDisplayDirection newDirection)>; 34 35 struct WMSImageInfo { 36 GSError wret; 37 int32_t fd; 38 uint32_t width; 39 uint32_t height; 40 uint32_t stride; 41 uint32_t format; 42 uint64_t timestamp; 43 }; 44 45 struct PowerStatus { 46 GSError wret; 47 DispPowerStatus status; 48 }; 49 50 struct Backlight { 51 GSError wret; 52 uint32_t level; 53 }; 54 55 using PromiseWMError = Promise<WMError>; 56 using PromiseGSError = Promise<GSError>; 57 using PromiseWMSImageInfo = Promise<WMSImageInfo>; 58 using PromisePowerStatus = Promise<PowerStatus>; 59 using PromiseBacklight = Promise<Backlight>; 60 } // namespace OHOS 61 62 #endif // INTERFACES_INNERKITS_WMSERVICE_WINDOW_MANAGER_SERVICE_TYPE_H 63