2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
13 /// <summary>A mixin that implements standard functions for command lines.
14 /// This object parses the command line that gets passed, later the object can be accessed via accessor or the string directly.</summary>
15 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
16 [Efl.Core.ICommandLineConcrete.NativeMethods]
17 [Efl.Eo.BindingEntity]
18 public interface ICommandLine :
19 Efl.Eo.IWrapper, IDisposable
21 /// <summary>A commandline that encodes arguments in a command string. This command is unix shell-style, thus whitespace separates arguments unless escaped. Also a semi-colon ';', ampersand '&', pipe/bar '|', hash '#', bracket, square brace, brace character ('(', ')', '[', ']', '{', '}'), exclamation mark '!', backquote '`', greator or less than ('>' '<') character unless escaped or in quotes would cause args_count/value to not be generated properly, because it would force complex shell interpretation which will not be supported in evaluating the arg_count/value information, but the final shell may interpret this if this is executed via a command-line shell. To not be a complex shell command, it should be simple with paths, options and variable expansions, but nothing more complex involving the above unescaped characters.
22 /// "cat -option /path/file" "cat 'quoted argument'" "cat ~/path/escaped argument" "/bin/cat escaped argument <c>VARIABLE</c>" etc.
24 /// It should not try and use "complex shell features" if you want the arg_count and arg_value set to be correct after setting the command string. For example none of:
26 /// "VAR=x /bin/command && /bin/othercommand >& /dev/null" "VAR=x /bin/command `/bin/othercommand` | /bin/cmd2 && cmd3 &" etc.
28 /// If you set the command the arg_count/value property contents can change and be completely re-evaluated by parsing the command string into an argument array set along with interpreting escapes back into individual argument strings.</summary>
29 System.String GetCommand();
30 /// <summary>Use an array to fill this object
31 /// Every element of a string is a argument.</summary>
32 /// <param name="array">An array where every array field is an argument</param>
33 /// <returns>On success <c>true</c>, <c>false</c> otherwise</returns>
34 bool SetCommandArray(Eina.Array<Eina.Stringshare> array);
35 /// <summary>Use a string to fill this object
36 /// The string will be split at every unescaped ' ', every resulting substring will be a new argument to the command line.</summary>
37 /// <param name="str">A command in form of a string</param>
38 /// <returns>On success <c>true</c>, <c>false</c> otherwise</returns>
39 bool SetCommandString(System.String str);
40 /// <summary>Get the accessor which enables access to each argument that got passed to this object.</summary>
41 Eina.Accessor<Eina.Stringshare> CommandAccess();
42 /// <summary>A commandline that encodes arguments in a command string. This command is unix shell-style, thus whitespace separates arguments unless escaped. Also a semi-colon ';', ampersand '&', pipe/bar '|', hash '#', bracket, square brace, brace character ('(', ')', '[', ']', '{', '}'), exclamation mark '!', backquote '`', greator or less than ('>' '<') character unless escaped or in quotes would cause args_count/value to not be generated properly, because it would force complex shell interpretation which will not be supported in evaluating the arg_count/value information, but the final shell may interpret this if this is executed via a command-line shell. To not be a complex shell command, it should be simple with paths, options and variable expansions, but nothing more complex involving the above unescaped characters.
43 /// "cat -option /path/file" "cat 'quoted argument'" "cat ~/path/escaped argument" "/bin/cat escaped argument <c>VARIABLE</c>" etc.
45 /// It should not try and use "complex shell features" if you want the arg_count and arg_value set to be correct after setting the command string. For example none of:
47 /// "VAR=x /bin/command && /bin/othercommand >& /dev/null" "VAR=x /bin/command `/bin/othercommand` | /bin/cmd2 && cmd3 &" etc.
49 /// If you set the command the arg_count/value property contents can change and be completely re-evaluated by parsing the command string into an argument array set along with interpreting escapes back into individual argument strings.</summary>
50 System.String Command {
53 /// <summary>Use an array to fill this object
54 /// Every element of a string is a argument.</summary>
55 /// <value>An array where every array field is an argument</value>
56 Eina.Array<Eina.Stringshare> CommandArray {
59 /// <summary>Use a string to fill this object
60 /// The string will be split at every unescaped ' ', every resulting substring will be a new argument to the command line.</summary>
61 /// <value>A command in form of a string</value>
62 System.String CommandString {
66 /// <summary>A mixin that implements standard functions for command lines.
67 /// This object parses the command line that gets passed, later the object can be accessed via accessor or the string directly.</summary>
68 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
69 sealed public class ICommandLineConcrete :
74 /// <summary>Pointer to the native class description.</summary>
75 public override System.IntPtr NativeClass
79 if (((object)this).GetType() == typeof(ICommandLineConcrete))
81 return GetEflClassStatic();
85 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
90 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
91 /// Do not call this constructor directly.</summary>
92 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
93 private ICommandLineConcrete(ConstructingHandle ch) : base(ch)
97 [System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr
98 efl_core_command_line_mixin_get();
99 /// <summary>Initializes a new instance of the <see cref="ICommandLine"/> class.
100 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
101 /// <param name="wh">The native pointer to be wrapped.</param>
102 private ICommandLineConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
106 /// <summary>A commandline that encodes arguments in a command string. This command is unix shell-style, thus whitespace separates arguments unless escaped. Also a semi-colon ';', ampersand '&', pipe/bar '|', hash '#', bracket, square brace, brace character ('(', ')', '[', ']', '{', '}'), exclamation mark '!', backquote '`', greator or less than ('>' '<') character unless escaped or in quotes would cause args_count/value to not be generated properly, because it would force complex shell interpretation which will not be supported in evaluating the arg_count/value information, but the final shell may interpret this if this is executed via a command-line shell. To not be a complex shell command, it should be simple with paths, options and variable expansions, but nothing more complex involving the above unescaped characters.
107 /// "cat -option /path/file" "cat 'quoted argument'" "cat ~/path/escaped argument" "/bin/cat escaped argument <c>VARIABLE</c>" etc.
109 /// It should not try and use "complex shell features" if you want the arg_count and arg_value set to be correct after setting the command string. For example none of:
111 /// "VAR=x /bin/command && /bin/othercommand >& /dev/null" "VAR=x /bin/command `/bin/othercommand` | /bin/cmd2 && cmd3 &" etc.
113 /// If you set the command the arg_count/value property contents can change and be completely re-evaluated by parsing the command string into an argument array set along with interpreting escapes back into individual argument strings.</summary>
114 public System.String GetCommand() {
115 var _ret_var = Efl.Core.ICommandLineConcrete.NativeMethods.efl_core_command_line_command_get_ptr.Value.Delegate(this.NativeHandle);
116 Eina.Error.RaiseIfUnhandledException();
119 /// <summary>Use an array to fill this object
120 /// Every element of a string is a argument.</summary>
121 /// <param name="array">An array where every array field is an argument</param>
122 /// <returns>On success <c>true</c>, <c>false</c> otherwise</returns>
123 public bool SetCommandArray(Eina.Array<Eina.Stringshare> array) {
124 var _in_array = array.Handle;
126 array.OwnContent = false;
127 var _ret_var = Efl.Core.ICommandLineConcrete.NativeMethods.efl_core_command_line_command_array_set_ptr.Value.Delegate(this.NativeHandle,_in_array);
128 Eina.Error.RaiseIfUnhandledException();
131 /// <summary>Use a string to fill this object
132 /// The string will be split at every unescaped ' ', every resulting substring will be a new argument to the command line.</summary>
133 /// <param name="str">A command in form of a string</param>
134 /// <returns>On success <c>true</c>, <c>false</c> otherwise</returns>
135 public bool SetCommandString(System.String str) {
136 var _ret_var = Efl.Core.ICommandLineConcrete.NativeMethods.efl_core_command_line_command_string_set_ptr.Value.Delegate(this.NativeHandle,str);
137 Eina.Error.RaiseIfUnhandledException();
140 /// <summary>Get the accessor which enables access to each argument that got passed to this object.</summary>
141 public Eina.Accessor<Eina.Stringshare> CommandAccess() {
142 var _ret_var = Efl.Core.ICommandLineConcrete.NativeMethods.efl_core_command_line_command_access_ptr.Value.Delegate(this.NativeHandle);
143 Eina.Error.RaiseIfUnhandledException();
144 return new Eina.Accessor<Eina.Stringshare>(_ret_var, false);
146 /// <summary>A commandline that encodes arguments in a command string. This command is unix shell-style, thus whitespace separates arguments unless escaped. Also a semi-colon ';', ampersand '&', pipe/bar '|', hash '#', bracket, square brace, brace character ('(', ')', '[', ']', '{', '}'), exclamation mark '!', backquote '`', greator or less than ('>' '<') character unless escaped or in quotes would cause args_count/value to not be generated properly, because it would force complex shell interpretation which will not be supported in evaluating the arg_count/value information, but the final shell may interpret this if this is executed via a command-line shell. To not be a complex shell command, it should be simple with paths, options and variable expansions, but nothing more complex involving the above unescaped characters.
147 /// "cat -option /path/file" "cat 'quoted argument'" "cat ~/path/escaped argument" "/bin/cat escaped argument <c>VARIABLE</c>" etc.
149 /// It should not try and use "complex shell features" if you want the arg_count and arg_value set to be correct after setting the command string. For example none of:
151 /// "VAR=x /bin/command && /bin/othercommand >& /dev/null" "VAR=x /bin/command `/bin/othercommand` | /bin/cmd2 && cmd3 &" etc.
153 /// If you set the command the arg_count/value property contents can change and be completely re-evaluated by parsing the command string into an argument array set along with interpreting escapes back into individual argument strings.</summary>
154 public System.String Command {
155 get { return GetCommand(); }
157 /// <summary>Use an array to fill this object
158 /// Every element of a string is a argument.</summary>
159 /// <value>An array where every array field is an argument</value>
160 public Eina.Array<Eina.Stringshare> CommandArray {
161 set { SetCommandArray(value); }
163 /// <summary>Use a string to fill this object
164 /// The string will be split at every unescaped ' ', every resulting substring will be a new argument to the command line.</summary>
165 /// <value>A command in form of a string</value>
166 public System.String CommandString {
167 set { SetCommandString(value); }
169 private static IntPtr GetEflClassStatic()
171 return Efl.Core.ICommandLineConcrete.efl_core_command_line_mixin_get();
173 /// <summary>Wrapper for native methods and virtual method delegates.
174 /// For internal use by generated code only.</summary>
175 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
177 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Ecore);
178 /// <summary>Gets the list of Eo operations to override.</summary>
179 /// <returns>The list of Eo operations to be overload.</returns>
180 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
182 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
183 var methods = Efl.Eo.Globals.GetUserMethods(type);
185 if (efl_core_command_line_command_get_static_delegate == null)
187 efl_core_command_line_command_get_static_delegate = new efl_core_command_line_command_get_delegate(command_get);
190 if (methods.FirstOrDefault(m => m.Name == "GetCommand") != null)
192 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_core_command_line_command_get"), func = Marshal.GetFunctionPointerForDelegate(efl_core_command_line_command_get_static_delegate) });
195 if (efl_core_command_line_command_array_set_static_delegate == null)
197 efl_core_command_line_command_array_set_static_delegate = new efl_core_command_line_command_array_set_delegate(command_array_set);
200 if (methods.FirstOrDefault(m => m.Name == "SetCommandArray") != null)
202 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_core_command_line_command_array_set"), func = Marshal.GetFunctionPointerForDelegate(efl_core_command_line_command_array_set_static_delegate) });
205 if (efl_core_command_line_command_string_set_static_delegate == null)
207 efl_core_command_line_command_string_set_static_delegate = new efl_core_command_line_command_string_set_delegate(command_string_set);
210 if (methods.FirstOrDefault(m => m.Name == "SetCommandString") != null)
212 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_core_command_line_command_string_set"), func = Marshal.GetFunctionPointerForDelegate(efl_core_command_line_command_string_set_static_delegate) });
215 if (efl_core_command_line_command_access_static_delegate == null)
217 efl_core_command_line_command_access_static_delegate = new efl_core_command_line_command_access_delegate(command_access);
220 if (methods.FirstOrDefault(m => m.Name == "CommandAccess") != null)
222 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_core_command_line_command_access"), func = Marshal.GetFunctionPointerForDelegate(efl_core_command_line_command_access_static_delegate) });
227 /// <summary>Returns the Eo class for the native methods of this class.</summary>
228 /// <returns>The native class pointer.</returns>
229 public override IntPtr GetEflClass()
231 return Efl.Core.ICommandLineConcrete.efl_core_command_line_mixin_get();
234 #pragma warning disable CA1707, CS1591, SA1300, SA1600
236 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
237 private delegate System.String efl_core_command_line_command_get_delegate(System.IntPtr obj, System.IntPtr pd);
239 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
240 public delegate System.String efl_core_command_line_command_get_api_delegate(System.IntPtr obj);
242 public static Efl.Eo.FunctionWrapper<efl_core_command_line_command_get_api_delegate> efl_core_command_line_command_get_ptr = new Efl.Eo.FunctionWrapper<efl_core_command_line_command_get_api_delegate>(Module, "efl_core_command_line_command_get");
244 private static System.String command_get(System.IntPtr obj, System.IntPtr pd)
246 Eina.Log.Debug("function efl_core_command_line_command_get was called");
247 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
250 System.String _ret_var = default(System.String);
253 _ret_var = ((ICommandLine)ws.Target).GetCommand();
257 Eina.Log.Warning($"Callback error: {e.ToString()}");
258 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
266 return efl_core_command_line_command_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
270 private static efl_core_command_line_command_get_delegate efl_core_command_line_command_get_static_delegate;
272 [return: MarshalAs(UnmanagedType.U1)]
273 private delegate bool efl_core_command_line_command_array_set_delegate(System.IntPtr obj, System.IntPtr pd, System.IntPtr array);
275 [return: MarshalAs(UnmanagedType.U1)]
276 public delegate bool efl_core_command_line_command_array_set_api_delegate(System.IntPtr obj, System.IntPtr array);
278 public static Efl.Eo.FunctionWrapper<efl_core_command_line_command_array_set_api_delegate> efl_core_command_line_command_array_set_ptr = new Efl.Eo.FunctionWrapper<efl_core_command_line_command_array_set_api_delegate>(Module, "efl_core_command_line_command_array_set");
280 private static bool command_array_set(System.IntPtr obj, System.IntPtr pd, System.IntPtr array)
282 Eina.Log.Debug("function efl_core_command_line_command_array_set was called");
283 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
286 var _in_array = new Eina.Array<Eina.Stringshare>(array, true, true);
287 bool _ret_var = default(bool);
290 _ret_var = ((ICommandLine)ws.Target).SetCommandArray(_in_array);
294 Eina.Log.Warning($"Callback error: {e.ToString()}");
295 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
303 return efl_core_command_line_command_array_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), array);
307 private static efl_core_command_line_command_array_set_delegate efl_core_command_line_command_array_set_static_delegate;
309 [return: MarshalAs(UnmanagedType.U1)]
310 private delegate bool efl_core_command_line_command_string_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String str);
312 [return: MarshalAs(UnmanagedType.U1)]
313 public delegate bool efl_core_command_line_command_string_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String str);
315 public static Efl.Eo.FunctionWrapper<efl_core_command_line_command_string_set_api_delegate> efl_core_command_line_command_string_set_ptr = new Efl.Eo.FunctionWrapper<efl_core_command_line_command_string_set_api_delegate>(Module, "efl_core_command_line_command_string_set");
317 private static bool command_string_set(System.IntPtr obj, System.IntPtr pd, System.String str)
319 Eina.Log.Debug("function efl_core_command_line_command_string_set was called");
320 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
323 bool _ret_var = default(bool);
326 _ret_var = ((ICommandLine)ws.Target).SetCommandString(str);
330 Eina.Log.Warning($"Callback error: {e.ToString()}");
331 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
339 return efl_core_command_line_command_string_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), str);
343 private static efl_core_command_line_command_string_set_delegate efl_core_command_line_command_string_set_static_delegate;
346 private delegate System.IntPtr efl_core_command_line_command_access_delegate(System.IntPtr obj, System.IntPtr pd);
349 public delegate System.IntPtr efl_core_command_line_command_access_api_delegate(System.IntPtr obj);
351 public static Efl.Eo.FunctionWrapper<efl_core_command_line_command_access_api_delegate> efl_core_command_line_command_access_ptr = new Efl.Eo.FunctionWrapper<efl_core_command_line_command_access_api_delegate>(Module, "efl_core_command_line_command_access");
353 private static System.IntPtr command_access(System.IntPtr obj, System.IntPtr pd)
355 Eina.Log.Debug("function efl_core_command_line_command_access was called");
356 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
359 Eina.Accessor<Eina.Stringshare> _ret_var = default(Eina.Accessor<Eina.Stringshare>);
362 _ret_var = ((ICommandLine)ws.Target).CommandAccess();
366 Eina.Log.Warning($"Callback error: {e.ToString()}");
367 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
370 return _ret_var.Handle;
375 return efl_core_command_line_command_access_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
379 private static efl_core_command_line_command_access_delegate efl_core_command_line_command_access_static_delegate;
381 #pragma warning restore CA1707, CS1591, SA1300, SA1600
390 #pragma warning disable CS1591
391 public static class Efl_CoreICommandLineConcrete_ExtensionMethods {
393 public static Efl.BindableProperty<Eina.Array<Eina.Stringshare>> CommandArray<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Core.ICommandLine, T>magic = null) where T : Efl.Core.ICommandLine {
394 return new Efl.BindableProperty<Eina.Array<Eina.Stringshare>>("command_array", fac);
397 public static Efl.BindableProperty<System.String> CommandString<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Core.ICommandLine, T>magic = null) where T : Efl.Core.ICommandLine {
398 return new Efl.BindableProperty<System.String>("command_string", fac);
402 #pragma warning restore CS1591