Tizen 2.1 base
[framework/security/security-server.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 #include <dpl/event/event_support.h>
28
29 #include "Request.h"
30 #include "AsyncVerdictResultListener.h"
31
32 enum UsageValidity
33 {
34     USAGE_UNKNOWN,
35     USAGE_ONCE,
36     USAGE_SESSION,
37     USAGE_ALWAYS
38 };
39
40 enum UsageVerdict
41 {
42     USAGE_VERDICT_PERMIT,
43     USAGE_VERDICT_DENY,
44     USAGE_VERDICT_INAPPLICABLE,
45     USAGE_VERDICT_UNDETERMINED,
46     USAGE_VERDICT_UNKNOWN,
47     USAGE_VERDICT_ERROR
48 };
49 //Forward declaration
50 class PolicyEvaluator;
51
52 class PolicyEvaluatorData
53 {
54   private:
55     Request m_request;
56     UsageValidity m_validity;
57     UsageVerdict m_verdict;
58     AsyncVerdictResultListener *m_listener;
59   public:
60
61     PolicyEvaluatorData(const Request& request,
62             AsyncVerdictResultListener *listener) :
63         m_request(request),
64         m_validity(USAGE_UNKNOWN),
65         m_verdict(USAGE_VERDICT_ERROR),
66         m_listener(listener)
67     {
68     }
69
70     // KW     UsageValidity getValidity() const {
71     // KW         return m_validity;
72     // KW     }
73     // KW
74     // KW     UsageVerdict getVerdict() const {
75     // KW         return m_verdict;
76     // KW     }
77     // KW
78     // KW     void setValidity(UsageValidity validity) {
79     // KW         this->m_validity = validity;
80     // KW     }
81     // KW
82     // KW     void setVerdict(UsageVerdict verdict) {
83     // KW         this->m_verdict = verdict;
84     // KW     }
85
86     const Request& getRequest() const
87     {
88         return m_request;
89     }
90
91     AsyncVerdictResultListener* getListener() const
92     {
93         return m_listener;
94     }
95 };
96
97 #endif  //_USERDECISION_H