summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-dev-kit/include/kodi/gui/dialogs/OK.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/gui/dialogs/OK.h')
-rw-r--r--xbmc/addons/kodi-dev-kit/include/kodi/gui/dialogs/OK.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/gui/dialogs/OK.h b/xbmc/addons/kodi-dev-kit/include/kodi/gui/dialogs/OK.h
new file mode 100644
index 0000000..747ab9d
--- /dev/null
+++ b/xbmc/addons/kodi-dev-kit/include/kodi/gui/dialogs/OK.h
@@ -0,0 +1,101 @@
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 "../../AddonBase.h"
12#include "../../c-api/gui/dialogs/ok.h"
13
14#ifdef __cplusplus
15
16namespace kodi
17{
18namespace gui
19{
20namespace dialogs
21{
22
23//==============================================================================
24/// @defgroup cpp_kodi_gui_dialogs_OK Dialog OK
25/// @ingroup cpp_kodi_gui_dialogs
26/// @{
27/// @brief @cpp_namespace{ kodi::gui::dialogs::OK }
28/// **OK dialog**\n
29/// The functions listed below permit the call of a dialogue of information, a
30/// confirmation of the user by press from OK required.
31///
32/// It has the header @ref OK.h "#include <kodi/gui/dialogs/OK.h>"
33/// be included to enjoy it.
34///
35namespace OK
36{
37//==============================================================================
38/// @ingroup cpp_kodi_gui_dialogs_OK
39/// @brief Use dialog to inform user with text and confirmation with OK with
40/// continued string.
41///
42/// @param[in] heading Dialog heading.
43/// @param[in] text Multi-line text.
44///
45///
46///-------------------------------------------------------------------------
47///
48/// **Example:**
49/// ~~~~~~~~~~~~~{.cpp}
50/// #include <kodi/gui/dialogs/OK.h>
51/// ...
52/// kodi::gui::dialogs::OK::ShowAndGetInput("Test dialog", "Hello World!\nI'm a call from add-on\n :) :D");
53/// ~~~~~~~~~~~~~
54///
55inline void ATTRIBUTE_HIDDEN ShowAndGetInput(const std::string& heading, const std::string& text)
56{
57 using namespace ::kodi::addon;
58 CAddonBase::m_interface->toKodi->kodi_gui->dialogOK->show_and_get_input_single_text(
59 CAddonBase::m_interface->toKodi->kodiBase, heading.c_str(), text.c_str());
60}
61//------------------------------------------------------------------------------
62
63//==============================================================================
64/// @ingroup cpp_kodi_gui_dialogs_OK
65/// @brief Use dialog to inform user with text and confirmation with OK with
66/// strings separated to the lines.
67///
68/// @param[in] heading Dialog heading.
69/// @param[in] line0 Line #1 text.
70/// @param[in] line1 Line #2 text.
71/// @param[in] line2 Line #3 text.
72///
73///
74///-------------------------------------------------------------------------
75///
76/// **Example:**
77/// ~~~~~~~~~~~~~{.cpp}
78/// #include <kodi/gui/dialogs/OK.h>
79/// ...
80/// kodi::gui::dialogs::OK::ShowAndGetInput("Test dialog", "Hello World!", "I'm a call from add-on", " :) :D");
81/// ~~~~~~~~~~~~~
82///
83inline void ATTRIBUTE_HIDDEN ShowAndGetInput(const std::string& heading,
84 const std::string& line0,
85 const std::string& line1,
86 const std::string& line2)
87{
88 using namespace ::kodi::addon;
89 CAddonBase::m_interface->toKodi->kodi_gui->dialogOK->show_and_get_input_line_text(
90 CAddonBase::m_interface->toKodi->kodiBase, heading.c_str(), line0.c_str(), line1.c_str(),
91 line2.c_str());
92}
93//------------------------------------------------------------------------------
94} // namespace OK
95/// @}
96
97} /* namespace dialogs */
98} /* namespace gui */
99} /* namespace kodi */
100
101#endif /* __cplusplus */