DeviceCommands.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #pragma once
  2. #include "../nu/refcount.h"
  3. #include "../devices/ifc_devicecommand.h"
  4. #include "../devices/ifc_devicesupportedcommand.h"
  5. #include "../devices/ifc_devicesupportedcommandenum.h"
  6. class PortableCommand : public ifc_devicecommand
  7. {
  8. public:
  9. PortableCommand(const char *name, int title, int description);
  10. const char *name;
  11. int title;
  12. int description;
  13. const char *GetName();
  14. HRESULT GetIcon(wchar_t *buffer, size_t bufferSize, int width, int height);
  15. HRESULT GetDisplayName(wchar_t *buffer, size_t bufferSize);
  16. HRESULT GetDescription(wchar_t *buffer, size_t bufferSize);
  17. RECVS_DISPATCH;
  18. };
  19. typedef struct DeviceCommandInfo
  20. {
  21. const char *name;
  22. DeviceCommandFlags flags;
  23. } DeviceCommandInfo;
  24. BOOL SetDeviceCommandInfo(DeviceCommandInfo *info, const char *name, DeviceCommandFlags flags);
  25. class DeviceCommand : public Countable<ifc_devicesupportedcommand>
  26. {
  27. public:
  28. DeviceCommand(const char *name, DeviceCommandFlags flags);
  29. DeviceCommand(const DeviceCommandInfo *commandInfo);
  30. public:
  31. const char *GetName();
  32. HRESULT GetFlags(DeviceCommandFlags *flags);
  33. REFERENCE_COUNT_IMPLEMENTATION;
  34. public:
  35. const char *name;
  36. DeviceCommandFlags flags;
  37. RECVS_DISPATCH;
  38. };
  39. class DeviceCommandEnumerator : public Countable<ifc_devicesupportedcommandenum>
  40. {
  41. public:
  42. DeviceCommandEnumerator(const DeviceCommandInfo *commandInfoList, size_t listSize);
  43. ~DeviceCommandEnumerator();
  44. HRESULT Next(ifc_devicesupportedcommand **buffer, size_t bufferMax, size_t *count);
  45. HRESULT Reset(void);
  46. HRESULT Skip(size_t count);
  47. HRESULT GetCount(size_t *count);
  48. REFERENCE_COUNT_IMPLEMENTATION;
  49. private:
  50. size_t position;
  51. DeviceCommand **commands;
  52. size_t count;
  53. RECVS_DISPATCH;
  54. };