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/systemsetting.read
74 * @return An error code
75 * @exception E_SUCCESS Mount operation is successfully started.
76 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
77 * @exception E_INVALID_OPERATION The external MMC has already been mounted.
78 * @exception E_SERVICE_BUSY One of mount, unmount and format operations is ongoing.
79 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
80 * @remarks The directory path of the mounted external MMC can be obtained by calling
81 * Environment::GetExternalStoragePath().
86 * Unmounts file system of external MMC.
90 * @privilege %http://tizen.org/privilege/systemsetting.read
92 * @return An error code
93 * @exception E_SUCCESS Unmount operation is successfully started.
94 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
95 * @exception E_INVALID_OPERATION The external MMC has already been unmounted.
96 * @exception E_SERVICE_BUSY One of mount, unmount and format operations is ongoing.
97 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
102 * Formats file system of external MMC.
105 * @privlevel platform
106 * @privilege %http://tizen.org/privilege/systemsetting.read
108 * @return An error code
109 * @exception E_SUCCESS Format operation is successfully started.
110 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
111 * @exception E_INVALID_OPERATION The external MMC should be unmounted for format operation.
112 * @exception E_SERVICE_BUSY One of mount, unmount and format operations is ongoing.
113 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
118 * Adds the listener for receiving the result of external MMC mount or unmount operations.
122 * @return An error code
123 * @param[in] listener The listener to add
124 * @exception E_SUCCESS The method is successful.
125 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
127 result AddMmcStorageMountListener(IMmcStorageMountListener& listener);
130 * Removes the listener for receiving the result of external MMC mount or unmount operations.
134 * @return An error code
135 * @param[in] listener The listener to add
136 * @exception E_SUCCESS The method is successful.
137 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
139 result RemoveMmcStorageMountListener(IMmcStorageMountListener& listener);
142 * Adds the listener for receiving the result of external MMC format operation.
146 * @return An error code
147 * @param[in] listener The listener to add
148 * @exception E_SUCCESS The method is successful.
149 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
151 result AddMmcStorageFormatListener(IMmcStorageFormatListener& listener);
154 * Removes the listener for receiving the result of external MMC format operation.
158 * @return An error code
159 * @param[in] listener The listener to add
160 * @exception E_SUCCESS The method is successful.
161 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
163 result RemoveMmcStorageFormatListener(IMmcStorageFormatListener& listener);
167 * This default constructor is intentionally declared as private to implement the Singleton semantic.
169 MmcStorageManager(void);
172 * This destructor is intentionally declared as private to implement the Singleton semantic.
174 virtual ~MmcStorageManager(void);
177 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
179 MmcStorageManager(const MmcStorageManager& rhs);
182 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
184 MmcStorageManager& operator =(const MmcStorageManager& rhs);
186 static void InitSingleton(void);
188 static void DestroySingleton(void);
191 static MmcStorageManager* __pMmcStorageManagerInstance;
192 friend class _MmcStorageManagerImpl;
193 class _MmcStorageManagerImpl* __pMmcStorageManagerImpl;
195 }; // MmcStorageManager
199 #endif // _FIO_MMC_STORAGE_MANAGER_H_