cceaba4126bfba986633f795c5bf756b034fb6bf
[platform/core/csapi/tizenfx.git] / src / Tizen.Applications.Common / Tizen.Applications / DirectoryInfo.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 namespace Tizen.Applications
18 {
19     /// <summary>
20     /// Represents directory information of the application.
21     /// </summary>
22     /// <since_tizen> 3 </since_tizen>
23     public class DirectoryInfo
24     {
25         private string _dataPath;
26         private string _cachePath;
27         private string _resourcePath;
28
29         private string _sharedDataPath;
30         private string _sharedResourcePath;
31         private string _sharedTrustedPath;
32
33         private string _externalDataPath;
34         private string _externalCachePath;
35         private string _externalSharedDataPath;
36
37         private string _expansionPackageResourcePath;
38
39         internal DirectoryInfo()
40         {
41         }
42
43         /// <summary>
44         /// Gets the absolute path to the application's data directory, which is used to store private data of the application.
45         /// </summary>
46         /// <since_tizen> 3 </since_tizen>
47         public string Data
48         {
49             get
50             {
51                 if (_dataPath == null)
52                     _dataPath = Interop.AppCommon.AppGetDataPath();
53                 return _dataPath;
54             }
55         }
56
57         /// <summary>
58         /// Gets the absolute path to the application's cache directory, which is used to store temporary data of the application.
59         /// </summary>
60         /// <since_tizen> 3 </since_tizen>
61         public string Cache
62         {
63             get
64             {
65                 if (_cachePath == null)
66                     _cachePath = Interop.AppCommon.AppGetCachePath();
67                 return _cachePath;
68             }
69         }
70
71         /// <summary>
72         /// Gets the absolute path to the application resource directory. The resource files are delivered with the application package.
73         /// </summary>
74         /// <since_tizen> 3 </since_tizen>
75         public string Resource
76         {
77             get
78             {
79                 if (_resourcePath == null)
80                     _resourcePath = Interop.AppCommon.AppGetResourcePath();
81                 return _resourcePath;
82             }
83         }
84
85         /// <summary>
86         /// Gets the absolute path to the application's shared data directory, which is used to share data with other applications.
87         /// </summary>
88         /// <since_tizen> 3 </since_tizen>
89         public string SharedData
90         {
91             get
92             {
93                 if (_sharedDataPath == null)
94                     _sharedDataPath = Interop.AppCommon.AppGetSharedDataPath();
95                 return _sharedDataPath;
96             }
97         }
98
99         /// <summary>
100         /// Gets the absolute path to the application's shared resource directory, which is used to share resources with other applications.
101         /// </summary>
102         /// <since_tizen> 3 </since_tizen>
103         public string SharedResource
104         {
105             get
106             {
107                 if (_sharedResourcePath == null)
108                     _sharedResourcePath = Interop.AppCommon.AppGetSharedResourcePath();
109                 return _sharedResourcePath;
110             }
111         }
112
113
114         /// <summary>
115         /// Gets the absolute path to the application's shared trusted directory, which is used to share data with a family of trusted applications.
116         /// </summary>
117         /// <since_tizen> 3 </since_tizen>
118         public string SharedTrusted
119         {
120             get
121             {
122                 if (_sharedTrustedPath == null)
123                     _sharedTrustedPath = Interop.AppCommon.AppGetSharedTrustedPath();
124                 return _sharedTrustedPath;
125             }
126         }
127
128         /// <summary>
129         /// Gets the absolute path to the application's external data directory, which is used to store data of the application.
130         /// </summary>
131         /// <since_tizen> 3 </since_tizen>
132         public string ExternalData
133         {
134             get
135             {
136                 if (_externalDataPath == null)
137                     _externalDataPath = Interop.AppCommon.AppGetExternalDataPath();
138                 return _externalDataPath;
139             }
140         }
141
142         /// <summary>
143         /// Gets the absolute path to the application's external cache directory, which is used to store temporary data of the application.
144         /// </summary>
145         /// <since_tizen> 3 </since_tizen>
146         public string ExternalCache
147         {
148             get
149             {
150                 if (_externalCachePath == null)
151                     _externalCachePath = Interop.AppCommon.AppGetExternalCachePath();
152                 return _externalCachePath;
153             }
154         }
155
156         /// <summary>
157         /// Gets the absolute path to the application's external shared data directory, which is used to share data with other applications.
158         /// </summary>
159         /// <since_tizen> 3 </since_tizen>
160         public string ExternalSharedData
161         {
162             get
163             {
164                 if (_externalSharedDataPath == null)
165                     _externalSharedDataPath = Interop.AppCommon.AppGetExternalSharedDataPath();
166                 return _externalSharedDataPath;
167             }
168         }
169
170         /// <summary>
171         /// Gets the absolute path to the application's TEP(Tizen Expansion Package) directory. The resource files are delivered with the expansion package.
172         /// </summary>
173         /// <since_tizen> 3 </since_tizen>
174         public string ExpansionPackageResource
175         {
176             get
177             {
178                 if (_expansionPackageResourcePath == null)
179                     _expansionPackageResourcePath = Interop.AppCommon.AppGetTepResourcePath();
180                 return _expansionPackageResourcePath;
181             }
182         }
183     }
184 }