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 #ifndef LCUIENGINEPRIVATE_H |
|
18 #define LCUIENGINEPRIVATE_H |
|
19 |
|
20 //SYSTEM |
|
21 #include <QObject> |
|
22 #include <QString> |
|
23 #include <QTime> |
|
24 #include <QProcess> |
|
25 #include <lcuiengine.h> |
|
26 |
|
27 class QTimer; |
|
28 class QRectF; |
|
29 class HbDialog; |
|
30 class LcUiEngine; |
|
31 class LcUiEngineSimulator; |
|
32 |
|
33 enum simulationState { |
|
34 ENone, |
|
35 EPreparing, |
|
36 EBuffering, |
|
37 EPlaying, |
|
38 EPaused, |
|
39 EStopped, |
|
40 EUnavailable |
|
41 }; |
|
42 |
|
43 /* |
|
44 * Live Comms UI Engine |
|
45 */ |
|
46 class LcUiEnginePrivate |
|
47 |
|
48 { |
|
49 |
|
50 public: |
|
51 |
|
52 LcUiEnginePrivate ( LcUiEngine& uiEngine, |
|
53 const QString &engineName, |
|
54 const QString &applicationDisplayName ); |
|
55 ~LcUiEnginePrivate (); |
|
56 |
|
57 public : |
|
58 |
|
59 void zoom( int value ); |
|
60 void stop(); |
|
61 |
|
62 private: |
|
63 |
|
64 //signaled when engine is stopped |
|
65 void stopped(){ emit mUiEngine.stopped();}; |
|
66 //signaled when layout is changed |
|
67 void layoutChanged(){ emit mUiEngine.layoutChanged();}; |
|
68 //signaled when camera changes to main |
|
69 void cameraChangedToMain(); |
|
70 //signaled when camera changes to secondary |
|
71 void cameraChangedToSecondary(); |
|
72 //signaled when mic is muted |
|
73 void muted(){ mMuteState = true; emit mUiEngine.muted();}; |
|
74 //signaled when mic is unmuted |
|
75 void unmuted(){ mMuteState = false; emit mUiEngine.unmuted();}; |
|
76 //signaled when speaker is enabled |
|
77 void speakerEnabled(){ mSpeakerState = true; emit mUiEngine.speakerEnabled();}; |
|
78 //signaled when speaker is disabled |
|
79 void speakerDisabled(){ mSpeakerState = false; emit mUiEngine.speakerDisabled();}; |
|
80 //signaled when camera is disabled |
|
81 void cameraDisabled(){ mPlayerStateLocal = EPaused; emit mUiEngine.cameraDisabled();}; |
|
82 //signaled when camera is enabled |
|
83 void cameraEnabled(){ mPlayerStateLocal = EPlaying; emit mUiEngine.cameraEnabled();}; |
|
84 //signaled when engine is blocked, |
|
85 //no calls expected until signaled unblocked |
|
86 void blocked(){ emit mUiEngine.blocked();}; |
|
87 //signaled when engine is free |
|
88 void unblocked(){ emit mUiEngine.unblocked();}; |
|
89 //signaled continuously while session is up and running |
|
90 //carries current session duration |
|
91 void sessionDurationChanged(const QString &duration){ emit mUiEngine.sessionDurationChanged(duration);}; |
|
92 void recipientChanged(const QString &recipient){ emit mUiEngine.recipientChanged(recipient);}; |
|
93 void phoneNumberChanged(const QString &number){ emit mUiEngine.phoneNumberChanged(number);}; |
|
94 //signaled when player state changed |
|
95 void localPlayerPlaying(); |
|
96 void remotePlayerPlaying(); |
|
97 void localPlayerPreparing(){ mPlayerStateLocal=EPreparing;emit mUiEngine.localPlayerPreparing();}; |
|
98 void remotePlayerPreparing(){ mSimulatorRemote=EPreparing;emit mUiEngine.remotePlayerPreparing();}; |
|
99 void localPlayerBuffering(){ mPlayerStateLocal=EBuffering;emit mUiEngine.localPlayerBuffering();}; |
|
100 void remotePlayerBuffering(){ mSimulatorRemote=EBuffering;emit mUiEngine.remotePlayerBuffering();}; |
|
101 void localPlayerPaused(); |
|
102 void remotePlayerPaused(); |
|
103 void localPlayerUnavailable(){ mPlayerStateLocal=EUnavailable;emit mUiEngine.localPlayerUnavailable();}; |
|
104 void remotePlayerUnavailable(){ mSimulatorRemote=EUnavailable;emit mUiEngine.remotePlayerUnavailable();}; |
|
105 |
|
106 public: |
|
107 |
|
108 void start(); |
|
109 const QString& sessionTitle() const; |
|
110 const QString& recipient() const; |
|
111 const QString& phoneNumber() const; |
|
112 LcViewLayoutHint viewLayout() const; |
|
113 void setContentAreas( const QRectF& sharedContent, |
|
114 const QRectF& receivedContent ); |
|
115 bool setOrientation( Qt::Orientation orientation ); |
|
116 void setUiComponents(HbDialog* invitingNote, |
|
117 HbDialog* waitingNote, |
|
118 HbDialog* acceptQuery, |
|
119 HbDialog* recipientQuery); |
|
120 void toggleMute(); |
|
121 bool isMuted() const; |
|
122 void toggleSpeaker(); |
|
123 bool isSpeakerOn() const; |
|
124 int zoomValues( LcControlValues& values ) const; |
|
125 void toggleDisableCamera(); |
|
126 void setMainCamera(const bool aMainCamera); |
|
127 bool mainCamera() const; |
|
128 void toggleCamera(); |
|
129 bool fullScreenMode(); |
|
130 void setFullScreenMode(bool aMode); |
|
131 void updateSession(); |
|
132 bool isLocalPlayerPlaying() const; |
|
133 bool isRemotePlayerPlaying() const; |
|
134 bool isMinimized()const; |
|
135 void minimize(); |
|
136 void maximize(); |
|
137 void shareImage(const QString&); |
|
138 void shareCamera(); |
|
139 |
|
140 public: // Data |
|
141 |
|
142 QByteArray mEngineName; |
|
143 QString mSessionTitle; |
|
144 QString mRecipient; |
|
145 QString mPhoneNumber; |
|
146 LcViewLayoutHint mViewLayout; |
|
147 QTimer* mCloseTimer; |
|
148 HbDialog* mInvitingNote; // Not owned |
|
149 HbDialog* mWaitingNote; // Not owned |
|
150 HbDialog* mAcceptQuery; // Not owned |
|
151 HbDialog* mRecipientQuery; // Not owned |
|
152 QString mPendingAction; |
|
153 bool mBlocked; |
|
154 bool mFullScreen; |
|
155 int mSessionDurationTimerId; |
|
156 QTime mSessionDurationStartTime; |
|
157 LcUiEngine& mUiEngine; |
|
158 |
|
159 public: |
|
160 simulationState mPlayerStateLocal; |
|
161 simulationState mSimulatorRemote; |
|
162 bool mSpeakerState; |
|
163 bool mMuteState; |
|
164 bool mMainCamera; |
|
165 QProcess *mLocalPlayerProcess; |
|
166 QProcess *mRemotePlayerProcess; |
|
167 QString mProgram; |
|
168 QString mProgramImage; |
|
169 QString mLocalMovieName; |
|
170 |
|
171 private: |
|
172 LcUiEngineSimulator* mSimulator; |
|
173 |
|
174 friend class LcUiEngineSimulator; |
|
175 }; |
|
176 |
|
177 #endif // LCUIENGINEPRIVATE_H |
|
178 |
|
179 |
|
180 // End of file |
|