2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
22 namespace Tizen.Applications
25 /// This class provides methods and properties to get information of the recent application.
27 /// <since_tizen> 3 </since_tizen>
28 [EditorBrowsable(EditorBrowsableState.Never)]
29 public class RecentApplicationControl
31 private const string LogTag = "Tizen.Applications";
33 private readonly string _pkgId;
35 internal RecentApplicationControl(String pkgId)
41 /// Deletes the application from the recent application list.
43 /// <privlevel>platform</privlevel>
44 /// <since_tizen> 3 </since_tizen>
47 Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
48 err = Interop.ApplicationManager.RuaDeleteHistoryWithPkgname(_pkgId);
49 if (err != Interop.ApplicationManager.ErrorCode.None)
51 throw ApplicationManagerErrorFactory.GetException(err, "Failed to delete application from recent application list.");
56 /// Deletes all recent applications from the recent application list.
58 /// <privlevel>platform</privlevel>
59 /// <since_tizen> 3 </since_tizen>
60 public static void DeleteAll()
62 Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
63 err = Interop.ApplicationManager.RuaClearHistory();
64 if (err != Interop.ApplicationManager.ErrorCode.None)
66 throw ApplicationManagerErrorFactory.GetException(err, "Failed to clear the recent application list.");