blob: 789ea36e38f3e0793468ee28548b2b5d99a4eba1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
#ifndef EFL_MODEL_COMMON_H__
# define EFL_MODEL_COMMON_H__
#include <Eina.h>
EAPI extern Eina_Error EFL_MODEL_ERROR_UNKNOWN;
EAPI extern Eina_Error EFL_MODEL_ERROR_NOT_SUPPORTED;
EAPI extern Eina_Error EFL_MODEL_ERROR_NOT_FOUND;
EAPI extern Eina_Error EFL_MODEL_ERROR_READ_ONLY;
EAPI extern Eina_Error EFL_MODEL_ERROR_INIT_FAILED;
EAPI extern Eina_Error EFL_MODEL_ERROR_INCORRECT_VALUE;
EAPI extern Eina_Error EFL_MODEL_ERROR_PERMISSION_DENIED;
EAPI extern Eina_Error EFL_MODEL_ERROR_INVALID_OBJECT; /**< @since 1.19 */
/**
* @struct _Efl_Model_Children_Event
* Every time a child id added the event
* EFL_MODEL_EVENT_CHILD_ADDED is dispatched
* passing along this structure.
*/
struct _Efl_Model_Children_Event
{
/**
* index is a hint and is intended
* to provide a way for applications
* to control/know children relative
* positions through listings.
*/
unsigned int index;
/**
* If an object has been build for this index and
* is currently tracked by the parent, it wild be
* available here.
*/
Eo *child;
};
/**
* @struct Efl_Model_Children_Event
*/
typedef struct _Efl_Model_Children_Event Efl_Model_Children_Event;
#include "interfaces/efl_model.eo.h"
EAPI int efl_model_init(void);
/**
* @brief Notifies a property changed event with an @c EFL_MODEL_EVENT_PROPERTIES_CHANGED
*
* @param model The model to be notified
* @param property The changed property
*
* @since 1.17
*/
EAPI void _efl_model_properties_changed_internal(const Efl_Model *model, ...);
#define efl_model_properties_changed(Model, ...) _efl_model_properties_changed_internal(Model, ##__VA_ARGS__, NULL)
/**
* @brief Notifies a property invalidated event with an @c EFL_MODEL_EVENT_PROPERTIES_CHANGED
*
* @param model The model to be notified
* @param property The invalidated property
*
* @since 1.17
*/
EAPI void efl_model_property_invalidated_notify(Efl_Model *model, const char *property);
/**
* @brief Callback to setup a member of @c Eina_Value_Struct
*
* @param data The user data
* @param index The member index
* @param member The member to fill its name and type. Must use @c Eina_Stringshare for name.
*/
typedef void (*Efl_Model_Value_Struct_Member_Setup_Cb)(void *data, int index, Eina_Value_Struct_Member *member);
/**
* @brief Creates a new struct description
*
* @param member_count The number of struct members
* @param setup_cb The callback to setup struct members
* @param data The user data
* @return Returns the struct description
*
* @since 1.17
*/
EAPI Eina_Value_Struct_Desc *efl_model_value_struct_description_new(unsigned int member_count, Efl_Model_Value_Struct_Member_Setup_Cb setup_cb, void *data) EINA_ARG_NONNULL(2);
/**
* @brief Frees the memory allocated to the struct description.
*
* @param desc The struct description. If @c NULL, the function returns immediately.
*
* @since 1.17
*/
EAPI void efl_model_value_struct_description_free(Eina_Value_Struct_Desc *desc);
#endif
|