summaryrefslogtreecommitdiff
path: root/src/player/FontStyle.h
blob: 513aa14772629f1422f50da42325d931114c8999 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//
//  libavg - Media Playback Engine. 
//  Copyright (C) 2003-2014 Ulrich von Zadow
//
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2 of the License, or (at your option) any later version.
//
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
//  Current versions can be found at www.libavg.de
//

#ifndef _FontStyle_H_
#define _FontStyle_H_

#include "../api.h"

#include "ExportedObject.h"

#include "../graphics/Pixel32.h"

#include <pango/pango.h>
#include <boost/shared_ptr.hpp>

#include <string>

namespace avg {

class FontStyle;
typedef boost::shared_ptr<class FontStyle> FontStylePtr;

class AVG_API FontStyle: public ExportedObject
{
    public:
        static void registerType();
        
        FontStyle(const ArgList& args);
        FontStyle();
        virtual ~FontStyle();

        void setDefaultedArgs(const ArgList& args);

        const std::string& getFont() const;
        void setFont(const std::string& sName);

        const std::string& getFontVariant() const;
        void setFontVariant(const std::string& sVariant);
        
        const std::string& getColor() const;
        void setColor(const std::string& sColor);
        
        virtual float getAAGamma() const;
        virtual void setAAGamma(float gamma);

        float getFontSize() const;
        void setFontSize(float size);
        
        int getIndent() const;
        void setIndent(int indent);
        
        float getLineSpacing() const;
        void setLineSpacing(float lineSpacing);
        
        std::string getAlignment() const;
        void setAlignment(const std::string& sAlignment);
 
        std::string getWrapMode() const;
        void setWrapMode(const std::string& sWrapMode);

        bool getJustify() const;
        void setJustify(bool bJustify);

        float getLetterSpacing() const;
        void setLetterSpacing(float letterSpacing);

        bool getHint() const;
        void setHint(bool bHint);

        PangoAlignment getAlignmentVal() const;
        PangoWrapMode getWrapModeVal() const;
        Pixel32 getColorVal() const;

    private:
        void applyBaseStyle(const FontStyle& baseStyle, const ArgList& args);

        std::string m_sName;
        std::string m_sVariant;
        std::string m_sColorName;
        Pixel32 m_Color;
        float m_AAGamma;
        float m_Size;
        int m_Indent;
        float m_LineSpacing;
        PangoAlignment m_Alignment;
        PangoWrapMode m_WrapMode;
        bool m_bJustify;
        float m_LetterSpacing;
        bool m_bHint;

};

typedef boost::shared_ptr<class FontStyle> FontStylePtr;

}
#endif