Tizen release 1.0
[pkgs/u/ui-gadget.git] / include / ug.h
1 /*
2  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * This file is part of the UI Gadget
5  * Written by Jayoun Lee <airjany@samsung.com>, Jinwoo Nam <jwoo.nam@samsung.com>
6  *
7  * PROPRIETARY/CONFIDENTIAL
8  *
9  * This software is the confidential and proprietary information of
10  * SAMSUNG ELECTRONICS (Confidential Information).
11  * You shall not disclose such Confidential Information and shall
12  * use it only in accordance with the terms of the license agreement
13  * you entered into with SAMSUNG ELECTRONICS.  SAMSUNG make no
14  * representations or warranties about the suitability
15  * of the software, either express or implied, including but not
16  * limited to the implied warranties of merchantability, fitness for a particular purpose, or non-
17  * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as
18  * a result of using, modifying or distributing this software or its derivatives.
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 {
54         const char *name;
55         void *layout;
56         enum ug_state state;
57         enum ug_mode mode;
58         enum ug_option opt;
59
60         struct ui_gadget *parent;
61         void *children;
62
63         struct ug_module *module;
64         struct ug_cbs cbs;
65
66         bundle *data;
67
68         int destroy_me:1;
69         enum ug_layout_state layout_state;
70         void *effect_layout;
71 };
72
73 struct ui_gadget *ug_root_create(void);
74 int ug_free(struct ui_gadget *ug);
75
76 #endif                          /* __UG_H__ */