Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / eail / eail_action_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_action_widget.h
22  *
23  * @brief Header for EailActionWidget implementation
24  */
25
26 #ifndef EAIL_ACTION_WIDGET_H
27 #define EAIL_ACTION_WIDGET_H
28
29 #include "eail_widget.h"
30
31 /**
32  * @brief Returns a value corresponding to the type of EailActionWidget class
33  */
34 #define EAIL_TYPE_ACTION_WIDGET             (eail_action_widget_get_type())
35 /**
36  * @brief Macro upcasts an instance (obj) of a subclass to the EailActionWidget
37  * type
38  *
39  * @param obj AtkObject instance
40  */
41
42 #define EAIL_ACTION_WIDGET(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), \
43                                              EAIL_TYPE_ACTION_WIDGET, EailActionWidget))
44 /**
45  * @brief Macro upcasts a subclass (klass) to the EailActionWidget class
46  *
47  * @param klass subclass object
48  */
49
50 #define EAIL_ACTION_WIDGET_CLASS(klass)     (G_TYPE_ACTION_WIDGET_CLASS_CAST((klass), \
51                                              EAIL_TYPE_ACTION_WIDGET, EailActionWidgetClass))
52 /**
53  * @brief Tests whether object (obj) is an instance of EailActionWidget class
54  *
55  * @param obj an AtkObject
56  */
57 #define EAIL_IS_ACTION_WIDGET(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
58                                              EAIL_TYPE_ACTION_WIDGET))
59 /**
60  * @brief Tests whether given klass is a subclass of EailActionWidget
61  *
62  * @param klass klass object
63  */
64
65 #define EAIL_IS_ACTION_WIDGET_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), \
66                                              EAIL_TYPE_ACTION_WIDGET))
67 /**
68  * @brief Gets EailActionWidget class structure from an obj (class instance)
69  *
70  * @param obj object instance to get EailActionWidget class from
71  */
72 #define EAIL_ACTION_WIDGET_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), \
73                                              EAIL_TYPE_ACTION_WIDGET, EailActionWidgetClass))
74
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78
79 /** @brief Definition of object structure for Atk EailActionWidget*/
80 typedef struct _EailActionWidget      EailActionWidget;
81 /** @brief Definition of class structure for Atk EailActionWidget*/
82 typedef struct _EailActionWidgetClass EailActionWidgetClass;
83
84 /*! \brief Callback used for performing work-action by given ActionObject
85  */
86 typedef gboolean (* Eail_Do_Action_Cb) (AtkAction *obj, void *data);
87
88 /*! \brief Appends given action to action list used by EailActionWidget
89  */
90 void eail_action_widget_action_append(EailActionWidget *action_widget,
91                                       const gchar *action_name,
92                                       const gchar *keybinding,
93                                       Eail_Do_Action_Cb action_cb);
94
95 /** @brief Definition of object structure for Atk EailActionWidget
96  * */
97 struct _EailActionWidget
98 {
99    /** @brief Parent widget whose functionality is being extended */
100    EailWidget parent;
101    /** @brief List of action objects (EailActionObj*) */
102    Eina_List *action_objs;
103 };
104
105 /** @brief Definition of class structure for Atk EailActionWidget
106  * */
107 struct _EailActionWidgetClass
108 {
109    EailWidgetClass parent_class;/**< class whose functionality is being extended*/
110 };
111
112 /** @brief Getter for EailActionWidget GType
113  * @returns GType for EailActionWidget implementation
114  * */
115 GType eail_action_widget_get_type(void);
116
117 #ifdef __cplusplus
118 }
119 #endif
120
121 #endif