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 [EditorBrowsable(EditorBrowsableState.Never)]
28 public class RecentApplicationControl
30 private const string LogTag = "Tizen.Applications";
32 private readonly string _pkgId;
34 internal RecentApplicationControl(String pkgId)
40 /// Deletes the application from the recent application list.
42 /// <privlevel>platform</privlevel>
45 Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
46 err = Interop.ApplicationManager.RuaDeleteHistoryWithPkgname(_pkgId);
47 if (err != Interop.ApplicationManager.ErrorCode.None)
49 throw ApplicationManagerErrorFactory.GetException(err, "Failed to delete application from recent application list.");
54 /// Deletes all recent applications from the recent application list.
56 /// <privlevel>platform</privlevel>
57 public static void DeleteAll()
59 Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None;
60 err = Interop.ApplicationManager.RuaClearHistory();
61 if (err != Interop.ApplicationManager.ErrorCode.None)
63 throw ApplicationManagerErrorFactory.GetException(err, "Failed to clear the recent application list.");