2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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.
17 #ifndef XWALK_COMMON_APP_CONTROL_H_
18 #define XWALK_COMMON_APP_CONTROL_H_
20 #include <app_control.h>
31 static std::unique_ptr<AppControl> MakeAppcontrolFromURL(
32 const std::string& url);
33 explicit AppControl(app_control_h app_control);
37 AppControl(const AppControl& src) = delete;
38 AppControl& operator=(const AppControl&) = delete;
40 std::string operation() const;
41 void set_operation(const std::string& operation);
42 std::string mime() const;
43 void set_mime(const std::string& mime);
44 std::string uri() const;
45 void set_uri(const std::string& uri);
46 std::string category() const;
47 void set_category(const std::string& category);
48 std::string data(const std::string& key) const;
49 std::vector<std::string> data_array(const std::string& key) const;
50 std::string encoded_bundle();
52 bool IsDataArray(const std::string& key);
53 bool AddData(const std::string& key, const std::string& value);
54 bool AddDataArray(const std::string& key,
55 const std::vector<std::string>& value_array);
56 bool Reply(const std::map<std::string, std::vector<std::string>>& data);
60 app_control_h app_control_;
61 bundle* app_control_bundle_;
66 #endif // XWALK_COMMON_APP_CONTROL_H_