wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Application / ApplicationControl.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 #ifndef TIZENAPIS_API_APPLICATION_CONTROL_H_
19 #define TIZENAPIS_API_APPLICATION_CONTROL_H_
20
21 #include <string>
22 #include <vector>
23 #include <dpl/shared_ptr.h>
24 #include <app_service.h>
25 #include "ApplicationControlData.h"
26
27 namespace DeviceAPI {
28 namespace Application {
29
30 class ApplicationControl;
31 typedef DPL::SharedPtr<ApplicationControl> ApplicationControlPtr;
32
33 /* This object represents a single extra data for service request and reply */
34 class ApplicationControl
35 {
36   public:
37     ApplicationControl();
38         ApplicationControl(const std::string &op, const std::string &uri, const std::string &mime,
39                         const std::string &category, std::vector<ApplicationControlDataPtr> &dataArray) ;
40     ~ApplicationControl();
41
42         std::string getOperation() const;
43         void setOperation(const std::string &operation);
44
45         std::string getUri() const;
46         void setUri(const std::string &uri);
47
48         std::string getMime() const;
49         void setMime(const std::string &uri);
50
51         std::string getCategory() const;
52         void setCategory(const std::string &category);
53
54         std::vector<ApplicationControlDataPtr> getAppControlDataArray() const;
55         void setAppControlDataArray(const std::vector<ApplicationControlDataPtr> &dataArray);
56         void addAppControlData(const ApplicationControlDataPtr &data);
57
58         service_h getService_h() const;
59         void setService_h(const service_h service);  
60
61 #if 0
62         void replyResult(std::vector<ApplicationControlDataPtr> &appControlDataArray);
63         void replyFailure();
64 #endif
65
66   private:
67         std::string m_operation;
68         std::string m_uri;
69         std::string m_mime;
70         std::string m_category;
71         std::vector<ApplicationControlDataPtr> m_appControlDataArray;
72         service_h m_appControl;
73 };
74 }
75 }
76 #endif