sycn with master
[platform/framework/web/data-provider-slave.git] / include / so_handler.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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 typedef int (*create_t)(const char *filename, const char *content, const char *cluster, const char *category);
18 typedef int (*destroy_t)(const char *filename);
19 typedef int (*is_updated_t)(const char *filename);
20 typedef int (*need_to_destroy_t)(const char *filename);
21 typedef int (*update_content_t)(const char *filename);
22 typedef int (*clicked_t)(const char *filename, const char *event, double timestamp, double x, double y);
23 typedef int (*script_t)(const char *filename, const char *emission, const char *source, struct event_info *event_info);
24 typedef int (*resize_t)(const char *filename, int type);
25 typedef int (*create_needed_t)(const char *cluster, const char *category);
26 typedef int (*change_group_t)(const char *filename, const char *cluster, const char *category);
27 typedef int (*get_output_info_t)(const char *filename, int *w, int *h, double *priority, char **content, char **title);
28 typedef int (*initialize_t)(const char *pkgname);
29 typedef int (*finalize_t)(void);
30 typedef char *(*pinup_t)(const char *filename, int pinup);
31 typedef int (*is_pinned_up_t)(const char *filename);
32 typedef int (*system_event_t)(const char *filename, int type);
33
34 typedef int (*adaptor_create_t)(const char *pkgname, const char *filename, const char *content, const char *cluster, const char *category);
35 typedef int (*adaptor_destroy_t)(const char *pkgname, const char *filename);
36 typedef int (*adaptor_is_updated_t)(const char *pkgname, const char *filename);
37 typedef int (*adaptor_need_to_destroy_t)(const char *pkgname, const char *filename);
38 typedef int (*adaptor_update_content_t)(const char *pkgname, const char *filename);
39 typedef int (*adaptor_clicked_t)(const char *pkgname, const char *filename, const char *event, double timestamp, double x, double y);
40 typedef int (*adaptor_script_t)(const char *pkgname, const char *filename, const char *emission, const char *source, struct event_info *event_info);
41 typedef int (*adaptor_resize_t)(const char *pkgname, const char *filename, int type);
42 typedef int (*adaptor_create_needed_t)(const char *pkgname, const char *cluster, const char *category);
43 typedef int (*adaptor_change_group_t)(const char *pkgname, const char *filename, const char *cluster, const char *category);
44 typedef int (*adaptor_get_output_info_t)(const char *pkgname, const char *filename, int *w, int *h, double *priority, char **content, char **title);
45 typedef int (*adaptor_initialize_t)(const char *pkgname);
46 typedef int (*adaptor_finalize_t)(const char *pkgname);
47 typedef char *(*adaptor_pinup_t)(const char *pkgname, const char *filename, int pinup);
48 typedef int (*adaptor_is_pinned_up_t)(const char *pkgname, const char *filename);
49 typedef int (*adaptor_system_event_t)(const char *pkgname, const char *filename, int type);
50
51 struct instance {
52         struct so_item *item;
53         char *id;
54         char *content;
55         char *title;
56         int w;
57         int h;
58         double priority;
59         char *cluster;
60         char *category;
61 };
62
63 struct so_item {
64         char *so_fname;
65         char *pkgname;
66         void *handle;
67         int timeout;
68         int has_livebox_script;
69
70         Eina_List *inst_list;
71
72         struct {
73                 initialize_t initialize;
74                 finalize_t finalize;
75                 create_t create;
76                 destroy_t destroy;
77                 is_updated_t is_updated;
78                 update_content_t update_content;
79                 clicked_t clicked;
80                 script_t script_event;
81                 resize_t resize;
82                 create_needed_t create_needed;
83                 change_group_t change_group;
84                 get_output_info_t get_output_info;
85                 need_to_destroy_t need_to_destroy;
86                 pinup_t pinup;
87                 is_pinned_up_t is_pinned_up;
88                 system_event_t sys_event;
89         } livebox;
90
91         struct {
92                 adaptor_initialize_t initialize;
93                 adaptor_finalize_t finalize;
94                 adaptor_create_t create;
95                 adaptor_destroy_t destroy;
96                 adaptor_is_updated_t is_updated;
97                 adaptor_update_content_t update_content;
98                 adaptor_clicked_t clicked;
99                 adaptor_script_t script_event;
100                 adaptor_resize_t resize;
101                 adaptor_create_needed_t create_needed;
102                 adaptor_change_group_t change_group;
103                 adaptor_get_output_info_t get_output_info;
104                 adaptor_need_to_destroy_t need_to_destroy;
105                 adaptor_pinup_t pinup;
106                 adaptor_is_pinned_up_t is_pinned_up;
107                 adaptor_system_event_t sys_event;
108         } adaptor;
109 };
110
111 extern struct instance *so_find_instance(const char *pkgname, const char *filename);
112 extern int so_create(const char *pkgname, const char *filename, const char *content_info, int timeout, int has_livebox_script, const char *cluster, const char *category, const char *abi, struct instance **inst);
113 extern int so_is_updated(struct instance *inst);
114 extern int so_need_to_destroy(struct instance *inst);
115 extern int so_update(struct instance *inst);
116 extern int so_destroy(struct instance *inst);
117 extern int so_clicked(struct instance *inst, const char *event, double timestamp, double x, double y);
118 extern int so_script_event(struct instance *inst, const char *emission, const char *source, struct event_info *event_info);
119 extern int so_resize(struct instance *inst, int w, int h);
120 extern int so_create_needed(const char *pkgname, const char *cluster, const char *category, const char *abi);
121 extern int so_change_group(struct instance *inst, const char *cluster, const char *category);
122 extern int so_get_output_info(struct instance *inst, int *w, int *h, double *priority, char **content, char **title);
123 extern char *so_pinup(struct instance *inst, int pinup);
124 extern int so_is_pinned_up(struct instance *inst);
125 extern int so_sys_event(struct instance *inst, int event);
126
127 /* End of a file */