• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-2024 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 COORDINATION_MESSAGE_H
17 #define COORDINATION_MESSAGE_H
18 
19 namespace OHOS {
20 namespace Msdp {
21 enum class CoordinationMessage {
22     UNKNOW = -1,
23     PREPARE = 0,
24     UNPREPARE = 1,
25     ACTIVATE = 2,
26     ACTIVATE_SUCCESS = 3,
27     ACTIVATE_FAIL = 4,
28     DEACTIVATE_SUCCESS = 5,
29     DEACTIVATE_FAIL = 6,
30     SESSION_CLOSED = 7,
31     COORDINATION_SUCCESS = 8,
32     COORDINATION_STATUS_FREE = 9,
33     COORDINATION_STATUS_OUT = 10,
34     COORDINATION_STATUS_IN = 11
35 };
36 
37 enum class CoordinationErrCode {
38     COORDINATION_OK = 0,
39     OPEN_SESSION_FAILED = 1,
40     SEND_PACKET_FAILED = 2,
41     UNEXPECTED_START_CALL = 3,
42     WORKER_THREAD_TIMEOUT = 4,
43     NOT_AOLLOW_COOPERATE_WHEN_MOTION_DRAGGING = 5
44 };
45 
46 struct CoordinationMsgInfo {
47     CoordinationMessage msg;
48     int32_t errCode;
49 };
50 
51 enum class HotAreaType {
52     AREA_LEFT = 0,
53     AREA_RIGHT = 1,
54     AREA_TOP = 2,
55     AREA_BOTTOM = 3,
56     AREA_NONE = 4
57 };
58 
59 struct CooperateOptions {
60     int32_t displayX { -1 };
61     int32_t displayY { -1 };
62     int32_t displayId { -1 };
63 };
64 
65 enum class CooperateParamType : int32_t {
66     DEFAULT,
67     WITHOPTIONS
68 };
69 
70 inline constexpr uint32_t COORDINATION_DAMPLING_UP { 0x1 };
71 inline constexpr uint32_t COORDINATION_DAMPLING_DOWN { COORDINATION_DAMPLING_UP << 0x1 };
72 inline constexpr uint32_t COORDINATION_DAMPLING_LEFT { COORDINATION_DAMPLING_DOWN << 0x1 };
73 inline constexpr uint32_t COORDINATION_DAMPLING_RIGHT { COORDINATION_DAMPLING_LEFT << 0x1 };
74 inline constexpr uint32_t COORDINATION_DAMPLING_ALL {
75     COORDINATION_DAMPLING_UP | COORDINATION_DAMPLING_DOWN |
76     COORDINATION_DAMPLING_LEFT | COORDINATION_DAMPLING_RIGHT };
77 } // namespace Msdp
78 } // namespace OHOS
79 #endif // COORDINATION_MESSAGE_H