Tizen 2.0 Release
[apps/osp/Phone.git] / inc / PhnDialerKeypad.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                PhnDialerKeypad.h
19  * @brief               This is the header file for the %DialerKeypad class.
20  *
21  * This header file contains the declarations for %DialerKeypad class.
22  */
23 #ifndef _PHN_DIALER_KEYPAD_H_
24 #define _PHN_DIALER_KEYPAD_H_
25
26 #include <FApp.h>
27 #include <FBase.h>
28 #include <FUi.h>
29
30 /**
31  * @class DialerKeypad
32  * @brief This class presents a Panel based UI for keypads used in Dialer Tab.
33  *
34  */
35 class DialerKeypad
36         : public Tizen::Ui::Controls::Panel
37 {
38 private:
39         enum ButtonState
40         {
41                 BTN_NORMAL,
42                 BTN_PRESS,
43                 BTN_DIM,
44         };
45
46 public:
47         enum DialerState
48         {
49                 DIALER_STATE_FIRST_SCENE = 0,
50                 DIALER_STATE_NORMAL_APPCONTROL,
51                 DIALER_STATE_EMERGENCY_APPCONTROL,
52                 DIALER_STATE_ADD_CALL,
53         };
54
55         DialerKeypad(DialerState openedState);
56         virtual ~DialerKeypad(void);
57
58         bool ConstructPanel(Tizen::Ui::IActionEventListener* pActionListener, Tizen::Ui::ITouchLongPressGestureEventListener* pLongTapListener);
59         /**
60          * Overrides this method to provide user-specific initialization code after the control is added to a container.
61          * @remarks             OnInitializing() is called when the control is about to be added to a container.
62          * @remarks             To cancel adding this control to the parent, return E_FAILURE in this method.
63          * @see                 OnTerminating()
64         */
65         virtual result OnInitializing(void);
66         /**
67          * Overrides this method to provide user-specific termination code.
68          * @return              An error code
69          * @remarks             OnTerminating() is called right before the control is removed successfully from the container.
70          * @remarks             To cancel removing this control from the parent, return E_FAILURE in this method.
71          * @see                 OnInitializing()
72         */
73         virtual result OnTerminating(void);
74
75 private:
76         // Set Bitmap to the Buttons in panel.
77         void SetBitmapToKeypadButtons(void);
78         //Adds Action listener and Long press detectors to buttons.
79         void AddListenersToButtons(void);
80         //used to determine whether to show cancel button
81         bool IsShowCancelButton(void);
82         //used to determine whether to show voice mail
83         bool IsShowVoiceMailIcon(void);
84         //used to determine whether to show video call button
85         bool IsShowVideoCallButton(void);
86
87 private:
88         //Acts as Action listener & LongPress Gesture Listener
89         Tizen::Ui::IActionEventListener* __pParentActionListener;
90         Tizen::Ui::ITouchLongPressGestureEventListener* __pParentLongTapListener;
91         //Long press gesture detectors for buttons
92         Tizen::Base::Collection::ArrayList* __pLongPressDetectors;
93         //Identifies dialer keypad opened from which state
94         DialerState __openedState;
95 };
96
97 #endif // _PHN_DIALER_KEYPAD_H_