summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/FadeLabel.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-07-02 23:09:26 +0200
committermanuel <manuel@mausz.at>2020-07-02 23:09:26 +0200
commit5f8335c1e49ce108ef3481863833c98efa00411b (patch)
treef02b5c1c9765bb6a14c8eb42bb4f81b9face0b55 /xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/FadeLabel.h
parente317daf081a1048904fdf0b548946fa3ba6593a7 (diff)
downloadkodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.tar.gz
kodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.tar.bz2
kodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.zip
sync with upstreamHEADmaster
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/FadeLabel.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/FadeLabel.h227
1 files changed, 116 insertions, 111 deletions
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
index aab8929..02c843f 100644
--- 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
@@ -18,130 +18,135 @@ namespace gui
18namespace controls 18namespace controls
19{ 19{
20 20
21 //============================================================================ 21//============================================================================
22///
23/// \defgroup cpp_kodi_gui_controls_CFadeLabel Control Fade Label
24/// \ingroup cpp_kodi_gui
25/// @brief \cpp_class{ kodi::gui::controls::CFadeLabel }
26/// **Window control used to show multiple pieces of text in the same position,
27/// by fading from one to the other**
28///
29/// The fade label control is used for displaying multiple pieces of text in
30/// the same space in Kodi. You can choose the font, size, colour, location
31/// and contents of the text to be displayed. The first piece of information
32/// to display fades in over 50 frames, then scrolls off to the left. Once it
33/// is finished scrolling off screen, the second piece of information fades
34/// in and the process repeats. A fade label control is not supported in a
35/// list container.
36///
37/// It has the header \ref FadeLabel.h "#include <kodi/gui/controls/FadeLabel.h>"
38/// be included to enjoy it.
39///
40/// Here you find the needed skin part for a \ref Fade_Label_Control "fade label control"
41///
42/// @note The call of the control is only possible from the corresponding
43/// window as its class and identification number is required.
44///
45class ATTRIBUTE_HIDDEN CFadeLabel : public CAddonGUIControlBase
46{
47public:
48 //==========================================================================
22 /// 49 ///
23 /// \defgroup cpp_kodi_gui_controls_CFadeLabel Control Fade Label 50 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
24 /// \ingroup cpp_kodi_gui 51 /// @brief Construct a new control.
25 /// @brief \cpp_class{ kodi::gui::controls::CFadeLabel }
26 /// **Window control used to show multiple pieces of text in the same position,
27 /// by fading from one to the other**
28 /// 52 ///
29 /// The fade label control is used for displaying multiple pieces of text in 53 /// @param[in] window related window control class
30 /// the same space in Kodi. You can choose the font, size, colour, location 54 /// @param[in] controlId Used skin xml control id
31 /// and contents of the text to be displayed. The first piece of information
32 /// to display fades in over 50 frames, then scrolls off to the left. Once it
33 /// is finished scrolling off screen, the second piece of information fades
34 /// in and the process repeats. A fade label control is not supported in a
35 /// list container.
36 /// 55 ///
37 /// It has the header \ref FadeLabel.h "#include <kodi/gui/controls/FadeLabel.h>" 56 CFadeLabel(CWindow* window, int controlId) : CAddonGUIControlBase(window)
38 /// be included to enjoy it. 57 {
58 m_controlHandle = m_interface->kodi_gui->window->get_control_fade_label(
59 m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
60 if (!m_controlHandle)
61 kodi::Log(ADDON_LOG_FATAL,
62 "kodi::gui::controls::CFadeLabel can't create control class from Kodi !!!");
63 }
64 //--------------------------------------------------------------------------
65
66 //==========================================================================
39 /// 67 ///
40 /// Here you find the needed skin part for a \ref Fade_Label_Control "fade label control" 68 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
69 /// @brief Destructor.
70 ///
71 ~CFadeLabel() override = default;
72 //--------------------------------------------------------------------------
73
74 //==========================================================================
41 /// 75 ///
42 /// @note The call of the control is only possible from the corresponding 76 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
43 /// window as its class and identification number is required. 77 /// @brief Set the control on window to visible.
44 /// 78 ///
45 class CFadeLabel : public CAddonGUIControlBase 79 /// @param[in] visible If true visible, otherwise hidden
80 ///
81 void SetVisible(bool visible)
46 { 82 {
47 public: 83 m_interface->kodi_gui->control_fade_label->set_visible(m_interface->kodiBase, m_controlHandle,
48 //========================================================================== 84 visible);
49 /// 85 }
50 /// \ingroup cpp_kodi_gui_controls_CFadeLabel 86 //--------------------------------------------------------------------------
51 /// @brief Construct a new control.
52 ///
53 /// @param[in] window related window control class
54 /// @param[in] controlId Used skin xml control id
55 ///
56 CFadeLabel(CWindow* window, int controlId)
57 : CAddonGUIControlBase(window)
58 {
59 m_controlHandle = m_interface->kodi_gui->window->get_control_fade_label(m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
60 if (!m_controlHandle)
61 kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CFadeLabel can't create control class from Kodi !!!");
62 }
63 //--------------------------------------------------------------------------
64
65 //==========================================================================
66 ///
67 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
68 /// @brief Destructor.
69 ///
70 ~CFadeLabel() override = default;
71 //--------------------------------------------------------------------------
72 87
73 //========================================================================== 88 //==========================================================================
74 /// 89 ///
75 /// \ingroup cpp_kodi_gui_controls_CFadeLabel 90 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
76 /// @brief Set the control on window to visible. 91 /// @brief To add additional text string on fade label.
77 /// 92 ///
78 /// @param[in] visible If true visible, otherwise hidden 93 /// @param[in] label Text to show
79 /// 94 ///
80 void SetVisible(bool visible) 95 void AddLabel(const std::string& label)
81 { 96 {
82 m_interface->kodi_gui->control_fade_label->set_visible(m_interface->kodiBase, m_controlHandle, visible); 97 m_interface->kodi_gui->control_fade_label->add_label(m_interface->kodiBase, m_controlHandle,
83 } 98 label.c_str());
84 //-------------------------------------------------------------------------- 99 }
85 100 //--------------------------------------------------------------------------
86 //==========================================================================
87 ///
88 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
89 /// @brief To add additional text string on fade label.
90 ///
91 /// @param[in] label Text to show
92 ///
93 void AddLabel(const std::string& label)
94 {
95 m_interface->kodi_gui->control_fade_label->add_label(m_interface->kodiBase, m_controlHandle, label.c_str());
96 }
97 //--------------------------------------------------------------------------
98 101
99 //========================================================================== 102 //==========================================================================
100 /// 103 ///
101 /// \ingroup cpp_kodi_gui_controls_CFadeLabel 104 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
102 /// @brief Get the used text from button 105 /// @brief Get the used text from button
103 /// 106 ///
104 /// @return Text shown 107 /// @return Text shown
105 /// 108 ///
106 std::string GetLabel() const 109 std::string GetLabel() const
110 {
111 std::string label;
112 char* ret = m_interface->kodi_gui->control_fade_label->get_label(m_interface->kodiBase,
113 m_controlHandle);
114 if (ret != nullptr)
107 { 115 {
108 std::string label; 116 if (std::strlen(ret))
109 char* ret = m_interface->kodi_gui->control_fade_label->get_label(m_interface->kodiBase, m_controlHandle); 117 label = ret;
110 if (ret != nullptr) 118 m_interface->free_string(m_interface->kodiBase, ret);
111 {
112 if (std::strlen(ret))
113 label = ret;
114 m_interface->free_string(m_interface->kodiBase, ret);
115 }
116 return label;
117 } 119 }
118 //-------------------------------------------------------------------------- 120 return label;
121 }
122 //--------------------------------------------------------------------------
119 123
120 //========================================================================== 124 //==========================================================================
121 /// 125 ///
122 /// \ingroup cpp_kodi_gui_controls_CFadeLabel 126 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
123 /// @brief To enable or disable scrolling on fade label 127 /// @brief To enable or disable scrolling on fade label
124 /// 128 ///
125 /// @param[in] scroll To enable scrolling set to true, otherwise is 129 /// @param[in] scroll To enable scrolling set to true, otherwise is
126 /// disabled 130 /// disabled
127 /// 131 ///
128 void SetScrolling(bool scroll) 132 void SetScrolling(bool scroll)
129 { 133 {
130 m_interface->kodi_gui->control_fade_label->set_scrolling(m_interface->kodiBase, m_controlHandle, scroll); 134 m_interface->kodi_gui->control_fade_label->set_scrolling(m_interface->kodiBase, m_controlHandle,
131 } 135 scroll);
132 //-------------------------------------------------------------------------- 136 }
137 //--------------------------------------------------------------------------
133 138
134 //========================================================================== 139 //==========================================================================
135 /// 140 ///
136 /// \ingroup cpp_kodi_gui_controls_CFadeLabel 141 /// \ingroup cpp_kodi_gui_controls_CFadeLabel
137 /// @brief To reset al inserted labels. 142 /// @brief To reset al inserted labels.
138 /// 143 ///
139 void Reset() 144 void Reset()
140 { 145 {
141 m_interface->kodi_gui->control_fade_label->reset(m_interface->kodiBase, m_controlHandle); 146 m_interface->kodi_gui->control_fade_label->reset(m_interface->kodiBase, m_controlHandle);
142 } 147 }
143 //-------------------------------------------------------------------------- 148 //--------------------------------------------------------------------------
144 }; 149};
145 150
146} /* namespace controls */ 151} /* namespace controls */
147} /* namespace gui */ 152} /* namespace gui */