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("onstestapp/")
16 property string filepath: pri_path + qsTr("vics.qml")
17 property string msgdata: ""
18 property string postmsg: ""
24 text: "OnScreen Test App"
30 anchors.top: title.bottom
32 anchors.horizontalCenter: title.horizontalCenter
34 // show received reply information area
39 Layout.alignment: Qt.AlignCenter
41 TextArea.flickable: TextArea {
43 text: "show received reply information area\n...\n...\n...\n...\n"
45 wrapMode: TextArea.Wrap
48 ScrollBar.vertical: ScrollBar { }
51 // select onscreen type area
53 title: "Please select send OnScreen Type"
58 Layout.alignment: Qt.AlignLeft
68 console.log("clicked:", "VICS")
76 console.log("clicked:", "SYS")
84 console.log("clicked:", "TEL")
92 console.log("clicked:", "MSG")
98 // edit post message area
101 title: "Please input parameter to onscreen"
106 Layout.alignment: Qt.AlignLeft
115 anchors.left: parent.left
116 anchors.leftMargin: 30
125 text: qsTr("tokyo vics information!")
128 anchors.left: dataname1.right
129 anchors.leftMargin: 20
132 inputMethodHints: Qt.ImhNone
134 console.log("OnScreenData1")
146 anchors.left: parent.left
147 anchors.leftMargin: 30
159 anchors.left: dataname2.right
160 anchors.leftMargin: 20
163 inputMethodHints: Qt.ImhNone
165 console.log("OnScreenData2")
177 anchors.left: parent.left
178 anchors.leftMargin: 30
190 anchors.left: dataname3.right
191 anchors.leftMargin: 20
194 inputMethodHints: Qt.ImhNone
196 console.log("OnScreenData3")
209 Layout.alignment: Qt.AlignCenter
211 console.log("poster pressed")
221 anchors.right: parent.right
222 anchors.left: parent.left
223 anchors.bottom: parent.bottom
225 if(!active) { visible = false; }
229 function selectVICS() {
230 filepath = pri_path + "vics.qml";
231 dataname1.text = "info"
232 data1.text = "tokyo vics information!"
238 line4.visible = false
239 line5.visible = false
242 function selectSYS() {
243 filepath = pri_path + "system.qml";
244 dataname1.text = "type"
245 data1.text = "system error"
246 dataname2.text = "text"
247 data2.text = "System Error Occured!"
252 line5.visible = false
255 function selectTEL() {
256 filepath = pri_path + "phone.qml";
257 dataname1.text = "status"
258 data1.text = "Call Answered"
264 line4.visible = false
265 line5.visible = false
268 function selectMSG() {
269 filepath = pri_path + "msg.qml";
270 dataname1.text = "data1"
271 data1.text = "from testApp data1"
272 dataname2.text = "data2"
273 data2.text = "from testApp data2"
274 dataname3.text = "data3"
275 data3.text = "from testApp data3"
281 function postMessage() {
282 postmsg = "{\"file\": \"" + filepath + "\"";
283 if (data1.text != "") {
284 msgdata = "\"" + dataname1.text + "\":\"" + data1.text + "\"";
286 if (data2.text !="") {
289 msgdata += "\"" + dataname2.text + "\":\"" + data2.text + "\"";
291 if (data3.text !="") {
294 msgdata += "\"" + dataname3.text + "\":\"" + data3.text + "\"";
297 postmsg += ",\"data\":{" + msgdata + "}}"
301 eventHandler.showWindow(onsId, postmsg);
304 function qmlOnReplyShowWindow(text) {
305 console.log("onstestapp received:",text);
307 eventHandler.hideWindow(onsId);