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.
19 namespace Tizen.Applications
22 /// This class has the read only properties to get package size information.
24 public class PackageSizeInformation
26 private long _dataSize;
27 private long _cacheSize;
28 private long _appSize;
29 private long _externalDataSize;
30 private long _externalCacheSize;
31 private long _externalAppSize;
33 private PackageSizeInformation() { }
36 /// Data size for package.
38 public long DataSize { get { return _dataSize; } }
41 /// Cache size for package.
43 public long CacheSize { get { return _cacheSize; } }
46 /// Application size for package.
48 public long AppSize { get { return _appSize; } }
51 /// External data size for package.
53 public long ExternalDataSize { get { return _externalDataSize; } }
56 /// External cache size for package.
58 public long ExternalCacheSize { get { return _externalCacheSize; } }
61 /// External application size for package.
63 public long ExternalAppSize { get { return _externalAppSize; } }
65 // This method assumes that pass handle is already validated
66 internal static PackageSizeInformation GetPackageSizeInformation(IntPtr handle)
68 var pkgSizeInfo = new PackageSizeInformation();
69 Interop.PackageManager.PackageSizeInfoGetDataSize(handle, out pkgSizeInfo._dataSize);
70 Interop.PackageManager.PackageSizeInfoGetCacheSize(handle, out pkgSizeInfo._cacheSize);
71 Interop.PackageManager.PackageSizeInfoGetAppSize(handle, out pkgSizeInfo._appSize);
72 Interop.PackageManager.PackageSizeInfoGetExtDataSize(handle, out pkgSizeInfo._externalDataSize);
73 Interop.PackageManager.PackageSizeInfoGetExtCacheSize(handle, out pkgSizeInfo._externalCacheSize);
74 Interop.PackageManager.PackageSizeInfoGetExtAppSize(handle, out pkgSizeInfo._externalAppSize);