deviceConnectionParser.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef _NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_DEVICE_CONNECTION_PARSER_HEADER
  2. #define _NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_DEVICE_CONNECTION_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 CONNECTION_TAG_MAX 2
  10. class DeviceConnectionParser : public ifc_xmlreadercallback
  11. {
  12. public:
  13. DeviceConnectionParser();
  14. ~DeviceConnectionParser();
  15. public:
  16. BOOL Begin(obj_xml *reader, ifc_xmlreaderparams *params);
  17. BOOL End(obj_xml *reader, ifc_deviceconnection **connection);
  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 DeviceConnectionParser_DisplayNameCb(DeviceConnectionParser *self, ifc_deviceconnectioneditor *editor, const wchar_t *value);
  25. friend static void DeviceConnectionParser_IconCb(DeviceConnectionParser *self, ifc_deviceconnectioneditor *editor, const wchar_t *value);
  26. protected:
  27. StringBuilder elementString;
  28. ifc_deviceconnectioneditor *editor;
  29. BOOL hitList[CONNECTION_TAG_MAX];
  30. SIZE iconSize;
  31. protected:
  32. RECVS_DISPATCH;
  33. };
  34. #endif // _NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_DEVICE_CONNECTION_PARSER_HEADER