Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnCallButtonsPanel.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                PhnCallButtonsPanel.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 "PhnBaseForm.h"
30 #include "PhnTypes.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
82 protected:
83         // Construct the panel to be shown in "End Call" form
84         result ConstructEndCallPanel(void);
85         // Construct the panel to be shown in "Active Call" form
86         result ConstructActiveCallPanel(void);
87         // Draws the background for the panel
88         result AddBackgroundBitmap(void);
89         // Draws the bitmap at the correct position on the button
90         void SetBitmapsToButton(const Tizen::Base::String& buttonId, const Tizen::Base::String& buttonName, const Tizen::Base::String& imgPath, ButtonState state);
91         // Draws the text at the correct position on the button
92         void SetEnrichedTextToButton(const Tizen::Base::String& buttonName, Tizen::Graphics::Canvas* pCanvas, ButtonState state, int verticalPos);
93         // Adds the action listener for the buttons
94         void AddKeyPadActionListener(const Tizen::Base::String& buttonId, CommandIds cmdId);
95         //Disable the unused buttons for Outgoing / Emergency Forms
96         void DisableKeysForOutgoingCall(void);
97
98         //set the buttons in the panel as the top controls. Chk if its needed in RC2
99         void SetButtonPosition(void);
100
101 private:
102         //action listener
103         Tizen::Ui::IActionEventListener* __pActionListener;
104         FormType __parentFormType;
105 };
106
107 #endif /* _PHN_CALL_BUTTONS_PANEL_H_ */