|
1 /*! |
|
2 * Copyright (c) 2009 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 BUBBLETESTVIEW_H |
|
19 #define BUBBLETESTVIEW_H |
|
20 |
|
21 #include <hbview.h> |
|
22 #include <bubblemanagerif.h> |
|
23 |
|
24 class HbAction; |
|
25 class HbMainWindow; |
|
26 class QSignalMapper; |
|
27 class HbToolBar; |
|
28 class BubbleTester; |
|
29 class BubbleManager; |
|
30 |
|
31 class BubbleTestView : public HbView |
|
32 { |
|
33 Q_OBJECT |
|
34 |
|
35 public: |
|
36 |
|
37 BubbleTestView(HbMainWindow& window, QGraphicsItem *parent = 0); |
|
38 |
|
39 virtual ~BubbleTestView(); |
|
40 |
|
41 BubbleManagerIF& bubbleManager(); |
|
42 |
|
43 private slots: |
|
44 void answerCall(); |
|
45 void endCall(); |
|
46 void endConferenceCall(); |
|
47 void rejectCall(); |
|
48 void toggleHold(); |
|
49 void toggleHoldDelayed(); |
|
50 void createIncomingCall(); |
|
51 void createOutgoingCall(); |
|
52 void setMuted(); |
|
53 void joinToConference(); |
|
54 void handlePrivate(); |
|
55 void handleDrop(); |
|
56 void replaceActiveCall(); |
|
57 void updateUiControls(); |
|
58 |
|
59 void switchOrientation(); |
|
60 void handleOrientationChange(Qt::Orientation orientation); |
|
61 |
|
62 void connectToTester(); |
|
63 void handleTesterDataChanged(); |
|
64 |
|
65 private: |
|
66 void keyPressEvent(QKeyEvent *event); |
|
67 |
|
68 void setBubbleData(int bubble, BubbleManagerIF::PhoneCallState state); |
|
69 void setBubbleActions(int bubble, BubbleManagerIF::PhoneCallState state); |
|
70 void setExpandActions(); |
|
71 void setCallObject(int bubble, const QString& filename); |
|
72 void createToolBarActions(); |
|
73 void updateToolBarActions(); |
|
74 void createMenuActions(); |
|
75 void createBubbleActions(); |
|
76 int bubbleIdByState(BubbleManagerIF::PhoneCallState state); |
|
77 bool initializingCallExists() const; |
|
78 bool conferenceCallExists() const; |
|
79 int callCount() const; |
|
80 bool callIndexByState(BubbleManagerIF::PhoneCallState state, int& index); |
|
81 bool callIndexByBubbleId(int bubbleId, int& index); |
|
82 void conferenceWizard(); |
|
83 void sendKeyEvent(int key); |
|
84 |
|
85 private: |
|
86 HbMainWindow& mMainWindow; |
|
87 BubbleManager *mBubbleManager; |
|
88 QList<HbAction*> mBubbleActions; |
|
89 |
|
90 // settings |
|
91 HbAction *mCallDivert; |
|
92 HbAction *mCallTimer; |
|
93 HbAction *mEmergencyCall; |
|
94 HbAction *mContactPicture; |
|
95 HbAction *mContactName; |
|
96 |
|
97 // Toolbar actions |
|
98 HbAction *mCallIn; |
|
99 HbAction *mCallOut; |
|
100 HbAction *mMute; |
|
101 HbAction *mUnmute; |
|
102 HbAction *mActivateLoudspeaker; |
|
103 HbAction *mActivateHandset; |
|
104 HbAction *mSendMessage; |
|
105 HbAction *mSilence; |
|
106 HbAction *mOpenDialer; |
|
107 HbAction *mOpenContacts; |
|
108 |
|
109 // Bubble actions |
|
110 HbAction *mAnswer; |
|
111 HbAction *mReject; |
|
112 HbAction *mHold; |
|
113 HbAction *mUnhold; |
|
114 HbAction *mSwap; |
|
115 HbAction *mEndCall; |
|
116 HbAction *mEndConference; |
|
117 HbAction *mJoin; |
|
118 HbAction *mPrivate; |
|
119 HbAction *mDrop; |
|
120 HbAction *mReplace; |
|
121 HbAction *mUpdateUiControls; |
|
122 |
|
123 // Test call data |
|
124 struct TestCall { |
|
125 int bubbleId; |
|
126 int callState; |
|
127 bool isConf; |
|
128 bool isInConf; |
|
129 |
|
130 TestCall() { |
|
131 isConf = false; |
|
132 isInConf = false; |
|
133 } |
|
134 }; |
|
135 |
|
136 QList<TestCall> mCalls; |
|
137 bool mMuted; |
|
138 |
|
139 HbAction *mConnectTester; |
|
140 BubbleTester *mBubbleTester; |
|
141 QMap<QString, int> mTestBubbleIds; |
|
142 QMap<QString, BubbleManagerIF::PhoneCallState> mStateMap; |
|
143 QMap<QString, QString> mLabelMap; |
|
144 QString mPhoneNumber; |
|
145 int mConfBubbleId; |
|
146 bool mProvideJoin; |
|
147 }; |
|
148 |
|
149 #endif // BUBBLETESTVIEW_H |