forked from dstd/HtmlayoutDelphi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHtmlBehaviorH.pas
More file actions
2647 lines (2179 loc) · 145 KB
/
HtmlBehaviorH.pas
File metadata and controls
2647 lines (2179 loc) · 145 KB
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
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
unit HtmlBehaviorH;
(*
HTMLayout License terms could be found here http://www.terrainformatica.com/htmlayout/prices.whtm
SDK - http://www.terrainformatica.com/htmlayout/HTMLayoutSDK.zip
Delphi binding of HTMLayout published under LGPL. Visit https://github.com/Keksov/HtmlayoutDelphi
This file contains function and types declarations translated from include\htmlayout_behavior.h
Most accurate documentation could be found in include\htmlayout_behavior.h itself
*)
interface
{$IFDEF USER_DEFINES_INC}{$I user_defines.inc}{$ENDIF}
uses SysUtils, Classes, Windows, Contnrs
, HtmlTypes
;
const
// enum EVENT_GROUPS
HANDLE_INITIALIZATION = $0000; (* attached/detached *)
HANDLE_MOUSE = $0001; (* mouse events *)
HANDLE_KEY = $0002; (* key events *)
HANDLE_FOCUS = $0004; (* focus events, if this flag is set it also means that element it attached to is focusable *)
HANDLE_SCROLL = $0008; (* scroll events *)
HANDLE_TIMER = $0010; (* timer event *)
HANDLE_SIZE = $0020; (* size changed event *)
HANDLE_DRAW = $0040; (* drawing request (event) *)
HANDLE_DATA_ARRIVED = $0080; (* requested data () has been delivered *)
HANDLE_BEHAVIOR_EVENT = $0100; (* secondary, synthetic events: BUTTON_CLICK, HYPERLINK_CLICK, etc., a.k.a. notifications from intrinsic behaviors *)
HANDLE_METHOD_CALL = $0200; (* behavior specific methods *)
HANDLE_EXCHANGE = $1000; (* system drag-n-drop *)
HANDLE_GESTURE = $2000; (* touch input events *)
HANDLE_ALL = $FFFF; (* all of them *)
(* disable INITIALIZATION events to be sent. normally engine sends BEHAVIOR_DETACH / BEHAVIOR_ATTACH events unconditionally, this flag allows to disable this behavior *)
DISABLE_INITIALIZATION = $80000000;
ALL_CMD = HANDLE_ALL;
// enum PHASE_MASK, see: http://www.w3.org/TR/xml-events/Overview.html#s_intro
BUBBLING = 0; // bubbling (emersion) phase
SINKING = $08000; // capture (immersion) phase, this flag is or'ed with EVENTS codes below
HANDLED = $10000; // event already processed.
// enum MOUSE_BUTTONS
MAIN_MOUSE_BUTTON = $01; //aka left button
PROP_MOUSE_BUTTON = $02; //aka right button
MIDDLE_MOUSE_BUTTON = $04;
X1_MOUSE_BUTTON = $08;
X2_MOUSE_BUTTON = $10;
// enum KEYBOARD_STATES
CONTROL_KEY_PRESSED = $1;
SHIFT_KEY_PRESSED = $2;
ALT_KEY_PRESSED = $4;
{-- INITIALIZATION ------------------------------------------------------------}
// parameters of evtg == HANDLE_INITIALIZATION
// enum INITIALIZATION_EVENTS
INITIALIZATION_ALL = ALL_CMD; // Delphi specific constant
BEHAVIOR_DETACH = 0;
BEHAVIOR_ATTACH = 1;
{-- MOUSE ---------------------------------------------------------------------}
//enum DRAGGING_TYPE
NO_DRAGGING = 0;
DRAGGING_MOVE = 1;
DRAGGING_COPY = 2;
// parameters of evtg == HANDLE_MOUSE
//enum MOUSE_EVENTS
MOUSE_ALL = ALL_CMD; // Delphi specific constant
MOUSE_ENTER = 0;
MOUSE_LEAVE = 1;
MOUSE_MOVE = 2;
MOUSE_UP = 3;
MOUSE_DOWN = 4;
MOUSE_CLICK = $FF; // mouse click event
MOUSE_DCLICK = 5;
MOUSE_WHEEL = 6;
MOUSE_TICK = 7; // mouse pressed ticks
MOUSE_IDLE = 8; // mouse stay idle for some time
DROP = 9; // item dropped; target is that dropped item
DRAG_ENTER = $A; // drag arrived to the target element that is one of current drop targets.
DRAG_LEAVE = $B; // drag left one of current drop targets. target is the drop target element.
DRAG_REQUEST = $C; // drag src notification before drag start. To cancel - return true from handler.
DRAGGING = $100; // This flag is 'ORed' with MOUSE_ENTER..MOUSE_DOWN codes if dragging operation is in effect.
// E.g. event DRAGGING | MOUSE_MOVE is sent to underlying DOM elements while dragging.
// enum CURSOR_TYPE
CURSOR_ARROW = 0;
CURSOR_IBEAM = 1;
CURSOR_WAIT = 2;
CURSOR_CROSS = 3;
CURSOR_UPARROW = 4;
CURSOR_SIZENWSE = 5;
CURSOR_SIZENESW = 6;
CURSOR_SIZEWE = 7;
CURSOR_SIZENS = 8;
CURSOR_SIZEALL = 9;
CURSOR_NO = 10;
CURSOR_APPSTARTING = 11;
CURSOR_HELP = 12;
CURSOR_HAND = 13;
CURSOR_DRAG_MOVE = 14;
CURSOR_DRAG_COPY = 15;
{-- KEY -----------------------------------------------------------------------}
// parameters of evtg == HANDLE_KEY
// enum KEY_EVENTS
KEY_ALL = ALL_CMD; // Delphi specific constant
KEY_DOWN = 0;
KEY_UP = 1;
KEY_CHAR = 2;
{-- FOCUS ---------------------------------------------------------------------}
// parameters of evtg == HANDLE_FOCUS
// focus event dispatch details:
// First: element that has focus before will get FOCUS_LOST (and its parents will get FOCUS_LOST | SINKING)
// FOCUS_PARAMS.target in this event points to the new focus candidate element.
// FOCUS_PARAMS.cancel at this point can be set to TRUE to canel focus assignment/
// In FOCUS_LOST HTMLayoutGetFocusElement(HWND hwnd, HELEMENT *phe) will return reference to old focus element.
//
// Second: system will set internal variable "current_focus" to the new focus. After that
// HTMLayoutGetFocusElement(HWND hwnd, HELEMENT *phe) will return new focus element
//
// Third: element that is getting focus gets FOCUS_GOT (and its parents will get FOCUS_GOT | SINKING)
// FOCUS_PARAMS.target in this event points to the old focus element.
// FOCUS_PARAMS.cancel has no effect.
// enum FOCUS_EVENTS
FOCUS_ALL = ALL_CMD; // Delphi specific constant
FOCUS_LOST = 0;
FOCUS_GOT = 1;
// enum FOCUS_CAUSE
BY_CODE = 0;
BY_MOUSE = 1;
BY_KEY_NEXT = 2;
BY_KEY_PREV = 3;
{-- SCROLL --------------------------------------------------------------------}
// parameters of evtg == HANDLE_SCROLL
// enum SCROLL_EVENTS
SCROLL_ALL = ALL_CMD; // Delphi specific constant
SCROLL_HOME = 0;
SCROLL_END = 1;
SCROLL_STEP_PLUS = 2;
SCROLL_STEP_MINUS = 3;
SCROLL_PAGE_PLUS = 4;
SCROLL_PAGE_MINUS = 5;
SCROLL_POS = 6;
SCROLL_SLIDER_RELEASED = 7;
{-- GESTURE -------------------------------------------------------------------}
// Gesture events
// enum GESTURE_CMD
GESTURE_ALL = ALL_CMD; // Delphi specific constant
GESTURE_REQUEST = 0; // return true and fill flags if it will handle gestures.
GESTURE_ZOOM = 1; // The zoom gesture.
GESTURE_PAN = 2; // The pan gesture.
GESTURE_ROTATE = 3; // The rotation gesture.
GESTURE_TAP1 = 4; // The tap gesture.
GESTURE_TAP2 = 5; // The two-finger tap gesture.
// enum GESTURE_STATE
GESTURE_STATE_BEGIN = 1; // starts
GESTURE_STATE_INERTIA = 2; // events generated by inertia processor
GESTURE_STATE_END = 4; // end, last event of the gesture sequence
// enum GESTURE_TYPE_FLAGS // requested
GESTURE_FLAG_ZOOM = $0001;
GESTURE_FLAG_ROTATE = $0002;
GESTURE_FLAG_PAN_VERTICAL = $0004;
GESTURE_FLAG_PAN_HORIZONTAL = $0008;
GESTURE_FLAG_TAP1 = $0010; // press & tap
GESTURE_FLAG_TAP2 = $0020; // two fingers tap
GESTURE_FLAG_PAN_WITH_GUTTER = $4000; // PAN_VERTICAL and PAN_HORIZONTAL modifiers
GESTURE_FLAG_PAN_WITH_INERTIA = $8000; //
GESTURE_FLAGS_ALL = $FFFF; //
{-- DRAW ----------------------------------------------------------------------}
// Draw events
DRAW_ALL = ALL_CMD; // Delphi specific constant
DRAW_BACKGROUND = 0;
DRAW_CONTENT = 1;
DRAW_FOREGROUND = 2;
{-- EXCHANGE ------------------------------------------------------------------}
// Exchange events
// enum EXCHANGE_EVENTS
X_DRAG_ENTER = 0;
X_DRAG_LEAVE = 1;
X_DRAG = 2;
X_DROP = 3;
// enum EXCHANGE_DATA_TYPE
EXF_UNDEFINED = 0;
EXF_TEXT = $01; // FETCH_EXCHANGE_DATA will receive UTF8 encoded string - plain text
EXF_HTML = $02; // FETCH_EXCHANGE_DATA will receive UTF8 encoded string - html
EXF_HYPERLINK = $04; // FETCH_EXCHANGE_DATA will receive UTF8 encoded string with pair url\0caption (null separated)
EXF_JSON = $08; // FETCH_EXCHANGE_DATA will receive UTF8 encoded string with JSON literal
EXF_FILE = $10; // FETCH_EXCHANGE_DATA will receive UTF8 encoded list of file names separated by nulls
// enum EXCHANGE_COMMANDS
EXC_ALL = ALL_CMD; // Delphi specific constant
EXC_NONE = 0;
EXC_COPY = 1;
EXC_MOVE = 2;
EXC_LINK = 4;
// enum EVENT_REASON
BY_MOUSE_CLICK = 0;
BY_KEY_CLICK = 1;
SYNTHESIZED = 2; // synthesized, programmatically generated.
// enum EDIT_CHANGED_REASON
BY_INS_CHAR = 3; // single char insertion
BY_INS_CHARS = 4; // character range insertion, clipboard
BY_DEL_CHAR = 5; // single char deletion
BY_DEL_CHARS = 6; // character range deletion (selection)
// identifiers of methods currently supported by intrinsic behaviors,
// see function HTMLayoutCallMethod
{-- BEHAVIOR ------------------------------------------------------------------}
// enum BEHAVIOR_EVENTS, HTMLayoutBehaviorEvents
BEHAVIOR_ALL = ALL_CMD; // Delphi specific constant
BUTTON_CLICK = 0; // click on button
BUTTON_PRESS = 1; // mouse down or key down in button
BUTTON_STATE_CHANGED = 2; // checkbox/radio/slider changed its state/value
EDIT_VALUE_CHANGING = 3; // before text change
EDIT_VALUE_CHANGED = 4; // after text change
SELECT_SELECTION_CHANGED = 5; // selection in <select> changed
SELECT_STATE_CHANGED = 6; // node in select expanded/collapsed, heTarget is the node
POPUP_REQUEST = 7; // request to show popup just received, here DOM of popup element can be modifed.
POPUP_READY = 8; // popup element has been measured and ready to be shown on screen, here you can use functions like ScrollToView.
POPUP_DISMISSED = 9; // popup element is closed, here DOM of popup element can be modifed again - e.g. some items can be removed to free memory.
MENU_ITEM_ACTIVE = $A; // menu item activated by mouse hover or by keyboard,
MENU_ITEM_CLICK = $B; // menu item click,
// BEHAVIOR_EVENT_PARAMS structure layout
// BEHAVIOR_EVENT_PARAMS.cmd - MENU_ITEM_CLICK/MENU_ITEM_ACTIVE
// BEHAVIOR_EVENT_PARAMS.heTarget - the menu item, presumably <li> element
// BEHAVIOR_EVENT_PARAMS.reason - BY_MOUSE_CLICK | BY_KEY_CLICK
CONTEXT_MENU_SETUP = $F; // evt.he is a menu dom element that is about to be shown. You can disable/enable items in it.
CONTEXT_MENU_REQUEST = $10; // "right-click", BEHAVIOR_EVENT_PARAMS::he is current popup menu HELEMENT being processed or NULL.
// application can provide its own HELEMENT here (if it is NULL) or modify current menu element.
VISIUAL_STATUS_CHANGED = $11; // broadcast notification, sent to all elements of some container being shown or hidden
DISABLED_STATUS_CHANGED = $12; // broadcast notification, sent to all elements of some container that got new value of :disabled state
POPUP_DISMISSING = $13; // popup is about to be closed
// "grey" event codes - notfications from behaviors from this SDK
HYPERLINK_CLICK = $80; // hyperlink click
TABLE_HEADER_CLICK = $81; // click on some cell in table header,
// target = the cell,
// reason = index of the cell (column number, 0..n)
TABLE_ROW_CLICK = $82; // click on data row in the table, target is the row
// target = the row,
// reason = index of the row (fixed_rows..n)
TABLE_ROW_DBL_CLICK = $83; // mouse dbl click on data row in the table, target is the row
// target = the row,
// reason = index of the row (fixed_rows..n)
ELEMENT_COLLAPSED = $90; // element was collapsed, so far only behavior:tabs is sending these two to the panels
ELEMENT_EXPANDED = $91; // element was expanded,
ACTIVATE_CHILD = $92; // activate (select) child,
// used for example by accesskeys behaviors to send activation request, e.g. tab on behavior:tabs.
DO_SWITCH_TAB = ACTIVATE_CHILD; // command to switch tab programmatically, handled by behavior:tabs
// use it as HTMLayoutPostEvent(tabsElementOrItsChild, DO_SWITCH_TAB, tabElementToShow, 0);
INIT_DATA_VIEW = $93; // request to virtual grid to initialize its view
ROWS_DATA_REQUEST = $94; // request from virtual grid to data source behavior to fill data in the table
// parameters passed throug DATA_ROWS_PARAMS structure.
UI_STATE_CHANGED = $95; // ui state changed, observers shall update their visual states.
// is sent for example by behavior:richtext when caret position/selection has changed.
FORM_SUBMIT = $96; // behavior:form detected submission event. BEHAVIOR_EVENT_PARAMS::data field contains data to be posted.
// BEHAVIOR_EVENT_PARAMS::data is of type T_MAP in this case key/value pairs of data that is about
// to be submitted. You can modify the data or discard submission by returning TRUE from the handler.
FORM_RESET = $97; // behavior:form detected reset event (from button type=reset). BEHAVIOR_EVENT_PARAMS::data field contains data to be reset.
// BEHAVIOR_EVENT_PARAMS::data is of type T_MAP in this case key/value pairs of data that is about
// to be rest. You can modify the data or discard reset by returning TRUE from the handler.
DOCUMENT_COMPLETE = $98; // behavior:frame have complete document.
HISTORY_PUSH = $99; // behavior:history stuff
HISTORY_DROP = $9A;
HISTORY_PRIOR = $9B;
HISTORY_NEXT = $9C;
HISTORY_STATE_CHANGED = $9D; // behavior:history notification - history stack has changed
CLOSE_POPUP = $9E; // close popup request,
REQUEST_TOOLTIP = $9F; // request tooltip, BEHAVIOR_EVENT_PARAMS.he <- is the tooltip element.
ANIMATION = $A0; // animation started (reason=1) or ended(reason=0) on the element.
FIRST_APPLICATION_EVENT_CODE = $100;
// all custom event codes shall be greater
// than this number. All codes below this will be used
// solely by application - HTMLayout will not intrepret it
// and will do just dispatching.
// To send event notifications with these codes use
// HTMLayoutSend/PostEvent API.
// enum BEHAVIOR_METHOD_IDENTIFIERS
DO_CLICK = 0;
GET_TEXT_VALUE = 1;
SET_TEXT_VALUE = 2;
// p - TEXT_VALUE_PARAMS
TEXT_EDIT_GET_SELECTION = 3;
// p - TEXT_EDIT_SELECTION_PARAMS
TEXT_EDIT_SET_SELECTION = 4;
// p - TEXT_EDIT_SELECTION_PARAMS
// Replace selection content or insert text at current caret position.
// Replaced text will be selected.
TEXT_EDIT_REPLACE_SELECTION = 5;
// p - TEXT_EDIT_REPLACE_SELECTION_PARAMS
// Set value of type="vscrollbar"/"hscrollbar"
SCROLL_BAR_GET_VALUE = 6;
SCROLL_BAR_SET_VALUE = 7;
// get current caret position, it returns rectangle that is relative to origin of the editing element.
TEXT_EDIT_GET_CARET_POSITION= 8;
// p - TEXT_CARET_POSITION_PARAMS
TEXT_EDIT_GET_SELECTION_TEXT= 9; // p - TEXT_SELECTION_PARAMS, OutputStreamProc will receive stream of WCHARs
TEXT_EDIT_GET_SELECTION_HTML= $A; // p - TEXT_SELECTION_PARAMS, OutputStreamProc will receive stream of BYTEs - utf8 encoded html fragment.
TEXT_EDIT_CHAR_POS_AT_XY = $B; // p - TEXT_EDIT_CHAR_POS_AT_XY_PARAMS
IS_EMPTY = $FC; // p - IS_EMPTY_PARAMS // set VALUE_PARAMS::is_empty (false/true) reflects :empty state of the element.
GET_VALUE = $FD; // p - VALUE_PARAMS
SET_VALUE = $FE; // p - VALUE_PARAMS
XCALL = $FF; // p - XCALL_PARAMS
FIRST_APPLICATION_METHOD_ID = $100;
type
HTMLayoutElementCallback = function( he : HELEMENT; param : Pointer ) : BOOL; stdcall;
HTMLayoutPhase = record // see THTMLayoutEvent.phase
code : UINT;
bubbling : boolean;
sinking : boolean;
handled : boolean;
end;
//struct INITIALIZATION_PARAMS
HTMLayoutInitializationParams = record
cmd : UINT; // INITIALIZATION_EVENTS
end;
PHTMLayoutInitializationParams = ^HTMLayoutInitializationParams;
{-- MOUSE ---------------------------------------------------------------------}
//struct MOUSE_PARAMS
HTMLayoutMouseParams = record
cmd : UINT; // MOUSE_EVENTS
target : HELEMENT; // target element
pos : TPOINT; // position of cursor, element relative
pos_document : TPOINT; // position of cursor, document root relative
button_state : UINT; // MOUSE_BUTTONS or MOUSE_WHEEL_DELTA
alt_state : UINT; // KEYBOARD_STATES
cursor_type : UINT; // CURSOR_TYPE to set, see CURSOR_TYPE
is_on_icon : BOOL; // mouse is over icon (foreground-image, foreground-repeat:no-repeat)
dragging : HELEMENT; // element that is being dragged over, this field is not NULL if (cmd & DRAGGING) != 0
dragging_mode : UINT; // see DRAGGING_TYPE.
end;
PHTMLayoutMouseParams = ^HTMLayoutMouseParams;
HTMLayoutMouseCmd = record
case t : byte of
0 : (
phase : HTMLayoutPhase
);
1 : (
code : UINT;
bubbling : boolean;
sinking : boolean;
handled : boolean;
dragging : boolean;
);
end;
{-- KEY -----------------------------------------------------------------------}
// struct KEY_PARAMS
HTMLayoutKeyParams = record
cmd : UINT; // KEY_EVENTS
target : HELEMENT; // target element
key_code : UINT; // key scan code, or character unicode for KEY_CHAR
alt_state : UINT; // KEYBOARD_STATES
end;
PHTMLayoutKeyParams = ^HTMLayoutKeyParams;
{-- FOCUS ---------------------------------------------------------------------}
// struct FOCUS_PARAMS
HTMLayoutFocusParams = record
cmd : UINT; // FOCUS_EVENTS
target : HELEMENT; // target element, for FOCUS_LOST it is a handle of new focus element and for FOCUS_GOT it is a handle of old focus element, can be NULL
by_mouse_click : BOOL; // TRUE if focus is being set by mouse click
cancel : BOOL; // in FOCUS_LOST phase setting this field to TRUE will cancel transfer focus from old element to the new one.
end;
PHTMLayoutFocusParams = ^HTMLayoutFocusParams;
{-- SCROLL --------------------------------------------------------------------}
// struct SCROLL_PARAMS
HTMLayoutScrollParams = record
cmd : UINT; // SCROLL_EVENTS
target : HELEMENT; // target element
pos : integer; // scroll position if SCROLL_POS
vertical : BOOL; // TRUE if from vertical scrollbar
end;
PHTMLayoutScrollParams = ^HTMLayoutScrollParams;
{-- GESTURE -------------------------------------------------------------------}
// struct GESTURE_PARAMS
HTMLayoutGestureParams = record
cmd : UINT; // GESTURE_CMD
target : HELEMENT; // target element
pos : TPOINT; // position of cursor, element relative
pos_view : TPOINT; // position of cursor, view relative
flags : UINT; // for GESTURE_REQUEST combination of GESTURE_FLAGs. for others it is a combination of GESTURE_STATe's
delta_time : UINT; // period of time from previous event.
delta_xy : SIZE; // for GESTURE_PAN it is a direction vector
delta_v : double; // for GESTURE_ROTATE - delta angle (radians) for GESTURE_ZOOM - zoom value, is less or greater than 1.0
end;
PHTMLayoutGestureParams = ^HTMLayoutGestureParams;
{-- DRAW ----------------------------------------------------------------------}
// Use ::GetTextColor(hdc) to get current text color of the element while drawing
HTMLayoutDrawParams = record
cmd : UINT; // DRAW_EVENTS
hdc : HDC; // hdc to paint on
area : TRECT; // element area to paint, for DRAW_BACKGROUND/DRAW_FOREGROUND - it is a border box, for DRAW_CONTENT - it is a content box
reserved : UINT; //
end;
PHTMLayoutDrawParams = ^HTMLayoutDrawParams;
{-- EXCHANGE ------------------------------------------------------------------}
//struct EXCHANGE_PARAMS;
PHTMLayoutExchangeParams = ^HTMLayoutExchangeParams;
//typedef BOOL CALLBACK FETCH_EXCHANGE_DATA(EXCHANGE_PARAMS* params, UINT data_type, LPCBYTE* ppDataStart, UINT* pDataLength );
HTMLayoutFetchExchangeDataCallback = function( params : PHTMLayoutExchangeParams; data_type : UINT; var ppDataStart : PByte; var pDataLength : UINT ) : BOOL; stdcall;
// struct EXCHANGE_PARAMS
HTMLayoutExchangeParams = record
cmd : UINT; // EXCHANGE_EVENTS
target : HELEMENT; // target element
pos : TPOINT; // position of cursor, element relative
pos_view : TPOINT; // position of cursor, view (window) relative
data_types : UINT; // combination of EXCHANGE_DATA_TYPEs above
drag_cmd : UINT; // EXCHANGE_COMMANDS above
fetch_data : HTMLayoutFetchExchangeDataCallback; // function to fetch the data of desired type.
end;
{-- BEHAVIOR ------------------------------------------------------------------}
// struct BEHAVIOR_EVENT_PARAMS
HTMLayoutBehaviorEventParams = record
cmd : UINT; // HTMLayoutBehaviorEvents BEHAVIOR_EVENTS
heTarget : HELEMENT; // target element handler
he : HELEMENT; // source element e.g. in SELECTION_CHANGED it is new selected <option>, in MENU_ITEM_CLICK it is menu item (LI) element
reason : UINT; // EVENT_REASON or EDIT_CHANGED_REASON - UI action causing change. In case of custom event notifications this may be any application specific value.
data : POINTER; // JSON_VALUE; // auxiliary data accompanied with the event. E.g. FORM_SUBMIT event is using this field to pass collection of values.
end;
PHTMLayoutBehaviorEventParams = ^HTMLayoutBehaviorEventParams;
{-- TIMER ---------------------------------------------------------------------}
// struct TIMER_PARAMS
HTMLayoutTimerParams = record
timerId : cardinal; // timerId that was used to create timer by using HTMLayoutSetTimerEx
end;
PHTMLayoutTimerParams = ^HTMLayoutTimerParams;
// struct _METHOD_PARAMS
// struct METHOD_PARAMS
HTMLayoutMethodParams = record
methodID : UINT; // see: #BEHAVIOR_METHOD_IDENTIFIERS
end;
PHTMLayoutMethodParams = ^HTMLayoutMethodParams;
// see HTMLayoutRequestElementData
{-- DATA_ARRIVED --------------------------------------------------------------}
// struct DATA_ARRIVED_PARAMS
HTMLayoutDataArrivedParams = record
initiator : HELEMENT; // element intiator of HTMLayoutRequestElementData request,
data : PByte; // data buffer
dataSize : UINT; // size of data
dataType : UINT; // data type passed "as is" from HTMLayoutRequestElementData
status : UINT; // status = 0 (dataSize == 0) - unknown error.
// status = 100..505 - http response status, Note: 200 - OK!
// status > 12000 - wininet error code, see ERROR_INTERNET_*** in wininet.h
uri : LPCWSTR; // requested url
end;
PHTMLayoutDataArrivedParams = ^HTMLayoutDataArrivedParams;
// request to data source to fill the data.
// used by virtual-grid and virtual list
// struct DATA_ROWS_PARAMS
HTMLayoutDataRowsParams = record
totalRecords : UINT;
firstRecord : UINT; // first visible record - 0..totalRecords
firstRowIdx : UINT; // idx of the first row in the table,
lastRowIdx : UINT; // idx of the last row in the table. content of these rows has to be updated.
end;
PHTMLayoutDataRowsParams = ^HTMLayoutDataRowsParams;
{---------------------------------- THTMLayoutEvent ---------------------------}
HTMLInitializationEventHandler = function( aSender : HELEMENT; aParams : PHTMLayoutInitializationParams; aTag : Pointer ) : boolean of object;
HTMLMouseEventHandler = function( aSender : HELEMENT; aParams : PHTMLayoutMouseParams; aTag : Pointer ) : boolean of object;
HTMLKeyEventHandler = function( aSender : HELEMENT; aParams : PHTMLayoutKeyParams; aTag : Pointer ) : boolean of object;
HTMLFocusEventHandler = function( aSender : HELEMENT; aParams : PHTMLayoutFocusParams; aTag : Pointer ) : boolean of object;
HTMLScrollEventHandler = function( aSender : HELEMENT; aParams : PHTMLayoutScrollParams; aTag : Pointer ) : boolean of object;
HTMLTimerEventHandler = function( aSender : HELEMENT; aParams : PHTMLayoutTimerParams; aTag : Pointer ) : boolean of object;
HTMLSizeEventHandler = function( aSender : HELEMENT; aTag : Pointer ) : boolean of object;
HTMLDrawEventHandler = function( aSender : HELEMENT; aParams : PHTMLayoutDrawParams; aTag : Pointer ) : boolean of object;
HTMLDataArrivedEventHandler = function( aSender : HELEMENT; aParams : PHTMLayoutDataArrivedParams; aTag : Pointer ) : boolean of object;
HTMLBehaviorEventHandler = function( aSender : HELEMENT; aParams : PHTMLayoutBehaviorEventParams; aTag : Pointer ) : boolean of object;
HTMLExchangeEventHandler = function( aSender : HELEMENT; aParams : PHTMLayoutExchangeParams; aTag : Pointer ) : boolean of object;
HTMLGestureEventHandler = function( aSender : HELEMENT; aParams : PHTMLayoutGestureParams; aTag : Pointer ) : boolean of object;
HTMLEventSetProxy = function( aDomElement : HELEMENT; aEventHandler : Pointer ) : BOOL; stdcall;
HTMLEventHandlerProxy = function( aUserData : Pointer; aSender : HELEMENT; aEventGroup : UINT; aEventHandler : Pointer ) : BOOL stdcall;
{***************************************************************************
* THTMLayoutEventHandler
***************************************************************************}
THTMLayoutEventHandler = class
protected
FcssSelector : string;
Fcallback : TMethod;
FuserData : Pointer;
Fcmd : cardinal;
Fsubscription : cardinal;
FhandlerProxy : HTMLEventHandlerProxy;
FallEvents : boolean;
protected
function valid( aDomElement : HELEMENT ) : boolean;
public
constructor Create( aCmd, aSubscription : cardinal; aHandlerProxy : HTMLEventHandlerProxy; const aCssSelector : string; aCallback : TMethod; aUserData : Pointer = nil );
function attach( aDomElement : HELEMENT ) : boolean;
end;
{***************************************************************************
* THTMLayoutEvent
* LightWeight event handling
***************************************************************************}
THTMLayoutEvent = class
protected
// top element in DOM
FdomElement : HELEMENT;
// lits of THTMLayoutEventHandler
Fevents : TObjectList;
private
{-- INITIALIZATION ------------------------------------------------------------}
procedure setOnInitialization( const aCssSelector : string; aUserEventHandler : HTMLInitializationEventHandler );
procedure setOnBehaviorDetach( const aCssSelector : string; aUserEventHandler : HTMLInitializationEventHandler );
procedure setOnBehaviorAttach( const aCssSelector : string; aUserEventHandler : HTMLInitializationEventHandler );
{-- MOUSE ---------------------------------------------------------------------}
procedure setOnMouse( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseEnter( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseLeave( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseMove( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseUp( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseDown( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseClick( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseDClick( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseWheel( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseTick( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseIdle( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnDrop( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnDragEnter( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnDragLeave( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnDragRequest( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseDraggingEnter( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseDraggingLeave( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseDraggingMove( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseDraggingUp( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
procedure setOnMouseDraggingDown( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler );
{-- KEY ----------------------------------------------------------------------}
procedure setOnKey( const aCssSelector : string; aUserEventHandler : HTMLKeyEventHandler );
procedure setOnKeyDown( const aCssSelector : string; aUserEventHandler : HTMLKeyEventHandler );
procedure setOnKeyUp( const aCssSelector : string; aUserEventHandler : HTMLKeyEventHandler );
procedure setOnKeyChar( const aCssSelector : string; aUserEventHandler : HTMLKeyEventHandler );
{-- FOCUS ---------------------------------------------------------------------}
procedure setOnFocus( const aCssSelector : string; aUserEventHandler : HTMLFocusEventHandler );
procedure setOnFocusLost( const aCssSelector : string; aUserEventHandler : HTMLFocusEventHandler );
procedure setOnFocusGot( const aCssSelector : string; aUserEventHandler : HTMLFocusEventHandler );
{-- SCROLL --------------------------------------------------------------------}
procedure setOnScroll( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler );
procedure setOnScrollHome( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler );
procedure setOnScrollEnd( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler );
procedure setOnScrollStepPlus( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler );
procedure setOnScrollStepMinus( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler );
procedure setOnScrollPagePlus( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler );
procedure setOnScrollPageMinus( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler );
procedure setOnScrollPos( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler );
procedure setOnScrollSliderReleased( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler );
{-- TIMER ---------------------------------------------------------------------}
procedure setOnTimer( const aCssSelector : string; aUserEventHandler : HTMLTimerEventHandler );
{-- SIZE ---------------------------------------------------------------------}
procedure setOnSize( const aCssSelector : string; aUserEventHandler : HTMLSizeEventHandler );
{-- HANDLE_DATA_ARRIVED -------------------------------------------------------}
procedure setOnDataArrived( const aCssSelector : string; aUserEventHandler : HTMLDataArrivedEventHandler );
{-- DRAW ----------------------------------------------------------------------}
procedure setOnDraw( const aCssSelector : string; aUserEventHandler : HTMLDrawEventHandler );
procedure setOnDrawBackground( const aCssSelector : string; aUserEventHandler : HTMLDrawEventHandler );
procedure setOnDrawContent( const aCssSelector : string; aUserEventHandler : HTMLDrawEventHandler );
procedure setOnDrawForeground( const aCssSelector : string; aUserEventHandler : HTMLDrawEventHandler );
{-- EXCHANGE ------------------------------------------------------------------}
procedure setOnExchange( const aCssSelector : string; aUserEventHandler : HTMLExchangeEventHandler );
procedure setOnExchangeNone( const aCssSelector : string; aUserEventHandler : HTMLExchangeEventHandler );
procedure setOnExchangeCopy( const aCssSelector : string; aUserEventHandler : HTMLExchangeEventHandler );
procedure setOnExchangeMove( const aCssSelector : string; aUserEventHandler : HTMLExchangeEventHandler );
procedure setOnExchangeLink( const aCssSelector : string; aUserEventHandler : HTMLExchangeEventHandler );
{-- GESTURE -------------------------------------------------------------------}
procedure setOnGesture( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler );
procedure setOnGestureRequest( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler );
procedure setOnGestureZoom( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler );
procedure setOnGesturePan( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler );
procedure setOnGestureRotate( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler );
procedure setOnGestureTap1( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler );
procedure setOnGestureTap2( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler );
{-- BEHAVIOR_EVENT ------------------------------------------------------------}
procedure setOnButtonClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnButtonPress( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnButtonStateChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnEditValueChanging( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnEditValueChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnSelectSelectionChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnSelectStateChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnPopupRequest( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnPopupReady( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnPopupDismissed( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnMenuItemActive( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnMenuItemClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnContextMenuSetup( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnContextMenuRequest( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnVisiualStatusChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnDisabledStatusChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnPopupDismissing( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnHyperLinkClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnTableHeaderClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnTableRowClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnTableRowDblClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnElementCollapsed( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnElementExpanded( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnActivateChild( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnDoSwitchTab( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnInitDataView( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnRowsDataRequest( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnUiStateChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnFormSubmit( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnFormReset( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnDocumentComplete( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnHistoryPush( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnHistoryDrop( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnHistoryPrior( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnHistoryNext( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnHistoryStateChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnClosePopup( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnRequestTooltip( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
procedure setOnAnimation( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler );
protected
procedure addEvent( aEventHandler : THTMLayoutEventHandler );
public
constructor Create(); overload;
constructor Create( aDomElement : HELEMENT ); overload;
destructor Destroy(); override;
class function controlPressed( const aParams : PHTMLayoutKeyParams ) : boolean;
class function altPressed( const aParams : PHTMLayoutKeyParams ) : boolean;
class function shiftPressed( const aParams : PHTMLayoutKeyParams ) : boolean;
class function phase( const aCmd : UINT ) : HTMLayoutPhase;
class function mouseCmd( const aParams : PHTMLayoutMouseParams ) : HTMLayoutMouseCmd;
class function leftPressed( const aParams : PHTMLayoutMouseParams ) : boolean;
class function middlePressed( const aParams : PHTMLayoutMouseParams ) : boolean;
class function rightPressed( const aParams : PHTMLayoutMouseParams ) : boolean;
// List of CSS selectors supported by HTMLayout could be found here http://www.terrainformatica.com/htmlayout/selectors.whtm
// Note: E:last-child Matches element E when E is the last child of its parent.
// aDomElement - could be any element in DOM. Usualy it's root (see. HTMLayoutGetRootElement)
function attach( aDomElement : HELEMENT ) : boolean;
// INITIALIZATION
function addOnInitialization( const aCssSelector : string; aUserEventHandler : HTMLInitializationEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnBehaviorDetach( const aCssSelector : string; aUserEventHandler : HTMLInitializationEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnBehaviorAttach( const aCssSelector : string; aUserEventHandler : HTMLInitializationEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// MOUSE
function addOnMouse( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseEnter( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseLeave( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseMove( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseUp( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseDown( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseClick( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnClick( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler; // same as onMouseClick
function addOnMouseDClick( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnDblClick( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler; // same as onMouseDClick
function addOnMouseDblClick( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler; // same as onMouseDClick
function addOnMouseWheel( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnWheel( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler; // same as onMouseWheel
function addOnMouseTick( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseIdle( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnDrop( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnDragEnter( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnDragLeave( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnDragRequest( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseDraggingEnter( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseDraggingLeave( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseDraggingMove( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseDraggingUp( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMouseDraggingDown( const aCssSelector : string; aUserEventHandler : HTMLMouseEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// KEY
function addOnKey( const aCssSelector : string; aUserEventHandler : HTMLKeyEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnKeyDown( const aCssSelector : string; aUserEventHandler : HTMLKeyEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnKeyUp( const aCssSelector : string; aUserEventHandler : HTMLKeyEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnKeyChar( const aCssSelector : string; aUserEventHandler : HTMLKeyEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// FOCUS
function addOnFocus( const aCssSelector : string; aUserEventHandler : HTMLFocusEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnFocusLost( const aCssSelector : string; aUserEventHandler : HTMLFocusEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnFocusGot( const aCssSelector : string; aUserEventHandler : HTMLFocusEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// SCROLL
function addOnScroll( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnScrollHome( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnScrollEnd( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnScrollStepPlus( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnScrollStepMinus( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnScrollPagePlus( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnScrollPageMinus( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnScrollPos( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnScrollSliderReleased( const aCssSelector : string; aUserEventHandler : HTMLScrollEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// TIMER
function addOnTimer( const aCssSelector : string; aUserEventHandler : HTMLTimerEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// SIZE
function addOnSize( const aCssSelector : string; aUserEventHandler : HTMLSizeEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// DRAW
function addOnDraw( const aCssSelector : string; aUserEventHandler : HTMLDrawEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnDrawBackground( const aCssSelector : string; aUserEventHandler : HTMLDrawEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnDrawContent( const aCssSelector : string; aUserEventHandler : HTMLDrawEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnDrawForeground( const aCssSelector : string; aUserEventHandler : HTMLDrawEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// HANDLE_DATA_ARRIVED
function addOnDataArrived( const aCssSelector : string; aUserEventHandler : HTMLDataArrivedEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// EXCHANGE
function addOnExchange( const aCssSelector : string; aUserEventHandler : HTMLExchangeEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnExchangeNone( const aCssSelector : string; aUserEventHandler : HTMLExchangeEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnExchangeCopy( const aCssSelector : string; aUserEventHandler : HTMLExchangeEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnExchangeMove( const aCssSelector : string; aUserEventHandler : HTMLExchangeEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnExchangeLink( const aCssSelector : string; aUserEventHandler : HTMLExchangeEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// GESTURE
function addOnGesture( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnGestureRequest( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnGestureZoom( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnGesturePan( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnGestureRotate( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnGestureTap1( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnGestureTap2( const aCssSelector : string; aUserEventHandler : HTMLGestureEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// BEHAVIOR_EVENT
function addOnButtonClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnButtonPress( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnButtonStateChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnEditValueChanging( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnEditValueChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnSelectSelectionChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnSelectStateChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnPopupRequest( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnPopupReady( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnPopupDismissed( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMenuItemActive( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnMenuItemClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnContextMenuSetup( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnContextMenuRequest( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnVisiualStatusChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnDisabledStatusChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnPopupDismissing( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
// "grey" event codes - notfications from behaviors from this SDK
function addOnHyperLinkClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnTableHeaderClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnTableRowClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnTableRowDblClick( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnElementCollapsed( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnElementExpanded( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnActivateChild( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnDoSwitchTab( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnInitDataView( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnRowsDataRequest( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnUiStateChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnFormSubmit( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnFormReset( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnDocumentComplete( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnHistoryPush( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnHistoryDrop( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnHistoryPrior( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnHistoryNext( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnHistoryStateChanged( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnClosePopup( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnRequestTooltip( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
function addOnAnimation( const aCssSelector : string; aUserEventHandler : HTMLBehaviorEventHandler; aUserData : Pointer = nil ) : THTMLayoutEventHandler;
public // property
{-- INITIALIZATION ------------------------------------------------------------}
property onInitialization[ const aCssSelector : string ] : HTMLInitializationEventHandler write setOnInitialization;
property onBehaviorDetach[ const aCssSelector : string ] : HTMLInitializationEventHandler write setOnBehaviorDetach;
property onBehaviorAttach[ const aCssSelector : string ] : HTMLInitializationEventHandler write setOnBehaviorAttach;
{-- MOUSE ---------------------------------------------------------------------}
property onMouse[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouse;
property onMouseEnter[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseEnter;
property onMouseLeave[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseLeave;
property onMouseMove[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseMove;
property onMouseUp[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseUp;
property onMouseDown[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseDown;
property onMouseClick[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseClick;
property onClick[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseClick;
property onMouseDClick[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseDClick;
property onMouseDblClick[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseDClick;
property onDblClick[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseDClick;
property onMouseWheel[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseWheel;
property onWheel[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseWheel;
property onMouseTick[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseTick;
property onMouseIdle[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseIdle;
property onDrop[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnDrop;
property onDragEnter[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnDragEnter;
property onDragLeave[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnDragLeave;
property onDragRequest[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnDragRequest;
property onMouseDraggingEnter[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseDraggingEnter;
property onMouseDraggingLeave[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseDraggingLeave;
property onMouseDraggingMove[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseDraggingMove;
property onMouseDraggingUp[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseDraggingUp;
property onMouseDraggingDown[ const aCssSelector : string ] : HTMLMouseEventHandler write setOnMouseDraggingDown;
{-- KEY ----------------------------------------------------------------------}
property onKey[ const aCssSelector : string ] : HTMLKeyEventHandler write setOnKey;
property onKeyDown[ const aCssSelector : string ] : HTMLKeyEventHandler write setOnKeyDown;
property onKeyUp[ const aCssSelector : string ] : HTMLKeyEventHandler write setOnKeyUp;
property onKeyChar[ const aCssSelector : string ] : HTMLKeyEventHandler write setOnKeyChar;
{-- FOCUS ---------------------------------------------------------------------}
property onFocus[ const aCssSelector : string ] : HTMLFocusEventHandler write setOnFocus;
property onFocusLost[ const aCssSelector : string ] : HTMLFocusEventHandler write setOnFocusLost;
property onFocusGot[ const aCssSelector : string ] : HTMLFocusEventHandler write setOnFocusGot;
{-- SCROLL --------------------------------------------------------------------}
property onScroll[ const aCssSelector : string ] : HTMLScrollEventHandler write setOnScroll;
property onScrollHome[ const aCssSelector : string ] : HTMLScrollEventHandler write setOnScrollHome;
property onScrollEnd[ const aCssSelector : string ] : HTMLScrollEventHandler write setOnScrollEnd;
property onScrollStepPlus[ const aCssSelector : string ] : HTMLScrollEventHandler write setOnScrollStepPlus;
property onScrollStepMinus[ const aCssSelector : string ] : HTMLScrollEventHandler write setOnScrollStepMinus;
property onScrollPagePlus[ const aCssSelector : string ] : HTMLScrollEventHandler write setOnScrollPagePlus;
property onScrollPageMinus[ const aCssSelector : string ] : HTMLScrollEventHandler write setOnScrollPageMinus;
property onScrollPos[ const aCssSelector : string ] : HTMLScrollEventHandler write setOnScrollPos;
property onScrollSliderReleased[ const aCssSelector : string ] : HTMLScrollEventHandler write setOnScrollSliderReleased;
{-- TIMER ---------------------------------------------------------------------}
property onTimer[ const aCssSelector : string ] : HTMLTimerEventHandler write setOnTimer;
{-- SIZE ---------------------------------------------------------------------}
property onSize[ const aCssSelector : string ] : HTMLSizeEventHandler write setOnSize;
{-- HANDLE_DATA_ARRIVED -------------------------------------------------------}
property onDataArrived[ const aCssSelector : string ] : HTMLDataArrivedEventHandler write setOnDataArrived;
{-- DRAW ----------------------------------------------------------------------}
property onDraw[ const aCssSelector : string ] : HTMLDrawEventHandler write setOnDraw;
property onDrawBackground[ const aCssSelector : string ] : HTMLDrawEventHandler write setOnDrawBackground;
property onDrawContent[ const aCssSelector : string ] : HTMLDrawEventHandler write setOnDrawContent;
property onDrawForeground[ const aCssSelector : string ] : HTMLDrawEventHandler write setOnDrawForeground;
{-- EXCHANGE ------------------------------------------------------------------}
property onExchange[ const aCssSelector : string ] : HTMLExchangeEventHandler write setOnExchange;
property onExchangeNone[ const aCssSelector : string ] : HTMLExchangeEventHandler write setOnExchangeNone;
property onExchangeCopy[ const aCssSelector : string ] : HTMLExchangeEventHandler write setOnExchangeCopy;
property onExchangeMove[ const aCssSelector : string ] : HTMLExchangeEventHandler write setOnExchangeMove;
property onExchangeLink[ const aCssSelector : string ] : HTMLExchangeEventHandler write setOnExchangeLink;
{-- GESTURE -------------------------------------------------------------------}
property onGesture[ const aCssSelector : string ] : HTMLGestureEventHandler write setOnGesture;
property onGestureRequest[ const aCssSelector : string ] : HTMLGestureEventHandler write setOnGestureRequest;
property onGestureZoom[ const aCssSelector : string ] : HTMLGestureEventHandler write setOnGestureZoom;
property onGesturePan[ const aCssSelector : string ] : HTMLGestureEventHandler write setOnGesturePan;
property onGestureRotate[ const aCssSelector : string ] : HTMLGestureEventHandler write setOnGestureRotate;
property onGestureTap1[ const aCssSelector : string ] : HTMLGestureEventHandler write setOnGestureTap1;
property onGestureTap2[ const aCssSelector : string ] : HTMLGestureEventHandler write setOnGestureTap2;
{-- BEHAVIOR_EVENT ------------------------------------------------------------}
property onButtonClick[ const aCssSelector : string ] : HTMLBehaviorEventHandler write setOnButtonClick;
property onButtonPress[ const aCssSelector : string ] : HTMLBehaviorEventHandler write setOnButtonPress;
property onButtonStateChanged[ const aCssSelector : string ] : HTMLBehaviorEventHandler write setOnButtonStateChanged;
property onEditValueChanging[ const aCssSelector : string ] : HTMLBehaviorEventHandler write setOnEditValueChanging;
property onEditValueChanged[ const aCssSelector : string ] : HTMLBehaviorEventHandler write setOnEditValueChanged;
property onSelectSelectionChanged[ const aCssSelector : string ] : HTMLBehaviorEventHandler write setOnSelectSelectionChanged;
property onSelectStateChanged[ const aCssSelector : string ] : HTMLBehaviorEventHandler write setOnSelectStateChanged;
property onPopupRequest[ const aCssSelector : string ] : HTMLBehaviorEventHandler write setOnPopupRequest;
property onPopupReady[ const aCssSelector : string ] : HTMLBehaviorEventHandler write setOnPopupReady;
property onPopupDismissed[ const aCssSelector : string ] : HTMLBehaviorEventHandler write setOnPopupDismissed;