summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/YesNo.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/YesNo.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/YesNo.h188
1 files changed, 0 insertions, 188 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/YesNo.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/YesNo.h
deleted file mode 100644
index 67c2fc4..0000000
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/YesNo.h
+++ /dev/null
@@ -1,188 +0,0 @@
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include "../definitions.h"
12#include "../../AddonBase.h"
13
14namespace kodi
15{
16namespace gui
17{
18namespace dialogs
19{
20
21 //============================================================================
22 ///
23 /// \defgroup cpp_kodi_gui_dialogs_YesNo Dialog Yes/No
24 /// \ingroup cpp_kodi_gui
25 /// @{
26 /// @brief \cpp_namespace{ kodi::gui::dialogs::YesNo }
27 /// **Yes / No dialog**
28 ///
29 /// The Yes / No dialog can be used to inform the user about questions and get
30 /// the answer.
31 ///
32 /// In order to achieve a line break is a <b>\\n</b> directly in the text or
33 /// in the <em>"./resources/language/resource.language.??_??/strings.po"</em>
34 /// to call with <b>std::string kodi::general::GetLocalizedString(...);</b>.
35 ///
36 /// It has the header \ref YesNo.h "#include <kodi/gui/dialogs/YesNo.h>"
37 /// be included to enjoy it.
38 ///
39 ///
40 namespace YesNo
41 {
42 //==========================================================================
43 ///
44 /// \ingroup cpp_kodi_gui_dialogs_YesNo
45 /// @brief Use dialog to get numeric new password with one text string shown
46 /// everywhere and cancel return field
47 ///
48 /// @param[in] heading Dialog heading
49 /// @param[in] text Multi-line text
50 /// @param[out] canceled Return value about cancel button
51 /// @param[in] noLabel [opt] label to put on the no button
52 /// @param[in] yesLabel [opt] label to put on the yes button
53 /// @return Returns True if 'Yes' was pressed, else False
54 ///
55 /// @note It is preferred to only use this as it is actually a multi-line text.
56 ///
57 ///
58 ///-------------------------------------------------------------------------
59 ///
60 /// **Example:**
61 /// ~~~~~~~~~~~~~{.cpp}
62 /// #include <kodi/gui/dialogs/YesNo.h>
63 ///
64 /// bool canceled;
65 /// bool ret = kodi::gui::dialogs::YesNo::ShowAndGetInput(
66 /// "Yes / No test call", /* The Header */
67 /// "You has opened Yes / No dialog for test\n\nIs this OK for you?",
68 /// canceled, /* return value about cancel button */
69 /// "Not really", /* No label, is optional and if empty "No" */
70 /// "Ohhh yes"); /* Yes label, also optional and if empty "Yes" */
71 /// fprintf(stderr, "You has called Yes/No, returned '%s' and was %s\n",
72 /// ret ? "yes" : "no",
73 /// canceled ? "canceled" : "not canceled");
74 /// ~~~~~~~~~~~~~
75 ///
76 inline bool ATTRIBUTE_HIDDEN ShowAndGetInput(const std::string& heading,
77 const std::string& text,
78 bool& canceled,
79 const std::string& noLabel = "",
80 const std::string& yesLabel = "")
81 {
82 using namespace ::kodi::addon;
83 return CAddonBase::m_interface->toKodi->kodi_gui->dialogYesNo->show_and_get_input_single_text(
84 CAddonBase::m_interface->toKodi->kodiBase, heading.c_str(), text.c_str(), &canceled,
85 noLabel.c_str(), yesLabel.c_str());
86 }
87 //--------------------------------------------------------------------------
88
89 //==========================================================================
90 ///
91 /// \ingroup cpp_kodi_gui_dialogs_YesNo
92 /// @brief Use dialog to get numeric new password with separated line strings
93 ///
94 /// @param[in] heading Dialog heading
95 /// @param[in] line0 Line #0 text
96 /// @param[in] line1 Line #1 text
97 /// @param[in] line2 Line #2 text
98 /// @param[in] noLabel [opt] label to put on the no button.
99 /// @param[in] yesLabel [opt] label to put on the yes button.
100 /// @return Returns True if 'Yes' was pressed, else False.
101 ///
102 ///
103 ///-------------------------------------------------------------------------
104 ///
105 /// **Example:**
106 /// ~~~~~~~~~~~~~{.cpp}
107 /// #include <kodi/gui/dialogs/YesNo.h>
108 ///
109 /// bool ret = kodi::gui::dialogs::YesNo::ShowAndGetInput(
110 /// "Yes / No test call", // The Header
111 /// "You has opened Yes / No dialog for test",
112 /// "",
113 /// "Is this OK for you?",
114 /// "Not really", // No label, is optional and if empty "No"
115 /// "Ohhh yes"); // Yes label, also optional and if empty "Yes"
116 /// fprintf(stderr, "You has called Yes/No, returned '%s'\n",
117 /// ret ? "yes" : "no");
118 /// ~~~~~~~~~~~~~
119 ///
120 inline bool ATTRIBUTE_HIDDEN ShowAndGetInput(const std::string& heading,
121 const std::string& line0,
122 const std::string& line1,
123 const std::string& line2,
124 const std::string& noLabel = "",
125 const std::string& yesLabel = "")
126 {
127 using namespace ::kodi::addon;
128 return CAddonBase::m_interface->toKodi->kodi_gui->dialogYesNo->show_and_get_input_line_text(CAddonBase::m_interface->toKodi->kodiBase,
129 heading.c_str(), line0.c_str(), line1.c_str(), line2.c_str(),
130 noLabel.c_str(), yesLabel.c_str());
131 }
132 //--------------------------------------------------------------------------
133
134 //==========================================================================
135 ///
136 /// \ingroup cpp_kodi_gui_dialogs_YesNo
137 /// @brief Use dialog to get numeric new password with separated line strings and cancel return field
138 ///
139 /// @param[in] heading Dialog heading
140 /// @param[in] line0 Line #0 text
141 /// @param[in] line1 Line #1 text
142 /// @param[in] line2 Line #2 text
143 /// @param[out] canceled Return value about cancel button
144 /// @param[in] noLabel [opt] label to put on the no button
145 /// @param[in] yesLabel [opt] label to put on the yes button
146 /// @return Returns True if 'Yes' was pressed, else False
147 ///
148 ///
149 ///-------------------------------------------------------------------------
150 ///
151 /// **Example:**
152 /// ~~~~~~~~~~~~~{.cpp}
153 /// #include <kodi/gui/dialogs/YesNo.h>
154 ///
155 /// bool canceled;
156 /// bool ret = kodi::gui::dialogs::YesNo::ShowAndGetInput(
157 /// "Yes / No test call", // The Header
158 /// "You has opened Yes / No dialog for test",
159 /// "",
160 /// "Is this OK for you?",
161 /// canceled, // return value about cancel button
162 /// "Not really", // No label, is optional and if empty "No"
163 /// "Ohhh yes"); // Yes label, also optional and if empty "Yes"
164 /// fprintf(stderr, "You has called Yes/No, returned '%s' and was %s\n",
165 /// ret ? "yes" : "no",
166 /// canceled ? "canceled" : "not canceled");
167 /// ~~~~~~~~~~~~~
168 ///
169 inline bool ATTRIBUTE_HIDDEN ShowAndGetInput(const std::string& heading,
170 const std::string& line0,
171 const std::string& line1,
172 const std::string& line2,
173 bool& canceled,
174 const std::string& noLabel = "",
175 const std::string& yesLabel = "")
176 {
177 using namespace ::kodi::addon;
178 return CAddonBase::m_interface->toKodi->kodi_gui->dialogYesNo->show_and_get_input_line_button_text(CAddonBase::m_interface->toKodi->kodiBase,
179 heading.c_str(), line0.c_str(), line1.c_str(), line2.c_str(),
180 &canceled, noLabel.c_str(), yesLabel.c_str());
181 }
182 //--------------------------------------------------------------------------
183 };
184 /// @}
185
186} /* namespace dialogs */
187} /* namespace gui */
188} /* namespace kodi */