import QtQuick 2.0 import "../../eventsList.js" as EventsList import "../../com/neusoft/auto/widgets" import "../../layoutList.js" as Layout import "../../windowsList.js" as WindowsList import Label 2.0 HMIWindow { id:msg_View_Answer //y:128 property int curTTSIndex: 0 property bool ttsEnable: true property bool phoneOutgoing: false property bool savebKeyboardvisible:false property bool saveinput_barvisible:false property bool saveanswer_btnvisible:false property bool saveicon_Sendvisible:false property bool savecursorvisible:false //ADD #F0042 2016/10/14 wangshuang begin property int shengyuzishu:70 property int duanxingeshu:1 //ADD #F0042 2016/10/14 wangshuang begin Component.onCompleted: { windowID = WindowsList.BTM_SMS_VIEW systemCtrl.setTextInputHandle(answerInput) } onVisibleChanged: { bFullWindow = true //bKeyboardVisiable = true msglist.positionViewAtIndex(msglist.count-1,ListView.End) systemCtrl.setTextInputHandle(answerInput) // answerInput.text = "" // keyBoardItem.visible = false // bKeyboardVisiable = false // input_bar.visible = false // answer_btn.visible = true // icon_Send.visible = false // if(keyBoardItem.visible == true) // { // keyBoardItem.visible = false // } // if(input_bar.visible == true) // { // input_bar.visible = false // } // if(icon_Send.visible == true) // { // icon_Send.visible = false // } // if(answer_btn.visible == false) // { // answer_btn.visible = true // } if(visible == false) { if(phoneOutgoing == true) { } else { btCtrl.msgTTSStop() //btCtrl.msgDiaNumberClear() } } else { phoneOutgoing = false } //ADD #119244 2016/10/19 wangshuang begin if(keyBoardItem.visible == false) { answer_btn.visible = true } //ADD #119244 2016/10/19 wangshuang end //ADD #140033 2016/12/20 wangshuang begin else { answer_btn.visible = false } //ADD #140033 2016/12/20 wangshuang end //ADD #105313 2016/12/07 liduo begin if(handWrite.visible==true) bhandwritebar=true if(keyBoard.visible==true) bhandwritebar=false if(handWrite.changecanvas==false){ handWrite.changecanvas=true } //ADD #105313 2016/12/07 liduo end } onCloseWindow: { if (closeType == Layout.CLOSE_BY_CLOSE) { btCtrl.msgDiaNumberClear() btCtrl.btpMsgAnswerSavedState ="" answerInput.text = "" keyBoardItem.visible = false bKeyboardVisiable = false input_bar.visible = false answer_btn.visible = true icon_Send.visible = false answerInput.cursorVisible = false } else if (closeType == Layout.CLOSE_BY_OPEN) { answerInput.text = "" keyBoardItem.visible = false bKeyboardVisiable = false input_bar.visible = false answer_btn.visible = true icon_Send.visible = false answerInput.cursorVisible = false } } Timer{ id:listtimer interval: 1 repeat : false running : true triggeredOnStart : false onTriggered: { //msglist.positionViewAtEnd() msglist.positionViewAtIndex(msglist.count-1,ListView.End) } } HMILabel { //Fod #F0002 2016/10/10 wangshuang begin id:view_Name x:240//304 y:back_btn_label.y//25 width:480//307 height:38//28 text:btCtrl.btselectmsgname color: "white" font.pixelSize: 30 //horizontalAlignment: Label.AlignLeft elide: Label.ElideRight horizontalAlignment: text.horizontalAlignment verticalAlignment: text.verticalAlignment //horizontalAlignment: Label.horizontalAlignment //Fod #F0002 2016/10/10 wangshuang end } HMIButton { id:folderBack_button x:0 y:5 width:138 height:70 btnImg:folderBack_button.pressed?"qrc:MATERIAL/MATERIAL_M8X_BACK_BUTTON_P"+bgImageStyle:"qrc:MATERIAL/MATERIAL_M8X_BACK_BUTTON"+bgImageStyle onClicked: { ScreenManager.changeForm(Layout.FM_CLOSE,WindowsList.BTM_SMS_VIEW) } Image{ x:20 width: 20 height:34 source:"qrc:MATERIAL/MATERIAL_M8X_ICON_BACK"+bgImageStyle anchors.verticalCenter:parent.verticalCenter } HMILabel{ id:back_btn_label x:58//50 //y:23 //Fod #F0017 2016/10/11 wangshuang begin width: 64//60 //Fod #F0017 2016/10/11 wangshuang end height:30 font.pixelSize: 30 text: qsTr("Back")+systemCtrl.emptyString anchors.verticalCenter:parent.verticalCenter } } Item { id:readmsg x:0 y:78 //Fod #F0144 2016/12/22 wangshuang begin width:937//950 //Fod #F0144 2016/12/22 wangshuang end height: (input_bar.visible == true)?((keyBoardItem.visible == true)?195:595):800 HMIListView { id:msglist anchors.fill: parent clip:true // model: mesrecord model:btCtrl.btMsgDiaListModel delegate: msg_View keyNavigationWraps: true orientation: ListView.Vertical highlightFollowsCurrentItem: true snapMode: ListView.SnapOneItem scrollBar:true scrollBar_edge:0 scrollBar_width:8//4 scrollBar_img:"qrc:MATERIAL/MATERIAL_M8X_SLIDER_BAR"+bgImageStyle } Component { id:msg_View Item { width: 960 height: (114+msgtext.height)<200?200:(128+msgtext.height) HMILabel { id:msgtime x:348 y:-5//6 width:260 height:30 text:col2 color: "#545454" font.pixelSize: 26 wtitesize:1 horizontalAlignment: Label.horizontalAlignment } Image{ id:msgpic x:col1 == "0"?58:238//28:208 y:43 width: 692 height: (msgtext.height+54)<130?130:(msgtext.height+54) source: "qrc:MATERIAL/MATERIAL_M8X_SMS_BK"+bgImageStyle Image{ x:(col1 == "0")?-14:692 anchors.verticalCenter: msgpic.verticalCenter source:(col1 == "0")?"qrc:MATERIAL/MATERIAL_M8X_SMS_BK_ARROW_LEFT"+bgImageStyle:"qrc:MATERIAL/MATERIAL_M8X_SMS_BK_ARROW_RIGHT"+bgImageStyle } } Text { id:msgtext visible: false x:col1 == "0"?90:265//60:235//89:230 y:71 width: 637 font.family: "Montserrat"//add lqy for 325925 font.pixelSize:30 text:col0 color:"white" wrapMode:Label.WrapAnywhere } HMILabel { id:msgLabel x:msgtext.x y:msgtext.y width: msgtext.width height: msgtext.height+6//*0.860 font.pixelSize:30//24 text:col0 color:"white" wrapMode:Label.Wrap //WordWrap//WrapAnywhere verticalAlignment: Label.AlignTop horizontalAlignment: Label.AlignLeft } HMIButton { id:tts x:col1 == "0"?790:55////////// // y:320-230//284-200-10 anchors.verticalCenter: msgpic.verticalCenter width: 88 height: 88 visible: !sms_Failure.visible enabled: ttsEnable btnImg:tts.pressed?("qrc:MATERIAL/MATERIAL_M8X_TTS_BUTTON_P"+bgImageStyle) :("qrc:MATERIAL/MATERIAL_M8X_TTS_BUTTON"+bgImageStyle) btnIcon: col1 == 0?"qrc:MATERIAL/MATERIAL_M8X_ICON_TTS_SENT"+bgImageStyle :"qrc:MATERIAL/MATERIAL_M8X_ICON_TTS_RECEIVE"+bgImageStyle onClicked: { ttsEnable = false tts_click.start() if(curTTSIndex != index) { if(btCtrl.getTTSCurrentStatus() == 2) { curTTSIndex = index btCtrl.msgTTSPlayDifferentIndex(msgtext.text); // console.log("000000000000000000000btCtrl.msgTTSPlayDifferentIndex(msgtext.text)") } else { curTTSIndex = index systemCtrl.reqSource(Layout.HMI_SRC_AUDIO_TTS,Layout.HMI_SRC_START,Layout.HMI_SRC_Front); btCtrl.msgTTSPlay(msgtext.text); // console.log("111111111111111111111111111btCtrl.msgTTSPlay(msgtext.text)") } } else { switch(btCtrl.getTTSCurrentStatus()) { case 1: case 3: systemCtrl.reqSource(Layout.HMI_SRC_AUDIO_TTS,Layout.HMI_SRC_START,Layout.HMI_SRC_Front); btCtrl.msgTTSPlay(msgtext.text); break; case 2: //systemCtrl.reqSource(Layout.HMI_SRC_AUDIO_TTS,Layout.HMI_SRC_End,Layout.HMI_SRC_Front); tts_stop.start() break; default: break; } } } } Image { id:sms_Failure x:110 y:60 source: "qrc:MATERIAL/MATERIAL_M8X_ICON_SMS-FALLURE"+bgImageStyle visible: (col1 == "1")&&(col4 == "0") HMILabel { x:-80 y:65 width:200 height:25 font.pixelSize:26 text:qsTr("SMS failure")+ systemCtrl.emptyString } } } } } //Add #129445 2016/11/30 wangs begin MouseArea { id:scroolbarcover x:915 y:78 width:45 height: (input_bar.visible == true)?((keyBoardItem.visible == true)?195:595):800 } //Add #129445 2016/11/30 wangs end Item { id:input_bar x:0 //Fod #F0015 2016/10/11 wangshuang begin y:(keyBoardItem.visible == true)?280:681//680//280:693 width: 960 height: 186 visible: false HMILabel { id:answer x:0//75 y:(keyBoardItem.visible == true)?15:3//6 width:240//180 height:30//29 font.pixelSize: 30 text:qsTr("Answer")+ systemCtrl.emptyString horizontalAlignment: text.AlignLeft } Image{ id:msgpic x:58 y:69//56 width: 842 height: 130 source: "qrc:MATERIAL/MATERIAL_M8X_SMS_BK"+bgImageStyle //ADD F0055 2017/1/18 mengyufeng begin Rectangle { width: 842 height: 130 color: "#130f0f" } //ADD F0055 2017/1/18 mengyufeng end Image{ x:842//900 anchors.verticalCenter: msgpic.verticalCenter source:"qrc:MATERIAL/MATERIAL_M8X_SMS_BK_ARROW_RIGHT"+bgImageStyle } } Flickable { id: flick x:89 y:87 width:790//769 height: 71 // x:0 // y:254-90-128-50 // width: 698 // height: (keyBoardItem.visible == true)?126:382 flickableDirection:Flickable.VerticalFlick contentWidth: answerInput.paintedWidth contentHeight: answerInput.paintedHeight clip: true interactive:true boundsBehavior: Flickable.StopAtBounds function ensureVisible(r) { if (contentX >= r.x) contentX = r.x; else if (contentX+width <= r.x+r.width) contentX = r.x+r.width-width; if (contentY >= r.y) contentY = r.y; else if (contentY+height <= r.y+r.height) contentY = r.y+r.height-height; } TextEdit { id: answerInput width: 780//698 height: answerInput.contentHeight//flick.height focus: true font.pixelSize: 30//24 //Fod #F0015 2016/10/11 wangshuang end //ADD F0055 2017/1/18 mengyufeng begin color: "#130f0f" selectedTextColor:"#676767" selectionColor:"#676767" font.family:"Montserrat" //ADD F0055 2017/1/18 mengyufeng end cursorVisible:true wrapMode: TextEdit.Wrap onCursorRectangleChanged: flick.ensureVisible(cursorRectangle) //ADD F0055 2017/1/18 mengyufeng begin cursorDelegate:mCursorDelegate Component { id:mCursorDelegate Rectangle { id:mCursorRectangle color: "white" height: 30//answerInput.cursorRectangle.height width: 1//answerInput.cursorRectangle.width Timer { running: true repeat: true interval: 800 onTriggered: { mCursorRectangle.visible = ! mCursorRectangle.visible } } } } Label { id:answerLable x:0 y:2 height: 30*5//(newMsgInput.lineCount>1)?(newMsgInput.lineCount+1)*30:30//newMsgLable.height width:780 text:answerInput.text font.family:"Montserrat" color: "white" font.pixelSize: 30 wrapMode: Label.Wrap horizontalAlignment: Label.AlignLeft verticalAlignment: Label.AlignTop } //ADD F0055 2017/1/18 mengyufeng end onLengthChanged: { if(length > 80) { // console.debug("lengthlengthlengthlengthlengthlengthlengthlength") remove(80, 82) } //ADD #F0042 2016/10/14 wangshuang begin if(length <70) { shengyuzishu=70-length duanxingeshu=1 } else{ shengyuzishu=70-length%70 duanxingeshu=1+length/70 } //ADD #F0042 2016/10/14 wangshuang end } onCursorPositionChanged: //每当光标移动的时候会收到该信号 { if(answerInput.text.length == 80) //判断当前已经输入的字体个数 { // console.debug("lengthlengthlengthlengthlengthlengthlengthlength") keyBoard.maximumState=true //当长度为480的时候将KeyBoard的maximumState设置为true } else if(answerInput.text.length <80) { keyBoard.maximumState=false //当长度小于480的时候将KeyBoard的maximumState设置为true } } //ADD #105313 2016/12/07 liduo begin HMIMouseArea { anchors.fill: parent //visible: !keyBoardItem.visible onClicked: { answerInput.cursorPosition = answerInput.positionAt(mouseX,mouseY) if(handWrite.visible==true) bhandwritebar=true if(keyBoard.visible==true) bhandwritebar=false if(handWrite.changecanvas==false){ handWrite.changecanvas=true } //ADD #145225 2017/01/18 wangs begin systemCtrl.pinyinsreachclear() //ADD #145225 2017/01/18 wangs end } } //ADD #105313 2016/12/07 liduo end } } HMIMouseArea { anchors.fill: parent visible: !keyBoardItem.visible onClicked: { keyBoardItem.visible = true bKeyboardVisiable = true //ADD #105313 2016/12/07 liduo begin if(handWrite.visible==true) bhandwritebar=true if(keyBoard.visible==true) bhandwritebar=false if(handWrite.changecanvas==false){ handWrite.changecanvas=true } //ADD #105313 2016/12/07 liduo end } } } //stbug #88563 start Timer{ id:tts_stop interval: 1 onTriggered: { // console.debug("btCtrl.msgTTSStop()") btCtrl.msgTTSStop() // console.log("[BTM_SMS_View]On Clicked stop"+Qt.formatTime(new Date(),"hh:mm:ss.zzz")) } } Timer{ id:tts_click interval: 200 onTriggered: { // console.debug("```````````````````ttsEnable = true") ttsEnable = true } } //stbug #88563 end /*---------------------------------------------Key Board Start----------------------------------------*/ Item { id:keyBoardItem x:1 y:561 visible: false onVisibleChanged: { msglist.positionViewAtIndex(msglist.count-1,ListView.End) } HMIKeyBoard { id:keyBoard iConfirm: true visible: true newline:true onClickspell: { if(!keyBoard.isPinyin) systemCtrl.setKeyPress(spell) } onHandwriteborad: { keyBoard.visible=false handWrite.visible=true //ADD #105313 2016/12/07 liduo begin bhandwritebar=true //ADD #105313 2016/12/07 liduo end } onCloseKeyBoardSignal: { keyBoardItem.visible=false; bKeyboardVisiable = false //ADD #105313 2016/12/07 liduo begin bhandwritebar=false //ADD #105313 2016/12/07 liduo end } onSearchStart: { keyBoardItem.visible=false; bKeyboardVisiable = false } } HMIHandWrite{ id:handWrite y:0 iConfirm: true visible: false newline:true onKeyborad: { // console.log("#############################################") keyBoard.iType=itype keyBoard.visible=true handWrite.visible=false //ADD #105313 2016/12/07 liduo begin bhandwritebar=false //ADD #105313 2016/12/07 liduo end } onCloseKeyBoardSignal: { keyBoardItem.visible=false; bKeyboardVisiable = false //ADD #105313 2016/12/07 liduo begin bhandwritebar=false //ADD #105313 2016/12/07 liduo end } onSearchStart: { keyBoardItem.visible=false; bKeyboardVisiable = false } } } /*---------------------------------------------Key Board Over----------------------------------------*/ HMIButton { id:answer_btn x:90 y:885 width: 870 height: 72 //add ST_Bug #126526 wudm 2016/12/06 begin //visible:(btCtrl.btPhoneTypeState==0)?true:false enabled:btCtrl.btPhoneTypeState //add ST_Bug #126526 wudm 2016/12/06 end //labelPixelSize: 18 //labelText: qsTr("NEW")+ systemCtrl.emptyString //enabled: !(ScreenManager.isOverlayShowed(WindowsList.BTM_DOWNLOAD)) btnImg:answer_btn.pressed?("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_1_BUTTON_NOSWITCH_P"+bgImageStyle) :("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_1_BUTTON_NOSWITCH"+bgImageStyle) Item { anchors.centerIn: parent //add ST_Bug #126526 wudm 2016/12/06 begin visible: btCtrl.btPhoneTypeState //add ST_Bug #126526 wudm 2016/12/06 end Image { id:answer_image x:-18 y:-25 width: 32 height:32 source: "qrc:MATERIAL/MATERIAL_M8X_ICON_ANSWER"+bgImageStyle } HMILabel { x:-77 y:10 width: 150 height: 28 font.pixelSize: 18 text:qsTr("Answer")+ systemCtrl.emptyString horizontalAlignment: Label.horizontalCenter } } onClicked: { //fod ST_Bug #126526 wudm 2016/12/06 begin if( true == btCtrl.btConnectState &&(btCtrl.btPhoneTypeState==true)) //add ST_Bug #126526 wudm 2016/12/06 begin { keyBoardItem.visible = true icon_Send.visible = true // console.log("BTM_SMS_VIEW-------------icon_Send.visible2="+icon_Send.visible) answer_btn.visible = false input_bar.visible = true bKeyboardVisiable = true answerInput.cursorVisible = true //ADD #105313 2016/12/07 liduo begin if(handWrite.visible==true) bhandwritebar=true if(keyBoard.visible==true) bhandwritebar=false if(handWrite.changecanvas==false){ handWrite.changecanvas=true } //ADD #105313 2016/12/07 liduo end } } } HMIButton { id:icon_Send x:90 //FOD #105313 2016/12/07 liduo begin y:keyBoardItem.visible?(bhandwritebar==true?723:483):885//482:885 //FOD #105313 2016/12/07 liduo end width: 870 height: 72 visible: false //labelPixelSize: 18 //labelText: qsTr("NEW")+ systemCtrl.emptyString //enabled: !(ScreenManager.isOverlayShowed(WindowsList.BTM_DOWNLOAD)) btnImg:icon_Send.pressed?("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_1_BUTTON_NOSWITCH_P"+bgImageStyle) :("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_1_BUTTON_NOSWITCH"+bgImageStyle) Item { anchors.centerIn: parent Image { id:icon_New_image x:-18 y:-25 width: 44//32 height:32 source: "qrc:MATERIAL/MATERIAL_M8X_ICON_SEND-SMS"+bgImageStyle } HMILabel { x:-77 y:10 width: 150 height: 28 font.pixelSize: 18 text:qsTr("Send")+ systemCtrl.emptyString horizontalAlignment: Label.horizontalCenter } } //ADD #F0042 2016/10/14 wangshuang begin HMILabel { id:zishu_geshu x:780 width:60 height:35 visible: btCtrl.btConnectState color:"#A0A0A0" text:shengyuzishu+"/"+duanxingeshu font.pixelSize: 26 horizontalAlignment: Label.AlignLeft anchors.verticalCenter: parent.verticalCenter } //ADD #F0042 2016/10/14 wangshuang begin onClicked: { // console.log("[BTM_SMS_View]---------icon_Send clicked") btCtrl.setBTMsgContent(answerInput.text) answerInput.text = "" keyBoardItem.visible = false bKeyboardVisiable = false input_bar.visible = false answer_btn.visible = true icon_Send.visible = false } } Rectangle { id:unreadToRead color: "#000000" opacity: 0.5 anchors.fill: parent visible: !btCtrl.unreadToReadStatus HMILabel { anchors.fill: parent anchors.horizontalCenter: Label.horizontalCenter anchors.verticalCenter: Label.verticalCenter //FOD #F0122 2016/12/05 wangs begin text: "Loading..." //text: "Loading……" //FOD #F0122 2016/12/05 wangs end } HMIMouseArea { anchors.fill: parent bBeep:false } } Connections { target: btCtrl onBtselectmsgnameChanged: { // console.debug("[BTM_SMS_View.qml]---------------------------onBtselectmsgnameChanged") view_Name.text = btCtrl.getselectmsgname() } onMsgAnswerSend: { if(msg_View_Answer.visible == true) { // console.debug("[BTM_SMS_View.qml]---------------msg_View_Answer.visible == true") btCtrl.getBTMsgDiaListData(btCtrl.getMsgAnswerIndex()) msglist.positionViewAtIndex(msglist.count-1,ListView.End) // console.log("onMsgAnswerSend--················``````````````````-@@@@@@@@@@@@") } else { // console.debug("[BTM_SMS_View.qml]---------------msg_View_Answer.visible == false") } } onBtConnectStatusChanged: { if( false == btCtrl.btConnectState ) { icon_Send.visible = false keyBoardItem.visible = false input_bar.visible = false btCtrl.setselectmsgname("") answer_btn.visible = true systemCtrl.reqSource(Layout.HMI_SRC_AUDIO_TTS,Layout.HMI_SRC_End,Layout.HMI_SRC_Front); if(msg_View_Answer.visible == true) { ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.BTP_HOME) } } } onNewMsgCom: { msglist.positionViewAtIndex(msglist.count-1,ListView.End) // console.log("onNewMsgCom-------------@@@@@@@@@@@@") } onBtOutGoingCallChanged: { // console.log("onBtOutGoingCallChanged-------###################") phoneOutgoing = true btCtrl.btpMsgAnswerSavedState = answerInput.text answerInput.text = "" savebKeyboardvisible=keyBoardItem.visible saveinput_barvisible=input_bar.visible saveanswer_btnvisible=answer_btn.visible saveicon_Sendvisible=icon_Send.visible savecursorvisible=answerInput.cursorVisible } onBtIncommingCallChanged: { btCtrl.btpMsgAnswerSavedState = answerInput.text answerInput.text = "" savebKeyboardvisible=keyBoardItem.visible saveinput_barvisible=input_bar.visible saveanswer_btnvisible=answer_btn.visible saveicon_Sendvisible=icon_Send.visible savecursorvisible=answerInput.cursorVisible } } Connections { target:ScreenManager // onBtHungupPageReset://del by lium for screenchange begin // { // answerInput.text=btCtrl.btpMsgAnswerSavedState //// keyBoardItem.visible = true //// bKeyboardVisiable = true //// input_bar.visible = true //// answer_btn.visible = false //// icon_Send.visible = true //// answerInput.cursorVisible = true // keyBoardItem.visible = savebKeyboardvisible // bKeyboardVisiable = savebKeyboardvisible // input_bar.visible = saveinput_barvisible // answer_btn.visible = saveanswer_btnvisible // icon_Send.visible = saveicon_Sendvisible // answerInput.cursorVisible = savecursorvisible // answerInput.cursorPosition = answerInput.text.length // }//del by lium for screenchange end } }