tizen 2.3.1 release
[framework/web/wearable/wrt-security.git] / ace / include / ace / Request.h
1 /*
2  * Copyright (c) 2011 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 //
18 //
19 //  @ Project : Access Control Engine
20 //  @ File Name : Request.h
21 //  @ Date : 2009-05-06
22 //  @ Author : Samsung
23 //
24 //
25
26 #ifndef _REQUEST_H_
27 #define _REQUEST_H_
28
29 #include <set>
30 #include <string>
31 #include <vector>
32
33 #include <ace-dao-ro/IRequest.h>
34 #include <ace/WRT_INTERFACE.h>
35
36 class Request : public AceDB::IRequest
37 {
38   public:
39     typedef std::string DeviceCapability;
40     typedef std::set<DeviceCapability> DeviceCapabilitySet;
41
42     enum ApplicationType {
43         APP_TYPE_TIZEN,
44         APP_TYPE_WAC20,
45         APP_TYPE_UNKNOWN
46     };
47
48     Request(WidgetHandle widgetHandle,
49             WidgetExecutionPhase phase,
50             IFunctionParam *functionParam = 0)
51       : m_widgetHandle(widgetHandle)
52       , m_phase(phase)
53       , m_functionParam(functionParam)
54       , m_appType(APP_TYPE_UNKNOWN)
55     {}
56
57     WidgetHandle getWidgetHandle() const
58     {
59         return m_widgetHandle;
60     }
61
62     WidgetExecutionPhase getExecutionPhase() const
63     {
64         return m_phase;
65     }
66
67     IFunctionParam *getFunctionParam() const
68     {
69         return m_functionParam;
70     }
71
72     void addDeviceCapability(const std::string& device)
73     {
74         m_devcapSet.insert(device);
75     }
76
77     DeviceCapabilitySet getDeviceCapabilitySet() const
78     {
79         return m_devcapSet;
80     }
81
82     void setAppType(ApplicationType appType)
83     {
84         m_appType = appType;
85     }
86
87     ApplicationType getAppType() const
88     {
89         return m_appType;
90     }
91
92   private:
93     WidgetHandle m_widgetHandle;
94     WidgetExecutionPhase m_phase;
95     //! \brief list of function param (only for intercept)
96     IFunctionParam *m_functionParam;
97     //! \brief Set of defice capabilities
98     DeviceCapabilitySet m_devcapSet;
99     ApplicationType m_appType;
100 };
101
102 typedef std::vector <Request> Requests;
103
104 #endif  //_REQUEST_H_