Tizen 2.1 base
[platform/framework/web/wrt-plugins-common.git] / src / plugins-api-support / SoFeatures.h
1 /*
2  * Copyright (c) 2012 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
18  * @author
19  * @version
20  * @brief    TODO This header must be removed because it does not fit to current
21  * solution, its just a temporary approach.
22  */
23 #ifndef _WRT_PLUGINS_COMMON_FEATURE_API_SO_FEATURES_H_
24 #define _WRT_PLUGINS_COMMON_FEATURE_API_SO_FEATURES_H_
25
26 #define PLUGIN_WIDGET_INIT_PROC_NAME         "on_widget_init"
27 //#define PLUGIN_WIDGET_INIT_PROC_NAME \
28 //    "_Z23on_widget_init_callbackP27feature_mapping_interface_s"
29
30 //TODO remove
31 /*
32  * list of device caps
33  */
34 typedef struct devcaps_s
35 {
36     char** deviceCaps;
37     size_t devCapsCount;
38 } devcaps_t;
39
40 /*
41  * mapping from a feature to corresponding list of device capabilities
42  */
43 typedef struct feature_devcaps_s
44 {
45     char* feature_name;
46     devcaps_t devCaps;
47 } feature_devcaps_t;
48
49 /*
50  * list of feature_devcaps_t structs
51  */
52 typedef struct feature_mapping_s
53 {
54     feature_devcaps_t* features;
55     size_t featuresCount;
56 } feature_mapping_t;
57
58
59 typedef feature_mapping_t* pfeature_mapping_t;
60
61 typedef pfeature_mapping_t (*features_getter)(void);
62
63 typedef const devcaps_t* (*devcaps_getter)(pfeature_mapping_t /*features*/,
64                                            const char* /*featureName*/);
65 typedef void (*deinitializer)(pfeature_mapping_t /*features*/);
66
67 typedef struct feature_mapping_interface_s
68 {
69     features_getter featGetter;  /* returns a list of api features */
70     devcaps_getter dcGetter;     /*
71                                   * for a given api feature returns a list of
72                                   * corresponding device capabilities
73                                   */
74
75     deinitializer release;       /* as memory ownership of features is
76                                   * transfered to callee you have to call
77                                   * the release function ptr on features
78                                   */
79 } feature_mapping_interface_t;
80
81 typedef void (*on_widget_init_proc)(feature_mapping_interface_t *interface);
82
83 #endif