summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2017-07-23 16:59:43 +0200
committermanuel <manuel@mausz.at>2017-07-23 16:59:43 +0200
commit4c3251ec645c8b71820dab7e51e612e5919d4e75 (patch)
tree9533268a93e58fc2e16de1b8ee3fafe3784e5225 /xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h
parentf44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (diff)
downloadkodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.tar.gz
kodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.tar.bz2
kodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.zip
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h385
1 files changed, 384 insertions, 1 deletions
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