Release 4.0.0-preview1-00051
[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     public class PackageManagerEventArgs : EventArgs
25     {
26         private readonly PackageType _packageType;
27         private readonly string _packageId;
28         private readonly PackageEventState _state;
29         private readonly int _progress;
30
31         internal PackageManagerEventArgs(string packageType, string packageId, PackageEventState state, int progress)
32         {
33             _packageType = PackageTypeMethods.ToPackageType(packageType);
34             _packageId = packageId;
35             _state = state;
36             _progress = progress;
37         }
38
39         /// <summary>
40         /// Type of the package to be installed, uninstalled or updated
41         /// </summary>
42         public PackageType PackageType { get { return _packageType; } }
43
44         /// <summary>
45         /// package ID to be installed, uninstalled or updated
46         /// </summary>
47         public string PackageId { get { return _packageId; } }
48
49         /// <summary>
50         /// Current state of the request to the package manager
51         /// </summary>
52         public PackageEventState State { get { return _state; } }
53
54         /// <summary>
55         /// Progress for the request being processed by the package manager (in percent).
56         /// </summary>
57         public int Progress { get { return _progress; } }
58     }
59 }