summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogOK.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogOK.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogOK.h104
1 files changed, 104 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogOK.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogOK.h
new file mode 100644
index 0000000..fa98241
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogOK.h
@@ -0,0 +1,104 @@
1#pragma once
2/*
3 * Copyright (C) 2005-2017 Team KODI
4 * http://kodi.tv
5 *
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with KODI; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#include "../AddonBase.h"
23#include "definitions.h"
24
25namespace kodi
26{
27namespace gui
28{
29
30 //============================================================================
31 ///
32 /// \defgroup cpp_kodi_gui_DialogOK Dialog OK
33 /// \ingroup cpp_kodi_gui
34 /// @{
35 /// @brief \cpp_namespace{ kodi::gui::DialogOK }
36 /// **OK dialog**
37 ///
38 /// The functions listed below permit the call of a dialogue of information, a
39 /// confirmation of the user by press from OK required.
40 ///
41 /// It has the header \ref DialogOK.h "#include <kodi/gui/DialogOK.h>"
42 /// be included to enjoy it.
43 ///
44 namespace DialogOK
45 {
46 //==========================================================================
47 ///
48 /// \ingroup cpp_kodi_gui_DialogOK
49 /// @brief Use dialog to inform user with text and confirmation with OK with continued string.
50 ///
51 /// @param[in] heading Dialog heading.
52 /// @param[in] text Multi-line text.
53 ///
54 ///
55 ///-------------------------------------------------------------------------
56 ///
57 /// **Example:**
58 /// ~~~~~~~~~~~~~{.cpp}
59 /// #include <kodi/gui/DialogOK.h>
60 /// ...
61 /// kodi::gui::DialogOK::ShowAndGetInput("Test dialog", "Hello World!\nI'm a call from add-on\n :) :D");
62 /// ~~~~~~~~~~~~~
63 ///
64 inline void ShowAndGetInput(const std::string& heading, const std::string& text)
65 {
66 using namespace ::kodi::addon;
67 CAddonBase::m_interface->toKodi->kodi_gui->dialogOK->show_and_get_input_single_text(CAddonBase::m_interface->toKodi->kodiBase,
68 heading.c_str(), text.c_str());
69 }
70 //--------------------------------------------------------------------------
71
72 //==========================================================================
73 ///
74 /// \ingroup cpp_kodi_gui_DialogOK
75 /// @brief Use dialog to inform user with text and confirmation with OK with strings separated to the lines.
76 ///
77 /// @param[in] heading Dialog heading.
78 /// @param[in] line0 Line #1 text.
79 /// @param[in] line1 Line #2 text.
80 /// @param[in] line2 Line #3 text.
81 ///
82 ///
83 ///-------------------------------------------------------------------------
84 ///
85 /// **Example:**
86 /// ~~~~~~~~~~~~~{.cpp}
87 /// #include <kodi/gui/DialogOK.h>
88 /// ...
89 /// kodi::gui::DialogOK::ShowAndGetInput("Test dialog", "Hello World!", "I'm a call from add-on", " :) :D");
90 /// ~~~~~~~~~~~~~
91 ///
92 inline void ShowAndGetInput(const std::string& heading, const std::string& line0, const std::string& line1, const std::string& line2)
93 {
94 using namespace ::kodi::addon;
95 CAddonBase::m_interface->toKodi->kodi_gui->dialogOK->show_and_get_input_line_text(CAddonBase::m_interface->toKodi->kodiBase,
96 heading.c_str(), line0.c_str(), line1.c_str(),
97 line2.c_str());
98 }
99 //--------------------------------------------------------------------------
100 }
101 /// @}
102
103} /* namespace gui */
104} /* namespace kodi */