Tizen 2.1 base
[framework/web/wrt-commons.git] / modules / ace / include / dpl / 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 <dpl/ace-dao-ro/IRequest.h>
34
35 #include <dpl/ace/WRT_INTERFACE.h>
36
37 class Request : public AceDB::IRequest
38 {
39   public:
40     typedef std::string DeviceCapability;
41     typedef std::set<DeviceCapability> DeviceCapabilitySet;
42
43     Request(WidgetHandle widgetHandle,
44             WidgetExecutionPhase phase,
45             IFunctionParam *functionParam = 0)
46       : m_widgetHandle(widgetHandle)
47       , m_phase(phase)
48       , m_functionParam(functionParam)
49     {}
50
51     WidgetHandle getWidgetHandle() const
52     {
53         return m_widgetHandle;
54     }
55
56     WidgetExecutionPhase getExecutionPhase() const
57     {
58         return m_phase;
59     }
60
61     IFunctionParam *getFunctionParam() const
62     {
63         return m_functionParam;
64     }
65
66     void addDeviceCapability(const std::string& device)
67     {
68         m_devcapSet.insert(device);
69     }
70
71     DeviceCapabilitySet getDeviceCapabilitySet() const
72     {
73         return m_devcapSet;
74     }
75
76   private:
77     WidgetHandle m_widgetHandle;
78     WidgetExecutionPhase m_phase;
79     //! \brief list of function param (only for intercept)
80     IFunctionParam *m_functionParam;
81     //! \brief Set of defice capabilities
82     DeviceCapabilitySet m_devcapSet;
83 };
84
85 typedef std::vector <Request> Requests;
86
87 #endif  //_REQUEST_H_