2 * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <unordered_map>
24 #include "wm_error.hpp"
36 ~LayerState() = default;
37 void attachIdToArea(const std::string& area, const WMClient&);
38 const std::unordered_map<std::string, std::string> popCurrentState();
39 const std::unordered_map<std::string, std::string> getCurrentState();
40 const std::vector<unsigned> getIviIdList();
41 void addLayer(unsigned layer);
42 void removeLayer(unsigned layer);
43 void setArea(const std::string& app, const std::string& area);
46 std::vector<unsigned> render_order;
47 std::unordered_map<std::string, std::string> area2appid;
59 explicit WMLayer(json_object* j, unsigned uuid);
62 // Status & Setting API
63 unsigned getNewLayerID(const std::string& role);
64 unsigned idBegin() { return this->id_begin; }
65 unsigned idEnd() { return this->id_end; }
66 unsigned getUuid() { return this->uuid; }
67 const std::string& layerName();
68 MANAGEMENT_TYPE layerType() { return this->type; }
69 void appendArea(const std::string& area);
70 void removeLayerID(unsigned id);
71 LayerState& getLayerState() { return tmp_state; }
72 WMError setLayerState(const LayerState& l);
73 bool hasLayerID(unsigned id);
74 bool hasRole(const std::string& role);
77 void addLayer(unsigned layer);
78 WMError commitChange();
84 std::string name = ""; // Layer name
86 std::string role_list;
87 std::vector<std::string> area_list;
88 std::vector<unsigned> id_list;
95 #endif // WM_LAYER_HPP