lib/ewl_model.h
Go to the documentation of this file.00001
00002 #ifndef EWL_MODEL_H
00003 #define EWL_MODEL_H
00004
00017 typedef struct Ewl_Model Ewl_Model;
00018
00023 #define EWL_MODEL_DATA_FETCH(f) ((Ewl_Model_Data_Fetch)f)
00024
00028 typedef void *(*Ewl_Model_Data_Fetch)(void *data, unsigned int row,
00029 unsigned int column);
00030
00035 #define EWL_MODEL_FREE(f) ((Ewl_Model_Data_Free)f)
00036
00040 typedef void (*Ewl_Model_Data_Free)(void *data);
00041
00047 #define EWL_MODEL_DATA_EXPANDABLE(f) ((Ewl_Model_Data_Expandable)f)
00048
00052 typedef int (*Ewl_Model_Data_Expandable)(void *data, unsigned int row);
00053
00058 #define EWL_MODEL_EXPANSION_DATA_FETCH(f) ((Ewl_Model_Expansion_Data_Fetch)f)
00059
00063 typedef void *(*Ewl_Model_Expansion_Data_Fetch)(void *data, unsigned int row);
00064
00069 #define EWL_MODEL_DATA_HEADER_FETCH(f) ((Ewl_Model_Data_Header_Fetch)f)
00070
00074 typedef void *(*Ewl_Model_Data_Header_Fetch)(void *data, unsigned int col);
00075
00080 #define EWL_MODEL_EXPANSION_MODEL_FETCH(f) ((Ewl_Model_Expansion_Model_Fetch)(f)
00081
00086 typedef Ewl_Model *(*Ewl_Model_Expansion_Model_Fetch)(void *data,
00087 unsigned int row);
00088
00094 #define EWL_MODEL_DATA_SORT(f) ((Ewl_Model_Data_Sort)f)
00095
00099 typedef void (*Ewl_Model_Data_Sort)(void *data, unsigned int column,
00100 Ewl_Sort_Direction sort);
00101
00106 #define EWL_MODEL_DATA_COUNT(f) ((Ewl_Model_Data_Count)f)
00107
00111 typedef unsigned int (*Ewl_Model_Data_Count)(void *data);
00112
00118 #define EWL_MODEL_DATA_UNREF(f) ((Ewl_Model_Data_Unref)f)
00119
00123 typedef unsigned int (*Ewl_Model_Data_Unref)(void *data);
00124
00129 #define EWL_MODEL_COLUMN_SORTABLE(f) ((Ewl_Model_Column_Sortable)f)
00130
00134 typedef int (*Ewl_Model_Column_Sortable)(void *data, unsigned int col);
00135
00140 #define EWL_MODEL_DATA_HIGHLIGHT(f) ((Ewl_Model_Data_Highlight)f)
00141
00145 typedef unsigned int (*Ewl_Model_Data_Highlight)(void *data, unsigned int row);
00146
00147
00152 #define EWL_MODEL(model) ((Ewl_Model *)model)
00153
00157 struct Ewl_Model
00158 {
00159 struct
00160 {
00161 Ewl_Model_Data_Expandable is;
00162 Ewl_Model_Expansion_Data_Fetch data;
00163 Ewl_Model_Expansion_Model_Fetch model;
00164 } expansion;
00165
00166 Ewl_Model_Column_Sortable sortable;
00168 Ewl_Model_Data_Header_Fetch header;
00169 Ewl_Model_Data_Fetch fetch;
00170 Ewl_Model_Data_Free data_free;
00171 Ewl_Model_Data_Count count;
00172 Ewl_Model_Data_Unref unref;
00173 Ewl_Model_Data_Sort sort;
00174 Ewl_Model_Data_Highlight highlight;
00175 };
00176
00177 Ewl_Model *ewl_model_new(void);
00178 int ewl_model_init(Ewl_Model *model);
00179
00180 Ewl_Model *ewl_model_ecore_list_instance(void);
00181
00182 void ewl_model_data_fetch_set(Ewl_Model *m,
00183 Ewl_Model_Data_Fetch get);
00184 Ewl_Model_Data_Fetch ewl_model_data_fetch_get(const Ewl_Model *m);
00185
00186 void ewl_model_data_header_fetch_set(Ewl_Model *m,
00187 Ewl_Model_Data_Header_Fetch get);
00188 Ewl_Model_Data_Header_Fetch ewl_model_data_header_fetch_get(const Ewl_Model *m);
00189
00190 void ewl_model_data_free_set(Ewl_Model *m,
00191 Ewl_Model_Data_Free assign);
00192 Ewl_Model_Data_Free ewl_model_data_free_get(const Ewl_Model *m);
00193
00194 void ewl_model_column_sortable_set(Ewl_Model *m,
00195 Ewl_Model_Column_Sortable sortable);
00196 Ewl_Model_Column_Sortable ewl_model_column_sortable_get(const Ewl_Model *m);
00197
00198 void ewl_model_data_sort_set(Ewl_Model *m,
00199 Ewl_Model_Data_Sort sort);
00200 Ewl_Model_Data_Sort ewl_model_data_sort_get(const Ewl_Model *m);
00201
00202 void ewl_model_data_highlight_set(Ewl_Model *m,
00203 Ewl_Model_Data_Highlight highlight);
00204 Ewl_Model_Data_Highlight ewl_model_data_highlight_get(const Ewl_Model *m);
00205
00206 void ewl_model_data_count_set(Ewl_Model *m,
00207 Ewl_Model_Data_Count count);
00208 Ewl_Model_Data_Count ewl_model_data_count_get(const Ewl_Model *m);
00209
00210 void ewl_model_data_unref_set(Ewl_Model *m,
00211 Ewl_Model_Data_Unref unref);
00212 Ewl_Model_Data_Unref ewl_model_data_unref_get(const Ewl_Model *m);
00213
00214 void ewl_model_data_expandable_set(Ewl_Model *m,
00215 Ewl_Model_Data_Expandable exp);
00216 Ewl_Model_Data_Expandable ewl_model_data_expandable_get(const Ewl_Model *m);
00217
00218 void ewl_model_expansion_data_fetch_set(Ewl_Model *m,
00219 Ewl_Model_Expansion_Data_Fetch get);
00220 Ewl_Model_Expansion_Data_Fetch ewl_model_expansion_data_fetch_get(const Ewl_Model *m);
00221
00222 void ewl_model_expansion_model_fetch_set(Ewl_Model *m,
00223 Ewl_Model_Expansion_Model_Fetch f);
00224 Ewl_Model_Expansion_Model_Fetch ewl_model_expansion_model_fetch_get(const Ewl_Model *m);
00225
00226
00227
00228
00229 void *ewl_model_cb_ecore_list_fetch(void *data, unsigned int row,
00230 unsigned int col);
00231 unsigned int ewl_model_cb_ecore_list_count(void *data);
00232
00237 #endif
00238