fix for als2019 8.0.0
[apps/agl-service-windowmanager.git] / src / request.hpp
1 /*
2  * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef WMREQUEST_HPP
18 #define WMREQUEST_HPP
19
20 #include <string>
21 #include <vector>
22 #include <memory>
23
24 namespace wm
25 {
26
27 class WMClient;
28
29 enum Task
30 {
31     TASK_ALLOCATE,
32     TASK_RELEASE,
33     TASK_CHANGE_AREA,
34     TASK_PARKING_BRAKE_OFF,
35     TASK_PARKING_BRAKE_ON,
36     TASK_ACCEL_PEDAL_OFF,
37     TASK_ACCEL_PEDAL_ON,
38     TASK_HEDLAMP_OFF,
39     TASK_HEDLAMP_ON,
40     TASK_LIGHTSTATUS_BRAKE_OFF,
41     TASK_LIGHTSTATUS_BRAKE_ON,
42     TASK_RESTRICTION_MODE_OFF,
43     TASK_RESTRICTION_MODE_ON,
44     TASK_INVALID
45 };
46
47 enum TaskVisible
48 {
49     VISIBLE,
50     INVISIBLE,
51     REQ_REMOTE_VISIBLE,
52     REQ_REMOTE_INVISIBLE,
53     REMOTE_VISIBLE,
54     REMOTE_INVISIBLE,
55     NO_CHANGE
56 };
57
58 enum TaskCarState
59 {
60     PARKING_BRAKE_OFF,
61     PARKING_BRAKE_ON,
62     ACCEL_PEDAL_OFF,
63     ACCEL_PEDAL_ON,
64     HEDLAMP_OFF,
65     HEDLAMP_ON,
66     LIGHTSTATUS_BRAKE_OFF,
67     LIGHTSTATUS_BRAKE_ON,
68     CAR_STOP,
69     CAR_RUN,
70     RESTRICTION_MODE_OFF,
71     RESTRICTION_MODE_ON,
72     NO_TASK,
73 };
74
75 struct WMTrigger
76 {
77     std::string appid;
78     std::string role;
79     std::string area;
80     Task task;
81 };
82
83 struct WMAction
84 {
85     unsigned req_num;
86     std::shared_ptr<WMClient> client;
87     std::string role;
88     std::string area;
89     TaskVisible visible;
90     bool end_draw_finished;
91     TaskCarState car_state;
92 };
93
94 struct WMRequest
95 {
96     WMRequest();
97     explicit WMRequest(std::string appid, std::string role,
98                        std::string area, Task task);
99     explicit WMRequest(Task task);
100     virtual ~WMRequest();
101     WMRequest(const WMRequest &obj);
102
103     unsigned req_num;
104     struct WMTrigger trigger;
105     std::vector<struct WMAction> sync_draw_req;
106 };
107
108 } // namespace wm
109
110 #endif //WMREQUEST_HPP