Release 9.0.0.16887
[platform/core/csapi/tizenfx.git] / src / Tizen.Applications.PackageManager / Tizen.Applications / PackageManagerEventArgs.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18
19 namespace Tizen.Applications
20 {
21     /// <summary>
22     /// PackageManagerEventArgs class. This class is an event arguments of the InstallProgressChanged, UninstallProgressChanged, and UpdateProgressChanged events.
23     /// </summary>
24     /// <since_tizen> 3 </since_tizen>
25     public class PackageManagerEventArgs : EventArgs
26     {
27         private readonly PackageType _packageType;
28         private readonly string _packageId;
29         private readonly PackageEventState _state;
30         private readonly int _progress;
31
32         internal PackageManagerEventArgs(string packageType, string packageId, PackageEventState state, int progress)
33         {
34             _packageType = PackageTypeMethods.ToPackageType(packageType);
35             _packageId = packageId;
36             _state = state;
37             _progress = progress;
38         }
39
40         /// <summary>
41         /// Type of the package to be installed, uninstalled, or updated.
42         /// </summary>
43         /// <since_tizen> 3 </since_tizen>
44         public PackageType PackageType { get { return _packageType; } }
45
46         /// <summary>
47         /// Package ID to be installed, uninstalled, or updated.
48         /// </summary>
49         /// <since_tizen> 3 </since_tizen>
50         public string PackageId { get { return _packageId; } }
51
52         /// <summary>
53         /// Current state of the request to the package manager.
54         /// </summary>
55         /// <since_tizen> 3 </since_tizen>
56         public PackageEventState State { get { return _state; } }
57
58         /// <summary>
59         /// Progress for the request being processed by the package manager (in percent).
60         /// </summary>
61         /// <since_tizen> 3 </since_tizen>
62         public int Progress { get { return _progress; } }
63     }
64 }