00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 import QtQuick 1.0
00041 import Qt 4.7
00042 import com.nokia.symbian 1.1
00043 import com.nokia.xqtelephonydeclarative 1.0
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 Window {
00056 id: view
00057
00058
00059
00060 StatusBar {
00061 id: statusBar
00062 anchors.top: view.top
00063 }
00064
00065
00066
00067 XQTelephonyManager {
00068 id: manager
00069 }
00070
00071
00072
00073 XQTelephonyAudio {
00074 id: audio
00075 maxCallVolume: 20
00076 callVolume:10
00077
00078
00079
00080 onMicMuteChanged: {
00081 if (audio.micMuted == true) {
00082 actionImage.source = "qgn_indi_button_mute_mic.svg";
00083 }
00084 else {
00085 actionImage.source = "qgn_indi_button_unmute_mic.svg";
00086 }
00087 }
00088
00089
00090
00091 onCallVolumeChanged: {
00092 actionImage.source = "button_sound_on.png";
00093 }
00094 }
00095
00096
00097
00098 Component {
00099 id: callItem
00100 CallHeader {
00101 id: callHeaderDisplay
00102
00103
00104 property bool incomingCall: (call.callState == XQTelephonyCall.Incoming);
00105 stateText: "";
00106 button1Text: incomingCall ? "Answer" : "End call";
00107 onButton1Pressed: incomingCall ? answer() : endcall();
00108
00109
00110 states: [
00111 State {
00112 name: "idle"
00113 when: call.callState == XQTelephonyCall.Idle || call.callState == XQTelephonyCall.Unknown
00114 PropertyChanges { target: callHeaderDisplay; stateText: "Idle"; }
00115 },
00116 State {
00117 name: "dialing"
00118 when: call.callState == XQTelephonyCall.Dialing
00119 PropertyChanges { target: callHeaderDisplay; stateText: "Dialing..."; }
00120 },
00121 State {
00122 name: "remotebusy"
00123 when: call.callError == XQTelephonyCall.RemoteBusy
00124 PropertyChanges { target: callHeaderDisplay; stateText: "Remote busy"; }
00125 },
00126 State {
00127 name: "alerting"
00128 when: call.callState == XQTelephonyCall.Alerting
00129 PropertyChanges { target: callHeaderDisplay; stateText: "Alerting..."; }
00130 },
00131 State {
00132 name: "connected"
00133 when: call.callState == XQTelephonyCall.Connected
00134 PropertyChanges { target: callHeaderDisplay; stateText: "Connected"; }
00135 },
00136 State {
00137 name: "onhold"
00138 when: call.callState == XQTelephonyCall.Hold
00139 PropertyChanges { target: callHeaderDisplay; stateText: "On hold"; }
00140 },
00141 State {
00142 name: "disconnecting"
00143 when: call.callState == XQTelephonyCall.Disconnecting
00144 PropertyChanges { target: callHeaderDisplay; stateText: "Disconnecting..."; }
00145 },
00146 State {
00147 name: "incoming"
00148 when: call.callState == XQTelephonyCall.Incoming
00149 PropertyChanges { target: callHeaderDisplay; stateText: "Incoming"; }
00150 }
00151 ]
00152
00153
00154 function endcall() {
00155 call.handleEndCallPressed();
00156 }
00157
00158 function answer() {
00159 call.handleAnswerPressed();
00160 }
00161 }
00162 }
00163
00164
00165
00166 ListView {
00167 id: callList
00168 model: manager.activeCalls
00169 delegate: callItem
00170 anchors.left: parent.left
00171 anchors.top: statusBar.bottom
00172 anchors.topMargin: 10
00173 }
00174
00175
00176
00177 Text {
00178 id: phoneNumberEdit
00179 text:""
00180 anchors.right: parent.right
00181 anchors.rightMargin: 5
00182 anchors.bottom: volumeSlider.top
00183 anchors.bottomMargin: 25
00184 font.weight: Font.Bold
00185 font.pixelSize:25
00186 color: "white"
00187 }
00188
00189
00190
00191 Image {
00192 id: actionImage
00193 anchors.bottom: volumeSlider.top
00194 anchors.bottomMargin: 20
00195 source: "button_sound_on.png"
00196 }
00197
00198
00199
00200
00201
00202
00203 Slider {
00204 id: volumeSlider
00205 maximumValue: audio.maxCallVolume
00206 minimumValue: 0
00207 value: audio.callVolume
00208 stepSize: 1
00209 valueIndicatorVisible: true
00210 anchors.left: parent.left
00211 anchors.bottom: numberKeyboard.top
00212 anchors.bottomMargin: 5
00213 onValueChanged: {
00214 audio.callVolume = value;
00215 }
00216 }
00217
00218
00219
00220 Button {
00221 id: muteButton
00222 text: audio.micMuted ? "Unmute" : "Mute"
00223 width: 120
00224 height: 35
00225 anchors.left: volumeSlider.right
00226 anchors.leftMargin: 20
00227 anchors.bottom: numberKeyboard.top
00228 anchors.bottomMargin: 25
00229 onClicked: {
00230 audio.micMuted = !audio.micMuted
00231 }
00232 }
00233
00234
00235
00236 VKeyboard {
00237 id:numberKeyboard
00238 anchors.bottom:dialButton.top
00239 onSend: {
00240 phoneNumberEdit.text = phonenumber
00241 loader.sourceComponent = null
00242 onClicked: mainMenu.close()
00243 }
00244 }
00245
00246
00247
00248 Button {
00249 id:dialButton
00250 text:"Dial"
00251 anchors.right:parent.right
00252 anchors.left:parent.left
00253 anchors.bottom:toolBar.top
00254 height: 50
00255 onClicked: {
00256 manager.makeCall(phoneNumberEdit.text, "CS");
00257 }
00258 }
00259
00260
00261
00262
00263 ToolBar {
00264 id: toolBar
00265 anchors.bottom: view.bottom
00266 tools: ToolBarLayout {
00267 id: toolBarLayout
00268 ToolButton {
00269 flat: true
00270 iconSource: "toolbar-back"
00271 onClicked: Qt.quit()
00272 }
00273 ToolButton {
00274 flat: true
00275 iconSource: "toolbar-menu"
00276 onClicked: mainMenu.open()
00277 }
00278 }
00279 }
00280
00281
00282 Component {
00283 id: helpComponent
00284 TextArea {
00285 readOnly: true
00286 anchors.bottom: parent.bottom
00287 anchors.right: parent.right
00288 text: "Click the Mute button to make it on/off \nUse the slider to change the volume \
00289 \nlevel. Type a number and click \nthe Dial button"
00290 }
00291 }
00292
00293
00294 Component {
00295 id: aboutComponent
00296 TextArea {
00297 readOnly: true
00298 anchors.bottom: parent.bottom
00299 anchors.right: parent.right
00300 text: "The example demonstrates the\nTelephony Qt style API by showcasing \
00301 \nout going call feature."
00302 }
00303 }
00304
00305
00306 Loader {
00307 id: loader
00308 }
00309
00310
00311 Menu{
00312 id: mainMenu
00313 content:
00314 Column{
00315 width: pageMenu.width
00316
00317 MenuItem{
00318 id: menu1
00319 text: "Help"
00320 onClicked:{
00321 loader.sourceComponent = helpComponent
00322 }
00323 }
00324 MenuItem{
00325 id: menu2
00326 text: "About"
00327 onClicked:{
00328 loader.sourceComponent = aboutComponent
00329 }
00330 }
00331 MenuItem{
00332 id: menu3
00333 text: "Close"
00334 onClicked:{
00335 loader.sourceComponent = null
00336 onClicked: mainMenu.close()
00337 }
00338 }
00339 }
00340 }
00341 }
00342