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