Add support for API 2

This commit is contained in:
Maschell
2024-04-26 13:49:11 +02:00
parent 71e6149b30
commit 75ce22a0f6
4 changed files with 94 additions and 15 deletions

View File

@@ -47,4 +47,5 @@ typedef enum NotificationModuleNotificationOption {
NOTIFICATION_MODULE_DEFAULT_OPTION_DURATION_BEFORE_FADE_OUT, /* Time in seconds before the Notification will fade out: Type: float. Example: 2.5f = 2.5 seconds*/
NOTIFICATION_MODULE_DEFAULT_OPTION_FINISH_FUNCTION, /* Function that will be called when the Notification starts to fade out. Type: NotificationModuleNotificationFinishedCallback*/
NOTIFICATION_MODULE_DEFAULT_OPTION_FINISH_FUNCTION_CONTEXT, /* Context that will be passed to the NOTIFICATION_MODULE_DEFAULT_TYPE_FINISH_FUNCTION callback. Type: void* */
NOTIFICATION_MODULE_DEFAULT_OPTION_KEEP_UNTIL_SHOWN, /* Keeps the notification in memory until it was actually shown */
} NotificationModuleNotificationOption;

View File

@@ -94,6 +94,7 @@ NotificationModuleStatus NotificationModule_SetDefaultValue(NotificationModuleNo
* @param backgroundColor Background color of the Notification
* @param callback Function that will be called then the Notification fades out.
* @param callbackContext Context that will be passed to the callback.
* @param keepUntilShown The Notification will be stored in a queue until can be shown - even accross application starts
* @return NOTIFICATION_MODULE_RESULT_SUCCESS: The default value has been set.<br>
* NOTIFICATION_MODULE_RESULT_INVALID_ARGUMENT: text was NULL.<br>
* NOTIFICATION_MODULE_RESULT_UNSUPPORTED_COMMAND: The loaded module version doesn't not support this function.<br>
@@ -106,7 +107,8 @@ NotificationModuleStatus NotificationModule_AddInfoNotificationEx(const char *te
NMColor textColor,
NMColor backgroundColor,
NotificationModuleNotificationFinishedCallback callback,
void *callbackContext);
void *callbackContext,
bool keepUntilShown);
/**
* Displays a Notification that fade outs after a given time. <br>
@@ -161,6 +163,7 @@ NotificationModuleStatus NotificationModule_AddInfoNotificationWithCallback(cons
* @param backgroundColor Background color of the Notification
* @param callback Function that will be called then the Notification fades out.
* @param callbackContext Context that will be passed to the callback.
* @param keepUntilShown The Notification will be stored in a queue until can be shown - even accross application starts
* @return NOTIFICATION_MODULE_RESULT_SUCCESS: The default value has been set.<br>
* NOTIFICATION_MODULE_RESULT_INVALID_ARGUMENT: text was NULL.<br>
* NOTIFICATION_MODULE_RESULT_UNSUPPORTED_COMMAND: The loaded module version doesn't not support this function.<br>
@@ -174,7 +177,8 @@ NotificationModuleStatus NotificationModule_AddErrorNotificationEx(const char *t
NMColor textColor,
NMColor backgroundColor,
NotificationModuleNotificationFinishedCallback callback,
void *callbackContext);
void *callbackContext,
bool keepUntilShown);
/**
* Displays a (error) Notification (default background color: red) that shakes and fade outs after a given time. <br>
@@ -227,6 +231,7 @@ NotificationModuleStatus NotificationModule_AddErrorNotificationWithCallback(con
* @param backgroundColor Background color of the notification
* @param callback Function that will be called then the Notification fades out.
* @param callbackContext Context that will be passed to the callback.
* @param keepUntilShown The Notification will be stored in a queue until can be shown - even accross application starts
* @return NOTIFICATION_MODULE_RESULT_SUCCESS: The default value has been set.<br>
* NOTIFICATION_MODULE_RESULT_INVALID_ARGUMENT: text or outHandle was NULL <br>
* NOTIFICATION_MODULE_RESULT_UNSUPPORTED_COMMAND: The loaded module version doesn't not support this function.<br>
@@ -239,7 +244,8 @@ NotificationModuleStatus NotificationModule_AddDynamicNotificationEx(const char
NMColor textColor,
NMColor backgroundColor,
NotificationModuleNotificationFinishedCallback callback,
void *callbackContext);
void *callbackContext,
bool keepUntilShown);
/**
* Displays a Notification that can be updated and stays on the screen until `NotificationModule_FinishDynamicNotification*` has been called. <br>