using System;
using System.Runtime.InteropServices;

namespace CM2
{
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("4B1160AE-8CD7-4070-B8B5-5CD46A31E965")]
	public interface ICM2GenPlug
	{
		// Basics
		void Name([MarshalAs(UnmanagedType.LPStr)] out string name);
		void Version(out ushort version);
		void RequiredCoreVersion(out ushort requiredCoreVersion);
		// Error
		void SetParentHandle(IntPtr windowHandle);
		// Info
		void GetLastErrorMsg([MarshalAs(UnmanagedType.LPStr)] out string errorMessage);
		void GetInfoCount(out int infoCount);
		// Sensor
		void GetInfo(int index, [MarshalAs(UnmanagedType.LPStr)] out string infoName, [MarshalAs(UnmanagedType.LPStr)] out string infoValue);
		void GetSensorCount(out int sensorCount);
		void GetSensorNameOnly(int index, [MarshalAs(UnmanagedType.LPStr)] out string sensorName, out byte sensorType);
		void GetSensor(int index, [MarshalAs(UnmanagedType.LPStr)] string parameters, [MarshalAs(UnmanagedType.LPStr)] out string sensorName, out byte sensorType, [MarshalAs(UnmanagedType.LPStr)] out string sensorString, out double sensorValue);
		// Events
		void Init();
		void Terminating();
		void Setup();
		// Support
		void GetDefaultCount(int sensorIndex, out int count);
		void GetDefault(int sensorIndex, int index, [MarshalAs(UnmanagedType.LPStr)] out string name, [MarshalAs(UnmanagedType.LPStr)] out string defaultValue, [MarshalAs(UnmanagedType.LPStr)] out string description);
		void GetOptionalCount(int sensorIndex, out int count);
		void GetOptional(int sensorIndex, int index, [MarshalAs(UnmanagedType.LPStr)] out string name, [MarshalAs(UnmanagedType.LPStr)] out string defaultValue, [MarshalAs(UnmanagedType.LPStr)] out string description);
	}
}
