set timing pid
[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 <lib/base/object.h>
7 #include <lib/service/iservice.h>
8 #include <list>
9 #include <string>
10 class Event;
11 #endif
12
13 struct eComponentData
14 {
15 DECLARE_REF(eComponentData);
16 #ifndef SWIG
17         uint8_t m_streamContent;
18         uint8_t m_componentType;
19         uint8_t m_componentTag;
20         std::string m_iso639LanguageCode;
21         std::string m_text;
22 #endif
23         int getStreamContent(void) const { return m_streamContent; }
24         int getComponentType(void) const { return m_componentType; }
25         int getComponentTag(void) const { return m_componentTag; }
26         std::string getIso639LanguageCode(void) const { return m_iso639LanguageCode; }
27         std::string getText(void) const { return m_text; }
28 };
29
30 TEMPLATE_TYPEDEF(ePtr<eComponentData>, eComponentDataPtr);
31
32 class eServiceEvent: public iObject
33 {
34         DECLARE_REF(eServiceEvent);
35         bool loadLanguage(Event *event, std::string lang, int tsidonid);
36         std::list<eComponentData> m_component_data;
37         std::list<eServiceReference> m_linkage_services;
38         time_t m_begin;
39         int m_duration;
40         int m_event_id;
41         std::string m_event_name, m_short_description, m_extended_description;
42         // .. additional info
43 public:
44 #ifndef SWIG
45         RESULT parseFrom(Event *evt, int tsidonid=0);
46 #endif
47         time_t getBeginTime() const { return m_begin; }
48         int getDuration() const { return m_duration; }
49         int getEventId() const { return m_event_id; }
50         std::string getEventName() const { return m_event_name; }
51         std::string getShortDescription() const { return m_short_description; }
52         std::string getExtendedDescription() const { return m_extended_description; }
53         std::string getBeginTimeString() const;
54         SWIG_VOID(RESULT) getComponentData(ePtr<eComponentData> &SWIG_OUTPUT, int tagnum) const;
55         int getNumOfLinkageServices() const { return m_linkage_services.size(); }
56         SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, eServiceReference &parent, int num) const;
57 };
58
59 TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
60 #ifndef SWIG
61
62 class eDebugClass: public iObject
63 {
64         DECLARE_REF(eDebugClass);
65 public:
66         int x;
67         static void getDebug(ePtr<eDebugClass> &ptr, int x) { ptr = new eDebugClass(x); }
68         eDebugClass(int i) { printf("build debug class %d\n", i); x = i; }
69         ~eDebugClass() { printf("remove debug class %d\n", x); }
70 };
71
72 // TEMPLATE_TYPEDEF(ePtr<eDebugClass>, eDebugClassPtr);
73 #endif
74
75 #endif