Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnBaseForm.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                PhnBaseForm.h
19  * @brief               This is the header file for the %BaseForm class.
20  *
21  * This header file contains the declarations for %BaseForm class.
22  */
23 #ifndef _PHN_BASE_FORM_H_
24 #define _PHN_BASE_FORM_H_
25
26 #include <FBase.h>
27 #include <FSystem.h>
28 #include <FGraphics.h>
29 #include <FUi.h>
30 #include "PhnITelephonyEventListener.h"
31 #include "PhnErrorMsgPopup.h"
32
33 class CallInfo;
34 class CallPresentationModel;
35
36 enum FormType
37 {
38         FORMTYPE_OUTGOINGCALL,
39         FORMTYPE_EMERGENCYOUTGOINGCALL,
40         FORMTYPE_INCOMINGCALL,
41         FORMTYPE_ACTIVECALL,
42         FORMTYPE_EMERGENCYACTIVECALL,
43         FORMTYPE_ACTIVECONFCALL,
44         FORMTYPE_CONFCALLLIST,
45         FORMTYPE_ENDCALL,
46         FORMTYPE_MULTIPLECALLS,
47 };
48
49 /**
50  * @class BaseForm
51  * @brief This class presents a form based UI all call scenarios and provides
52  * common functionalities in all call forms.
53  *
54  */
55 class BaseForm
56         : public Tizen::Ui::Controls::Form
57         , public Tizen::Ui::IActionEventListener
58         , public Tizen::Ui::IOrientationEventListener
59         , public ITelephonyEventListener
60         , public IPopupClosedEventListener
61 {
62 public:
63         BaseForm(FormType formType);
64         virtual ~BaseForm(void);
65         virtual void Initialize(void) = 0;
66
67 public:
68         //Used to add user specific code after controls are added to form
69         virtual result OnInitializing(void);
70
71         //From 'Tizen::Ui::IActionEventListener'
72         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
73         //Event Listener methods from ITelephonyEventListener
74         virtual void HandleCallConnected(Tizen::Base::Collection::IListT<CallInfo>& pCallList);
75         virtual void HandleCallDisconnected(bool isLastCall, Tizen::Base::Collection::IListT<CallInfo>& pCallList);
76         virtual void HandleConferenceCall(CallInfo& pCallInfo);
77         virtual void HandleIncomingCall(CallInfo& pCallInfo);
78         virtual void HandleCallSwapOccured(Tizen::Base::Collection::IListT<CallInfo>& pCallList);
79         virtual void HandleConferenceChange(void);
80         virtual void HandleTelephonyError(int errorCode);
81         //Event Listener method from IPopupClosedEventListener
82         virtual void HandlePopupClosed(void);
83         //From IOrientationEventListener
84         virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
85 protected:
86         FormType __formType;
87         //Ownership
88         ErrorMsgPopup* __pErrorMsgPopup;
89         CallPresentationModel* __pCallPresentor;
90 };
91
92 #endif // _PHN_BASE_FORM_H_