summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogSelect.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2017-07-23 16:59:43 +0200
committermanuel <manuel@mausz.at>2017-07-23 16:59:43 +0200
commit4c3251ec645c8b71820dab7e51e612e5919d4e75 (patch)
tree9533268a93e58fc2e16de1b8ee3fafe3784e5225 /xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogSelect.h
parentf44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (diff)
downloadkodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.tar.gz
kodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.tar.bz2
kodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.zip
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogSelect.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogSelect.h101
1 files changed, 0 insertions, 101 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogSelect.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogSelect.h
deleted file mode 100644
index 36433db..0000000
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogSelect.h
+++ /dev/null
@@ -1,101 +0,0 @@
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 "definitions.h"
23#include "../AddonBase.h"
24
25namespace kodi
26{
27namespace gui
28{
29
30 //============================================================================
31 ///
32 /// \defgroup cpp_kodi_gui_DialogSelect Dialog Select
33 /// \ingroup cpp_kodi_gui
34 /// @{
35 /// @brief \cpp_namespace{ kodi::gui::DialogSelect }
36 /// **Selection dialog**
37 ///
38 /// The function listed below permits the call of a dialogue to select of an
39 /// entry as a key
40 ///
41 /// It has the header \ref DialogSelect.h "#include <kodi/gui/DialogSelect.h>"
42 /// be included to enjoy it.
43 ///
44 ///
45 namespace DialogSelect
46 {
47 //==========================================================================
48 ///
49 /// \ingroup cpp_kodi_gui_DialogSelect
50 /// @brief Show a selection dialog about given parts.
51 ///
52 /// @param[in] heading Dialog heading name
53 /// @param[in] entries String list about entries
54 /// @param[in] selected [opt] Predefined selection (default is
55 /// <tt>-1</tt> for the first)
56 /// @param[in] autoclose [opt] To close dialog automatic after a time
57 /// @return The selected entry, if return <tt>-1</tt> was
58 /// nothing selected or canceled
59 ///
60 ///
61 ///-------------------------------------------------------------------------
62 ///
63 /// **Example:**
64 /// ~~~~~~~~~~~~~{.cpp}
65 /// #include <kodi/gui/DialogSelect.h>
66 ///
67 /// const std::vector<std::string> entries
68 /// {
69 /// "Test 1",
70 /// "Test 2",
71 /// "Test 3",
72 /// "Test 4",
73 /// "Test 5"
74 /// };
75 ///
76 /// int selected = kodi::gui::DialogSelect::Show("Test selection", entries, -1);
77 /// if (selected < 0)
78 /// fprintf(stderr, "Item selection canceled\n");
79 /// else
80 /// fprintf(stderr, "Selected item is: %i\n", selected);
81 /// ~~~~~~~~~~~~~
82 ///
83 inline int Show(const std::string& heading, const std::vector<std::string>& entries, int selected = -1, bool autoclose = false)
84 {
85 using namespace ::kodi::addon;
86 unsigned int size = entries.size();
87 const char** cEntries = (const char**)malloc(size*sizeof(const char**));
88 for (unsigned int i = 0; i < size; ++i)
89 {
90 cEntries[i] = entries[i].c_str();
91 }
92 int ret = CAddonBase::m_interface->toKodi->kodi_gui->dialogSelect->open(CAddonBase::m_interface->toKodi->kodiBase, heading.c_str(), cEntries, size, selected, autoclose);
93 free(cEntries);
94 return ret;
95 }
96 //--------------------------------------------------------------------------
97 };
98 /// @}
99
100} /* namespace gui */
101} /* namespace kodi */