1 #ifndef ELM_WIDGET_CONTAINER_H
2 #define ELM_WIDGET_CONTAINER_H
4 #include <elm_widget.h>
10 * @section elm-container-class The Elementary Container Class
12 * @image html container_inheritance_tree.png
13 * @image latex container_inheritance_tree.eps
15 * This class defines a common interface for objects acting like
16 * containers, i.e. objects parenting others and displaying their
17 * childs "inside" of them somehow.
19 * The container must define "parts" (or spots) into which child
20 * objects will be placed, inside of it. This is a way of handling
21 * more the one content object, by naming content locations
22 * properly. This is the role of the @c name argument of the virtual
23 * functions in the class.
25 * The following object functions are meant to be used with all
26 * container objects and derived ones:
28 * - elm_object_part_content_set()
29 * - elm_object_part_content_get()
30 * - elm_object_part_content_unset()
34 * @def ELM_CONTAINER_CLASS
36 * Use this macro to cast whichever subclass of
37 * #Elm_Container_Smart_Class into it, so to access its fields.
41 #define ELM_CONTAINER_CLASS(x) ((Elm_Container_Smart_Class *) x)
44 * @def ELM_CONTAINER_SMART_CLASS_VERSION
46 * Current version for Elementary container @b base smart class, a value
47 * which goes to _Elm_Container_Smart_Class::version.
51 #define ELM_CONTAINER_SMART_CLASS_VERSION 1
54 * @def ELM_CONTAINER_SMART_CLASS_INIT
56 * Initializer for a whole #Elm_Container_Smart_Class structure, with
57 * @c NULL values on its specific fields.
59 * @param smart_class_init initializer to use for the "base" field
60 * (#Evas_Smart_Class).
62 * @see EVAS_SMART_CLASS_INIT_NULL
63 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
64 * @see ELM_CONTAINER_SMART_CLASS_INIT_NULL
65 * @see ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION
69 #define ELM_CONTAINER_SMART_CLASS_INIT(smart_class_init) \
70 {smart_class_init, ELM_CONTAINER_SMART_CLASS_VERSION, NULL, NULL, NULL}
73 * @def ELM_CONTAINER_SMART_CLASS_INIT_NULL
75 * Initializer to zero out a whole #Elm_Container_Smart_Class structure.
77 * @see ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION
78 * @see ELM_CONTAINER_SMART_CLASS_INIT
82 #define ELM_CONTAINER_SMART_CLASS_INIT_NULL \
83 ELM_CONTAINER_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
86 * @def ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION
88 * Initializer to zero out a whole #Elm_Container_Smart_Class structure and
89 * set its name and version.
91 * This is similar to #ELM_CONTAINER_SMART_CLASS_INIT_NULL, but it will
92 * also set the version field of #Elm_Container_Smart_Class (base field)
93 * to the latest #ELM_CONTAINER_SMART_CLASS_VERSION and name it to the
96 * It will keep a reference to the name field as a <c>"const char *"</c>,
97 * i.e., the name must be available while the structure is
98 * used (hint: static or global variable!) and must not be modified.
100 * @see ELM_CONTAINER_SMART_CLASS_INIT_NULL
101 * @see ELM_CONTAINER_SMART_CLASS_INIT
105 #define ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION(name) \
106 ELM_CONTAINER_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
109 * Elementary container base smart class. This inherits directly from
110 * #Elm_Widget_Smart_Class and is meant to build widgets exposing
111 * "parts" to hold child elements at.
113 typedef struct _Elm_Container_Smart_Class
115 Elm_Widget_Smart_Class base; /**< Base Elementary widget class struct, since we're inheriting from it */
117 int version; /**< Version of this smart class definition */
118 Eina_Bool (*content_set)(Evas_Object *obj,
120 Evas_Object *content); /* 'Virtual' function on setting content on the object, at the given @a part part */
121 Evas_Object *(*content_get)(const Evas_Object * obj,
122 const char *part); /* 'Virtual' function on retrieving content from the object, at the given @a part part */
123 Evas_Object *(*content_unset)(Evas_Object * obj,
124 const char *part); /* 'Virtual' function on unsetting content from the object, at the given @a part part. Meant to return the content's pointer. */
125 } Elm_Container_Smart_Class;
127 typedef struct _Elm_Container_Smart_Data Elm_Container_Smart_Data;
128 struct _Elm_Container_Smart_Data
130 Elm_Widget_Smart_Data base;
136 EAPI const Elm_Container_Smart_Class *elm_container_smart_class_get(void);