Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / eail / eail_widget.h
1 /*
2  * Copyright (c) 2013 Samsung Electronics Co., Ltd.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 /**
21  * @file eail_widget.h
22  *
23  * @brief Header for EailWindow implementation
24  */
25
26 #ifndef EAIL_WIDGET_H
27 #define EAIL_WIDGET_H
28
29 #include <atk/atk.h>
30
31 #include <Eina.h>
32 #include <Evas.h>
33
34 /**
35  * @brief Returns a value corresponding to the type of EailWidget class
36  */
37 #define EAIL_TYPE_WIDGET              (eail_widget_get_type())
38
39 /**
40  * @brief Macro upcasts an instance (obj) of a subclass to the EailWidget
41  * type
42  *
43  * @param obj AtkObject instance
44  */
45 #define EAIL_WIDGET(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
46                                        EAIL_TYPE_WIDGET, EailWidget))
47
48 /**
49  * @brief Macro upcasts a subclass (klass) to the EailWidget class
50  *
51  * @param klass subclass object
52  */
53 #define EAIL_WIDGET_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
54                                        EAIL_TYPE_WIDGET, EailWidgetClass))
55
56 /**
57  * @brief Tests whether object (obj) is an instance of EailWidget class
58  *
59  * @param obj AtkObject instance
60  */
61 #define EAIL_IS_WIDGET(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
62                                        EAIL_TYPE_WIDGET))
63
64 /**
65  * @brief Tests whether given klass is a subclass of EailWidget
66  *
67  * @param klass klass object
68  */
69 #define EAIL_IS_WIDGET_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
70                                        EAIL_TYPE_WIDGET))
71
72 /**
73  * @brief Gets EailWidget class structure from an obj (class instance)
74  *
75  * @param obj object instance to get EailWidget class from
76  */
77 #define EAIL_WIDGET_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
78                                        EAIL_TYPE_WIDGET, EailWidgetClass))
79 #ifdef __cplusplus
80 extern "C" {
81 #endif
82
83 /** @brief Definition of object structure for Atk EailWidget*/
84 typedef struct _EailWidget      EailWidget;
85
86 /** @brief Definition of object class for Atk EailWidget*/
87 typedef struct _EailWidgetClass EailWidgetClass;
88
89 /** @brief Definition of object structure for Atk EailWidget*/
90 struct _EailWidget
91 {
92    AtkObject parent;/**< @brief Parent AtkObject whose functionality is being extended*/
93
94    Evas_Object *widget;/**< @brief Internal widget that is represented by EailWidget */
95    AtkLayer layer;/**< @brief Describes layer of a component (eg. ATK_LAYER_WIDGET) */
96    Eina_List *custom_children;
97 };
98
99 /** @brief Definition of object class for Atk EailWidget*/
100 struct _EailWidgetClass
101 {
102    AtkObjectClass parent_class;/**< @brief class that is being extended*/
103
104    /** @brief callback definition for eail_widget_get_widget_children func*/
105    Eina_List * (*get_widget_children)  (EailWidget *widget);
106 };
107
108 /**
109  * @brief Getter for widget GType
110  *
111  * @returns GType for EailWidget implementation
112  */
113 GType           eail_widget_get_type                   (void);
114 Evas_Object *   eail_widget_get_widget                 (EailWidget *widget);
115 Eina_List *     eail_widget_get_widget_children        (EailWidget *widget);
116 Eina_Bool       eail_widget_add_custom_widget_child    (AtkObject *parent,
117                                                        AtkObject *custom_widget);
118 Eina_Bool       eail_widget_del_custom_widgets         (AtkObject *parent);
119 Eina_List *     eail_widget_get_widget_custom_children (EailWidget *widget);
120 #ifdef __cplusplus
121 }
122 #endif
123
124 #endif