/// <summary> /// The public constructor. /// </summary> /// <since_tizen> 3 </since_tizen> /// <exception cref="InvalidOperationException">This exception can be due to an invalid state.</exception> /// <exception cref="OutOfMemoryException">This exception can be due to out Of memory.</exception> /// <exception cref="UnauthorizedAccessException">This exception can be due to permission denied.</exception> /// <exception cref="NotSupportedException">This exception can be due to not supported.</exception> public VoiceCommand() { SafeCommandHandle handle; ErrorCode error = VcCmdCreate(out handle); if (error != ErrorCode.None) { Log.Error(LogTag, "Create Failed with error " + error); throw ExceptionFactory.CreateException(error); } _handle = handle; }
/// <summary> /// Release any unmanaged resources used by this object. /// </summary> /// <param name="disposing"> /// If true, disposes any disposable objects. If false, does not dispose disposable objects. /// </param> /// <since_tizen> 6 </since_tizen> protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { _handle?.Dispose(); _handle = null; } _disposed = true; }
internal VoiceCommandsGroup(SafeCommandListHandle handle) { _handle = handle; VcCmdListCb _callback = (IntPtr vcCommand, IntPtr userData) => { SafeCommandHandle cmdHandle = new SafeCommandHandle(vcCommand); _commands.Add(new VoiceCommand(cmdHandle)); return(true); }; ErrorCode error = VcCmdListForeachCommands(_handle, _callback, IntPtr.Zero); if (error != ErrorCode.None) { Log.Error(LogTag, "GetAllCommands Failed with error " + error); throw ExceptionFactory.CreateException(error); } _commands.CollectionChanged += OnCollectionChanged; }
internal VoiceCommandList(SafeCommandListHandle handle) { _handle = handle; _index = 0; _list = new List <VoiceCommand>(); _callback = (IntPtr vcCommand, IntPtr userData) => { SafeCommandHandle cmdHandle = new SafeCommandHandle(vcCommand); cmdHandle._ownership = false; _list.Add(new VoiceCommand(cmdHandle)); return(true); }; ErrorCode error = VcCmdListForeachCommands(_handle, _callback, IntPtr.Zero); if (error != ErrorCode.None) { Log.Error(LogTag, "GetAllCommands Failed with error " + error); throw ExceptionFactory.CreateException(error); } }
internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdGetFormat(SafeCommandHandle vcCommand, out CommandFormat format);
internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdGetType(SafeCommandHandle vcCommand, out int type);
internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdGetUnfixedCommand(SafeCommandHandle vcCommand, out string command);
internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdSetCommand(SafeCommandHandle vcCommand, string command);
internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdCreate(out SafeCommandHandle vcCommand);
internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdListGetCurrent(SafeCommandListHandle cmdList, out SafeCommandHandle vcCommand);
internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdListRemove(SafeCommandListHandle cmdList, SafeCommandHandle vcCommand);
internal VoiceCommand(SafeCommandHandle handle) { _handle = handle; }
internal static extern Interop.VoiceControl.ErrorCode VcCmdSetFormat(SafeCommandHandle vcCommand, CommandFormat format);
internal static extern Interop.VoiceControl.ErrorCode VcCmdSetType(SafeCommandHandle vcCommand, CommandType type);
internal static extern Interop.VoiceControl.ErrorCode VcCmdListAdd(SafeCommandListHandle cmdList, SafeCommandHandle vcCommand);
internal static extern Interop.VoiceControlManager.ErrorCode VcCmdGetCommand(SafeCommandHandle vcCommand, out string command);