merge with master
[platform/framework/native/telephony.git] / src / FTel_SimStateManagerImpl.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        FTel_SimStateManagerImpl.h
19  * @brief       This is the header file for the %_SimStateManagerImpl class.
20  *
21  * This header file contains the declarations of the %_SimStateManagerImpl class.
22  */
23
24 #ifndef _FTEL_INTERNAL_SIM_STATE_MANAGER_IMPL_H_
25 #define _FTEL_INTERNAL_SIM_STATE_MANAGER_IMPL_H_
26
27
28 #include <unique_ptr.h>
29 #include <net_connection.h>
30 #include <tapi_type.h>
31
32 #include <FBaseObject.h>
33 #include <FTelSimInfo.h>
34 #include <FTelSimStateManager.h>
35 #include <FTelTypes.h>
36
37
38 namespace Tizen { namespace Base
39 {
40 class String;
41 } } // Tizen::Base
42
43 namespace Tizen { namespace Telephony
44 {
45 class SimStateManager;
46 class _SimEvent;
47 class _SimManagerEvent;
48 class ITelephonySimEventListener;
49 class ISimStateManagerGetPinLockSettingResultListener;
50 //class _TelephonyIpcProxy;
51
52
53 class _SimStateManagerImpl
54         : public Tizen::Base::Object
55 {
56 public:
57         /**
58          * This is the default constructor for this class.
59          *
60          * @since       2.1
61          */
62         _SimStateManagerImpl(void);
63
64         /**
65      * This is the destructor for this class.
66      *
67      * @since   2.1
68      */
69         virtual ~_SimStateManagerImpl(void);
70
71         /**
72      * @see     SimStateManager::Construct()
73      */
74         result Construct(void);
75
76         /**
77          * @see SimStateManager::SetSimEventListener()
78          */
79         result SetSimEventListener(ITelephonySimEventListener *pListener);
80
81         result SetSimStateManagerGetPinLockSettingResultListener(ISimStateManagerGetPinLockSettingResultListener *pListener);
82
83         /**
84          * @see SimStateManager::GetSimInfo()
85          */
86         result GetSimInfo(SimInfo& simInfo) const;
87
88         /**
89          * @see SimStateManager::GetSimState()
90          */
91         SimState GetSimState(void) const;
92
93         /**
94          * @see SimStateManager::GetPinLockSetting()
95          */
96         result GetPinLockSetting(ISimStateManagerGetPinLockSettingResultListener* pListener);
97
98         /**
99      * Gets the Impl instance.
100      *
101      * @since 2.1
102      * @return The pointer to _SimStateManagerImpl
103      * @param[in] simStateManager    An instance of SimStateManager
104      */
105         static _SimStateManagerImpl* GetInstance(SimStateManager& simStateManager);
106
107         /**
108      * Gets the Impl instance.
109      *
110      * @since 2.1
111      * @return The pointer to _SimStateManagerImpl
112      * @param[in] simStateManager    An instance of SimStateManager
113      */
114         static const _SimStateManagerImpl* GetInstance(const SimStateManager& simStateManager);
115
116         static void OnSimStateChangedCallback(TapiHandle* pHandle, const char* pNotiId, void* pData, void* pUserData);
117         static void OnGetPinLockSettingCallback(TapiHandle* pHandle, int ret, void* pData, void* pUserData);
118
119 private:
120         //
121     // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
122         //
123         // @param[in]   rhs   An instance of %_SimStateManagerImpl
124         //
125         _SimStateManagerImpl(const _SimStateManagerImpl& rhs);
126
127         //
128         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
129         //
130         // @param[in]   rhs An instance of %_SimStateManagerImpl
131         //
132         _SimStateManagerImpl& operator =(const _SimStateManagerImpl& rhs);
133
134 private:
135         TapiHandle* __pHandle;
136         SimState __simState;
137         bool __isInProgress;
138
139         std::unique_ptr<_SimEvent> __pSimEvent;
140         std::unique_ptr<_SimManagerEvent> __pSimManagerEvent;
141
142         ITelephonySimEventListener* __pSimEventListener;
143     ISimStateManagerGetPinLockSettingResultListener* __pSimStateManagerGetPinLockSettingResultListener;
144
145 }; // _SimStateManagerImpl
146
147 }} // Tizen::Telephony
148
149 #endif // _FTEL_INTERNAL_SIM_STATE_MANAGER_IMPL_H_