TextSizeAdjustment.h [plain text]
#ifndef TextSizeAdjustment_h
#define TextSizeAdjustment_h
enum TextSizeAdjustmentType { AutoTextSizeAdjustment = -1, NoTextSizeAdjustment = -2 };
class TextSizeAdjustment {
public:
TextSizeAdjustment() : m_value(AutoTextSizeAdjustment) { }
TextSizeAdjustment(float value) : m_value(value) { }
float percentage() { return m_value; }
float multiplier() { return m_value / 100; }
bool isAuto() { return m_value == AutoTextSizeAdjustment; }
bool isNone() { return m_value == NoTextSizeAdjustment; }
bool operator == (const TextSizeAdjustment & anAdjustment) const { return m_value == anAdjustment.m_value; }
bool operator != (const TextSizeAdjustment & anAdjustment) const { return m_value != anAdjustment.m_value; }
private:
float m_value;
};
#endif // TextSizeAdjustment_h