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"
35 ~LayerState() = default;
37 std::vector<unsigned> _ivi_layer_id_list;
38 std::unordered_map<std::string, unsigned> area2ivi_layer_id;
39 // std::map<std::string, unsigned> _render_order;
51 explicit LayerSetting(const std::string& name, MANAGEMENT_TYPE type, unsigned begin, unsigned end);
52 ~LayerSetting() = default;
54 const std::string& layerName() { return this->name; }
55 MANAGEMENT_TYPE layerType() { return this->type; };
56 void appendRole(const std::string& role);
57 void appendArea(const std::string& area);
58 unsigned idBegin() { return this->id_begin; }
59 unsigned idEnd() { return this->id_end; }
60 unsigned getNewLayerID(const std::string& role);
61 void removeLayerID(unsigned id);
63 /* unsigned getNewID(const std::string& role);
64 void remove(unsigned ivi_layer_id);
66 bool attach(unsigned ivi_layer_id, const std::string& area);
67 void stack(unsigned ivi_layer_id, const std::string& area);
68 bool updateRenderOrder(const std::vector<unsigned> list); */
71 std::string name = ""; // Layer name
73 std::vector<std::string> role_list;
74 std::vector<std::string> area_list;
75 std::vector<unsigned> id_list;
84 WMLayer(json_object* j);
86 unsigned getNewLayerID(const std::string& role);
87 LayerState getLayerState() const { return before_state; }
88 WMError setLayerState(const LayerState& l);
89 bool checkIDBelongTo(unsigned id);
91 LayerState before_state;
93 std::unique_ptr<LayerSetting> setting;