Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / platform / Tizen / Call / CallService.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License. 
15  */
16
17 #ifndef TIZENAPIS_PLATFORM_CALLSERVICE_H_
18 #define TIZENAPIS_PLATFORM_CALLSERVICE_H_
19
20 #include <map>
21 #include <vector>
22 #include <dpl/shared_ptr.h>
23 #include <dpl/noncopyable.h>
24 #include <TapiCommon.h>
25 #include <API/Call/ICallService.h>
26 #include <API/Call/CallFactory.h>
27 #include <API/Call/EventLaunchDialer.h>
28 #include <API/Call/EventSendUSSD.h>
29 #include <app.h>
30
31 namespace TizenApis {
32 namespace Platform {
33 namespace Call {
34
35 typedef std::vector<unsigned int> handleList;
36 typedef DPL::SharedPtr<handleList> handleListPtr;
37
38 class CallService : public Api::Call::ICallService
39 {
40 public:
41         CallService();
42         ~CallService();
43
44         void registerCallEvent();
45         void deregisterCallEvent();
46
47         /**
48          * Asynchronously launches the native phone application for this call service with a pre-filled remote ID.
49          * The user still needs to press the call button to make the call.
50          */
51         void launchDialer(const Api::Call::EventLaunchDialerPtr& event);
52
53         /**
54          * Send a USSD string to the network.
55          */
56         void sendUSSD(const Api::Call::EventSendUSSDPtr& event);
57
58         /**
59          * Get voicemail numbers.
60          * @return A list of voicemail numbers.
61          */
62         Api::Call::StringListPtr getVoicemailNumbers();
63
64         /**
65          * Get subscriber numbers.
66          * @return A list of subscriber numbers.
67          */
68         Api::Call::StringListPtr getSubscriberNumbers();
69
70         /**
71          * Get emergency numbers.
72          * @return A list of emergency numbers.
73          */
74         Api::Call::StringListPtr getEmergencyNumbers();
75
76         void changedEvent(void *data);
77
78         void launchDialerManualAnswer(service_h request, service_h reply, service_result_e result);
79
80 protected:
81         void OnRequestReceived(const Api::Call::EventLaunchDialerPtr& event);
82         void OnRequestReceived(const Api::Call::EventSendUSSDPtr& event);
83
84 private:
85         handleListPtr m_handles;
86         Api::Call::EventSendUSSDPtr m_EventSendUSSDPtr;
87         bool m_lockSendUSSD;
88 };
89
90 }
91 }
92 }
93
94 #endif