take care for disabled -C -T frontends
[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* 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 setNoWrap(int nowrap);
32         void clearForegroundColor();
33         
34         eSize calculateSize();
35 protected:
36         ePtr<gFont> m_font;
37         int m_valign, m_halign;
38         std::string m_text;
39         int event(int event, void *data=0, void *data2=0);
40         int m_pos;
41 private:
42         int m_have_foreground_color, m_have_shadow_color;
43         gRGB m_foreground_color, m_shadow_color;
44         ePoint m_shadow_offset;
45         int m_nowrap;
46         
47         enum eLabelEvent
48         {
49                 evtChangedText = evtUserWidget,
50                 evtChangedFont,
51                 evtChangedAlignment,
52                 evtChangedMarkedPos
53         };
54 };
55
56 #endif