Download

Support

lib/ewl_model.h

Go to the documentation of this file.
00001 /* vim: set sw=8 ts=8 sts=8 expandtab: */
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
00189                                         (const Ewl_Model *m);
00190 
00191 void                             ewl_model_data_free_set(Ewl_Model *m,
00192                                         Ewl_Model_Data_Free assign);
00193 Ewl_Model_Data_Free              ewl_model_data_free_get(const Ewl_Model *m);
00194 
00195 void                             ewl_model_column_sortable_set(Ewl_Model *m,
00196                                         Ewl_Model_Column_Sortable sortable);
00197 Ewl_Model_Column_Sortable        ewl_model_column_sortable_get
00198                                         (const Ewl_Model *m);
00199 
00200 void                             ewl_model_data_sort_set(Ewl_Model *m,
00201                                         Ewl_Model_Data_Sort sort);
00202 Ewl_Model_Data_Sort              ewl_model_data_sort_get(const Ewl_Model *m);
00203 
00204 void                             ewl_model_data_highlight_set(Ewl_Model *m,
00205                                         Ewl_Model_Data_Highlight highlight);
00206 Ewl_Model_Data_Highlight         ewl_model_data_highlight_get
00207                                         (const Ewl_Model *m);
00208 
00209 void                             ewl_model_data_count_set(Ewl_Model *m,
00210                                         Ewl_Model_Data_Count count);
00211 Ewl_Model_Data_Count             ewl_model_data_count_get(const Ewl_Model *m);
00212 
00213 void                             ewl_model_data_unref_set(Ewl_Model *m,
00214                                         Ewl_Model_Data_Unref unref);
00215 Ewl_Model_Data_Unref             ewl_model_data_unref_get(const Ewl_Model *m);
00216 
00217 void                             ewl_model_data_expandable_set(Ewl_Model *m,
00218                                         Ewl_Model_Data_Expandable exp);
00219 Ewl_Model_Data_Expandable        ewl_model_data_expandable_get
00220                                         (const Ewl_Model *m);
00221 
00222 void                             ewl_model_expansion_data_fetch_set(Ewl_Model *m,
00223                                         Ewl_Model_Expansion_Data_Fetch get);
00224 Ewl_Model_Expansion_Data_Fetch   ewl_model_expansion_data_fetch_get
00225                                         (const Ewl_Model *m);
00226 
00227 void                             ewl_model_expansion_model_fetch_set(Ewl_Model *m,
00228                                         Ewl_Model_Expansion_Model_Fetch f);
00229 Ewl_Model_Expansion_Model_Fetch  ewl_model_expansion_model_fetch_get
00230                                         (const Ewl_Model *m);
00231 
00232 /*
00233  * Internal stuff.
00234  */
00235 void *ewl_model_cb_ecore_list_fetch(void *data, unsigned int row,
00236                                                 unsigned int col);
00237 unsigned int ewl_model_cb_ecore_list_count(void *data);
00238 
00243 #endif
00244 

Copyright © Enlightenment.org

Enlightened Widget Library Documentation Generated: Fri Jan 23 21:56:24 2009