Termux:GUI C/C++ Bindings
Loading...
Searching...
No Matches
notification.h File Reference

This file contains all functions related to notifications. More...

#include "types.h"

Go to the source code of this file.

Classes

struct  tgui_notification_create_info
 Contains information needed to create a notification. More...
 

Functions

tgui_err tgui_notification_create_channel (tgui_connection c, const char *id, const char *name, tgui_importance imp)
 Creates a notification channel. More...
 
tgui_err tgui_notification_create_normal (tgui_connection c, tgui_notification *n, const tgui_notification_create_info *info, const char *title, const char *content)
 Creates a normal notification. More...
 
tgui_err tgui_notification_create_big_text (tgui_connection c, tgui_notification *n, const tgui_notification_create_info *info, const char *title, const char *content)
 Creates a notification with a larger content field that can be opened up. More...
 
tgui_err tgui_notification_big_image (tgui_connection c, tgui_notification *n, const tgui_notification_create_info *info, const char *title, const char *content, const void *img, size_t img_length, bool thumbnail)
 Creates a notification with a big image. More...
 
tgui_err tgui_notification_create_custom (tgui_connection c, tgui_notification *n, const tgui_notification_create_info *info, tgui_remote_layout normal, tgui_remote_layout *expanded, tgui_remote_layout *hud)
 Creates a notification with a remote layout. More...
 
tgui_err tgui_notification_dismiss (tgui_connection c, tgui_notification n)
 Dismisses a notification. More...
 

Detailed Description

This file contains all functions related to notifications.

Function Documentation

◆ tgui_notification_create_channel()

tgui_err tgui_notification_create_channel ( tgui_connection  c,
const char *  id,
const char *  name,
tgui_importance  imp 
)

Creates a notification channel.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
idThe channel id.
nameThe name displayed to the user.
impThe importance of the channel.
Returns
The error code.

◆ tgui_notification_create_normal()

tgui_err tgui_notification_create_normal ( tgui_connection  c,
tgui_notification n,
const tgui_notification_create_info info,
const char *  title,
const char *  content 
)

Creates a normal notification.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
[out]nWill contain the notification id if successful.
[in]infoGeneral information for constructing a notification.
titleThe notification title.
contentThe notification content.
Returns
The error code.

◆ tgui_notification_create_big_text()

tgui_err tgui_notification_create_big_text ( tgui_connection  c,
tgui_notification n,
const tgui_notification_create_info info,
const char *  title,
const char *  content 
)

Creates a notification with a larger content field that can be opened up.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
[out]nWill contain the notification id if successful.
[in]infoGeneral information for constructing a notification.
titleThe notification title.
contentThe notification content.
Returns
The error code.

◆ tgui_notification_big_image()

tgui_err tgui_notification_big_image ( tgui_connection  c,
tgui_notification n,
const tgui_notification_create_info info,
const char *  title,
const char *  content,
const void *  img,
size_t  img_length,
bool  thumbnail 
)

Creates a notification with a big image.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
[out]nWill contain the notification id if successful.
[in]infoGeneral information for constructing a notification.
titleThe notification title.
contentThe notification content.
[in]imgThe image data.
img_lengthThe length of the image data.
thumbnailWhether to show a thumbnail when the notification is folded up.
Returns
The error code.

◆ tgui_notification_create_custom()

tgui_err tgui_notification_create_custom ( tgui_connection  c,
tgui_notification n,
const tgui_notification_create_info info,
tgui_remote_layout  normal,
tgui_remote_layout expanded,
tgui_remote_layout hud 
)

Creates a notification with a remote layout.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
[out]nWill contain the notification id if successful.
[in]infoGeneral information for constructing a notification.
normalThe layout for the standard notification.
[in]expandedThe layout for the expanded notification. Optional.
[in]hudThe layout for the HUD notification. Optional.
Returns
The error code.

◆ tgui_notification_dismiss()

tgui_err tgui_notification_dismiss ( tgui_connection  c,
tgui_notification  n 
)

Dismisses a notification.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
nThe notification to dismiss.
Returns
The error code.