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