summaryrefslogtreecommitdiff
path: root/testapp/qml/testapp/WebPageWindow.qml
blob: d2b8c22c2225b8b1e38db004f1af157a95cc1aae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
import QtQuick 2.0
import QtQuick.Controls 1.0

Item {
    id: root
    anchors.fill: parent

    GroupBox {
        id: groupcontrolbuttons
        title: "back()/forward()/reload()/stop()    "
        width: 4 * 130 + 3 * 20 + 3 * 10
        anchors.top: parent.top
        anchors.topMargin: 15
        anchors.left: parent.left
        anchors.leftMargin: 30

        Button {
            id: buttonback
            width: 130
            height: 40
            text: "Back"
            anchors.left: parent.left
            anchors.leftMargin: 10
            onClicked: browserinterface.goBack()
        }
        Button {
            id: buttonforward
            width: 130
            height: buttonback.height
            anchors.top: buttonback.top
            anchors.left: buttonback.right
            anchors.leftMargin: 20
            text: "Forward"
            onClicked: browserinterface.goForward()
        }
        Button {
            id: buttonreload
            width: 130
            height: buttonback.height
            anchors.top: buttonback.top
            anchors.left: buttonforward.right
            anchors.leftMargin: 20
            text: "Reload"
            onClicked: browserinterface.reload()
        }
        Button {
            id: buttonstop
            width: 130
            height: buttonback.height
            anchors.top: buttonback.top
            anchors.left: buttonreload.right
            anchors.leftMargin: 20
            text: "Stop"
            onClicked: browserinterface.stop()
        }
    }

    GroupBox {
        id: groupload
        title: "load(const QString &a_Url)"
        width: 400 + 130 + 20 + 30
        anchors.top: groupcontrolbuttons.bottom
        anchors.topMargin: 10
        anchors.left: groupcontrolbuttons.left

        TextField {
            id: inputfieldurl
            width: 400
            height: 40
            anchors.left: parent.left
            anchors.leftMargin: 10
            font.pixelSize: 16
            text: "http://"
        }
        Text {
            text: "url"
            anchors.top: inputfieldurl.bottom
            anchors.left: inputfieldurl.left
        }
        Button {
            width: 130
            height: inputfieldurl.height
            anchors.top: inputfieldurl.top
            anchors.left: inputfieldurl.right
            anchors.leftMargin: 20
            text: "Load Url"
            onClicked: browserinterface.loadurl(inputfieldurl.text)
        }
    }

    GroupBox {
        id: groupgeturl
        x: 30
        y: 198
        width: 400 + 130 + 20 + 30
        anchors.leftMargin: 0
        anchors.top: groupload.bottom
        anchors.topMargin: 10
        title: "getUrl()"
        Text {
            id: inputfieldgeturl
            width: 400
            height: 40
            text: ""
            font.pixelSize: 16
            anchors.leftMargin: 10
            anchors.left: parent.left
        }

        Button {
            width: 130
            height: inputfieldgeturl.height
            text: "Retrieve Url"
            anchors.leftMargin: 20
            anchors.top: inputfieldgeturl.top
            anchors.left: inputfieldgeturl.right
            onClicked: {
                inputfieldgeturl.text = browserinterface.getUrl()
            }
        }
        anchors.left: groupcontrolbuttons.left
    }

    GroupBox {
        id: groupgettitle
        x: 30
        y: 290
        width: 400 + 130 + 20 + 30
        anchors.leftMargin: 0
        anchors.top: groupgeturl.bottom
        anchors.topMargin: 10
        title: "getTitle()"
        Text {
            id: inputfieldgettitle
            width: 400
            height: 40
            text: ""
            font.pixelSize: 16
            anchors.leftMargin: 10
            anchors.left: parent.left
            enabled: false
        }

        Button {
            width: 130
            height: inputfieldgettitle.height
            text: "Retrieve title"
            anchors.leftMargin: 20
            anchors.top: inputfieldgettitle.top
            anchors.left: inputfieldgettitle.right
            onClicked: {
                inputfieldgettitle.text = browserinterface.getTitle()
            }
        }
        anchors.left: groupcontrolbuttons.left
    }
    GroupBox {
        id: groupcontrolbuttons2
        x: 30
        y: 392
        title: "getVisible()/getGeometry()/getContentSize()/getBrowserActionsState()    "
        width: 4 * 130 + 3 * 20 + 30
        anchors.leftMargin: 0
        anchors.top: groupgettitle.bottom
        anchors.topMargin: 10
        anchors.left: groupload.left

        Button {
            id: buttongetvisible
            width: 130
            height: 40
            anchors.left: parent.left
            anchors.leftMargin: 10
            text: "Get Visible"
            onClicked: browserinterface.getVisible()
        }

        Button {
            id: buttongetgeometry
            width: 130
            height: buttongetvisible.height
            anchors.top: buttongetvisible.top
            anchors.left: buttongetvisible.right
            anchors.leftMargin: 20
            text: "Get Geometry"
            onClicked: browserinterface.getGeometry()
        }

        Button {
            id: buttongetcontentsize
            width: 130
            height: buttongetvisible.height
            anchors.top: buttongetgeometry.top
            anchors.left: buttongetgeometry.right
            anchors.leftMargin: 20
            text: "Get ContentSize"
            onClicked: browserinterface.getContentSize()
        }

        Button {
            width: 130
            height: buttongetvisible.height
            anchors.top: buttongetgeometry.top
            anchors.left: buttongetcontentsize.right
            anchors.leftMargin: 20
            text: "Get Browser ActionState"
            onClicked: browserinterface.getBrowserActionState()
        }
    }


    GroupBox {
        id: groupsetgeometry
        title: "setGeometry(conn::brw::Rect & a_sRect)"
        width: 4 * 50 + 130 + 4 * 20 + 30
        anchors.top: groupcontrolbuttons2.bottom
        anchors.topMargin: 10
        anchors.left: groupcontrolbuttons2.left

        TextField {
            id: inputfieldx
            width: 50
            height: 40
            anchors.left: parent.left
            anchors.leftMargin: 10
            font.pixelSize: 16
            maximumLength: 3
            inputMask: "999"
            text: "0"
        }
        Text {
            text: "x"
            anchors.top: inputfieldx.bottom
            anchors.left: inputfieldx.left
        }
        TextField {
            id: inputfieldy
            width: 50
            height: inputfieldx.height
            anchors.top: inputfieldx.top
            anchors.left: inputfieldx.right
            anchors.leftMargin: 20
            font.pixelSize: 16
            maximumLength: 3
            inputMask: "999"
            text: "0"
        }
        Text {
            text: "y"
            anchors.top: inputfieldy.bottom
            anchors.left: inputfieldy.left
        }
        TextField {
            id: inputfieldwidth
            width: 50
            height: inputfieldx.height
            anchors.top: inputfieldx.top
            anchors.left: inputfieldy.right
            anchors.leftMargin: 20
            font.pixelSize: 16
            maximumLength: 4
            inputMask: "9999"
            text: "1024"
        }
        Text {
            text: "width"
            anchors.top: inputfieldwidth.bottom
            anchors.left: inputfieldwidth.left
        }
        TextField {
            id: inputfieldheight
            width: 50
            height: inputfieldx.height
            anchors.top: inputfieldx.top
            anchors.left: inputfieldwidth.right
            anchors.leftMargin: 20
            font.pixelSize: 16
            inputMask: "999"
            text: "688"
        }
        Text {
            text: "height"
            anchors.top: inputfieldheight.bottom
            anchors.left: inputfieldheight.left
        }
        Button {
            width: 130
            height: inputfieldx.height
            anchors.top: inputfieldx.top
            anchors.left: inputfieldheight.right
            anchors.leftMargin: 20
            text: "Set Geometry"
            onClicked: browserinterface.setGeometry(inputfieldx.text, inputfieldy.text, inputfieldwidth.text, inputfieldheight.text)
        }
    }

    GroupBox {
        id: groupsetvisible
        title: "setVisible(bool a_bVisible)"
        width: 70 + 130 + 20 + 30
        anchors.top: groupcontrolbuttons2.bottom
        anchors.topMargin: 10
        anchors.left: groupsetgeometry.right
        anchors.leftMargin: 10

        ComboBox {
            id: combo
            width: 70
            height: 40
            model: [ "True", "False" ]
            anchors.left: parent.left
            anchors.leftMargin: 10
        }
        Text {
            id: placeholder
            text: ""
            anchors.top: combo.bottom
            anchors.left: combo.left
        }
        Button {
            width: 130
            height: combo.height
            anchors.top: combo.top
            anchors.left: combo.right
            anchors.leftMargin: 20
            text: "Set Visible"
            onClicked: {
                if(combo.currentText == "True")
                    browserinterface.setVisible(true)
                else
                    browserinterface.setVisible(false)
            }
        }
    }

    GroupBox {
        id: groupscroll
        title: "scroll(a_eScrollDirection, a_eScrollType);"
        anchors.top: groupsetgeometry.bottom
        anchors.topMargin: 10
        anchors.left: groupsetgeometry.left

        Image {
            id: buttonleft
            anchors.top: buttonup.bottom
            source: "../../images/draw-triangle1.png"
            MouseArea {
                anchors.fill: parent
                onClicked: browserinterface.goLeft(scrolltype.currentIndex)
            }
        }
        Image {
            id: buttonright
            anchors.left: buttonup.right
            anchors.top: buttonleft.top
            source: "../../images/draw-triangle2.png"
            MouseArea {
                anchors.fill: parent
                onClicked: browserinterface.goRight(scrolltype.currentIndex)
            }
        }
        Image {
            id: buttonup
            anchors.top: parent.top
            anchors.left: buttonleft.right
            source: "../../images/draw-triangle3.png"
            MouseArea {
                anchors.fill: parent
                onClicked: browserinterface.goUp(scrolltype.currentIndex)
            }
        }
        Image {
            id: buttondown
            anchors.left: buttonleft.right
            anchors.top: buttonleft.bottom
            source: "../../images/draw-triangle4.png"
            MouseArea {
                anchors.fill: parent
                onClicked: browserinterface.goDown(scrolltype.currentIndex)
            }
        }
        ComboBox {
            id: scrolltype
            width: 120
            height: 40
            model: [ "ST_SYMBOL", "ST_PAGE", "ST_LINK" ]
            anchors.left: buttonright.right
            anchors.leftMargin: 20
            anchors.verticalCenter: parent.verticalCenter
        }
        Text {
            text: "scroll type"
            anchors.top: scrolltype.bottom
            anchors.left: scrolltype.left
        }

        Button {
            id: buttonSelect
            text: "Click"
            anchors.top: buttonup.bottom
            anchors.topMargin: 0
            anchors.bottom: buttondown.top
            anchors.bottomMargin: 0
            anchors.right: buttonright.left
            anchors.rightMargin: 0
            anchors.left: buttonleft.right
            anchors.leftMargin: 0
            onClicked: browserinterface.select();
        }
    }

    GroupBox {
        id: groupzoom
        y: 6
        anchors.left: groupscroll.right
        anchors.leftMargin: 10
        Button {
            id: buttonZoomPlus
            onClicked: {
                browserinterface.setZoomFactor(
                            browserinterface.getZoomFactor() + 0.1)
            }
            text: "+"
        }

        Button {
        id: buttonZoomMinus
        anchors.leftMargin: 10
        anchors.left: buttonZoomPlus.right
        anchors.top: buttonZoomPlus.top
        text: "-"
        onClicked: {
            browserinterface.setZoomFactor(
                        browserinterface.getZoomFactor() - 0.1)
        }
    }

        Text {
            text: "scroll type"
            anchors.leftMargin: 0
            anchors.topMargin: 0
            anchors.left: parent.left
            anchors.top: buttonZoomPlus.bottom
        }
        anchors.topMargin: 10
        anchors.top: groupsetgeometry.bottom
        title: "set/getZoomFactor(double)"
    }

    GroupBox {
        id: grouppageicon
        x: 536
        y: 543
        width: 164
        height: 150
        anchors.left: groupsetgeometry.right
        anchors.leftMargin: 66
        anchors.top: groupsetvisible.bottom
        anchors.topMargin: 10

        Image {
            id: pageiconimage
            anchors.left: parent.left
            anchors.leftMargin: 5
            anchors.right: parent.right
            anchors.rightMargin: 5
            anchors.top: parent.top
            anchors.topMargin: -1
            anchors.bottom: parent.bottom
            anchors.bottomMargin: 32
        }

        Button {
            id: pageiconbutton
            text: "Fetch image"
            anchors.right: parent.right
            anchors.rightMargin: 0
            anchors.left: parent.left
            anchors.leftMargin: 0
            anchors.top: pageiconimage.bottom
            anchors.topMargin: 10
            anchors.bottom: parent.bottom
            anchors.bottomMargin: 0
        onClicked: {
        pageiconimage.source = browserinterface.getPageIcon("/tmp/");
}
        }
    }
}