4 #include <lib/gui/ewindow.h>
5 #include <lib/gui/listbox.h>
6 #include <lib/gui/statusbar.h>
7 #include <lib/dvb/epgcache.h>
8 #include <src/channelinfo.h>
10 #include <lib/dvb/service.h>
15 class eEPGStyleSelector
: public eListBoxWindow
<eListBoxEntryText
>
19 eEPGStyleSelector(int ssel
=0);
20 int eventHandler( const eWidgetEvent
&event
);
21 void entrySelected( eListBoxEntryText
* e
);
24 class eListBoxEntryService
: public eListBoxEntry
26 friend class eServiceSelector
;
27 friend class eListBoxExt
<eListBoxEntryService
>;
28 friend struct moveFirstChar
;
29 friend struct moveServiceNum
;
30 friend struct moveServicePath
;
31 friend struct _selectService
;
32 friend struct updateEPGChangedService
;
33 friend struct renumber
;
35 static gFont serviceFont
, descrFont
, numberFont
;
36 static int maxNumSize
;
37 static gPixmap
*folder
, *marker
, *locked
, *newfound
;
38 eTextPara
*numPara
, *namePara
, *descrPara
;
39 int nameXOffs
, descrXOffs
, numYOffs
, nameYOffs
, descrYOffs
;
44 const eString
&getText() const { return sort
; }
45 static eListBoxEntryService
*selectedToMove
;
46 static std::set
<eServiceReference
> hilitedEntrys
;
47 static int nownextEPG
;
48 int getNum() const { return num
; }
50 void invalidateDescr();
51 static int getEntryHeight();
52 eServiceReference service
;
53 enum { flagShowNumber
=1, flagOwnNumber
=2, flagIsReturn
=4, flagSameTransponder
=8 };
54 eListBoxEntryService(eListBoxExt
<eListBoxEntryService
> *lb
, const eServiceReference
&service
, int flags
, int num
=-1);
55 ~eListBoxEntryService();
57 bool operator<(const eListBoxEntry
&r
) const
59 if (flags
& flagIsReturn
)
61 else if (((eListBoxEntryService
&)r
).flags
& flagIsReturn
)
63 else if (service
.getSortKey() == ((eListBoxEntryService
&)r
).service
.getSortKey())
64 return sort
< ((eListBoxEntryService
&)r
).sort
;
65 else // sort andersrum
66 return service
.getSortKey() > ((eListBoxEntryService
&)r
).service
.getSortKey();
69 const eString
&redraw(gPainter
*rc
, const eRect
&rect
, gColor
, gColor
, gColor
, gColor
, int hilited
);
72 class eServiceSelector
: public eWindow
74 eServiceReference selected
;
75 eServiceReference
*result
;
76 eListBoxExt
<eListBoxEntryService
> *services
, *bouquets
;
79 const eWidget
*rfocus
;
85 void addService(const eServiceReference
&service
);
86 void addBouquet(const eServiceReference
&service
);
87 int style
, lastSelectedStyle
;
88 int serviceentryflags
;
94 eListBoxEntryService
*goUpEntry
;
97 void fillServiceList(const eServiceReference
&ref
);
98 void fillBouquetList(const eServiceReference
&ref
);
99 void serviceSelected(eListBoxEntryService
*entry
);
100 void bouquetSelected(eListBoxEntryService
*entry
);
101 void serviceSelChanged(eListBoxEntryService
*entry
);
102 void bouquetSelChanged( eListBoxEntryService
*entry
);
103 void ResetBrowseChar();
104 void gotoChar(char c
);
106 void init_eServiceSelector();
107 void SwitchNowNext();
111 int eventHandler(const eWidgetEvent
&event
);
112 void setKeyDescriptions(bool editMode
=false);
113 void forEachServiceRef( Signal1
<void,const eServiceReference
&>, bool );
117 enum { styleInvalid
, styleCombiColumn
, styleSingleColumn
, styleMultiColumn
};
118 enum { dirNo
, dirUp
, dirDown
, dirFirst
, dirLast
};
123 enum { listAll
, listSatellites
, listProvider
, listBouquets
};
124 Signal2
<eServicePath
,int,int> getRoot
;
125 Signal2
<int,eServiceReference
,int> getFirstBouquetServiceNum
;
127 Signal1
<void,const eServiceReference
&> addServiceToPlaylist
; // add service to the Playlist
128 Signal2
<void,eServiceReference
*,int> addServiceToUserBouquet
; // add current service to selected User Bouquet
130 Signal1
<void,int> setMode
; // set TV, Radio or File
132 Signal1
<void,eServiceSelector
*> removeServiceFromUserBouquet
, // remove service from selected User Bouquet
133 showMenu
, // shows the contextmenu
134 toggleStyle
, // switch service selector style
135 renameService
, renameBouquet
,
136 deletePressed
, newMarkerPressed
,
140 const eServiceReference
&, // path
141 const eServiceReference
&, // service to move
142 const eServiceReference
& // service AFTER moved service
145 Signal1
<void,eServiceReferenceDVB
>showEPGList
;
147 const eServicePath
&getPath() { return path
; }
148 void setPath(const eServicePath
&path
, const eServiceReference
&select
=eServiceReference());
150 int getStyle() { return style
; }
151 void setStyle(int newStyle
=-1, bool force
=false);
153 bool selectService(const eServiceReference
&ref
);
154 bool selectService(int num
);
155 bool selectServiceRecursive( eServiceReference
&ref
);
156 bool selServiceRec( eServiceReference
&ref
);
157 int getServiceNum( const eServiceReference
&ref
);
158 void enterDirectory(const eServiceReference
&ref
);
159 const eServiceReference
&getSelected() { return selected
; }
160 const eServiceReference
*choose(int irc
=-1);
161 const eServiceReference
*next();
162 const eServiceReference
*prev();
163 void removeCurrent(bool=false);
164 void invalidateCurrent(eServiceReference ref
=eServiceReference());
165 void updateNumbers();
168 int toggleMoveMode(); // enable / disable move entry Mode ( only in userBouquets )
169 int toggleEditMode(); // enable / disable edit UserBouquet Mode