// DO NOT EDIT! This is an autogenerated file. All changes will be
// overwritten!

//	Copyright (c) 2023 Vidyo, Inc. All rights reserved.


using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;

namespace VidyoClient
{
	public class CameraPresetFactory
	{
		public static CameraPreset Create()
		{
			return new CameraPreset(IntPtr.Zero);
		}
		public static void Destroy(CameraPreset obj)
		{
		}
	}
	/// <summary>
	/// Represents camera preset structure.
	/// </summary>
	public class CameraPreset {
#if __IOS__
		const string importLib = "__Internal";
#else
		const string importLib = "libVidyoClient";
#endif
		private IntPtr objPtr; // opaque VidyoCameraPreset reference.
		public IntPtr GetObjectPtr() {
			IntPtr nName = MarshalPtrToUtf8.GetInstance().MarshalManagedToNative(name ?? string.Empty);

			VidyoCameraPresetSetindexNative(objPtr, index);
			VidyoCameraPresetSetnameNative(objPtr, nName);

			Marshal.FreeHGlobal(nName);
			return objPtr;
		}
		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		private static extern uint VidyoCameraPresetGetindexNative(IntPtr obj);

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		private static extern void VidyoCameraPresetSetindexNative(IntPtr obj, uint index);

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr VidyoCameraPresetGetnameNative(IntPtr obj);

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		private static extern void VidyoCameraPresetSetnameNative(IntPtr obj, IntPtr name);

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr VidyoCameraPresetConstructCopyNative(IntPtr obj);

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr VidyoCameraPresetConstructDefaultNative();

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		public static extern void VidyoCameraPresetDestructNative(IntPtr obj);

		/// <summary>
		/// Represents preset index.
		/// </summary>
		public uint index;
		/// <summary>
		/// Represents friendly name associate with preset index.
		/// </summary>
		public String name;
		public CameraPreset(IntPtr obj){
			if(obj == IntPtr.Zero) {
				objPtr = VidyoCameraPresetConstructDefaultNative();
			}
			else {
				objPtr = VidyoCameraPresetConstructCopyNative(obj);
			}

			index = VidyoCameraPresetGetindexNative(objPtr);
			name = (string)MarshalPtrToUtf8.GetInstance().MarshalNativeToManaged(VidyoCameraPresetGetnameNative(objPtr));
		}
		~CameraPreset() {
			VidyoCameraPresetDestructNative(objPtr);
		 }
	};
}
