Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / eail / eail_custom_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_custom_widget.h
22  *
23  * @brief Header for EailCustomWidget implementation
24  */
25
26 #ifndef EAIL_CUSTOM_WIDGET_H
27 #define EAIL_CUSTOM_WIDGET_H
28
29 #include "eail_widget.h"
30
31 /**
32  * @brief Returns a value corresponding to the type of EailCustomWidget class
33  */
34 #define EAIL_TYPE_CUSTOM_WIDGET              (eail_custom_widget_get_type())
35
36 /**
37  * @brief Macro upcasts an instance (obj) of a subclass to the EailCustomWidget
38  * type
39  *
40  * @param obj AtkObject instance
41  */
42 #define EAIL_CUSTOM_WIDGET(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), \
43                                        EAIL_TYPE_CUSTOM_WIDGET, EailCustomWidget))
44
45 /**
46  * @brief Macro upcasts a subclass (klass) to the EailCustomWidget class
47  *
48  * @param klass subclass object
49  */
50 #define EAIL_CUSTOM_WIDGET_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), \
51                                        EAIL_TYPE_CUSTOM_WIDGET, EailCustomWidgetClass))
52
53 /**
54  * @brief Tests whether object (obj) is an instance of EailCustomWidget class
55  *
56  * @param obj AtkObject instance
57  */
58 #define EAIL_IS_CUSTOM_WIDGET(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
59                                        EAIL_TYPE_CUSTOM_WIDGET))
60
61 /**
62  * @brief Tests whether given klass is a subclass of EailCustomWidget
63  *
64  * @param klass klass object
65  */
66 #define EAIL_IS_CUSTOM_WIDGET_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), \
67                                        EAIL_TYPE_CUSTOM_WIDGET))
68
69 /**
70  * @brief Gets EailCustomWidget class structure from an obj (class instance)
71  *
72  * @param obj object instance to get EailCustomWidget class from
73  */
74 #define EAIL_CUSTOM_WIDGET_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), \
75                                        EAIL_TYPE_CUSTOM_WIDGET, EailCustomWidgetClass))
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79
80 /** @brief Definition of object structure for Atk EailCustomWidget*/
81 typedef struct _EailCustomWidget      EailCustomWidget;
82
83 /** @brief Definition of object class for Atk EailCustomWidget*/
84 typedef struct _EailCustomWidgetClass EailCustomWidgetClass;
85
86 /** @brief Definition of object structure for Atk EailCustomWidget*/
87 struct _EailCustomWidget
88 {
89    EailWidget parent;/**< @brief Parent AtkObject whose functionality is being extended*/
90 };
91
92 /** @brief Definition of object class for Atk EailCustomWidget*/
93 struct _EailCustomWidgetClass
94 {
95    EailWidgetClass parent_class;/**< @brief class that is being extended*/
96
97    /** @brief callback definition for eail_widget_get_widget_children func*/
98    Eina_List * (*get_custom_widget_children)  (EailCustomWidget *widget);
99 };
100
101 /**
102  * @brief Getter for widget GType
103  *
104  * @returns GType for EailCustomWidget implementation
105  */
106 GType           eail_custom_widget_get_type  (void);
107 AtkObject *     eail_custom_widget_create    (Evas_Object *widget);
108 Evas_Object *   eail_custom_widget_get_widget(EailCustomWidget *widget);
109
110 #ifdef __cplusplus
111 }
112 #endif
113
114 #endif