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 information and events about the SIM card.
43 * The %SimStateManager class provides methods to obtain information and events about the SIM card.
46 class _OSP_EXPORT_ SimStateManager
47 : public Tizen::Base::Object
51 * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
55 SimStateManager(void);
58 * This destructor overrides Tizen::Base::Object::~Object().
62 virtual ~SimStateManager(void);
65 * Initializes this instance of %SimStateManager.
69 * @return An error code
71 * @exception E_SUCCESS The method is successful.
72 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
73 * @exception E_UNSUPPORTED_OPERATION The device does not support the telephony feature.
75 result Construct(void);
78 * Sets the listener for receiving SIM-related events.
83 * @privilege %http://tizen.org/privilege/telephony
85 * @return An error code
87 * @param[in] pListener An ITelephonySimEventListener instance @n
88 * The parameter can be set to @c null to remove listener.
90 * @exception E_SUCCESS The method is successful.
91 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
92 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, @n
93 * because the caller thread is a worker thread.
95 result SetSimEventListener(ITelephonySimEventListener* pListener);
98 * Requests for the PIN lock setting information. @n
99 * The %GetPinLockSetting() method is asynchronous.
104 * @privilege %http://tizen.org/privilege/telephony
106 * @return An error code
108 * @param[in] pListener An ISimStateManagerGetPinLockSettingResultListener instance
109 * @exception E_SUCCESS The method is successful.
110 * @exception E_INVALID_ARG The specified @c pListener must not be @c null.
111 * @exception E_IN_PROGRESS The previous request is in progress.
112 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
113 * @exception E_DEVICE_UNAVAILABLE The operation has failed due to a missing SIM card.
114 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
115 * @see ISimStateManagerGetPinLockSettingResultListener::OnSimStateManagerGetPinLockSettingResultReceived()
117 result GetPinLockSetting(ISimStateManagerGetPinLockSettingResultListener* pListener);
120 * Gets the current state of SIM card.
125 * @privilege %http://tizen.org/privilege/telephony
127 * @return The state of SIM card, @n
128 * else @c SIM_STATE_UNKNOWN if the method fails
130 * @exception E_SUCCESS The method is successful.
131 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
133 SimState GetSimState(void) const;
136 * Gets the SIM card information.
141 * @privilege %http://tizen.org/privilege/telephony
143 * @return An error code
145 * @param[out] simInfo The SIM card information
146 * @exception E_SUCCESS The method is successful.
147 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
148 * @exception E_DEVICE_UNAVAILABLE The operation has failed due to a missing SIM card.
150 result GetSimInfo(SimInfo& simInfo) const;
154 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
156 // @param[in] rhs An instance of %SimStateManager
158 SimStateManager(const SimStateManager& rhs);
161 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
163 // @param[in] rhs An instance of %SimStateManager
165 SimStateManager& operator =(const SimStateManager& rhs);
168 _SimStateManagerImpl* __pSimStateManagerImpl;
170 friend class _SimStateManagerImpl;
171 }; // SimStateManager
173 }} // Tizen::Telephony
175 #endif // _FTEL_SIM_STATE_MANAGER_H_