update es, da language
[enigma2.git] / lib / service / event.h
1 #ifndef __lib_service_event_h
2 #define __lib_service_event_h
3
4 #ifndef SWIG
5 #include <time.h>
6 #include <list>
7 #include <string>
8 class Event;
9 #endif
10
11 #include <lib/base/object.h>
12 #include <lib/service/iservice.h>
13
14 SWIG_IGNORE(eComponentData);
15 struct eComponentData
16 {
17 DECLARE_REF(eComponentData);
18 #ifndef SWIG
19         uint8_t m_streamContent;
20         uint8_t m_componentType;
21         uint8_t m_componentTag;
22         std::string m_iso639LanguageCode;
23         std::string m_text;
24 #endif
25         int getStreamContent(void) const { return m_streamContent; }
26         int getComponentType(void) const { return m_componentType; }
27         int getComponentTag(void) const { return m_componentTag; }
28         std::string getIso639LanguageCode(void) const { return m_iso639LanguageCode; }
29         std::string getText(void) const { return m_text; }
30 };
31 SWIG_TEMPLATE_TYPEDEF(ePtr<eComponentData>, eComponentDataPtr);
32
33 SWIG_ALLOW_OUTPUT_SIMPLE(eServiceReference);  // needed for SWIG_OUTPUT in eServiceEvent::getLinkageService
34
35 SWIG_IGNORE(eServiceEvent);
36 class eServiceEvent: public iObject
37 {
38         DECLARE_REF(eServiceEvent);
39         bool loadLanguage(Event *event, std::string lang, int tsidonid);
40         std::list<eComponentData> m_component_data;
41         std::list<eServiceReference> m_linkage_services;
42         time_t m_begin;
43         int m_duration;
44         int m_event_id;
45         std::string m_event_name, m_short_description, m_extended_description;
46         static std::string m_language;
47         // .. additional info
48 public:
49 #ifndef SWIG
50         RESULT parseFrom(Event *evt, int tsidonid=0);
51         RESULT parseFrom(const std::string filename, int tsidonid=0);
52         static void setEPGLanguage( const std::string language );
53 #endif
54         time_t getBeginTime() const { return m_begin; }
55         int getDuration() const { return m_duration; }
56         int getEventId() const { return m_event_id; }
57         std::string getEventName() const { return m_event_name; }
58         std::string getShortDescription() const { return m_short_description; }
59         std::string getExtendedDescription() const { return m_extended_description; }
60         std::string getBeginTimeString() const;
61         SWIG_VOID(RESULT) getComponentData(ePtr<eComponentData> &SWIG_OUTPUT, int tagnum) const;
62         PyObject *getComponentData() const;
63         int getNumOfLinkageServices() const { return m_linkage_services.size(); }
64         SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, eServiceReference &parent, int num) const;
65 };
66 SWIG_TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEvent);
67 SWIG_EXTEND(ePtr<eServiceEvent>,
68         static void setEPGLanguage( const std::string language )
69         {
70                 extern void setServiceEventLanguage(const std::string language);
71                 setServiceEventLanguage(language);
72         }
73 );
74
75 #ifndef SWIG
76 SWIG_IGNORE(eDebugClass);
77 class eDebugClass: public iObject
78 {
79         DECLARE_REF(eDebugClass);
80 public:
81         int x;
82         static void getDebug(ePtr<eDebugClass> &ptr, int x) { ptr = new eDebugClass(x); }
83         eDebugClass(int i) { printf("build debug class %d\n", i); x = i; }
84         ~eDebugClass() { printf("remove debug class %d\n", x); }
85 };
86 SWIG_TEMPLATE_TYPEDEF(ePtr<eDebugClass>, eDebugClassPtr);
87 #endif
88
89 #endif