License and Privilege changes
[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.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                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 ViewContact is present or not
84         void ShowViewContactButton(void);
85         // Used to set the AddToContact is present or not
86         void ShowAddContactButton(void);
87         //set the buttons in the panel as the top controls. Chk if its needed in RC2
88         void SetButtonPosition(void);
89         void ShowOrHideAddtoContactsButton(bool isEnabled);
90
91 protected:
92         // Construct the panel to be shown in "End Call" form
93         result ConstructEndCallPanel(void);
94         // Construct the panel to be shown in "Active Call" form
95         result ConstructActiveCallPanel(void);
96         // Draws the background for the panel
97         result AddBackgroundBitmap(void);
98         // Draws the bitmap at the correct position on the button
99         void SetBitmapsToButton(const Tizen::Base::String& buttonId, const Tizen::Base::String& buttonName, const Tizen::Base::String& imgPath, ButtonState state);
100         // Draws the text at the correct position on the button
101         void SetEnrichedTextToButton(const Tizen::Base::String& buttonName, Tizen::Graphics::Canvas* pCanvas, ButtonState state, int verticalPos);
102         // Adds the action listener for the buttons
103         void AddKeyPadActionListener(const Tizen::Base::String& buttonId, CommandIds cmdId);
104         //Disable the unused buttons for Outgoing / Emergency Forms
105         void DisableKeysForOutgoingCall(void);
106
107
108         //set the View contact bitmaps
109         void SetViewContacBitmapToButton(const Tizen::Base::String& buttonId, const Tizen::Base::String& buttonName, const Tizen::Base::String& imgBackgroundPath,const Tizen::Base::String& imgPath, ButtonState state);
110
111 private:
112         //action listener
113         Tizen::Ui::IActionEventListener* __pActionListener;
114         FormType __parentFormType;
115 };
116
117 #endif /* _PHN_CALL_BUTTONS_PANEL_H_ */