49d5ccc4e1d6e254b70ab49e0f0efbc760e7ebd1
[platform/framework/native/telephony.git] / inc / FTelSimStateManager.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
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  * @file        FTelSimStateManager.h
19  * @brief       This is the header file for the %SimStateManager class.
20  *
21  * This header file contains the declarations of the %SimStateManager class.
22  */
23 #ifndef _FTEL_SIM_STATE_MANAGER_H_
24 #define _FTEL_SIM_STATE_MANAGER_H_
25
26
27 #include <FBase.h>
28 #include <FTelTypes.h>
29 #include <FTelSimInfo.h>
30 #include <FTelITelephonySimEventListener.h>
31 #include <FTelISimStateManagerGetPinLockSettingResultListener.h>
32
33
34 namespace Tizen { namespace Telephony
35 {
36 class _SimStateManagerImpl;
37
38 /**
39  * @class       SimStateManager
40  * @brief       This class provides methods to obtain information and events about the SIM card.
41  * @since       2.1
42  *
43  * The %SimStateManager class provides methods to obtain information and events about the SIM card.
44  *
45  */
46 class _OSP_EXPORT_ SimStateManager
47         : public Tizen::Base::Object
48 {
49 public:
50         /**
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.
52          *
53          * @since       2.1
54          */
55         SimStateManager(void);
56
57         /**
58          * This destructor overrides Tizen::Base::Object::~Object().
59          *
60          * @since       2.1
61          */
62         virtual ~SimStateManager(void);
63
64         /**
65          * Initializes this instance of %SimStateManager.
66          *
67          * @since       2.1
68          * @feature %http://tizen.org/feature/network.telephony
69          * @return      An error code
70          *
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 Emulator or target device does not support the required feature. @b Since: @b 2.1
74          *                                                                               For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/manifest_features.htm">Application Filtering</a>.
75          * @remarks     Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
76          */
77         result Construct(void);
78
79         /**
80          * Sets the listener for receiving SIM-related events.
81          *
82          * @since   2.1
83          *
84          * @privlevel   public
85          * @privilege   %http://tizen.org/privilege/telephony
86          *
87          * @return  An error code
88          *
89          * @param[in]   pListener                               An ITelephonySimEventListener instance @n
90          *                                                                              The parameter can be set to @c null to remove listener.
91          *
92          * @exception   E_SUCCESS                               The method is successful.
93          * @exception   E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
94          * @exception   E_INVALID_OPERATION             The current state of the instance prohibits the execution of the specified operation, @n
95          *                                                                              because the caller thread is a worker thread.
96          */
97         result SetSimEventListener(ITelephonySimEventListener* pListener);
98
99         /**
100          * Requests for the PIN lock setting information. @n
101          * The %GetPinLockSetting() method is asynchronous.
102          *
103          * @since   2.1
104          *
105          * @privlevel   public
106          * @privilege   %http://tizen.org/privilege/telephony
107          *
108          * @return  An error code
109          *
110          * @param[in]   pListener                               An ISimStateManagerGetPinLockSettingResultListener instance
111          * @exception   E_SUCCESS                               The method is successful.
112          * @exception   E_INVALID_ARG                   The specified @c pListener must not be @c null.
113          * @exception   E_IN_PROGRESS                   The previous request is in progress.
114          * @exception   E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
115          * @exception   E_DEVICE_UNAVAILABLE    The operation has failed due to a missing SIM card.
116          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
117          * @see ISimStateManagerGetPinLockSettingResultListener::OnSimStateManagerGetPinLockSettingResultReceived()
118          */
119         result GetPinLockSetting(ISimStateManagerGetPinLockSettingResultListener* pListener);
120
121         /**
122          * Gets the current state of SIM card.
123          *
124          * @since   2.1
125          *
126          * @privlevel   public
127          * @privilege   %http://tizen.org/privilege/telephony
128          *
129          * @return      The state of SIM card, @n
130          *                              else @c SIM_STATE_UNKNOWN if the method fails
131          *
132          * @exception   E_SUCCESS                               The method is successful.
133          * @exception   E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
134          */
135         SimState GetSimState(void) const;
136
137         /**
138          * Gets the SIM card information.
139          *
140          * @since   2.1
141          *
142          * @privlevel   public
143          * @privilege   %http://tizen.org/privilege/telephony
144          *
145          * @return  An error code
146          *
147          * @param[out]  simInfo                                 The SIM card information
148          * @exception   E_SUCCESS                               The method is successful.
149          * @exception   E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
150          * @exception   E_DEVICE_UNAVAILABLE    The operation has failed due to a missing SIM card.
151          */
152         result GetSimInfo(SimInfo& simInfo) const;
153
154 private:
155         //
156         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
157         //
158         // @param[in]   rhs   An instance of %SimStateManager
159         //
160         SimStateManager(const SimStateManager& rhs);
161
162         //
163         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
164         //
165         // @param[in]   rhs An instance of %SimStateManager
166         //
167         SimStateManager& operator =(const SimStateManager& rhs);
168
169 private:
170         _SimStateManagerImpl* __pSimStateManagerImpl;
171
172         friend class _SimStateManagerImpl;
173 }; // SimStateManager
174
175 }} // Tizen::Telephony
176
177 #endif // _FTEL_SIM_STATE_MANAGER_H_