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

Displays a QR code generated from textual data. More...

#include <gui/widget.h>

Go to the source code of this file.

Typedefs

typedef struct QRCode QRCode
 QRCode opaque structure.
 

Functions

QRCode * qr_code_alloc (Widget *parent)
 Create a new QRCode instance.
 
void qr_code_free (QRCode *instance)
 Delete an QRCode instance.
 
Widget * qr_code_get_base (QRCode *instance)
 Get a pointer to the base class instance.
 
void qr_code_set_size (QRCode *instance, int32_t size)
 Sets the size of the QR code.
 
void qr_code_set_data (QRCode *instance, const char *data)
 Generate and show a QR code.
 

Detailed Description

Displays a QR code generated from textual data.

Function Documentation

◆ qr_code_alloc()

QRCode * qr_code_alloc ( Widget * parent)

Create a new QRCode instance.

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

◆ qr_code_free()

void qr_code_free ( QRCode * instance)

Delete an QRCode instance.

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

◆ qr_code_get_base()

Widget * qr_code_get_base ( QRCode * 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 QRCode instance to be queried
Returns
pointer to the base class instance

◆ qr_code_set_data()

void qr_code_set_data ( QRCode * instance,
const char * data )

Generate and show a QR code.

Parameters
[in,out]instancepointer to the QRCode instance to be modified
[in]datazero-terminated string containing the text to be shown
Warning
qr_code_set_size must have been called beforehand.

◆ qr_code_set_size()

void qr_code_set_size ( QRCode * instance,
int32_t size )

Sets the size of the QR code.

Parameters
[in,out]instancepointer to the QRCode instance to be modified
[in]sizeSize of one side of the code (width and height)
Warning
must be called before qr_code_set_data.