|
1 /*! |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef DIALPADMAILBOXEVENTFILTERBASE_H |
|
19 #define DIALPADMAILBOXEVENTFILTERBASE_H |
|
20 |
|
21 #include <QObject> |
|
22 |
|
23 class QTimer; |
|
24 class Dialpad; |
|
25 class DialpadSymbianWrapper; |
|
26 |
|
27 enum err { |
|
28 DialpadErrorNone = 0, |
|
29 DialpadErrorCancel = -3 |
|
30 }; |
|
31 const int DialpadLongKeyPressTimeOut(1000); |
|
32 |
|
33 /*! |
|
34 DialpadMailboxEventFilterBase |
|
35 Class provides voice mailbox key handling. |
|
36 */ |
|
37 class DialpadMailboxEventFilterBase : public QObject |
|
38 { |
|
39 Q_OBJECT |
|
40 |
|
41 public: |
|
42 explicit DialpadMailboxEventFilterBase(Dialpad* dialpad, QObject* parent = 0); |
|
43 virtual ~DialpadMailboxEventFilterBase(); |
|
44 |
|
45 protected: |
|
46 virtual bool eventFilter(QObject *watched, QEvent *event) = 0; |
|
47 |
|
48 /*! |
|
49 \fn bool isLongKeyPressSupported(const int key) |
|
50 |
|
51 Checks if key is numeric key'1' or numbersign key if it is then |
|
52 function return true, if key is something else for example |
|
53 yes/send then this returns false. |
|
54 */ |
|
55 bool isLongKeyPressSupported(const int key); |
|
56 |
|
57 /*! |
|
58 \fn bool checkIfSendEventAndConsumeEvent(const int pressedKey, const int eventType) |
|
59 |
|
60 Checks that keycode is call related key if it is then handle it. |
|
61 */ |
|
62 bool checkIfSendEventAndConsumeEvent(const int pressedKey, const int eventType); |
|
63 |
|
64 /*! |
|
65 \fn bool handleCallButtonPress() |
|
66 |
|
67 Check if editor has number string and if it does then createCall |
|
68 is called and funtion returns true, if there is no number then |
|
69 funtion return false. |
|
70 */ |
|
71 virtual bool handleCallButtonPress() = 0; |
|
72 |
|
73 /*! |
|
74 \fn void clearEditor() |
|
75 |
|
76 Clears dialpad editor. |
|
77 */ |
|
78 void clearEditor(); |
|
79 |
|
80 /*! |
|
81 \fn createCall(const QString phoneNumber) |
|
82 |
|
83 Creates call request to QT Highway. |
|
84 */ |
|
85 void createCall(const QString &phoneNumber, bool createVideoCall = false); |
|
86 |
|
87 /*! |
|
88 \fn handleMailboxOperation |
|
89 |
|
90 Start vmbx call or number definition procedures. |
|
91 */ |
|
92 virtual void handleMailboxOperation() = 0; |
|
93 |
|
94 |
|
95 protected slots: |
|
96 |
|
97 /*! |
|
98 \fn void handleLongKeyPress() |
|
99 |
|
100 Handles long key presses. |
|
101 */ |
|
102 virtual void handleLongKeyPress() = 0; |
|
103 |
|
104 |
|
105 protected: |
|
106 QTimer *mLongPressTimer; |
|
107 DialpadSymbianWrapper *mSymbianWrapper; |
|
108 Dialpad* mDialpad; |
|
109 int mKeyEvent; |
|
110 }; |
|
111 |
|
112 #endif // DIALPADMAILBOXEVENTFILTERBASE_H |