apply FSL license
[pkgs/u/ui-gadget.git] / include / ug.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
18
19
20
21 #ifndef __UG_H__
22 #define __UG_H__
23
24 #include <bundle.h>
25 #include "ug-module.h"
26 #include "ui-gadget.h"
27
28 struct ug_child;
29
30 enum ug_state {
31         UG_STATE_READY = 0x00,
32         UG_STATE_CREATED,
33         UG_STATE_RUNNING,
34         UG_STATE_STOPPED,
35         UG_STATE_DESTROYING,
36         UG_STATE_DESTROYED,
37         UG_STATE_INVALID,
38         UG_STATE_MAX
39 };
40
41 enum ug_layout_state {
42         UG_LAYOUT_INIT = 0x00,
43         UG_LAYOUT_SHOW,
44         UG_LAYOUT_SHOWEFFECT,
45         UG_LAYOUT_HIDE,
46         UG_LAYOUT_HIDEEFFECT,
47         UG_LAYOUT_DESTROY,
48         UG_LAYOUT_NOEFFECT,
49         UG_LAYOUT_MAX
50 };
51
52 struct ui_gadget {
53         const char *name;
54         void *layout;
55         enum ug_state state;
56         enum ug_mode mode;
57         enum ug_option opt;
58
59         struct ui_gadget *parent;
60         void *children;
61
62         struct ug_module *module;
63         struct ug_cbs cbs;
64
65         bundle *data;
66
67         int destroy_me:1;
68         enum ug_layout_state layout_state;
69         void *effect_layout;
70 };
71
72 struct ui_gadget *ug_root_create(void);
73 int ug_free(struct ui_gadget *ug);
74
75 #endif                          /* __UG_H__ */