add iSubserviceList interface to iRecordableService
[enigma2.git] / lib / service / servicefs.h
1 #ifndef __servicefs_h
2 #define __servicefs_h
3
4 #include <lib/service/iservice.h>
5
6 class eServiceFactoryFS: public iServiceHandler
7 {
8         DECLARE_REF(eServiceFactoryFS);
9 public:
10         eServiceFactoryFS();
11         virtual ~eServiceFactoryFS();
12         enum { id = 0x2 };
13
14                 // iServiceHandler
15         RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr);
16         RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
17         RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
18         RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr);
19         RESULT offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr);
20 private:
21         ePtr<iStaticServiceInformation> m_service_information;
22 };
23
24 class eServiceFS: public iListableService
25 {
26         DECLARE_REF(eServiceFS);
27         std::string path;
28         friend class eServiceFactoryFS;
29         eServiceFS(const char *path, const char *additional_extensions=0);
30         std::map<int, std::list<std::string> > m_additional_extensions;
31         
32         int m_list_valid;
33         std::list<eServiceReference> m_list;
34         int getServiceTypeForExtension(const char *str);
35         int getServiceTypeForExtension(const std::string &str);
36 public:
37         virtual ~eServiceFS();
38
39         RESULT getContent(std::list<eServiceReference> &list, bool sorted=false);
40         PyObject *getContent(const char *format, bool sorted=false);
41         RESULT getNext(eServiceReference &ptr);
42         int compareLessEqual(const eServiceReference &, const eServiceReference &);
43         RESULT startEdit(ePtr<iMutableServiceList> &);
44 };
45
46 #endif