summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h86
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h385
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h176
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h276
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/FadeLabel.h159
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h123
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Label.h128
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Progress.h121
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/RadioButton.h171
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Rendering.h215
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/SettingsSlider.h323
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Slider.h336
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Spin.h376
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/TextBox.h176
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h240
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/ContextMenu.h (renamed from xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogContextMenu.h)21
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/ExtendedProgress.h (renamed from xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogExtendedProgress.h)45
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/FileBrowser.h (renamed from xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogFileBrowser.h)35
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Keyboard.h (renamed from xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogKeyboard.h)43
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Numeric.h (renamed from xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogNumeric.h)47
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/OK.h (renamed from xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogOK.h)27
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Progress.h (renamed from xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogProgress.h)51
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Select.h (renamed from xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogSelect.h)26
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/TextViewer.h (renamed from xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogTextViewer.h)21
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/YesNo.h (renamed from xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogYesNo.h)33
25 files changed, 3471 insertions, 169 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h
index a473f28..944b1b9 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h
@@ -91,20 +91,18 @@ namespace gui
91 /// @param[in] label Item label 91 /// @param[in] label Item label
92 /// @param[in] label2 Second Item label (if needed) 92 /// @param[in] label2 Second Item label (if needed)
93 /// @param[in] iconImage Item icon image (if needed) 93 /// @param[in] iconImage Item icon image (if needed)
94 /// @param[in] thumbnailImage Thumbnail Image of item (if needed)
95 /// @param[in] path Path to where item is defined 94 /// @param[in] path Path to where item is defined
96 /// 95 ///
97 CListItem( 96 CListItem(
98 const std::string& label = "", 97 const std::string& label = "",
99 const std::string& label2 = "", 98 const std::string& label2 = "",
100 const std::string& iconImage = "", 99 const std::string& iconImage = "",
101 const std::string& thumbnailImage = "",
102 const std::string& path = "") 100 const std::string& path = "")
103 : CAddonGUIControlBase(nullptr) 101 : CAddonGUIControlBase(nullptr)
104 { 102 {
105 m_controlHandle = m_interface->kodi_gui->listItem->create(m_interface->kodiBase, label.c_str(), 103 m_controlHandle = m_interface->kodi_gui->listItem->create(m_interface->kodiBase, label.c_str(),
106 label2.c_str(), iconImage.c_str(), 104 label2.c_str(), iconImage.c_str(),
107 thumbnailImage.c_str(), path.c_str()); 105 path.c_str());
108 } 106 }
109 107
110 /* 108 /*
@@ -124,7 +122,7 @@ namespace gui
124 /// \ingroup cpp_kodi_gui_CListItem 122 /// \ingroup cpp_kodi_gui_CListItem
125 /// @brief Class destructor 123 /// @brief Class destructor
126 /// 124 ///
127 virtual ~CListItem() 125 ~CListItem() override
128 { 126 {
129 m_interface->kodi_gui->listItem->destroy(m_interface->kodiBase, m_controlHandle); 127 m_interface->kodi_gui->listItem->destroy(m_interface->kodiBase, m_controlHandle);
130 } 128 }
@@ -330,6 +328,86 @@ namespace gui
330 } 328 }
331 //-------------------------------------------------------------------------- 329 //--------------------------------------------------------------------------
332 330
331 //==========================================================================
332 ///
333 /// \ingroup cpp_kodi_gui_CListItem
334 /// @brief Sets a listitem property, similar to an infolabel.
335 ///
336 /// @param[in] key string - property name.
337 /// @param[in] value string or unicode - value of property.
338 ///
339 /// @note Key is NOT case sensitive.
340 /// You can use the above as keywords for arguments and skip certain\n
341 /// optional arguments.\n
342 /// Once you use a keyword, all following arguments require the
343 /// keyword.
344 ///
345 /// Some of these are treated internally by Kodi, such as the
346 /// <b>'StartOffset'</b> property, which is the offset in seconds at which to
347 /// start playback of an item. Others may be used in the skin to add
348 /// extra information, such as <b>'WatchedCount'</b> for tvshow items
349 ///
350 void SetProperty(const std::string& key, const std::string& value)
351 {
352 m_interface->kodi_gui->listItem->set_property(m_interface->kodiBase, m_controlHandle, key.c_str(), value.c_str());
353 }
354 //--------------------------------------------------------------------------
355
356 //==========================================================================
357 ///
358 /// \ingroup cpp_kodi_gui_CListItem
359 /// @brief Returns a listitem property as a string, similar to an infolabel.
360 ///
361 /// @param[in] key string - property name.
362 /// @return string - List item property
363 ///
364 /// @note Key is NOT case sensitive.\n
365 /// You can use the above as keywords for arguments and skip certain
366 /// optional arguments.\n
367 /// Once you use a keyword, all following arguments require the
368 /// keyword.
369 ///
370 std::string GetProperty(const std::string& key)
371 {
372 std::string label;
373 char* ret = m_interface->kodi_gui->listItem->get_property(m_interface->kodiBase, m_controlHandle, key.c_str());
374 if (ret != nullptr)
375 {
376 if (std::strlen(ret))
377 label = ret;
378 m_interface->free_string(m_interface->kodiBase, ret);
379 }
380 return label;
381 }
382 //--------------------------------------------------------------------------
383
384 //==========================================================================
385 ///
386 /// \ingroup cpp_kodi_gui_CListItem
387 /// @brief To control selection of item in list (also multiple selection,
388 /// in list on serveral items possible).
389 ///
390 /// @param[in] selected if true becomes set as selected
391 ///
392 void Select(bool selected)
393 {
394 m_interface->kodi_gui->listItem->select(m_interface->kodiBase, m_controlHandle, selected);
395 }
396 //--------------------------------------------------------------------------
397
398 //==========================================================================
399 ///
400 /// \ingroup cpp_kodi_gui_CListItem
401 /// @brief Returns the listitem's selected status.
402 ///
403 /// @return true if selected, otherwise false
404 ///
405 bool IsSelected()
406 {
407 return m_interface->kodi_gui->listItem->is_selected(m_interface->kodiBase, m_controlHandle);
408 }
409 //--------------------------------------------------------------------------
410
333 }; 411 };
334 412
335} /* namespace gui */ 413} /* namespace gui */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h
index 7069e63..b78585f 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h
@@ -110,7 +110,7 @@ namespace gui
110 /// 110 ///
111 /// 111 ///
112 /// 112 ///
113 virtual ~CWindow() 113 ~CWindow() override
114 { 114 {
115 if (m_controlHandle) 115 if (m_controlHandle)
116 m_interface->kodi_gui->window->destroy(m_interface->kodiBase, m_controlHandle); 116 m_interface->kodi_gui->window->destroy(m_interface->kodiBase, m_controlHandle);
@@ -166,6 +166,232 @@ namespace gui
166 //========================================================================== 166 //==========================================================================
167 /// 167 ///
168 /// \ingroup cpp_kodi_gui_CWindow 168 /// \ingroup cpp_kodi_gui_CWindow
169 /// @brief Gives the control with the supplied focus.
170 ///
171 /// @param[in] iControlId On skin defined id of control
172 /// @return Return true if call and focus is successed,
173 /// if false was something failed to get needed
174 /// skin parts.
175 ///
176 ///
177 bool SetFocusId(int iControlId)
178 {
179 return m_interface->kodi_gui->window->set_focus_id(m_interface->kodiBase, m_controlHandle, iControlId);
180 }
181 //--------------------------------------------------------------------------
182
183 //==========================================================================
184 ///
185 /// \ingroup cpp_kodi_gui_CWindow
186 /// @brief Returns the id of the control which is focused.
187 ///
188 /// @return Focused control id
189 ///
190 ///
191 int GetFocusId()
192 {
193 return m_interface->kodi_gui->window->get_focus_id(m_interface->kodiBase, m_controlHandle);
194 }
195 //--------------------------------------------------------------------------
196
197 //==========================================================================
198 ///
199 /// \ingroup cpp_kodi_gui_CWindow
200 /// @brief To set the used label on given control id
201 ///
202 /// @param[in] controlId Control id where label need to set
203 /// @param[in] label Label to use
204 ///
205 ///
206 void SetControlLabel(int controlId, const std::string& label)
207 {
208 m_interface->kodi_gui->window->set_control_label(m_interface->kodiBase, m_controlHandle, controlId, label.c_str());
209 }
210 //--------------------------------------------------------------------------
211
212 //==========================================================================
213 ///
214 /// \ingroup cpp_kodi_gui_CWindow
215 /// @brief Sets a window property, similar to an infolabel.
216 ///
217 /// @param[in] key string - property name.
218 /// @param[in] value string or unicode - value of property.
219 ///
220 /// @note Key is NOT case sensitive. Setting value to an empty string is
221 /// equivalent to clearProperty(key).\n
222 /// You can use the above as keywords for arguments and skip certain
223 /// optional arguments.\n
224 /// Once you use a keyword, all following arguments require the keyword.
225 ///
226 void SetProperty(const std::string& key, const std::string& value)
227 {
228 m_interface->kodi_gui->window->set_property(m_interface->kodiBase, m_controlHandle, key.c_str(), value.c_str());
229 }
230 //--------------------------------------------------------------------------
231
232 //==========================================================================
233 ///
234 /// \ingroup cpp_kodi_gui_CWindow
235 /// @brief Returns a window property as a string, similar to an infolabel.
236 ///
237 /// @param[in] key string - property name.
238 /// @return The property as strin (if present)
239 ///
240 /// @note Key is NOT case sensitive. Setting value to an empty string is
241 /// equivalent to clearProperty(key).\n
242 /// You can use the above as keywords for arguments and skip certain
243 /// optional arguments.\n
244 /// Once you use a keyword, all following arguments require the keyword.
245 ///
246 ///
247 std::string GetProperty(const std::string& key) const
248 {
249 std::string label;
250 char* ret = m_interface->kodi_gui->window->get_property(m_interface->kodiBase, m_controlHandle, key.c_str());
251 if (ret != nullptr)
252 {
253 if (std::strlen(ret))
254 label = ret;
255 m_interface->free_string(m_interface->kodiBase, ret);
256 }
257 return label;
258 }
259 //--------------------------------------------------------------------------
260
261 //==========================================================================
262 ///
263 /// \ingroup cpp_kodi_gui_CWindow
264 /// @brief Sets a window property with integer value
265 ///
266 /// @param[in] key string - property name.
267 /// @param[in] value integer value to set
268 ///
269 ///
270 void SetPropertyInt(const std::string& key, int value)
271 {
272 m_interface->kodi_gui->window->set_property_int(m_interface->kodiBase, m_controlHandle, key.c_str(), value);
273 }
274 //--------------------------------------------------------------------------
275
276 //==========================================================================
277 ///
278 /// \ingroup cpp_kodi_gui_CWindow
279 /// @brief Returns a window property with integer value
280 ///
281 /// @param[in] key string - property name.
282 /// @return integer value of property
283 ///
284 int GetPropertyInt(const std::string& key) const
285 {
286 return m_interface->kodi_gui->window->get_property_int(m_interface->kodiBase, m_controlHandle, key.c_str());
287 }
288 //--------------------------------------------------------------------------
289
290 //==========================================================================
291 ///
292 /// \ingroup cpp_kodi_gui_CWindow
293 /// @brief Sets a window property with boolean value
294 ///
295 /// @param[in] key string - property name.
296 /// @param[in] value boolean value to set
297 ///
298 ///
299 void SetPropertyBool(const std::string& key, bool value)
300 {
301 m_interface->kodi_gui->window->set_property_bool(m_interface->kodiBase, m_controlHandle, key.c_str(), value);
302 }
303 //--------------------------------------------------------------------------
304
305 //==========================================================================
306 ///
307 /// \ingroup cpp_kodi_gui_CWindow
308 /// @brief Returns a window property with boolean value
309 ///
310 /// @param[in] key string - property name.
311 /// @return boolean value of property
312 ///
313 bool GetPropertyBool(const std::string& key) const
314 {
315 return m_interface->kodi_gui->window->get_property_bool(m_interface->kodiBase, m_controlHandle, key.c_str());
316 }
317 //--------------------------------------------------------------------------
318
319 //==========================================================================
320 ///
321 /// \ingroup cpp_kodi_gui_CWindow
322 /// @brief Sets a window property with double value
323 ///
324 /// @param[in] key string - property name.
325 /// @param[in] value double value to set
326 ///
327 ///
328 void SetPropertyDouble(const std::string& key, double value)
329 {
330 m_interface->kodi_gui->window->set_property_double(m_interface->kodiBase, m_controlHandle, key.c_str(), value);
331 }
332 //--------------------------------------------------------------------------
333
334 //==========================================================================
335 ///
336 /// \ingroup cpp_kodi_gui_CWindow
337 /// @brief Returns a window property with double value
338 ///
339 /// @param[in] key string - property name.
340 /// @return double value of property
341 ///
342 ///
343 double GetPropertyDouble(const std::string& key) const
344 {
345 return m_interface->kodi_gui->window->get_property_double(m_interface->kodiBase, m_controlHandle, key.c_str());
346 }
347 //--------------------------------------------------------------------------
348
349 //==========================================================================
350 ///
351 /// \ingroup cpp_kodi_gui_CWindow
352 /// @brief Remove all present properties from window
353 ///
354 ///
355 ///
356 void ClearProperties()
357 {
358 m_interface->kodi_gui->window->clear_properties(m_interface->kodiBase, m_controlHandle);
359 }
360 //--------------------------------------------------------------------------
361
362 //==========================================================================
363 ///
364 /// \ingroup cpp_kodi_gui_CWindow
365 /// @brief Clears the specific window property.
366 ///
367 /// @param[in] key string - property name.
368 ///
369 /// @note Key is NOT case sensitive. Equivalent to SetProperty(key, "")
370 /// You can use the above as keywords for arguments and skip certain
371 /// optional arguments.
372 /// Once you use a keyword, all following arguments require the
373 /// keyword.
374 ///
375 ///
376 ///-----------------------------------------------------------------------
377 ///
378 /// **Example:**
379 /// ~~~~~~~~~~~~~{.cpp}
380 /// ..
381 /// ClearProperty('Category')
382 /// ..
383 /// ~~~~~~~~~~~~~
384 ///
385 void ClearProperty(const std::string& key)
386 {
387 m_interface->kodi_gui->window->clear_property(m_interface->kodiBase, m_controlHandle, key.c_str());
388 }
389 //--------------------------------------------------------------------------
390
391 //@{
392 //==========================================================================
393 ///
394 /// \ingroup cpp_kodi_gui_CWindow
169 /// @brief Function delete all entries in integrated list. 395 /// @brief Function delete all entries in integrated list.
170 /// 396 ///
171 /// 397 ///
@@ -209,6 +435,34 @@ namespace gui
209 //========================================================================== 435 //==========================================================================
210 /// 436 ///
211 /// \ingroup cpp_kodi_gui_CWindow 437 /// \ingroup cpp_kodi_gui_CWindow
438 /// @brief Remove list item on position.
439 ///
440 /// @param[in] itemPosition List position to remove
441 ///
442 ///
443 void RemoveListItem(int itemPosition)
444 {
445 m_interface->kodi_gui->window->remove_list_item_from_position(m_interface->kodiBase, m_controlHandle, itemPosition);
446 }
447 //--------------------------------------------------------------------------
448
449 //==========================================================================
450 ///
451 /// \ingroup cpp_kodi_gui_CWindow
452 /// @brief Remove item with given control class from list.
453 ///
454 /// @param[in] item List item control class to remove
455 ///
456 ///
457 void RemoveListItem(ListItemPtr item)
458 {
459 m_interface->kodi_gui->window->remove_list_item(m_interface->kodiBase, m_controlHandle, item->m_controlHandle);
460 }
461 //--------------------------------------------------------------------------
462
463 //==========================================================================
464 ///
465 /// \ingroup cpp_kodi_gui_CWindow
212 /// @brief To get list item control class on wanted position. 466 /// @brief To get list item control class on wanted position.
213 /// 467 ///
214 /// @param[in] listPos Position from where control is needed 468 /// @param[in] listPos Position from where control is needed
@@ -227,6 +481,135 @@ namespace gui
227 //-------------------------------------------------------------------------- 481 //--------------------------------------------------------------------------
228 482
229 //========================================================================== 483 //==========================================================================
484 ///
485 /// \ingroup cpp_kodi_gui_CWindow
486 /// @brief To set position of selected part in list.
487 ///
488 /// @param[in] listPos Position to use
489 ///
490 ///
491 void SetCurrentListPosition(int listPos)
492 {
493 m_interface->kodi_gui->window->set_current_list_position(m_interface->kodiBase, m_controlHandle, listPos);
494 }
495 //--------------------------------------------------------------------------
496
497 //==========================================================================
498 ///
499 /// \ingroup cpp_kodi_gui_CWindow
500 /// @brief To get current selected position in list
501 ///
502 /// @return Current list position
503 ///
504 ///
505 int GetCurrentListPosition()
506 {
507 return m_interface->kodi_gui->window->get_current_list_position(m_interface->kodiBase, m_controlHandle);
508 }
509 //--------------------------------------------------------------------------
510
511 //==========================================================================
512 ///
513 /// \ingroup cpp_kodi_gui_CWindow
514 /// @brief To get the amount of entries in the list.
515 ///
516 /// @return Size of in window integrated control class
517 ///
518 ///
519 int GetListSize()
520 {
521 return m_interface->kodi_gui->window->get_list_size(m_interface->kodiBase, m_controlHandle);
522 }
523 //--------------------------------------------------------------------------
524
525 //==========================================================================
526 ///
527 /// \ingroup cpp_kodi_gui_CWindow
528 /// @brief Sets a container property, similar to an infolabel.
529 ///
530 /// @param[in] key string - property name.
531 /// @param[in] value string or unicode - value of property.
532 ///
533 /// @note Key is NOT case sensitive.\n
534 /// You can use the above as keywords for arguments and skip certain
535 /// optional arguments.\n
536 /// Once you use a keyword, all following arguments require the keyword.
537 ///
538 ///
539 void SetContainerProperty(const std::string& key, const std::string& value)
540 {
541 m_interface->kodi_gui->window->set_container_property(m_interface->kodiBase, m_controlHandle, key.c_str(), value.c_str());
542 }
543 //--------------------------------------------------------------------------
544
545 //==========================================================================
546 ///
547 /// \ingroup cpp_kodi_gui_CWindow
548 /// @brief Sets the content type of the container.
549 ///
550 /// @param[in] value string or unicode - content value.
551 ///
552 /// __Available content types__
553 /// | Name | Media |
554 /// |:-----------:|:-----------------------------------------|
555 /// | actors | Videos
556 /// | addons | Addons, Music, Pictures, Programs, Videos
557 /// | albums | Music, Videos
558 /// | artists | Music, Videos
559 /// | countries | Music, Videos
560 /// | directors | Videos
561 /// | files | Music, Videos
562 /// | games | Games
563 /// | genres | Music, Videos
564 /// | images | Pictures
565 /// | mixed | Music, Videos
566 /// | movies | Videos
567 /// | Musicvideos | Music, Videos
568 /// | playlists | Music, Videos
569 /// | seasons | Videos
570 /// | sets | Videos
571 /// | songs | Music
572 /// | studios | Music, Videos
573 /// | tags | Music, Videos
574 /// | tvshows | Videos
575 /// | videos | Videos
576 /// | years | Music, Videos
577 ///
578 ///
579 void SetContainerContent(const std::string& value)
580 {
581 m_interface->kodi_gui->window->set_container_content(m_interface->kodiBase, m_controlHandle, value.c_str());
582 }
583 //--------------------------------------------------------------------------
584
585 //==========================================================================
586 ///
587 /// \ingroup cpp_kodi_gui_CWindow
588 /// @brief Get the id of the currently visible container.
589 ///
590 /// @return currently visible container id
591 ///
592 ///
593 int GetCurrentContainerId()
594 {
595 return m_interface->kodi_gui->window->get_current_container_id(m_interface->kodiBase, m_controlHandle);
596 }
597 //--------------------------------------------------------------------------
598 //@}
599
600 //==========================================================================
601 ///
602 /// \ingroup cpp_kodi_gui_CWindow
603 /// @brief To inform Kodi that it need to render region new.
604 ///
605 ///
606 void MarkDirtyRegion()
607 {
608 return m_interface->kodi_gui->window->mark_dirty_region(m_interface->kodiBase, m_controlHandle);
609 }
610 //--------------------------------------------------------------------------
611
612 //==========================================================================
230 // 613 //
231 /// @defgroup cpp_kodi_gui_CWindow_callbacks Callback functions from Kodi to add-on 614 /// @defgroup cpp_kodi_gui_CWindow_callbacks Callback functions from Kodi to add-on
232 /// \ingroup cpp_kodi_gui_CWindow 615 /// \ingroup cpp_kodi_gui_CWindow
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h
new file mode 100644
index 0000000..5892d24
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h
@@ -0,0 +1,176 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CButton Control Button
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CButton }
37 /// **Standard push button control for window**
38 ///
39 /// The button control is used for creating push buttons in Kodi. You can
40 /// choose the position, size, and look of the button, as well as choosing
41 /// what action(s) should be performed when pushed.
42 ///
43 /// It has the header \ref Button.h "#include <kodi/gui/controls/Button.h>"
44 /// be included to enjoy it.
45 ///
46 /// Here you find the needed skin part for a \ref skin_Button_control "button control"
47 ///
48 /// @note The call of the control is only possible from the corresponding
49 /// window as its class and identification number is required.
50 ///
51 class CButton : public CAddonGUIControlBase
52 {
53 public:
54 //==========================================================================
55 ///
56 /// @ingroup cpp_kodi_gui_control_CButton
57 /// @brief Construct a new control
58 ///
59 /// @param[in] window related window control class
60 /// @param[in] controlId Used skin xml control id
61 ///
62 CButton(CWindow* window, int controlId)
63 : CAddonGUIControlBase(window)
64 {
65 m_controlHandle = m_interface->kodi_gui->window->get_control_button(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
66 if (!m_controlHandle)
67 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::CButton can't create control class from Kodi !!!");
68 }
69 //--------------------------------------------------------------------------
70
71 //==========================================================================
72 ///
73 /// @ingroup cpp_kodi_gui_control_CButton
74 /// @brief Destructor
75 ///
76 ~CButton() override = default;
77 //--------------------------------------------------------------------------
78
79 //==========================================================================
80 ///
81 /// @ingroup cpp_kodi_gui_control_CButton
82 /// @brief Set the control on window to visible
83 ///
84 /// @param[in] visible If true visible, otherwise hidden
85 ///
86 void SetVisible(bool visible)
87 {
88 m_interface->kodi_gui->control_button->set_visible(m_interface->kodiBase, m_controlHandle, visible);
89 }
90 //--------------------------------------------------------------------------
91
92 //==========================================================================
93 ///
94 /// @ingroup cpp_kodi_gui_control_CButton
95 /// @brief Set's the control's enabled/disabled state
96 ///
97 /// @param[in] enabled If true enabled, otherwise disabled
98 ///
99 void SetEnabled(bool enabled)
100 {
101 m_interface->kodi_gui->control_button->set_enabled(m_interface->kodiBase, m_controlHandle, enabled);
102 }
103 //--------------------------------------------------------------------------
104
105 //==========================================================================
106 ///
107 /// @ingroup cpp_kodi_gui_control_CButton
108 /// @brief To set the text string on button
109 ///
110 /// @param[in] label Text to show
111 ///
112 void SetLabel(const std::string& label)
113 {
114 m_interface->kodi_gui->control_button->set_label(m_interface->kodiBase, m_controlHandle, label.c_str());
115 }
116 //--------------------------------------------------------------------------
117
118 //==========================================================================
119 ///
120 /// @ingroup cpp_kodi_gui_control_CButton
121 /// @brief Get the used text from button
122 ///
123 /// @return Text shown
124 ///
125 std::string GetLabel() const
126 {
127 std::string label;
128 char* ret = m_interface->kodi_gui->control_button->get_label(m_interface->kodiBase, m_controlHandle);
129 if (ret != nullptr)
130 {
131 if (std::strlen(ret))
132 label = ret;
133 m_interface->free_string(m_interface->kodiBase, ret);
134 }
135 return label;
136 }
137 //--------------------------------------------------------------------------
138
139 //==========================================================================
140 ///
141 /// @ingroup cpp_kodi_gui_control_CButton
142 /// @brief If two labels are used for button becomes it set with them
143 ///
144 /// @param[in] label Text for second label
145 ///
146 void SetLabel2(const std::string& label)
147 {
148 m_interface->kodi_gui->control_button->set_label2(m_interface->kodiBase, m_controlHandle, label.c_str());
149 }
150 //--------------------------------------------------------------------------
151
152 //==========================================================================
153 ///
154 /// @ingroup cpp_kodi_gui_control_CButton
155 /// @brief Get the second label if present
156 ///
157 /// @return Second label
158 ///
159 std::string GetLabel2() const
160 {
161 std::string label;
162 char* ret = m_interface->kodi_gui->control_button->get_label2(m_interface->kodiBase, m_controlHandle);
163 if (ret != nullptr)
164 {
165 if (std::strlen(ret))
166 label = ret;
167 m_interface->free_string(m_interface->kodiBase, ret);
168 }
169 return label;
170 }
171 //--------------------------------------------------------------------------
172 };
173
174} /* namespace controls */
175} /* namespace gui */
176} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h
new file mode 100644
index 0000000..83eeede
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h
@@ -0,0 +1,276 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CEdit Control Edit
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CEdit }
37 /// **Editable window text control used as an input control for the osd keyboard
38 /// and other input fields**
39 ///
40 /// The edit control allows a user to input text in Kodi. You can choose the
41 /// font, size, colour, location and header of the text to be displayed.
42 ///
43 /// It has the header \ref Edit.h "#include <kodi/gui/controls/Edit.h>"
44 /// be included to enjoy it.
45 ///
46 /// Here you find the needed skin part for a \ref skin_Edit_control
47 /// "edit control".
48 ///
49 /// @note The call of the control is only possible from the corresponding
50 /// window as its class and identification number is required.
51 ///
52
53 //============================================================================
54 // see gui/definition.h for use of group "cpp_kodi_gui_controls_CEdit_Defs"
55 ///
56 /// \defgroup cpp_kodi_gui_controls_CEdit_Defs Definitions, structures and enumerators
57 /// \ingroup cpp_kodi_gui_controls_CEdit
58 /// @brief **Library definition values**
59 ///
60
61} /* namespace controls */
62} /* namespace gui */
63} /* namespace kodi */
64
65//============================================================================
66///
67/// \ingroup cpp_kodi_gui_controls_CEdit_Defs
68/// @{
69/// @anchor AddonGUIInputType
70/// @brief Text input types used on kodi::gui::controls::CEdit
71enum AddonGUIInputType
72{
73 /// Text inside edit control only readable
74 ADDON_INPUT_TYPE_READONLY = -1,
75 /// Normal text entries
76 ADDON_INPUT_TYPE_TEXT = 0,
77 /// To use on edit control only numeric numbers
78 ADDON_INPUT_TYPE_NUMBER,
79 /// To insert seconds
80 ADDON_INPUT_TYPE_SECONDS,
81 /// To insert time
82 ADDON_INPUT_TYPE_TIME,
83 /// To insert a date
84 ADDON_INPUT_TYPE_DATE,
85 /// Used for write in IP addresses
86 ADDON_INPUT_TYPE_IPADDRESS,
87 /// Text field used as password entry field with not visible text
88 ADDON_INPUT_TYPE_PASSWORD,
89 /// Text field used as password entry field with not visible text but
90 /// returned as MD5 value
91 ADDON_INPUT_TYPE_PASSWORD_MD5,
92 /// Use text field for search purpose
93 ADDON_INPUT_TYPE_SEARCH,
94 /// Text field as filter
95 ADDON_INPUT_TYPE_FILTER,
96 ///
97 ADDON_INPUT_TYPE_PASSWORD_NUMBER_VERIFY_NEW
98};
99/// @}
100//----------------------------------------------------------------------------
101
102namespace kodi
103{
104namespace gui
105{
106namespace controls
107{
108
109 class CEdit : public CAddonGUIControlBase
110 {
111 public:
112 //==========================================================================
113 ///
114 /// \ingroup cpp_kodi_gui_controls_CEdit
115 /// @brief Construct a new control
116 ///
117 /// @param[in] window related window control class
118 /// @param[in] controlId Used skin xml control id
119 ///
120 CEdit(CWindow* window, int controlId)
121 : CAddonGUIControlBase(window)
122 {
123 m_controlHandle = m_interface->kodi_gui->window->get_control_edit(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
124 if (!m_controlHandle)
125 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::control::CEdit can't create control class from Kodi !!!");
126 }
127 //--------------------------------------------------------------------------
128
129 //==========================================================================
130 ///
131 /// \ingroup cpp_kodi_gui_controls_CEdit
132 /// @brief Destructor
133 ///
134 ~CEdit() override = default;
135 //--------------------------------------------------------------------------
136
137 //==========================================================================
138 ///
139 /// \ingroup cpp_kodi_gui_controls_CEdit
140 /// @brief Set the control on window to visible
141 ///
142 /// @param[in] visible If true visible, otherwise hidden
143 ///
144 void SetVisible(bool visible)
145 {
146 m_interface->kodi_gui->control_edit->set_visible(m_interface->kodiBase, m_controlHandle, visible);
147 }
148 //--------------------------------------------------------------------------
149
150 //==========================================================================
151 ///
152 /// \ingroup cpp_kodi_gui_controls_CEdit
153 /// @brief Set's the control's enabled/disabled state
154 ///
155 /// @param[in] enabled If true enabled, otherwise disabled
156 ///
157 void SetEnabled(bool enabled)
158 {
159 m_interface->kodi_gui->control_edit->set_enabled(m_interface->kodiBase, m_controlHandle, enabled);
160 }
161 //--------------------------------------------------------------------------
162
163 //==========================================================================
164 ///
165 /// \ingroup cpp_kodi_gui_controls_CEdit
166 /// @brief To set the text string on edit control
167 ///
168 /// @param[in] label Text to show
169 ///
170 void SetLabel(const std::string& label)
171 {
172 m_interface->kodi_gui->control_edit->set_label(m_interface->kodiBase, m_controlHandle, label.c_str());
173 }
174 //--------------------------------------------------------------------------
175
176 //==========================================================================
177 ///
178 /// \ingroup cpp_kodi_gui_controls_CEdit
179 /// @brief Returns the text heading for this edit control.
180 ///
181 /// @return Heading text
182 ///
183 std::string GetLabel() const
184 {
185 std::string label;
186 char* ret = m_interface->kodi_gui->control_edit->get_label(m_interface->kodiBase, m_controlHandle);
187 if (ret != nullptr)
188 {
189 if (std::strlen(ret))
190 label = ret;
191 m_interface->free_string(m_interface->kodiBase, ret);
192 }
193 return label;
194 }
195 //--------------------------------------------------------------------------
196
197 //==========================================================================
198 ///
199 /// \ingroup cpp_kodi_gui_controls_CEdit
200 /// @brief Set's text heading for this edit control.
201 ///
202 /// @param[in] text string or unicode - text string.
203 ///
204 void SetText(const std::string& text)
205 {
206 m_interface->kodi_gui->control_edit->set_text(m_interface->kodiBase, m_controlHandle, text.c_str());
207 }
208 //--------------------------------------------------------------------------
209
210 //==========================================================================
211 ///
212 /// \ingroup cpp_kodi_gui_controls_CEdit
213 /// @brief Returns the text value for this edit control.
214 ///
215 /// @return Text value of control
216 ///
217 std::string GetText() const
218 {
219 std::string text;
220 char* ret = m_interface->kodi_gui->control_edit->get_text(m_interface->kodiBase, m_controlHandle);
221 if (ret != nullptr)
222 {
223 if (std::strlen(ret))
224 text = ret;
225 m_interface->free_string(m_interface->kodiBase, ret);
226 }
227 return text;
228 }
229 //--------------------------------------------------------------------------
230
231 //==========================================================================
232 ///
233 /// \ingroup cpp_kodi_gui_controls_CEdit
234 /// @brief Set the cursor position on text.
235 ///
236 /// @param[in] iPosition The position to set
237 ///
238 void SetCursorPosition(unsigned int iPosition)
239 {
240 m_interface->kodi_gui->control_edit->set_cursor_position(m_interface->kodiBase, m_controlHandle, iPosition);
241 }
242 //--------------------------------------------------------------------------
243
244 //==========================================================================
245 ///
246 /// \ingroup cpp_kodi_gui_controls_CEdit
247 /// @brief To get current cursor position on text field
248 ///
249 /// @return The current cursor position
250 ///
251 unsigned int GetCursorPosition()
252 {
253 return m_interface->kodi_gui->control_edit->get_cursor_position(m_interface->kodiBase, m_controlHandle);
254 }
255 //--------------------------------------------------------------------------
256
257 //==========================================================================
258 ///
259 /// \ingroup cpp_kodi_gui_controls_CEdit
260 /// @brief To set field input type which are defined on \ref AddonGUIInputType
261 ///
262 /// @param[in] type The \ref AddonGUIInputType "Add-on input type"
263 /// to use
264 /// @param[in] heading The heading text for related keyboard
265 /// dialog
266 ///
267 void SetInputType(AddonGUIInputType type, const std::string& heading)
268 {
269 m_interface->kodi_gui->control_edit->set_input_type(m_interface->kodiBase, m_controlHandle, static_cast<int>(type), heading.c_str());
270 }
271 //--------------------------------------------------------------------------
272 };
273
274} /* namespace controls */
275} /* namespace gui */
276} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/FadeLabel.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/FadeLabel.h
new file mode 100644
index 0000000..82d17ff
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/FadeLabel.h
@@ -0,0 +1,159 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CFadeLabel Control Fade Label
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CFadeLabel }
37 /// **Window control used to show multiple pieces of text in the same position,
38 /// by fading from one to the other**
39 ///
40 /// The fade label control is used for displaying multiple pieces of text in
41 /// the same space in Kodi. You can choose the font, size, colour, location
42 /// and contents of the text to be displayed. The first piece of information
43 /// to display fades in over 50 frames, then scrolls off to the left. Once it
44 /// is finished scrolling off screen, the second piece of information fades
45 /// in and the process repeats. A fade label control is not supported in a
46 /// list container.
47 ///
48 /// It has the header \ref FadeLabel.h "#include <kodi/gui/controls/FadeLabel.h>"
49 /// be included to enjoy it.
50 ///
51 /// Here you find the needed skin part for a \ref Fade_Label_Control "fade label control"
52 ///
53 /// @note The call of the control is only possible from the corresponding
54 /// window as its class and identification number is required.
55 ///
56 class CFadeLabel : public CAddonGUIControlBase
57 {
58 public:
59 //==========================================================================
60 ///
61 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
62 /// @brief Construct a new control.
63 ///
64 /// @param[in] window related window control class
65 /// @param[in] controlId Used skin xml control id
66 ///
67 CFadeLabel(CWindow* window, int controlId)
68 : CAddonGUIControlBase(window)
69 {
70 m_controlHandle = m_interface->kodi_gui->window->get_control_fade_label(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
71 if (!m_controlHandle)
72 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CFadeLabel can't create control class from Kodi !!!");
73 }
74 //--------------------------------------------------------------------------
75
76 //==========================================================================
77 ///
78 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
79 /// @brief Destructor.
80 ///
81 ~CFadeLabel() override = default;
82 //--------------------------------------------------------------------------
83
84 //==========================================================================
85 ///
86 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
87 /// @brief Set the control on window to visible.
88 ///
89 /// @param[in] visible If true visible, otherwise hidden
90 ///
91 void SetVisible(bool visible)
92 {
93 m_interface->kodi_gui->control_fade_label->set_visible(m_interface->kodiBase, m_controlHandle, visible);
94 }
95 //--------------------------------------------------------------------------
96
97 //==========================================================================
98 ///
99 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
100 /// @brief To add additional text string on fade label.
101 ///
102 /// @param[in] label Text to show
103 ///
104 void AddLabel(const std::string& label)
105 {
106 m_interface->kodi_gui->control_fade_label->add_label(m_interface->kodiBase, m_controlHandle, label.c_str());
107 }
108 //--------------------------------------------------------------------------
109
110 //==========================================================================
111 ///
112 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
113 /// @brief Get the used text from button
114 ///
115 /// @return Text shown
116 ///
117 std::string GetLabel() const
118 {
119 std::string label;
120 char* ret = m_interface->kodi_gui->control_fade_label->get_label(m_interface->kodiBase, m_controlHandle);
121 if (ret != nullptr)
122 {
123 if (std::strlen(ret))
124 label = ret;
125 m_interface->free_string(m_interface->kodiBase, ret);
126 }
127 return label;
128 }
129 //--------------------------------------------------------------------------
130
131 //==========================================================================
132 ///
133 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
134 /// @brief To enable or disable scrolling on fade label
135 ///
136 /// @param[in] scroll To enable scrolling set to true, otherwise is
137 /// disabled
138 ///
139 void SetScrolling(bool scroll)
140 {
141 m_interface->kodi_gui->control_fade_label->set_scrolling(m_interface->kodiBase, m_controlHandle, scroll);
142 }
143 //--------------------------------------------------------------------------
144
145 //==========================================================================
146 ///
147 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
148 /// @brief To reset al inserted labels.
149 ///
150 void Reset()
151 {
152 m_interface->kodi_gui->control_fade_label->reset(m_interface->kodiBase, m_controlHandle);
153 }
154 //--------------------------------------------------------------------------
155 };
156
157} /* namespace controls */
158} /* namespace gui */
159} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h
new file mode 100644
index 0000000..1179fab
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h
@@ -0,0 +1,123 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CImage Control Image
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CImage }
37 /// **Window control used to show an image.**
38 ///
39 /// The image control is used for displaying images in Kodi. You can choose
40 /// the position, size, transparency and contents of the image to be displayed.
41 ///
42 /// It has the header \ref Image.h "#include <kodi/gui/controls/Image.h>"
43 /// be included to enjoy it.
44 ///
45 /// Here you find the needed skin part for a \ref Image_Control "image control"
46 ///
47 /// @note The call of the control is only possible from the corresponding
48 /// window as its class and identification number is required.
49 ///
50 class CImage : public CAddonGUIControlBase
51 {
52 public:
53 //==========================================================================
54 ///
55 /// \ingroup cpp_kodi_gui_controls_CImage
56 /// @brief Construct a new control
57 ///
58 /// @param[in] window related window control class
59 /// @param[in] controlId Used skin xml control id
60 ///
61 CImage(CWindow* window, int controlId)
62 : CAddonGUIControlBase(window)
63 {
64 m_controlHandle = m_interface->kodi_gui->window->get_control_image(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
65 if (!m_controlHandle)
66 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CImage can't create control class from Kodi !!!");
67 }
68 //--------------------------------------------------------------------------
69
70 //==========================================================================
71 ///
72 /// \ingroup cpp_kodi_gui_controls_CImage
73 /// @brief Destructor
74 ///
75 ~CImage() override = default;
76 //--------------------------------------------------------------------------
77
78 //==========================================================================
79 ///
80 /// \ingroup cpp_kodi_gui_controls_CImage
81 /// @brief Set the control on window to visible
82 ///
83 /// @param[in] visible If true visible, otherwise hidden
84 ///
85 void SetVisible(bool visible)
86 {
87 m_interface->kodi_gui->control_image->set_visible(m_interface->kodiBase, m_controlHandle, visible);
88 }
89 //--------------------------------------------------------------------------
90
91 //==========================================================================
92 ///
93 /// \ingroup cpp_kodi_gui_controls_CImage
94 /// @brief To set the filename used on image control.
95 ///
96 /// @param[in] filename Image file to use
97 /// @param[in] useCache To define storage of image, default is
98 /// in cache, if false becomes it loaded
99 /// always on changes again
100 ///
101 void SetFileName(const std::string& filename, bool useCache = true)
102 {
103 m_interface->kodi_gui->control_image->set_filename(m_interface->kodiBase, m_controlHandle, filename.c_str(), useCache);
104 }
105 //--------------------------------------------------------------------------
106
107 //==========================================================================
108 ///
109 /// \ingroup cpp_kodi_gui_controls_CImage
110 /// @brief To set set the diffuse color on image.
111 ///
112 /// @param[in] colorDiffuse Color to use for diffuse
113 ///
114 void SetColorDiffuse(uint32_t colorDiffuse)
115 {
116 m_interface->kodi_gui->control_image->set_color_diffuse(m_interface->kodiBase, m_controlHandle, colorDiffuse);
117 }
118 //--------------------------------------------------------------------------
119 };
120
121} /* namespace controls */
122} /* namespace gui */
123} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Label.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Label.h
new file mode 100644
index 0000000..f74ac03
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Label.h
@@ -0,0 +1,128 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CLabel Control Label
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CLabel }
37 /// **Window control used to show some lines of text.**
38 ///
39 /// The label control is used for displaying text in Kodi. You can choose
40 /// the font, size, colour, location and contents of the text to be displayed.
41 ///
42 /// It has the header \ref Label.h "#include <kodi/gui/controls/Label.h>"
43 /// be included to enjoy it.
44 ///
45 /// Here you find the needed skin part for a \ref Label_Control "label control"
46 ///
47 /// @note The call of the control is only possible from the corresponding
48 /// window as its class and identification number is required.
49 ///
50 class CLabel : public CAddonGUIControlBase
51 {
52 public:
53 //==========================================================================
54 ///
55 /// \ingroup cpp_kodi_gui_controls_CLabel
56 /// @brief Construct a new control
57 ///
58 /// @param[in] window related window control class
59 /// @param[in] controlId Used skin xml control id
60 ///
61 CLabel(CWindow* window, int controlId)
62 : CAddonGUIControlBase(window)
63 {
64 m_controlHandle = m_interface->kodi_gui->window->get_control_label(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
65 if (!m_controlHandle)
66 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CLabel can't create control class from Kodi !!!");
67 }
68 //--------------------------------------------------------------------------
69
70 //==========================================================================
71 ///
72 /// \ingroup cpp_kodi_gui_controls_CLabel
73 /// @brief Destructor
74 ///
75 ~CLabel() override = default;
76 //--------------------------------------------------------------------------
77
78 //==========================================================================
79 ///
80 /// \ingroup cpp_kodi_gui_controls_CLabel
81 /// @brief Set the control on window to visible
82 ///
83 /// @param[in] visible If true visible, otherwise hidden
84 ///
85 void SetVisible(bool visible)
86 {
87 m_interface->kodi_gui->control_label->set_visible(m_interface->kodiBase, m_controlHandle, visible);
88 }
89 //--------------------------------------------------------------------------
90
91 //==========================================================================
92 ///
93 /// \ingroup cpp_kodi_gui_controls_CLabel
94 /// @brief To set the text string on label
95 ///
96 /// @param[in] text Text to show
97 ///
98 void SetLabel(const std::string& text)
99 {
100 m_interface->kodi_gui->control_label->set_label(m_interface->kodiBase, m_controlHandle, text.c_str());
101 }
102 //--------------------------------------------------------------------------
103
104 //==========================================================================
105 ///
106 /// \ingroup cpp_kodi_gui_controls_CLabel
107 /// @brief Get the used text from control
108 ///
109 /// @return Used text on label control
110 ///
111 std::string GetLabel() const
112 {
113 std::string label;
114 char* ret = m_interface->kodi_gui->control_label->get_label(m_interface->kodiBase, m_controlHandle);
115 if (ret != nullptr)
116 {
117 if (std::strlen(ret))
118 label = ret;
119 m_interface->free_string(m_interface->kodiBase, ret);
120 }
121 return label;
122 }
123 //--------------------------------------------------------------------------
124 };
125
126} /* namespace controls */
127} /* namespace gui */
128} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Progress.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Progress.h
new file mode 100644
index 0000000..44310ed
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Progress.h
@@ -0,0 +1,121 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CProgress Control Progress
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CProgress }
37 /// **Window control to show the progress of a particular operation**
38 ///
39 /// The progress control is used to show the progress of an item that may take
40 /// a long time, or to show how far through a movie you are. You can choose
41 /// the position, size, and look of the progress control.
42 ///
43 /// It has the header \ref Progress.h "#include <kodi/gui/controls/Progress.h>"
44 /// be included to enjoy it.
45 ///
46 /// Here you find the needed skin part for a \ref Progress_Control "progress control"
47 ///
48 /// @note The call of the control is only possible from the corresponding
49 /// window as its class and identification number is required.
50 ///
51 class CProgress : public CAddonGUIControlBase
52 {
53 public:
54 //==========================================================================
55 ///
56 /// \ingroup cpp_kodi_gui_controls_CProgress
57 /// @brief Construct a new control
58 ///
59 /// @param[in] window related window control class
60 /// @param[in] controlId Used skin xml control id
61 ///
62 CProgress(CWindow* window, int controlId)
63 : CAddonGUIControlBase(window)
64 {
65 m_controlHandle = m_interface->kodi_gui->window->get_control_progress(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
66 if (!m_controlHandle)
67 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CProgress can't create control class from Kodi !!!");
68 }
69 //--------------------------------------------------------------------------
70
71 //==========================================================================
72 ///
73 /// \ingroup cpp_kodi_gui_controls_CProgress
74 /// @brief Destructor
75 ///
76 ~CProgress() override = default;
77 //--------------------------------------------------------------------------
78
79 //==========================================================================
80 ///
81 /// \ingroup cpp_kodi_gui_controls_CProgress
82 /// @brief Set the control on window to visible
83 ///
84 /// @param[in] visible If true visible, otherwise hidden
85 ///
86 void SetVisible(bool visible)
87 {
88 m_interface->kodi_gui->control_progress->set_visible(m_interface->kodiBase, m_controlHandle, visible);
89 }
90 //--------------------------------------------------------------------------
91
92 //==========================================================================
93 ///
94 /// \ingroup cpp_kodi_gui_controls_CProgress
95 /// @brief To set Percent position of control
96 ///
97 /// @param[in] percent The percent position to use
98 ///
99 void SetPercentage(float percent)
100 {
101 m_interface->kodi_gui->control_progress->set_percentage(m_interface->kodiBase, m_controlHandle, percent);
102 }
103 //--------------------------------------------------------------------------
104
105 //==========================================================================
106 ///
107 /// \ingroup cpp_kodi_gui_controls_CProgress
108 /// @brief Get the active percent position of progress bar
109 ///
110 /// @return Progress position as percent
111 ///
112 float GetPercentage() const
113 {
114 return m_interface->kodi_gui->control_progress->get_percentage(m_interface->kodiBase, m_controlHandle);
115 }
116 //--------------------------------------------------------------------------
117 };
118
119} /* namespace controls */
120} /* namespace gui */
121} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/RadioButton.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/RadioButton.h
new file mode 100644
index 0000000..b87920d
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/RadioButton.h
@@ -0,0 +1,171 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CRadioButton Control Radio Button
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CRadioButton }
37 /// **Window control for a radio button (as used for on/off settings)**
38 ///
39 /// The radio button control is used for creating push button on/off settings
40 /// in Kodi. You can choose the position, size, and look of the button. When
41 /// the user clicks on the radio button, the state will change, toggling the
42 /// extra textures (textureradioon and textureradiooff). Used for settings
43 /// controls.
44 ///
45 /// It has the header \ref RadioButton.h "#include <kodi/gui/controls/RadioButton.h>"
46 /// be included to enjoy it.
47 ///
48 /// Here you find the needed skin part for a \ref Radio_button_control "radio button control"
49 ///
50 /// @note The call of the control is only possible from the corresponding
51 /// window as its class and identification number is required.
52 ///
53 class CRadioButton : public CAddonGUIControlBase
54 {
55 public:
56 //==========================================================================
57 ///
58 /// \ingroup cpp_kodi_gui_controls_CRadioButton
59 /// @brief Construct a new control
60 ///
61 /// @param[in] window related window control class
62 /// @param[in] controlId Used skin xml control id
63 ///
64 CRadioButton(CWindow* window, int controlId)
65 : CAddonGUIControlBase(window)
66 {
67 m_controlHandle = m_interface->kodi_gui->window->get_control_radio_button(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
68 if (!m_controlHandle)
69 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CRadioButton can't create control class from Kodi !!!");
70 }
71 //--------------------------------------------------------------------------
72
73 //==========================================================================
74 ///
75 /// \ingroup cpp_kodi_gui_controls_CRadioButton
76 /// @brief Destructor
77 ///
78 ~CRadioButton() override = default;
79 //--------------------------------------------------------------------------
80
81 //==========================================================================
82 ///
83 /// \ingroup cpp_kodi_gui_controls_CRadioButton
84 /// @brief Set the control on window to visible
85 ///
86 /// @param[in] visible If true visible, otherwise hidden
87 ///
88 void SetVisible(bool visible)
89 {
90 m_interface->kodi_gui->control_radio_button->set_visible(m_interface->kodiBase, m_controlHandle, visible);
91 }
92 //--------------------------------------------------------------------------
93
94 //==========================================================================
95 ///
96 /// \ingroup cpp_kodi_gui_controls_CRadioButton
97 /// @brief Set's the control's enabled/disabled state
98 ///
99 /// @param[in] enabled If true enabled, otherwise disabled
100 ///
101 void SetEnabled(bool enabled)
102 {
103 m_interface->kodi_gui->control_radio_button->set_enabled(m_interface->kodiBase, m_controlHandle, enabled);
104 }
105 //--------------------------------------------------------------------------
106
107 //==========================================================================
108 ///
109 /// \ingroup cpp_kodi_gui_controls_CRadioButton
110 /// @brief To set the text string on radio button
111 ///
112 /// @param[in] label Text to show
113 ///
114 void SetLabel(const std::string& label)
115 {
116 m_interface->kodi_gui->control_radio_button->set_label(m_interface->kodiBase, m_controlHandle, label.c_str());
117 }
118 //--------------------------------------------------------------------------
119
120 //==========================================================================
121 ///
122 /// \ingroup cpp_kodi_gui_controls_CRadioButton
123 /// @brief Get the used text from control
124 ///
125 /// @return Text shown
126 ///
127 std::string GetLabel() const
128 {
129 std::string label;
130 char* ret = m_interface->kodi_gui->control_radio_button->get_label(m_interface->kodiBase, m_controlHandle);
131 if (ret != nullptr)
132 {
133 if (std::strlen(ret))
134 label = ret;
135 m_interface->free_string(m_interface->kodiBase, ret);
136 }
137 return label;
138 }
139 //--------------------------------------------------------------------------
140
141 //==========================================================================
142 ///
143 /// \ingroup cpp_kodi_gui_controls_CRadioButton
144 /// @brief To set radio button condition to on or off
145 ///
146 /// @param[in] selected true set radio button to selection on, otherwise
147 /// off
148 ///
149 void SetSelected(bool selected)
150 {
151 m_interface->kodi_gui->control_radio_button->set_selected(m_interface->kodiBase, m_controlHandle, selected);
152 }
153 //--------------------------------------------------------------------------
154
155 //==========================================================================
156 ///
157 /// \ingroup cpp_kodi_gui_controls_CRadioButton
158 /// @brief Get the current selected condition of radio button
159 ///
160 /// @return Selected condition
161 ///
162 bool IsSelected() const
163 {
164 return m_interface->kodi_gui->control_radio_button->is_selected(m_interface->kodiBase, m_controlHandle);
165 }
166 //--------------------------------------------------------------------------
167 };
168
169} /* namespace controls */
170} /* namespace gui */
171} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Rendering.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Rendering.h
new file mode 100644
index 0000000..f80fcfa
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Rendering.h
@@ -0,0 +1,215 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CRendering Control Rendering
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CRendering }
37 /// **Window control for rendering own parts**
38 ///
39 /// This rendering control is used when own parts are needed. You have the
40 /// control over them to render direct OpenGL or DirectX content to the
41 /// screen set by the size of them.
42 ///
43 /// Alternative can be the virtual functions from t his been ignored if the
44 /// callbacks are defined by the \ref CRendering_SetIndependentCallbacks function and
45 /// class is used as single and not as a parent class.
46 ///
47 /// It has the header \ref Rendering.h "#include <kodi/gui/controls/Rendering.h>"
48 /// be included to enjoy it.
49 ///
50 /// Here you find the needed skin part for a \ref Addon_Rendering_control "rendering control"
51 ///
52 /// @note The call of the control is only possible from the corresponding
53 /// window as its class and identification number is required.
54 ///
55
56 //============================================================================
57 ///
58 /// \defgroup cpp_kodi_gui_controls_CRendering_Defs Definitions, structures and enumerators
59 /// \ingroup cpp_kodi_gui_controls_CRendering
60 /// @brief **Library definition values**
61 ///
62
63 class CRendering : public CAddonGUIControlBase
64 {
65 public:
66 //==========================================================================
67 ///
68 /// \ingroup cpp_kodi_gui_controls_CRendering
69 /// @brief Construct a new control
70 ///
71 /// @param[in] window related window control class
72 /// @param[in] controlId Used skin xml control id
73 ///
74 CRendering(CWindow* window, int controlId)
75 : CAddonGUIControlBase(window)
76 {
77 m_controlHandle = m_interface->kodi_gui->window->get_control_render_addon(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
78 if (m_controlHandle)
79 m_interface->kodi_gui->control_rendering->set_callbacks(m_interface->kodiBase, m_controlHandle, this,
80 OnCreateCB, OnRenderCB, OnStopCB, OnDirtyCB);
81 else
82 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::%s can't create control class from Kodi !!!", __FUNCTION__);
83 }
84 //--------------------------------------------------------------------------
85
86 //==========================================================================
87 ///
88 /// \ingroup cpp_kodi_gui_controls_CRendering
89 /// @brief Destructor
90 ///
91 ~CRendering() override
92 {
93 m_interface->kodi_gui->control_rendering->destroy(m_interface->kodiBase, m_controlHandle);
94 }
95 //--------------------------------------------------------------------------
96
97 //==========================================================================
98 ///
99 /// \ingroup cpp_kodi_gui_controls_CRendering
100 /// @brief To create rendering control on Add-on
101 ///
102 /// Function creates the needed rendering control for Kodi which becomes
103 /// handled and processed from Add-on
104 ///
105 /// @note This is callback function from Kodi to Add-on and not to use
106 /// for calls from add-on to this function.
107 ///
108 /// @param[in] x Horizontal position
109 /// @param[in] y Vertical position
110 /// @param[in] w Width of control
111 /// @param[in] h Height of control
112 /// @param[in] device The device to use. For OpenGL is empty
113 /// on Direct X is the needed device send.
114 /// @return Add-on needs to return true if successed,
115 /// otherwise false.
116 ///
117 virtual bool Create(int x, int y, int w, int h, void* device) { return false; }
118 //--------------------------------------------------------------------------
119
120 //==========================================================================
121 ///
122 /// \ingroup cpp_kodi_gui_controls_CRendering
123 /// @brief Render process call from Kodi
124 ///
125 /// @note This is callback function from Kodi to Add-on and not to use
126 /// for calls from add-on to this function.
127 ///
128 virtual void Render() { }
129 //--------------------------------------------------------------------------
130
131 //==========================================================================
132 ///
133 /// \ingroup cpp_kodi_gui_controls_CRendering
134 /// @brief Call from Kodi to stop rendering process
135 ///
136 /// @note This is callback function from Kodi to Add-on and not to use
137 /// for calls from add-on to this function.
138 ///
139 virtual void Stop() { }
140 //--------------------------------------------------------------------------
141
142 //==========================================================================
143 ///
144 /// \ingroup cpp_kodi_gui_controls_CRendering
145 /// @brief Call from Kodi where add-on becomes asked about dirty rendering
146 /// region.
147 ///
148 /// @note This is callback function from Kodi to Add-on and not to use
149 /// for calls from add-on to this function.
150 ///
151 virtual bool Dirty() { return false; }
152 //--------------------------------------------------------------------------
153
154 //==========================================================================
155 ///
156 /// \ingroup cpp_kodi_gui_controls_CRendering
157 /// \anchor CRendering_SetIndependentCallbacks
158 /// @brief If the class is used independent (with "new CRendering")
159 /// and not as parent (with "cCLASS_own : CRendering") from own must
160 /// be the callback from Kodi to add-on overdriven with own functions!
161 ///
162 void SetIndependentCallbacks(
163 GUIHANDLE cbhdl,
164 bool (*CBCreate)(GUIHANDLE cbhdl,
165 int x,
166 int y,
167 int w,
168 int h,
169 void* device),
170 void (*CBRender)(GUIHANDLE cbhdl),
171 void (*CBStop) (GUIHANDLE cbhdl),
172 bool (*CBDirty) (GUIHANDLE cbhdl))
173 {
174 if (!cbhdl ||
175 !CBCreate || !CBRender || !CBStop || !CBDirty)
176 {
177 kodi::Log(ADDON_LOG_ERROR, "kodi::gui::controls::%s called with nullptr !!!", __FUNCTION__);
178 return;
179 }
180
181 m_interface->kodi_gui->control_rendering->set_callbacks(m_interface->kodiBase, m_controlHandle, cbhdl,
182 CBCreate, CBRender, CBStop, CBDirty);
183 }
184 //--------------------------------------------------------------------------
185
186 private:
187 /*
188 * Defined callback functions from Kodi to add-on, for use in parent / child system
189 * (is private)!
190 */
191 static bool OnCreateCB(void* cbhdl, int x, int y, int w, int h, void* device)
192 {
193 return static_cast<CRendering*>(cbhdl)->Create(x, y, w, h, device);
194 }
195
196 static void OnRenderCB(void* cbhdl)
197 {
198 static_cast<CRendering*>(cbhdl)->Render();
199 }
200
201 static void OnStopCB(void* cbhdl)
202 {
203 static_cast<CRendering*>(cbhdl)->Stop();
204 }
205
206 static bool OnDirtyCB(void* cbhdl)
207 {
208 return static_cast<CRendering*>(cbhdl)->Dirty();
209 }
210
211 };
212
213} /* namespace controls */
214} /* namespace gui */
215} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/SettingsSlider.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/SettingsSlider.h
new file mode 100644
index 0000000..e51433a
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/SettingsSlider.h
@@ -0,0 +1,323 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CSettingsSlider Control Settings Slider
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CSettingsSlider }
37 /// **Window control for moveable slider with text name**
38 ///
39 /// The settings slider control is used in the settings screens for when an
40 /// option is best specified on a sliding scale. You can choose the position,
41 /// size, and look of the slider control. It is basically a cross between the
42 /// button control and a slider control. It has a label and focus and non
43 /// focus textures, as well as a slider control on the right.
44 ///
45 /// It has the header \ref SettingsSlider.h "#include <kodi/gui/controls/SettingsSlider.h>"
46 /// be included to enjoy it.
47 ///
48 /// Here you find the needed skin part for a \ref Settings_Slider_Control "settings slider control"
49 ///
50 /// @note The call of the control is only possible from the corresponding
51 /// window as its class and identification number is required.
52 ///
53 class CSettingsSlider : public CAddonGUIControlBase
54 {
55 public:
56 //==========================================================================
57 ///
58 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
59 /// @brief Construct a new control
60 ///
61 /// @param[in] window related window control class
62 /// @param[in] controlId Used skin xml control id
63 ///
64 CSettingsSlider(CWindow* window, int controlId)
65 : CAddonGUIControlBase(window)
66 {
67 m_controlHandle = m_interface->kodi_gui->window->get_control_settings_slider(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
68 if (!m_controlHandle)
69 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CSettingsSlider can't create control class from Kodi !!!");
70 }
71 //--------------------------------------------------------------------------
72
73 //==========================================================================
74 ///
75 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
76 /// @brief Destructor
77 ///
78 ~CSettingsSlider() override = default;
79 //--------------------------------------------------------------------------
80
81 //==========================================================================
82 ///
83 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
84 /// @brief Set the control on window to visible
85 ///
86 /// @param[in] visible If true visible, otherwise hidden
87 ///
88 void SetVisible(bool visible)
89 {
90 m_interface->kodi_gui->control_settings_slider->set_visible(m_interface->kodiBase, m_controlHandle, visible);
91 }
92 //--------------------------------------------------------------------------
93
94 //==========================================================================
95 ///
96 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
97 /// @brief Set's the control's enabled/disabled state
98 ///
99 /// @param[in] enabled If true enabled, otherwise disabled
100 ///
101 void SetEnabled(bool enabled)
102 {
103 m_interface->kodi_gui->control_settings_slider->set_enabled(m_interface->kodiBase, m_controlHandle, enabled);
104 }
105 //--------------------------------------------------------------------------
106
107 //==========================================================================
108 ///
109 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
110 /// @brief To set the text string on settings slider
111 ///
112 /// @param[in] text Text to show
113 ///
114 void SetText(const std::string& text)
115 {
116 m_interface->kodi_gui->control_settings_slider->set_text(m_interface->kodiBase, m_controlHandle, text.c_str());
117 }
118 //--------------------------------------------------------------------------
119
120 //==========================================================================
121 ///
122 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
123 /// @brief To reset slider on defaults
124 ///
125 void Reset()
126 {
127 m_interface->kodi_gui->control_settings_slider->reset(m_interface->kodiBase, m_controlHandle);
128 }
129 //--------------------------------------------------------------------------
130
131 //==========================================================================
132 ///
133 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
134 /// @brief To set the the range as integer of slider, e.g. -10 is the slider
135 /// start and e.g. +10 is the from here defined position where it reach the
136 /// end.
137 ///
138 /// Ad default is the range from 0 to 100.
139 ///
140 /// The integer interval is as default 1 and can be changed with
141 /// @ref SetIntInterval.
142 ///
143 /// @param[in] start Integer start value
144 /// @param[in] end Integer end value
145 ///
146 /// @note Percent, floating point or integer are alone possible. Combining
147 /// these different values can be not together and can, therefore, only
148 /// one each can be used.
149 ///
150 void SetIntRange(int start, int end)
151 {
152 m_interface->kodi_gui->control_settings_slider->set_int_range(m_interface->kodiBase, m_controlHandle, start, end);
153 }
154 //--------------------------------------------------------------------------
155
156 //==========================================================================
157 ///
158 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
159 /// @brief Set the slider position with the given integer value. The Range
160 /// must be defined with a call from \ref SetIntRange before.
161 ///
162 /// @param[in] value Position in range to set with integer
163 ///
164 /// @note Percent, floating point or integer are alone possible. Combining
165 /// these different values ​​can be not together and can, therefore, only
166 /// one each can be used.
167 ///
168 void SetIntValue(int value)
169 {
170 m_interface->kodi_gui->control_settings_slider->set_int_value(m_interface->kodiBase, m_controlHandle, value);
171 }
172 //--------------------------------------------------------------------------
173
174 //==========================================================================
175 ///
176 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
177 /// @brief To get the current position as integer value.
178 ///
179 /// @return The position as integer
180 ///
181 /// @note Percent, floating point or integer are alone possible. Combining
182 /// these different values ​​can be not together and can, therefore, only
183 /// one each can be used.
184 ///
185 int GetIntValue() const
186 {
187 return m_interface->kodi_gui->control_settings_slider->get_int_value(m_interface->kodiBase, m_controlHandle);
188 }
189 //--------------------------------------------------------------------------
190
191 //==========================================================================
192 ///
193 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
194 /// @brief To set the interval steps of slider, as default is it 1. If it
195 /// becomes changed with this function will a step of the user with the
196 /// value fixed here be executed.
197 ///
198 /// @param[in] interval Intervall step to set.
199 ///
200 /// @note Percent, floating point or integer are alone possible. Combining
201 /// these different values ​​can be not together and can, therefore, only
202 /// one each can be used.
203 ///
204 void SetIntInterval(int interval)
205 {
206 m_interface->kodi_gui->control_settings_slider->set_int_interval(m_interface->kodiBase, m_controlHandle, interval);
207 }
208 //--------------------------------------------------------------------------
209
210 //==========================================================================
211 ///
212 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
213 /// @brief Sets the percent of the slider.
214 ///
215 /// @param[in] percent float - Percent value of slide
216 ///
217 /// @note Percent, floating point or integer are alone possible. Combining
218 /// these different values ​​can be not together and can, therefore, only
219 /// one each can be used.
220 ///
221 void SetPercentage(float percent)
222 {
223 m_interface->kodi_gui->control_settings_slider->set_percentage(m_interface->kodiBase, m_controlHandle, percent);
224 }
225 //--------------------------------------------------------------------------
226
227 //==========================================================================
228 ///
229 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
230 /// @brief Returns a float of the percent of the slider.
231 ///
232 /// @return float - Percent of slider
233 ///
234 /// @note Percent, floating point or integer are alone possible. Combining
235 /// these different values ​​can be not together and can, therefore, only
236 /// one each can be used.
237 ///
238 float GetPercentage() const
239 {
240 return m_interface->kodi_gui->control_settings_slider->get_percentage(m_interface->kodiBase, m_controlHandle);
241 }
242 //--------------------------------------------------------------------------
243
244 //==========================================================================
245 ///
246 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
247 /// @brief To set the the range as float of slider, e.g. -25.0 is the slider
248 /// start and e.g. +25.0 is the from here defined position where it reach
249 /// the end.
250 ///
251 /// As default is the range 0.0 to 1.0.
252 ///
253 /// The float interval is as default 0.1 and can be changed with
254 /// @ref SetFloatInterval.
255 ///
256 /// @param[in] start Integer start value
257 /// @param[in] end Integer end value
258 ///
259 /// @note Percent, floating point or integer are alone possible. Combining
260 /// these different values ​​ can be not together and can, therefore, only
261 /// one each can be used.
262 ///
263 void SetFloatRange(float start, float end)
264 {
265 m_interface->kodi_gui->control_settings_slider->set_float_range(m_interface->kodiBase, m_controlHandle, start, end);
266 }
267 //--------------------------------------------------------------------------
268
269 //==========================================================================
270 ///
271 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
272 /// @brief Set the slider position with the given float value. The Range
273 /// can be defined with a call from \ref SetIntRange before, as default it
274 /// is 0.0 to 1.0.
275 ///
276 /// @param[in] value Position in range to set with float
277 ///
278 /// @note Percent, floating point or integer are alone possible. Combining
279 /// these different values ​​can be not together and can, therefore, only
280 /// one each can be used.
281 ///
282 void SetFloatValue(float value)
283 {
284 m_interface->kodi_gui->control_settings_slider->set_float_value(m_interface->kodiBase, m_controlHandle, value);
285 }
286 //--------------------------------------------------------------------------
287
288 //==========================================================================
289 ///
290 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
291 /// @brief To get the current position as float value.
292 ///
293 /// @return The position as float
294 ///
295 float GetFloatValue() const
296 {
297 return m_interface->kodi_gui->control_settings_slider->get_float_value(m_interface->kodiBase, m_controlHandle);
298 }
299 //--------------------------------------------------------------------------
300
301 //==========================================================================
302 ///
303 /// \ingroup cpp_kodi_gui_controls_CSettingsSlider
304 /// @brief To set the interval steps of slider, as default is it 0.1 If it
305 /// becomes changed with this function will a step of the user with the
306 /// value fixed here be executed.
307 ///
308 /// @param[in] interval Intervall step to set.
309 ///
310 /// @note Percent, floating point or integer are alone possible. Combining
311 /// these different values ​​can be not together and can, therefore, only
312 /// one each can be used.
313 ///
314 void SetFloatInterval(float interval)
315 {
316 m_interface->kodi_gui->control_settings_slider->set_float_interval(m_interface->kodiBase, m_controlHandle, interval);
317 }
318 //--------------------------------------------------------------------------
319 };
320
321} /* namespace controls */
322} /* namespace gui */
323} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Slider.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Slider.h
new file mode 100644
index 0000000..cbb9b8f
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Slider.h
@@ -0,0 +1,336 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CSlider Control Slider
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CSlider }
37 /// **Window control for moveable slider**
38 ///
39 /// The slider control is used for things where a sliding bar best represents
40 /// the operation at hand (such as a volume control or seek control). You can
41 /// choose the position, size, and look of the slider control.
42 ///
43 /// It has the header \ref Slider.h "#include <kodi/gui/controls/Slider.h>"
44 /// be included to enjoy it.
45 ///
46 /// Here you find the needed skin part for a \ref Slider_Control "slider control"
47 ///
48 /// @note The call of the control is only possible from the corresponding
49 /// window as its class and identification number is required.
50 ///
51 class CSlider : public CAddonGUIControlBase
52 {
53 public:
54 //==========================================================================
55 ///
56 /// \ingroup cpp_kodi_gui_controls_CSlider
57 /// @brief Construct a new control
58 ///
59 /// @param[in] window related window control class
60 /// @param[in] controlId Used skin xml control id
61 ///
62 CSlider(CWindow* window, int controlId)
63 : CAddonGUIControlBase(window)
64 {
65 m_controlHandle = m_interface->kodi_gui->window->get_control_slider(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
66 if (!m_controlHandle)
67 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CSlider can't create control class from Kodi !!!");
68 }
69 //--------------------------------------------------------------------------
70
71 //==========================================================================
72 ///
73 /// \ingroup cpp_kodi_gui_controls_CSlider
74 /// @brief Destructor
75 ///
76 ~CSlider() override = default;
77 //--------------------------------------------------------------------------
78
79 //==========================================================================
80 ///
81 /// \ingroup cpp_kodi_gui_controls_CSlider
82 /// @brief Set the control on window to visible
83 ///
84 /// @param[in] visible If true visible, otherwise hidden
85 ///
86 void SetVisible(bool visible)
87 {
88 m_interface->kodi_gui->control_slider->set_visible(m_interface->kodiBase, m_controlHandle, visible);
89 }
90 //--------------------------------------------------------------------------
91
92 //==========================================================================
93 ///
94 /// \ingroup cpp_kodi_gui_controls_CSlider
95 /// @brief Set's the control's enabled/disabled state
96 ///
97 /// @param[in] enabled If true enabled, otherwise disabled
98 ///
99 void SetEnabled(bool enabled)
100 {
101 m_interface->kodi_gui->control_slider->set_enabled(m_interface->kodiBase, m_controlHandle, enabled);
102 }
103 //--------------------------------------------------------------------------
104
105 //==========================================================================
106 ///
107 /// \ingroup cpp_kodi_gui_controls_CSlider
108 /// @brief To reset slider on defaults
109 ///
110 void Reset()
111 {
112 m_interface->kodi_gui->control_slider->reset(m_interface->kodiBase, m_controlHandle);
113 }
114 //--------------------------------------------------------------------------
115
116 //==========================================================================
117 ///
118 /// \ingroup cpp_kodi_gui_controls_CSlider
119 /// @brief With GetDescription becomes a string value of position returned.
120 ///
121 /// @return Text string about current slider position
122 ///
123 /// The following are the text definition returned from this:
124 /// | Value | Without range selection | With range selection |
125 /// |:---------:|:------------------------|:-------------------------------|
126 /// | float | <c>%2.2f</c> | <c>[%2.2f, %2.2f]</c> |
127 /// | integer | <c>%i</c> | <c>[%i, %i]</c> |
128 /// | percent | <c>%i%%</c> | <c>[%i%%, %i%%]</c> |
129 ///
130 std::string GetDescription() const
131 {
132 std::string text;
133 char* ret = m_interface->kodi_gui->control_slider->get_description(m_interface->kodiBase, m_controlHandle);
134 if (ret != nullptr)
135 {
136 if (std::strlen(ret))
137 text = ret;
138 m_interface->free_string(m_interface->kodiBase, ret);
139 }
140 return text;
141 }
142 //--------------------------------------------------------------------------
143
144 //==========================================================================
145 ///
146 /// \ingroup cpp_kodi_gui_controls_CSlider
147 /// @brief To set the the range as integer of slider, e.g. -10 is the slider
148 /// start and e.g. +10 is the from here defined position where it reach the
149 /// end.
150 ///
151 /// Ad default is the range from 0 to 100.
152 ///
153 /// The integer interval is as default 1 and can be changed with
154 /// @ref SetIntInterval.
155 ///
156 /// @param[in] start Integer start value
157 /// @param[in] end Integer end value
158 ///
159 /// @note Percent, floating point or integer are alone possible. Combining
160 /// these different values can be not together and can, therefore, only one
161 /// each can be used.
162 ///
163 void SetIntRange(int start, int end)
164 {
165 m_interface->kodi_gui->control_slider->set_int_range(m_interface->kodiBase, m_controlHandle, start, end);
166 }
167 //--------------------------------------------------------------------------
168
169 //==========================================================================
170 ///
171 /// \ingroup CSlider
172 /// @brief Set the slider position with the given integer value. The Range
173 /// must be defined with a call from \ref SetIntRange before.
174 ///
175 /// @param[in] value Position in range to set with integer
176 ///
177 /// @note Percent, floating point or integer are alone possible. Combining
178 /// these different values can be not together and can, therefore, only one
179 /// each can be used.
180 ///
181 void SetIntValue(int value)
182 {
183 m_interface->kodi_gui->control_slider->set_int_value(m_interface->kodiBase, m_controlHandle, value);
184 }
185 //--------------------------------------------------------------------------
186
187 //==========================================================================
188 ///
189 /// \ingroup cpp_kodi_gui_controls_CSlider
190 /// @brief To get the current position as integer value.
191 ///
192 /// @return The position as integer
193 ///
194 /// @note Percent, floating point or integer are alone possible. Combining
195 /// these different values can be not together and can, therefore, only
196 /// one each can be used.
197 ///
198 int GetIntValue() const
199 {
200 return m_interface->kodi_gui->control_slider->get_int_value(m_interface->kodiBase, m_controlHandle);
201 }
202 //--------------------------------------------------------------------------
203
204 //==========================================================================
205 ///
206 /// \ingroup cpp_kodi_gui_controls_CSlider
207 /// @brief To set the interval steps of slider, as default is it 1. If it
208 /// becomes changed with this function will a step of the user with the
209 /// value fixed here be executed.
210 ///
211 /// @param[in] interval Intervall step to set.
212 ///
213 /// @note Percent, floating point or integer are alone possible. Combining
214 /// these different values can be not together and can, therefore, only one
215 /// each can be used.
216 ///
217 void SetIntInterval(int interval)
218 {
219 m_interface->kodi_gui->control_slider->set_int_interval(m_interface->kodiBase, m_controlHandle, interval);
220 }
221 //--------------------------------------------------------------------------
222
223 //==========================================================================
224 ///
225 /// \ingroup cpp_kodi_gui_controls_CSlider
226 /// @brief Sets the percent of the slider.
227 ///
228 /// @param[in] percent float - Percent value of slide
229 ///
230 /// @note Percent, floating point or integer are alone possible. Combining
231 /// these different values can be not together and can, therefore, only one
232 /// each can be used.
233 ///
234 void SetPercentage(float percent)
235 {
236 m_interface->kodi_gui->control_slider->set_percentage(m_interface->kodiBase, m_controlHandle, percent);
237 }
238 //--------------------------------------------------------------------------
239
240 //==========================================================================
241 ///
242 /// \ingroup cpp_kodi_gui_controls_CSlider
243 /// @brief Returns a float of the percent of the slider.
244 ///
245 /// @return float - Percent of slider
246 ///
247 /// @note Percent, floating point or integer are alone possible. Combining
248 /// these different values can be not together and can, therefore, only one
249 /// each can be used.
250 ///
251 float GetPercentage() const
252 {
253 return m_interface->kodi_gui->control_slider->get_percentage(m_interface->kodiBase, m_controlHandle);
254 }
255 //--------------------------------------------------------------------------
256
257 //==========================================================================
258 ///
259 /// \ingroup cpp_kodi_gui_controls_CSlider
260 /// @brief To set the the range as float of slider, e.g. -25.0 is the slider
261 /// start and e.g. +25.0 is the from here defined position where it reach
262 /// the end.
263 ///
264 /// As default is the range 0.0 to 1.0.
265 ///
266 /// The float interval is as default 0.1 and can be changed with
267 /// @ref SetFloatInterval.
268 ///
269 /// @param[in] start Integer start value
270 /// @param[in] end Integer end value
271 ///
272 /// @note Percent, floating point or integer are alone possible. Combining
273 /// these different values can be not together and can, therefore, only
274 /// one each can be used.
275 ///
276 void SetFloatRange(float start, float end)
277 {
278 m_interface->kodi_gui->control_slider->set_float_range(m_interface->kodiBase, m_controlHandle, start, end);
279 }
280 //--------------------------------------------------------------------------
281
282 //==========================================================================
283 ///
284 /// \ingroup cpp_kodi_gui_controls_CSlider
285 /// @brief Set the slider position with the given float value. The Range
286 /// can be defined with a call from \ref SetIntRange before, as default it
287 /// is 0.0 to 1.0.
288 ///
289 /// @param[in] value Position in range to set with float
290 ///
291 /// @note Percent, floating point or integer are alone possible. Combining
292 /// these different values can be not together and can, therefore, only one
293 /// each can be used.
294 ///
295 void SetFloatValue(float value)
296 {
297 m_interface->kodi_gui->control_slider->set_float_value(m_interface->kodiBase, m_controlHandle, value);
298 }
299 //--------------------------------------------------------------------------
300
301 //==========================================================================
302 ///
303 /// \ingroup cpp_kodi_gui_controls_CSlider
304 /// @brief To get the current position as float value.
305 ///
306 /// @return The position as float
307 ///
308 float GetFloatValue() const
309 {
310 return m_interface->kodi_gui->control_slider->get_float_value(m_interface->kodiBase, m_controlHandle);
311 }
312 //--------------------------------------------------------------------------
313
314 //==========================================================================
315 ///
316 /// \ingroup cpp_kodi_gui_controls_CSlider
317 /// @brief To set the interval steps of slider, as default is it 0.1 If it
318 /// becomes changed with this function will a step of the user with the
319 /// value fixed here be executed.
320 ///
321 /// @param[in] interval Intervall step to set.
322 ///
323 /// @note Percent, floating point or integer are alone possible. Combining
324 /// these different values can be not together and can, therefore, only
325 /// one each can be used.
326 ///
327 void SetFloatInterval(float interval)
328 {
329 m_interface->kodi_gui->control_slider->set_float_interval(m_interface->kodiBase, m_controlHandle, interval);
330 }
331 //--------------------------------------------------------------------------
332 };
333
334} /* namespace controls */
335} /* namespace gui */
336} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Spin.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Spin.h
new file mode 100644
index 0000000..b39cd06
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Spin.h
@@ -0,0 +1,376 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CSpin Control Spin
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CSpin }
37 /// **Window control used for cycling up/down controls**
38 ///
39 /// The settings spin control is used in the settings screens for when a list
40 /// of options can be chosen from using up/down arrows. You can choose the
41 /// position, size, and look of the spin control. It is basically a cross
42 /// between the button control and a spin control. It has a label and focus
43 /// and non focus textures, as well as a spin control on the right.
44 ///
45 /// It has the header \ref Spin.h "#include <kodi/gui/controls/Spin.h>"
46 /// be included to enjoy it.
47 ///
48 /// Here you find the needed skin part for a \ref Spin_Control "spin control"
49 ///
50 /// @note The call of the control is only possible from the corresponding
51 /// window as its class and identification number is required.
52 ///
53
54
55 //============================================================================
56 ///
57 /// \ingroup cpp_kodi_gui_controls_CSpin
58 /// @anchor AddonGUISpinControlType
59 /// @brief The values here defines the used value format for steps on
60 /// spin control.
61 ///
62 typedef enum AddonGUISpinControlType
63 {
64 /// One spin step interpreted as integer
65 ADDON_SPIN_CONTROL_TYPE_INT = 1,
66 /// One spin step interpreted as floating point value
67 ADDON_SPIN_CONTROL_TYPE_FLOAT = 2,
68 /// One spin step interpreted as text string
69 ADDON_SPIN_CONTROL_TYPE_TEXT = 3,
70 /// One spin step interpreted as a page change value
71 ADDON_SPIN_CONTROL_TYPE_PAGE = 4
72 } AddonGUISpinControlType;
73 //----------------------------------------------------------------------------
74
75 class CSpin : public CAddonGUIControlBase
76 {
77 public:
78 //==========================================================================
79 ///
80 /// \ingroup cpp_kodi_gui_controls_CSpin
81 /// @brief Construct a new control
82 ///
83 /// @param[in] window related window control class
84 /// @param[in] controlId Used skin xml control id
85 ///
86 CSpin(CWindow* window, int controlId)
87 : CAddonGUIControlBase(window)
88 {
89 m_controlHandle = m_interface->kodi_gui->window->get_control_spin(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
90 if (!m_controlHandle)
91 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CSpin can't create control class from Kodi !!!");
92 }
93 //--------------------------------------------------------------------------
94
95 //==========================================================================
96 ///
97 /// \ingroup cpp_kodi_gui_controls_CSpin
98 /// @brief Destructor
99 ///
100 ~CSpin() override = default;
101 //--------------------------------------------------------------------------
102
103 //==========================================================================
104 ///
105 /// \ingroup cpp_kodi_gui_controls_CSpin
106 /// @brief Set the control on window to visible
107 ///
108 /// @param[in] visible If true visible, otherwise hidden
109 ///
110 void SetVisible(bool visible)
111 {
112 m_interface->kodi_gui->control_spin->set_visible(m_interface->kodiBase, m_controlHandle, visible);
113 }
114 //--------------------------------------------------------------------------
115
116 //==========================================================================
117 ///
118 /// \ingroup cpp_kodi_gui_controls_CSpin
119 /// @brief Set's the control's enabled/disabled state
120 ///
121 /// @param[in] enabled If true enabled, otherwise disabled
122 ///
123 void SetEnabled(bool enabled)
124 {
125 m_interface->kodi_gui->control_spin->set_enabled(m_interface->kodiBase, m_controlHandle, enabled);
126 }
127 //--------------------------------------------------------------------------
128
129 //==========================================================================
130 ///
131 /// \ingroup cpp_kodi_gui_controls_CSpin
132 /// @brief To set the text string on spin control
133 ///
134 /// @param[in] text Text to show as name for spin
135 ///
136 void SetText(const std::string& text)
137 {
138 m_interface->kodi_gui->control_spin->set_text(m_interface->kodiBase, m_controlHandle, text.c_str());
139 }
140 //--------------------------------------------------------------------------
141
142 //==========================================================================
143 ///
144 /// \ingroup cpp_kodi_gui_controls_CSpin
145 /// @brief To reset spin control to defaults
146 ///
147 void Reset()
148 {
149 m_interface->kodi_gui->control_spin->reset(m_interface->kodiBase, m_controlHandle);
150 }
151 //--------------------------------------------------------------------------
152
153 //==========================================================================
154 ///
155 /// \ingroup cpp_kodi_gui_controls_CSpin
156 /// @brief To set the with SpinControlType defined types of spin.
157 ///
158 /// @param[in] type The type to use
159 ///
160 /// @note See description of \ref AddonGUISpinControlType for available types.
161 ///
162 void SetType(AddonGUISpinControlType type)
163 {
164 m_interface->kodi_gui->control_spin->set_type(m_interface->kodiBase, m_controlHandle, (int)type);
165 }
166 //--------------------------------------------------------------------------
167
168 //==========================================================================
169 ///
170 /// \ingroup cpp_kodi_gui_controls_CSpin
171 /// @brief To add a label entry in spin defined with a value as string.
172 ///
173 /// Format must be set to ADDON_SPIN_CONTROL_TYPE_TEXT to use this function.
174 ///
175 /// @param[in] label Label string to view on skin
176 /// @param[in] value String value to use for selection
177 /// of them.
178 ///
179 void AddLabel(const std::string& label, const std::string& value)
180 {
181 m_interface->kodi_gui->control_spin->add_string_label(m_interface->kodiBase, m_controlHandle, label.c_str(), value.c_str());
182 }
183 //--------------------------------------------------------------------------
184
185 //==========================================================================
186 ///
187 /// \ingroup cpp_kodi_gui_controls_CSpin
188 /// @brief To add a label entry in spin defined with a value as integer.
189 ///
190 /// Format must be set to ADDON_SPIN_CONTROL_TYPE_INT to use this function.
191 ///
192 /// @param[in] label Label string to view on skin
193 /// @param[in] value Integer value to use for selection
194 /// of them.
195 ///
196 void AddLabel(const std::string& label, int value)
197 {
198 m_interface->kodi_gui->control_spin->add_int_label(m_interface->kodiBase, m_controlHandle, label.c_str(), value);
199 }
200 //--------------------------------------------------------------------------
201
202 //==========================================================================
203 ///
204 /// \ingroup cpp_kodi_gui_controls_CSpin
205 /// @brief To change the spin to position with them string as value.
206 ///
207 /// Format must be set to ADDON_SPIN_CONTROL_TYPE_TEXT to use this function.
208 ///
209 /// @param[in] value String value to change to
210 ///
211 void SetStringValue(const std::string& value)
212 {
213 m_interface->kodi_gui->control_spin->set_string_value(m_interface->kodiBase, m_controlHandle, value.c_str());
214 }
215 //--------------------------------------------------------------------------
216
217 //==========================================================================
218 ///
219 /// \ingroup cpp_kodi_gui_controls_CSpin
220 /// @brief To get the current spin control position with text string value.
221 ///
222 /// Format must be set to ADDON_SPIN_CONTROL_TYPE_TEXT to use this function.
223 ///
224 /// @return Currently selected string value
225 ///
226 std::string GetStringValue() const
227 {
228 std::string value;
229 char* ret = m_interface->kodi_gui->control_spin->get_string_value(m_interface->kodiBase, m_controlHandle);
230 if (ret != nullptr)
231 {
232 if (std::strlen(ret))
233 value = ret;
234 m_interface->free_string(m_interface->kodiBase, ret);
235 }
236 return value;
237 }
238 //--------------------------------------------------------------------------
239
240 //==========================================================================
241 ///
242 /// \ingroup cpp_kodi_gui_controls_CSpin
243 /// @brief To set the the range as integer of slider, e.g. -10 is the slider
244 /// start and e.g. +10 is the from here defined position where it reach the
245 /// end.
246 ///
247 /// Ad default is the range from 0 to 100.
248 ///
249 /// @param[in] start Integer start value
250 /// @param[in] end Integer end value
251 ///
252 /// @note Percent, floating point or integer are alone possible. Combining
253 /// these different values can be not together and can, therefore, only
254 /// one each can be used and must be defined with \ref SetType before.
255 ///
256 void SetIntRange(int start, int end)
257 {
258 m_interface->kodi_gui->control_spin->set_int_range(m_interface->kodiBase, m_controlHandle, start, end);
259 }
260 //--------------------------------------------------------------------------
261
262 //==========================================================================
263 ///
264 /// \ingroup cpp_kodi_gui_controls_CSpin
265 /// @brief Set the slider position with the given integer value. The Range
266 /// must be defined with a call from \ref SetIntRange before.
267 ///
268 /// @param[in] value Position in range to set with integer
269 ///
270 /// @note Percent, floating point or integer are alone possible. Combining
271 /// these different values can be not together and can, therefore, only
272 /// one each can be used and must be defined with \ref SetType before.
273 ///
274 void SetIntValue(int value)
275 {
276 m_interface->kodi_gui->control_spin->set_int_value(m_interface->kodiBase, m_controlHandle, value);
277 }
278 //--------------------------------------------------------------------------
279
280 //==========================================================================
281 ///
282 /// \ingroup cpp_kodi_gui_controls_CSpin
283 /// @brief To get the current position as integer value.
284 ///
285 /// @return The position as integer
286 ///
287 /// @note Percent, floating point or integer are alone possible. Combining
288 /// these different values can be not together and can, therefore, only
289 /// one each can be used and must be defined with \ref SetType before.
290 ///
291 int GetIntValue() const
292 {
293 return m_interface->kodi_gui->control_spin->get_int_value(m_interface->kodiBase, m_controlHandle);
294 }
295 //--------------------------------------------------------------------------
296
297 //==========================================================================
298 ///
299 /// \ingroup cpp_kodi_gui_controls_CSpin
300 /// @brief To set the the range as float of spin, e.g. -25.0 is the spin
301 /// start and e.g. +25.0 is the from here defined position where it reach
302 /// the end.
303 ///
304 /// As default is the range 0.0 to 1.0.
305 ///
306 /// The float interval is as default 0.1 and can be changed with
307 /// @ref SetFloatInterval.
308 ///
309 /// @param[in] start Integer start value
310 /// @param[in] end Integer end value
311 ///
312 /// @note Percent, floating point or integer are alone possible. Combining
313 /// these different values can be not together and can, therefore, only
314 /// one each can be used and must be defined with \ref SetType before.
315 ///
316 void SetFloatRange(float start, float end)
317 {
318 m_interface->kodi_gui->control_spin->set_float_range(m_interface->kodiBase, m_controlHandle, start, end);
319 }
320 //--------------------------------------------------------------------------
321
322 //==========================================================================
323 ///
324 /// \ingroup cpp_kodi_gui_controls_CSpin
325 /// @brief Set the spin position with the given float value. The Range
326 /// can be defined with a call from \ref SetIntRange before, as default it
327 /// is 0.0 to 1.0.
328 ///
329 /// @param[in] value Position in range to set with float
330 ///
331 /// @note Percent, floating point or integer are alone possible. Combining
332 /// these different values can be not together and can, therefore, only
333 /// one each can be used and must be defined with \ref SetType before.
334 ///
335 void SetFloatValue(float value)
336 {
337 m_interface->kodi_gui->control_spin->set_float_value(m_interface->kodiBase, m_controlHandle, value);
338 }
339 //--------------------------------------------------------------------------
340
341 //==========================================================================
342 ///
343 /// \ingroup cpp_kodi_gui_controls_CSpin
344 /// @brief To get the current position as float value.
345 ///
346 /// @return The position as float
347 ///
348 float GetFloatValue() const
349 {
350 return m_interface->kodi_gui->control_spin->get_float_value(m_interface->kodiBase, m_controlHandle);
351 }
352 //--------------------------------------------------------------------------
353
354 //==========================================================================
355 ///
356 /// \ingroup cpp_kodi_gui_controls_CSpin
357 /// @brief To set the interval steps of spin, as default is it 0.1 If it
358 /// becomes changed with this function will a step of the user with the
359 /// value fixed here be executed.
360 ///
361 /// @param[in] interval Intervall step to set.
362 ///
363 /// @note Percent, floating point or integer are alone possible. Combining
364 /// these different values can be not together and can, therefore, only
365 /// one each can be used and must be defined with \ref SetType before.
366 ///
367 void SetFloatInterval(float interval)
368 {
369 m_interface->kodi_gui->control_spin->set_float_interval(m_interface->kodiBase, m_controlHandle, interval);
370 }
371 //--------------------------------------------------------------------------
372 };
373
374} /* namespace controls */
375} /* namespace gui */
376} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/TextBox.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/TextBox.h
new file mode 100644
index 0000000..9d8976e
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/TextBox.h
@@ -0,0 +1,176 @@
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 "../Window.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace controls
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_controls_CTextBox Control Text Box
35 /// \ingroup cpp_kodi_gui
36 /// @brief \cpp_class{ kodi::gui::controls::CTextBox }
37 /// **Used to show a multi-page piece of text**
38 ///
39 /// The text box control can be used to display descriptions, help texts or
40 /// other larger texts. It corresponds to the representation which is also to
41 /// be seen on the CDialogTextViewer.
42 ///
43 /// It has the header \ref TextBox.h "#include <kodi/gui/controls/TextBox.h>"
44 /// be included to enjoy it.
45 ///
46 /// Here you find the needed skin part for a \ref Text_Box "textbox control".
47 ///
48 /// @note The call of the control is only possible from the corresponding
49 /// window as its class and identification number is required.
50 ///
51 class CTextBox : public CAddonGUIControlBase
52 {
53 public:
54 //==========================================================================
55 ///
56 /// \ingroup cpp_kodi_gui_controls_CTextBox
57 /// @brief Construct a new control
58 ///
59 /// @param[in] window related window control class
60 /// @param[in] controlId Used skin xml control id
61 ///
62 CTextBox(CWindow* window, int controlId)
63 : CAddonGUIControlBase(window)
64 {
65 m_controlHandle = m_interface->kodi_gui->window->get_control_text_box(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
66 if (!m_controlHandle)
67 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CTextBox can't create control class from Kodi !!!");
68 }
69 //--------------------------------------------------------------------------
70
71 //==========================================================================
72 ///
73 /// \ingroup cpp_kodi_gui_controls_CTextBox
74 /// @brief Destructor
75 ///
76 ~CTextBox() override = default;
77 //--------------------------------------------------------------------------
78
79 //==========================================================================
80 ///
81 /// \ingroup cpp_kodi_gui_controls_CTextBox
82 /// @brief Set the control on window to visible
83 ///
84 /// @param[in] visible If true visible, otherwise hidden
85 ///
86 void SetVisible(bool visible)
87 {
88 m_interface->kodi_gui->control_text_box->set_visible(m_interface->kodiBase, m_controlHandle, visible);
89 }
90 //--------------------------------------------------------------------------
91
92 //==========================================================================
93 ///
94 /// \ingroup cpp_kodi_gui_controls_CTextBox
95 /// @brief To reset box an remove all the text
96 ///
97 void Reset()
98 {
99 m_interface->kodi_gui->control_text_box->reset(m_controlHandle, m_controlHandle);
100 }
101 //--------------------------------------------------------------------------
102
103 //==========================================================================
104 ///
105 /// \ingroup cpp_kodi_gui_controls_CTextBox
106 /// @brief To set the text on box
107 ///
108 /// @param[in] text Text to show
109 ///
110 void SetText(const std::string& text)
111 {
112 m_interface->kodi_gui->control_text_box->set_text(m_interface->kodiBase, m_controlHandle, text.c_str());
113 }
114 //--------------------------------------------------------------------------
115
116 //==========================================================================
117 ///
118 /// \ingroup cpp_kodi_gui_controls_CTextBox
119 /// @brief Get the used text from control
120 ///
121 /// @return Text shown
122 ///
123 std::string GetText() const
124 {
125 std::string text;
126 char* ret = m_interface->kodi_gui->control_text_box->get_text(m_interface->kodiBase, m_controlHandle);
127 if (ret != nullptr)
128 {
129 if (std::strlen(ret))
130 text = ret;
131 m_interface->free_string(m_interface->kodiBase, ret);
132 }
133 return text;
134 }
135 //--------------------------------------------------------------------------
136
137 //==========================================================================
138 ///
139 /// \ingroup cpp_kodi_gui_controls_CTextBox
140 /// @brief To scroll text on other position
141 ///
142 /// @param[in] position The line position to scroll to
143 ///
144 void Scroll(unsigned int position)
145 {
146 m_interface->kodi_gui->control_text_box->scroll(m_interface->kodiBase, m_controlHandle, position);
147 }
148 //--------------------------------------------------------------------------
149
150 //==========================================================================
151 ///
152 /// \ingroup cpp_kodi_gui_controls_CTextBox
153 /// @brief To set automatic scrolling of textbox
154 ///
155 /// Specifies the timing and conditions of any autoscrolling this textbox
156 /// should have. Times are in milliseconds. The content is delayed for the
157 /// given delay, then scrolls at a rate of one line per time interval until
158 /// the end. If the repeat tag is present, it then delays for the repeat
159 /// time, fades out over 1 second, and repeats. It does not wrap or reset
160 /// to the top at the end of the scroll.
161 ///
162 /// @param[in] delay Content delay
163 /// @param[in] time One line per time interval
164 /// @param[in] repeat Delays with given time, fades out over 1
165 /// second, and repeats
166 ///
167 void SetAutoScrolling(int delay, int time, int repeat)
168 {
169 m_interface->kodi_gui->control_text_box->set_auto_scrolling(m_interface->kodiBase, m_controlHandle, delay, time, repeat);
170 }
171 //--------------------------------------------------------------------------
172 };
173
174} /* namespace controls */
175} /* namespace gui */
176} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h
index a4cf963..61af9fe 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h
@@ -39,6 +39,145 @@ typedef struct AddonToKodiFuncTable_kodi_gui_general
39 int (*get_current_window_id)(void* kodiBase); 39 int (*get_current_window_id)(void* kodiBase);
40} AddonToKodiFuncTable_kodi_gui_general; 40} AddonToKodiFuncTable_kodi_gui_general;
41 41
42typedef struct AddonToKodiFuncTable_kodi_gui_control_button
43{
44 void (*set_visible)(void* kodiBase, void* handle, bool visible);
45 void (*set_enabled)(void* kodiBase, void* handle, bool enabled);
46 void (*set_label)(void* kodiBase, void* handle, const char* label);
47 char* (*get_label)(void* kodiBase, void* handle);
48 void (*set_label2)(void* kodiBase, void* handle, const char *label);
49 char* (*get_label2)(void* kodiBase, void* handle);
50} AddonToKodiFuncTable_kodi_gui_control_button;
51
52typedef struct AddonToKodiFuncTable_kodi_gui_control_edit
53{
54 void (*set_visible)(void* kodiBase, void* handle, bool visible);
55 void (*set_enabled)(void* kodiBase, void* handle, bool enabled);
56 void (*set_label)(void* kodiBase, void* handle, const char* label);
57 char* (*get_label)(void* kodiBase, void* handle);
58 void (*set_text)(void* kodiBase, void* handle, const char* text);
59 char* (*get_text)(void* kodiBase, void* handle);
60 void (*set_cursor_position)(void* kodiBase, void* handle, unsigned int position);
61 unsigned int (*get_cursor_position)(void* kodiBase, void* handle);
62 void (*set_input_type)(void* kodiBase, void* handle, int type, const char* heading);
63} AddonToKodiFuncTable_kodi_gui_control_edit;
64
65typedef struct AddonToKodiFuncTable_kodi_gui_control_fade_label
66{
67 void (*set_visible)(void* kodiBase, void* handle, bool visible);
68 void (*add_label)(void* kodiBase, void* handle, const char* text);
69 char* (*get_label)(void* kodiBase, void* handle);
70 void (*set_scrolling)(void* kodiBase, void* handle, bool scroll);
71 void (*reset)(void* kodiBase, void* handle);
72} AddonToKodiFuncTable_kodi_gui_control_fade_label;
73
74typedef struct AddonToKodiFuncTable_kodi_gui_control_image
75{
76 void (*set_visible)(void* kodiBase, void* handle, bool visible);
77 void (*set_filename)(void* kodiBase, void* handle, const char* filename, bool use_cache);
78 void (*set_color_diffuse)(void* kodiBase, void* handle, uint32_t color_diffuse);
79} AddonToKodiFuncTable_kodi_gui_control_image;
80
81typedef struct AddonToKodiFuncTable_kodi_gui_control_label
82{
83 void (*set_visible)(void* kodiBase, void* handle, bool visible);
84 void (*set_label)(void* kodiBase, void* handle, const char* text);
85 char* (*get_label)(void* kodiBase, void* handle);
86} AddonToKodiFuncTable_kodi_gui_control_label;
87
88typedef struct AddonToKodiFuncTable_kodi_gui_control_progress
89{
90 void (*set_visible)(void* kodiBase, void* handle, bool visible);
91 void (*set_percentage)(void* kodiBase, void* handle, float percent);
92 float (*get_percentage)(void* kodiBase, void* handle);
93} AddonToKodiFuncTable_kodi_gui_control_progress;
94
95typedef struct AddonToKodiFuncTable_kodi_gui_control_radio_button
96{
97 void (*set_visible)(void* kodiBase, void* handle, bool visible);
98 void (*set_enabled)(void* kodiBase, void* handle, bool enabled);
99 void (*set_label)(void* kodiBase, void* handle, const char* text);
100 char* (*get_label)(void* kodiBase, void* handle);
101 void (*set_selected)(void* kodiBase, void* handle, bool selected);
102 bool (*is_selected)(void* kodiBase, void* handle);
103} AddonToKodiFuncTable_kodi_gui_control_radio_button;
104
105typedef struct AddonToKodiFuncTable_kodi_gui_control_rendering
106{
107 void (*set_callbacks)(void* kodiBase, void* handle, void* clienthandle,
108 bool (*createCB)(void*,int,int,int,int,void*),
109 void (*renderCB)(void*),
110 void (*stopCB)(void*),
111 bool (*dirtyCB)(void*));
112 void (*destroy)(void *kodiBase, void* handle);
113} AddonToKodiFuncTable_kodi_gui_control_rendering;
114
115typedef struct AddonToKodiFuncTable_kodi_gui_control_settings_slider
116{
117 void (*set_visible)(void* kodiBase, void* handle, bool visible);
118 void (*set_enabled)(void* kodiBase, void* handle, bool enabled);
119 void (*set_text)(void* kodiBase, void* handle, const char* label);
120 void (*reset)(void* kodiBase, void* handle);
121 void (*set_int_range)(void* kodiBase, void* handle, int start, int end);
122 void (*set_int_value)(void* kodiBase, void* handle, int value);
123 int (*get_int_value)(void* kodiBase, void* handle);
124 void (*set_int_interval)(void* kodiBase, void* handle, int interval);
125 void (*set_percentage)(void* kodiBase, void* handle, float percent);
126 float (*get_percentage)(void* kodiBase, void* handle);
127 void (*set_float_range)(void* kodiBase, void* handle, float start, float end);
128 void (*set_float_value)(void* kodiBase, void* handle, float value);
129 float (*get_float_value)(void* kodiBase, void* handle);
130 void (*set_float_interval)(void* kodiBase, void* handle, float interval);
131} AddonToKodiFuncTable_kodi_gui_control_settings_slider;
132
133typedef struct AddonToKodiFuncTable_kodi_gui_control_slider
134{
135 void (*set_visible)(void* kodiBase, void* handle, bool visible);
136 void (*set_enabled)(void* kodiBase, void* handle, bool enabled);
137 void (*reset)(void* kodiBase, void* handle);
138 char* (*get_description)(void* kodiBase, void* handle);
139 void (*set_int_range)(void* kodiBase, void* handle, int start, int end);
140 void (*set_int_value)(void* kodiBase, void* handle, int value);
141 int (*get_int_value)(void* kodiBase, void* handle);
142 void (*set_int_interval)(void* kodiBase, void* handle, int interval);
143 void (*set_percentage)(void* kodiBase, void* handle, float percent);
144 float (*get_percentage)(void* kodiBase, void* handle);
145 void (*set_float_range)(void* kodiBase, void* handle, float start, float end);
146 void (*set_float_value)(void* kodiBase, void* handle, float value);
147 float (*get_float_value)(void* kodiBase, void* handle);
148 void (*set_float_interval)(void* kodiBase, void* handle, float interval);
149} AddonToKodiFuncTable_kodi_gui_control_slider;
150
151typedef struct AddonToKodiFuncTable_kodi_gui_control_spin
152{
153 void (*set_visible)(void* kodiBase, void* handle, bool visible);
154 void (*set_enabled)(void* kodiBase, void* handle, bool enabled);
155 void (*set_text)(void* kodiBase, void* handle, const char* text);
156 void (*reset)(void* kodiBase, void* handle);
157 void (*set_type)(void* kodiBase, void* handle, int type);
158 void (*add_string_label)(void* kodiBase, void* handle, const char* label, const char* value);
159 void (*set_string_value)(void* kodiBase, void* handle, const char* value);
160 char* (*get_string_value)(void* kodiBase, void* handle);
161 void (*add_int_label)(void* kodiBase, void* handle, const char* label, int value);
162 void (*set_int_range)(void* kodiBase, void* handle, int start, int end);
163 void (*set_int_value)(void* kodiBase, void* handle, int value);
164 int (*get_int_value)(void* kodiBase, void* handle);
165 void (*set_float_range)(void* kodiBase, void* handle, float start, float end);
166 void (*set_float_value)(void* kodiBase, void* handle, float value);
167 float (*get_float_value)(void* kodiBase, void* handle);
168 void (*set_float_interval)(void* kodiBase, void* handle, float interval);
169} AddonToKodiFuncTable_kodi_gui_control_spin;
170
171typedef struct AddonToKodiFuncTable_kodi_gui_control_text_box
172{
173 void (*set_visible)(void* kodiBase, void* handle, bool visible);
174 void (*reset)(void* kodiBase, void* handle);
175 void (*set_text)(void* kodiBase, void* handle, const char* text);
176 char* (*get_text)(void* kodiBase, void* handle);
177 void (*scroll)(void* kodiBase, void* handle, unsigned int scroll);
178 void (*set_auto_scrolling)(void* kodiBase, void* handle, int delay, int time, int repeat);
179} AddonToKodiFuncTable_kodi_gui_control_text_box;
180
42typedef struct AddonToKodiFuncTable_kodi_gui_dialogContextMenu 181typedef struct AddonToKodiFuncTable_kodi_gui_dialogContextMenu
43{ 182{
44 int (*open)(void* kodiBase, const char *heading, const char *entries[], unsigned int size); 183 int (*open)(void* kodiBase, const char *heading, const char *entries[], unsigned int size);
@@ -122,7 +261,7 @@ typedef struct AddonToKodiFuncTable_kodi_gui_dialogProgress
122 261
123typedef struct AddonToKodiFuncTable_kodi_gui_dialogSelect 262typedef struct AddonToKodiFuncTable_kodi_gui_dialogSelect
124{ 263{
125 int (*open)(void* kodiBase, const char *heading, const char *entries[], unsigned int size, int selected, bool autoclose); 264 int (*open)(void* kodiBase, const char *heading, const char *entries[], unsigned int size, int selected, unsigned int autoclose);
126} AddonToKodiFuncTable_kodi_gui_dialogSelect; 265} AddonToKodiFuncTable_kodi_gui_dialogSelect;
127 266
128typedef struct AddonToKodiFuncTable_kodi_gui_dialogTextViewer 267typedef struct AddonToKodiFuncTable_kodi_gui_dialogTextViewer
@@ -139,7 +278,7 @@ typedef struct AddonToKodiFuncTable_kodi_gui_dialogYesNo
139 278
140typedef struct AddonToKodiFuncTable_kodi_gui_listItem 279typedef struct AddonToKodiFuncTable_kodi_gui_listItem
141{ 280{
142 void* (*create)(void* kodiBase, const char* label, const char* label2, const char* icon_image, const char* thumbnail_image, const char* path); 281 void* (*create)(void* kodiBase, const char* label, const char* label2, const char* icon_image, const char* path);
143 void (*destroy)(void* kodiBase, void* handle); 282 void (*destroy)(void* kodiBase, void* handle);
144 char* (*get_label)(void* kodiBase, void* handle); 283 char* (*get_label)(void* kodiBase, void* handle);
145 void (*set_label)(void* kodiBase, void* handle, const char* label); 284 void (*set_label)(void* kodiBase, void* handle, const char* label);
@@ -151,6 +290,10 @@ typedef struct AddonToKodiFuncTable_kodi_gui_listItem
151 void (*set_art)(void* kodiBase, void* handle, const char* type, const char* image); 290 void (*set_art)(void* kodiBase, void* handle, const char* type, const char* image);
152 char* (*get_path)(void* kodiBase, void* handle); 291 char* (*get_path)(void* kodiBase, void* handle);
153 void (*set_path)(void* kodiBase, void* handle, const char* path); 292 void (*set_path)(void* kodiBase, void* handle, const char* path);
293 char* (*get_property)(void* kodiBase, void* handle, const char* key);
294 void (*set_property)(void* kodiBase, void* handle, const char* key, const char* value);
295 void (*select)(void* kodiBase, void* handle, bool select);
296 bool (*is_selected)(void* kodiBase, void* handle);
154} AddonToKodiFuncTable_kodi_gui_listItem; 297} AddonToKodiFuncTable_kodi_gui_listItem;
155 298
156#define ADDON_MAX_CONTEXT_ENTRIES 20 299#define ADDON_MAX_CONTEXT_ENTRIES 20
@@ -160,9 +303,10 @@ typedef struct gui_context_menu_pair
160 unsigned int id; 303 unsigned int id;
161 char name[ADDON_MAX_CONTEXT_ENTRY_NAME_LENGTH]; 304 char name[ADDON_MAX_CONTEXT_ENTRY_NAME_LENGTH];
162} gui_context_menu_pair; 305} gui_context_menu_pair;
163 306
164typedef struct AddonToKodiFuncTable_kodi_gui_window 307typedef struct AddonToKodiFuncTable_kodi_gui_window
165{ 308{
309 /* Window creation functions */
166 void* (*create)(void* kodiBase, const char* xml_filename, const char* default_skin, bool as_dialog, bool is_media); 310 void* (*create)(void* kodiBase, const char* xml_filename, const char* default_skin, bool as_dialog, bool is_media);
167 void (*destroy)(void* kodiBase, void* handle); 311 void (*destroy)(void* kodiBase, void* handle);
168 void (*set_callbacks)(void* kodiBase, void* handle, void* clienthandle, 312 void (*set_callbacks)(void* kodiBase, void* handle, void* clienthandle,
@@ -175,14 +319,90 @@ typedef struct AddonToKodiFuncTable_kodi_gui_window
175 bool (*show)(void* kodiBase, void* handle); 319 bool (*show)(void* kodiBase, void* handle);
176 bool (*close)(void* kodiBase, void* handle); 320 bool (*close)(void* kodiBase, void* handle);
177 bool (*do_modal)(void* kodiBase, void* handle); 321 bool (*do_modal)(void* kodiBase, void* handle);
322
323 /* Window control functions */
324 bool (*set_focus_id)(void* kodiBase, void* handle, int control_id);
325 int (*get_focus_id)(void* kodiBase, void* handle);
326 void (*set_control_label)(void* kodiBase, void* handle, int control_id, const char* label);
327
328 /* Window property functions */
329 void (*set_property)(void* kodiBase, void* handle, const char* key, const char* value);
330 void (*set_property_int)(void* kodiBase, void* handle, const char* key, int value);
331 void (*set_property_bool)(void* kodiBase, void* handle, const char* key, bool value);
332 void (*set_property_double)(void* kodiBase, void* handle, const char* key, double value);
333 char* (*get_property)(void* kodiBase, void* handle, const char* key);
334 int (*get_property_int)(void* kodiBase, void* handle, const char* key);
335 bool (*get_property_bool)(void* kodiBase, void* handle, const char* key);
336 double (*get_property_double)(void* kodiBase, void* handle, const char* key);
337 void (*clear_properties)(void* kodiBase, void* handle);
338 void (*clear_property)(void* kodiBase, void* handle, const char* key);
339
340 /* List item functions */
178 void (*clear_item_list)(void* kodiBase, void* handle); 341 void (*clear_item_list)(void* kodiBase, void* handle);
179 void (*add_list_item)(void* kodiBase, void* handle, void* item, int item_position); 342 void (*add_list_item)(void* kodiBase, void* handle, void* item, int list_position);
180 void* (*get_list_item)(void* kodiBase, void* handle, int listPos); 343 void (*remove_list_item_from_position)(void* kodiBase, void* handle, int list_position);
344 void (*remove_list_item)(void* kodiBase, void* handle, void* item);
345 void* (*get_list_item)(void* kodiBase, void* handle, int list_position);
346 void (*set_current_list_position)(void* kodiBase, void* handle, int list_position);
347 int (*get_current_list_position)(void* kodiBase, void* handle);
348 int (*get_list_size)(void* kodiBase, void* handle);
349 void (*set_container_property)(void* kodiBase, void* handle, const char* key, const char* value);
350 void (*set_container_content)(void* kodiBase, void* handle, const char* value);
351 int (*get_current_container_id)(void* kodiBase, void* handle);
352
353 /* Various functions */
354 void (*mark_dirty_region)(void* kodiBase, void* handle);
355
356 /* GUI control access functions */
357 void* (*get_control_button)(void* kodiBase, void* handle, int control_id);
358 void* (*get_control_edit)(void* kodiBase, void* handle, int control_id);
359 void* (*get_control_fade_label)(void* kodiBase, void* handle, int control_id);
360 void* (*get_control_image)(void* kodiBase, void* handle, int control_id);
361 void* (*get_control_label)(void* kodiBase, void* handle, int control_id);
362 void* (*get_control_progress)(void* kodiBase, void* handle, int control_id);
363 void* (*get_control_radio_button)(void* kodiBase, void* handle, int control_id);
364 void* (*get_control_render_addon)(void* kodiBase, void* handle, int control_id);
365 void* (*get_control_settings_slider)(void* kodiBase, void* handle, int control_id);
366 void* (*get_control_slider)(void* kodiBase, void* handle, int control_id);
367 void* (*get_control_spin)(void* kodiBase, void* handle, int control_id);
368 void* (*get_control_text_box)(void* kodiBase, void* handle, int control_id);
369 void* (*get_control_dummy1)(void* kodiBase, void* handle, int control_id);
370 void* (*get_control_dummy2)(void* kodiBase, void* handle, int control_id);
371 void* (*get_control_dummy3)(void* kodiBase, void* handle, int control_id);
372 void* (*get_control_dummy4)(void* kodiBase, void* handle, int control_id);
373 void* (*get_control_dummy5)(void* kodiBase, void* handle, int control_id);
374 void* (*get_control_dummy6)(void* kodiBase, void* handle, int control_id);
375 void* (*get_control_dummy7)(void* kodiBase, void* handle, int control_id);
376 void* (*get_control_dummy8)(void* kodiBase, void* handle, int control_id);
377 void* (*get_control_dummy9)(void* kodiBase, void* handle, int control_id);
378 void* (*get_control_dummy10)(void* kodiBase, void* handle, int control_id); /* This and above used to add new get_control_* functions */
181} AddonToKodiFuncTable_kodi_gui_window; 379} AddonToKodiFuncTable_kodi_gui_window;
182 380
183typedef struct AddonToKodiFuncTable_kodi_gui 381typedef struct AddonToKodiFuncTable_kodi_gui
184{ 382{
185 AddonToKodiFuncTable_kodi_gui_general* general; 383 AddonToKodiFuncTable_kodi_gui_general* general;
384 AddonToKodiFuncTable_kodi_gui_control_button* control_button;
385 AddonToKodiFuncTable_kodi_gui_control_edit* control_edit;
386 AddonToKodiFuncTable_kodi_gui_control_fade_label* control_fade_label;
387 AddonToKodiFuncTable_kodi_gui_control_label* control_label;
388 AddonToKodiFuncTable_kodi_gui_control_image* control_image;
389 AddonToKodiFuncTable_kodi_gui_control_progress* control_progress;
390 AddonToKodiFuncTable_kodi_gui_control_radio_button* control_radio_button;
391 AddonToKodiFuncTable_kodi_gui_control_rendering* control_rendering;
392 AddonToKodiFuncTable_kodi_gui_control_settings_slider* control_settings_slider;
393 AddonToKodiFuncTable_kodi_gui_control_slider* control_slider;
394 AddonToKodiFuncTable_kodi_gui_control_spin* control_spin;
395 AddonToKodiFuncTable_kodi_gui_control_text_box* control_text_box;
396 void* control_dummy1;
397 void* control_dummy2;
398 void* control_dummy3;
399 void* control_dummy4;
400 void* control_dummy5;
401 void* control_dummy6;
402 void* control_dummy7;
403 void* control_dummy8;
404 void* control_dummy9;
405 void* control_dummy10; /* This and above used to add new controls */
186 AddonToKodiFuncTable_kodi_gui_dialogContextMenu* dialogContextMenu; 406 AddonToKodiFuncTable_kodi_gui_dialogContextMenu* dialogContextMenu;
187 AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress* dialogExtendedProgress; 407 AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress* dialogExtendedProgress;
188 AddonToKodiFuncTable_kodi_gui_dialogFileBrowser* dialogFileBrowser; 408 AddonToKodiFuncTable_kodi_gui_dialogFileBrowser* dialogFileBrowser;
@@ -193,6 +413,16 @@ typedef struct AddonToKodiFuncTable_kodi_gui
193 AddonToKodiFuncTable_kodi_gui_dialogSelect* dialogSelect; 413 AddonToKodiFuncTable_kodi_gui_dialogSelect* dialogSelect;
194 AddonToKodiFuncTable_kodi_gui_dialogTextViewer* dialogTextViewer; 414 AddonToKodiFuncTable_kodi_gui_dialogTextViewer* dialogTextViewer;
195 AddonToKodiFuncTable_kodi_gui_dialogYesNo* dialogYesNo; 415 AddonToKodiFuncTable_kodi_gui_dialogYesNo* dialogYesNo;
416 void* dialog_dummy1;
417 void* dialog_dummy2;
418 void* dialog_dummy3;
419 void* dialog_dummy4;
420 void* dialog_dummy5;
421 void* dialog_dummy6;
422 void* dialog_dummy7;
423 void* dialog_dummy8;
424 void* dialog_dummy9;
425 void* dialog_dummy10; /* This and above used to add new dialogs */
196 AddonToKodiFuncTable_kodi_gui_listItem* listItem; 426 AddonToKodiFuncTable_kodi_gui_listItem* listItem;
197 AddonToKodiFuncTable_kodi_gui_window* window; 427 AddonToKodiFuncTable_kodi_gui_window* window;
198} AddonToKodiFuncTable_kodi_gui; 428} AddonToKodiFuncTable_kodi_gui;
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogContextMenu.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/ContextMenu.h
index 66a1c90..47afc23 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogContextMenu.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/ContextMenu.h
@@ -19,33 +19,35 @@
19 * 19 *
20 */ 20 */
21 21
22#include "definitions.h" 22#include "../definitions.h"
23#include "../AddonBase.h" 23#include "../../AddonBase.h"
24 24
25namespace kodi 25namespace kodi
26{ 26{
27namespace gui 27namespace gui
28{ 28{
29namespace dialogs
30{
29 31
30 //============================================================================ 32 //============================================================================
31 /// 33 ///
32 /// \defgroup cpp_kodi_gui_DialogContextMenu Dialog Context Menu 34 /// \defgroup cpp_kodi_gui_dialogs_ContextMenu Dialog Context Menu
33 /// \ingroup cpp_kodi_gui 35 /// \ingroup cpp_kodi_gui
34 /// @brief \cpp_namespace{ kodi::gui::DialogContextMenu } 36 /// @brief \cpp_namespace{ kodi::gui::dialogs::ContextMenu }
35 /// **Context menu dialog** 37 /// **Context menu dialog**
36 /// 38 ///
37 /// The function listed below permits the call of a dialogue as context menu to 39 /// The function listed below permits the call of a dialogue as context menu to
38 /// select of an entry as a key 40 /// select of an entry as a key
39 /// 41 ///
40 /// It has the header \ref DialogContextMenu.h "#include <kodi/gui/DialogContextMenu.h>" 42 /// It has the header \ref ContextMenu.h "#include <kodi/gui/dialogs/ContextMenu.h>"
41 /// be included to enjoy it. 43 /// be included to enjoy it.
42 /// 44 ///
43 /// 45 ///
44 namespace DialogContextMenu 46 namespace ContextMenu
45 { 47 {
46 //========================================================================== 48 //==========================================================================
47 /// 49 ///
48 /// \ingroup cpp_kodi_gui_DialogContextMenu 50 /// \ingroup cpp_kodi_gui_dialogs_ContextMenu
49 /// @brief Show a context menu dialog about given parts. 51 /// @brief Show a context menu dialog about given parts.
50 /// 52 ///
51 /// @param[in] heading Dialog heading name 53 /// @param[in] heading Dialog heading name
@@ -57,7 +59,7 @@ namespace gui
57 /// 59 ///
58 /// **Example:** 60 /// **Example:**
59 /// ~~~~~~~~~~~~~{.cpp} 61 /// ~~~~~~~~~~~~~{.cpp}
60 /// #include <kodi/gui/DialogContextMenu.h> 62 /// #include <kodi/gui/dialogs/ContextMenu.h>
61 /// 63 ///
62 /// const std::vector<std::string> entries 64 /// const std::vector<std::string> entries
63 /// { 65 /// {
@@ -68,7 +70,7 @@ namespace gui
68 /// "Test 5" 70 /// "Test 5"
69 /// }; 71 /// };
70 /// 72 ///
71 /// int selected = kodi::gui::DialogContextMenu::Show("Test selection", entries); 73 /// int selected = kodi::gui::dialogs::ContextMenu::Show("Test selection", entries);
72 /// if (selected < 0) 74 /// if (selected < 0)
73 /// fprintf(stderr, "Item selection canceled\n"); 75 /// fprintf(stderr, "Item selection canceled\n");
74 /// else 76 /// else
@@ -91,5 +93,6 @@ namespace gui
91 //-------------------------------------------------------------------------- 93 //--------------------------------------------------------------------------
92 }; 94 };
93 95
96} /* namespace dialogs */
94} /* namespace gui */ 97} /* namespace gui */
95} /* namespace kodi */ 98} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogExtendedProgress.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/ExtendedProgress.h
index b6f2deb..e9c5a9d 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogExtendedProgress.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/ExtendedProgress.h
@@ -19,22 +19,24 @@
19 * 19 *
20 */ 20 */
21 21
22#include "definitions.h" 22#include "../definitions.h"
23#include "../AddonBase.h" 23#include "../../AddonBase.h"
24 24
25namespace kodi 25namespace kodi
26{ 26{
27namespace gui 27namespace gui
28{ 28{
29namespace dialogs
30{
29 31
30 //============================================================================ 32 //============================================================================
31 /// 33 ///
32 /// \defgroup cpp_kodi_gui_CDialogExtendedProgress Dialog Extended Progress 34 /// \defgroup cpp_kodi_gui_dialogs_CExtendedProgress Dialog Extended Progress
33 /// \ingroup cpp_kodi_gui 35 /// \ingroup cpp_kodi_gui
34 /// @brief \cpp_class{ kodi::gui::CDialogExtendedProgress } 36 /// @brief \cpp_class{ kodi::gui::dialogs::ExtendedProgress }
35 /// **Progress dialog shown for background work** 37 /// **Progress dialog shown for background work**
36 /// 38 ///
37 /// The with \ref DialogExtendedProgress.h "#include <kodi/gui/DialogExtendedProgress.h>" 39 /// The with \ref ExtendedProgress.h "#include <kodi/gui/dialogs/ExtendedProgress.h>"
38 /// given class are basically used to create Kodi's extended progress. 40 /// given class are basically used to create Kodi's extended progress.
39 /// 41 ///
40 /// 42 ///
@@ -42,9 +44,9 @@ namespace gui
42 /// 44 ///
43 /// **Example:** 45 /// **Example:**
44 /// ~~~~~~~~~~~~~{.cpp} 46 /// ~~~~~~~~~~~~~{.cpp}
45 /// #include <kodi/gui/DialogExtendedProgress.h> 47 /// #include <kodi/gui/dialogs/ExtendedProgress.h>
46 /// 48 ///
47 /// kodi::gui::CDialogExtendedProgress *ext_progress = new kodi::gui::CDialogExtendedProgress("Test Extended progress"); 49 /// kodi::gui::dialogs::CExtendedProgress *ext_progress = new kodi::gui::dialogs::CExtendedProgress("Test Extended progress");
48 /// ext_progress->SetText("Test progress"); 50 /// ext_progress->SetText("Test progress");
49 /// for (unsigned int i = 0; i < 50; i += 10) 51 /// for (unsigned int i = 0; i < 50; i += 10)
50 /// { 52 /// {
@@ -63,17 +65,17 @@ namespace gui
63 /// delete ext_progress; 65 /// delete ext_progress;
64 /// ~~~~~~~~~~~~~ 66 /// ~~~~~~~~~~~~~
65 /// 67 ///
66 class CDialogExtendedProgress 68 class CExtendedProgress
67 { 69 {
68 public: 70 public:
69 //========================================================================== 71 //==========================================================================
70 /// 72 ///
71 /// \ingroup cpp_kodi_gui_CDialogExtendedProgress 73 /// \ingroup cpp_kodi_gui_dialogs_CExtendedProgress
72 /// Construct a new dialog 74 /// Construct a new dialog
73 /// 75 ///
74 /// @param[in] title Title string 76 /// @param[in] title Title string
75 /// 77 ///
76 CDialogExtendedProgress(const std::string& title = "") 78 CExtendedProgress(const std::string& title = "")
77 { 79 {
78 using namespace ::kodi::addon; 80 using namespace ::kodi::addon;
79 m_DialogHandle = CAddonBase::m_interface->toKodi->kodi_gui->dialogExtendedProgress->new_dialog(CAddonBase::m_interface->toKodi->kodiBase, title.c_str()); 81 m_DialogHandle = CAddonBase::m_interface->toKodi->kodi_gui->dialogExtendedProgress->new_dialog(CAddonBase::m_interface->toKodi->kodiBase, title.c_str());
@@ -84,10 +86,10 @@ namespace gui
84 86
85 //========================================================================== 87 //==========================================================================
86 /// 88 ///
87 /// \ingroup cpp_kodi_gui_CDialogExtendedProgress 89 /// \ingroup cpp_kodi_gui_dialogs_CExtendedProgress
88 /// Destructor 90 /// Destructor
89 /// 91 ///
90 ~CDialogExtendedProgress() 92 ~CExtendedProgress()
91 { 93 {
92 using namespace ::kodi::addon; 94 using namespace ::kodi::addon;
93 if (m_DialogHandle) 95 if (m_DialogHandle)
@@ -97,7 +99,7 @@ namespace gui
97 99
98 //========================================================================== 100 //==========================================================================
99 /// 101 ///
100 /// \ingroup cpp_kodi_gui_CDialogExtendedProgress 102 /// \ingroup cpp_kodi_gui_dialogs_CExtendedProgress
101 /// @brief Get the used title 103 /// @brief Get the used title
102 /// 104 ///
103 /// @return Title string 105 /// @return Title string
@@ -119,7 +121,7 @@ namespace gui
119 121
120 //========================================================================== 122 //==========================================================================
121 /// 123 ///
122 /// \ingroup cpp_kodi_gui_CDialogExtendedProgress 124 /// \ingroup cpp_kodi_gui_dialogs_CExtendedProgress
123 /// @brief To set the title of dialog 125 /// @brief To set the title of dialog
124 /// 126 ///
125 /// @param[in] title Title string 127 /// @param[in] title Title string
@@ -133,7 +135,7 @@ namespace gui
133 135
134 //========================================================================== 136 //==========================================================================
135 /// 137 ///
136 /// \ingroup cpp_kodi_gui_CDialogExtendedProgress 138 /// \ingroup cpp_kodi_gui_dialogs_CExtendedProgress
137 /// @brief Get the used text information string 139 /// @brief Get the used text information string
138 /// 140 ///
139 /// @return Text string 141 /// @return Text string
@@ -155,7 +157,7 @@ namespace gui
155 157
156 //========================================================================== 158 //==========================================================================
157 /// 159 ///
158 /// \ingroup cpp_kodi_gui_CDialogExtendedProgress 160 /// \ingroup cpp_kodi_gui_dialogs_CExtendedProgress
159 /// @brief To set the used text information string 161 /// @brief To set the used text information string
160 /// 162 ///
161 /// @param[in] text information text to set 163 /// @param[in] text information text to set
@@ -169,7 +171,7 @@ namespace gui
169 171
170 //========================================================================== 172 //==========================================================================
171 /// 173 ///
172 /// \ingroup cpp_kodi_gui_CDialogExtendedProgress 174 /// \ingroup cpp_kodi_gui_dialogs_CExtendedProgress
173 /// @brief To ask dialog is finished 175 /// @brief To ask dialog is finished
174 /// 176 ///
175 /// @return True if on end 177 /// @return True if on end
@@ -183,7 +185,7 @@ namespace gui
183 185
184 //========================================================================== 186 //==========================================================================
185 /// 187 ///
186 /// \ingroup cpp_kodi_gui_CDialogExtendedProgress 188 /// \ingroup cpp_kodi_gui_dialogs_CExtendedProgress
187 /// @brief Mark progress finished 189 /// @brief Mark progress finished
188 /// 190 ///
189 void MarkFinished() 191 void MarkFinished()
@@ -195,7 +197,7 @@ namespace gui
195 197
196 //========================================================================== 198 //==========================================================================
197 /// 199 ///
198 /// \ingroup cpp_kodi_gui_CDialogExtendedProgress 200 /// \ingroup cpp_kodi_gui_dialogs_CExtendedProgress
199 /// @brief Get the current progress position as percent 201 /// @brief Get the current progress position as percent
200 /// 202 ///
201 /// @return Position 203 /// @return Position
@@ -209,7 +211,7 @@ namespace gui
209 211
210 //========================================================================== 212 //==========================================================================
211 /// 213 ///
212 /// \ingroup cpp_kodi_gui_CDialogExtendedProgress 214 /// \ingroup cpp_kodi_gui_dialogs_CExtendedProgress
213 /// @brief To set the current progress position as percent 215 /// @brief To set the current progress position as percent
214 /// 216 ///
215 /// @param[in] percentage Position to use from 0.0 to 100.0 217 /// @param[in] percentage Position to use from 0.0 to 100.0
@@ -223,7 +225,7 @@ namespace gui
223 225
224 //========================================================================== 226 //==========================================================================
225 /// 227 ///
226 /// \ingroup cpp_kodi_gui_CDialogExtendedProgress 228 /// \ingroup cpp_kodi_gui_dialogs_CExtendedProgress
227 /// @brief To set progress position with predefined places 229 /// @brief To set progress position with predefined places
228 /// 230 ///
229 /// @param[in] currentItem Place position to use 231 /// @param[in] currentItem Place position to use
@@ -240,5 +242,6 @@ namespace gui
240 void* m_DialogHandle; 242 void* m_DialogHandle;
241 }; 243 };
242 244
245} /* namespace dialogs */
243} /* namespace gui */ 246} /* namespace gui */
244} /* namespace kodi */ 247} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogFileBrowser.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/FileBrowser.h
index e348125..401a78d 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogFileBrowser.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/FileBrowser.h
@@ -19,35 +19,37 @@
19 * 19 *
20 */ 20 */
21 21
22#include "definitions.h" 22#include "../definitions.h"
23#include "../AddonBase.h" 23#include "../../AddonBase.h"
24 24
25namespace kodi 25namespace kodi
26{ 26{
27namespace gui 27namespace gui
28{ 28{
29namespace dialogs
30{
29 31
30 //============================================================================ 32 //============================================================================
31 /// 33 ///
32 /// \defgroup cpp_kodi_gui_DialogFileBrowser Dialog File Browser 34 /// \defgroup cpp_kodi_gui_dialogs_FileBrowser Dialog File Browser
33 /// \ingroup cpp_kodi_gui 35 /// \ingroup cpp_kodi_gui
34 /// @brief \cpp_namespace{ kodi::gui::DialogFileBrowser } 36 /// @brief \cpp_namespace{ kodi::gui::dialogs::FileBrowser }
35 /// **File browser dialog** 37 /// **File browser dialog**
36 /// 38 ///
37 /// The functions listed below of the class "DialogFileBrowser" offer 39 /// The functions listed below of the class "FileBrowser" offer
38 /// the possibility to select to a file by the user of the add-on. 40 /// the possibility to select to a file by the user of the add-on.
39 /// 41 ///
40 /// It allows all the options that are possible in Kodi itself and offers all 42 /// It allows all the options that are possible in Kodi itself and offers all
41 /// support file types. 43 /// support file types.
42 /// 44 ///
43 /// It has the header \ref DialogFileBrowser.h "#include <kodi/gui/DialogFileBrowser.h>" 45 /// It has the header \ref FileBrowser.h "#include <kodi/gui/dialogs/FileBrowser.h>"
44 /// be included to enjoy it. 46 /// be included to enjoy it.
45 /// 47 ///
46 namespace DialogFileBrowser 48 namespace FileBrowser
47 { 49 {
48 //========================================================================== 50 //==========================================================================
49 /// 51 ///
50 /// \ingroup cpp_kodi_gui_DialogFileBrowser 52 /// \ingroup cpp_kodi_gui_dialogs_FileBrowser
51 /// @brief Directory selection dialog 53 /// @brief Directory selection dialog
52 /// 54 ///
53 /// @param[in] shares With Shares becomes the available start folders 55 /// @param[in] shares With Shares becomes the available start folders
@@ -60,7 +62,7 @@ namespace gui
60 /// 62 ///
61 /// **Example:** 63 /// **Example:**
62 /// ~~~~~~~~~~~~~{.cpp} 64 /// ~~~~~~~~~~~~~{.cpp}
63 /// #include <kodi/gui/DialogFileBrowser.h> 65 /// #include <kodi/gui/dialogs/FileBrowser.h>
64 /// 66 ///
65 /// /* 67 /// /*
66 /// * Example show directory selection dialog with on 'share' (first value) 68 /// * Example show directory selection dialog with on 'share' (first value)
@@ -73,7 +75,7 @@ namespace gui
73 /// * to a start place. 75 /// * to a start place.
74 /// */ 76 /// */
75 /// std::string directory; 77 /// std::string directory;
76 /// bool ret = kodi::gui::DialogFileBrowser::ShowAndGetDirectory("local|network|removable", 78 /// bool ret = kodi::gui::dialogs::FileBrowser::ShowAndGetDirectory("local|network|removable",
77 /// "Test directory selection", 79 /// "Test directory selection",
78 /// directory, 80 /// directory,
79 /// false); 81 /// false);
@@ -98,7 +100,7 @@ namespace gui
98 100
99 //========================================================================== 101 //==========================================================================
100 /// 102 ///
101 /// \ingroup cpp_kodi_gui_DialogFileBrowser 103 /// \ingroup cpp_kodi_gui_dialogs_FileBrowser
102 /// @brief File selection dialog 104 /// @brief File selection dialog
103 /// 105 ///
104 /// @param[in] shares With Shares becomes the available start 106 /// @param[in] shares With Shares becomes the available start
@@ -133,7 +135,7 @@ namespace gui
133 135
134 //========================================================================== 136 //==========================================================================
135 /// 137 ///
136 /// \ingroup cpp_kodi_gui_DialogFileBrowser 138 /// \ingroup cpp_kodi_gui_dialogs_FileBrowser
137 /// @brief File selection from a directory 139 /// @brief File selection from a directory
138 /// 140 ///
139 /// @param[in] directory The directory name where the dialog 141 /// @param[in] directory The directory name where the dialog
@@ -171,7 +173,7 @@ namespace gui
171 173
172 //========================================================================== 174 //==========================================================================
173 /// 175 ///
174 /// \ingroup cpp_kodi_gui_DialogFileBrowser 176 /// \ingroup cpp_kodi_gui_dialogs_FileBrowser
175 /// @brief File selection dialog to get several in to a list 177 /// @brief File selection dialog to get several in to a list
176 /// 178 ///
177 /// @param[in] shares With Shares becomes the available start 179 /// @param[in] shares With Shares becomes the available start
@@ -206,7 +208,7 @@ namespace gui
206 208
207 //========================================================================== 209 //==========================================================================
208 /// 210 ///
209 /// \ingroup cpp_kodi_gui_DialogFileBrowser 211 /// \ingroup cpp_kodi_gui_dialogs_FileBrowser
210 /// @brief Source selection dialog 212 /// @brief Source selection dialog
211 /// 213 ///
212 /// @param[in,out] path As in the path to start and Return value 214 /// @param[in,out] path As in the path to start and Return value
@@ -235,7 +237,7 @@ namespace gui
235 237
236 //========================================================================== 238 //==========================================================================
237 /// 239 ///
238 /// \ingroup cpp_kodi_gui_DialogFileBrowser 240 /// \ingroup cpp_kodi_gui_dialogs_FileBrowser
239 /// @brief Image selection dialog 241 /// @brief Image selection dialog
240 /// 242 ///
241 /// @param[in] shares With Shares becomes the available start folders be 243 /// @param[in] shares With Shares becomes the available start folders be
@@ -262,7 +264,7 @@ namespace gui
262 264
263 //========================================================================== 265 //==========================================================================
264 /// 266 ///
265 /// \ingroup cpp_kodi_gui_DialogFileBrowser 267 /// \ingroup cpp_kodi_gui_dialogs_FileBrowser
266 /// @brief Image selection dialog to get several in to a list 268 /// @brief Image selection dialog to get several in to a list
267 /// 269 ///
268 /// @param[in] shares With Shares becomes the available start folders 270 /// @param[in] shares With Shares becomes the available start folders
@@ -289,5 +291,6 @@ namespace gui
289 //-------------------------------------------------------------------------- 291 //--------------------------------------------------------------------------
290 }; 292 };
291 293
294} /* namespace dialogs */
292} /* namespace gui */ 295} /* namespace gui */
293} /* namespace kodi */ 296} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogKeyboard.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Keyboard.h
index 9261972..cff30d8 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogKeyboard.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Keyboard.h
@@ -19,19 +19,21 @@
19 * 19 *
20 */ 20 */
21 21
22#include "definitions.h" 22#include "../definitions.h"
23#include "../AddonBase.h" 23#include "../../AddonBase.h"
24 24
25namespace kodi 25namespace kodi
26{ 26{
27namespace gui 27namespace gui
28{ 28{
29namespace dialogs
30{
29 31
30 //============================================================================ 32 //============================================================================
31 /// 33 ///
32 /// \defgroup cpp_kodi_gui_DialogKeyboard Dialog Keyboard 34 /// \defgroup cpp_kodi_gui_dialogs_Keyboard Dialog Keyboard
33 /// \ingroup cpp_kodi_gui 35 /// \ingroup cpp_kodi_gui
34 /// @brief \cpp_namespace{ kodi::gui::DialogKeyboard } 36 /// @brief \cpp_namespace{ kodi::gui::dialogs::Keyboard }
35 /// **Keyboard dialogs** 37 /// **Keyboard dialogs**
36 /// 38 ///
37 /// The functions listed below have to be permitted by the user for the 39 /// The functions listed below have to be permitted by the user for the
@@ -40,14 +42,14 @@ namespace gui
40 /// The class supports several kinds, from an easy text choice up to the 42 /// The class supports several kinds, from an easy text choice up to the
41 /// passport Word production and their confirmation for add-on. 43 /// passport Word production and their confirmation for add-on.
42 /// 44 ///
43 /// It has the header \ref DialogKeyboard.h "#include <kodi/gui/DialogKeyboard.h>" 45 /// It has the header \ref Keyboard.h "#include <kodi/gui/dialogs/Keyboard.h>"
44 /// be included to enjoy it. 46 /// be included to enjoy it.
45 /// 47 ///
46 namespace DialogKeyboard 48 namespace Keyboard
47 { 49 {
48 //========================================================================== 50 //==========================================================================
49 /// 51 ///
50 /// \ingroup cpp_kodi_gui_DialogKeyboard 52 /// \ingroup cpp_kodi_gui_dialogs_Keyboard
51 /// @brief Show keyboard with initial value `text` and replace with result 53 /// @brief Show keyboard with initial value `text` and replace with result
52 /// string. 54 /// string.
53 /// 55 ///
@@ -67,7 +69,7 @@ namespace gui
67 /// 69 ///
68 /// **Example:** 70 /// **Example:**
69 /// ~~~~~~~~~~~~~{.cpp} 71 /// ~~~~~~~~~~~~~{.cpp}
70 /// #include <kodi/gui/DialogKeyboard.h> 72 /// #include <kodi/gui/dialogs/Keyboard.h>
71 /// 73 ///
72 /// /* 74 /// /*
73 /// * The example shows the display of keyboard call dialog at Kodi from the add-on. 75 /// * The example shows the display of keyboard call dialog at Kodi from the add-on.
@@ -76,7 +78,7 @@ namespace gui
76 /// */ 78 /// */
77 /// std::string text = "Please change me to them want you want"; /*< It can be leaved empty or a 79 /// std::string text = "Please change me to them want you want"; /*< It can be leaved empty or a
78 /// entry text added */ 80 /// entry text added */
79 /// bool bRet = ::kodi::gui::DialogKeyboard::ShowAndGetInput(text, 81 /// bool bRet = ::kodi::gui::dialogs::Keyboard::ShowAndGetInput(text,
80 /// "Demonstration text entry", 82 /// "Demonstration text entry",
81 /// true, 83 /// true,
82 /// false, 84 /// false,
@@ -104,7 +106,7 @@ namespace gui
104 106
105 //========================================================================== 107 //==========================================================================
106 /// 108 ///
107 /// \ingroup cpp_kodi_gui_DialogKeyboard 109 /// \ingroup cpp_kodi_gui_dialogs_Keyboard
108 /// @brief The example shows the display of keyboard call dialog at Kodi 110 /// @brief The example shows the display of keyboard call dialog at Kodi
109 /// from the add-on. 111 /// from the add-on.
110 /// 112 ///
@@ -137,7 +139,7 @@ namespace gui
137 139
138 //========================================================================== 140 //==========================================================================
139 /// 141 ///
140 /// \ingroup cpp_kodi_gui_DialogKeyboard 142 /// \ingroup cpp_kodi_gui_dialogs_Keyboard
141 /// @brief Shows keyboard and prompts for a password. Differs from 143 /// @brief Shows keyboard and prompts for a password. Differs from
142 /// `ShowAndVerifyNewPassword()` in that no second verification 144 /// `ShowAndVerifyNewPassword()` in that no second verification
143 /// 145 ///
@@ -170,7 +172,7 @@ namespace gui
170 172
171 //========================================================================== 173 //==========================================================================
172 /// 174 ///
173 /// \ingroup cpp_kodi_gui_DialogKeyboard 175 /// \ingroup cpp_kodi_gui_dialogs_Keyboard
174 /// @brief Shows keyboard and prompts for a password. Differs from 176 /// @brief Shows keyboard and prompts for a password. Differs from
175 /// `ShowAndVerifyNewPassword()` in that no second verification 177 /// `ShowAndVerifyNewPassword()` in that no second verification
176 /// 178 ///
@@ -200,7 +202,7 @@ namespace gui
200 202
201 //========================================================================== 203 //==========================================================================
202 /// 204 ///
203 /// \ingroup cpp_kodi_gui_DialogKeyboard 205 /// \ingroup cpp_kodi_gui_dialogs_Keyboard
204 /// @brief Show keyboard twice to get and confirm a user-entered password 206 /// @brief Show keyboard twice to get and confirm a user-entered password
205 /// string. 207 /// string.
206 /// 208 ///
@@ -220,7 +222,7 @@ namespace gui
220 /// **Example:** 222 /// **Example:**
221 /// ~~~~~~~~~~~~~{.cpp} 223 /// ~~~~~~~~~~~~~{.cpp}
222 /// #include <kodi/General.h> 224 /// #include <kodi/General.h>
223 /// #include <kodi/gui/DialogKeyboard.h> 225 /// #include <kodi/gui/dialogs/Keyboard.h>
224 /// 226 ///
225 /// /* 227 /// /*
226 /// * The example below shows the complete use of keyboard dialog for password 228 /// * The example below shows the complete use of keyboard dialog for password
@@ -246,7 +248,7 @@ namespace gui
246 /// /* 248 /// /*
247 /// * Ask the user about the password. 249 /// * Ask the user about the password.
248 /// */ 250 /// */
249 /// ret = ::kodi::gui::DialogKeyboard::ShowAndVerifyPassword(password, "Demo password call for PW 'kodi'", i, 0); 251 /// ret = ::kodi::gui::dialogs::Keyboard::ShowAndVerifyPassword(password, "Demo password call for PW 'kodi'", i, 0);
250 /// if (ret == 0) 252 /// if (ret == 0)
251 /// { 253 /// {
252 /// fprintf(stderr, "Password successfull confirmed after '%i' tries\n", i+1); 254 /// fprintf(stderr, "Password successfull confirmed after '%i' tries\n", i+1);
@@ -283,7 +285,7 @@ namespace gui
283 285
284 //========================================================================== 286 //==========================================================================
285 /// 287 ///
286 /// \ingroup cpp_kodi_gui_DialogKeyboard 288 /// \ingroup cpp_kodi_gui_dialogs_Keyboard
287 /// @brief Show keyboard twice to get and confirm a user-entered password 289 /// @brief Show keyboard twice to get and confirm a user-entered password
288 /// string. 290 /// string.
289 /// 291 ///
@@ -313,7 +315,7 @@ namespace gui
313 315
314 //========================================================================== 316 //==========================================================================
315 /// 317 ///
316 /// \ingroup cpp_kodi_gui_DialogKeyboard 318 /// \ingroup cpp_kodi_gui_dialogs_Keyboard
317 /// @brief Show keyboard and verify user input against `password`. 319 /// @brief Show keyboard and verify user input against `password`.
318 /// 320 ///
319 /// @param[in,out] password Value to compare against user input. 321 /// @param[in,out] password Value to compare against user input.
@@ -347,7 +349,7 @@ namespace gui
347 349
348 //========================================================================== 350 //==========================================================================
349 /// 351 ///
350 /// \ingroup cpp_kodi_gui_DialogKeyboard 352 /// \ingroup cpp_kodi_gui_dialogs_Keyboard
351 /// @brief Shows a filter related keyboard 353 /// @brief Shows a filter related keyboard
352 /// 354 ///
353 /// @param[in,out] text Overwritten with user input if return=true. 355 /// @param[in,out] text Overwritten with user input if return=true.
@@ -381,7 +383,7 @@ namespace gui
381 383
382 //========================================================================== 384 //==========================================================================
383 /// 385 ///
384 /// \ingroup cpp_kodi_gui_DialogKeyboard 386 /// \ingroup cpp_kodi_gui_dialogs_Keyboard
385 /// @brief Send a text to a visible keyboard 387 /// @brief Send a text to a visible keyboard
386 /// 388 ///
387 /// @param[in] text Overwritten with user input if return=true. 389 /// @param[in] text Overwritten with user input if return=true.
@@ -399,7 +401,7 @@ namespace gui
399 401
400 //========================================================================== 402 //==========================================================================
401 /// 403 ///
402 /// \ingroup cpp_kodi_gui_DialogKeyboard 404 /// \ingroup cpp_kodi_gui_dialogs_Keyboard
403 /// @brief Check for visible keyboard on GUI 405 /// @brief Check for visible keyboard on GUI
404 /// 406 ///
405 /// @return true if keyboard present, false if not present 407 /// @return true if keyboard present, false if not present
@@ -412,5 +414,6 @@ namespace gui
412 //-------------------------------------------------------------------------- 414 //--------------------------------------------------------------------------
413 }; 415 };
414 416
417} /* namespace dialogs */
415} /* namespace gui */ 418} /* namespace gui */
416} /* namespace kodi */ 419} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogNumeric.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Numeric.h
index 8b5c592..dddbf7e 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogNumeric.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Numeric.h
@@ -19,20 +19,22 @@
19 * 19 *
20 */ 20 */
21 21
22#include "definitions.h" 22#include "../definitions.h"
23#include "../AddonBase.h" 23#include "../../AddonBase.h"
24 24
25namespace kodi 25namespace kodi
26{ 26{
27namespace gui 27namespace gui
28{ 28{
29namespace dialogs
30{
29 31
30 //============================================================================ 32 //============================================================================
31 /// 33 ///
32 /// \defgroup cpp_kodi_gui_DialogNumeric Dialog Numeric 34 /// \defgroup cpp_kodi_gui_dialogs_Numeric Dialog Numeric
33 /// \ingroup cpp_kodi_gui 35 /// \ingroup cpp_kodi_gui
34 /// @{ 36 /// @{
35 /// @brief \cpp_namespace{ kodi::gui::DialogNumeric } 37 /// @brief \cpp_namespace{ kodi::gui::dialogs::Numeric }
36 /// **Numeric dialogs** 38 /// **Numeric dialogs**
37 /// 39 ///
38 /// The functions listed below have to be permitted by the user for the 40 /// The functions listed below have to be permitted by the user for the
@@ -41,14 +43,14 @@ namespace gui
41 /// The class supports several kinds, from an easy number choice up to the 43 /// The class supports several kinds, from an easy number choice up to the
42 /// passport Word production and their confirmation for add-on. 44 /// passport Word production and their confirmation for add-on.
43 /// 45 ///
44 /// It has the header \ref DialogNumeric.h "#include <kodi/gui/DialogNumeric.h>" 46 /// It has the header \ref Numeric.h "#include <kodi/gui/dialogs/Numeric.h>"
45 /// be included to enjoy it. 47 /// be included to enjoy it.
46 /// 48 ///
47 namespace DialogNumeric 49 namespace Numeric
48 { 50 {
49 //========================================================================== 51 //==========================================================================
50 /// 52 ///
51 /// \ingroup cpp_kodi_gui_DialogNumeric 53 /// \ingroup cpp_kodi_gui_dialogs_Numeric
52 /// @brief Use dialog to get numeric new password 54 /// @brief Use dialog to get numeric new password
53 /// 55 ///
54 /// @param[out] newPassword String to preload into the keyboard 56 /// @param[out] newPassword String to preload into the keyboard
@@ -76,7 +78,7 @@ namespace gui
76 78
77 //========================================================================== 79 //==========================================================================
78 /// 80 ///
79 /// \ingroup cpp_kodi_gui_DialogNumeric 81 /// \ingroup cpp_kodi_gui_dialogs_Numeric
80 /// @brief Use dialog to verify numeric password. 82 /// @brief Use dialog to verify numeric password.
81 /// 83 ///
82 /// @param[in] password Password to compare with user input, need 84 /// @param[in] password Password to compare with user input, need
@@ -97,7 +99,7 @@ namespace gui
97 /// ~~~~~~~~~~~~~{.cpp} 99 /// ~~~~~~~~~~~~~{.cpp}
98 /// #include <stdio.h> /* fprintf */ 100 /// #include <stdio.h> /* fprintf */
99 /// #include <kodi/General.h> 101 /// #include <kodi/General.h>
100 /// #include <kodi/gui/DialogNumeric.h> 102 /// #include <kodi/gui/dialogs/Numeric.h>
101 /// 103 ///
102 /// /* 104 /// /*
103 /// * The example below shows the complete use of keyboard dialog for password 105 /// * The example below shows the complete use of keyboard dialog for password
@@ -123,7 +125,7 @@ namespace gui
123 /// /* 125 /// /*
124 /// * Ask the user about the password. 126 /// * Ask the user about the password.
125 /// */ 127 /// */
126 /// ret = kodi::gui::DialogNumeric::ShowAndVerifyPassword(password, "Demo numeric password call for PW '1234'", i); 128 /// ret = kodi::gui::dialogs::Numeric::ShowAndVerifyPassword(password, "Demo numeric password call for PW '1234'", i);
127 /// if (ret == 0) 129 /// if (ret == 0)
128 /// { 130 /// {
129 /// fprintf(stderr, "Numeric password successfull confirmed after '%i' tries\n", i+1); 131 /// fprintf(stderr, "Numeric password successfull confirmed after '%i' tries\n", i+1);
@@ -151,7 +153,7 @@ namespace gui
151 153
152 //========================================================================== 154 //==========================================================================
153 /// 155 ///
154 /// \ingroup cpp_kodi_gui_DialogNumeric 156 /// \ingroup cpp_kodi_gui_dialogs_Numeric
155 /// @brief Use dialog to verify numeric password 157 /// @brief Use dialog to verify numeric password
156 /// 158 ///
157 /// @param[in,out] toVerify Value to compare against user input. 159 /// @param[in,out] toVerify Value to compare against user input.
@@ -180,7 +182,7 @@ namespace gui
180 182
181 //========================================================================== 183 //==========================================================================
182 /// 184 ///
183 /// \ingroup cpp_kodi_gui_DialogNumeric 185 /// \ingroup cpp_kodi_gui_dialogs_Numeric
184 /// @brief Use dialog to get time value. 186 /// @brief Use dialog to get time value.
185 /// 187 ///
186 /// @param[out] time Overwritten with user input if 188 /// @param[out] time Overwritten with user input if
@@ -197,7 +199,7 @@ namespace gui
197 /// ~~~~~~~~~~~~~{.cpp} 199 /// ~~~~~~~~~~~~~{.cpp}
198 /// #include <stdio.h> /* printf */ 200 /// #include <stdio.h> /* printf */
199 /// #include <time.h> /* time_t, struct tm, time, localtime, strftime */ 201 /// #include <time.h> /* time_t, struct tm, time, localtime, strftime */
200 /// #include <kodi/gui/DialogNumeric.h> 202 /// #include <kodi/gui/dialogs/Numeric.h>
201 /// 203 ///
202 /// time_t rawtime; 204 /// time_t rawtime;
203 /// struct tm * timeinfo; 205 /// struct tm * timeinfo;
@@ -205,7 +207,7 @@ namespace gui
205 /// 207 ///
206 /// time (&rawtime); 208 /// time (&rawtime);
207 /// timeinfo = localtime(&rawtime); 209 /// timeinfo = localtime(&rawtime);
208 /// bool bRet = kodi::gui::DialogNumeric::ShowAndGetTime(*timeinfo, "Selected time test call"); 210 /// bool bRet = kodi::gui::dialogs::Numeric::ShowAndGetTime(*timeinfo, "Selected time test call");
209 /// strftime(buffer, sizeof(buffer), "%H:%M.", timeinfo); 211 /// strftime(buffer, sizeof(buffer), "%H:%M.", timeinfo);
210 /// printf("Selected time it's %s and was on Dialog %s\n", buffer, bRet ? "OK" : "Canceled"); 212 /// printf("Selected time it's %s and was on Dialog %s\n", buffer, bRet ? "OK" : "Canceled");
211 /// ~~~~~~~~~~~~~ 213 /// ~~~~~~~~~~~~~
@@ -219,7 +221,7 @@ namespace gui
219 221
220 //========================================================================== 222 //==========================================================================
221 /// 223 ///
222 /// \ingroup cpp_kodi_gui_DialogNumeric 224 /// \ingroup cpp_kodi_gui_dialogs_Numeric
223 /// @brief Use dialog to get date value. 225 /// @brief Use dialog to get date value.
224 /// 226 ///
225 /// @param[in,out] date Overwritten with user input if 227 /// @param[in,out] date Overwritten with user input if
@@ -236,7 +238,7 @@ namespace gui
236 /// ~~~~~~~~~~~~~{.cpp} 238 /// ~~~~~~~~~~~~~{.cpp}
237 /// #include <stdio.h> /* printf */ 239 /// #include <stdio.h> /* printf */
238 /// #include <time.h> /* time_t, struct tm, time, localtime, strftime */ 240 /// #include <time.h> /* time_t, struct tm, time, localtime, strftime */
239 /// #include <kodi/gui/DialogNumeric.h> 241 /// #include <kodi/gui/dialogs/Numeric.h>
240 /// 242 ///
241 /// time_t rawtime; 243 /// time_t rawtime;
242 /// struct tm * timeinfo; 244 /// struct tm * timeinfo;
@@ -244,7 +246,7 @@ namespace gui
244 /// 246 ///
245 /// time (&rawtime); 247 /// time (&rawtime);
246 /// timeinfo = localtime(&rawtime); 248 /// timeinfo = localtime(&rawtime);
247 /// bool bRet = kodi::gui::DialogNumeric::ShowAndGetDate(*timeinfo, "Selected date test call"); 249 /// bool bRet = kodi::gui::dialogs::Numeric::ShowAndGetDate(*timeinfo, "Selected date test call");
248 /// strftime(buffer, sizeof(buffer), "%Y-%m-%d", timeinfo); 250 /// strftime(buffer, sizeof(buffer), "%Y-%m-%d", timeinfo);
249 /// printf("Selected date it's %s and was on Dialog %s\n", buffer, bRet ? "OK" : "Canceled"); 251 /// printf("Selected date it's %s and was on Dialog %s\n", buffer, bRet ? "OK" : "Canceled");
250 /// ~~~~~~~~~~~~~ 252 /// ~~~~~~~~~~~~~
@@ -258,7 +260,7 @@ namespace gui
258 260
259 //========================================================================== 261 //==========================================================================
260 /// 262 ///
261 /// \ingroup cpp_kodi_gui_DialogNumeric 263 /// \ingroup cpp_kodi_gui_dialogs_Numeric
262 /// @brief Use dialog to get a IP 264 /// @brief Use dialog to get a IP
263 /// 265 ///
264 /// @param[in,out] ipAddress Overwritten with user input if 266 /// @param[in,out] ipAddress Overwritten with user input if
@@ -287,7 +289,7 @@ namespace gui
287 289
288 //========================================================================== 290 //==========================================================================
289 /// 291 ///
290 /// \ingroup cpp_kodi_gui_DialogNumeric 292 /// \ingroup cpp_kodi_gui_dialogs_Numeric
291 /// @brief Use dialog to get normal number. 293 /// @brief Use dialog to get normal number.
292 /// 294 ///
293 /// @param[in,out] input Overwritten with user input if 295 /// @param[in,out] input Overwritten with user input if
@@ -308,10 +310,10 @@ namespace gui
308 /// ~~~~~~~~~~~~~{.cpp} 310 /// ~~~~~~~~~~~~~{.cpp}
309 /// #include <stdio.h> /* printf */ 311 /// #include <stdio.h> /* printf */
310 /// #include <stdlib.h> /* strtoull (C++11) */ 312 /// #include <stdlib.h> /* strtoull (C++11) */
311 /// #include <kodi/gui/DialogNumeric.h> 313 /// #include <kodi/gui/dialogs/Numeric.h>
312 /// 314 ///
313 /// std::string number; 315 /// std::string number;
314 /// bool bRet = kodi::gui::DialogNumeric::ShowAndGetNumber(number, "Number test call"); 316 /// bool bRet = kodi::gui::dialogs::Numeric::ShowAndGetNumber(number, "Number test call");
315 /// printf("Written number input is : %llu and was %s\n", 317 /// printf("Written number input is : %llu and was %s\n",
316 /// strtoull(number.c_str(), nullptr, 0), bRet ? "OK" : "Canceled"); 318 /// strtoull(number.c_str(), nullptr, 0), bRet ? "OK" : "Canceled");
317 /// ~~~~~~~~~~~~~ 319 /// ~~~~~~~~~~~~~
@@ -334,7 +336,7 @@ namespace gui
334 336
335 //========================================================================== 337 //==========================================================================
336 /// 338 ///
337 /// \ingroup cpp_kodi_gui_DialogNumeric 339 /// \ingroup cpp_kodi_gui_dialogs_Numeric
338 /// @brief Show numeric keypad to get seconds. 340 /// @brief Show numeric keypad to get seconds.
339 /// 341 ///
340 /// @param[in,out] time Overwritten with user input if return=true and 342 /// @param[in,out] time Overwritten with user input if return=true and
@@ -362,5 +364,6 @@ namespace gui
362 }; 364 };
363 /// @} 365 /// @}
364 366
367} /* namespace dialogs */
365} /* namespace gui */ 368} /* namespace gui */
366} /* namespace kodi */ 369} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogOK.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/OK.h
index fa98241..12799b7 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogOK.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/OK.h
@@ -19,33 +19,35 @@
19 * 19 *
20 */ 20 */
21 21
22#include "../AddonBase.h" 22#include "../../AddonBase.h"
23#include "definitions.h" 23#include "../definitions.h"
24 24
25namespace kodi 25namespace kodi
26{ 26{
27namespace gui 27namespace gui
28{ 28{
29namespace dialogs
30{
29 31
30 //============================================================================ 32 //============================================================================
31 /// 33 ///
32 /// \defgroup cpp_kodi_gui_DialogOK Dialog OK 34 /// \defgroup cpp_kodi_gui_dialogs_OK Dialog OK
33 /// \ingroup cpp_kodi_gui 35 /// \ingroup cpp_kodi_gui
34 /// @{ 36 /// @{
35 /// @brief \cpp_namespace{ kodi::gui::DialogOK } 37 /// @brief \cpp_namespace{ kodi::gui::dialogs::OK }
36 /// **OK dialog** 38 /// **OK dialog**
37 /// 39 ///
38 /// The functions listed below permit the call of a dialogue of information, a 40 /// The functions listed below permit the call of a dialogue of information, a
39 /// confirmation of the user by press from OK required. 41 /// confirmation of the user by press from OK required.
40 /// 42 ///
41 /// It has the header \ref DialogOK.h "#include <kodi/gui/DialogOK.h>" 43 /// It has the header \ref OK.h "#include <kodi/gui/dialogs/OK.h>"
42 /// be included to enjoy it. 44 /// be included to enjoy it.
43 /// 45 ///
44 namespace DialogOK 46 namespace OK
45 { 47 {
46 //========================================================================== 48 //==========================================================================
47 /// 49 ///
48 /// \ingroup cpp_kodi_gui_DialogOK 50 /// \ingroup cpp_kodi_gui_dialogs_OK
49 /// @brief Use dialog to inform user with text and confirmation with OK with continued string. 51 /// @brief Use dialog to inform user with text and confirmation with OK with continued string.
50 /// 52 ///
51 /// @param[in] heading Dialog heading. 53 /// @param[in] heading Dialog heading.
@@ -56,9 +58,9 @@ namespace gui
56 /// 58 ///
57 /// **Example:** 59 /// **Example:**
58 /// ~~~~~~~~~~~~~{.cpp} 60 /// ~~~~~~~~~~~~~{.cpp}
59 /// #include <kodi/gui/DialogOK.h> 61 /// #include <kodi/gui/dialogs/OK.h>
60 /// ... 62 /// ...
61 /// kodi::gui::DialogOK::ShowAndGetInput("Test dialog", "Hello World!\nI'm a call from add-on\n :) :D"); 63 /// kodi::gui::dialogs::OK::ShowAndGetInput("Test dialog", "Hello World!\nI'm a call from add-on\n :) :D");
62 /// ~~~~~~~~~~~~~ 64 /// ~~~~~~~~~~~~~
63 /// 65 ///
64 inline void ShowAndGetInput(const std::string& heading, const std::string& text) 66 inline void ShowAndGetInput(const std::string& heading, const std::string& text)
@@ -71,7 +73,7 @@ namespace gui
71 73
72 //========================================================================== 74 //==========================================================================
73 /// 75 ///
74 /// \ingroup cpp_kodi_gui_DialogOK 76 /// \ingroup cpp_kodi_gui_dialogs_OK
75 /// @brief Use dialog to inform user with text and confirmation with OK with strings separated to the lines. 77 /// @brief Use dialog to inform user with text and confirmation with OK with strings separated to the lines.
76 /// 78 ///
77 /// @param[in] heading Dialog heading. 79 /// @param[in] heading Dialog heading.
@@ -84,9 +86,9 @@ namespace gui
84 /// 86 ///
85 /// **Example:** 87 /// **Example:**
86 /// ~~~~~~~~~~~~~{.cpp} 88 /// ~~~~~~~~~~~~~{.cpp}
87 /// #include <kodi/gui/DialogOK.h> 89 /// #include <kodi/gui/dialogs/OK.h>
88 /// ... 90 /// ...
89 /// kodi::gui::DialogOK::ShowAndGetInput("Test dialog", "Hello World!", "I'm a call from add-on", " :) :D"); 91 /// kodi::gui::dialogs::OK::ShowAndGetInput("Test dialog", "Hello World!", "I'm a call from add-on", " :) :D");
90 /// ~~~~~~~~~~~~~ 92 /// ~~~~~~~~~~~~~
91 /// 93 ///
92 inline void ShowAndGetInput(const std::string& heading, const std::string& line0, const std::string& line1, const std::string& line2) 94 inline void ShowAndGetInput(const std::string& heading, const std::string& line0, const std::string& line1, const std::string& line2)
@@ -100,5 +102,6 @@ namespace gui
100 } 102 }
101 /// @} 103 /// @}
102 104
105} /* namespace dialogs */
103} /* namespace gui */ 106} /* namespace gui */
104} /* namespace kodi */ 107} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogProgress.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Progress.h
index e652644..3f18499 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogProgress.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Progress.h
@@ -19,30 +19,32 @@
19 * 19 *
20 */ 20 */
21 21
22#include "definitions.h" 22#include "../definitions.h"
23#include "../AddonBase.h" 23#include "../../AddonBase.h"
24 24
25namespace kodi 25namespace kodi
26{ 26{
27namespace gui 27namespace gui
28{ 28{
29namespace dialogs
30{
29 31
30 //============================================================================ 32 //============================================================================
31 /// 33 ///
32 /// \defgroup cpp_kodi_gui_CDialogProgress Dialog Progress 34 /// \defgroup cpp_kodi_gui_dialogs_CProgress Dialog Progress
33 /// \ingroup cpp_kodi_gui 35 /// \ingroup cpp_kodi_gui
34 /// @brief \cpp_class{ kodi::gui::CDialogProgress } 36 /// @brief \cpp_class{ kodi::gui::dialogs::CProgress }
35 /// **Progress dialog shown in center** 37 /// **Progress dialog shown in center**
36 /// 38 ///
37 /// The with \ref DialogProgress.h "#include <kodi/gui/DialogProgress.h>" 39 /// The with \ref DialogProgress.h "#include <kodi/gui/dialogs/Progress.h>"
38 /// given class are basically used to create Kodi's progress dialog with named 40 /// given class are basically used to create Kodi's progress dialog with named
39 /// text fields. 41 /// text fields.
40 /// 42 ///
41 /// **Example:** 43 /// **Example:**
42 /// ~~~~~~~~~~~~~{.cpp} 44 /// ~~~~~~~~~~~~~{.cpp}
43 /// #include <kodi/gui/DialogProgress.h> 45 /// #include <kodi/gui/dialogs/Progress.h>
44 /// 46 ///
45 /// kodi::gui::CDialogProgress *progress = new kodi::gui::CDialogProgress; 47 /// kodi::gui::dialogs::CProgress *progress = new kodi::gui::dialogs::CProgress;
46 /// progress->SetHeading("Test progress"); 48 /// progress->SetHeading("Test progress");
47 /// progress->SetLine(1, "line 1"); 49 /// progress->SetLine(1, "line 1");
48 /// progress->SetLine(2, "line 2"); 50 /// progress->SetLine(2, "line 2");
@@ -58,29 +60,29 @@ namespace gui
58 /// delete progress; 60 /// delete progress;
59 /// ~~~~~~~~~~~~~ 61 /// ~~~~~~~~~~~~~
60 /// 62 ///
61 class CDialogProgress 63 class CProgress
62 { 64 {
63 public: 65 public:
64 //========================================================================== 66 //==========================================================================
65 /// 67 ///
66 /// \ingroup cpp_kodi_gui_CDialogProgress 68 /// \ingroup cpp_kodi_gui_dialogs_CProgress
67 /// @brief Construct a new dialog 69 /// @brief Construct a new dialog
68 /// 70 ///
69 CDialogProgress() 71 CProgress()
70 { 72 {
71 using namespace ::kodi::addon; 73 using namespace ::kodi::addon;
72 m_DialogHandle = CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->new_dialog(CAddonBase::m_interface->toKodi->kodiBase); 74 m_DialogHandle = CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->new_dialog(CAddonBase::m_interface->toKodi->kodiBase);
73 if (!m_DialogHandle) 75 if (!m_DialogHandle)
74 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::CDialogProgress can't create window class from Kodi !!!"); 76 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::dialogs::CProgress can't create window class from Kodi !!!");
75 } 77 }
76 //-------------------------------------------------------------------------- 78 //--------------------------------------------------------------------------
77 79
78 //========================================================================== 80 //==========================================================================
79 /// 81 ///
80 /// \ingroup cpp_kodi_gui_CDialogProgress 82 /// \ingroup cpp_kodi_gui_dialogs_CProgress
81 /// @brief Destructor 83 /// @brief Destructor
82 /// 84 ///
83 ~CDialogProgress() 85 ~CProgress()
84 { 86 {
85 using namespace ::kodi::addon; 87 using namespace ::kodi::addon;
86 if (m_DialogHandle) 88 if (m_DialogHandle)
@@ -90,7 +92,7 @@ namespace gui
90 92
91 //========================================================================== 93 //==========================================================================
92 /// 94 ///
93 /// \ingroup cpp_kodi_gui_CDialogProgress 95 /// \ingroup cpp_kodi_gui_dialogs_CProgress
94 /// @brief To open the dialog 96 /// @brief To open the dialog
95 /// 97 ///
96 void Open() 98 void Open()
@@ -102,7 +104,7 @@ namespace gui
102 104
103 //========================================================================== 105 //==========================================================================
104 /// 106 ///
105 /// \ingroup cpp_kodi_gui_CDialogProgress 107 /// \ingroup cpp_kodi_gui_dialogs_CProgress
106 /// @brief Set the heading title of dialog 108 /// @brief Set the heading title of dialog
107 /// 109 ///
108 /// @param[in] heading Title string to use 110 /// @param[in] heading Title string to use
@@ -116,7 +118,7 @@ namespace gui
116 118
117 //========================================================================== 119 //==========================================================================
118 /// 120 ///
119 /// \ingroup cpp_kodi_gui_CDialogProgress 121 /// \ingroup cpp_kodi_gui_dialogs_CProgress
120 /// @brief To set the line text field on dialog from 0 - 2 122 /// @brief To set the line text field on dialog from 0 - 2
121 /// 123 ///
122 /// @param[in] iLine Line number 124 /// @param[in] iLine Line number
@@ -131,7 +133,7 @@ namespace gui
131 133
132 //========================================================================== 134 //==========================================================================
133 /// 135 ///
134 /// \ingroup cpp_kodi_gui_CDialogProgress 136 /// \ingroup cpp_kodi_gui_dialogs_CProgress
135 /// @brief To enable and show cancel button on dialog 137 /// @brief To enable and show cancel button on dialog
136 /// 138 ///
137 /// @param[in] canCancel if true becomes it shown 139 /// @param[in] canCancel if true becomes it shown
@@ -145,7 +147,7 @@ namespace gui
145 147
146 //========================================================================== 148 //==========================================================================
147 /// 149 ///
148 /// \ingroup cpp_kodi_gui_CDialogProgress 150 /// \ingroup cpp_kodi_gui_dialogs_CProgress
149 /// @brief To check dialog for clicked cancel button 151 /// @brief To check dialog for clicked cancel button
150 /// 152 ///
151 /// @return True if canceled 153 /// @return True if canceled
@@ -159,7 +161,7 @@ namespace gui
159 161
160 //========================================================================== 162 //==========================================================================
161 /// 163 ///
162 /// \ingroup cpp_kodi_gui_CDialogProgress 164 /// \ingroup cpp_kodi_gui_dialogs_CProgress
163 /// @brief Get the current progress position as percent 165 /// @brief Get the current progress position as percent
164 /// 166 ///
165 /// @param[in] percentage Position to use from 0 to 100 167 /// @param[in] percentage Position to use from 0 to 100
@@ -173,7 +175,7 @@ namespace gui
173 175
174 //========================================================================== 176 //==========================================================================
175 /// 177 ///
176 /// \ingroup cpp_kodi_gui_CDialogProgress 178 /// \ingroup cpp_kodi_gui_dialogs_CProgress
177 /// @brief To set the current progress position as percent 179 /// @brief To set the current progress position as percent
178 /// 180 ///
179 /// @return Current Position used from 0 to 100 181 /// @return Current Position used from 0 to 100
@@ -187,7 +189,7 @@ namespace gui
187 189
188 //========================================================================== 190 //==========================================================================
189 /// 191 ///
190 /// \ingroup cpp_kodi_gui_CDialogProgress 192 /// \ingroup cpp_kodi_gui_dialogs_CProgress
191 /// @brief To show or hide progress bar dialog 193 /// @brief To show or hide progress bar dialog
192 /// 194 ///
193 /// @param[in] onOff If true becomes it shown 195 /// @param[in] onOff If true becomes it shown
@@ -201,7 +203,7 @@ namespace gui
201 203
202 //========================================================================== 204 //==========================================================================
203 /// 205 ///
204 /// \ingroup cpp_kodi_gui_CDialogProgress 206 /// \ingroup cpp_kodi_gui_dialogs_CProgress
205 /// @brief Set the maximum position of progress, needed if `SetProgressAdvance(...)` is used 207 /// @brief Set the maximum position of progress, needed if `SetProgressAdvance(...)` is used
206 /// 208 ///
207 /// @param[in] max Biggest usable position to use 209 /// @param[in] max Biggest usable position to use
@@ -215,7 +217,7 @@ namespace gui
215 217
216 //========================================================================== 218 //==========================================================================
217 /// 219 ///
218 /// \ingroup cpp_kodi_gui_CDialogProgress 220 /// \ingroup cpp_kodi_gui_dialogs_CProgress
219 /// @brief To increase progress bar by defined step size until reach of maximum position 221 /// @brief To increase progress bar by defined step size until reach of maximum position
220 /// 222 ///
221 /// @param[in] steps Step size to increase, default is 1 223 /// @param[in] steps Step size to increase, default is 1
@@ -229,7 +231,7 @@ namespace gui
229 231
230 //========================================================================== 232 //==========================================================================
231 /// 233 ///
232 /// \ingroup cpp_kodi_gui_CDialogProgress 234 /// \ingroup cpp_kodi_gui_dialogs_CProgress
233 /// @brief To check progress was canceled on work 235 /// @brief To check progress was canceled on work
234 /// 236 ///
235 /// @return True if aborted 237 /// @return True if aborted
@@ -245,5 +247,6 @@ namespace gui
245 void* m_DialogHandle; 247 void* m_DialogHandle;
246 }; 248 };
247 249
250} /* namespace dialogs */
248} /* namespace gui */ 251} /* namespace gui */
249} /* namespace kodi */ 252} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogSelect.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Select.h
index 36433db..963c84c 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogSelect.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/Select.h
@@ -19,41 +19,44 @@
19 * 19 *
20 */ 20 */
21 21
22#include "definitions.h" 22#include "../definitions.h"
23#include "../AddonBase.h" 23#include "../../AddonBase.h"
24 24
25namespace kodi 25namespace kodi
26{ 26{
27namespace gui 27namespace gui
28{ 28{
29namespace dialogs
30{
29 31
30 //============================================================================ 32 //============================================================================
31 /// 33 ///
32 /// \defgroup cpp_kodi_gui_DialogSelect Dialog Select 34 /// \defgroup cpp_kodi_gui_dialogs_Select Dialog Select
33 /// \ingroup cpp_kodi_gui 35 /// \ingroup cpp_kodi_gui
34 /// @{ 36 /// @{
35 /// @brief \cpp_namespace{ kodi::gui::DialogSelect } 37 /// @brief \cpp_namespace{ kodi::gui::dialogs::Select }
36 /// **Selection dialog** 38 /// **Selection dialog**
37 /// 39 ///
38 /// The function listed below permits the call of a dialogue to select of an 40 /// The function listed below permits the call of a dialogue to select of an
39 /// entry as a key 41 /// entry as a key
40 /// 42 ///
41 /// It has the header \ref DialogSelect.h "#include <kodi/gui/DialogSelect.h>" 43 /// It has the header \ref Select.h "#include <kodi/gui/dialogs/Select.h>"
42 /// be included to enjoy it. 44 /// be included to enjoy it.
43 /// 45 ///
44 /// 46 ///
45 namespace DialogSelect 47 namespace Select
46 { 48 {
47 //========================================================================== 49 //==========================================================================
48 /// 50 ///
49 /// \ingroup cpp_kodi_gui_DialogSelect 51 /// \ingroup cpp_kodi_gui_dialogs_Select
50 /// @brief Show a selection dialog about given parts. 52 /// @brief Show a selection dialog about given parts.
51 /// 53 ///
52 /// @param[in] heading Dialog heading name 54 /// @param[in] heading Dialog heading name
53 /// @param[in] entries String list about entries 55 /// @param[in] entries String list about entries
54 /// @param[in] selected [opt] Predefined selection (default is 56 /// @param[in] selected [opt] Predefined selection (default is
55 /// <tt>-1</tt> for the first) 57 /// <tt>-1</tt> for the first)
56 /// @param[in] autoclose [opt] To close dialog automatic after a time 58 /// @param[in] autoclose [opt] To close dialog automatic after the given
59 /// time in ms. As '0' it stays open.
57 /// @return The selected entry, if return <tt>-1</tt> was 60 /// @return The selected entry, if return <tt>-1</tt> was
58 /// nothing selected or canceled 61 /// nothing selected or canceled
59 /// 62 ///
@@ -62,7 +65,7 @@ namespace gui
62 /// 65 ///
63 /// **Example:** 66 /// **Example:**
64 /// ~~~~~~~~~~~~~{.cpp} 67 /// ~~~~~~~~~~~~~{.cpp}
65 /// #include <kodi/gui/DialogSelect.h> 68 /// #include <kodi/gui/dialogs/Select.h>
66 /// 69 ///
67 /// const std::vector<std::string> entries 70 /// const std::vector<std::string> entries
68 /// { 71 /// {
@@ -73,14 +76,14 @@ namespace gui
73 /// "Test 5" 76 /// "Test 5"
74 /// }; 77 /// };
75 /// 78 ///
76 /// int selected = kodi::gui::DialogSelect::Show("Test selection", entries, -1); 79 /// int selected = kodi::gui::dialogs::Select::Show("Test selection", entries, -1);
77 /// if (selected < 0) 80 /// if (selected < 0)
78 /// fprintf(stderr, "Item selection canceled\n"); 81 /// fprintf(stderr, "Item selection canceled\n");
79 /// else 82 /// else
80 /// fprintf(stderr, "Selected item is: %i\n", selected); 83 /// fprintf(stderr, "Selected item is: %i\n", selected);
81 /// ~~~~~~~~~~~~~ 84 /// ~~~~~~~~~~~~~
82 /// 85 ///
83 inline int Show(const std::string& heading, const std::vector<std::string>& entries, int selected = -1, bool autoclose = false) 86 inline int Show(const std::string& heading, const std::vector<std::string>& entries, int selected = -1, unsigned int autoclose = 0)
84 { 87 {
85 using namespace ::kodi::addon; 88 using namespace ::kodi::addon;
86 unsigned int size = entries.size(); 89 unsigned int size = entries.size();
@@ -97,5 +100,6 @@ namespace gui
97 }; 100 };
98 /// @} 101 /// @}
99 102
103} /* namespace dialogs */
100} /* namespace gui */ 104} /* namespace gui */
101} /* namespace kodi */ 105} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogTextViewer.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/TextViewer.h
index 09c81bd..c64bc1e 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogTextViewer.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/TextViewer.h
@@ -19,20 +19,22 @@
19 * 19 *
20 */ 20 */
21 21
22#include "definitions.h" 22#include "../definitions.h"
23#include "../AddonBase.h" 23#include "../../AddonBase.h"
24 24
25namespace kodi 25namespace kodi
26{ 26{
27namespace gui 27namespace gui
28{ 28{
29namespace dialogs
30{
29 31
30 //============================================================================ 32 //============================================================================
31 /// 33 ///
32 /// \defgroup cpp_kodi_gui_DialogTextViewer Dialog Text Viewer 34 /// \defgroup cpp_kodi_gui_dialogs_TextViewer Dialog Text Viewer
33 /// \ingroup cpp_kodi_gui 35 /// \ingroup cpp_kodi_gui
34 /// @{ 36 /// @{
35 /// @brief \cpp_namespace{ kodi::gui::DialogTextViewer } 37 /// @brief \cpp_namespace{ kodi::gui::dialogs::TextViewer }
36 /// **Text viewer dialog** 38 /// **Text viewer dialog**
37 /// 39 ///
38 /// The text viewer dialog can be used to display descriptions, help texts or 40 /// The text viewer dialog can be used to display descriptions, help texts or
@@ -42,14 +44,14 @@ namespace gui
42 /// in the <em>"./resources/language/resource.language.??_??/strings.po"</em> 44 /// in the <em>"./resources/language/resource.language.??_??/strings.po"</em>
43 /// to call with <b>std::string kodi::general::GetLocalizedString(...);</b>. 45 /// to call with <b>std::string kodi::general::GetLocalizedString(...);</b>.
44 /// 46 ///
45 /// It has the header \ref DialogTextViewer.h "#include <kodi/gui/DialogTextViewer.h>" 47 /// It has the header \ref TextViewer.h "#include <kodi/gui/dialogs/TextViewer.h>"
46 /// be included to enjoy it. 48 /// be included to enjoy it.
47 /// 49 ///
48 namespace DialogTextViewer 50 namespace TextViewer
49 { 51 {
50 //========================================================================== 52 //==========================================================================
51 /// 53 ///
52 /// \ingroup cpp_kodi_gui_DialogTextViewer 54 /// \ingroup cpp_kodi_gui_dialogs_TextViewer
53 /// @brief Show info text dialog 55 /// @brief Show info text dialog
54 /// 56 ///
55 /// @param[in] heading Small heading text 57 /// @param[in] heading Small heading text
@@ -60,9 +62,9 @@ namespace gui
60 /// 62 ///
61 /// **Example:** 63 /// **Example:**
62 /// ~~~~~~~~~~~~~{.cpp} 64 /// ~~~~~~~~~~~~~{.cpp}
63 /// #include <kodi/gui/DialogTextViewer.h> 65 /// #include <kodi/gui/dialogs/TextViewer.h>
64 /// 66 ///
65 /// kodi::gui::DialogTextViewer::Show("The Wizard of Oz (1939 film)", 67 /// kodi::gui::dialogs::TextViewer::Show("The Wizard of Oz (1939 film)",
66 /// "The Wizard of Oz is a 1939 American musical comedy-drama fantasy film " 68 /// "The Wizard of Oz is a 1939 American musical comedy-drama fantasy film "
67 /// "produced by Metro-Goldwyn-Mayer, and the most well-known and commercially " 69 /// "produced by Metro-Goldwyn-Mayer, and the most well-known and commercially "
68 /// "successful adaptation based on the 1900 novel The Wonderful Wizard of Oz " 70 /// "successful adaptation based on the 1900 novel The Wonderful Wizard of Oz "
@@ -111,5 +113,6 @@ namespace gui
111 }; 113 };
112 /// @} 114 /// @}
113 115
116} /* namespace dialogs */
114} /* namespace gui */ 117} /* namespace gui */
115} /* namespace kodi */ 118} /* namespace kodi */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogYesNo.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/YesNo.h
index 064bf8c..d9c34ff 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/DialogYesNo.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/YesNo.h
@@ -19,20 +19,22 @@
19 * 19 *
20 */ 20 */
21 21
22#include "definitions.h" 22#include "../definitions.h"
23#include "../AddonBase.h" 23#include "../../AddonBase.h"
24 24
25namespace kodi 25namespace kodi
26{ 26{
27namespace gui 27namespace gui
28{ 28{
29namespace dialogs
30{
29 31
30 //============================================================================ 32 //============================================================================
31 /// 33 ///
32 /// \defgroup cpp_kodi_gui_DialogYesNo Dialog Yes/No 34 /// \defgroup cpp_kodi_gui_dialogs_YesNo Dialog Yes/No
33 /// \ingroup cpp_kodi_gui 35 /// \ingroup cpp_kodi_gui
34 /// @{ 36 /// @{
35 /// @brief \cpp_namespace{ kodi::gui::DialogYesNo } 37 /// @brief \cpp_namespace{ kodi::gui::dialogs::YesNo }
36 /// **Yes / No dialog** 38 /// **Yes / No dialog**
37 /// 39 ///
38 /// The Yes / No dialog can be used to inform the user about questions and get 40 /// The Yes / No dialog can be used to inform the user about questions and get
@@ -42,15 +44,15 @@ namespace gui
42 /// in the <em>"./resources/language/resource.language.??_??/strings.po"</em> 44 /// in the <em>"./resources/language/resource.language.??_??/strings.po"</em>
43 /// to call with <b>std::string kodi::general::GetLocalizedString(...);</b>. 45 /// to call with <b>std::string kodi::general::GetLocalizedString(...);</b>.
44 /// 46 ///
45 /// It has the header \ref DialogYesNo.h "#include <kodi/gui/DialogYesNo.h>" 47 /// It has the header \ref YesNo.h "#include <kodi/gui/dialogs/YesNo.h>"
46 /// be included to enjoy it. 48 /// be included to enjoy it.
47 /// 49 ///
48 /// 50 ///
49 namespace DialogYesNo 51 namespace YesNo
50 { 52 {
51 //========================================================================== 53 //==========================================================================
52 /// 54 ///
53 /// \ingroup cpp_kodi_gui_DialogYesNo 55 /// \ingroup cpp_kodi_gui_dialogs_YesNo
54 /// @brief Use dialog to get numeric new password with one text string shown 56 /// @brief Use dialog to get numeric new password with one text string shown
55 /// everywhere and cancel return field 57 /// everywhere and cancel return field
56 /// 58 ///
@@ -68,10 +70,10 @@ namespace gui
68 /// 70 ///
69 /// **Example:** 71 /// **Example:**
70 /// ~~~~~~~~~~~~~{.cpp} 72 /// ~~~~~~~~~~~~~{.cpp}
71 /// #include <kodi/gui/DialogYesNo.h> 73 /// #include <kodi/gui/dialogs/YesNo.h>
72 /// 74 ///
73 /// bool canceled; 75 /// bool canceled;
74 /// bool ret = kodi::gui::DialogYesNo::ShowAndGetInput( 76 /// bool ret = kodi::gui::dialogs::YesNo::ShowAndGetInput(
75 /// "Yes / No test call", /* The Header */ 77 /// "Yes / No test call", /* The Header */
76 /// "You has opened Yes / No dialog for test\n\nIs this OK for you?", 78 /// "You has opened Yes / No dialog for test\n\nIs this OK for you?",
77 /// canceled, /* return value about cancel button */ 79 /// canceled, /* return value about cancel button */
@@ -95,7 +97,7 @@ namespace gui
95 97
96 //========================================================================== 98 //==========================================================================
97 /// 99 ///
98 /// \ingroup cpp_kodi_gui_DialogYesNo 100 /// \ingroup cpp_kodi_gui_dialogs_YesNo
99 /// @brief Use dialog to get numeric new password with separated line strings 101 /// @brief Use dialog to get numeric new password with separated line strings
100 /// 102 ///
101 /// @param[in] heading Dialog heading 103 /// @param[in] heading Dialog heading
@@ -111,9 +113,9 @@ namespace gui
111 /// 113 ///
112 /// **Example:** 114 /// **Example:**
113 /// ~~~~~~~~~~~~~{.cpp} 115 /// ~~~~~~~~~~~~~{.cpp}
114 /// #include <kodi/gui/DialogYesNo.h> 116 /// #include <kodi/gui/dialogs/YesNo.h>
115 /// 117 ///
116 /// bool ret = kodi::gui::DialogYesNo::ShowAndGetInput( 118 /// bool ret = kodi::gui::dialogs::YesNo::ShowAndGetInput(
117 /// "Yes / No test call", // The Header 119 /// "Yes / No test call", // The Header
118 /// "You has opened Yes / No dialog for test", 120 /// "You has opened Yes / No dialog for test",
119 /// "", 121 /// "",
@@ -137,7 +139,7 @@ namespace gui
137 139
138 //========================================================================== 140 //==========================================================================
139 /// 141 ///
140 /// \ingroup cpp_kodi_gui_DialogYesNo 142 /// \ingroup cpp_kodi_gui_dialogs_YesNo
141 /// @brief Use dialog to get numeric new password with separated line strings and cancel return field 143 /// @brief Use dialog to get numeric new password with separated line strings and cancel return field
142 /// 144 ///
143 /// @param[in] heading Dialog heading 145 /// @param[in] heading Dialog heading
@@ -154,10 +156,10 @@ namespace gui
154 /// 156 ///
155 /// **Example:** 157 /// **Example:**
156 /// ~~~~~~~~~~~~~{.cpp} 158 /// ~~~~~~~~~~~~~{.cpp}
157 /// #include <kodi/gui/DialogYesNo.h> 159 /// #include <kodi/gui/dialogs/YesNo.h>
158 /// 160 ///
159 /// bool canceled; 161 /// bool canceled;
160 /// bool ret = kodi::gui::DialogYesNo::ShowAndGetInput( 162 /// bool ret = kodi::gui::dialogs::YesNo::ShowAndGetInput(
161 /// "Yes / No test call", // The Header 163 /// "Yes / No test call", // The Header
162 /// "You has opened Yes / No dialog for test", 164 /// "You has opened Yes / No dialog for test",
163 /// "", 165 /// "",
@@ -183,5 +185,6 @@ namespace gui
183 }; 185 };
184 /// @} 186 /// @}
185 187
188} /* namespace dialogs */
186} /* namespace gui */ 189} /* namespace gui */
187} /* namespace kodi */ 190} /* namespace kodi */