1 #ifndef __lib_service_event_h
2 #define __lib_service_event_h
11 #include <lib/base/object.h>
12 #include <lib/service/iservice.h>
14 SWIG_IGNORE(eComponentData);
17 friend class eServiceEvent;
18 DECLARE_REF(eComponentData);
19 uint8_t m_streamContent;
20 uint8_t m_componentType;
21 uint8_t m_componentTag;
22 std::string m_iso639LanguageCode;
25 eComponentData(const eComponentData& d) { *this = d; }
26 eComponentData() { m_streamContent = m_componentType = m_componentTag = 0; }
27 int getStreamContent(void) const { return m_streamContent; }
28 int getComponentType(void) const { return m_componentType; }
29 int getComponentTag(void) const { return m_componentTag; }
30 std::string getIso639LanguageCode(void) const { return m_iso639LanguageCode; }
31 std::string getText(void) const { return m_text; }
33 SWIG_TEMPLATE_TYPEDEF(ePtr<eComponentData>, eComponentDataPtr);
35 SWIG_IGNORE(eGenreData);
38 friend class eServiceEvent;
39 DECLARE_REF(eGenreData);
45 eGenreData(const eGenreData& d) { *this = d; }
46 eGenreData() { m_level1 = m_level2 = m_user1 = m_user2 = 0; }
47 int getLevel1(void) const { return m_level1; }
48 int getLevel2(void) const { return m_level2; }
49 int getUser1(void) const { return m_user1; }
50 int getUser2(void) const { return m_user2; }
52 SWIG_TEMPLATE_TYPEDEF(ePtr<eGenreData>, eGenreDataPtr);
54 SWIG_IGNORE(eParentalData);
57 friend class eServiceEvent;
58 DECLARE_REF(eParentalData);
59 std::string m_country_code;
62 eParentalData(const eParentalData& d) { *this = d; }
63 eParentalData() { m_country_code = ""; m_rating = 0; }
64 std::string getCountryCode(void) const { return m_country_code; }
65 int getRating(void) const { return m_rating; }
67 SWIG_TEMPLATE_TYPEDEF(ePtr<eParentalData>, eParentalDataPtr);
70 SWIG_ALLOW_OUTPUT_SIMPLE(eServiceReference); // needed for SWIG_OUTPUT in eServiceEvent::getLinkageService
72 SWIG_IGNORE(eServiceEvent);
73 class eServiceEvent: public iObject
75 DECLARE_REF(eServiceEvent);
76 bool loadLanguage(Event *event, const std::string &lang, int tsidonid);
77 std::list<eComponentData> m_component_data;
78 std::list<eServiceReference> m_linkage_services;
79 std::list<eGenreData> m_genres;
80 std::list<eParentalData> m_ratings;
86 std::string m_event_name, m_short_description, m_extended_description, m_tmp_extended_description;
87 static std::string m_language, m_language_alternative;
91 RESULT parseFrom(Event *evt, int tsidonid=0);
92 RESULT parseFrom(const std::string &filename, int tsidonid=0);
93 static void setEPGLanguage(const std::string &language) { m_language = language; }
94 static void setEPGLanguageAlternative(const std::string &language) { m_language_alternative = language; }
96 time_t getBeginTime() const { return m_begin; }
97 int getDuration() const { return m_duration; }
98 int getEventId() const { return m_event_id; }
99 int getPdcPil() const { return m_pdc_pil; }
100 int getRunningStatus() const { return m_running_status; }
101 std::string getEventName() const { return m_event_name; }
102 std::string getShortDescription() const { return m_short_description; }
103 std::string getExtendedDescription() const { return m_extended_description; }
104 std::string getBeginTimeString() const;
105 SWIG_VOID(RESULT) getComponentData(ePtr<eComponentData> &SWIG_OUTPUT, int tagnum) const;
106 PyObject *getComponentData() const;
107 int getNumOfLinkageServices() const { return m_linkage_services.size(); }
108 SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, eServiceReference &parent, int num) const;
109 SWIG_VOID(RESULT) getGenreData(ePtr<eGenreData> &SWIG_OUTPUT) const;
110 PyObject *getGenreData() const;
111 SWIG_VOID(RESULT) getParentalData(ePtr<eParentalData> &SWIG_OUTPUT) const;
112 PyObject *getParentalData() const;
114 SWIG_TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEvent);
115 SWIG_EXTEND(ePtr<eServiceEvent>,
116 static void setEPGLanguage(const std::string &language)
118 eServiceEvent::setEPGLanguage(language);
121 SWIG_EXTEND(ePtr<eServiceEvent>,
122 static void setEPGLanguageAlternative(const std::string &language)
124 eServiceEvent::setEPGLanguageAlternative(language);
129 SWIG_IGNORE(eDebugClass);
130 class eDebugClass: public iObject
132 DECLARE_REF(eDebugClass);
135 static void getDebug(ePtr<eDebugClass> &ptr, int x) { ptr = new eDebugClass(x); }
136 eDebugClass(int i) { printf("build debug class %d\n", i); x = i; }
137 ~eDebugClass() { printf("remove debug class %d\n", x); }
139 SWIG_TEMPLATE_TYPEDEF(ePtr<eDebugClass>, eDebugClassPtr);