NvDialog 0.10.1
A cross-platform modal dialogs library for C/C++ that uses the native OS theme.
Loading...
Searching...
No Matches
nvdialog_types.h
Go to the documentation of this file.
1/*
2 * The MIT License (MIT)
3 *
4 * Copyright (c) 2025 Aggelos Tselios
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 * IN THE SOFTWARE.
23 */
24
25#pragma once
26
27#ifndef __nvdialog_types_h__
28#define __nvdialog_types_h__ 1
29
30/**
31 * @brief Defines what use it the dialog about.
32 * Each member of this enum defines what the dialog should
33 * represent:
34 * - NVD_DIALOG_SIMPLE -> A simple message box, to say something.
35 * - NVD_DIALOG_WARNING -> A warning message to be used for warnings.
36 * - NVD_DIALOG_ERROR -> An error message box.
37 * @since v0.1.0
38 * @ingroup Dialog
39 * @sa nvd_dialog_box_new
40 */
41typedef enum {
42 NVD_DIALOG_SIMPLE = 0xff, /**< A simple dialog box, no decorations. */
43 NVD_DIALOG_WARNING, /**< A warning message to be used for warnings, with
44 warning color styling. */
45 NVD_DIALOG_ERROR, /**< An error message box, with error styling. */
47
48/**
49 * @brief Enumerator containing the possible arguments for
50 * nvd_dialog_question_new().
51 * @details Each field describes the possible answers that will be included in a new @ref NvdQuestionDialog.
52 * More specifically:
53 * - NVD_YES_NO will have the dialog include only two buttons, yes and no (May differ per locale and system, but always affirmative and negative).
54 * - NVD_YES_NO_CANCEL is the same but also includes a cancel button. Sometimes this is ignored depending on the system.
55 * - NVD_YES_CANCEL is useful when you want to change the affirmative button's text but want to use cancel for the negative.
56 * @since v0.1.0
57 * @sa nvd_dialog_question_new
58 */
64
65/**
66 * @brief An enumerator containing a possible returned value by @ref nvd_get_reply, when used with an @ref NvdQuestionBox
67 * @sa nvd_get_reply
68 * @since v0.1.1
69 */
70typedef enum {
71 NVD_REPLY_OK = 0x04, /**< User accepted the question. */
72 NVD_REPLY_CANCEL, /**< User cancelled the question. Also used as a
73 fallback. */
74 NVD_REPLY_NO /**< User rejected the question. */
75} NvdReply;
76
77/**
78 * @brief A struct that identifies the version of NvDialog.
79 * @details This struct contains a series of fields that hold information about
80 * NvDialog's version (usually at runtime). It's usually filled by @ref nvd_get_version
81 * @sa nvd_get_version
82 * @ingroup Version
83 */
84typedef struct {
85 short major; /**< Major version of NvDialog. */
86 short minor; /**< Minor version of NvDialog. */
87 short patch; /**< Patch version of NvDialog. */
88 char *string; /**< String representation of the version for eg. printf()
89 calls. */
91
92#endif /* __nvdialog_types_h__ */
NvdReply
An enumerator containing a possible returned value by nvd_get_reply, when used with an NvdQuestionBox...
Definition nvdialog_types.h:70
@ NVD_REPLY_OK
Definition nvdialog_types.h:71
@ NVD_REPLY_CANCEL
Definition nvdialog_types.h:72
@ NVD_REPLY_NO
Definition nvdialog_types.h:74
NvdDialogType
Defines what use it the dialog about. Each member of this enum defines what the dialog should represe...
Definition nvdialog_types.h:41
@ NVD_DIALOG_WARNING
Definition nvdialog_types.h:43
@ NVD_DIALOG_ERROR
Definition nvdialog_types.h:45
@ NVD_DIALOG_SIMPLE
Definition nvdialog_types.h:42
NvdQuestionButton
Enumerator containing the possible arguments for nvd_dialog_question_new().
Definition nvdialog_types.h:59
@ NVD_YES_NO_CANCEL
Definition nvdialog_types.h:61
@ NVD_YES_NO
Definition nvdialog_types.h:60
@ NVD_YES_CANCEL
Definition nvdialog_types.h:62
A struct that identifies the version of NvDialog.
Definition nvdialog_types.h:84
short patch
Definition nvdialog_types.h:87
short major
Definition nvdialog_types.h:85
short minor
Definition nvdialog_types.h:86
char * string
Definition nvdialog_types.h:88