sync with master
[apps/osp/Call.git] / inc / CallSettingsPresentationModel.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                CallSettingsPresentationModel.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 "CallISettingsEventListener.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         // Get the reject message list
62         Tizen::Base::Collection::IMapT<int,Tizen::Base::String>* GetRejectMessageListN(void);
63         // checks if the call is to be rejected
64         bool IsCallToBeRejected(Tizen::Base::String& phoneNumber);
65         //Sets the call state
66         result SetCallState(CallState callState);
67         //Get Flight mode status
68         bool GetFlightModeStatus(void);
69
70 protected:
71         //From ISettingsEventListener
72         virtual void HandleGetCallWaitingResponse(bool isCallSuccessful, bool callWaitingActivated);
73         virtual void HandleSetCallWaitingResponse(bool isCallSuccessful, bool isCallWaitingEnabled);
74         virtual void HandleGetCallForwardResponse(bool isCallSuccessful, CallForwardCondition callFwdCondition, const Tizen::Base::String& callFwdNumber, bool callForwardActivated, int noReplyWaitTime);
75         virtual void HandleSetCallForwardResponse(bool isCallSuccessful, CallForwardCondition callFwdCondition, const Tizen::Base::String& callFwdNumber, bool isCallForwardActivated, int noReplyWaitTime);
76         virtual void HandleGetCallBarringResponse(bool isCallSuccessful, CallBarringType callBarringType, bool isBarringActivated);
77         virtual void HandleSetCallBarringResponse(bool isCallSuccessful, CallBarringType callBarringType, bool isBarringActivated);
78         virtual void HandleFlightMode(bool isFlightModeActivated);
79
80 private:
81         static SettingsPresentationModel* __pInstance;
82         //Owned. Is responsible for destroying the instance
83         SettingsManager* __pSettingsMgr;
84         ISettingsEventListener* __pSettingsEventListener;
85 };
86
87 #endif // _PHN_SETTINGS_PRESENTATION_MODEL_H_