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) 2022, 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#ifdef __cplusplus
31extern "C" {
32#endif /* __cplusplus */
33
34/**
35 * @brief Defines what use it the dialog about.
36 * Each member of this enum defines what the dialog should
37 * represent:
38 * - NVD_DIALOG_SIMPLE -> A simple message box, to say something.
39 * - NVD_DIALOG_WARNING -> A warning message to be used for warnings.
40 * - NVD_DIALOG_ERROR -> An error message box.
41 * @since v0.1.0
42 * @ingroup Dialog
43 * @sa nvd_dialog_box_new
44 */
45typedef enum {
46 NVD_DIALOG_SIMPLE = 0xff, /**< A simple dialog box, no decorations. */
47 NVD_DIALOG_WARNING, /**< A warning message to be used for warnings, with
48 warning color styling. */
49 NVD_DIALOG_ERROR, /**< An error message box, with error styling. */
51
52/**
53 * @brief Enumerator containing the possible arguments for
54 * nvd_dialog_question_new().
55 * @details Each field describes the possible answers that will be included in a new @ref NvdQuestionDialog.
56 * More specifically:
57 * - 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).
58 * - NVD_YES_NO_CANCEL is the same but also includes a cancel button. Sometimes this is ignored depending on the system.
59 * - NVD_YES_CANCEL is useful when you want to change the affirmative button's text but want to use cancel for the negative.
60 * @since v0.1.0
61 * @sa nvd_dialog_question_new
62 */
63typedef enum {
64 NVD_YES_NO = 0x04,
68
69/**
70 * @brief An enumerator containing a possible returned value by @ref nvd_get_reply, when used with an @ref NvdQuestionBox
71 * @sa nvd_get_reply
72 * @since v0.1.1
73 */
74typedef enum {
75 NVD_REPLY_OK = 0x04, /**< User accepted the question. */
76 NVD_REPLY_CANCEL, /**< User cancelled the question. Also used as a
77 fallback. */
78 NVD_REPLY_NO /**< User rejected the question. */
80
81/**
82 * @brief A struct that identifies the version of NvDialog.
83 * @details This struct contains a series of fields that hold information about
84 * NvDialog's version (usually at runtime). It's usually filled by @ref nvd_get_version
85 * @sa nvd_get_version
86 * @ingroup Version
87 */
88typedef struct {
89 short major; /**< Major version of NvDialog. */
90 short minor; /**< Minor version of NvDialog. */
91 short patch; /**< Patch version of NvDialog. */
92 char *string; /**< String representation of the version for eg. printf()
93 calls. */
95
96#ifdef __cplusplus
97}
98#endif /* __cplusplus */
99
100#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:74
@ NVD_REPLY_OK
Definition: nvdialog_types.h:75
@ NVD_REPLY_CANCEL
Definition: nvdialog_types.h:76
@ NVD_REPLY_NO
Definition: nvdialog_types.h:78
NvdDialogType
Defines what use it the dialog about. Each member of this enum defines what the dialog should represe...
Definition: nvdialog_types.h:45
@ NVD_DIALOG_WARNING
Definition: nvdialog_types.h:47
@ NVD_DIALOG_ERROR
Definition: nvdialog_types.h:49
@ NVD_DIALOG_SIMPLE
Definition: nvdialog_types.h:46
NvdQuestionButton
Enumerator containing the possible arguments for nvd_dialog_question_new().
Definition: nvdialog_types.h:63
@ NVD_YES_NO_CANCEL
Definition: nvdialog_types.h:65
@ NVD_YES_NO
Definition: nvdialog_types.h:64
@ NVD_YES_CANCEL
Definition: nvdialog_types.h:66
A struct that identifies the version of NvDialog.
Definition: nvdialog_types.h:88
short patch
Definition: nvdialog_types.h:91
short major
Definition: nvdialog_types.h:89
short minor
Definition: nvdialog_types.h:90
char * string
Definition: nvdialog_types.h:92