Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnSettingsPresentationModel.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://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                PhnSettingsPresentationModel.h
19  * @brief               This is the header file for the %SettingsPresentationModel class.
20  *
21  * This header file contains the declarations for %SettingsPresentationModel class.
22  */
23 #ifndef _PHN_SETTINGS_PRESENTATION_MODEL_H_
24 #define _PHN_SETTINGS_PRESENTATION_MODEL_H_
25
26 #include <FSocial.h>
27 #include "PhnISettingsEventListener.h"
28
29 class SettingsManager;
30 class CallRejectInfo;
31 class SpeedDialInfo;
32
33 /**
34  * @class SettingsPresentationModel
35  * @brief This class provides data to settings forms and provides functions
36  * to interact with Settings manager.
37  *
38  */
39 class SettingsPresentationModel: public ISettingsEventListener
40 {
41 public:
42         //create a singleton instance
43         static SettingsPresentationModel* GetInstance(void);
44
45 private:
46         SettingsPresentationModel(void);
47         SettingsPresentationModel(SettingsPresentationModel& presentor);
48         virtual ~SettingsPresentationModel(void);
49         SettingsPresentationModel& operator =(const SettingsPresentationModel& presentor);
50
51         //perform 2nd phase initialization
52         result Construct(void);
53         static void CreateInstance(void);
54         static void DestroyInstance(void);
55
56 public:
57         // Add the observer for setting events
58         result AddSettingEventListener(ISettingsEventListener* pSettingsEventListener);
59         //remove the observer for setting events
60         void RemoveSettingEventListener(void);
61
62         // Get the reject message list
63         Tizen::Base::Collection::IMapT<int,Tizen::Base::String>* GetRejectMessageListN(void);
64         // Add the number to the call reject list
65         result AddToCallRejectList(const Tizen::Base::String& phoneNumber, CallRejectMatchCondition rejectCondition);
66         // Get the call reject list
67         Tizen::Base::Collection::IListT<CallRejectInfo>* GetCallRejectList(void);
68         // Set the number to the prefix dial list
69         result SetPrefixDialNumber(int phoneNumberIndex, const Tizen::Base::String& phoneNumber);
70         // Set the active prefix dial to be used
71         result SetActivePrefixDialingValue(int prefixDialIndex);
72         // Set the prefix dial status
73         result SetPrefixDialingStatus(bool enablePrefixDialing);
74         // Get the active prefix dial number to be used
75         result GetActivePrefixDialNumber(Tizen::Base::String& phoneNumber);
76         // Set the call barring status
77         int SetCallBarringStatus(const Tizen::Base::String& password, CallBarringType callBarringType, bool activateBarring);
78         // Get the call Forwarding status
79         int GetCallForwardStatus(CallForwardCondition callFwdCondition);
80         // Set the call Forwarding status
81         int SetCallForwardStatus(const Tizen::Base::String& phoneNumber, CallForwardCondition callFwdCondition, bool activateFwding, int noReplyTime);
82         // Get the call barring status
83         int GetCallBarringStatus(CallBarringType callBarringType);
84         // Set the call waiitng status
85         int SetCallWaitingStatus(bool activateWaiting);
86         // Get the call waiting status
87         int GetCallWaitingStatus(void);
88         // Set the call connect tone status
89         result SetCallConnectToneStatus(bool activate);
90         // Get the call connect tone status
91         bool GetCallConnectToneStatus(void);
92         // Set the minute minder tone status
93         result SetMinuteMinderToneStatus(bool activate);
94         // Get the minute minder tone status
95         bool GetMinuteMinderToneStatus(void);
96         // Set the call End tone status
97         result SetCallEndToneStatus(bool activate);
98         // Get the call End tone status
99         bool GetCallEndToneStatus(void);
100         // Update the call reject number already present
101         result UpdateCallRejectRow(int rowId, const Tizen::Base::String& phoneNumber, bool activate, CallRejectMatchCondition rejectCondition);
102         // Remove the call reject item
103         result RemoveCallRejectRow(int rowId);
104         // Add/edit the message list at the given index
105         result SetRejectMessage(int messageIndex, const Tizen::Base::String& rejectMessage);
106         // delete the message from the list
107         result RemoveRejectMessage(const Tizen::Base::Collection::IListT<int>& deleteKeyList);
108         // checks if the call is to be rejected
109         bool IsCallToBeRejected(Tizen::Base::String& phoneNumber);
110         //Set the speed dial mapping
111         result SetSpeedDialMapping(const Tizen::Base::String& contactId, int numberToMap);
112         // Get the speed dial mapping list
113         Tizen::Base::Collection::IMapT<int,SpeedDialInfo>* GetSpeedDialMappingN(void);
114         //remove speed dial mapping for given 'rowId'.
115         result RemoveSpeedDialMapping(int rowId);
116         //update speed dial mapping for given 'rowId'.
117         result UpdateSpeedDialMapping(int rowId, const Tizen::Base::String& contactId, int numberToMap);
118         // Set the call line identity
119         result SetCallLineIdentity(CallLineIdentity identity);
120         // Get the call line identity
121         result GetCallLineIdentity(CallLineIdentity& identity);
122         // Set the call alert status
123         result SetCallAlertStatus(CallAlertStatus callAlertStatus);
124         // Get the call alert status
125         result GetCallAlertStatus(CallAlertStatus& callAlertStatus);
126         // Set the reject "unknown" status
127         result SetUnknownRejectStatus(bool activate);
128         // Get the reject "unknown" status
129         bool GetUnknownRejectStatus(void);
130         //Fetch Contacts details by contact id
131         Tizen::Social::Contact* FetchContactDetailsN(const Tizen::Base::String& contactId);
132         //Sets the call state
133         result SetCallState(CallState callState);
134
135 protected:
136         //From ISettingsEventListener
137         virtual void HandleGetCallWaitingResponse(bool isCallSuccessful, bool callWaitingActivated);
138         virtual void HandleSetCallWaitingResponse(bool isCallSuccessful, bool isCallWaitingEnabled);
139         virtual void HandleGetCallForwardResponse(bool isCallSuccessful, CallForwardCondition callFwdCondition, const Tizen::Base::String& callFwdNumber, bool callForwardActivated, int noReplyWaitTime);
140         virtual void HandleSetCallForwardResponse(bool isCallSuccessful, CallForwardCondition callFwdCondition, const Tizen::Base::String& callFwdNumber, bool isCallForwardActivated, int noReplyWaitTime);
141         virtual void HandleGetCallBarringResponse(bool isCallSuccessful, CallBarringType callBarringType, bool isBarringActivated);
142         virtual void HandleSetCallBarringResponse(bool isCallSuccessful, CallBarringType callBarringType, bool isBarringActivated);
143
144 private:
145         static SettingsPresentationModel* __pInstance;
146         //Owned. Is responsible for destroying the instance
147         SettingsManager* __pSettingsMgr;
148         ISettingsEventListener* __pSettingsEventListener;
149 };
150
151 #endif // _PHN_SETTINGS_PRESENTATION_MODEL_H_