Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / eail / eail_item_parent.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_item_parent.h
22  *
23  * @brief Header for EailItemParent implementation
24  */
25
26 #ifndef EAIL_ITEM_PARENT_H
27 #define EAIL_ITEM_PARENT_H
28
29 #include "eail_item.h"
30 /**
31  * @brief Returns a value corresponding to the type of EailItemParent interface
32  */
33 #define EAIL_TYPE_ITEM_PARENT           (eail_item_parent_get_type())
34 /**
35  * @brief Macro upcasts an instance (obj) of a subclass to the EailItemParent
36  * interface
37  *
38  * @param obj AtkObject instance
39  */
40 #define EAIL_ITEM_PARENT(obj)           (G_TYPE_CHECK_INSTANCE_CAST((obj), \
41                                          EAIL_TYPE_ITEM_PARENT, EailItemParent))
42 /**
43  * @brief Tests whether object (obj) implements EailItemParent interface
44  *
45  * @param obj AtkObject instance
46  */
47 #define EAIL_IS_ITEM_PARENT(obj)        (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
48                                          EAIL_TYPE_ITEM_PARENT))
49 /**
50  * @brief Gets EailItemParent interface structure from an obj (class instance)
51  *
52  * @param obj object instance to get EailItemParent interface from
53  */
54 #define EAIL_ITEM_PARENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj),\
55                                          EAIL_TYPE_ITEM_PARENT, EailItemParentIface))
56
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60
61 /** @brief Definition of object structure for Atk EailItemParent*/
62 typedef struct _EailItemParent      EailItemParent;
63 /** @brief Definition of interface structure for Atk EailItemParent*/
64 typedef struct _EailItemParentIface EailItemParentIface;
65
66 /** @brief Definition of interface structure for Atk EailItemParent*/
67 struct _EailItemParentIface
68 {
69    GTypeInterface parent;/**< @brief Parent interface that is being extended*/
70
71    /**@brief Callback definition for eail_item_parent_get_item_name function*/
72    const gchar *(*get_item_name)            (EailItemParent   *parent,
73                                             EailItem         *item);
74
75    /**@brief Callback definition for eail_item_parent_get_item_role function*/
76    AtkRole      (*get_item_role)            (EailItemParent   *parent,
77                                             EailItem         *item);
78
79    /**@brief Callback definition for eail_item_parent_get_index_in_parent function*/
80    gint         (*get_item_index_in_parent) (EailItemParent   *parent,
81                                             EailItem         *item);
82
83    /**@brief Callback definition for eail_item_parent_get_n_children function*/
84    gint         (*get_n_children)           (EailItemParent   *parent,
85                                             EailItem         *item);
86
87    /**@brief Callback definition for eail_item_parent_ref_n_child function*/
88    AtkObject *  (*ref_n_child)              (EailItemParent   *parent,
89                                             EailItem         *item,
90                                             gint             index);
91
92    /**@brief Callback definition for eail_item_parent_ref_item_state_set function*/
93    AtkStateSet *
94                 (*ref_item_state_set)       (EailItemParent   *parent,
95                                             EailItem         *item,
96                                             AtkStateSet      *state_set);
97
98    /* AtkComponent interface */
99    /**@brief Callback definition for eail_item_parent_grab_item_focus function*/
100    gboolean    (*grab_item_focus)          (EailItemParent   *parent,
101                                             EailItem         *item);
102
103    /**@brief Callback definition for eail_item_parent_get_item_extents function*/
104    void        (*get_item_extents)         (EailItemParent   *parent,
105                                             EailItem         *item,
106                                             gint             *x,
107                                             gint             *y,
108                                             gint             *width,
109                                             gint             *height,
110                                             AtkCoordType      coord_type);
111
112    /**@brief Callback definition for eail_item_parent_get_evas_obj function*/
113    Evas_Object * (*get_evas_obj)           (EailItemParent   *parent,
114                                             EailItem         *item);
115
116    /**@brief Callback definition for eail_item_parent_get_actions_supported
117     * function*/
118    gboolean    (*get_actions_supported)       (EailItemParent   *parent,
119                                                EailItem         *item);
120
121    /**@brief Callback definition for eail_item_parent_is_content_get_supported
122     * function*/
123    gboolean    (*is_content_get_supported) (EailItemParent   *parent,
124                                             EailItem         *item);
125 };
126
127 /** @brief Enum that is used for representing supported actions by item*/
128 enum EailActionSupported
129 {
130     EAIL_ACTION_SUPPORTED_NONE = 1 << 0,
131     EAIL_ACTION_SUPPORTED_CLICK = 1 << 1,
132     EAIL_ACTION_SUPPORTED_PRESS = 1 << 2,
133     EAIL_ACTION_SUPPORTED_RELEASE = 1 << 3,
134     EAIL_ACTION_SUPPORTED_EXPAND = 1 << 4,
135     EAIL_ACTION_SUPPORTED_SHRINK = 1 << 5
136 };
137
138
139 GType eail_item_parent_get_type(void);
140 const gchar * eail_item_parent_get_item_name(EailItemParent *parent,
141                                              EailItem *item);
142 AtkRole eail_item_parent_get_item_role(EailItemParent *parent,
143                                        EailItem *item);
144 gint eail_item_parent_get_n_children(EailItemParent *parent,
145                                      EailItem *item);
146 AtkObject * eail_item_parent_ref_n_child(EailItemParent *parent,
147                                          EailItem *item,
148                                          gint index);
149 gint eail_item_parent_get_item_index_in_parent(EailItemParent *parent,
150                                                EailItem *item);
151 AtkStateSet * eail_item_parent_ref_item_state_set(EailItemParent *parent,
152                                                   EailItem *item,
153                                                   AtkStateSet *state_set);
154 gboolean eail_item_parent_grab_item_focus(EailItemParent *parent,
155                                           EailItem *item);
156 void eail_item_parent_get_item_extents(EailItemParent *parent,
157                                        EailItem *item,
158                                        gint *x,
159                                        gint *y,
160                                        gint *width,
161                                        gint *height,
162                                        AtkCoordType coord_type);
163 gboolean eail_item_parent_get_actions_supported(EailItemParent *parent,
164                                                 EailItem *item);
165 gboolean eail_item_parent_is_is_content_get_supported(EailItemParent *parent,
166                                                       EailItem *item);
167 Evas_Object * eail_item_parent_get_evas_obj(EailItemParent *parent,
168                                             EailItem *item);
169
170 #ifdef __cplusplus
171 }
172 #endif
173
174 #endif