CaptionUserPreferencesMediaAF.h [plain text]
#pragma once
#if ENABLE(VIDEO_TRACK)
#include "CSSPropertyNames.h"
#include "CaptionUserPreferences.h"
#include "Color.h"
namespace WebCore {
class CaptionUserPreferencesMediaAF : public CaptionUserPreferences {
WTF_MAKE_FAST_ALLOCATED;
public:
CaptionUserPreferencesMediaAF(PageGroup&);
virtual ~CaptionUserPreferencesMediaAF();
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
CaptionDisplayMode captionDisplayMode() const override;
void setCaptionDisplayMode(CaptionDisplayMode) override;
bool userPrefersCaptions() const override;
bool userPrefersSubtitles() const override;
float captionFontSizeScaleAndImportance(bool&) const override;
bool captionStrokeWidthForFont(float fontSize, const String& language, float& strokeWidth, bool& important) const override;
void setInterestedInCaptionPreferenceChanges() override;
void setPreferredLanguage(const String&) override;
Vector<String> preferredLanguages() const override;
void setPreferredAudioCharacteristic(const String&) override;
Vector<String> preferredAudioCharacteristics() const override;
void captionPreferencesChanged() override;
bool shouldFilterTrackMenu() const { return true; }
#else
bool shouldFilterTrackMenu() const { return false; }
#endif
String captionsStyleSheetOverride() const override;
int textTrackSelectionScore(TextTrack*, HTMLMediaElement*) const override;
Vector<RefPtr<AudioTrack>> sortedTrackListForMenu(AudioTrackList*) override;
Vector<RefPtr<TextTrack>> sortedTrackListForMenu(TextTrackList*) override;
String displayNameForTrack(AudioTrack*) const override;
String displayNameForTrack(TextTrack*) const override;
private:
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
void updateTimerFired();
String captionsWindowCSS() const;
String captionsBackgroundCSS() const;
String captionsTextColorCSS() const;
Color captionsTextColor(bool&) const;
String captionsDefaultFontCSS() const;
String windowRoundedCornerRadiusCSS() const;
String captionsTextEdgeCSS() const;
String colorPropertyCSS(CSSPropertyID, const Color&, bool) const;
Timer m_updateStyleSheetTimer;
bool m_listeningForPreferenceChanges;
bool m_registeringForNotification { false };
#endif
};
}
#endif // ENABLE(VIDEO_TRACK)