e5587ebcda67dd54ca28a6d5ff8652a0ac4388f9
[apps/osp/Call.git] / inc / CallConfCallerListForm.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                CallConfCallerListForm.h
19  * @brief               This is the header file for the %ConfCallerListForm class.
20  *
21  * This header file contains the declarations for %ConfCallerListForm class.
22  */
23 #ifndef _PHN_CONF_CALLER_LIST_FORM_H_
24 #define _PHN_CONF_CALLER_LIST_FORM_H_
25
26 #include <FBase.h>
27 #include <FApp.h>
28 #include <FUi.h>
29 #include "CallBaseForm.h"
30 #include "CallTypes.h"
31
32 class AppCallInfo;
33
34 /**
35  * @class ConfCallerListForm
36  * @brief This class presents a form based UI for participants list of conference call.
37  *
38  */
39 class ConfCallerListForm
40         : public BaseForm
41         , public Tizen::Ui::Scenes::ISceneEventListener
42         , public Tizen::Base::Runtime::ITimerEventListener
43         , public Tizen::Ui::Controls::IFormBackEventListener
44         , public Tizen::Ui::Controls::ITableViewItemProvider
45         , public Tizen::Ui::IOrientationEventListener
46         , public Tizen::Social::IAddressbookChangeEventListener
47 {
48 public:
49         ConfCallerListForm(void);
50         virtual ~ConfCallerListForm(void);
51         //From BaseForm
52         virtual void Initialize(void);
53
54 public:
55         virtual result OnInitializing(void);
56         virtual result OnTerminating(void);
57         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
58         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
59         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
60         //From IOrientationEventListener
61         virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
62
63         //Disable all the elements
64         void DisableAllControls(void);
65         void OnConfCallHoldTelephoneCallBackOccured(bool success);
66         void OnConfCallActiveTelephoneCallBackOccured(bool success);
67         bool IsConfCallStateInProgress(void);
68         void SetConfCallStateInProgress(bool progress);
69         // From 'Container'.
70         // Called when the container needs to draw itself. @n
71         // Users can override this method to display user-specific drawings. @n
72         // This method is called after the container has drawn itself, but just before the container draws its child controls.
73         //
74         virtual result OnDraw(void);
75         // Handle change in conf call list
76         void HandleParticipantsChanged(void);
77         //IAddressbookChangeEventListener
78         virtual void OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList);
79         virtual void OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList);
80
81         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
82         virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
83         //ITableViewItemProvider
84         virtual int GetItemCount(void);
85         virtual Tizen::Ui::Controls::TableViewItem* CreateItem(int itemIndex, int itemWidth);
86         virtual bool DeleteItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
87         virtual void UpdateItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem);
88         virtual int GetDefaultItemHeight(void);
89
90 private:
91         // Add the action listener for the buttons
92         void AddActionListener(const Tizen::Base::String& keyName, CommandIds cmdId);
93         // Method to show call duration/state(held) for call in progress
94         void ShowTimerInfo(const Tizen::Base::String& timerLblName, long long startTime = 0);
95         // Method to set "Hold" Button status
96         void SetHoldButtonStatus(bool isCallOnHold);
97         void CreateItemAndAddActionListener(  Tizen::Ui::Controls::Button& splitButton, Tizen::Ui::Controls::Button& endButton,  Tizen::Ui::Controls::Label& callerLabel, SplitConfCallerCmdIds splitCmdId,EndConfCallerCmdIds EndCmdId, const Tizen::Base::String& displayName);
98         void CreateTableView(void);
99
100 private:
101         AppCallInfo* __pConfCallInfo;
102         //Timer used to show call time
103         Tizen::Base::Runtime::Timer* __pConfCallTimer;
104         Tizen::Social::Addressbook* __pAddressbook;
105         Tizen::Ui::Controls::TableView* __pList;
106         bool            __isCallSplit;
107         bool            __isConfCallStateInProgress;
108 };
109
110 #endif  //_PHN_CONF_CALLER_LIST_FORM_H_