fixes to language activation callbacks and using the callbacks in mytest for setting...
[enigma2.git] / lib / service / service.h
1 #ifndef __service_h
2 #define __service_h
3
4 #include <map>
5 #include <lib/base/object.h>
6 #include <lib/service/iservice.h>
7
8 class eServiceCenter;
9
10 typedef ePtr<eServiceCenter> eServiceCenterPtr;
11
12 class eServiceCenter: public iServiceHandler
13 {
14 DECLARE_REF(eServiceCenter);
15 private:
16         std::map<int,iServiceHandlerPtr> handler;
17         static eServiceCenter *instance;
18 #ifdef SWIG
19         eServiceCenter();
20         ~eServiceCenter();
21 #endif
22 public:
23 #ifndef SWIG
24         eServiceCenter();
25         virtual ~eServiceCenter();
26 #endif
27                 // iServiceHandler
28         RESULT play(const eServiceReference &, iPlayableServicePtr &ptr);
29         RESULT record(const eServiceReference &, iRecordableServicePtr &ptr);
30         RESULT list(const eServiceReference &, iListableServicePtr &ptr);
31         RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr);
32         RESULT offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr);
33         
34                 // eServiceCenter
35         static RESULT getPrivInstance(eServiceCenterPtr &ptr) { ptr = instance; return 0; }
36         static SWIG_VOID(RESULT) getInstance(iServiceHandlerPtr &SWIG_NAMED_OUTPUT(ptr)) { ptr = instance; return 0; }
37         RESULT addServiceFactory(int id, iServiceHandler *hnd);
38         RESULT removeServiceFactory(int id);
39 };
40
41 #endif