e0ad0c47ad0034cff1e09063d40a8f96492876bb
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_canvas_text_factory.eo.cs
1 #pragma warning disable CS1591
2 using System;
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Threading;
7 using System.ComponentModel;
8 namespace Efl {
9
10 namespace Canvas {
11
12 /// <summary>Object factory that creates Efl.Canvas.Object objects.
13 /// Translates a given key to an object (item), to be later placed in a text for higher level usages. The translation implementation is left to be decided by the inheriting class, whether it is by treating the <c>key</c> as an image path, or a key associated with a real-path in a hashtable or something else entirely.</summary>
14 [Efl.Canvas.ITextFactoryConcrete.NativeMethods]
15 public interface ITextFactory : 
16     Efl.Eo.IWrapper, IDisposable
17 {
18     /// <summary>Translates a given <c>key</c> to an item object, and returns the object. The returned object should be owned by the passed <c>object</c>.</summary>
19 /// <param name="kw_object">The parent of the created object</param>
20 /// <param name="key">Key that is associated to an item object</param>
21 Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key);
22     }
23 /// <summary>Object factory that creates Efl.Canvas.Object objects.
24 /// Translates a given key to an object (item), to be later placed in a text for higher level usages. The translation implementation is left to be decided by the inheriting class, whether it is by treating the <c>key</c> as an image path, or a key associated with a real-path in a hashtable or something else entirely.</summary>
25 sealed public class ITextFactoryConcrete :
26     Efl.Eo.EoWrapper
27     , ITextFactory
28     
29 {
30     ///<summary>Pointer to the native class description.</summary>
31     public override System.IntPtr NativeClass
32     {
33         get
34         {
35             if (((object)this).GetType() == typeof(ITextFactoryConcrete))
36             {
37                 return GetEflClassStatic();
38             }
39             else
40             {
41                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
42             }
43         }
44     }
45
46     [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
47         efl_canvas_text_factory_interface_get();
48     /// <summary>Initializes a new instance of the <see cref="ITextFactory"/> class.
49     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
50     private ITextFactoryConcrete(System.IntPtr raw) : base(raw)
51     {
52     }
53
54     /// <summary>Translates a given <c>key</c> to an item object, and returns the object. The returned object should be owned by the passed <c>object</c>.</summary>
55     /// <param name="kw_object">The parent of the created object</param>
56     /// <param name="key">Key that is associated to an item object</param>
57     public Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key) {
58                                                          var _ret_var = Efl.Canvas.ITextFactoryConcrete.NativeMethods.efl_canvas_text_factory_create_ptr.Value.Delegate(this.NativeHandle,kw_object, key);
59         Eina.Error.RaiseIfUnhandledException();
60                                         return _ret_var;
61  }
62     private static IntPtr GetEflClassStatic()
63     {
64         return Efl.Canvas.ITextFactoryConcrete.efl_canvas_text_factory_interface_get();
65     }
66     /// <summary>Wrapper for native methods and virtual method delegates.
67     /// For internal use by generated code only.</summary>
68     public class NativeMethods  : Efl.Eo.NativeClass
69     {
70         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Evas);
71         /// <summary>Gets the list of Eo operations to override.</summary>
72         /// <returns>The list of Eo operations to be overload.</returns>
73         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
74         {
75             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
76             var methods = Efl.Eo.Globals.GetUserMethods(type);
77
78             if (efl_canvas_text_factory_create_static_delegate == null)
79             {
80                 efl_canvas_text_factory_create_static_delegate = new efl_canvas_text_factory_create_delegate(create);
81             }
82
83             if (methods.FirstOrDefault(m => m.Name == "Create") != null)
84             {
85                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_text_factory_create"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_text_factory_create_static_delegate) });
86             }
87
88             return descs;
89         }
90         /// <summary>Returns the Eo class for the native methods of this class.</summary>
91         /// <returns>The native class pointer.</returns>
92         public override IntPtr GetEflClass()
93         {
94             return Efl.Canvas.ITextFactoryConcrete.efl_canvas_text_factory_interface_get();
95         }
96
97         #pragma warning disable CA1707, CS1591, SA1300, SA1600
98
99         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
100         private delegate Efl.Canvas.Object efl_canvas_text_factory_create_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Canvas.Object kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
101
102         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
103         public delegate Efl.Canvas.Object efl_canvas_text_factory_create_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Canvas.Object kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
104
105         public static Efl.Eo.FunctionWrapper<efl_canvas_text_factory_create_api_delegate> efl_canvas_text_factory_create_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_text_factory_create_api_delegate>(Module, "efl_canvas_text_factory_create");
106
107         private static Efl.Canvas.Object create(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.Object kw_object, System.String key)
108         {
109             Eina.Log.Debug("function efl_canvas_text_factory_create was called");
110             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
111             if (ws != null)
112             {
113                                                             Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object);
114                 try
115                 {
116                     _ret_var = ((ITextFactory)ws.Target).Create(kw_object, key);
117                 }
118                 catch (Exception e)
119                 {
120                     Eina.Log.Warning($"Callback error: {e.ToString()}");
121                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
122                 }
123
124                                         return _ret_var;
125
126             }
127             else
128             {
129                 return efl_canvas_text_factory_create_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), kw_object, key);
130             }
131         }
132
133         private static efl_canvas_text_factory_create_delegate efl_canvas_text_factory_create_static_delegate;
134
135         #pragma warning restore CA1707, CS1591, SA1300, SA1600
136
137 }
138 }
139 }
140
141 }
142