Initialize Tizen 2.3
[apps/osp/Call.git] / inc / CallBaseForm.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                CallBaseForm.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 "CallITelephonyEventListener.h"
31 #include "CallErrorMsgPopup.h"
32
33 class AppCallInfo;
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 ITelephonyEventListener
59         , public IPopupClosedEventListener
60 {
61 public:
62         BaseForm(FormType formType);
63         virtual ~BaseForm(void);
64         virtual void Initialize(void) = 0;
65
66 public:
67         //Used to add user specific code after controls are added to form
68         virtual result OnInitializing(void);
69
70         //From 'Tizen::Ui::IActionEventListener'
71         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
72         //Event Listener methods from ITelephonyEventListener
73         virtual void HandleCallConnected(Tizen::Base::Collection::IListT<AppCallInfo>& pCallList);
74         virtual void HandleCallDisconnected(bool isLastCall, Tizen::Base::Collection::IListT<AppCallInfo>& pCallList);
75         virtual void HandleCallHeld(bool isHeld);
76         virtual void HandleCallActive(bool isActive);
77         virtual void HandleConferenceCall(AppCallInfo& pCallInfo);
78         virtual void HandleIncomingCall(AppCallInfo& pCallInfo);
79         virtual void HandleConfCallHoldOccured(bool success);
80         virtual void HandleConfCallActiveOccured(bool success);
81         virtual void HandleCallSwapOccured(Tizen::Base::Collection::IListT<AppCallInfo>& pCallList);
82         virtual void HandleConferenceChange(void);
83         virtual void HandleTelephonyError(int errorCode);
84         //Event Listener method from IPopupClosedEventListener
85         virtual void HandlePopupClosed(void);
86
87 protected:
88         FormType __formType;
89         //Ownership
90         ErrorMsgPopup* __pErrorMsgPopup;
91         CallPresentationModel* __pCallPresentor;
92 };
93
94 #endif // _PHN_BASE_FORM_H_