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 read-only properties to get the package size information.
24 /// <since_tizen> 3 </since_tizen>
25 public class PackageSizeInformation
27 private long _dataSize;
28 private long _cacheSize;
29 private long _appSize;
30 private long _externalDataSize;
31 private long _externalCacheSize;
32 private long _externalAppSize;
34 private PackageSizeInformation() { }
37 /// Data size for the package.
39 /// <since_tizen> 3 </since_tizen>
40 public long DataSize { get { return _dataSize; } }
43 /// Cache size for the package.
45 /// <since_tizen> 3 </since_tizen>
46 public long CacheSize { get { return _cacheSize; } }
49 /// Application size for the package.
51 /// <since_tizen> 3 </since_tizen>
52 public long AppSize { get { return _appSize; } }
55 /// External data size for the package.
57 /// <since_tizen> 3 </since_tizen>
58 public long ExternalDataSize { get { return _externalDataSize; } }
61 /// External cache size for the package.
63 /// <since_tizen> 3 </since_tizen>
64 public long ExternalCacheSize { get { return _externalCacheSize; } }
67 /// External application size for the package.
69 /// <since_tizen> 3 </since_tizen>
70 public long ExternalAppSize { get { return _externalAppSize; } }
72 // This method assumes that pass handle is already validated
73 internal static PackageSizeInformation GetPackageSizeInformation(IntPtr handle)
75 var pkgSizeInfo = new PackageSizeInformation();
76 Interop.PackageManager.PackageSizeInfoGetDataSize(handle, out pkgSizeInfo._dataSize);
77 Interop.PackageManager.PackageSizeInfoGetCacheSize(handle, out pkgSizeInfo._cacheSize);
78 Interop.PackageManager.PackageSizeInfoGetAppSize(handle, out pkgSizeInfo._appSize);
79 Interop.PackageManager.PackageSizeInfoGetExtDataSize(handle, out pkgSizeInfo._externalDataSize);
80 Interop.PackageManager.PackageSizeInfoGetExtCacheSize(handle, out pkgSizeInfo._externalCacheSize);
81 Interop.PackageManager.PackageSizeInfoGetExtAppSize(handle, out pkgSizeInfo._externalAppSize);