add imdb query link
[enigma2.git] / lib / gui / epositiongauge.h
1 #ifndef __lib_gui_epositiongauge_h
2 #define __lib_gui_epositiongauge_h
3
4 #include <lib/gui/ewidget.h>
5 #include <set>
6
7 typedef long long pts_t;
8
9 class ePixmap;
10
11 class ePositionGauge: public eWidget
12 {
13 public:
14         ePositionGauge(eWidget *parent);
15         ~ePositionGauge();
16         void setLength(const pts_t &len);
17         void setPosition(const pts_t &pos);
18         
19         void setInColor(const gRGB &color); /* foreground? */
20         void setPointer(gPixmap *pixmap, const ePoint &center);
21         
22         void setInOutList(PyObject *list);
23         void setForegroundColor(const gRGB &col);
24 #ifndef SWIG
25 protected:
26         int event(int event, void *data=0, void *data2=0);
27 private:
28         void updatePosition();
29         enum ePositionGaugeEvent
30         {
31                 evtChangedPosition = evtUserWidget
32         };
33         ePixmap *m_point_widget;
34         ePoint m_point_center;
35         
36         pts_t m_position, m_length;
37         int m_pos;
38
39                 /* TODO: this is duplicated code from lib/service/servicedvb.h */
40         struct cueEntry
41         {
42                 pts_t where;
43                 unsigned int what;
44                 
45                 bool operator < (const struct cueEntry &o) const
46                 {
47                         return where < o.where;
48                 }
49                 cueEntry(const pts_t &where, unsigned int what) :
50                         where(where), what(what)
51                 {
52                 }
53         };
54         
55         std::multiset<cueEntry> m_cue_entries;
56         int scale(const pts_t &val);
57         
58         int m_have_foreground_color;
59         gRGB m_foreground_color;
60 #endif
61 };
62
63 #endif