aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Library/ml_pmp/DeviceCommands.h
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Plugins/Library/ml_pmp/DeviceCommands.h')
-rw-r--r--Src/Plugins/Library/ml_pmp/DeviceCommands.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/Src/Plugins/Library/ml_pmp/DeviceCommands.h b/Src/Plugins/Library/ml_pmp/DeviceCommands.h
new file mode 100644
index 00000000..3aa237d2
--- /dev/null
+++ b/Src/Plugins/Library/ml_pmp/DeviceCommands.h
@@ -0,0 +1,65 @@
+#pragma once
+#include "../nu/refcount.h"
+#include "../devices/ifc_devicecommand.h"
+#include "../devices/ifc_devicesupportedcommand.h"
+#include "../devices/ifc_devicesupportedcommandenum.h"
+class PortableCommand : public ifc_devicecommand
+{
+public:
+ PortableCommand(const char *name, int title, int description);
+ const char *name;
+ int title;
+ int description;
+
+ const char *GetName();
+ HRESULT GetIcon(wchar_t *buffer, size_t bufferSize, int width, int height);
+
+ HRESULT GetDisplayName(wchar_t *buffer, size_t bufferSize);
+
+ HRESULT GetDescription(wchar_t *buffer, size_t bufferSize);
+RECVS_DISPATCH;
+};
+
+typedef struct DeviceCommandInfo
+{
+ const char *name;
+ DeviceCommandFlags flags;
+} DeviceCommandInfo;
+
+BOOL SetDeviceCommandInfo(DeviceCommandInfo *info, const char *name, DeviceCommandFlags flags);
+
+class DeviceCommand : public Countable<ifc_devicesupportedcommand>
+{
+public:
+ DeviceCommand(const char *name, DeviceCommandFlags flags);
+ DeviceCommand(const DeviceCommandInfo *commandInfo);
+
+public:
+ const char *GetName();
+ HRESULT GetFlags(DeviceCommandFlags *flags);
+ REFERENCE_COUNT_IMPLEMENTATION;
+
+public:
+ const char *name;
+ DeviceCommandFlags flags;
+RECVS_DISPATCH;
+};
+
+class DeviceCommandEnumerator : public Countable<ifc_devicesupportedcommandenum>
+{
+public:
+ DeviceCommandEnumerator(const DeviceCommandInfo *commandInfoList, size_t listSize);
+ ~DeviceCommandEnumerator();
+
+ HRESULT Next(ifc_devicesupportedcommand **buffer, size_t bufferMax, size_t *count);
+ HRESULT Reset(void);
+ HRESULT Skip(size_t count);
+ HRESULT GetCount(size_t *count);
+ REFERENCE_COUNT_IMPLEMENTATION;
+
+private:
+ size_t position;
+ DeviceCommand **commands;
+ size_t count;
+ RECVS_DISPATCH;
+};