Refactor AppFW
[platform/core/csapi/tizenfx.git] / Tizen.Applications / Tizen.Applications / ReceivedAppControl.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Threading.Tasks;
6
7 using Tizen.Internals.Errors;
8
9 namespace Tizen.Applications
10 {
11     public class ReceivedAppControl : AppControl
12     {
13         private const string LogTag = "Tizen.Applications";
14
15         internal ReceivedAppControl(IntPtr handle)
16         {
17             ErrorCode err = Interop.AppControl.DangerousClone(out _handle, handle);
18             if (err != ErrorCode.None)
19             {
20                 throw new InvalidOperationException("Failed to create the appcontrol handle. Err = " + err);
21             }
22         }
23
24         /// <summary>
25         /// 
26         /// </summary>
27         public string CallerApplicationId
28         {
29             get
30             {
31                 string value = String.Empty;
32                 ErrorCode err = Interop.AppControl.GetCaller(_handle, out value);
33                 if (err != ErrorCode.None)
34                 {
35                     Log.Warn(LogTag, "Failed to get the caller appId from the appcontrol. Err = " + err);
36                 }
37                 return value;
38             }
39         }
40
41         /// <summary>
42         /// 
43         /// </summary>
44         public bool IsReplyRequested
45         {
46             get
47             {
48                 bool value = false;
49                 ErrorCode err = Interop.AppControl.IsReplyRequested(_handle, out value);
50                 if (err != ErrorCode.None)
51                 {
52                     Log.Warn(LogTag, "Failed to check the replyRequested of the appcontrol. Err = " + err);
53                 }
54                 return value;
55             }
56         }
57
58
59         /// <summary>
60         /// 
61         /// </summary>
62         /// <param name="reply"></param>
63         public void Reply(AppControl reply)
64         {
65             throw new NotImplementedException();
66         }
67
68     }
69 }