tizen 2.0 beta
[framework/appfw/ui-gadget-1.git] / include / ug.h
1 /*
2  *  UI Gadget
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __UG_H__
23 #define __UG_H__
24
25 #include <bundle.h>
26 #include "ug-module.h"
27 #include "ui-gadget.h"
28
29 struct ug_child;
30
31 enum ug_state {
32         UG_STATE_READY = 0x00,
33         UG_STATE_CREATED,
34         UG_STATE_RUNNING,
35         UG_STATE_STOPPED,
36         UG_STATE_DESTROYING,
37         UG_STATE_DESTROYED,
38         UG_STATE_INVALID,
39         UG_STATE_MAX
40 };
41
42 enum ug_layout_state {
43         UG_LAYOUT_INIT = 0x00,
44         UG_LAYOUT_SHOW,
45         UG_LAYOUT_SHOWEFFECT,
46         UG_LAYOUT_HIDE,
47         UG_LAYOUT_HIDEEFFECT,
48         UG_LAYOUT_DESTROY,
49         UG_LAYOUT_NOEFFECT,
50         UG_LAYOUT_MAX
51 };
52
53 struct ui_gadget_s {
54         const char *name;
55         void *layout;
56         enum ug_state state;
57         enum ug_mode mode;
58         enum ug_option opt;
59
60         ui_gadget_h parent;
61         void *children;
62
63         struct ug_module *module;
64         struct ug_cbs cbs;
65
66         service_h service;
67
68         int destroy_me:1;
69         enum ug_layout_state layout_state;
70         void *effect_layout;
71 };
72
73 ui_gadget_h ug_root_create(void);
74 int ug_free(ui_gadget_h ug);
75
76 #endif                          /* __UG_H__ */