many changes for better CI handling
[enigma2.git] / lib / gui / elabel.h
1 #ifndef __lib_gui_elabel_h
2 #define __lib_gui_elabel_h
3
4 #include <lib/gui/ewidget.h>
5
6 class eLabel: public eWidget
7 {
8 public:
9         eLabel(eWidget *parent, int markedPos = -1);
10         void setText(const std::string &string);
11         void setMarkedPos(int markedPos);
12         void setFont(gFont *font);
13         gFont* eLabel::getFont();
14
15         enum
16         {
17                 alignLeft,
18                 alignTop=alignLeft,
19                 alignCenter,
20                 alignRight,
21                 alignBottom=alignRight,
22                 alignBlock
23         };
24         
25         void setVAlign(int align);
26         void setHAlign(int align);
27         
28         void setForegroundColor(const gRGB &col);
29         void setShadowColor(const gRGB &col);
30         void setShadowOffset(const ePoint &offset);
31         void clearForegroundColor();
32         
33         eSize calculateSize();
34 protected:
35         ePtr<gFont> m_font;
36         int m_valign, m_halign;
37         std::string m_text;
38         int event(int event, void *data=0, void *data2=0);
39         int m_pos;
40 private:
41         int m_have_foreground_color, m_have_shadow_color;
42         gRGB m_foreground_color, m_shadow_color;
43         ePoint m_shadow_offset;
44         
45         enum eLabelEvent
46         {
47                 evtChangedText = evtUserWidget,
48                 evtChangedFont,
49                 evtChangedAlignment,
50                 evtChangedMarkedPos
51         };
52 };
53
54 #endif