diff options
author | Guilherme Lepsch <lepsch@expertisesolutions.com.br> | 2015-07-30 15:48:41 -0300 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-12-10 11:10:46 -0800 |
commit | 48b22214493958fc852f101009b0e8a88aa77e05 (patch) | |
tree | d0a194788694fa7513779e5c6f94861d9ce54541 /src/lib/efl/Efl_Model_Common.h | |
parent | 5d4038d74d877ca88f2abccb4a67ebc84f06ffc7 (diff) |
efl: common Efl.Model implementation functions helpers.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/efl/Efl_Model_Common.h')
-rw-r--r-- | src/lib/efl/Efl_Model_Common.h | 82 |
1 files changed, 73 insertions, 9 deletions
diff --git a/src/lib/efl/Efl_Model_Common.h b/src/lib/efl/Efl_Model_Common.h index ce1ed3b66b..1afa5e1026 100644 --- a/src/lib/efl/Efl_Model_Common.h +++ b/src/lib/efl/Efl_Model_Common.h | |||
@@ -1,9 +1,5 @@ | |||
1 | #ifndef _EFL_MODEL_COMMON_H | 1 | #ifndef EFL_MODEL_COMMON_H__ |
2 | #define _EFL_MODEL_COMMON_H | 2 | # define EFL_MODEL_COMMON_H__ |
3 | |||
4 | #ifdef __cplusplus | ||
5 | extern "C" { | ||
6 | #endif | ||
7 | 3 | ||
8 | /** | 4 | /** |
9 | * @struct _Efl_Model_Children_Event | 5 | * @struct _Efl_Model_Children_Event |
@@ -31,8 +27,76 @@ struct _Efl_Model_Children_Event | |||
31 | */ | 27 | */ |
32 | typedef struct _Efl_Model_Children_Event Efl_Model_Children_Event; | 28 | typedef struct _Efl_Model_Children_Event Efl_Model_Children_Event; |
33 | 29 | ||
30 | #include "interfaces/efl_model_base.eo.h" | ||
31 | |||
32 | /** | ||
33 | * @brief Sets the new load status signaling an event if changed | ||
34 | * | ||
35 | * @param model The model to call the event @c EFL_MODEL_EVENT_LOAD_STATUS | ||
36 | * @param load The load status to be changed | ||
37 | * @param status The new status | ||
38 | */ | ||
39 | EAPI void efl_model_load_set(Efl_Model_Base *model, Efl_Model_Load *load, Efl_Model_Load_Status status) EINA_ARG_NONNULL(1, 2); | ||
40 | |||
41 | /** | ||
42 | * @brief Slices a list | ||
43 | * | ||
44 | * If the @p start and @p count are 0, a new accessor of the entire list is returned | ||
45 | * | ||
46 | * @param list The list to get the slice | ||
47 | * @param start The nth element to start the slice | ||
48 | * @param count The number of elements | ||
49 | * @return The accessor to the sliced elements or @c NULL if error | ||
50 | */ | ||
51 | EAPI Eina_Accessor *efl_model_list_slice(Eina_List *list, unsigned start, unsigned count) EINA_ARG_NONNULL(1); | ||
52 | |||
53 | /** | ||
54 | * @brief Notifies an error with an @c EFL_MODEL_EVENT_LOAD_STATUS | ||
55 | * | ||
56 | * @param model The model to be notified | ||
57 | */ | ||
58 | EAPI void efl_model_error_notify(Efl_Model_Base *model) EINA_ARG_NONNULL(1); | ||
59 | |||
60 | /** | ||
61 | * @brief Notifies a property changed event with an @c EFL_MODEL_EVENT_PROPERTIES_CHANGED | ||
62 | * | ||
63 | * @param model The model to be notified | ||
64 | * @param property The changed property | ||
65 | */ | ||
66 | EAPI void efl_model_property_changed_notify(Efl_Model_Base *model, const char *property); | ||
67 | |||
68 | /** | ||
69 | * @brief Notifies a property invalidated event with an @c EFL_MODEL_EVENT_PROPERTIES_CHANGED | ||
70 | * | ||
71 | * @param model The model to be notified | ||
72 | * @param property The invalidated property | ||
73 | */ | ||
74 | EAPI void efl_model_property_invalidated_notify(Efl_Model_Base *model, const char *property); | ||
75 | |||
76 | /** | ||
77 | * @brief Callback to setup a member of @c Eina_Value_Struct | ||
78 | * | ||
79 | * @param data The user data | ||
80 | * @param index The member index | ||
81 | * @param member The member to fill its name and type. Must use @c Eina_Stringshare for name. | ||
82 | */ | ||
83 | typedef void (*Efl_Model_Value_Struct_Member_Setup_Cb)(void *data, int index, Eina_Value_Struct_Member *member); | ||
84 | |||
85 | /** | ||
86 | * @brief Creates a new struct description | ||
87 | * | ||
88 | * @param member_count The number of struct members | ||
89 | * @param setup_cb The callback to setup struct members | ||
90 | * @param data The user data | ||
91 | * @return Returns the struct description | ||
92 | */ | ||
93 | 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); | ||
94 | |||
95 | /** | ||
96 | * @brief Frees the memory allocated to the struct description. | ||
97 | * | ||
98 | * @param desc The struct description. If @c NULL, the function returns immediately. | ||
99 | */ | ||
100 | EAPI void efl_model_value_struct_description_free(Eina_Value_Struct_Desc *desc); | ||
34 | 101 | ||
35 | #ifdef __cplusplus | ||
36 | } | ||
37 | #endif | ||
38 | #endif | 102 | #endif |