#ifndef GenericFontFamilySettings_h
#define GenericFontFamilySettings_h
#include "platform/PlatformExport.h"
#include "wtf/HashMap.h"
#include "wtf/text/AtomicString.h"
#include "wtf/text/AtomicStringHash.h"
#include <unicode/uscript.h>
namespace WebCore {
class PLATFORM_EXPORT GenericFontFamilySettings {
WTF_MAKE_FAST_ALLOCATED;
public:
GenericFontFamilySettings()
{
}
explicit GenericFontFamilySettings(const GenericFontFamilySettings&);
void setStandard(const AtomicString&, UScriptCode = USCRIPT_COMMON);
const AtomicString& standard(UScriptCode = USCRIPT_COMMON) const;
void setFixed(const AtomicString&, UScriptCode = USCRIPT_COMMON);
const AtomicString& fixed(UScriptCode = USCRIPT_COMMON) const;
void setSerif(const AtomicString&, UScriptCode = USCRIPT_COMMON);
const AtomicString& serif(UScriptCode = USCRIPT_COMMON) const;
void setSansSerif(const AtomicString&, UScriptCode = USCRIPT_COMMON);
const AtomicString& sansSerif(UScriptCode = USCRIPT_COMMON) const;
void setCursive(const AtomicString&, UScriptCode = USCRIPT_COMMON);
const AtomicString& cursive(UScriptCode = USCRIPT_COMMON) const;
void setFantasy(const AtomicString&, UScriptCode = USCRIPT_COMMON);
const AtomicString& fantasy(UScriptCode = USCRIPT_COMMON) const;
void setPictograph(const AtomicString&, UScriptCode = USCRIPT_COMMON);
const AtomicString& pictograph(UScriptCode = USCRIPT_COMMON) const;
void reset();
GenericFontFamilySettings& operator=(const GenericFontFamilySettings&);
private:
struct UScriptCodeHashTraits : WTF::GenericHashTraits<int> {
static const bool emptyValueIsZero = false;
static int emptyValue() { return -2; }
static void constructDeletedValue(int& slot) { slot = -3; }
static bool isDeletedValue(int value) { return value == -3; }
};
typedef HashMap<int, AtomicString, DefaultHash<int>::Hash, UScriptCodeHashTraits> ScriptFontFamilyMap;
void setGenericFontFamilyMap(ScriptFontFamilyMap&, const AtomicString&, UScriptCode);
const AtomicString& genericFontFamilyForScript(const ScriptFontFamilyMap&, UScriptCode) const;
ScriptFontFamilyMap m_standardFontFamilyMap;
ScriptFontFamilyMap m_serifFontFamilyMap;
ScriptFontFamilyMap m_fixedFontFamilyMap;
ScriptFontFamilyMap m_sansSerifFontFamilyMap;
ScriptFontFamilyMap m_cursiveFontFamilyMap;
ScriptFontFamilyMap m_fantasyFontFamilyMap;
ScriptFontFamilyMap m_pictographFontFamilyMap;
};
}
#endif