Update License
[platform/framework/web/livebox-viewer.git] / include / livebox_internal.h
1 /*
2  * Copyright 2013  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://floralicense.org
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 extern int lb_set_group(struct livebox *handler, const char *cluster, const char *category);
18 extern void lb_set_size(struct livebox *handler, int w, int h);
19 extern void lb_set_pdsize(struct livebox *handler, int w, int h);
20 extern void lb_set_default_pdsize(struct livebox *handler, int w, int h);
21 extern void lb_invoke_event_handler(struct livebox *handler, enum livebox_event_type event);
22 extern void lb_invoke_fault_handler(enum livebox_fault_type type, const char *pkgname, const char *filename, const char *function);
23 extern int lb_set_content(struct livebox *handler, const char *content);
24 extern int lb_set_title(struct livebox *handler, const char *title);
25 extern void lb_set_auto_launch(struct livebox *handler, const char *auto_launch);
26 extern struct livebox *lb_find_livebox(const char *pkgname, const char *filename);
27 extern struct livebox *lb_new_livebox(const char *pkgname, const char *filename, double timestamp);
28 extern struct livebox *lb_find_livebox_by_timestamp(double timestamp);
29 extern void lb_set_id(struct livebox *handler, const char *id);
30 extern void lb_set_size_list(struct livebox *handler, int size_list);
31 extern void lb_set_priority(struct livebox *handler, double priority);
32 extern int lb_set_lb_fb(struct livebox *handler, const char *filename);
33 extern int lb_set_pd_fb(struct livebox *handler, const char *filename);
34 extern struct fb_info *lb_get_pd_fb(struct livebox *handler);
35 extern struct fb_info *lb_get_lb_fb(struct livebox *handler);
36 extern void lb_set_user(struct livebox *handler, int user);
37 extern void lb_set_pinup(struct livebox *handler, int pinup);
38 extern void lb_set_text_lb(struct livebox *handler);
39 extern void lb_set_text_pd(struct livebox *handler);
40 extern int lb_text_lb(struct livebox *handler);
41 extern int lb_text_pd(struct livebox *handler);
42 extern void lb_set_period(struct livebox *handler, double period);
43 extern void lb_set_update_mode(struct livebox *handler, int active_mode);
44 extern struct livebox *lb_ref(struct livebox *handler);
45 extern struct livebox *lb_unref(struct livebox *handler);
46 extern int lb_send_delete(struct livebox *handler, ret_cb_t cb, void *data);
47 extern int lb_delete_all(void);
48
49 enum lb_type { /*!< Must have to be sync with data-provider-master */
50         _LB_TYPE_NONE = 0x0,
51         _LB_TYPE_SCRIPT,
52         _LB_TYPE_FILE,
53         _LB_TYPE_TEXT,
54         _LB_TYPE_BUFFER,
55 };
56
57 enum pd_type { /*!< Must have to be sync with data-provider-master */
58         _PD_TYPE_NONE = 0x0,
59         _PD_TYPE_SCRIPT,
60         _PD_TYPE_TEXT,
61         _PD_TYPE_BUFFER,
62 };
63
64 struct livebox {
65         int refcnt;
66         enum {
67                 CREATE = 0xBEEFbeef,
68                 DELETE = 0xDEADdead, /* Delete only for this client */
69                 DESTROYED = 0x00DEAD00,
70         } state;
71
72         char *cluster;
73         char *category;
74
75         char *pkgname;
76         char *id;
77         char *content;
78         char *title;
79         char *filename;
80
81         double timestamp;
82
83         enum livebox_visible_state visible;
84
85         int is_user;
86         int is_pd_created;
87         int is_pinned_up;
88         int is_active_update;
89
90         struct {
91                 enum lb_type type;
92                 union {
93                         struct fb_info *fb;
94                         struct livebox_script_operators ops;
95                 } data;
96
97                 int size_list;
98
99                 int width;
100                 int height;
101                 double priority;
102
103                 char *auto_launch;
104                 double period;
105                 int pinup_supported;
106                 int mouse_event;
107
108                 /* For the filtering event */
109                 double x;
110                 double y;
111         } lb;
112
113         struct {
114                 enum pd_type type;
115                 union {
116                         struct fb_info *fb;
117                         struct livebox_script_operators ops;
118                 } data;
119
120                 int width;
121                 int height;
122
123                 int default_width;
124                 int default_height;
125
126                 /* For the filtering event */
127                 double x;
128                 double y;
129         } pd;
130
131         int nr_of_sizes;
132
133         void *data;
134
135         ret_cb_t created_cb;
136         void *created_cbdata;
137
138         ret_cb_t deleted_cb;
139         void *deleted_cbdata;
140
141         ret_cb_t pinup_cb;
142         void *pinup_cbdata;
143
144         ret_cb_t group_changed_cb;
145         void *group_cbdata;
146
147         ret_cb_t period_changed_cb;
148         void *period_cbdata;
149
150         ret_cb_t size_changed_cb;
151         void *size_cbdata;
152
153         ret_cb_t pd_created_cb;
154         void *pd_created_cbdata;
155
156         ret_cb_t pd_destroyed_cb;
157         void *pd_destroyed_cbdata;
158
159         ret_cb_t update_mode_cb;
160         void *update_mode_cbdata;
161
162         ret_cb_t access_event_cb;
163         void *access_event_cbdata;
164 };
165
166 /* End of a file */