[AppControl] Add Features Manipulating Data
authoryons.kim <yons.kim@samsung.com>
Wed, 9 Mar 2016 10:06:19 +0000 (19:06 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Wed, 23 Mar 2016 08:08:10 +0000 (17:08 +0900)
Add AppControl's features.
- AddData, GetData, RemoveData,TryGetData,
- and ExtraData Class for mentioned features
- For these features, add code for Libc.so

Change-Id: I3ef033f81c394147ed8444d4777cb148e363ea5d

17 files changed:
AppFW.sln
Tizen.Applications/Interop/Interop.AppControl.cs
Tizen.Applications/Interop/Interop.Libc.cs [new file with mode: 0644]
Tizen.Applications/Interop/Interop.Libraries.cs
Tizen.Applications/Tizen.Applications.csproj
Tizen.Applications/Tizen.Applications.csproj.user
Tizen.Applications/Tizen.Applications/AppControl.cs
Tizen.Applications/Tizen.Applications/AppControlEventArgs.cs [deleted file]
Tizen.Applications/Tizen.Applications/AppControlLaunchMode.cs [new file with mode: 0755]
Tizen.Applications/Tizen.Applications/AppControlLaunchResult.cs [new file with mode: 0755]
Tizen.Applications/Tizen.Applications/AppControlOperations.cs [new file with mode: 0755]
Tizen.Applications/Tizen.Applications/AppControlReplyReceivedEventArgs.cs [new file with mode: 0755]
Tizen.Applications/Tizen.Applications/Application.cs
Tizen.Applications/Tizen.Applications/ApplicationInfo.cs
Tizen.Applications/Tizen.Applications/LocaleChangedEventArgs.cs
Tizen.Applications/Tizen.Applications/LowMemoryEventArgs.cs
Tizen.Applications/Tizen.Applications/UIApplication.cs

index b31afed..4d309af 100755 (executable)
--- a/AppFW.sln
+++ b/AppFW.sln
@@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tizen", "..\tizen\Tizen\Tiz
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tizen.Internals", "..\tizen\Tizen.Internals\Tizen.Internals.csproj", "{B9AA1CB2-F72D-4A30-A33B-A20C850A38A0}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{296FB4FC-D152-45AF-99BF-09CC7A212262}"
-EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Any CPU = Debug|Any CPU
@@ -29,10 +27,6 @@ Global
                {B9AA1CB2-F72D-4A30-A33B-A20C850A38A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {B9AA1CB2-F72D-4A30-A33B-A20C850A38A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {B9AA1CB2-F72D-4A30-A33B-A20C850A38A0}.Release|Any CPU.Build.0 = Release|Any CPU
-               {296FB4FC-D152-45AF-99BF-09CC7A212262}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {296FB4FC-D152-45AF-99BF-09CC7A212262}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {296FB4FC-D152-45AF-99BF-09CC7A212262}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {296FB4FC-D152-45AF-99BF-09CC7A212262}.Release|Any CPU.Build.0 = Release|Any CPU
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 90595e7..a2e36a6 100755 (executable)
 /// it only in accordance with the terms of the license agreement
 /// you entered into with Samsung.
 
-
 using System;
 using System.Runtime.InteropServices;
 
+using Tizen.Internals.Errors;
+
 internal static partial class Interop
 {
     internal static partial class AppControl
     {
+        internal delegate bool ExtraDataCallback(SafeAppControlHandle handle, string key, IntPtr userData);
+        internal delegate bool AppMatchedCallback(SafeAppControlHandle handle, string applicationId, IntPtr userData);
+        internal delegate void ReplyCallback(SafeAppControlHandle request, SafeAppControlHandle reply, int result, IntPtr userData);
+
         [DllImport(Libraries.AppControl, EntryPoint = "app_control_create")]
-        internal static extern int Create(out SafeAppControlHandle handle);
+        internal static extern ErrorCode Create(out SafeAppControlHandle handle);
 
         [DllImport(Libraries.AppControl, EntryPoint = "app_control_clone")]
-        internal static extern int Clone(out SafeAppControlHandle clone, SafeAppControlHandle handle);
+        internal static extern ErrorCode DangerousClone(out SafeAppControlHandle clone, IntPtr handle);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_app_id")]
+        internal static extern ErrorCode GetAppId(IntPtr app_control, out IntPtr app_id);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_operation")]
+        internal static extern ErrorCode GetOperation(SafeAppControlHandle handle, out string operation);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_operation")]
+        internal static extern ErrorCode SetOperation(SafeAppControlHandle handle, string operation);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_uri")]
+        internal static extern ErrorCode GetUri(SafeAppControlHandle handle, out string uri);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_uri")]
+        internal static extern ErrorCode SetUri(SafeAppControlHandle handle, string uri);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_mime")]
+        internal static extern ErrorCode GetMime(SafeAppControlHandle handle, out string mime);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_mime")]
+        internal static extern ErrorCode SetMime(SafeAppControlHandle handle, string mime);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_category")]
+        internal static extern ErrorCode GetCategory(SafeAppControlHandle handle, out string category);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_category")]
+        internal static extern ErrorCode SetCategory(SafeAppControlHandle handle, string category);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_app_id")]
+        internal static extern ErrorCode GetAppId(SafeAppControlHandle handle, out string appId);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_app_id")]
+        internal static extern ErrorCode SetAppId(SafeAppControlHandle handle, string appId);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_launch_mode")]
+        internal static extern ErrorCode SetLaunchMode(SafeAppControlHandle handle, int mode);
 
-        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_app_id", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAppId(IntPtr app_control, out IntPtr app_id);
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_launch_mode")]
+        internal static extern ErrorCode GetLaunchMode(SafeAppControlHandle handle, out int mode);
 
-        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_operation", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetOperation(SafeAppControlHandle handle, out string operation);
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_caller")]
+        internal static extern ErrorCode GetCaller(SafeAppControlHandle handle, out string caller);
 
-        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_uri", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetUri(SafeAppControlHandle handle, out string uri);
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_is_reply_requested")]
+        internal static extern ErrorCode IsReplyRequested(SafeAppControlHandle handle, out bool requested);
 
-        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_mime", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetMime(SafeAppControlHandle handle, out string mime);
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_add_extra_data")]
+        internal static extern ErrorCode AddExtraData(SafeAppControlHandle handle, string key, string value);
 
-        [DllImport(Libraries.AppControl, EntryPoint = "app_control_destroy", CallingConvention = CallingConvention.Cdecl)]
-        private static extern int DangerousDestroy(IntPtr handle);
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_remove_extra_data")]
+        internal static extern ErrorCode RemoveExtraData(SafeAppControlHandle handle, string key);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_extra_data")]
+        internal static extern ErrorCode GetExtraData(SafeAppControlHandle handle, string key, out string value);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_add_extra_data_array")]
+        internal static extern ErrorCode AddExtraDataArray(SafeAppControlHandle handle, string key, string[] value, int length);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_extra_data_array")]
+        internal static extern ErrorCode GetExtraDataArray(SafeAppControlHandle handle, string key, out IntPtr value, out int length);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_is_extra_data_array")]
+        internal static extern ErrorCode IsExtraDataArray(SafeAppControlHandle handle, string key, out bool array);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_destroy")]
+        private static extern ErrorCode DangerousDestroy(IntPtr handle);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_foreach_extra_data")]
+        internal static extern ErrorCode ForeachExtraData(SafeAppControlHandle handle, ExtraDataCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_foreach_app_matched")]
+        internal static extern ErrorCode ForeachAppMatched(SafeAppControlHandle handle, AppMatchedCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.AppControl, EntryPoint = "app_control_send_launch_request")]
+        internal static extern ErrorCode SendLaunchRequest(SafeAppControlHandle handle, ReplyCallback callback, IntPtr userData);
+
+        [DllImport(Libraries.Application, EntryPoint = "app_control_send_terminate_request")]
+        internal static extern ErrorCode SendTerminateRequest(SafeAppControlHandle handle);
+
+        [DllImport(Libraries.Application, EntryPoint = "app_control_reply_to_launch_request")]
+        internal static extern ErrorCode ReplyToLaunchRequest(SafeAppControlHandle reply, SafeAppControlHandle request, int result);
+
+        [DllImport(Libraries.Application, EntryPoint = "app_control_enable_app_started_result_event")]
+        internal static extern ErrorCode EnableAppStartedResultEvent(SafeAppControlHandle handle);
 
         internal sealed class SafeAppControlHandle : SafeHandle
         {
@@ -41,10 +115,6 @@ internal static partial class Interop
             {
             }
 
-            public SafeAppControlHandle(IntPtr handle) : base(handle, false)
-            {
-            }
-
             public override bool IsInvalid
             {
                 get { return this.handle == IntPtr.Zero; }
diff --git a/Tizen.Applications/Interop/Interop.Libc.cs b/Tizen.Applications/Interop/Interop.Libc.cs
new file mode 100644 (file)
index 0000000..c968cb2
--- /dev/null
@@ -0,0 +1,20 @@
+/// Copyright 2016 by Samsung Electronics, Inc.,
+///
+/// This software is the confidential and proprietary information
+/// of Samsung Electronics, Inc. ("Confidential Information"). You
+/// shall not disclose such Confidential Information and shall use
+/// it only in accordance with the terms of the license agreement
+/// you entered into with Samsung.
+
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Libc
+    {
+        [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Free(IntPtr ptr);
+    }
+}
index 5ce88c4..9141ea0 100755 (executable)
@@ -17,5 +17,6 @@ internal static partial class Interop
         public const string AppcoreAgent = "libappcore-agent.so.1";
         public const string Bundle = "libbundle.so.0";
         public const string Glib = "libglib-2.0.so.0";
+        public const string Libc = "libc.so.6";
     }
 }
index 3536789..6ec4179 100755 (executable)
     <Compile Include="Interop\Interop.Application.cs" />
     <Compile Include="Interop\Interop.Bundle.cs" />
     <Compile Include="Interop\Interop.Glib.cs" />
+    <Compile Include="Interop\Interop.Libc.cs" />
     <Compile Include="Interop\Interop.Libraries.cs" />
     <Compile Include="Interop\Interop.Service.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Tizen.Applications\AppControlEventArgs.cs" />
     <Compile Include="Tizen.Applications\ApplicationInfo.cs" />
     <Compile Include="Tizen.Applications\LocaleChangedEventArgs.cs" />
     <Compile Include="Tizen.Applications\LowMemoryEventArgs.cs" />
     <Compile Include="Tizen.Applications\ServiceApplication.cs" />
     <Compile Include="Tizen.Applications\UIApplication.cs" />
     <Compile Include="Tizen.Applications\AppControl.cs" />
+    <Compile Include="Tizen.Applications\AppControlLaunchMode.cs" />
+    <Compile Include="Tizen.Applications\AppControlLaunchResult.cs" />
+    <Compile Include="Tizen.Applications\AppControlOperations.cs" />
+    <Compile Include="Tizen.Applications\AppControlReplyReceivedEventArgs.cs" />
     <Compile Include="Tizen.Applications\Application.cs" />
     <Compile Include="Tizen.Applications\Bundle.cs" />
     <Compile Include="Tizen.Applications\TizenSynchronizationContext.cs" />
index ca1d04b..5283ef1 100755 (executable)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <ProjectView>ProjectFiles</ProjectView>
+    <ProjectView>ShowAllFiles</ProjectView>
   </PropertyGroup>
 </Project>
\ No newline at end of file
index 24fae1c..f923d2a 100755 (executable)
@@ -8,6 +8,9 @@
 
 
 using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using Tizen.Internals.Errors;
 
 namespace Tizen.Applications
 {
@@ -16,197 +19,400 @@ namespace Tizen.Applications
     /// </summary>
     public class AppControl
     {
-        private readonly string _operation;
-        private readonly string _mime;
-        private readonly string _uri;
+        private const string LogTag = "Tizen.Applications";
+
+        private readonly Interop.AppControl.SafeAppControlHandle _handle;
+
+        private string _operation = null;
+        private string _mime = null;
+        private string _uri = null;
+        private string _category = null;
+        private string _applicationId = null;
+
+        private ExtraDataCollection _extraData = null;
 
         /// <summary>
         /// 
         /// </summary>
-        /// <param name="operation"></param>
-        /// <param name="mime"></param>
-        /// <param name="uri"></param>
-        public AppControl(string operation, string mime, string uri)
+        public event EventHandler<AppControlReplyReceivedEventArgs> AppControlReplyReceived;
+
+        /// <summary>
+        ///
+        /// </summary>
+        public AppControl()
         {
-            _operation = operation;
-            _mime = mime;
-            _uri = uri;
+            ErrorCode err = Interop.AppControl.Create(out _handle);
+            if (err != ErrorCode.None)
+            {
+                throw new InvalidOperationException("Failed to create the appcontrol handle. Err = " + err);
+            }
         }
 
-        internal AppControl(IntPtr appControlHandle)
+        internal AppControl(IntPtr handle)
         {
-            var handle = new Interop.AppControl.SafeAppControlHandle(appControlHandle);
-            Interop.AppControl.GetOperation(handle, out _operation);
-            Interop.AppControl.GetMime(handle, out _mime);
-            Interop.AppControl.GetUri(handle, out _uri);
+            ErrorCode err = Interop.AppControl.DangerousClone(out _handle, handle);
+            if (err != ErrorCode.None)
+            {
+                throw new InvalidOperationException("Failed to create the appcontrol handle. Err = " + err);
+            }
         }
 
+        #region Public Properties
+
         /// <summary>
-        /// Gets the operation to be performed. 
+        /// The operation to be performed.
         /// </summary>
-        public string Operation { get { return _operation; } }
+        public string Operation
+        {
+            get
+            {
+                if (String.IsNullOrEmpty(_operation))
+                {
+                    ErrorCode err = Interop.AppControl.GetOperation(_handle, out _operation);
+                    if (err != ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the operation from the appcontrol. Err = " + err);
+                    }
+                }
+                return _operation;
+            }
+            set
+            {
+                ErrorCode err = Interop.AppControl.SetOperation(_handle, value);
+                if (err == ErrorCode.None)
+                {
+                    _operation = value;
+                }
+                else
+                {
+                    Log.Warn(LogTag, "Failed to set the operation to the appcontrol. Err = " + err);
+                }
+            }
+        }
 
         /// <summary>
-        /// Gets the explicit MIME type of the data. 
+        /// The explicit MIME type of the data.
         /// </summary>
-        public string Mime { get { return _mime; } }
+        public string Mime
+        {
+            get
+            {
+                if (String.IsNullOrEmpty(_mime))
+                {
+                    ErrorCode err = Interop.AppControl.GetMime(_handle, out _mime);
+                    if (err != ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the mime from the appcontrol. Err = " + err);
+                    }
+                }
+                return _mime;
+            }
+            set
+            {
+                ErrorCode err = Interop.AppControl.SetMime(_handle, value);
+                if (err == ErrorCode.None)
+                {
+                    _mime = value;
+                }
+                else
+                {
+                    Log.Warn(LogTag, "Failed to set the mime to the appcontrol. Err = " + err);
+                }
+            }
+        }
 
         /// <summary>
-        /// Gets the URI of the data. 
+        /// The URI of the data.
         /// </summary>
-        public string Uri { get { return _uri; } }
-
-        internal bool IsLaunchOperation()
+        public string Uri
         {
-            if (_operation == null) return false;
-            return (_operation == Operations.Main) || (_operation == Operations.Default);
+            get
+            {
+                if (String.IsNullOrEmpty(_uri))
+                {
+                    ErrorCode err = Interop.AppControl.GetUri(_handle, out _uri);
+                    if (err != ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the uri from the appcontrol. Err = " + err);
+                    }
+                }
+                return _uri;
+            }
+            set
+            {
+                ErrorCode err = Interop.AppControl.SetUri(_handle, value);
+                if (err == ErrorCode.None)
+                {
+                    _uri = value;
+                }
+                else
+                {
+                    Log.Warn(LogTag, "Failed to set the uri to the appcontrol. Err = " + err);
+                }
+            }
         }
 
-        internal bool IsService
+        /// <summary>
+        /// 
+        /// </summary>
+        public string Category
         {
-            get { return false; }
+            get
+            {
+                if (String.IsNullOrEmpty(_category))
+                {
+                    ErrorCode err = Interop.AppControl.GetCategory(_handle, out _category);
+                    if (err != ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the category from the appcontrol. Err = " + err);
+                    }
+                }
+                return _category;
+            }
+            set
+            {
+                ErrorCode err = Interop.AppControl.SetCategory(_handle, value);
+                if (err == ErrorCode.None)
+                {
+                    _category = value;
+                }
+                else
+                {
+                    Log.Warn(LogTag, "Failed to set the category to the appcontrol. Err = " + err);
+                }
+            }
         }
 
-
         /// <summary>
         /// 
         /// </summary>
-        public static class Operations
+        public string ApplicationId
         {
-            /// <summary>
-            /// An explicit launch for a homescreen application. 
-            /// </summary>
-            public const string Main = "http://tizen.org/appcontrol/operation/main";
-
-            /// <summary>
-            /// An explicit launch for an application that excludes a homescreen application. 
-            /// </summary>
-            public const string Default = "http://tizen.org/appcontrol/operation/default";
-
-            /// <summary>
-            /// Provides an editable access to the given data. 
-            /// </summary>
-            public const string Edit = "http://tizen.org/appcontrol/operation/edit";
-
-            /// <summary>
-            /// Displays the data. 
-            /// </summary>
-            public const string View = "http://tizen.org/appcontrol/operation/view";
-
-            /// <summary>
-            /// Picks items. 
-            /// </summary>
-            public const string Pick = "http://tizen.org/appcontrol/operation/pick";
-
-            /// <summary>
-            /// Creates contents. 
-            /// </summary>
-            public const string CreateContent = "http://tizen.org/appcontrol/operation/create_content";
-
-            /// <summary>
-            /// Performs a call to someone. 
-            /// </summary>
-            public const string Call = "http://tizen.org/appcontrol/operation/call";
-
-            /// <summary>
-            /// Delivers some data to someone else. 
-            /// </summary>
-            public const string Send = "http://tizen.org/appcontrol/operation/send";
-
-            /// <summary>
-            /// Delivers text data to someone else. 
-            /// </summary>
-            public const string SendText = "http://tizen.org/appcontrol/operation/send_text";
-
-            /// <summary>
-            /// Shares an item with someone else. 
-            /// </summary>
-            public const string Share = "http://tizen.org/appcontrol/operation/share";
+            get
+            {
+                if (String.IsNullOrEmpty(_applicationId))
+                {
+                    ErrorCode err = Interop.AppControl.GetAppId(_handle, out _applicationId);
+                    if (err != ErrorCode.None)
+                    {
+                        Log.Warn(LogTag, "Failed to get the appId from the appcontrol. Err = " + err);
+                    }
+                }
+                return _applicationId;
+            }
+            set
+            {
+                ErrorCode err = Interop.AppControl.SetAppId(_handle, value);
+                if (err == ErrorCode.None)
+                {
+                    _applicationId = value;
+                }
+                else
+                {
+                    Log.Warn(LogTag, "Failed to set the appId to the appcontrol. Err = " + err);
+                }
+            }
+        }
 
-            /// <summary>
-            /// Shares multiple items with someone else. 
-            /// </summary>
-            public const string MultiShare = "http://tizen.org/appcontrol/operation/multi_share";
+        /// <summary>
+        /// 
+        /// </summary>
+        public AppControlLaunchMode LaunchMode
+        {
+            get
+            {
+                int value = 0;
+                ErrorCode err = Interop.AppControl.GetLaunchMode(_handle, out value);
+                if (err != ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the launchMode from the appcontrol. Err = " + err);
+                }
+                return (AppControlLaunchMode)value;
+            }
+            set
+            {
+                ErrorCode err = Interop.AppControl.SetLaunchMode(_handle, (int)value);
+                if (err != ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to set the launchMode to the appcontrol. Err = " + err);
+                }
+            }
+        }
 
-            /// <summary>
-            /// Shares text data with someone else. 
-            /// </summary>
-            public const string ShareText = "http://tizen.org/appcontrol/operation/share_text";
+        /// <summary>
+        /// 
+        /// </summary>
+        public string CallerApplicationId
+        {
+            get
+            {
+                string value = String.Empty;
+                ErrorCode err = Interop.AppControl.GetCaller(_handle, out value);
+                if (err != ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to get the caller appId from the appcontrol. Err = " + err);
+                }
+                return value;
+            }
+        }
 
-            /// <summary>
-            /// Dials a number. This shows a UI with the number to be dialed, allowing the user to explicitly initiate the call. 
-            /// </summary>
-            public const string Dial = "http://tizen.org/appcontrol/operation/dial";
+        /// <summary>
+        /// 
+        /// </summary>
+        public bool IsReplyRequested
+        {
+            get
+            {
+                bool value = false;
+                ErrorCode err = Interop.AppControl.IsReplyRequested(_handle, out value);
+                if (err != ErrorCode.None)
+                {
+                    Log.Warn(LogTag, "Failed to check the replyRequested of the appcontrol. Err = " + err);
+                }
+                return value;
+            }
+        }
 
-            /// <summary>
-            /// Performs a search. 
-            /// </summary>
-            public const string Search = "http://tizen.org/appcontrol/operation/search";
+        public ExtraDataCollection ExtraData
+        {
+            get
+            {
+                if (_extraData == null)
+                {
+                    _extraData = new ExtraDataCollection(_handle);
+                }
+                return _extraData;
+            }
+        }
 
-            /// <summary>
-            /// Downloads items. 
-            /// </summary>
-            public const string Download = "http://tizen.org/appcontrol/operation/download";
+        #endregion // Public Properties
 
-            /// <summary>
-            /// Prints contents. 
-            /// </summary>
-            public const string Print = "http://tizen.org/appcontrol/operation/print";
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <returns></returns>
+        public IEnumerable<string> GetMatchedApplicationIds()
+        {
+            List<string> ids = new List<string>();
+            Interop.AppControl.AppMatchedCallback callback = new Interop.AppControl.AppMatchedCallback(
+                (handle, applicationId, userData) =>
+                {
+                    List<string> idsList = Marshal.GetObjectForIUnknown(userData) as List<string>;
+                    if (idsList != null)
+                    {
+                        idsList.Add(applicationId);
+                        return true;
+                    }
+                    else
+                    {
+                        return false;
+                    }
+                });
+
+            IntPtr pointerToApplicationIds = Marshal.GetIUnknownForObject(ids);
+            if (pointerToApplicationIds != null)
+            {
+                ErrorCode err = Interop.AppControl.ForeachAppMatched(_handle, callback, pointerToApplicationIds);
+                if (err != ErrorCode.None)
+                {
+                    throw new InvalidOperationException("Failed to get matched appids. err = " + err);
+                }
+                return ids;
+            }
+
+            return ids;
+        }
 
-            /// <summary>
-            /// Composes a message. 
-            /// </summary>
-            public const string Compose = "http://tizen.org/appcontrol/operation/compose";
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="request"></param>
+        public static void SendLaunchRequest(AppControl request)
+        {
+            throw new NotImplementedException();
+        }
 
-            /// <summary>
-            /// Can be launched by interested System-Event. 
-            /// </summary>
-            public const string LaunchOnEvent = "http://tizen.org/appcontrol/operation/launch_on_event";
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="request"></param>
+        public static void SendLaunchRequestForReply(AppControl request)
+        {
+            throw new NotImplementedException();
+        }
 
-            /// <summary>
-            /// Adds an item. 
-            /// </summary>
-            public const string Add = "http://tizen.org/appcontrol/operation/add";
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="reply"></param>
+        public void Reply(AppControl reply)
+        {
+            throw new NotImplementedException();
+        }
 
-            /// <summary>
-            /// Captures images by camera applications. 
-            /// </summary>
-            public const string ImageCapture = "http://tizen.org/appcontrol/operation/image_capture";
 
-            /// <summary>
-            /// Captures videos by camera applications. 
-            /// </summary>
-            public const string VideoCapture = "http://tizen.org/appcontrol/operation/video_capture";
+        /// <summary>
+        /// 
+        /// </summary>
+        public class ExtraDataCollection
+        {
+            private readonly Interop.AppControl.SafeAppControlHandle _handle;
 
-            /// <summary>
-            /// Shows system settings. 
-            /// </summary>
-            public const string Setting = "http://tizen.org/appcontrol/operation/setting";
+            internal ExtraDataCollection(Interop.AppControl.SafeAppControlHandle handle)
+            {
+                _handle = handle;
+            }
 
             /// <summary>
-            /// Shows settings to enable Bluetooth. 
+            /// 
             /// </summary>
-            public const string SettingBluetoothEnable = "http://tizen.org/appcontrol/operation/setting/bt_enable";
+            /// <param name="key"></param>
+            /// <param name="value"></param>
+            public void Add(string key, string value)
+            {
+                throw new NotImplementedException();
+            }
 
             /// <summary>
-            /// Shows settings to configure Bluetooth visibility. 
+            /// 
             /// </summary>
-            public const string SettingBluetoothVisibility = "http://tizen.org/appcontrol/operation/setting/bt_visibility";
+            /// <param name="key"></param>
+            /// <param name="value"></param>
+            public void Add(string key, IEnumerable<string> value)
+            {
+                throw new NotImplementedException();
+            }
 
             /// <summary>
-            /// Shows settings to allow configuration of current location sources. 
+            /// 
             /// </summary>
-            public const string SettingLocation = "http://tizen.org/appcontrol/operation/setting/location";
+            /// <typeparam name="T"></typeparam>
+            /// <param name="key"></param>
+            /// <returns></returns>
+            public T Get<T>(string key)
+            {
+                throw new NotImplementedException();
+            }
 
             /// <summary>
-            /// Shows NFC settings. 
+            /// 
             /// </summary>
-            public const string SettingNfc = "http://tizen.org/appcontrol/operation/setting/nfc";
+            /// <param name="key"></param>
+            /// <returns></returns>
+            public object Get(string key)
+            {
+                throw new NotImplementedException();
+            }
 
             /// <summary>
-            /// Shows settings to allow configuration of Wi-Fi. 
+            /// 
             /// </summary>
-            public const string SettingWifi = "http://tizen.org/appcontrol/operation/setting/wifi";
+            /// <param name="key"></param>
+            public void Remove(string key)
+            {
+                throw new NotImplementedException();
+            }
         }
+
     }
 }
diff --git a/Tizen.Applications/Tizen.Applications/AppControlEventArgs.cs b/Tizen.Applications/Tizen.Applications/AppControlEventArgs.cs
deleted file mode 100755 (executable)
index dd735b1..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tizen.Applications
-{
-    public class AppControlEventArgs : EventArgs
-    {
-        public AppControl AppControl { get; internal set; }
-    }
-}
diff --git a/Tizen.Applications/Tizen.Applications/AppControlLaunchMode.cs b/Tizen.Applications/Tizen.Applications/AppControlLaunchMode.cs
new file mode 100755 (executable)
index 0000000..c240a34
--- /dev/null
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    public enum AppControlLaunchMode
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        Single = 0,
+
+        /// <summary>
+        /// 
+        /// </summary>
+        Group,
+    }
+}
diff --git a/Tizen.Applications/Tizen.Applications/AppControlLaunchResult.cs b/Tizen.Applications/Tizen.Applications/AppControlLaunchResult.cs
new file mode 100755 (executable)
index 0000000..1464443
--- /dev/null
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Enumeration for App Control Result.
+    /// </summary>
+    public enum AppControlLaunchResult
+    {
+        /// <summary>
+        /// Callee application is launched actually.
+        /// </summary>
+        AppStarted = 1,
+
+        /// <summary>
+        /// Operation is succeeded
+        /// </summary>
+        Succeeded = 0,
+
+        /// <summary>
+        /// Operation is failed by the callee
+        /// </summary>
+        Failed = -1,
+
+        /// <summary>
+        /// Operation is canceled by the platform
+        /// </summary>
+        Canceled = -2,
+    }
+}
diff --git a/Tizen.Applications/Tizen.Applications/AppControlOperations.cs b/Tizen.Applications/Tizen.Applications/AppControlOperations.cs
new file mode 100755 (executable)
index 0000000..b9137f2
--- /dev/null
@@ -0,0 +1,149 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    ///
+    /// </summary>
+    public static class AppControlOperations
+    {
+        /// <summary>
+        /// An explicit launch for a homescreen application.
+        /// </summary>
+        public const string Main = "http://tizen.org/appcontrol/operation/main";
+
+        /// <summary>
+        /// An explicit launch for an application that excludes a homescreen application.
+        /// </summary>
+        public const string Default = "http://tizen.org/appcontrol/operation/default";
+
+        /// <summary>
+        /// Provides an editable access to the given data.
+        /// </summary>
+        public const string Edit = "http://tizen.org/appcontrol/operation/edit";
+
+        /// <summary>
+        /// Displays the data.
+        /// </summary>
+        public const string View = "http://tizen.org/appcontrol/operation/view";
+
+        /// <summary>
+        /// Picks items.
+        /// </summary>
+        public const string Pick = "http://tizen.org/appcontrol/operation/pick";
+
+        /// <summary>
+        /// Creates contents.
+        /// </summary>
+        public const string CreateContent = "http://tizen.org/appcontrol/operation/create_content";
+
+        /// <summary>
+        /// Performs a call to someone.
+        /// </summary>
+        public const string Call = "http://tizen.org/appcontrol/operation/call";
+
+        /// <summary>
+        /// Delivers some data to someone else.
+        /// </summary>
+        public const string Send = "http://tizen.org/appcontrol/operation/send";
+
+        /// <summary>
+        /// Delivers text data to someone else.
+        /// </summary>
+        public const string SendText = "http://tizen.org/appcontrol/operation/send_text";
+
+        /// <summary>
+        /// Shares an item with someone else.
+        /// </summary>
+        public const string Share = "http://tizen.org/appcontrol/operation/share";
+
+        /// <summary>
+        /// Shares multiple items with someone else.
+        /// </summary>
+        public const string MultiShare = "http://tizen.org/appcontrol/operation/multi_share";
+
+        /// <summary>
+        /// Shares text data with someone else.
+        /// </summary>
+        public const string ShareText = "http://tizen.org/appcontrol/operation/share_text";
+
+        /// <summary>
+        /// Dials a number. This shows a UI with the number to be dialed, allowing the user to explicitly initiate the call.
+        /// </summary>
+        public const string Dial = "http://tizen.org/appcontrol/operation/dial";
+
+        /// <summary>
+        /// Performs a search.
+        /// </summary>
+        public const string Search = "http://tizen.org/appcontrol/operation/search";
+
+        /// <summary>
+        /// Downloads items.
+        /// </summary>
+        public const string Download = "http://tizen.org/appcontrol/operation/download";
+
+        /// <summary>
+        /// Prints contents.
+        /// </summary>
+        public const string Print = "http://tizen.org/appcontrol/operation/print";
+
+        /// <summary>
+        /// Composes a message.
+        /// </summary>
+        public const string Compose = "http://tizen.org/appcontrol/operation/compose";
+
+        /// <summary>
+        /// Can be launched by interested System-Event.
+        /// </summary>
+        public const string LaunchOnEvent = "http://tizen.org/appcontrol/operation/launch_on_event";
+
+        /// <summary>
+        /// Adds an item.
+        /// </summary>
+        public const string Add = "http://tizen.org/appcontrol/operation/add";
+
+        /// <summary>
+        /// Captures images by camera applications.
+        /// </summary>
+        public const string ImageCapture = "http://tizen.org/appcontrol/operation/image_capture";
+
+        /// <summary>
+        /// Captures videos by camera applications.
+        /// </summary>
+        public const string VideoCapture = "http://tizen.org/appcontrol/operation/video_capture";
+
+        /// <summary>
+        /// Shows system settings.
+        /// </summary>
+        public const string Setting = "http://tizen.org/appcontrol/operation/setting";
+
+        /// <summary>
+        /// Shows settings to enable Bluetooth.
+        /// </summary>
+        public const string SettingBluetoothEnable = "http://tizen.org/appcontrol/operation/setting/bt_enable";
+
+        /// <summary>
+        /// Shows settings to configure Bluetooth visibility.
+        /// </summary>
+        public const string SettingBluetoothVisibility = "http://tizen.org/appcontrol/operation/setting/bt_visibility";
+
+        /// <summary>
+        /// Shows settings to allow configuration of current location sources.
+        /// </summary>
+        public const string SettingLocation = "http://tizen.org/appcontrol/operation/setting/location";
+
+        /// <summary>
+        /// Shows NFC settings.
+        /// </summary>
+        public const string SettingNfc = "http://tizen.org/appcontrol/operation/setting/nfc";
+
+        /// <summary>
+        /// Shows settings to allow configuration of Wi-Fi.
+        /// </summary>
+        public const string SettingWifi = "http://tizen.org/appcontrol/operation/setting/wifi";
+    }
+}
diff --git a/Tizen.Applications/Tizen.Applications/AppControlReplyReceivedEventArgs.cs b/Tizen.Applications/Tizen.Applications/AppControlReplyReceivedEventArgs.cs
new file mode 100755 (executable)
index 0000000..b3cdf56
--- /dev/null
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    public class AppControlReplyReceivedEventArgs
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        public AppControl Request { get; internal set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public AppControl Reply { get; internal set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public AppControlLaunchResult Result { get; internal set; }
+    }
+}
index fd8a5d9..f9b09b0 100755 (executable)
@@ -12,7 +12,7 @@ using System;
 namespace Tizen.Applications
 {
     /// <summary>
-    /// 
+    /// The Application handles an application state change or system events and provides mechanisms that launch other applications.
     /// </summary>
     public abstract class Application
     {
@@ -22,12 +22,12 @@ namespace Tizen.Applications
         private Interop.AppEvent.SafeAppEventHandle _localeChangedNativeHandle;
 
         /// <summary>
-        /// 
+        /// The low memory event.
         /// </summary>
         public event EventHandler<LowMemoryEventArgs> LowMemory;
 
         /// <summary>
-        /// 
+        /// The system language changed event.
         /// </summary>
         public event EventHandler<LocaleChangedEventArgs> LocaleChanged;
 
@@ -42,7 +42,7 @@ namespace Tizen.Applications
         public ApplicationInfo ApplicationInfo { get; internal set; }
 
         /// <summary>
-        /// 
+        /// Runs the application's main loop.
         /// </summary>
         /// <param name="args"></param>
         public virtual void Run(string[] args)
@@ -54,27 +54,36 @@ namespace Tizen.Applications
         }
 
         /// <summary>
-        /// 
+        /// Exits the main loop of application. 
         /// </summary>
         public abstract void Exit();
 
-        internal void SendCreate()
-        {
-            ApplicationInfo = new ApplicationInfo();
-            OnCreate();
-        }
+        /// <summary>
+        /// 
+        /// </summary>
         protected virtual void OnCreate()
         {
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
         protected virtual void OnTerminate()
         {
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="control"></param>
         protected virtual void OnStart(AppControl control)
         {
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="e"></param>
         protected virtual void OnLowMemory(LowMemoryEventArgs e)
         {
             EventHandler<LowMemoryEventArgs> eh = LowMemory;
@@ -84,6 +93,10 @@ namespace Tizen.Applications
             }
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="e"></param>
         protected virtual void OnLocaleChanged(LocaleChangedEventArgs e)
         {
             EventHandler<LocaleChangedEventArgs> eh = LocaleChanged;
@@ -93,6 +106,12 @@ namespace Tizen.Applications
             }
         }
 
+        internal void SendCreate()
+        {
+            ApplicationInfo = new ApplicationInfo();
+            OnCreate();
+        }
+
         private void HandleAppEvent(string eventName, IntPtr eventData, IntPtr data)
         {
             Bundle b = new Bundle(eventData);
index 4122d7e..f30f1db 100755 (executable)
@@ -138,6 +138,9 @@ namespace Tizen.Applications
         }
 
 
+        /// <summary>
+        /// 
+        /// </summary>
         public class SharedPaths
         {
             internal SharedPaths() { }
@@ -175,6 +178,9 @@ namespace Tizen.Applications
             }
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
         public class ExternalPaths
         {
             internal ExternalPaths() { }
index 19cc970..c044398 100755 (executable)
@@ -6,8 +6,14 @@ using System.Threading.Tasks;
 
 namespace Tizen.Applications
 {
+    /// <summary>
+    /// 
+    /// </summary>
     public class LocaleChangedEventArgs
     {
+        /// <summary>
+        /// 
+        /// </summary>
         public string Locale { get; internal set; }
     }
 }
index 5f172f4..44c222e 100755 (executable)
@@ -15,8 +15,14 @@ using System.Threading.Tasks;
 
 namespace Tizen.Applications
 {
+    /// <summary>
+    /// 
+    /// </summary>
     public class LowMemoryEventArgs : EventArgs
     {
+        /// <summary>
+        /// 
+        /// </summary>
         public LowMemoryStatus LowMemoryStatus { get; internal set; }
     }
 }
index 0e605dc..e80dfca 100755 (executable)
@@ -64,10 +64,16 @@ namespace Tizen.Applications
             Interop.Application.Exit();
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
         protected virtual void OnResume()
         {
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
         protected virtual void OnPause()
         {
         }