tizen 2.3 release
[framework/web/wearable/wrt-security.git] / ace / include / ace / WidgetUsageModel.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 //  @ Project : Access Control Engine
18 //  @ File Name : UserDecision.h
19 //  @ Date : 2009-05-22
20 //  @ Author : Samsung
21 //
22 //
23
24 #ifndef _WIDGET_USAGE_H
25 #define _WIDGET_USAGE_H
26
27 #ifdef DBUS_CONNECTION
28 #include <dpl/event/event_support.h>
29 #endif
30
31 #include "Request.h"
32 #include "AsyncVerdictResultListener.h"
33
34 enum UsageValidity
35 {
36     USAGE_UNKNOWN,
37     USAGE_ONCE,
38     USAGE_SESSION,
39     USAGE_ALWAYS
40 };
41
42 enum UsageVerdict
43 {
44     USAGE_VERDICT_PERMIT,
45     USAGE_VERDICT_DENY,
46     USAGE_VERDICT_INAPPLICABLE,
47     USAGE_VERDICT_UNDETERMINED,
48     USAGE_VERDICT_UNKNOWN,
49     USAGE_VERDICT_ERROR
50 };
51 //Forward declaration
52 class PolicyEvaluator;
53
54 class PolicyEvaluatorData
55 {
56   private:
57     Request m_request;
58     UsageValidity m_validity;
59     UsageVerdict m_verdict;
60     AsyncVerdictResultListener *m_listener;
61   public:
62
63     PolicyEvaluatorData(const Request& request,
64             AsyncVerdictResultListener *listener) :
65         m_request(request),
66         m_validity(USAGE_UNKNOWN),
67         m_verdict(USAGE_VERDICT_ERROR),
68         m_listener(listener)
69     {
70     }
71
72     // KW     UsageValidity getValidity() const {
73     // KW         return m_validity;
74     // KW     }
75     // KW
76     // KW     UsageVerdict getVerdict() const {
77     // KW         return m_verdict;
78     // KW     }
79     // KW
80     // KW     void setValidity(UsageValidity validity) {
81     // KW         this->m_validity = validity;
82     // KW     }
83     // KW
84     // KW     void setVerdict(UsageVerdict verdict) {
85     // KW         this->m_verdict = verdict;
86     // KW     }
87
88     const Request& getRequest() const
89     {
90         return m_request;
91     }
92
93     AsyncVerdictResultListener* getListener() const
94     {
95         return m_listener;
96     }
97 };
98
99 #endif  //_USERDECISION_H