Fix for N_SE-46707
[apps/osp/Call.git] / inc / CallSettingsManager.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 /**
18  * @file                CallSettingsManager.h
19  * @brief               This is the header file for the %SettingsManager class.
20  *
21  * This header file contains the declarations for %SettingsManager class.
22  */
23 #ifndef _PHN_SETTINGS_MANAGER_H_
24 #define _PHN_SETTINGS_MANAGER_H_
25
26 #include <FBase.h>
27 #include <FIo.h>
28 #include <FSocial.h>
29 #include <FSysSettingInfo.h>
30 #include "ITapiCall.h"
31 #include "ITapiSs.h"
32 #include "tapi_common.h"
33 #include "TapiUtility.h"
34 #include "TelCall.h"
35 #include "TelSs.h"
36 #include "vconf.h"
37 #include "CallRejectInfo.h"
38 #include "CallISettingsEventListener.h"
39 #include "CallSettingsConstants.h"
40 #include "CallSettingDataService.h"
41
42 /**
43  * @class SettingsManager
44  * @brief This class provides functionality to set and fetch settings related to voice call, e.g. Call barring,
45  * call forwarding, etc.
46  */
47 class SettingsManager
48 : public Tizen::System::ISettingEventListener
49 {
50 public:
51         //create a singleton instance
52         static SettingsManager* GetInstance(void);
53
54 private:
55         //constructor
56         SettingsManager(void);
57         SettingsManager(SettingsManager& manager);
58         SettingsManager& operator =(const SettingsManager& manager);
59
60         result Construct(void);
61         static void CreateInstance(void);
62         static void DestroyInstance(void);
63
64 public:
65         // Add the observer for setting events
66         void AddSettingEventListener(ISettingsEventListener* pSettingsEventListener);
67         //remove the observer for setting events
68         void RemoveSettingEventListener(ISettingsEventListener* pSettingsEventListener);
69         // Get the reject message list
70         Tizen::Base::Collection::IMapT<int,Tizen::Base::String>* GetRejectMessageListN(void);
71         // Get the reject "unknown" status
72         bool GetUnknownRejectStatus(void);
73         // checks if the call is to be rejected
74         bool IsCallToBeRejected(Tizen::Base::String& phoneNumber);
75
76         result SetCallState(CallState callState);
77
78         void AddSystemEventListener(void);
79
80         void RemoveSystemEventListener(void);
81
82         virtual void OnSettingChanged(Tizen::Base::String& key);
83
84         bool GetFlightModeStatus(void);
85
86 private:
87
88         enum ForwardResponseType
89         {
90                 SET_CALLFORWARD_RESPONSE,
91                 GET_CALLFORWARD_RESPONSE,
92         };
93         enum BarringResponseType
94         {
95                 SET_CALLBARRING_RESPONSE,
96                 GET_CALLBARRING_RESPONSE,
97         };
98         enum WaitingResponseType
99         {
100                 SET_CALLWAITING_RESPONSE,
101                 GET_CALLWAITING_RESPONSE,
102         };
103 private:
104         virtual ~SettingsManager(void);
105         //notify event listeners for Setting or Getting Call Forwarding status events.
106         void NotifyForwardingEventListeners(ForwardResponseType responseType, bool isCallSuccessful, CallForwardCondition callFwdCondition, const Tizen::Base::String& callFwdNumber, bool isCallForwardActivated, int noReplyWaitTime);
107         //notify event listeners for Setting or Getting Call Barring status events.
108         void NotifyBarringEventListeners(BarringResponseType responseType, bool isCallSuccessful, CallBarringType callBarringType, bool isBarringActivated);
109         //notify event listeners for Setting or Getting Call Waiting status events.
110         void NotifyWaitingEventListeners(WaitingResponseType responseType, bool isCallSuccessful, bool isCallWaitingActivated);
111
112 private:
113         static SettingsManager* __pInstance;
114         //handle to Telephony API
115         TapiHandle* __pTapiHandle;
116         Tizen::Base::Collection::ArrayListT<ISettingsEventListener*>* __pSettingsEventListener;
117         CallSettingDataService* __pCallSettingDataService;
118 };
119
120 #endif // _PHN_SETTINGS_MANAGER_H_