deviceCommandParser.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_DEVICE_COMMAND_PARSER_HEADER
  2. #define _NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_DEVICE_COMMAND_PARSER_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include "../../xml/ifc_xmlreadercallback.h"
  8. class obj_xml;
  9. #define COMMAND_TAG_MAX 3
  10. class DeviceCommandParser : public ifc_xmlreadercallback
  11. {
  12. public:
  13. DeviceCommandParser();
  14. ~DeviceCommandParser();
  15. public:
  16. BOOL Begin(obj_xml *reader, ifc_xmlreaderparams *params);
  17. BOOL End(obj_xml *reader, ifc_devicecommand **command);
  18. protected:
  19. void Event_XmlStartElement(const wchar_t *xmlpath, const wchar_t *xmltag, ifc_xmlreaderparams *params);
  20. void Event_XmlEndElement(const wchar_t *xmlpath, const wchar_t *xmltag);
  21. void Event_XmlCharData(const wchar_t *xmlpath, const wchar_t *xmltag, const wchar_t *value);
  22. void Event_XmlError(int linenum, int errcode, const wchar_t *errstr);
  23. protected:
  24. friend static void DeviceCommandParser_DisplayNameCb(DeviceCommandParser *self, ifc_devicecommandeditor *editor, const wchar_t *value);
  25. friend static void DeviceCommandParser_IconCb(DeviceCommandParser *self, ifc_devicecommandeditor *editor, const wchar_t *value);
  26. friend static void DeviceCommandParser_DescirptionCb(DeviceCommandParser *self, ifc_devicecommandeditor *editor, const wchar_t *value);
  27. protected:
  28. StringBuilder elementString;
  29. ifc_devicecommandeditor *editor;
  30. BOOL hitList[COMMAND_TAG_MAX];
  31. SIZE iconSize;
  32. protected:
  33. RECVS_DISPATCH;
  34. };
  35. #endif // _NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_DEVICE_COMMAND_PARSER_HEADER