45 #ifndef LEGATO_WIDGET_BAR_GRAPH_H 46 #define LEGATO_WIDGET_BAR_GRAPH_H 50 #if LE_BARGRAPH_WIDGET_ENABLED == 1 77 typedef enum leBarGraphValueAxis
81 } leBarGraphValueAxis;
95 typedef enum leBarGraphTickPosition
99 BAR_GRAPH_TICK_CENTER,
100 } leBarGraphTickPosition;
120 typedef struct leBarGraphDataSeries
124 leBarGraphValueAxis axis;
125 } leBarGraphDataSeries;
127 typedef struct leBarGraphCategory
131 } leBarGraphCategory;
133 typedef struct leBarGraphWidget leBarGraphWidget;
139 #define LE_BARGRAPHWIDGET_VTABLE(THIS_TYPE) \ 140 LE_WIDGET_VTABLE(THIS_TYPE) \ 142 uint32_t (*getTickLength)(const THIS_TYPE* _this); \ 143 leResult (*setTickLength)(THIS_TYPE* _this, uint32_t len); \ 144 uint32_t (*getMinValue)(const THIS_TYPE* _this, leBarGraphValueAxis axis); \ 145 leResult (*setMinValue)(THIS_TYPE* _this, leBarGraphValueAxis axis, int32_t min); \ 146 uint32_t (*getMaxValue)(const THIS_TYPE* _this, leBarGraphValueAxis axis); \ 147 leResult (*setMaxValue)(THIS_TYPE* _this, leBarGraphValueAxis axis, int32_t max); \ 148 leBool (*getValueAxisLabelsVisible)(const THIS_TYPE* _this, leBarGraphValueAxis axis); \ 149 leResult (*setValueAxisLabelsVisible)(THIS_TYPE* _this, leBarGraphValueAxis axis, leBool vis); \ 150 leBool (*getValueAxisTicksVisible)(const THIS_TYPE* _this, leBarGraphValueAxis axis); \ 151 leResult (*setValueAxisTicksVisible)(THIS_TYPE* _this, leBarGraphValueAxis axis, leBool vis); \ 152 uint32_t (*getValueAxisTicksInterval)(const THIS_TYPE* _this, leBarGraphValueAxis axis); \ 153 leResult (*setValueAxisTicksInterval)(THIS_TYPE* _this, leBarGraphValueAxis axis, uint32_t itv); \ 154 leBarGraphTickPosition (*getValueAxisTicksPosition)(const THIS_TYPE* _this, leBarGraphValueAxis axis); \ 155 leResult (*setValueAxisTicksPosition)(THIS_TYPE* _this, leBarGraphValueAxis axis, leBarGraphTickPosition pos); \ 156 leBool (*getValueAxisSubticksVisible)(const THIS_TYPE* _this, leBarGraphValueAxis axis); \ 157 leResult (*setValueAxisSubticksVisible)(THIS_TYPE* _this, leBarGraphValueAxis axis, leBool vis); \ 158 uint32_t (*getValueAxisSubticksInterval)(const THIS_TYPE* _this, leBarGraphValueAxis axis); \ 159 leResult (*setValueAxisSubticksInterval)(THIS_TYPE* _this, leBarGraphValueAxis axis, uint32_t itv); \ 160 leBarGraphTickPosition (*getValueAxisSubticksPosition)(const THIS_TYPE* _this, leBarGraphValueAxis axis); \ 161 leResult (*setValueAxisSubticksPosition)(THIS_TYPE* _this, leBarGraphValueAxis axis, leBarGraphTickPosition pos); \ 162 leBool (*getCategoryAxisTicksVisible)(const THIS_TYPE* _this); \ 163 leResult (*setCategoryAxisTicksVisible)(THIS_TYPE* _this, leBool vis); \ 164 leBarGraphTickPosition (*getCategoryAxisTicksPosition)(const THIS_TYPE* _this); \ 165 leResult (*setCategoryAxisTicksPosition)(THIS_TYPE* _this, leBarGraphTickPosition pos); \ 166 leBool (*getCategoryAxisLabelsVisible)(const THIS_TYPE* _this); \ 167 leResult (*setCategoryAxisLabelsVisible)(THIS_TYPE* _this, leBool vis); \ 168 leResult (*addSeries)(THIS_TYPE* _this, uint32_t* seriesID); \ 169 leScheme* (*getSeriesScheme)(const THIS_TYPE* _this, uint32_t seriesID); \ 170 leResult (*setSeriesScheme)(THIS_TYPE* _this, uint32_t seriesID, const leScheme* schm); \ 171 leResult (*addDataToSeries)(THIS_TYPE* _this, uint32_t seriesID, int32_t val, uint32_t* idx); \ 172 leResult (*setDataInSeries)(THIS_TYPE* _this, uint32_t seriesID, uint32_t index, int32_t value); \ 173 leResult (*clearData)(THIS_TYPE* _this); \ 174 leFont* (*getTicksLabelFont)(THIS_TYPE* _this); \ 175 leResult (*setTicksLabelFont)(THIS_TYPE* _this, const leFont* font); \ 176 leBool (*getGridLinesVisible)(const THIS_TYPE* _this, leBarGraphValueAxis axis); \ 177 leResult (*setGridLinesVisible)(THIS_TYPE* _this, leBarGraphValueAxis axis, leBool vis); \ 178 leResult (*addCategory)(THIS_TYPE* _this, uint32_t* id); \ 179 leString* (*getCategoryString)(const THIS_TYPE* _this, uint32_t id); \ 180 leResult (*setCategoryString)(THIS_TYPE* _this, uint32_t id, const leString* str); \ 181 leBool (*getStacked)(const THIS_TYPE* _this); \ 182 leResult (*setStacked)(THIS_TYPE* _this, leBool stk); \ 183 leBool (*getFillGraphArea)(const THIS_TYPE* _this); \ 184 leResult (*setFillGraphArea)(THIS_TYPE* _this, leBool fill); \ 187 typedef struct leBarGraphWidgetVTable
189 LE_BARGRAPHWIDGET_VTABLE(leBarGraphWidget)
190 } leBarGraphWidgetVTable;
219 typedef struct leBarGraphWidget
223 const leBarGraphWidgetVTable* fn;
231 uint32_t tickInterval;
232 uint32_t subtickInterval;
233 leBool valueAxisLabelsVisible;
234 leBool valueAxisTicksVisible;
235 leBool valueAxisSubticksVisible;
236 leBool valueGridLinesVisible;
239 const leFont* ticksLabelFont;
240 leBarGraphTickPosition valueAxisTicksPosition;
241 leBarGraphTickPosition valueAxisSubticksPosition;
244 leBool categAxisLabelsVisible;
245 leBool categAxisTicksVisible;
246 leBarGraphTickPosition categAxisTicksPosition;
267 leBarGraphWidget* leBarGraphWidget_New(
void);
279 void leBarGraphWidget_Constructor(leBarGraphWidget* wgt);
282 #define THIS_TYPE struct leWidget 295 uint32_t getTickLength(
const leBarGraphWidget* _this);
312 virtual leResult setTickLength(leBarGraphWidget* _this,
329 virtual uint32_t getMinValue(
const leBarGraphWidget* _this,
330 leBarGraphValueAxis axis);
348 virtual leResult setMinValue(leBarGraphWidget* _this,
349 leBarGraphValueAxis axis,
366 virtual uint32_t getMaxValue(
const leBarGraphWidget* _this,
367 leBarGraphValueAxis axis);
385 virtual leResult setMaxValue(leBarGraphWidget* _this,
386 leBarGraphValueAxis axis,
402 virtual leBool getValueAxisLabelsVisible(
const leBarGraphWidget* _this,
403 leBarGraphValueAxis axis);
422 virtual leResult setValueAxisLabelsVisible(leBarGraphWidget* _this,
423 leBarGraphValueAxis axis,
440 virtual leBool getValueAxisTicksVisible(
const leBarGraphWidget* _this,
441 leBarGraphValueAxis axis);
460 virtual leResult setValueAxisTicksVisible(leBarGraphWidget* _this,
461 leBarGraphValueAxis axis,
478 virtual uint32_t getValueAxisTicksInterval(
const leBarGraphWidget* _this,
479 leBarGraphValueAxis axis);
498 virtual leResult setValueAxisTicksInterval(leBarGraphWidget* _this,
499 leBarGraphValueAxis axis,
517 virtual leBarGraphTickPosition getValueAxisTicksPosition(
const leBarGraphWidget* _this,
518 leBarGraphValueAxis axis);
536 virtual leResult setValueAxisTicksPosition(leBarGraphWidget* _this,
537 leBarGraphValueAxis axis,
538 leBarGraphTickPosition pos);
555 virtual leBool getValueAxisSubticksVisible(
const leBarGraphWidget* _this,
556 leBarGraphValueAxis axis);
575 virtual leResult setValueAxisSubticksVisible(leBarGraphWidget* _this,
576 leBarGraphValueAxis axis,
594 virtual uint32_t getValueAxisSubticksInterval(
const leBarGraphWidget* _this,
595 leBarGraphValueAxis axis);
614 virtual leResult setValueAxisSubticksInterval(leBarGraphWidget* _this,
615 leBarGraphValueAxis axis,
632 virtual leBarGraphTickPosition getValueAxisSubticksPosition(
const leBarGraphWidget* _this,
633 leBarGraphValueAxis axis);
651 virtual leResult setValueAxisSubticksPosition(leBarGraphWidget* _this,
652 leBarGraphValueAxis axis,
653 leBarGraphTickPosition pos);
667 virtual leBool getCategoryAxisTicksVisible(
const leBarGraphWidget* _this);
682 virtual leResult setCategoryAxisTicksVisible(leBarGraphWidget* _this,
696 virtual leBarGraphTickPosition getCategoryAxisTicksPosition(
const leBarGraphWidget* _this);
711 virtual leResult setCategoryAxisTicksPosition(leBarGraphWidget* _this,
712 leBarGraphTickPosition pos)
729 virtual leResult setCategoryAxisLabelsVisible(leBarGraphWidget* _this,
745 virtual leResult addSeries(leBarGraphWidget* _this,
760 virtual leScheme* getSeriesScheme(
const leBarGraphWidget* _this,
779 leResult setSeriesScheme(leBarGraphWidget* _this,
801 leResult setDataInSeries(leBarGraphWidget* _this,
816 virtual leResult clearData(leBarGraphWidget* _this);
829 virtual leFont* getTicksLabelFont(leBarGraphWidget* _this);
845 virtual leResult setTicksLabelFont(
const leBarGraphWidget* _this,
861 virtual leBool getGridLinesVisible(
const leBarGraphWidget* _this,
862 leBarGraphValueAxis axis);
880 virtual leResult setGridLinesVisible(leBarGraphWidget* _this,
881 leBarGraphValueAxis axis,
897 virtual leResult addCategory(leBarGraphWidget* _this,
913 virtual leString* getCategoryString(
const leBarGraphWidget* _this,
931 virtual leResult setCategoryString(leBarGraphWidget* _this,
945 virtual leBool getStacked(
const leBarGraphWidget* _this);
960 virtual leResult setStacked(leBarGraphWidget* _this,
973 virtual leBool getFillGraphArea(
const leBarGraphWidget* _this);
987 virtual leResult setFillGraphArea(THIS_TYPE* _this,
996 #endif // LE_BARGRAPH_WIDGET_ENABLED Common macros and definitions used by Legato.
This struct represents a string.
Definition: legato_string.h:107
This struct represents a font object.
Definition: legato_font.h:156
leResult
This enum represents function call results.
Definition: legato_common.h:123
Dynamic string functions and definitions.
This struct represents a array.
Definition: legato_array.h:64
leBool
This enum represents booleans.
Definition: legato_common.h:146
Definition: legato_scheme.h:154