Initialize Tizen 2.3
[framework/web/wrt-plugins-common.git] / src_mobile / 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 typedef feature_mapping_t* pfeature_mapping_t;
59
60 typedef pfeature_mapping_t (*features_getter)(void);
61
62 typedef const devcaps_t* (*devcaps_getter)(pfeature_mapping_t /*features*/,
63                                            const char* /*featureName*/);
64 typedef void (*deinitializer)(pfeature_mapping_t /*features*/);
65
66 typedef struct feature_mapping_interface_s
67 {
68     features_getter featGetter;  /* returns a list of api features */
69     devcaps_getter dcGetter;     /*
70                                   * for a given api feature returns a list of
71                                   * corresponding device capabilities
72                                   */
73
74     deinitializer release;       /* as memory ownership of features is
75                                   * transfered to callee you have to call
76                                   * the release function ptr on features
77                                   */
78 } feature_mapping_interface_t;
79
80 typedef void (*on_widget_init_proc)(feature_mapping_interface_t *interface);
81
82 #endif