2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FIoMmcStorageManager.h
20 * @brief This is the header file for the %MmcStorageManager class.
22 * This header file contains the declarations of the %MmcStorageManager class.
25 #ifndef _FIO_MMC_STORAGE_MANAGER_H_
26 #define _FIO_MMC_STORAGE_MANAGER_H_
28 #include <FBaseObject.h>
29 #include <FBaseResult.h>
30 #include <FIoIMmcStorageMountListener.h>
31 #include <FIoIMmcStorageFormatListener.h>
33 namespace Tizen { namespace Io
37 * @class MmcStorageManager
38 * @brief This class provides methods to mount, unmount, and format external MMC.
42 * @final This class is not intended for extension.
44 * The %MmcStorageManager class provides methods to mount, unmount, and format external MMC.
46 * @see IMmcStorageMountListener
47 * @see IMmcStorageFormatListener
49 class _OSP_EXPORT_ MmcStorageManager
50 : public Tizen::Base::Object
55 * Gets the MMC storage manager instance.
59 * @return A pointer to %MmcStorageManager instance if this method is successful, @n
61 * @exception E_SUCCESS The method is successful.
62 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
63 * @remarks The specific error code can be accessed using the GetLastResult() method.
65 static MmcStorageManager* GetInstance(void);
68 * Mounts file system of external MMC.
72 * @privilege %http://tizen.org/privilege/settingmanager.write @n
73 * (%http://tizen.org/privilege/systemsetting.read is deprecated.)
75 * @return An error code
76 * @exception E_SUCCESS Mount operation is successfully started.
77 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
78 * @exception E_INVALID_OPERATION The external MMC has already been mounted.
79 * @exception E_SERVICE_BUSY One of mount, unmount and format operations is ongoing.
80 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
81 * @remarks The directory path of the mounted external MMC can be obtained by calling
82 * Environment::GetExternalStoragePath().
87 * Unmounts file system of external MMC.
91 * @privilege %http://tizen.org/privilege/settingmanager.write @n
92 * (%http://tizen.org/privilege/systemsetting.read is deprecated.)
94 * @return An error code
95 * @exception E_SUCCESS Unmount operation is successfully started.
96 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
97 * @exception E_INVALID_OPERATION The external MMC has already been unmounted.
98 * @exception E_SERVICE_BUSY One of mount, unmount and format operations is ongoing.
99 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
101 result Unmount(void);
104 * Formats file system of external MMC.
107 * @privlevel platform
108 * @privilege %http://tizen.org/privilege/settingmanager.write @n
109 * (%http://tizen.org/privilege/systemsetting.read is deprecated.)
111 * @return An error code
112 * @exception E_SUCCESS Format operation is successfully started.
113 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
114 * @exception E_INVALID_OPERATION The external MMC should be unmounted for format operation.
115 * @exception E_SERVICE_BUSY One of mount, unmount and format operations is ongoing.
116 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
121 * Adds the listener for receiving the result of external MMC mount or unmount operations.
125 * @return An error code
126 * @param[in] listener The listener to add
127 * @exception E_SUCCESS The method is successful.
128 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
130 result AddMmcStorageMountListener(IMmcStorageMountListener& listener);
133 * Removes the listener for receiving the result of external MMC mount or unmount operations.
137 * @return An error code
138 * @param[in] listener The listener to add
139 * @exception E_SUCCESS The method is successful.
140 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
142 result RemoveMmcStorageMountListener(IMmcStorageMountListener& listener);
145 * Adds the listener for receiving the result of external MMC format operation.
149 * @return An error code
150 * @param[in] listener The listener to add
151 * @exception E_SUCCESS The method is successful.
152 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
154 result AddMmcStorageFormatListener(IMmcStorageFormatListener& listener);
157 * Removes the listener for receiving the result of external MMC format operation.
161 * @return An error code
162 * @param[in] listener The listener to add
163 * @exception E_SUCCESS The method is successful.
164 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
166 result RemoveMmcStorageFormatListener(IMmcStorageFormatListener& listener);
170 * This default constructor is intentionally declared as private to implement the Singleton semantic.
172 MmcStorageManager(void);
175 * This destructor is intentionally declared as private to implement the Singleton semantic.
177 virtual ~MmcStorageManager(void);
180 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
182 MmcStorageManager(const MmcStorageManager& rhs);
185 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
187 MmcStorageManager& operator =(const MmcStorageManager& rhs);
189 static void InitSingleton(void);
191 static void DestroySingleton(void);
194 static MmcStorageManager* __pMmcStorageManagerInstance;
195 friend class _MmcStorageManagerImpl;
196 class _MmcStorageManagerImpl* __pMmcStorageManagerImpl;
198 }; // MmcStorageManager
202 #endif // _FIO_MMC_STORAGE_MANAGER_H_