- default fonts handled in windowstyle
[enigma2.git] / lib / dvb / idvb.h
index a69f170f00f25d4dcd03f59d511b45853bdf4f3f..da626866d6ec44d51c5dc0172697925dfa2722fd 100644 (file)
@@ -1,6 +1,14 @@
 #ifndef __dvb_idvb_h
 #define __dvb_idvb_h
 
+#include <config.h>
+#if HAVE_DVB_API_VERSION < 3
+#include <ost/frontend.h>
+#define FRONTENDPARAMETERS FrontendParameters
+#else
+#include <linux/dvb/frontend.h>
+#define FRONTENDPARAMETERS struct dvb_frontend_parameters
+#endif
 #include <lib/base/object.h>
 #include <lib/base/ebase.h>
 #include <lib/service/service.h>
@@ -131,7 +139,7 @@ struct eServiceReferenceDVB: public eServiceReference
                setTransportStreamID(chid.transport_stream_id);
        }
        
-       void getChannelID(eDVBChannelID &chid)
+       void getChannelID(eDVBChannelID &chid) const
        {
                chid = eDVBChannelID(getDVBNamespace(), getTransportStreamID(), getOriginalNetworkID());
        }
@@ -143,14 +151,87 @@ struct eServiceReferenceDVB: public eServiceReference
 };
 
 
+////////////////// TODO: we need an interface here, but what exactly?
+
+#include <set>
+// btw, still implemented in db.cpp. FIX THIS, TOO.
+
+class eDVBChannelQuery;
+
+class eDVBService: public iStaticServiceInformation
+{
+       DECLARE_REF(eDVBService);
+public:
+       eDVBService();
+       std::string m_service_name;
+       std::string m_provider_name;
+       
+       int m_flags;
+       std::set<int> m_ca;
+       std::map<int,int> m_cache;
+       virtual ~eDVBService();
+       
+       eDVBService &operator=(const eDVBService &);
+       
+       // iStaticServiceInformation
+       RESULT getName(const eServiceReference &ref, std::string &name);
+       
+       // for filtering:
+       int checkFilter(const eServiceReferenceDVB &ref, const eDVBChannelQuery &query);
+};
+
+//////////////////
+
 class iDVBChannel;
 class iDVBDemux;
 class iDVBFrontendParameters;
 
+class iDVBChannelListQuery: public iObject
+{
+public:
+       virtual RESULT getNextResult(eServiceReferenceDVB &ref)=0;
+};
+
+class eDVBChannelQuery: public iObject
+{
+       DECLARE_REF(eDVBChannelQuery);
+public:
+       enum
+       {
+               tName,
+               tProvider,
+               tType,
+               tBouquet,
+               tSatellitePosition,
+               tChannelID,
+               tAND,
+               tOR
+       };
+       
+       int m_type;
+       int m_inverse;
+       
+       std::string m_string;
+       int m_int;
+       eDVBChannelID m_channelid;
+       
+       static RESULT compile(ePtr<eDVBChannelQuery> &res, std::string query);
+       
+       ePtr<eDVBChannelQuery> m_p1, m_p2;
+};
+
 class iDVBChannelList: public iObject
 {
 public:
+       virtual RESULT addChannelToList(const eDVBChannelID &id, iDVBFrontendParameters *feparm)=0;
+       virtual RESULT removeChannel(const eDVBChannelID &id)=0;
+       
        virtual RESULT getChannelFrontendData(const eDVBChannelID &id, ePtr<iDVBFrontendParameters> &parm)=0;
+       
+       virtual RESULT addService(const eServiceReferenceDVB &service, eDVBService *service)=0;
+       virtual RESULT getService(const eServiceReferenceDVB &reference, ePtr<eDVBService> &service)=0;
+
+       virtual RESULT startQuery(ePtr<iDVBChannelListQuery> &query, eDVBChannelQuery *query)=0;
 };
 
 class iDVBResourceManager: public iObject
@@ -267,7 +348,7 @@ public:
 class iDVBSatelliteEquipmentControl: public iObject
 {
 public:
-       virtual RESULT prepare(iDVBFrontend &frontend, struct dvb_frontend_parameters &parm, eDVBFrontendParametersSatellite &sat)=0;
+       virtual RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat)=0;
 };
 
 struct eDVBCIRouting