1.Changed appcontrol parameters of contacts 2.GUI changes 3.Changes to alert tone...
[apps/osp/Call.git] / inc / CallButtonsPanel.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                CallButtonsPanel.h
19  * @brief               This is the header file for the %CallButtonsPanel class.
20  *
21  * This header file contains the declarations for %CallButtonsPanel class.
22  */
23 #ifndef _PHN_CALL_BUTTONS_PANEL_H_
24 #define _PHN_CALL_BUTTONS_PANEL_H_
25
26 #include <FApp.h>
27 #include <FBase.h>
28 #include <FUi.h>
29 #include "CallBaseForm.h"
30 #include "CallTypes.h"
31
32 /**
33  * @class CallButtonsPanel
34  * @brief This class presents a panel based UI for keypads used in active call
35  * and end call scenarios.
36  *
37  */
38 class CallButtonsPanel
39         : public Tizen::Ui::Controls::Panel
40 {
41 private:
42         enum ButtonState
43         {
44                 BTN_NORMAL,
45                 BTN_PRESS,
46                 BTN_DIM,
47         };
48
49 public:
50         CallButtonsPanel(void);
51         virtual ~CallButtonsPanel(void);
52
53         bool ConstructPanel(Tizen::Ui::IActionEventListener* pEventListener, FormType parentFormType);
54
55         /**
56          * Overrides this method to provide user-specific initialization code after the control is added to a container.
57          * @remarks             OnInitializing() is called when the control is about to be added to a container.
58          * @remarks             To cancel adding this control to the parent, return E_FAILURE in this method.
59          * @see                 OnTerminating()
60         */
61         virtual result OnInitializing(void);
62
63         /**
64          * Overrides this method to provide user-specific termination code.
65          * @return              An error code
66          * @remarks             OnTerminating() is called right before the control is removed successfully from the container.
67          * @remarks             To cancel removing this control from the parent, return E_FAILURE in this method.
68          * @see                 OnInitializing()
69         */
70         virtual result OnTerminating(void);
71         //Called to change state, when keypad is opened or closed.
72         void SetKeypadButtonState(CommandIds cmdId);
73         //used to set or change speaker button state.
74         void SetSpeakerButtonState(CommandIds cmdId);
75         //used to set or change Mute button state.
76         void SetMuteButtonState(CommandIds cmdId);
77         //used to set the button panel state in end call form based on type of call.
78         void SetEndCallPanelState(bool isEnabled);
79         //Used to enable or disable "Add Call" Button
80         void EnableAddCallButton(bool enable);
81         //Used to enable or disable "Join Call" Button
82         void EnableJoinCallButton(bool enable);
83         // Used to set the contact is present or not
84         void SetViewContactButtonStatus(bool isContactPresent);
85
86         //set the buttons in the panel as the top controls. Chk if its needed in RC2
87         void SetButtonPosition(void);
88
89 protected:
90         // Construct the panel to be shown in "End Call" form
91         result ConstructEndCallPanel(void);
92         // Construct the panel to be shown in "Active Call" form
93         result ConstructActiveCallPanel(void);
94         // Draws the background for the panel
95         result AddBackgroundBitmap(void);
96         // Draws the bitmap at the correct position on the button
97         void SetBitmapsToButton(const Tizen::Base::String& buttonId, const Tizen::Base::String& buttonName, const Tizen::Base::String& imgPath, ButtonState state);
98         // Draws the text at the correct position on the button
99         void SetEnrichedTextToButton(const Tizen::Base::String& buttonName, Tizen::Graphics::Canvas* pCanvas, ButtonState state, int verticalPos);
100         // Adds the action listener for the buttons
101         void AddKeyPadActionListener(const Tizen::Base::String& buttonId, CommandIds cmdId);
102         //Disable the unused buttons for Outgoing / Emergency Forms
103         void DisableKeysForOutgoingCall(void);
104
105
106         //set the View contact bitmaps
107         void SetViewContacBitmapToButton(const Tizen::Base::String& buttonId, const Tizen::Base::String& buttonName, const Tizen::Base::String& imgBackgroundPath,const Tizen::Base::String& imgPath, ButtonState state);
108
109 private:
110         //action listener
111         Tizen::Ui::IActionEventListener* __pActionListener;
112         FormType __parentFormType;
113 };
114
115 #endif /* _PHN_CALL_BUTTONS_PANEL_H_ */