2 * Copyright (C) 2012-2021 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "settings/lib/ISettingCallback.h"
12 #include "utils/ColorUtils.h"
13 #include "utils/Observer.h"
20 struct StringSettingOption
;
26 // This is a placeholder to keep the fontname setting valid
27 // even if the default app font could be changed
28 constexpr const char* FONT_DEFAULT_FAMILYNAME
= "DEFAULT";
39 enum class HorizontalAlign
46 enum class BackgroundType
62 enum class OverrideStyles
70 class CSubtitlesSettings
: public ISettingCallback
, public Observable
73 explicit CSubtitlesSettings(const std::shared_ptr
<CSettings
>& settings
);
74 ~CSubtitlesSettings() override
;
76 // Inherited from ISettingCallback
77 void OnSettingChanged(const std::shared_ptr
<const CSetting
>& setting
) override
;
80 * \brief Get subtitle alignment
81 * \return The alignment
86 * \brief Set the subtitle alignment
87 * \param align The alignment
89 void SetAlignment(Align align
);
92 * \brief Get horizontal text alignment
93 * \return The alignment
95 HorizontalAlign
GetHorizontalAlignment();
98 * \brief Get font name
99 * \return The font name
101 std::string
GetFontName();
104 * \brief Get font style
105 * \return The font style
107 FontStyle
GetFontStyle();
110 * \brief Get font size
111 * \return The font size in PX
116 * \brief Get font color
117 * \return The font color
119 UTILS::COLOR::Color
GetFontColor();
122 * \brief Get font opacity
123 * \return The font opacity in %
125 int GetFontOpacity();
128 * \brief Get border size
129 * \return The border size in %
134 * \brief Get border color
135 * \return The border color
137 UTILS::COLOR::Color
GetBorderColor();
140 * \brief Get shadow size
141 * \return The shadow size in %
146 * \brief Get shadow color
147 * \return The shadow color
149 UTILS::COLOR::Color
GetShadowColor();
152 * \brief Get shadow opacity
153 * \return The shadow opacity in %
155 int GetShadowOpacity();
158 * \brief Get blur size
159 * \return The blur size in %
164 * \brief Get line spacing
165 * \return The line spacing
167 int GetLineSpacing();
170 * \brief Get background type
171 * \return The background type
173 BackgroundType
GetBackgroundType();
176 * \brief Get background color
177 * \return The background color
179 UTILS::COLOR::Color
GetBackgroundColor();
182 * \brief Get background opacity
183 * \return The background opacity in %
185 int GetBackgroundOpacity();
188 * \brief Check if font override is enabled
189 * \return True if fonts must be overriden, otherwise false
191 bool IsOverrideFonts();
194 * \brief Get override styles
195 * \return The styles to be overriden
197 OverrideStyles
GetOverrideStyles();
200 * \brief Get the subtitle vertical margin
201 * \return The vertical margin in %
203 float GetVerticalMarginPerc();
205 static void SettingOptionsSubtitleFontsFiller(const std::shared_ptr
<const CSetting
>& setting
,
206 std::vector
<StringSettingOption
>& list
,
207 std::string
& current
,
211 CSubtitlesSettings() = delete;
213 const std::shared_ptr
<CSettings
> m_settings
;
216 } // namespace SUBTITLES