1
0

svc_xmlprov.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _SVC_XMLPROVIDER_H
  2. #define _SVC_XMLPROVIDER_H
  3. #include <bfc/dispatch.h>
  4. #include <api/service/services.h>
  5. class skin_xmlreaderparams;
  6. class NOVTABLE svc_xmlProvider : public Dispatchable {
  7. public:
  8. static FOURCC getServiceType() { return WaSvc::XMLPROVIDER; }
  9. int testDesc(const wchar_t *desc);
  10. const wchar_t *getXmlData(const wchar_t *desc, const wchar_t *incpath, skin_xmlreaderparams *params=NULL);
  11. enum {
  12. TESTDESC=10,
  13. GETXMLDATA=20,
  14. };
  15. };
  16. inline int svc_xmlProvider::testDesc(const wchar_t *desc) {
  17. return _call(TESTDESC, 0, desc);
  18. }
  19. inline const wchar_t *svc_xmlProvider::getXmlData(const wchar_t *desc, const wchar_t *incpath, skin_xmlreaderparams *params) {
  20. return _call(GETXMLDATA, (const wchar_t *)0, desc, incpath, params);
  21. }
  22. // derive from this one
  23. class NOVTABLE svc_xmlProviderI : public svc_xmlProvider {
  24. public:
  25. virtual int testDesc(const wchar_t *desc)=0;
  26. virtual const wchar_t *getXmlData(const wchar_t *desc, const wchar_t *incpath, skin_xmlreaderparams *params=NULL)=0;
  27. protected:
  28. RECVS_DISPATCH;
  29. };
  30. #include <api/service/svc_enum.h>
  31. #include <bfc/string/StringW.h>
  32. class XmlProviderEnum : public SvcEnumT<svc_xmlProvider> {
  33. public:
  34. XmlProviderEnum(const wchar_t *_desc) : desc(_desc) { }
  35. protected:
  36. virtual int testService(svc_xmlProvider *svc) {
  37. return svc->testDesc(desc);
  38. }
  39. private:
  40. StringW desc;
  41. };
  42. #endif