Add widget app restart logic
[platform/core/appfw/appcore-widget.git] / src / widget-private.h
1 /*
2  * Copyright (c) 2015 - 2016 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
18 #ifndef __APPCORE_WIDGET_PRIVATE_H__
19 #define __APPCORE_WIDGET_PRIVATE_H__
20
21 #include <glib.h>
22
23 #include <Elementary.h>
24 #include <widget_app.h>
25 #include <app_common.h>
26 #include <widget_errno.h>
27
28 #define FEATURE_SHELL_APPWIDGET "http://tizen.org/feature/shell.appwidget"
29
30 struct _widget_class {
31         void *user_data;
32         widget_instance_lifecycle_callback_s ops;
33         char *classid;
34         struct _widget_class *next;
35         struct _widget_class *prev;
36 };
37
38 struct _widget_context {
39         char *id;
40         struct _widget_class *provider;
41         int state;
42         void *tag;
43         Evas_Object *win;
44         int win_id;
45         char *content;
46         widget_instance_lifecycle_callback_s ops;
47 };
48
49 typedef struct _widget_context widget_context_s;
50
51 GList *_widget_app_get_contexts();
52 int _widget_app_add_context(widget_context_s *wc);
53 int _widget_app_remove_context(widget_context_s *wc);
54 int _widget_app_set_viewer_endpoint(char *viewer_endpoint);
55 char *_widget_app_get_viewer_endpoint();
56 int _widget_app_free_viewer_endpoint();
57 int _set_i18n(const char *domainname);
58 void _update_lang(void);
59 void _update_region(void);
60 int widget_app_error(widget_error_e error, const char *function,
61                 const char *description);
62
63 #endif /* __APPCORE_WIDGET_PRIVATE_H__ */
64