2 import QtQuick.Window 2.2
3 import QtQuick.Controls 2.0
4 import QtQuick.Layouts 1.0
5 import QtQuick.VirtualKeyboard 2.1
6 import AGL.Demo.Controls 1.0
14 property string onsId: qsTr("onscreenapp")
15 // property string pri_path: qsTr("/home/0/app-data/OnScreen/qml/")
16 property string pri_path: qmldir
17 property string filepath: pri_path + qsTr("vics.qml")
18 property string msgdata: ""
19 property string postmsg: ""
25 text: "OnScreen Test App"
31 anchors.top: title.bottom
33 anchors.horizontalCenter: title.horizontalCenter
35 // show received reply information area
40 Layout.alignment: Qt.AlignCenter
42 TextArea.flickable: TextArea {
44 text: "show received reply information area\n...\n...\n...\n...\n"
46 wrapMode: TextArea.Wrap
49 ScrollBar.vertical: ScrollBar { }
52 // select onscreen type area
54 title: "Please select send OnScreen Type"
59 Layout.alignment: Qt.AlignLeft
69 console.log("clicked:", "VICS")
77 console.log("clicked:", "SYS")
85 console.log("clicked:", "TEL")
93 console.log("clicked:", "MSG")
99 // edit post message area
102 title: "Please input parameter to onscreen"
107 Layout.alignment: Qt.AlignLeft
116 anchors.left: parent.left
117 anchors.leftMargin: 10
124 text: qsTr("application")
127 anchors.left: guitype.right
128 anchors.leftMargin: 20
136 anchors.left: parent.left
137 anchors.leftMargin: 30
149 anchors.left: qmlpath.right
150 anchors.leftMargin: 20
153 inputMethodHints: Qt.ImhNone
155 console.log("filepath")
166 anchors.left: parent.left
167 anchors.leftMargin: 30
176 text: qsTr("tokyo vics information!")
179 anchors.left: dataname1.right
180 anchors.leftMargin: 20
183 inputMethodHints: Qt.ImhNone
185 console.log("OnScreenData1")
197 anchors.left: parent.left
198 anchors.leftMargin: 30
210 anchors.left: dataname2.right
211 anchors.leftMargin: 20
214 inputMethodHints: Qt.ImhNone
216 console.log("OnScreenData2")
228 anchors.left: parent.left
229 anchors.leftMargin: 30
241 anchors.left: dataname3.right
242 anchors.leftMargin: 20
245 inputMethodHints: Qt.ImhNone
247 console.log("OnScreenData3")
260 Layout.alignment: Qt.AlignCenter
262 console.log("poster pressed")
272 anchors.right: parent.right
273 anchors.left: parent.left
274 anchors.bottom: parent.bottom
276 if(!active) { visible = false; }
280 function selectVICS() {
281 filepath = pri_path + "vics.qml";
282 dataname1.text = "info"
283 data1.text = "tokyo vics information!"
289 line4.visible = false
290 line5.visible = false
293 function selectSYS() {
294 filepath = pri_path + "system.qml";
295 dataname1.text = "type"
296 data1.text = "system error"
297 dataname2.text = "text"
298 data2.text = "System Error Occured!"
303 line5.visible = false
306 function selectTEL() {
307 filepath = pri_path + "phone.qml";
308 dataname1.text = "status"
309 data1.text = "Call Answered"
315 line4.visible = false
316 line5.visible = false
319 function selectMSG() {
320 filepath = pri_path + "msg.qml";
321 dataname1.text = "data1"
322 data1.text = "from testApp data1"
323 dataname2.text = "data2"
324 data2.text = "from testApp data2"
325 dataname3.text = "data3"
326 data3.text = "from testApp data3"
332 function postMessage() {
333 postmsg = "{\"gui\": \"application\", \"file\": \"" + filepath + "\"";
334 if (data1.text != "") {
335 msgdata = "\"" + dataname1.text + "\":\"" + data1.text + "\"";
337 if (data2.text !="") {
340 msgdata += "\"" + dataname2.text + "\":\"" + data2.text + "\"";
342 if (data3.text !="") {
345 msgdata += "\"" + dataname3.text + "\":\"" + data3.text + "\"";
348 postmsg += ",\"data\":{" + msgdata + "}}"
352 eventHandler.showWindow(onsId, postmsg);
355 function qmlOnReplyShowWindow(text) {
356 console.log("onstestapp received:",text);
358 eventHandler.hideWindow(onsId);