kodi
Control.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "Alternative.h"
12 #include "ListItem.h"
13 #include "Tuple.h"
14 #include "guilib/GUIControl.h"
15 #include "guilib/GUIFont.h"
16 #include "input/actions/ActionIDs.h"
17 #include "swighelper.h"
18 #include "utils/ColorUtils.h"
19 
20 #include <vector>
21 
22 
23 // hardcoded offsets for button controls (and controls that use button controls)
24 // ideally they should be dynamically read in as with all the other properties.
25 #define CONTROL_TEXT_OFFSET_X 10
26 #define CONTROL_TEXT_OFFSET_Y 2
27 
28 namespace XBMCAddon
29 {
30  namespace xbmcgui
31  {
32 
60  //
61  class Control : public AddonClass
62  {
63  protected:
64  Control() = default;
65 
66  public:
67  ~Control() override;
68 
69 #ifndef SWIG
70  virtual CGUIControl* Create();
71 #endif
72 
73  // currently we only accept messages from a button or controllist with a select action
74  virtual bool canAcceptMessages(int actionId) { return false; }
75 
76 #ifdef DOXYGEN_SHOULD_USE_THIS
77  getId()
94 #else
95  virtual int getId() { return iControlId; }
96 #endif
97 
98  inline bool operator==(const Control& other) const { return iControlId == other.iControlId; }
99  inline bool operator>(const Control& other) const { return iControlId > other.iControlId; }
100  inline bool operator<(const Control& other) const { return iControlId < other.iControlId; }
101 
102  // hack this because it returns a tuple
103 #ifdef DOXYGEN_SHOULD_USE_THIS
104  getPosition();
121 #else
122  virtual std::vector<int> getPosition();
123 #endif
124 
125 #ifdef DOXYGEN_SHOULD_USE_THIS
126  getX();
143 #else
144  int getX() { return dwPosX; }
145 #endif
146 
147 #ifdef DOXYGEN_SHOULD_USE_THIS
148  getY();
165 #else
166  int getY() { return dwPosY; }
167 #endif
168 
169 #ifdef DOXYGEN_SHOULD_USE_THIS
170  getHeight();
187 #else
188  virtual int getHeight() { return dwHeight; }
189 #endif
190 
191  // getWidth() Method
192 #ifdef DOXYGEN_SHOULD_USE_THIS
193  getWidth();
210 #else
211  virtual int getWidth() { return dwWidth; }
212 #endif
213 
214  // setEnabled() Method
215 #ifdef DOXYGEN_SHOULD_USE_THIS
216  setEnabled(...);
233 #else
234  virtual void setEnabled(bool enabled);
235 #endif
236 
237  // setVisible() Method
238 #ifdef DOXYGEN_SHOULD_USE_THIS
239  setVisible(...);
260 #else
261  virtual void setVisible(bool visible);
262 #endif
263 
264  // isVisible() Method
265 #ifdef DOXYGEN_SHOULD_USE_THIS
266  isVisible(...);
285 #else
286  virtual bool isVisible();
287 #endif
288 
289  // setVisibleCondition() Method
290 #ifdef DOXYGEN_SHOULD_USE_THIS
291  setVisibleCondition(...);
315 #else
316  virtual void setVisibleCondition(const char* visible, bool allowHiddenFocus = false);
317 #endif
318 
319  // setEnableCondition() Method
320 #ifdef DOXYGEN_SHOULD_USE_THIS
321  setEnableCondition(...);
343 #else
344  virtual void setEnableCondition(const char* enable);
345 #endif
346 
347  // setAnimations() Method
348 #ifdef DOXYGEN_SHOULD_USE_THIS
349  setAnimations(...);
374 #else
375  virtual void setAnimations(const std::vector< Tuple<String,String> >& eventAttr);
376 #endif
377 
378  // setPosition() Method
379 #ifdef DOXYGEN_SHOULD_USE_THIS
380  setPosition(...);
400 #else
401  virtual void setPosition(long x, long y);
402 #endif
403 
404  // setWidth() Method
405 #ifdef DOXYGEN_SHOULD_USE_THIS
406  setWidth(...);
423 #else
424  virtual void setWidth(long width);
425 #endif
426 
427  // setHeight() Method
428 #ifdef DOXYGEN_SHOULD_USE_THIS
429  setHeight(...);
446 #else
447  virtual void setHeight(long height);
448 #endif
449 
450  // setNavigation() Method
451 #ifdef DOXYGEN_SHOULD_USE_THIS
452  //
478  setNavigation(...);
479 #else
480  virtual void setNavigation(const Control* up, const Control* down,
481  const Control* left, const Control* right);
482 #endif
483 
484  // controlUp() Method
485 #ifdef DOXYGEN_SHOULD_USE_THIS
486  controlUp(...);
510 #else
511  virtual void controlUp(const Control* up);
512 #endif
513 
514  // controlDown() Method
515 #ifdef DOXYGEN_SHOULD_USE_THIS
516  controlDown(...);
540 #else
541  virtual void controlDown(const Control* control);
542 #endif
543 
544  // controlLeft() Method
545 #ifdef DOXYGEN_SHOULD_USE_THIS
546  controlLeft(...);
570 #else
571  virtual void controlLeft(const Control* control);
572 #endif
573 
574  // controlRight() Method
575 #ifdef DOXYGEN_SHOULD_USE_THIS
576  controlRight(...);
600 #else
601  virtual void controlRight(const Control* control);
602 #endif
603 
604 #ifndef SWIG
605  int iControlId = 0;
606  int iParentId = 0;
607  int dwPosX = 0;
608  int dwPosY = 0;
609  int dwWidth = 0;
610  int dwHeight = 0;
611  int iControlUp = 0;
612  int iControlDown = 0;
613  int iControlLeft = 0;
614  int iControlRight = 0;
615  std::string m_label{};
616  bool m_visible{true};
617  CGUIControl* pGUIControl = nullptr;
618 #endif
619 
620  };
622 
649  class ControlSpin : public Control
650  {
651  public:
652  ~ControlSpin() override;
653 
654 #ifdef DOXYGEN_SHOULD_USE_THIS
655  setTextures(...);
688 #else
689  virtual void setTextures(const char* up, const char* down,
690  const char* upFocus,
691  const char* downFocus,
692  const char* upDisabled, const char* downDisabled);
693 #endif
694 
695 #ifndef SWIG
696  UTILS::COLOR::Color color;
697  std::string strTextureUp;
698  std::string strTextureDown;
699  std::string strTextureUpFocus;
700  std::string strTextureDownFocus;
701  std::string strTextureUpDisabled;
702  std::string strTextureDownDisabled;
703 #endif
704 
705  private:
706  ControlSpin();
707 
708  friend class Window;
709  friend class ControlList;
710 
711  };
713 
767  class ControlLabel : public Control
768  {
769  public:
770  ControlLabel(long x, long y, long width, long height, const String& label,
771  const char* font = NULL, const char* textColor = NULL,
772  const char* disabledColor = NULL,
773  long alignment = XBFONT_LEFT,
774  bool hasPath = false, long angle = 0);
775 
776  ~ControlLabel() override;
777 
778 #ifdef DOXYGEN_SHOULD_USE_THIS
779  getLabel();
796 #else
797  virtual String getLabel();
798 #endif
799 
800 #ifdef DOXYGEN_SHOULD_USE_THIS
801  setLabel(...);
829 #else
830  virtual void setLabel(const String& label = emptyString,
831  const char* font = NULL,
832  const char* textColor = NULL,
833  const char* disabledColor = NULL,
834  const char* shadowColor = NULL,
835  const char* focusedColor = NULL,
836  const String& label2 = emptyString);
837 #endif
838 
839 #ifndef SWIG
840  ControlLabel() = default;
841 
842  std::string strFont;
843  std::string strText;
844  UTILS::COLOR::Color textColor;
845  UTILS::COLOR::Color disabledColor;
846  uint32_t align;
847  bool bHasPath = false;
848  int iAngle = 0;
849 
850  CGUIControl* Create() override;
851 
852 #endif
853  };
855 
856  // ControlEdit class
914  class ControlEdit : public Control
915  {
916  public:
917  ControlEdit(long x, long y, long width, long height, const String& label,
918  const char* font = NULL, const char* textColor = NULL,
919  const char* disabledColor = NULL,
920  long _alignment = XBFONT_LEFT, const char* focusTexture = NULL,
921  const char* noFocusTexture = NULL);
922 
923 
924  // setLabel() Method
925 #ifdef DOXYGEN_SHOULD_USE_THIS
926  setLabel(...);
954 #else
955  virtual void setLabel(const String& label = emptyString,
956  const char* font = NULL,
957  const char* textColor = NULL,
958  const char* disabledColor = NULL,
959  const char* shadowColor = NULL,
960  const char* focusedColor = NULL,
961  const String& label2 = emptyString);
962 #endif
963 
964  // getLabel() Method
965 #ifdef DOXYGEN_SHOULD_USE_THIS
966  getLabel();
983 #else
984  virtual String getLabel();
985 #endif
986 
987  // setText() Method
988 #ifdef DOXYGEN_SHOULD_USE_THIS
989  setText(...);
1006 #else
1007  virtual void setText(const String& text);
1008 #endif
1009 
1010  // getText() Method
1011 #ifdef DOXYGEN_SHOULD_USE_THIS
1012  getText();
1030 #else
1031  virtual String getText();
1032 #endif
1033 
1034 #ifndef SWIG
1035  ControlEdit() = default;
1036 
1037  std::string strFont;
1038  std::string strText;
1039  std::string strTextureFocus;
1040  std::string strTextureNoFocus;
1041  UTILS::COLOR::Color textColor;
1042  UTILS::COLOR::Color disabledColor;
1043  uint32_t align;
1044 
1045  CGUIControl* Create() override;
1046 #endif
1047 
1048  // setType() Method
1049 #ifdef DOXYGEN_SHOULD_USE_THIS
1050  setType(...);
1082 #else
1083  virtual void setType(int type, const String& heading);
1084 #endif
1085  };
1087 
1088  // ControlList class
1152  class ControlList : public Control
1153  {
1154  void internAddListItem(const AddonClass::Ref<ListItem>& listitem, bool sendMessage);
1155 
1156  public:
1157  ControlList(long x, long y, long width, long height, const char* font = NULL,
1158  const char* textColor = NULL, const char* buttonTexture = NULL,
1159  const char* buttonFocusTexture = NULL,
1160  const char* selectedColor = NULL,
1161  long _imageWidth=10, long _imageHeight=10, long _itemTextXOffset = CONTROL_TEXT_OFFSET_X,
1162  long _itemTextYOffset = CONTROL_TEXT_OFFSET_Y, long _itemHeight = 27, long _space = 2,
1163  long _alignmentY = XBFONT_CENTER_Y);
1164 
1165  ~ControlList() override;
1166 
1167 #ifdef DOXYGEN_SHOULD_USE_THIS
1168  addItem(...);
1185 #else
1186  virtual void addItem(const Alternative<String, const XBMCAddon::xbmcgui::ListItem* > & item, bool sendMessage = true);
1187 #endif
1188 
1189 #ifdef DOXYGEN_SHOULD_USE_THIS
1190  addItems(...);
1211 #else
1212  virtual void addItems(const std::vector<Alternative<String, const XBMCAddon::xbmcgui::ListItem* > > & items);
1213 #endif
1214 
1215 #ifdef DOXYGEN_SHOULD_USE_THIS
1216  selectItem(...);
1233 #else
1234  virtual void selectItem(long item);
1235 #endif
1236 
1237 #ifdef DOXYGEN_SHOULD_USE_THIS
1238  removeItem(...);
1256 #else
1257  virtual void removeItem(int index);
1258 #endif
1259 
1260 #ifdef DOXYGEN_SHOULD_USE_THIS
1261  reset();
1302 #else
1303  virtual void reset();
1304 #endif
1305 
1306 #ifdef DOXYGEN_SHOULD_USE_THIS
1307  getSpinControl();
1326 #else
1327  virtual Control* getSpinControl();
1328 #endif
1329 
1330 #ifdef DOXYGEN_SHOULD_USE_THIS
1331  getSelectedPosition();
1348 #else
1349  virtual long getSelectedPosition();
1350 #endif
1351 
1352 #ifdef DOXYGEN_SHOULD_USE_THIS
1353  getSelectedItem();
1375 #else
1376  virtual XBMCAddon::xbmcgui::ListItem* getSelectedItem();
1377 #endif
1378 
1379  // setImageDimensions() method
1380 #ifdef DOXYGEN_SHOULD_USE_THIS
1381  setImageDimensions(...);
1399 #else
1400  virtual void setImageDimensions(long imageWidth,long imageHeight);
1401 #endif
1402 
1403  // setItemHeight() method
1404 #ifdef DOXYGEN_SHOULD_USE_THIS
1405  setItemHeight(...);
1422 #else
1423  virtual void setItemHeight(long height);
1424 #endif
1425 
1426  // setSpace() method
1427 #ifdef DOXYGEN_SHOULD_USE_THIS
1428  setSpace(...);
1446 #else
1447  virtual void setSpace(int space);
1448 #endif
1449 
1450  // setPageControlVisible() method
1451 #ifdef DOXYGEN_SHOULD_USE_THIS
1452  setPageControlVisible(...);
1470 #else
1471  virtual void setPageControlVisible(bool visible);
1472 #endif
1473 
1474  // size() method
1475 #ifdef DOXYGEN_SHOULD_USE_THIS
1476  size();
1494 #else
1495  virtual long size();
1496 #endif
1497 
1498  // getItemHeight() Method
1499 #ifdef DOXYGEN_SHOULD_USE_THIS
1500  getItemHeight();
1518 #else
1519  virtual long getItemHeight();
1520 #endif
1521 
1522  // getSpace() Method
1523 #ifdef DOXYGEN_SHOULD_USE_THIS
1524  getSpace();
1542 #else
1543  virtual long getSpace();
1544 #endif
1545 
1546  // getListItem() method
1547 #ifdef DOXYGEN_SHOULD_USE_THIS
1548  getListItem(...);
1568 #else
1569  virtual XBMCAddon::xbmcgui::ListItem* getListItem(int index);
1570 #endif
1571 
1572 #ifdef DOXYGEN_SHOULD_USE_THIS
1573  setStaticContent(...);
1593 #else
1594  virtual void setStaticContent(const ListItemList* items);
1595 #endif
1596 
1597 #ifndef SWIG
1598  void sendLabelBind(int tail);
1599 
1600  bool canAcceptMessages(int actionId) override
1601  { return ((actionId == ACTION_SELECT_ITEM) | (actionId == ACTION_MOUSE_LEFT_CLICK)); }
1602 
1603  // This is called from AddonWindow.cpp but shouldn't be available
1604  // to the scripting languages.
1605  ControlList() = default;
1606 
1607  std::vector<AddonClass::Ref<ListItem> > vecItems;
1608  std::string strFont;
1609  AddonClass::Ref<ControlSpin> pControlSpin;
1610 
1611  UTILS::COLOR::Color textColor;
1612  UTILS::COLOR::Color selectedColor;
1613  std::string strTextureButton;
1614  std::string strTextureButtonFocus;
1615 
1616  int imageHeight = 0;
1617  int imageWidth = 0;
1618  int itemHeight = 0;
1619  int space = 0;
1620 
1621  int itemTextOffsetX = 0;
1622  int itemTextOffsetY = 0;
1623  uint32_t alignmentY;
1624 
1625  CGUIControl* Create() override;
1626 #endif
1627  };
1629 
1630  // ControlFadeLabel class
1685  class ControlFadeLabel : public Control
1686  {
1687  public:
1688  ControlFadeLabel(long x, long y, long width, long height,
1689  const char* font = NULL,
1690  const char* textColor = NULL,
1691  long _alignment = XBFONT_LEFT);
1692 
1693  // addLabel() Method
1694 #ifdef DOXYGEN_SHOULD_USE_THIS
1695  addLabel(...);
1714 #else
1715  virtual void addLabel(const String& label);
1716 #endif
1717 
1718 #ifdef DOXYGEN_SHOULD_USE_THIS
1719  setScrolling(...);
1738 #else
1739  virtual void setScrolling(bool scroll);
1740 #endif
1741 
1742 #ifdef DOXYGEN_SHOULD_USE_THIS
1743  reset();
1758 #else
1759  virtual void reset();
1760 #endif
1761 
1762 #ifndef SWIG
1763  std::string strFont;
1764  UTILS::COLOR::Color textColor;
1765  std::vector<std::string> vecLabels;
1766  uint32_t align;
1767 
1768  CGUIControl* Create() override;
1769 
1770  ControlFadeLabel() = default;
1771 #endif
1772  };
1774 
1775  // ControlTextBox class
1826  class ControlTextBox : public Control
1827  {
1828  public:
1829  ControlTextBox(long x, long y, long width, long height,
1830  const char* font = NULL,
1831  const char* textColor = NULL);
1832 
1833  // SetText() Method
1834 #ifdef DOXYGEN_SHOULD_USE_THIS
1835  setText(...);
1857 #else
1858  virtual void setText(const String& text);
1859 #endif
1860 
1861  // getText() Method
1862 #ifdef DOXYGEN_SHOULD_USE_THIS
1863  getText();
1883 #else
1884  virtual String getText();
1885 #endif
1886 
1887  // reset() Method
1888 #ifdef DOXYGEN_SHOULD_USE_THIS
1889  reset();
1906 #else
1907  virtual void reset();
1908 #endif
1909 
1910  // scroll() Method
1911 #ifdef DOXYGEN_SHOULD_USE_THIS
1912  scroll(...);
1933 #else
1934  virtual void scroll(long id);
1935 #endif
1936 
1937  // autoScroll() Method
1938 #ifdef DOXYGEN_SHOULD_USE_THIS
1939  autoScroll(...);
1962 #else
1963  virtual void autoScroll(int delay, int time, int repeat);
1964 #endif
1965 
1966 #ifndef SWIG
1967  std::string strFont;
1968  UTILS::COLOR::Color textColor;
1969 
1970  CGUIControl* Create() override;
1971 
1972  ControlTextBox() = default;
1973 #endif
1974  };
1976 
1977  // ControlImage class
2020  class ControlImage : public Control
2021  {
2022  public:
2023  ControlImage(long x, long y, long width, long height,
2024  const char* filename, long aspectRatio = 0,
2025  const char* colorDiffuse = NULL);
2026 
2027 #ifdef DOXYGEN_SHOULD_USE_THIS
2028  setImage(...);
2051 #else
2052  virtual void setImage(const char* imageFilename, const bool useCache = true);
2053 #endif
2054 
2055 #ifdef DOXYGEN_SHOULD_USE_THIS
2056  setColorDiffuse(...);
2076 #else
2077  virtual void setColorDiffuse(const char* hexString);
2078 #endif
2079 
2080 #ifndef SWIG
2081  ControlImage() = default;
2082 
2083  std::string strFileName;
2084  int aspectRatio = 0;
2085  UTILS::COLOR::Color colorDiffuse;
2086 
2087  CGUIControl* Create() override;
2088 #endif
2089  };
2091 
2092  // ControlImage class
2158  class ControlProgress : public Control
2159  {
2160  public:
2161  ControlProgress(long x, long y, long width, long height,
2162  const char* texturebg = NULL,
2163  const char* textureleft = NULL,
2164  const char* texturemid = NULL,
2165  const char* textureright = NULL,
2166  const char* textureoverlay = NULL);
2167 
2168 #ifdef DOXYGEN_SHOULD_USE_THIS
2169  setPercent(...);
2191 #else
2192  virtual void setPercent(float pct);
2193 #endif
2194 
2195 #ifdef DOXYGEN_SHOULD_USE_THIS
2196  getPercent();
2215 #else
2216  virtual float getPercent();
2217 #endif
2218 
2219 #ifndef SWIG
2220  std::string strTextureLeft;
2221  std::string strTextureMid;
2222  std::string strTextureRight;
2223  std::string strTextureBg;
2224  std::string strTextureOverlay;
2225  int aspectRatio = 0;
2226  UTILS::COLOR::Color colorDiffuse;
2227 
2228  CGUIControl* Create() override;
2229  ControlProgress() = default;
2230 #endif
2231  };
2233 
2234  // ControlButton class
2304  class ControlButton : public Control
2305  {
2306  public:
2307  ControlButton(long x, long y, long width, long height, const String& label,
2308  const char* focusTexture = NULL, const char* noFocusTexture = NULL,
2309  long textOffsetX = CONTROL_TEXT_OFFSET_X,
2310  long textOffsetY = CONTROL_TEXT_OFFSET_Y,
2311  long alignment = (XBFONT_LEFT | XBFONT_CENTER_Y),
2312  const char* font = NULL, const char* textColor = NULL,
2313  const char* disabledColor = NULL, long angle = 0,
2314  const char* shadowColor = NULL, const char* focusedColor = NULL);
2315 
2316  // setLabel() Method
2317 #ifdef DOXYGEN_SHOULD_USE_THIS
2318  setLabel(...);
2347 #else
2348  virtual void setLabel(const String& label = emptyString,
2349  const char* font = NULL,
2350  const char* textColor = NULL,
2351  const char* disabledColor = NULL,
2352  const char* shadowColor = NULL,
2353  const char* focusedColor = NULL,
2354  const String& label2 = emptyString);
2355 #endif
2356 
2357  // setDisabledColor() Method
2358 #ifdef DOXYGEN_SHOULD_USE_THIS
2359  setDisabledColor(...);
2378 #else
2379  virtual void setDisabledColor(const char* color);
2380 #endif
2381 
2382  // getLabel() Method
2383 #ifdef DOXYGEN_SHOULD_USE_THIS
2384  getLabel();
2403 #else
2404  virtual String getLabel();
2405 #endif
2406 
2407  // getLabel2() Method
2408 #ifdef DOXYGEN_SHOULD_USE_THIS
2409  getLabel2();
2428 #else
2429  virtual String getLabel2();
2430 #endif
2431 
2432 #ifndef SWIG
2433  bool canAcceptMessages(int actionId) override { return true; }
2434 
2435  int textOffsetX = 0;
2436  int textOffsetY = 0;
2437  UTILS::COLOR::Color align;
2438  std::string strFont;
2439  UTILS::COLOR::Color textColor;
2440  UTILS::COLOR::Color disabledColor;
2441  int iAngle = 0;
2442  int shadowColor = 0;
2443  int focusedColor = 0;
2444  std::string strText;
2445  std::string strText2;
2446  std::string strTextureFocus;
2447  std::string strTextureNoFocus;
2448 
2449  CGUIControl* Create() override;
2450 
2451  ControlButton() = default;
2452 #endif
2453  };
2455 
2456  // ControlGroup class
2493  class ControlGroup : public Control
2494  {
2495  public:
2496  ControlGroup(long x, long y, long width, long height);
2497 
2498 #ifndef SWIG
2499  CGUIControl* Create() override;
2500 
2501  inline ControlGroup() = default;
2502 #endif
2503  };
2505 
2506  // ControlRadioButton class
2581  {
2582  public:
2583  ControlRadioButton(long x, long y, long width, long height, const String& label,
2584  const char* focusOnTexture = NULL, const char* noFocusOnTexture = NULL,
2585  const char* focusOffTexture = NULL, const char* noFocusOffTexture = NULL,
2586  const char* focusTexture = NULL, const char* noFocusTexture = NULL,
2587  long textOffsetX = CONTROL_TEXT_OFFSET_X,
2588  long textOffsetY = CONTROL_TEXT_OFFSET_Y,
2589  long _alignment = (XBFONT_LEFT | XBFONT_CENTER_Y),
2590  const char* font = NULL, const char* textColor = NULL,
2591  const char* disabledColor = NULL, long angle = 0,
2592  const char* shadowColor = NULL, const char* focusedColor = NULL,
2593  const char* disabledOnTexture = NULL, const char* disabledOffTexture = NULL);
2594 
2595  // setSelected() Method
2596 #ifdef DOXYGEN_SHOULD_USE_THIS
2597  setSelected(...);
2620 #else
2621  virtual void setSelected(bool selected);
2622 #endif
2623 
2624  // isSelected() Method
2625 #ifdef DOXYGEN_SHOULD_USE_THIS
2626  isSelected();
2644 #else
2645  virtual bool isSelected();
2646 #endif
2647 
2648  // setLabel() Method
2649 #ifdef DOXYGEN_SHOULD_USE_THIS
2650  setLabel(...);
2686 #else
2687  virtual void setLabel(const String& label = emptyString,
2688  const char* font = NULL,
2689  const char* textColor = NULL,
2690  const char* disabledColor = NULL,
2691  const char* shadowColor = NULL,
2692  const char* focusedColor = NULL,
2693  const String& label2 = emptyString);
2694 #endif
2695 
2696  // setRadioDimension() Method
2697 #ifdef DOXYGEN_SHOULD_USE_THIS
2698  setRadioDimension(...);
2724 #else
2725  virtual void setRadioDimension(long x, long y, long width, long height);
2726 #endif
2727 
2728 #ifndef SWIG
2729  bool canAcceptMessages(int actionId) override { return true; }
2730 
2731  std::string strFont;
2732  std::string strText;
2733  std::string strTextureFocus;
2734  std::string strTextureNoFocus;
2735  std::string strTextureRadioOnFocus;
2736  std::string strTextureRadioOnNoFocus;
2737  std::string strTextureRadioOffFocus;
2738  std::string strTextureRadioOffNoFocus;
2739  std::string strTextureRadioOnDisabled;
2740  std::string strTextureRadioOffDisabled;
2741  UTILS::COLOR::Color textColor;
2742  UTILS::COLOR::Color disabledColor;
2743  int textOffsetX = 0;
2744  int textOffsetY = 0;
2745  uint32_t align;
2746  int iAngle = 0;
2747  UTILS::COLOR::Color shadowColor;
2748  UTILS::COLOR::Color focusedColor;
2749 
2750  CGUIControl* Create() override;
2751 
2752  ControlRadioButton() = default;
2753 #endif
2754  };
2756 
2799  class ControlSlider : public Control
2800  {
2801  public:
2802  ControlSlider(long x,
2803  long y,
2804  long width,
2805  long height,
2806  const char* textureback = NULL,
2807  const char* texture = NULL,
2808  const char* texturefocus = NULL,
2809  int orientation = 1,
2810  const char* texturebackdisabled = NULL,
2811  const char* texturedisabled = NULL);
2812 
2813 #ifdef DOXYGEN_SHOULD_USE_THIS
2814  getPercent();
2832 #else
2833  virtual float getPercent();
2834 #endif
2835 
2836 #ifdef DOXYGEN_SHOULD_USE_THIS
2837  setPercent(...);
2855 #else
2856  virtual void setPercent(float pct);
2857 #endif
2858 
2859 #ifdef DOXYGEN_SHOULD_USE_THIS
2860  getInt();
2879 #else
2880  virtual int getInt();
2881 #endif
2882 
2883 #ifdef DOXYGEN_SHOULD_USE_THIS
2884  setInt(...);
2906 #else
2907  virtual void setInt(int value, int min, int delta, int max);
2908 #endif
2909 
2910 #ifdef DOXYGEN_SHOULD_USE_THIS
2911  getFloat();
2930 #else
2931  virtual float getFloat();
2932 #endif
2933 
2934 #ifdef DOXYGEN_SHOULD_USE_THIS
2935  setFloat(...);
2957 #else
2958  virtual void setFloat(float value, float min, float delta, float max);
2959 #endif
2960 
2961 #ifndef SWIG
2962  std::string strTextureBack;
2963  std::string strTextureBackDisabled;
2964  std::string strTexture;
2965  std::string strTextureFoc;
2966  std::string strTextureDisabled;
2967  int iOrientation;
2968 
2969  CGUIControl* Create() override;
2970 
2971  inline ControlSlider() = default;
2972 #endif
2973  };
2975  }
2976 }
Definition: Control.h:649
constexpr int XBFONT_LEFT
Align X left.
Definition: GUIFont.h:39
constexpr int XBFONT_CENTER_Y
Align Y center.
Definition: GUIFont.h:42
Definition: Control.h:2020
Definition: Control.h:2304
This class is a smart pointer for a Referenced class.
Definition: AddonClass.h:154
Definition: Control.h:61
Definition: Control.h:1685
Base class for controls.
Definition: GUIControl.h:83
Definition: Control.h:1826
Definition: Control.h:2158
Definition: Control.h:2493
Definition: Control.h:2799
Defining LOG_LIFECYCLE_EVENTS will log all instantiations, deletions and also reference countings (in...
Definition: Addon.cpp:25
Definition: ListItem.h:53
Definition: Control.h:2580
Definition: Control.h:767
Definition: Window.h:186
Definition: Alternative.h:17
Definition: Control.h:914
This class is the superclass for all reference counted classes in the api.
Definition: AddonClass.h:57
Definition: Tuple.h:32
Definition: Control.h:1152