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 BROWSER_APP_CONTROL_H_
18 #define BROWSER_APP_CONTROL_H_
20 #include <app_control.h>
29 class NativeAppControl {
31 static std::unique_ptr<NativeAppControl> MakeAppcontrolFromURL(
32 const std::string& url);
34 explicit NativeAppControl(app_control_h app_control);
35 explicit NativeAppControl();
39 NativeAppControl(const NativeAppControl& src) = delete;
40 NativeAppControl& operator=(const NativeAppControl&) = delete;
42 std::string GetOperation() const;
43 void SetOperation(const std::string& operation);
45 std::string GetMime() const;
46 void SetMime(const std::string& mime);
48 std::string GetUri() const;
49 void SetUri(const std::string& uri);
51 std::string GetCategory() const;
52 void SetCategory(const std::string& category);
54 bool IsDataArray(const std::string& key);
55 std::string GetData(const std::string& key) const;
56 std::vector<std::string> GetDataArray(const std::string& key) const;
57 bool AddData(const std::string& key, const std::string& value);
58 bool AddDataArray(const std::string& key,
59 const std::vector<std::string>& value_array);
61 bool SendLaunchRequest();
62 bool Reply(const std::map<std::string, std::vector<std::string>>& data);
64 std::string GetEncodedBundle();
67 app_control_h app_control_ = nullptr;
68 bundle* app_control_bundle_ = nullptr;
73 #endif // BROWSER_APP_CONTROL_H_