2 // Open Service Platform
3 // Copyright (c) 2012-2013 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.
18 * @file FTelSimStateManager.h
19 * @brief This is the header file for the %SimStateManager class.
21 * This header file contains the declarations of the %SimStateManager class.
23 #ifndef _FTEL_SIM_STATE_MANAGER_H_
24 #define _FTEL_SIM_STATE_MANAGER_H_
28 #include <FTelTypes.h>
29 #include <FTelSimInfo.h>
30 #include <FTelITelephonySimEventListener.h>
31 #include <FTelISimStateManagerGetPinLockSettingResultListener.h>
34 namespace Tizen { namespace Telephony
36 class _SimStateManagerImpl;
39 * @class SimStateManager
40 * @brief This class provides methods to obtain the information and events of the SIM card.
43 * The %SimStateManager class provides methods to obtain the information and events of the SIM card.
48 * #include <FTelephony.h>
50 * using namespace Tizen::Base;
51 * using namespace Tizen::Telephony;
55 * , public ITelephonySimEventListener
61 * // ITelephonySimEventListener
62 * void OnTelephonySimStateChanged(SimState state);
64 * void GetSimState (void);
68 * MyClass::OnTelephonySimStateChanged(SimState state)
74 * MyClass::GetSimState(void)
76 * SimStateManager* pSimStateManager = new (std::nothrow) SimStateManager();
78 * SimState simState = SIM_STATE_UNKNOWN;
80 * result r = pSimStateManager->Construct();
83 * delete pSimStateManager;
87 * r = pSimStateManager->SetSimEventListener(this);
90 * delete pSimStateManager;
94 * r = pSimStateManager->GetSimInfo(simInfo);
97 * delete pSimStateManager;
101 * simState = pSimStateManager->GetSimState();
102 * delete pSimStateManager;
108 class _OSP_EXPORT_ SimStateManager
109 : public Tizen::Base::Object
113 * The object is not fully constructed after this constructor is called.
114 * For full construction, the Construct() method must be called right after calling this constructor.
118 SimStateManager(void);
121 * This destructor overrides Tizen::Base::Object::~Object().
125 virtual ~SimStateManager(void);
128 * Initializes this instance of %SimStateManager.
131 * @feature %http://tizen.org/feature/network.telephony
132 * @return An error code
134 * @exception E_SUCCESS The method is successful.
135 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
136 * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature.
137 * For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
138 * @remarks Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
140 result Construct(void);
143 * Sets the listener used to receive SIM-related events.
148 * @privilege %http://tizen.org/privilege/telephony
150 * @return An error code
152 * @param[in] pListener An ITelephonySimEventListener instance @n
153 * The parameter can be set to @c null to remove the listener.
155 * @exception E_SUCCESS The method is successful.
156 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
157 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, @n
158 * because the caller thread is a worker thread.
160 result SetSimEventListener(ITelephonySimEventListener* pListener);
163 * Requests for the PIN lock setting information. @n
164 * The %GetPinLockSetting() method is asynchronous.
169 * @privilege %http://tizen.org/privilege/telephony
171 * @return An error code
173 * @param[in] pListener An ISimStateManagerGetPinLockSettingResultListener instance
174 * @exception E_SUCCESS The method is successful.
175 * @exception E_INVALID_ARG The specified @c pListener is @c null.
176 * @exception E_IN_PROGRESS The previous request is in progress.
177 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
178 * @exception E_DEVICE_UNAVAILABLE The operation has failed because the SIM card is missing
179 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
180 * @see ISimStateManagerGetPinLockSettingResultListener::OnSimStateManagerGetPinLockSettingResultReceived()
182 result GetPinLockSetting(ISimStateManagerGetPinLockSettingResultListener* pListener);
185 * Gets the current state of the SIM card.
190 * @privilege %http://tizen.org/privilege/telephony
192 * @return The state of the SIM card, @n
193 * else @c SIM_STATE_UNKNOWN if the method fails
195 * @exception E_SUCCESS The method is successful.
196 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
198 SimState GetSimState(void) const;
201 * Gets the SIM card information.
206 * @privilege %http://tizen.org/privilege/telephony
208 * @return An error code
210 * @param[out] simInfo The SIM card information
211 * @exception E_SUCCESS The method is successful.
212 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
213 * @exception E_DEVICE_UNAVAILABLE The operation has failed because the SIM card is not ready.
215 result GetSimInfo(SimInfo& simInfo) const;
219 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
221 // @param[in] rhs An instance of %SimStateManager
223 SimStateManager(const SimStateManager& rhs);
226 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
228 // @param[in] rhs An instance of %SimStateManager
230 SimStateManager& operator =(const SimStateManager& rhs);
233 _SimStateManagerImpl* __pSimStateManagerImpl;
235 friend class _SimStateManagerImpl;
236 }; // SimStateManager
238 }} // Tizen::Telephony
240 #endif // _FTEL_SIM_STATE_MANAGER_H_