// 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 FormFieldOptionFactory
	{
		public static FormFieldOption Create()
		{
			return new FormFieldOption(IntPtr.Zero);
		}
		public static void Destroy(FormFieldOption obj)
		{
		}
	}
	/// <summary>
	/// Option properties for an HTML drop down select input field.
	/// </summary>
	public class FormFieldOption {
#if __IOS__
		const string importLib = "__Internal";
#else
		const string importLib = "libVidyoClient";
#endif
		private IntPtr objPtr; // opaque VidyoFormFieldOption reference.
		public IntPtr GetObjectPtr() {
			IntPtr nValue = MarshalPtrToUtf8.GetInstance().MarshalManagedToNative(value ?? string.Empty);

			VidyoFormFieldOptionSetselectedNative(objPtr, selected);
			VidyoFormFieldOptionSetvalueNative(objPtr, nValue);

			Marshal.FreeHGlobal(nValue);
			return objPtr;
		}
		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		[return: MarshalAs(UnmanagedType.I1)]
		private static extern Boolean VidyoFormFieldOptionGetselectedNative(IntPtr obj);

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		private static extern void VidyoFormFieldOptionSetselectedNative(IntPtr obj, Boolean selected);

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

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

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

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

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

		/// <summary>
		/// Indicates whether the option was selected or not
		/// </summary>
		public Boolean selected;
		/// <summary>
		/// String value representing the option text label
		/// </summary>
		public String value;
		public FormFieldOption(IntPtr obj){
			if(obj == IntPtr.Zero) {
				objPtr = VidyoFormFieldOptionConstructDefaultNative();
			}
			else {
				objPtr = VidyoFormFieldOptionConstructCopyNative(obj);
			}

			selected = VidyoFormFieldOptionGetselectedNative(objPtr);
			value = (string)MarshalPtrToUtf8.GetInstance().MarshalNativeToManaged(VidyoFormFieldOptionGetvalueNative(objPtr));
		}
		~FormFieldOption() {
			VidyoFormFieldOptionDestructNative(objPtr);
		 }
	};
}
