You.i Engine
YiClosedCaptionsStylingBridge.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_CLOSED_CAPTIONS_STYLING_BRIDGE_H_
3 #define _YI_CLOSED_CAPTIONS_STYLING_BRIDGE_H_
4 
5 #include "utility/YiColor.h"
6 
12 #include "signal/YiSignal.h"
13 
19 {
20 public:
24  enum class Mode
25  {
37  Unknown
38  };
39 
64  enum class FontType
65  {
66  Default,
67  MonospaceSansSerif,
68  ProportionalSansSerif,
69  MonospaceWithSerif,
70  ProportionalWithSerif,
71  Casual,
72  Cursive,
73  SmallCapitals,
74  Custom
75  };
76 
80  enum class EdgeStyle
81  {
82  Default,
83  NoEdges,
84  Raised,
85  Depressed,
86  Uniform,
87  DropShadowed
88  };
89 
93  struct Style
94  {
95  Style();
96 
100  const CYIString &GetFontFamily() const;
101 
105  ssize_t GetFontID() const;
106 
108 
111 
113 
115 
118 
120 
122 
128  };
129 
132 
136  static const Style &GetDefaultStyle();
137 
146  ssize_t GetFontIdForFontType(FontType fontType) const;
147 
156  bool SetFontIdForFontType(FontType fontType, ssize_t fontId);
157 
161  virtual Style GetClosedCaptionsStyle() const = 0;
162 
163 private:
164  mutable std::mutex m_fontTypeToFontIdMapMutex;
165  std::map<CYIClosedCaptionsStylingBridge::FontType, ssize_t> m_fontTypeToFontIdMap;
166 };
167 
172 #endif
Mode stylingMode
Definition: YiClosedCaptionsStylingBridge.h:107
CYIColor windowColor
The color of the background of the rendering region for the caption.
Definition: YiClosedCaptionsStylingBridge.h:121
bool usesDefaultEdgeColor
If true, indicates that the edge color from the content should be used as edge color.
Definition: YiClosedCaptionsStylingBridge.h:125
A bridge which reports operating system closed captions style.
Definition: YiClosedCaptionsStylingBridge.h:18
EdgeStyle edgeStyle
Definition: YiClosedCaptionsStylingBridge.h:116
ssize_t GetFontIdForFontType(FontType fontType) const
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:36
bool usesDefaultCharacterColor
If true, indicates that the character color from the content should be used as character color...
Definition: YiClosedCaptionsStylingBridge.h:124
CYIColor characterBackgroundColor
The color of the background of individual characters.
Definition: YiClosedCaptionsStylingBridge.h:119
CYIColor characterColor
Definition: YiClosedCaptionsStylingBridge.h:114
static const Style & GetDefaultStyle()
bool usesDefaultFontSize
If true, indicates that the font size from the content should be used as font size.
Definition: YiClosedCaptionsStylingBridge.h:123
Mode
Definition: YiClosedCaptionsStylingBridge.h:24
float fontSizeFractionOfVideoHeight
The font size, as a fraction of the video height. Ranges from 0 to 1.
Definition: YiClosedCaptionsStylingBridge.h:112
Definition: YiClosedCaptionsStylingBridge.h:93
CYIColor edgeColor
Definition: YiClosedCaptionsStylingBridge.h:117
bool usesDefaultCharacterBackgroundColor
If true, indicates that the character background color from the content should be used as character b...
Definition: YiClosedCaptionsStylingBridge.h:126
CYIString customFontFamily
A custom font family. Has no effect if fontType is not CUSTOM.
Definition: YiClosedCaptionsStylingBridge.h:110
bool usesDefaultWindowColor
If true, indicates that the window color from the content should be used as window color...
Definition: YiClosedCaptionsStylingBridge.h:127
FontType
Definition: YiClosedCaptionsStylingBridge.h:64
EdgeStyle
Definition: YiClosedCaptionsStylingBridge.h:80
int ssize_t
Definition: YiPredefWin32.h:131
virtual Style GetClosedCaptionsStyle() const =0
A class used to represent a color value.
Definition: YiColor.h:31
FontType fontType
The font type for closed captions. If set to CUSTOM, the font family specified in customFontFamily sh...
Definition: YiClosedCaptionsStylingBridge.h:109
bool SetFontIdForFontType(FontType fontType, ssize_t fontId)