add source for ces2019
[apps/agl-service-windowmanager-2017.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_PARKING_BRAKE_OFF,
34     TASK_PARKING_BRAKE_ON,
35     TASK_ACCEL_PEDAL_OFF,
36     TASK_ACCEL_PEDAL_ON,
37     TASK_HEDLAMP_OFF,
38     TASK_HEDLAMP_ON,
39     TASK_LIGHTSTATUS_BRAKE_OFF,
40     TASK_LIGHTSTATUS_BRAKE_ON,
41     TASK_RESTRICTION_MODE_OFF,
42     TASK_RESTRICTION_MODE_ON,
43     TASK_INVALID
44 };
45
46 enum TaskVisible
47 {
48     VISIBLE,
49     INVISIBLE,
50     REQ_REMOTE_VISIBLE,
51     REQ_REMOTE_INVISIBLE,
52     REMOTE_VISIBLE,
53     REMOTE_INVISIBLE,
54     NO_CHANGE
55 };
56
57 enum TaskCarState
58 {
59     PARKING_BRAKE_OFF,
60     PARKING_BRAKE_ON,
61     ACCEL_PEDAL_OFF,
62     ACCEL_PEDAL_ON,
63     HEDLAMP_OFF,
64     HEDLAMP_ON,
65     LIGHTSTATUS_BRAKE_OFF,
66     LIGHTSTATUS_BRAKE_ON,
67     CAR_STOP,
68     CAR_RUN,
69     RESTRICTION_MODE_OFF,
70     RESTRICTION_MODE_ON,
71     NO_TASK,
72 };
73
74 struct WMTrigger
75 {
76     std::string appid;
77     std::string role;
78     std::string area;
79     Task task;
80 };
81
82 struct WMAction
83 {
84     unsigned req_num;
85     std::shared_ptr<WMClient> client;
86     std::string role;
87     std::string area;
88     TaskVisible visible;
89     bool end_draw_finished;
90     TaskCarState car_state;
91 };
92
93 struct WMRequest
94 {
95     WMRequest();
96     explicit WMRequest(std::string appid, std::string role,
97                        std::string area, Task task);
98     explicit WMRequest(Task task);
99     virtual ~WMRequest();
100     WMRequest(const WMRequest &obj);
101
102     unsigned req_num;
103     struct WMTrigger trigger;
104     std::vector<struct WMAction> sync_draw_req;
105 };
106
107 } // namespace wm
108
109 #endif //WMREQUEST_HPP