Add AppControlData class and terminate request API
authorSukHyung, Kang <shine.kang@samsung.com>
Mon, 19 Dec 2016 08:22:23 +0000 (17:22 +0900)
committerSukHyung Kang <shine.kang@samsung.com>
Wed, 18 Jan 2017 06:01:44 +0000 (22:01 -0800)
Change-Id: Idaeaec3c5db7efcea1d6e80c6759c9ac912490d9
Signed-off-by: SukHyung, Kang <shine.kang@samsung.com>
Tizen.Applications/Tizen.Applications/AppControl.cs
Tizen.Applications/Tizen.Applications/AppControlData.cs [new file with mode: 0755]
packaging/csapi-application.spec

index c9d3239..c162662 100755 (executable)
@@ -551,6 +551,50 @@ namespace Tizen.Applications
         }
 
         /// <summary>
+        /// Sends the terminate request to the application that is launched by AppControl.
+        /// </summary>
+        /// <remarks>
+        /// You are not allowed to terminate other general applications using this API.
+        /// This API can be used to terminate sub-applications which were launched as group mode by caller application.
+        /// Once callee application is being terminated by this API,
+        /// other applications which were launched by callee application as group mode will be terminated as well
+        /// </remarks>
+        /// <param name="terminateRequest">The AppControl</param>
+        /// <exception cref="ArgumentException">Thrown when failed because of arguament is invalid</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of invalid operation</exception>
+        /// <exception cref="TimeoutException">Thrown when failed because of timeout</exception>
+        /// <example>
+        /// <code>
+        /// AppControl terminateRequest = new AppControl();
+        /// terminateRequest.ApplicationId = "org.tizen.calculator";
+        /// AppControl.SendTerminateRequest(terminateRequest);
+        /// </code>
+        /// </example>
+        public static void SendTerminateRequest(AppControl terminateRequest)
+        {
+            if (terminateRequest == null)
+            {
+                throw new ArgumentNullException("terminateRequest");
+            }
+            Interop.AppControl.ErrorCode err;
+
+            err = Interop.AppControl.SendTerminateRequest(terminateRequest._handle);
+
+            if (err != Interop.AppControl.ErrorCode.None)
+            {
+                switch (err)
+                {
+                    case Interop.AppControl.ErrorCode.InvalidParameter:
+                        throw new ArgumentException("Invalid Arguments");
+                    case Interop.AppControl.ErrorCode.TimedOut:
+                        throw new TimeoutException("Timed out");
+                    default:
+                        throw new InvalidOperationException("Error = " + err);
+                }
+            }
+        }
+
+        /// <summary>
         /// Class for Extra Data
         /// </summary>
         public class ExtraDataCollection
diff --git a/Tizen.Applications/Tizen.Applications/AppControlData.cs b/Tizen.Applications/Tizen.Applications/AppControlData.cs
new file mode 100755 (executable)
index 0000000..fddfd09
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Tizen.Applications
+{
+    /// <summary>
+    /// Data of the AppControl.
+    /// </summary>
+    public static class AppControlData
+    {
+        /// <summary>
+        /// Subject
+        /// </summary>
+        public const string Subject = "http://tizen.org/appcontrol/data/subject";
+
+        /// <summary>
+        /// Recipients
+        /// </summary>
+        public const string To = "http://tizen.org/appcontrol/data/to";
+
+        /// <summary>
+        /// E-mail addresses that should be carbon copied
+        /// </summary>
+        public const string Cc = "http://tizen.org/appcontrol/data/cc";
+
+        /// <summary>
+        /// E-mail addresses that should be blind carbon copied
+        /// </summary>
+        public const string Bcc = "http://tizen.org/appcontrol/data/bcc";
+
+        /// <summary>
+        /// Text
+        /// </summary>
+        public const string Text = "http://tizen.org/appcontrol/data/text";
+
+        /// <summary>
+        /// Title
+        /// </summary>
+        public const string Title = "http://tizen.org/appcontrol/data/title";
+
+        /// <summary>
+        /// Selected items
+        /// </summary>
+        public const string Selected = "http://tizen.org/appcontrol/data/selected";
+
+        /// <summary>
+        /// Paths of items
+        /// </summary>
+        public const string Path = "http://tizen.org/appcontrol/data/path";
+
+        /// <summary>
+        /// Selection mode. ("single" or "multiple")
+        /// </summary>
+        public const string SectionMode = "http://tizen.org/appcontrol/data/selection_mode";
+
+        /// <summary>
+        /// All-day mode of event ("true" or "false")
+        /// </summary>
+        public const string AllDay = "http://tizen.org/appcontrol/data/calendar/all_day";
+
+        /// <summary>
+        /// Start time of event (format: YYYY-MM-DD HH:MM:SS)
+        /// </summary>
+        public const string StartTime = "http://tizen.org/appcontrol/data/calendar/start_time";
+
+        /// <summary>
+        /// End time of event (format: YYYY-MM-DD HH:MM:SS)
+        /// </summary>
+        public const string Endtime = "http://tizen.org/appcontrol/data/calendar/end_time";
+
+        /// <summary>
+        /// E-mail addressed
+        /// </summary>
+        public const string Email = "http://tizen.org/appcontrol/data/email";
+
+        /// <summary>
+        /// Phone numbers
+        /// </summary>
+        public const string Phone = "http://tizen.org/appcontrol/data/phone";
+
+        /// <summary>
+        /// URLs
+        /// </summary>
+        public const string Url = "http://tizen.org/appcontrol/data/url";
+
+        /// <summary>
+        /// IDs
+        /// </summary>
+        public const string Ids = "http://tizen.org/appcontrol/data/id";
+
+        /// <summary>
+        /// Type
+        /// </summary>
+        public const string Type = "http://tizen.org/appcontrol/data/type";
+
+        /// <summary>
+        /// Total count
+        /// </summary>
+        public const string TotalCount = "http://tizen.org/appcontrol/data/total_count";
+
+        /// <summary>
+        /// Total size (unit : bytes)
+        /// </summary>
+        public const string TotalSize = "http://tizen.org/appcontrol/data/total_size";
+
+        /// <summary>
+        /// Name
+        /// </summary>
+        public const string Name = "http://tizen.org/appcontrol/data/name";
+
+        /// <summary>
+        /// Location
+        /// </summary>
+        public const string Location = "http://tizen.org/appcontrol/data/location";
+
+        /// <summary>
+        /// Select the type of input method
+        /// </summary>
+        public const string InputType = "http://tizen.org/appcontrol/data/input_type";
+
+        /// <summary>
+        /// Send the pre inputted text such as "http://" in web
+        /// </summary>
+        public const string InputDefaultText = "http://tizen.org/appcontrol/data/input_default_text";
+
+        /// <summary>
+        /// Send guide text to show to user such as "Input user name"
+        /// </summary>
+        public const string InputGuideText = "http://tizen.org/appcontrol/data/input_guide_text";
+
+        /// <summary>
+        /// Send text to receive answer result from smart reply
+        /// </summary>
+        public const string InputPredictionHint = "http://tizen.org/appcontrol/data/input_prediction_hint";
+    }
+}
index 9402dbf..1e388e3 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       csapi-application
 Summary:    Tizen Application API for C#
-Version:    1.0.3
+Version:    1.0.4
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0