|
NvDialog 0.10.1
A cross-platform modal dialogs library for C/C++ that uses the native OS theme.
|
#include "nvdialog_platform.h"Go to the source code of this file.
Macros | |
| #define | __nvdialog_notification_h__ 1 |
Typedefs | |
| typedef struct _NvdNotification | NvdNotification |
| The base notification type used by NvDialog. | |
Enumerations | |
| enum | NvdNotifyType { NVD_NOTIFICATION_SIMPLE , NVD_NOTIFICATION_WARNING , NVD_NOTIFICATION_ERROR } |
| Possible types of NvDialog notifications. Each field will create a slightly different dialog matching the requested type. More... | |
Functions | |
| NVD_API NvdNotification * | nvd_notification_new (const char *title, const char *msg, NvdNotifyType type) |
| Creates a new notification object and returns it. | |
| NVD_API void | nvd_send_notification (NvdNotification *notification) |
| Sends the notification to the system. It's safe to assume that the same notification can be sent multiple times. Just make sure the notification is still valid (Not freed yet). | |
| NVD_API void | nvd_delete_notification (NvdNotification *notification) |
| Deletes a notification object from NvDialog. | |
| NVD_API void | nvd_add_notification_action (NvdNotification *notification, const char *action, int value_to_set, int *value_to_return) |
| Adds another button with a specified action to do when it is clicked. | |
| #define __nvdialog_notification_h__ 1 |
| typedef struct _NvdNotification NvdNotification |
The base notification type used by NvDialog.
NvDialog offers since v0.5.0 support for basic notifications that add an extra cross-platform solution. The notification API is cross-platform and should reduce the required setup to send a simple notification. On GNU/Linux and other Unix-like platforms, the DBus interface for notifications is used, making it desktop-agnostic and only requiring libdbus and related daemons to be available.
| enum NvdNotifyType |
Possible types of NvDialog notifications. Each field will create a slightly different dialog matching the requested type.
| NVD_API void nvd_add_notification_action | ( | NvdNotification * | notification, |
| const char * | action, | ||
| int | value_to_set, | ||
| int * | value_to_return ) |
Adds another button with a specified action to do when it is clicked.
| notification | The notification to add the said action to. |
| action | A string defining the action as well as the label of the button for the action. |
| value_to_set | The value to set when the action is triggered. |
| value_to_return | A pointer to an integer to save the value passed to value_to_set . |
| NVD_API void nvd_delete_notification | ( | NvdNotification * | notification | ) |
Deletes a notification object from NvDialog.
| notification | The notification object to delete. |
| NVD_API NvdNotification * nvd_notification_new | ( | const char * | title, |
| const char * | msg, | ||
| NvdNotifyType | type ) |
Creates a new notification object and returns it.
| title | The title of the notification, can be NULL if no title is desired. |
| msg | The message to show (Required, can't be NULL). |
| type | The type of the notification, see NvdNotifyType. Example: #include <nvdialog/nvdialog.h>
int main(int argc, char** argv) {
nvd_init(argv[0]);
"A notification for your
nvd_send_notification(notif);
nvd_delete_notification(notif);
return 0;
}
struct _NvdNotification NvdNotification The base notification type used by NvDialog. Definition nvdialog_notification.h:61 NVD_API void nvd_delete_notification(NvdNotification *notification) Deletes a notification object from NvDialog. NVD_API NvdNotification * nvd_notification_new(const char *title, const char *msg, NvdNotifyType type) Creates a new notification object and returns it. NVD_API void nvd_send_notification(NvdNotification *notification) Sends the notification to the system. It's safe to assume that the same notification can be sent mult... |
| NVD_API void nvd_send_notification | ( | NvdNotification * | notification | ) |
Sends the notification to the system. It's safe to assume that the same notification can be sent multiple times. Just make sure the notification is still valid (Not freed yet).
| notification | The notification object to use. |