From e1eda4587a978396462b5938bc6da2c76ccad0d3 Mon Sep 17 00:00:00 2001 From: "SukHyung, Kang" Date: Mon, 19 Dec 2016 17:22:23 +0900 Subject: [PATCH] Add AppControlData class and terminate request API Change-Id: Idaeaec3c5db7efcea1d6e80c6759c9ac912490d9 Signed-off-by: SukHyung, Kang --- .../Tizen.Applications/AppControl.cs | 44 ++++++ .../Tizen.Applications/AppControlData.cs | 149 +++++++++++++++++++++ packaging/csapi-application.spec | 2 +- 3 files changed, 194 insertions(+), 1 deletion(-) create mode 100755 Tizen.Applications/Tizen.Applications/AppControlData.cs diff --git a/Tizen.Applications/Tizen.Applications/AppControl.cs b/Tizen.Applications/Tizen.Applications/AppControl.cs index c9d3239..c162662 100755 --- a/Tizen.Applications/Tizen.Applications/AppControl.cs +++ b/Tizen.Applications/Tizen.Applications/AppControl.cs @@ -551,6 +551,50 @@ namespace Tizen.Applications } /// + /// Sends the terminate request to the application that is launched by AppControl. + /// + /// + /// 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 + /// + /// The AppControl + /// Thrown when failed because of arguament is invalid + /// Thrown when failed because of invalid operation + /// Thrown when failed because of timeout + /// + /// + /// AppControl terminateRequest = new AppControl(); + /// terminateRequest.ApplicationId = "org.tizen.calculator"; + /// AppControl.SendTerminateRequest(terminateRequest); + /// + /// + 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); + } + } + } + + /// /// Class for Extra Data /// public class ExtraDataCollection diff --git a/Tizen.Applications/Tizen.Applications/AppControlData.cs b/Tizen.Applications/Tizen.Applications/AppControlData.cs new file mode 100755 index 0000000..fddfd09 --- /dev/null +++ b/Tizen.Applications/Tizen.Applications/AppControlData.cs @@ -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 +{ + /// + /// Data of the AppControl. + /// + public static class AppControlData + { + /// + /// Subject + /// + public const string Subject = "http://tizen.org/appcontrol/data/subject"; + + /// + /// Recipients + /// + public const string To = "http://tizen.org/appcontrol/data/to"; + + /// + /// E-mail addresses that should be carbon copied + /// + public const string Cc = "http://tizen.org/appcontrol/data/cc"; + + /// + /// E-mail addresses that should be blind carbon copied + /// + public const string Bcc = "http://tizen.org/appcontrol/data/bcc"; + + /// + /// Text + /// + public const string Text = "http://tizen.org/appcontrol/data/text"; + + /// + /// Title + /// + public const string Title = "http://tizen.org/appcontrol/data/title"; + + /// + /// Selected items + /// + public const string Selected = "http://tizen.org/appcontrol/data/selected"; + + /// + /// Paths of items + /// + public const string Path = "http://tizen.org/appcontrol/data/path"; + + /// + /// Selection mode. ("single" or "multiple") + /// + public const string SectionMode = "http://tizen.org/appcontrol/data/selection_mode"; + + /// + /// All-day mode of event ("true" or "false") + /// + public const string AllDay = "http://tizen.org/appcontrol/data/calendar/all_day"; + + /// + /// Start time of event (format: YYYY-MM-DD HH:MM:SS) + /// + public const string StartTime = "http://tizen.org/appcontrol/data/calendar/start_time"; + + /// + /// End time of event (format: YYYY-MM-DD HH:MM:SS) + /// + public const string Endtime = "http://tizen.org/appcontrol/data/calendar/end_time"; + + /// + /// E-mail addressed + /// + public const string Email = "http://tizen.org/appcontrol/data/email"; + + /// + /// Phone numbers + /// + public const string Phone = "http://tizen.org/appcontrol/data/phone"; + + /// + /// URLs + /// + public const string Url = "http://tizen.org/appcontrol/data/url"; + + /// + /// IDs + /// + public const string Ids = "http://tizen.org/appcontrol/data/id"; + + /// + /// Type + /// + public const string Type = "http://tizen.org/appcontrol/data/type"; + + /// + /// Total count + /// + public const string TotalCount = "http://tizen.org/appcontrol/data/total_count"; + + /// + /// Total size (unit : bytes) + /// + public const string TotalSize = "http://tizen.org/appcontrol/data/total_size"; + + /// + /// Name + /// + public const string Name = "http://tizen.org/appcontrol/data/name"; + + /// + /// Location + /// + public const string Location = "http://tizen.org/appcontrol/data/location"; + + /// + /// Select the type of input method + /// + public const string InputType = "http://tizen.org/appcontrol/data/input_type"; + + /// + /// Send the pre inputted text such as "http://" in web + /// + public const string InputDefaultText = "http://tizen.org/appcontrol/data/input_default_text"; + + /// + /// Send guide text to show to user such as "Input user name" + /// + public const string InputGuideText = "http://tizen.org/appcontrol/data/input_guide_text"; + + /// + /// Send text to receive answer result from smart reply + /// + public const string InputPredictionHint = "http://tizen.org/appcontrol/data/input_prediction_hint"; + } +} diff --git a/packaging/csapi-application.spec b/packaging/csapi-application.spec index 9402dbf..1e388e3 100755 --- a/packaging/csapi-application.spec +++ b/packaging/csapi-application.spec @@ -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 -- 2.7.4