/**1* @file lv_bar.h2*3*/45#ifndef LV_BAR_H6#define LV_BAR_H78#ifdef __cplusplus9extern "C" {10#endif1112/*********************13* INCLUDES14*********************/15#ifdef LV_CONF_INCLUDE_SIMPLE16#include "lv_conf.h"17#else18#include "../../lv_conf.h"19#endif2021#if USE_LV_BAR != 02223#include "../lv_core/lv_obj.h"24#include "lv_cont.h"25#include "lv_btn.h"26#include "lv_label.h"2728/*********************29* DEFINES30*********************/3132/**********************33* TYPEDEFS34**********************/3536/*Data of bar*/37typedef struct38{39/*No inherited ext*/ /*Ext. of ancestor*/40/*New data for this type */41int16_t cur_value; /*Current value of the bar*/42int16_t min_value; /*Minimum value of the bar*/43int16_t max_value; /*Maximum value of the bar*/44uint8_t sym :1; /*Symmetric: means the center is around zero value*/45lv_style_t *style_indic; /*Style of the indicator*/46} lv_bar_ext_t;4748enum {49LV_BAR_STYLE_BG,50LV_BAR_STYLE_INDIC,51};52typedef uint8_t lv_bar_style_t;5354/**********************55* GLOBAL PROTOTYPES56**********************/5758/**59* Create a bar objects60* @param par pointer to an object, it will be the parent of the new bar61* @param copy pointer to a bar object, if not NULL then the new object will be copied from it62* @return pointer to the created bar63*/64lv_obj_t * lv_bar_create(lv_obj_t * par, const lv_obj_t * copy);6566/*=====================67* Setter functions68*====================*/6970/**71* Set a new value on the bar72* @param bar pointer to a bar object73* @param value new value74*/75void lv_bar_set_value(lv_obj_t * bar, int16_t value);7677/**78* Set a new value with animation on the bar79* @param bar pointer to a bar object80* @param value new value81* @param anim_time animation time in milliseconds82*/83void lv_bar_set_value_anim(lv_obj_t * bar, int16_t value, uint16_t anim_time);848586/**87* Set minimum and the maximum values of a bar88* @param bar pointer to the bar object89* @param min minimum value90* @param max maximum value91*/92void lv_bar_set_range(lv_obj_t * bar, int16_t min, int16_t max);9394/**95* Make the bar symmetric to zero. The indicator will grow from zero instead of the minimum position.96* @param bar pointer to a bar object97* @param en true: enable disable symmetric behavior; false: disable98*/99void lv_bar_set_sym(lv_obj_t * bar, bool en);100101/**102* Set a style of a bar103* @param bar pointer to a bar object104* @param type which style should be set105* @param style pointer to a style106*/107void lv_bar_set_style(lv_obj_t *bar, lv_bar_style_t type, lv_style_t *style);108109/*=====================110* Getter functions111*====================*/112113/**114* Get the value of a bar115* @param bar pointer to a bar object116* @return the value of the bar117*/118int16_t lv_bar_get_value(const lv_obj_t * bar);119120/**121* Get the minimum value of a bar122* @param bar pointer to a bar object123* @return the minimum value of the bar124*/125int16_t lv_bar_get_min_value(const lv_obj_t * bar);126127/**128* Get the maximum value of a bar129* @param bar pointer to a bar object130* @return the maximum value of the bar131*/132int16_t lv_bar_get_max_value(const lv_obj_t * bar);133134/**135* Get whether the bar is symmetric or not.136* @param bar pointer to a bar object137* @return true: symmetric is enabled; false: disable138*/139bool lv_bar_get_sym(lv_obj_t * bar);140141/**142* Get a style of a bar143* @param bar pointer to a bar object144* @param type which style should be get145* @return style pointer to a style146*/147lv_style_t * lv_bar_get_style(const lv_obj_t *bar, lv_bar_style_t type);148149/**********************150* MACROS151**********************/152153#endif /*USE_LV_BAR*/154155#ifdef __cplusplus156} /* extern "C" */157#endif158159#endif /*LV_BAR_H*/160161162