Tizen 2.1 base
[platform/framework/native/app-service.git] / inc / FIo_MmcStorageManagerService.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file         FIo_MmcStorageManagerService.h
20  * @brief       This is the header file of the _MmcStorageManagerService class.
21  *
22  * This header file contains the declarations of the _MmcStorageManagerService class.
23  */
24
25 #ifndef _FIO_INTERNAL_MMC_STORAGE_MANAGER_SERVICE_H_
26 #define _FIO_INTERNAL_MMC_STORAGE_MANAGER_SERVICE_H_
27
28 #include <string>
29 #include <map>
30
31 #include <appsvc/appsvc.h>
32 #include <bundle.h>
33 #include <vconf.h>
34
35 #include <FBaseObject.h>
36 #include <FBaseString.h>
37 #include <FAppTypes.h>
38
39 #include <FApp_ContextManager.h>
40
41 namespace Tizen { namespace Io  {
42
43 class _IMmcStorageServiceEventListener;
44
45 /**
46  * @class       _MmcStorageManagerService
47  * @brief       This class contains implementaion of MmcStorageManager feature.
48  * @since 2.1
49  * @see
50  */
51 class _MmcStorageManagerService
52         : public Tizen::Base::Object
53 {
54     typedef std::map< std::string, Tizen::Base::String* > _AppList;
55     typedef std::pair< std::string, Tizen::Base::String* > _AppListPair;
56
57 public:
58         result Construct(_IMmcStorageServiceEventListener* pStub);
59
60         result Mount(void);
61
62         result Unmount(void);
63
64         result Format(void);
65
66         static _MmcStorageManagerService* GetInstance(void);
67
68         static result ConvertNativeErrorToResult(int errNo);
69
70 private:
71         _MmcStorageManagerService(void);
72
73         virtual ~_MmcStorageManagerService(void);
74
75         static void MmcEventVconfCallback(keynode_t* node, void* userData);
76
77         static result CreateFlag(const Tizen::Base::String& path);
78
79         static result CreateExternalDirectories(const Tizen::Base::String& appRoot, const Tizen::App::PackageId& pkgId);
80
81         static _MmcStorageManagerService* __pMmcStorageManagerService;
82         _IMmcStorageServiceEventListener* __pStub;
83     _AppList __appList;
84     friend class Tizen::App::_ContextManager;
85 };
86
87 }} // Tizen::Io
88
89 #endif // _FIO_INTERNAL_MMC_STORAGE_MANAGER_SERVICE_H_
90