BSB Developer Docs
Loading...
Searching...
No Matches
timer_label.h File Reference

A widget that shows the remaining time. More...

#include <gui/widget.h>

Go to the source code of this file.

Data Structures

struct  TimerLabelPreset
 TimerLabel preset type. More...
 

Typedefs

typedef struct TimerLabel TimerLabel
 TimerLabel opaque structure.
 

Functions

TimerLabel * timer_label_alloc (Widget *parent)
 Create a new TimerLabel instance.
 
void timer_label_free (TimerLabel *instance)
 Delete a TimerLabel instance.
 
Widget * timer_label_get_base (TimerLabel *instance)
 Get a pointer to the base class instance.
 
void timer_label_set_time (TimerLabel *instance, uint32_t time_s)
 Set the displayed time.
 
void timer_label_set_preset (TimerLabel *instance, const TimerLabelPreset *preset)
 Set the current preset (affects countdown blinking)
 
void timer_label_enable_background (TimerLabel *instance, bool enable)
 Enable or disable the dark gradient background.
 
void timer_label_show (TimerLabel *instance, bool enable_animation)
 Show the label text and background (if enabled) with animation.
 
void timer_label_hide (TimerLabel *instance, bool enable_animation)
 Hide the label text and background (if enabled) with animation.
 

Detailed Description

A widget that shows the remaining time.

Can be used only on the front display.

Function Documentation

◆ timer_label_alloc()

TimerLabel * timer_label_alloc ( Widget * parent)

Create a new TimerLabel instance.

Parameters
[in,out]parentpointer to the parent Widget instance
Returns
pointer to the newly created TimerLabel instance

◆ timer_label_enable_background()

void timer_label_enable_background ( TimerLabel * instance,
bool enable )

Enable or disable the dark gradient background.

Parameters
[in,out]instancepointer to the TimerLabel instance to be modified
[in]enableshow the background if true, hide it otherwise

◆ timer_label_free()

void timer_label_free ( TimerLabel * instance)

Delete a TimerLabel instance.

Parameters
[in,out]instancepointer to the TimerLabel instance to be deleted

◆ timer_label_get_base()

Widget * timer_label_get_base ( TimerLabel * instance)

Get a pointer to the base class instance.

The return value can be used in all Widget methods.

Parameters
[in,out]instancepointer to the TimerLabel instance to be queried
Returns
pointer to the base class instance

◆ timer_label_hide()

void timer_label_hide ( TimerLabel * instance,
bool enable_animation )

Hide the label text and background (if enabled) with animation.

Parameters
[in,out]instancepointer to the TimerLabel instance to be modified
[in]enable_animationuse transition animation if true, no animated transition otherwise

◆ timer_label_set_preset()

void timer_label_set_preset ( TimerLabel * instance,
const TimerLabelPreset * preset )

Set the current preset (affects countdown blinking)

Parameters
[in,out]instancepointer to the TimerLabel instance to be modified
[in]presetpointer to the TimerLabelPreset object

◆ timer_label_set_time()

void timer_label_set_time ( TimerLabel * instance,
uint32_t time_s )

Set the displayed time.

Parameters
[in,out]instancepointer to the TimerLabel instance to be modified
[in]time_stime to show, in seconds

◆ timer_label_show()

void timer_label_show ( TimerLabel * instance,
bool enable_animation )

Show the label text and background (if enabled) with animation.

Parameters
[in,out]instancepointer to the TimerLabel instance to be modified
[in]enable_animationuse transition animation if true, no animated transition otherwise