Termux:GUI C/C++ Bindings
Loading...
Searching...
No Matches
notification.h
Go to the documentation of this file.
1#pragma once
2
10#include "types.h"
11
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17
18
35
36
41typedef struct {
46 const char* channel;
47
52 bool ongoing;
53
58 uint64_t timestamp;
59
65
71
77
82 const void* icon;
83
88 const size_t icon_length;
89
95
100 const char** actions;
101
106 const size_t actions_length;
108
109
127
128
146
147
167tgui_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);
168
169
188
189
190
205
206
207
208
209#ifdef __cplusplus
210}
211#endif
tgui_err tgui_notification_create_channel(tgui_connection c, const char *id, const char *name, tgui_importance imp)
Creates a notification channel.
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.
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.
tgui_err tgui_notification_dismiss(tgui_connection c, tgui_notification n)
Dismisses a notification.
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.
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.
Contains information needed to create a notification.
Definition: notification.h:41
bool ongoing
When a notification is ongoing, it cannot be dismissed by the user.
Definition: notification.h:52
tgui_importance importance
The importance. Newer Android versions use the channel importance instead, which can be changed by th...
Definition: notification.h:94
const size_t actions_length
The length of the actions array.
Definition: notification.h:106
const char * channel
The id of the channel the notification should be posted in.
Definition: notification.h:46
const tgui_notification * update
Can contain a notification id. When used, updates the specified notification instead of creating a ne...
Definition: notification.h:76
const void * icon
An icon for the notification. Set to NULL for the standard app icon.
Definition: notification.h:82
const size_t icon_length
The length of the icon data.
Definition: notification.h:88
bool alert_once
If set, alerts the user only once when the notification is created instead also on updates.
Definition: notification.h:70
uint64_t timestamp
The notification timestamp in milliseconds since the Unix epoch. Leave 0 to use the current time.
Definition: notification.h:58
const char ** actions
An optional array of string labels for actions the user can click in the notification.
Definition: notification.h:100
bool show_timestamp
Whether to show the timestamp in the notification or not.
Definition: notification.h:64
This file contains the types used for all the functions.
struct tgui_connection_ * tgui_connection
Represents a connection to the Termux:GUI plugin.
Definition: types.h:27
int32_t tgui_notification
Represents a notification.
Definition: types.h:60
int32_t tgui_remote_layout
Represents a RemoteView layout.
Definition: types.h:54
tgui_importance
The importance of a notification.
Definition: types.h:390
tgui_err
Status codes for all functions in the library.
Definition: types.h:77