tizen 2.3.1 release
[framework/web/wearable/wrt-security.git] / ace_client / include / ace-client / ace_client_types.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  * @file        ace_client_types.h
18  * @author      Tomasz Swierczek (t.swierczek@samsung.com)
19  * @version     1.0
20  * @brief       This file contains definitions of AceClient types
21  */
22 #ifndef WRT_ACE_CLIENT_TYPES_H
23 #define WRT_ACE_CLIENT_TYPES_H
24
25 #include <string>
26 #include <utility>
27 #include <map>
28
29 namespace AceClient {
30
31 typedef int   AceWidgetHandle;
32 typedef void* AceJobWidgetInstallId;
33
34 typedef std::string AceResource;
35 typedef std::string AceSubject;
36 typedef std::string AceSessionId;
37
38 enum AcePreference
39 {
40     PREFERENCE_PERMIT,
41     PREFERENCE_DENY,
42     PREFERENCE_DEFAULT,
43     PREFERENCE_BLANKET_PROMPT,
44     PREFERENCE_SESSION_PROMPT,
45     PREFERENCE_ONE_SHOT_PROMPT
46 };
47
48 typedef std::map<std::string, AcePreference>  AceResourcesPreferences;
49 typedef std::pair<std::string, AcePreference> AceResurcePreference;
50
51 struct AceParam
52 {
53     const char *name;
54     const char *value;
55
56     AceParam():
57         name(NULL), value(NULL)
58     {}
59
60     AceParam(const char *name, const char *value):
61         name(name), value(value)
62     {}
63 };
64
65 struct AceParamList
66 {
67     size_t    count;
68     AceParam* param;
69     AceParamList():
70         count(0),
71         param(NULL)
72     {}
73 };
74
75 struct AceDeviceCap
76 {
77     size_t        devcapsCount;
78     const char**  devCapNames;
79     size_t        paramsCount;
80     AceParamList* params;
81     AceDeviceCap():
82         devcapsCount(0),
83         devCapNames(NULL),
84         paramsCount(0),
85         params(NULL)
86     {}
87 };
88
89 struct AceApiFeatures
90 {
91     size_t       count;
92     const char** apiFeature;
93     AceApiFeatures():
94         count(0),
95         apiFeature(NULL)
96     {}
97 };
98
99 struct AceRequest
100 {
101     AceSessionId    sessionId;
102     AceWidgetHandle widgetHandle;
103     AceApiFeatures  apiFeatures;
104     const char*     functionName;
105     AceDeviceCap    deviceCapabilities;
106     AceRequest():
107         widgetHandle(0),
108         apiFeatures(),
109         functionName(NULL),
110         deviceCapabilities()
111     {}
112 };
113
114 } // namespace AceClient
115
116 #endif // WRT_ACE_CLIENT_TYPES_H