7d04b0b1e42d6b92abbc02a13d458ca24952817a
[platform/core/csapi/tizenfx.git] /
1 using ElmSharp;
2 using System;
3 using Tizen.Applications.ComponentBased.Common;
4
5 namespace Tizen.Applications.ComponentBased.Default
6 {
7     /// <summary>
8     /// Window information class for ComponentBasedApplication
9     /// </summary>
10     /// <since_tizen> 6 </since_tizen>
11     public class EFLWindowInfo : IWindowInfo
12     {
13         private const string LogTag = "Tizen.Applications.EFLWindow";
14         private Window _win;
15         private int _resId;
16
17         /// <summary>
18         /// Initializes the EFLWindow class.
19         /// </summary>
20         /// <param name="win">The window object of component.</param>
21         /// <since_tizen> 6 </since_tizen>
22         public EFLWindowInfo(Window win)
23         {
24             _win = win;
25         }
26
27         /// <summary>
28         /// Gets the resource ID of window
29         /// </summary>
30         /// <returns>The native handle of window</returns>
31         /// <since_tizen> 6 </since_tizen>
32         public int ResourceId
33         {
34             get
35             {
36                 if (_resId == 0)
37                 {
38                     int err = Interop.EflCBApplication.GetResourceId(_win.RealHandle, out _resId);
39                     if (err != 0)
40                         Log.Info(LogTag, "Fail to get resource ID");
41                 }
42
43                 return _resId;
44             }
45         }
46
47     }
48
49 }