- add listbox
[enigma2.git] / lib / gui / ewindowstyle.h
1 #ifndef __lib_gui_ewindowstyle_h
2 #define __lib_gui_ewindowstyle_h
3
4 class eWindow;
5 class eSize;
6 class gFont;
7
8 #include <lib/base/object.h>
9
10 class eWindowStyle: public iObject
11 {
12 public:
13         virtual void handleNewSize(eWindow *wnd, const eSize &size) = 0;
14         virtual void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) = 0;
15         virtual void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) = 0;
16         virtual void setStyle(gPainter &painter, int what) = 0;
17         enum {
18                 styleLabel,
19                 styleListboxSelected,
20                 styleListboxNormal
21         };
22         
23         virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
24         
25         enum {
26                 frameButton,
27                 frameListboxEntry
28         };
29         virtual ~eWindowStyle() = 0;
30
31 };
32
33 class eWindowStyleSimple: public eWindowStyle
34 {
35         DECLARE_REF;
36 private:
37         ePtr<gFont> m_fnt;
38         gColor m_border_color_tl, m_border_color_br, m_title_color_back, m_title_color, m_background_color;
39         
40         int m_border_top, m_border_left, m_border_right, m_border_bottom;
41 public:
42         eWindowStyleSimple();
43         void handleNewSize(eWindow *wnd, const eSize &size);
44         void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title);
45         void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size);
46         void setStyle(gPainter &painter, int what);
47         void drawFrame(gPainter &painter, const eRect &frame, int what);
48 };
49
50 #endif