Fix invalid licenses
[platform/framework/web/crosswalk-tizen.git] / src / common / app_control.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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 WRT_COMMON_APP_CONTROL_H_
18 #define WRT_COMMON_APP_CONTROL_H_
19
20 #include <app_control.h>
21 #include <bundle.h>
22 #include <string>
23 #include <vector>
24 #include <map>
25
26 namespace wrt {
27
28 class AppControl {
29  public:
30   explicit AppControl(app_control_h app_control);
31   AppControl();
32   ~AppControl();
33   // disable copy
34   AppControl(const AppControl& src) = delete;
35   AppControl& operator=(const AppControl&) = delete;
36
37   std::string operation() const;
38   void set_operation(const std::string& operation);
39   std::string mime() const;
40   void set_mime(const std::string& mime);
41   std::string uri() const;
42   void set_uri(const std::string& uri);
43   std::string category() const;
44   void set_category(const std::string& category);
45   std::string data(const std::string& key) const;
46   std::vector<std::string> data_array(const std::string& key) const;
47   std::string encoded_bundle();
48
49   bool IsDataArray(const std::string& key);
50   bool AddData(const std::string& key, const std::string& value);
51   bool AddDataArray(const std::string& key,
52                     const std::vector<std::string>& value_array);
53   bool Reply(const std::map<std::string, std::vector<std::string>>& data);
54   bool LaunchRequest();
55
56  private:
57   app_control_h app_control_;
58   bundle* app_control_bundle_;
59 };
60
61 }  // namespace wrt
62
63 #endif  // WRT_COMMON_APP_CONTROL_H_