summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno da Silva Belo <brunodasilvabelo@gmail.com>2019-10-17 14:49:15 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-10-17 15:24:55 -0300
commit351b9650dfc456ebdf001c08347a65d5d4b70742 (patch)
tree00d6eb51411d1d4a6ba1e9ef50c190c60e52fdd7
parent67c07117c849a886f075b6de0e2595d0d2beb2e5 (diff)
csharp: updating eldbus_object docs and hide api.
Summary: ref T8361 Reviewers: lauromoura, felipealmeida, segfaultxavi, woohyun Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8361 Differential Revision: https://phab.enlightenment.org/D10426
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_object.cs110
1 files changed, 106 insertions, 4 deletions
diff --git a/src/bindings/mono/eldbus_mono/eldbus_object.cs b/src/bindings/mono/eldbus_mono/eldbus_object.cs
index d86ad6c..7c7e325 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_object.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_object.cs
@@ -1,7 +1,7 @@
1
2#pragma warning disable 1591 1#pragma warning disable 1591
3 2
4using System.Runtime.InteropServices; 3using System.Runtime.InteropServices;
4using System.ComponentModel;
5 5
6using static eldbus.EldbusObjectNativeFunctions; 6using static eldbus.EldbusObjectNativeFunctions;
7 7
@@ -10,6 +10,7 @@ using IntPtr = System.IntPtr;
10namespace eldbus 10namespace eldbus
11{ 11{
12 12
13[EditorBrowsable(EditorBrowsableState.Never)]
13public static class EldbusObjectNativeFunctions 14public static class EldbusObjectNativeFunctions
14{ 15{
15 [DllImport(efl.Libs.Eldbus)] public static extern IntPtr 16 [DllImport(efl.Libs.Eldbus)] public static extern IntPtr
@@ -83,15 +84,18 @@ public static class EldbusObjectNativeFunctions
83} 84}
84 85
85/// <summary>Represents a DBus object. 86/// <summary>Represents a DBus object.
86/// 87/// <para>Since EFL 1.23.</para>
87/// Since EFL 1.23.
88/// </summary> 88/// </summary>
89public class Object : System.IDisposable 89public class Object : System.IDisposable
90{ 90{
91 91 [EditorBrowsable(EditorBrowsableState.Never)]
92 public IntPtr Handle {get;set;} = IntPtr.Zero; 92 public IntPtr Handle {get;set;} = IntPtr.Zero;
93 /// <summary>Whether this managed list owns the native one.
94 /// <para>Since EFL 1.23.</para>
95 /// </summary>
93 public bool Own {get;set;} = true; 96 public bool Own {get;set;} = true;
94 97
98 [EditorBrowsable(EditorBrowsableState.Never)]
95 private void InitNew(IntPtr handle, bool own) 99 private void InitNew(IntPtr handle, bool own)
96 { 100 {
97 Handle = handle; 101 Handle = handle;
@@ -107,11 +111,21 @@ public class Object : System.IDisposable
107 } 111 }
108 } 112 }
109 113
114 [EditorBrowsable(EditorBrowsableState.Never)]
110 public Object(IntPtr handle, bool own) 115 public Object(IntPtr handle, bool own)
111 { 116 {
112 InitNew(handle, own); 117 InitNew(handle, own);
113 } 118 }
114 119
120 /// <summary>
121 /// Constructor.
122 /// <para>Since EFL 1.23.</para>
123 /// </summary>
124 /// <param name="conn"><see cref="eldbus.Connection" /> where object
125 /// belongs.</param>
126 /// <param name="bus">The name of the bus or unique id who listens for calls
127 /// of this object</param>
128 /// <param name="path">The object path of this object.</param>
115 public Object(eldbus.Connection conn, string bus, string path) 129 public Object(eldbus.Connection conn, string bus, string path)
116 { 130 {
117 if (conn == null) 131 if (conn == null)
@@ -139,11 +153,20 @@ public class Object : System.IDisposable
139 InitNew(handle, true); 153 InitNew(handle, true);
140 } 154 }
141 155
156 /// <summary>Finalizes with garbage collector.
157 /// <para>Since EFL 1.23.</para>
158 /// </summary>
142 ~Object() 159 ~Object()
143 { 160 {
144 Dispose(false); 161 Dispose(false);
145 } 162 }
146 163
164
165 /// <summary>Disposes of this list.
166 /// <para>Since EFL 1.23.</para>
167 /// </summary>
168 /// <param name="disposing">Whether this was called from the finalizer (<c>false</c>) or from the
169 /// <see cref="Dispose()"/> method.</param>
147 protected virtual void Dispose(bool disposing) 170 protected virtual void Dispose(bool disposing)
148 { 171 {
149 IntPtr h = Handle; 172 IntPtr h = Handle;
@@ -166,17 +189,28 @@ public class Object : System.IDisposable
166 } 189 }
167 } 190 }
168 191
192 /// <summary>Disposes of this list.
193 /// <para>Since EFL 1.23.</para>
194 /// </summary>
169 public void Dispose() 195 public void Dispose()
170 { 196 {
171 Dispose(true); 197 Dispose(true);
172 System.GC.SuppressFinalize(this); 198 System.GC.SuppressFinalize(this);
173 } 199 }
174 200
201 /// <summary>Releases the native resources held by this instance.
202 /// <para>Since EFL 1.23.</para>
203 /// </summary>
175 public void Free() 204 public void Free()
176 { 205 {
177 Dispose(); 206 Dispose();
178 } 207 }
179 208
209 /// <summary>
210 /// Releases the native handler.
211 /// <para>Since EFL 1.23.</para>
212 /// </summary>
213 /// <returns>The native handler.</returns>
180 public IntPtr Release() 214 public IntPtr Release()
181 { 215 {
182 IntPtr h = Handle; 216 IntPtr h = Handle;
@@ -184,6 +218,12 @@ public class Object : System.IDisposable
184 return h; 218 return h;
185 } 219 }
186 220
221 /// <summary>
222 /// Get the <see cref="eldbus.Connection" /> object associated with a
223 /// <see cref="eldbus.Object" />
224 /// <para>Since EFL 1.23.</para>
225 /// </summary>
226 /// <returns>The <see cref="eldbus.Connection" /> object</returns>
187 public eldbus.Connection GetConnection() 227 public eldbus.Connection GetConnection()
188 { 228 {
189 CheckHandle(); 229 CheckHandle();
@@ -197,6 +237,12 @@ public class Object : System.IDisposable
197 return new eldbus.Connection(conn, false); 237 return new eldbus.Connection(conn, false);
198 } 238 }
199 239
240 /// <summary>
241 /// Get the name associated with a <see cref="eldbus.Object" />
242 /// <para>Since EFL 1.23.</para>
243 /// </summary>
244 /// <returns>A string corresponding to the <see cref="eldbus.Object" />
245 /// name</returns>
200 public string GetBusName() 246 public string GetBusName()
201 { 247 {
202 CheckHandle(); 248 CheckHandle();
@@ -204,6 +250,12 @@ public class Object : System.IDisposable
204 return Eina.StringConversion.NativeUtf8ToManagedString(ptr); 250 return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
205 } 251 }
206 252
253 /// <summary>
254 /// Get the path associated with a <see cref="eldbus.Object" />
255 /// <para>Since EFL 1.23.</para>
256 /// </summary>
257 /// <returns>A string corresponding to the <see cref="eldbus.Object" />
258 /// path.</returns>
207 public string GetPath() 259 public string GetPath()
208 { 260 {
209 CheckHandle(); 261 CheckHandle();
@@ -211,18 +263,37 @@ public class Object : System.IDisposable
211 return Eina.StringConversion.NativeUtf8ToManagedString(ptr); 263 return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
212 } 264 }
213 265
266 /// <summary>
267 /// Increse object reference
268 /// <para>Since EFL 1.23.</para>
269 /// </summary>
214 public void Ref() 270 public void Ref()
215 { 271 {
216 CheckHandle(); 272 CheckHandle();
217 eldbus_object_ref(Handle); 273 eldbus_object_ref(Handle);
218 } 274 }
219 275
276 /// <summary>
277 /// Decrease object reference.
278 /// <para>If reference == 0 object will be freed and all its children.</para>
279 ///<para>
280 /// Since EFL 1.23.
281 ///</para>
282 /// </summary>
220 public void Unref() 283 public void Unref()
221 { 284 {
222 CheckHandle(); 285 CheckHandle();
223 eldbus_object_unref(Handle); 286 eldbus_object_unref(Handle);
224 } 287 }
225 288
289 /// <summary>
290 /// Send a message
291 /// <para>Since EFL 1.23.</para>
292 /// </summary>
293 /// <param name="msg">The message will be sent in connection to this object.</param>
294 /// <param name="dlgt">The function to call when receiving answer.</param>
295 /// <param name="timeout">Timeout.</param>
296 /// <returns>A <see cref="eldbus.Pending" /></returns>
226 public eldbus.Pending Send(eldbus.Message msg, eldbus.MessageDelegate dlgt = null, double timeout = -1) 297 public eldbus.Pending Send(eldbus.Message msg, eldbus.MessageDelegate dlgt = null, double timeout = -1)
227 { 298 {
228 CheckHandle(); 299 CheckHandle();
@@ -245,6 +316,13 @@ public class Object : System.IDisposable
245 return new eldbus.Pending(pending_hdl, false); 316 return new eldbus.Pending(pending_hdl, false);
246 } 317 }
247 318
319 /// <summary>
320 /// Call a dbus method on the <see cref="eldbus.Object" />.
321 /// <para>Since EFL 1.23.</para>
322 /// </summary>
323 /// <param name="_interface">The interface name.</param>
324 /// <param name="member">Name of the method to be called.</param>
325 /// <returns>A new <see cref="eldbus.Message" /></returns>
248 public eldbus.Message NewMethodCall(string _interface, string member) 326 public eldbus.Message NewMethodCall(string _interface, string member)
249 { 327 {
250 CheckHandle(); 328 CheckHandle();
@@ -259,6 +337,12 @@ public class Object : System.IDisposable
259 return new eldbus.Message(hdl, false); 337 return new eldbus.Message(hdl, false);
260 } 338 }
261 339
340 /// <summary>
341 /// Call the method Ping on the eldbus.
342 /// <para>Since EFL 1.23.</para>
343 /// </summary>
344 /// <param name="dlgt">The function to call when receiving answer.</param>
345 /// <returns>A <see cref="eldbus.Pending" /></returns>
262 public eldbus.Pending PeerPing(eldbus.MessageDelegate dlgt = null) 346 public eldbus.Pending PeerPing(eldbus.MessageDelegate dlgt = null)
263 { 347 {
264 CheckHandle(); 348 CheckHandle();
@@ -276,6 +360,12 @@ public class Object : System.IDisposable
276 return new eldbus.Pending(pending_hdl, false); 360 return new eldbus.Pending(pending_hdl, false);
277 } 361 }
278 362
363 /// <summary>
364 /// Call the method GetMachineId on the eldbus.
365 /// <para>Since EFL 1.23.</para>
366 /// </summary>
367 /// <param name="dlgt">The function to call when receiving answer.</param>
368 /// <returns>A <see cref="eldbus.Pending" /></returns>
279 public eldbus.Pending GetPeerMachineId(eldbus.MessageDelegate dlgt = null) 369 public eldbus.Pending GetPeerMachineId(eldbus.MessageDelegate dlgt = null)
280 { 370 {
281 CheckHandle(); 371 CheckHandle();
@@ -293,6 +383,12 @@ public class Object : System.IDisposable
293 return new eldbus.Pending(pending_hdl, false); 383 return new eldbus.Pending(pending_hdl, false);
294 } 384 }
295 385
386 /// <summary>
387 /// Call the method Introspect on the eldbus.
388 /// <para>Since EFL 1.23.</para>
389 /// </summary>
390 /// <param name="dlgt">The function to call when receiving answer.</param>
391 /// <returns>A <see cref="eldbus.Pending" /></returns>
296 public eldbus.Pending Introspect(eldbus.MessageDelegate dlgt = null) 392 public eldbus.Pending Introspect(eldbus.MessageDelegate dlgt = null)
297 { 393 {
298 CheckHandle(); 394 CheckHandle();
@@ -310,6 +406,12 @@ public class Object : System.IDisposable
310 return new eldbus.Pending(pending_hdl, false); 406 return new eldbus.Pending(pending_hdl, false);
311 } 407 }
312 408
409 /// <summary>
410 /// Call the method GetmanagedObjects on eldbus.
411 /// <para>Since EFL 1.23.</para>
412 /// </summary>
413 /// <param name="dlgt">The function to call when receiving answer.</param>
414 /// <returns>A <see cref="eldbus.Pending" /></returns>
313 public eldbus.Pending GetManagedObjects(eldbus.MessageDelegate dlgt = null) 415 public eldbus.Pending GetManagedObjects(eldbus.MessageDelegate dlgt = null)
314 { 416 {
315 CheckHandle(); 417 CheckHandle();