forked from CollaboraOnline/online
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cool-api.html
2039 lines (1842 loc) · 52.2 KB
/
cool-api.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<link rel="stylesheet" href="docs/css/normalize.css" />
<link rel="stylesheet" href="docs/css/main.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,300' rel='stylesheet' type='text/css'>
<script src="docs/highlight/highlight.pack.js"></script>
<script src="docs/js/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" href="docs/highlight/styles/github-gist.css" />
</head>
<body class="api-page">
<div class="container">
<h2>COOL API Reference</h2>
<div id="toc" class="clearfix">
<div class="toc-col last-col">
<h4 style="color:red;">COOL API</h4>
<ul>
<li><a href="#cool-initialization">Initialization</a></li>
<li><a href="#cool-general">General</a></li>
<li><a href="#cool-toolbar">Toolbar</a></li>
<li><a href="#cool-page">Page oriented</a></li>
<li><a href="#cool-part">Part oriented</a></li>
<li><a href="#cool-events">Events</a></li>
<li><a href="#cool-object-values">Object values</a></li>
<li><a href="#cool-uno-commands">Uno commands</a></li>
</ul>
</div>
</div>
<!--<a href="#toc" id="back-to-top">↑</a>-->
<hr />
<p>This reference reflects <strong>COOL master</strong>.</p>
<h2 id="cool-cool">COOL</h2>
<h3 id="cool-initialization">Initialization</h3>
<h4>Usage example</h4>
<pre><code class="javascript">
var map = L.map('map', {
doc: 'file:///path/to/document',
server: 'wss://localhost',
documentContainer: 'document-container'
});</code></pre>
<h4 class="left">Creation</h4>
<table data-id='map'>
<tr>
<th>Factory</th>
<th>Description</th>
</tr>
<tr>
<td><code><b>L.map</b>(
<nobr><HTMLElement|String> <i>id</i>,</nobr>
<nobr><<a href="#map-options">Map options</a>> <i>options?</i> )</nobr>
</code></td>
<td>Instantiates a map object given a div element (or its id) and optionally an object literal with map options described below.</td>
</tr>
</table>
<h4>Options</h4>
<h5>These are the options intended to be used for browser, using any additional options from Leaflet might cause some
unexpected behaviour.</h5>
<table data-id='map'>
<tr>
<th>Option</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
<tr>
<td><code><b>doc</b></code></td>
<td><code>String</code></td>
<td><code><span class="literal">undefined</span></code></td>
<td>Document URL, the server should be able to access the document.</td>
</tr>
<tr>
<td><code><b>server</b></code></td>
<td><code>String</code></td>
<td><code><span class="literal">undefined</span></code></td>
<td>The websocket server hosting coolwsd using the <code>ws:</code> protocol.
Example: wss://localhost:9980</td>
</tr>
<tr>
<td><code><b>webserver</b></code></td>
<td><code>String</code></td>
<td><code><span class="literal">undefined</span></code></td>
<td>The webserver access to hosting coolwsd. Normally it is
derived from 'server', but can be overridden with an own
value in case of proxying. Example: http://localhost:9980</td>
</tr>
<tr>
<td><code><b>permission</b></code></td>
<td><code>String</code></td>
<td><code><span class="literal">'view'</span></code></td>
<td>The document's <a href="#documentpermission-values">permission</a>.</td>
</tr>
<tr>
<td><code><b>timestamp</b></code></td>
<td><code>String</code></td>
<td><code><span class="literal">undefined</span></code></td>
<td>A timestamp of the last modification to the document.</td>
</tr>
<tr>
<td><code><b>documentContainer</b></code></td>
<td><code>String / DOM element</code></td>
<td><code><span class="literal">undefined</span></code></td>
<td>An outer div, containing the map div, that is used internally for the creation of the toolbar.</td>
</tr>
<tr>
<td><code><b>toolbarContainer</b></code></td>
<td><code>String / DOM element</code></td>
<td><code><span class="literal">undefined</span></code></td>
<td>A div used by the default toolbar elements (bold, italic, search, etc.) in browser. If you implement
your own toolbar and use controls that do not require a toolbar (like the dialog or scroll control) you
can ignore this.</td>
</tr>
<tr>
<td><code><b>renderingOptions</b></code></td>
<td><code>Object</code></td>
<td><code><span class="literal">undefined</span></code></td>
<td>Enables the continuous, web view, of the document, see the UNO commands below for this parameter.</td>
</tr>
<tr>
<td><code><b>print</b></code></td>
<td><code>Boolean</code></td>
<td><code><span class="literal">true</span></code></td>
<td>Whether the print handler is active (for Chrome).</td>
</tr>
<tr>
<td><code><b>autoFitWidth</b></code></td>
<td><code>Boolean</code></td>
<td><code><span class="literal">true</span></code></td>
<td>Whether the document is automatically zoomed so that the width fits the viewing area when
the window is resized. The document will not be zoomed in more than map.options.zoom.</td>
</tr>
<tr>
<td><code><b>zoom</b></code></td>
<td><code>Number</code></td>
<td><code><span class="literal">10</span></code></td>
<td>Default zoom level in which the document will be loaded.</td>
</tr>
<tr>
<td><code><b>tileWidthTwips</b></code></td>
<td><code>Number</code></td>
<td><code><span class="literal">3840</span></code></td>
<td>Default tile width in twips (how much of the document is covered horizontally in a 256x256 pixels tile).
Unless you know what you are doing, this should not be modified;
this means twips value for 256 pixels at 96dpi.</td>
</tr>
<tr>
<td><code><b>tileHeightTwips</b></code></td>
<td><code>Number</code></td>
<td><code><span class="literal">3840</span></code></td>
<td>Default tile height in twips (how much of the document is covered vertically in a 256x256 pixels tile).
Unless you know what you are doing, this should not be modified;
this means twips value for 256 pixels at 96dpi.</td>
</tr>
<tr>
<td><code><b>defaultZoom</b></code></td>
<td><code>Number</code></td>
<td><code><span class="literal">10</span></code></td>
<td>The zoom level at which the tile size in twips equals the default size (3840 x 3840).
Unless you know what you are doing, this should not be modified.</td>
</tr>
<tr>
<td><code><b>cursorURL</b></code></td>
<td><code>String</code></td>
<td><code><span class="literal">undefined</span></code></td>
<td>The path (local to the server) where custom cursor files are stored.</td>
</tr>
</table>
<h3 id="cool-general">General</h3>
<p>General methods for document interaction.</p>
<table data-id='map'>
<tr>
<th>Method</th>
<th>Returns</th>
<th>Description</th>
</tr>
<tr>
<td><code><b>search</b>(
<nobr><String> <i>phrase</i>,</nobr>
<nobr><Boolean> <i>backward?</i> )</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Searches for the given phrase downward from the current top border of the viewing area.
Or backwards if specified.</td>
</tr>
<tr>
<td><code><b>highlightAll</b>(
<nobr><String> <i>phrase</i>,</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Highlights all the occurrences of the given phrase. Please note that
this adds an extra layer for the highlights, so it is possible to
see both all the highlighted phrase, and the current selection at
the same time.</td>
</tr>
<tr>
<td><code><b>setPermission</b>(
<nobr><<a href="#documentpermission-values">DocumentPermissionValues</a>> <i>documenPermission</i>)</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Sets the permission of the document.</td>
</tr>
<tr>
<td><code><b>getDocSize</b>()</code></td>
<td><code><a href="#point">Point</a></code></td>
<td>Returns the document size.</td>
</tr>
<tr>
<td><code><b>getDocType</b>()</code></td>
<td><code><nobr><a href="#documenttype-values">DocumentTypeValues</a></nobr></code></td>
<td>Returns the document type.</td>
</tr>
<tr>
<td><code><b>getPageSizes</b>()</code></td>
<td><code><nobr>{twips: <a href="#bounds">[Bounds]</a>,<br>
pixels: <a href="#bounds">[Bounds]</a>}</nobr></code></td>
<td>Returns an object describing the size of each page in twips and pixels.</td>
</tr>
<tr>
<td><code><b>scroll</b>(
<nobr><Number><i>x</i>,</nobr>
<nobr><Number><i>y</i>,</nobr>
<nobr><<a href="#scroll-options">ScrollOptions</a>><i>Options</i>)</nobr>
</code></td>
<td><code><nobr>undefined</nobr></code></td>
<td>Scroll right by 'x' and down by 'y' (or left and up if negative).</td>
</tr>
<tr>
<td><code><b>scrollDown</b>(
<nobr><Number><i>y</i>,</nobr>
<nobr><<a href="#scroll-options">ScrollOptions</a>><i>Options</i>)</nobr>
</code></td>
<td><code><nobr>undefined</nobr></code></td>
<td>Scroll down by 'y' (or up if negative).</td>
</tr>
<tr>
<td><code><b>scrollRight</b>(
<nobr><Number><i>x</i>,</nobr>
<nobr><<a href="#scroll-options">ScrollOptions</a>><i>Options</i>)</nobr>
</code></td>
<td><code><nobr>undefined</nobr></code></td>
<td>Scroll right by 'x' (or left if negative).</td>
</tr>
<tr>
<td><code><b>scrollTop</b>(
<nobr><Number><i>y</i>,</nobr>
<nobr><<a href="#scroll-options">ScrollOptions</a>><i>Options</i>)</nobr>
</code></td>
<td><code><nobr>undefined</nobr></code></td>
<td>Scroll to 'y' offset relative to the beginning of the document.</td>
</tr>
<tr>
<td><code><b>scrollLeft</b>(
<nobr><Number><i>x</i>,</nobr>
<nobr><<a href="#scroll-options">ScrollOptions</a>><i>Options</i>)</nobr>
</code></td>
<td><code><nobr>undefined</nobr></code></td>
<td>Scroll to 'x' offset relative to the beginning of the document.</td>
</tr>
<tr>
<td><code><b>scrollOffset</b>()</code></td>
<td><code><nobr><a href="#point">Point</a></nobr></code></td>
<td>Returns the scroll offset relative to the beginning of the document.</td>
</tr>
<tr>
<td><code><b>getPreview</b>(
<Object><i>id</i>,<br>
<Number><i>index</i>,<br>
<Number><i>maxWidth</i>,<br>
<Number><i>maxHeight</i>,<br>
<nobr><<a href="#getpreview-options">PreviewOptions</a>><i>options?</i>)</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Triggers the creation of a preview with the given id, of maximum maxWidth X maxHeight size, of the
page / part with number 'index', keeping the original ratio.</td>
</tr>
<tr>
<td><code><b>getCustomPreview</b>(
<Object><i>id</i>,<br>
<Number><i>part</i>,<br>
<Number><i>width</i>,<br>
<Number><i>height</i>,<br>
<Twips><i>tilePosX</i>,<br>
<Twips><i>tilePosY</i>,<br>
<Twips><i>tileWidth</i>,<br>
<Twips><i>tileHeight</i>,<br>
<nobr><<a href="#getpreview-options">PreviewOptions</a>><i>options?</i>)</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Triggers the creation of a preview with the given id, of width X height size, of the
[(tilePosX,tilePosY), (tilePosX + tileWidth, tilePosY + tileHeight)] section of the document.</td>
</tr>
<tr>
<td><code><b>removePreviewUpdate</b>(
<nobr><Object><i>id</i>)</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Cancels the automatic update for the preview defined by 'id'.</td>
</tr>
<tr>
<td><code><b>fitWidthZoom</b>(
<nobr><Number><i>maxZoom</i>)</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Zooms in or out so that the document's width fits the viewing area. The document will not zoom in more
than `maxZoom` if the parameter is provided.</td>
</tr>
</table>
<h4 id="scroll-options">ScrollOptions</h4>
<table data-id='values'>
<tr>
<th class="width100">property</th>
<th class="width100">type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>update</b></code></td>
<td><code>Boolean</code></td>
<td>Whether the <a href="#updatescrolloffset-event">update-scroll-offset</a> event is fired.</td>
</tr>
</table>
<h4 id="getpreview-options">PreviewOptions</h4>
<table data-id='values'>
<tr>
<th class="width100">property</th>
<th class="width100">type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>autoUpdate</b></code></td>
<td><code>Boolean</code></td>
<td>Whether a new preview is generated automatically when it becomes
invalid.</td>
</tr>
<tr>
<td><code><b>broadcast</b></code></td>
<td><code>Boolean</code></td>
<td>Whether new preview should be broadcasted to other clients of same
document.</td>
</tr>
</table>
<h3 id="cool-toolbar">Toolbar</h3>
<p>Toolbar methods.</p>
<table data-id='map'>
<tr>
<th>Method</th>
<th>Returns</th>
<th>Description</th>
</tr>
<tr>
<td><code><b>getToolbarCommandValues</b>(
<nobr><<a href="#toolbarcommand-values">ToolbarCommandValues</a>> <i>unoCommand</i>)</nobr>
</code></td>
<td><code>Object</code></td>
<td>Returns a JSON mapping of the possible values.</td>
</tr>
<tr>
<td><code><b>toggleCommandState</b>(
<nobr><<a href="#commandstatechanged-values">CommandValues</a>> <i>unoCommand</i>)</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Toggles the state for the given UNO command.</td>
</tr>
<tr>
<td><code><b>saveAs</b>(
<nobr><String><i>url</i>,</nobr>
<nobr><String><i>format?</i>,</nobr>
<nobr><String><i>options?</i>)</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Save the document as "format" at the given URL by applying the filter options.</td>
</tr>
<tr>
<td><code><b>downloadAs</b>(
<nobr><String><i>name</i>,</nobr>
<nobr><String><i>format?</i>,</nobr>
<nobr><String><i>options?</i>)</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Download the document as "format" with the name "name" by applying the filter options.</td>
</tr>
<tr>
<td><code><b>print</b>()</code></td>
<td><code>undefined</code></td>
<td>Opens the browser's print dialog or prompts the user to download a PDF version of the document.</td>
</tr>
<tr>
<td><code><b>cellEnterString</b>(
<nobr><String><i>formula</i>)</nobr></code></td>
<td><code>undefined</code></td>
<td>Enters a string of text in the selected cell.</td>
</tr>
<tr>
<td><code><b>insertFile</b>(
<nobr><File><i>file</i>)</nobr></code></td>
<td><code>undefined</code></td>
<td>Insert a file (graphic) in the document.</td>
</tr>
<tr>
<td><code><b>applyFont</b>(
<nobr><String><i>fontName</i>)</nobr></code></td>
<td><code>undefined</code></td>
<td>Applies a font.</td>
</tr>
<tr>
<td><code><b>applyFontSize</b>(
<nobr><Number><i>fontSize</i>)</nobr></code></td>
<td><code>undefined</code></td>
<td>Applies a font size.</td>
</tr>
<tr>
<td><code><b>applyStyle</b>(
<nobr><String><i>style</i>,</nobr>
<nobr><String><i>styleFamily</i>)</nobr></code></td>
<td><code>undefined</code></td>
<td>Applies a style from a style family.</td>
</tr>
<tr>
<td><code><b>renderFont</b>(
<nobr><String><i>fontName</i>)</nobr></code></td>
<td><code>undefined</code></td>
<td>Renders the given font in the smallest rectangle it can fit in.</td>
</tr>
<tr>
<td><code><b>sendUnoCommand</b>(
<nobr><<a href="#cool-uno-commands">String</a>> <i>unoCommand</i>,</nobr>
<nobr><<a href="#cool-uno-commands">Object</a>> <i>param</i>)</nobr></code></td>
<td><code>undefined</code></td>
<td>Sends a <a href="#cool-uno-commands">uno command</a> with the given parameter to LOKit.</td>
</tr>
</table>
<h3 id="cool-page">Page oriented</h3>
<p>Methods for page oriented documents.</p>
<table data-id='map'>
<tr>
<th>Method</th>
<th>Returns</th>
<th>Description</th>
</tr>
<tr>
<td><code><b>getCurrentPageNumber</b>()</code></td>
<td><code>Number</code></td>
<td>Number of the current page.</td>
</tr>
<tr>
<td><code><b>getNumberOfPages</b>()</code></td>
<td><code>Number</code></td>
<td>Total number of pages.</td>
</tr>
<tr>
<td><code><b>goToPage</b>(
<nobr><Number><i>pageNumber</i>)</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Scrolls to the beginning of the given page.</td>
</tr>
</table>
<h3 id="cool-part">Part oriented</h3>
<p>Methods for page oriented documents.</p>
<table data-id='map'>
<tr>
<th>Method</th>
<th>Returns</th>
<th>Description</th>
</tr>
<tr>
<td><code><b>getCurrentPartNumber</b>()</code></td>
<td><code>Number</code></td>
<td>Number of the current part.</td>
</tr>
<tr>
<td><code><b>getNumberOfParts</b>()</code></td>
<td><code>Number</code></td>
<td>Total number of parts.</td>
</tr>
<tr>
<td><code><b>setPart</b>(
<nobr><Number><i>partNumber</i>)</nobr>
</code></td>
<td><code>undefined</code></td>
<td>Select a specific part.</td>
</tr>
</table>
<h3 id="cool-events">Events</h3>
<p>You can subscribe to the following events using <a href="#events">these methods</a>.</p>
<table data-id='map'>
<tr>
<th>Event</th>
<th>Data</th>
<th>Description</th>
</tr>
<tr>
<td><code><b>cellformula</b></code></td>
<td><code><a href="#cellformula-event">CellFormulaEvent</a></code></td>
<td>Fired when the content of the selected cell changes.</td>
</tr>
<tr>
<td><code><b>commandresult</b></code></td>
<td><code><a href="#commandresult-event">CommandResultEvent</a></code></td>
<td>Fired when a dispatched uno command or the 'saveas' command has finished.</td>
</tr>
<tr>
<td><code><b>commandstatechanged</b></code></td>
<td><code><a href="#commandstatechanged-event">CommandStateChangedEvent</a></code></td>
<td>Fired when the state of a command such as .uno:Bold changes.</td>
</tr>
<tr>
<td><code><b>locontextmenu</b></code></td>
<td><code><a href="#locontextmenu-event">LOContextMenuEvent</a></code></td>
<td>Fired when the user's action invoked a context menu (via a
right-click). It contains the structure of the menu.</td>
</tr>
<tr>
<td><code><b>docsize</b></code></td>
<td><code><a href="#docsize-event">DocumentSizeEvent</a></code></td>
<td>Fired when the document size changes.</td>
</tr>
<tr>
<td><code><b>error</b></code></td>
<td><code><a href="#error-event">ErrorEvent</a></code></td>
<td>Fired on server or client error.</td>
</tr>
<tr>
<td><code><b>hyperlinkclicked</b></code></td>
<td><code><a href="#hyperlinkclicked-event">HyperlinkClickedEvent</a></code></td>
<td>Fired when the user clicks a hyperlink in the document.</td>
</tr>
<tr>
<td><code><b>pagenumberchanged</b></code></td>
<td><code><a href="#pagenumberchanged-event">PageNumberChangedEvent</a></code></td>
<td>Fired when the number of pages changes.</td>
</tr>
<tr>
<td><code><b>print</b></code></td>
<td><code><a href="#print-event">PrintEvent</a></code></td>
<td>Fired when the URL for the PDF export is ready.</td>
</tr>
<tr>
<td><code><b>renderfont</b></code></td>
<td><code><a href="#renderfont-event">RenderFontEvent</a></code></td>
<td>Fired when the font rendering is ready.</td>
</tr>
<tr>
<td><code><b>search</b></code></td>
<td><code><a href="#search-event">SearchEvent</a></code></td>
<td>Fired when the search result is ready.</td>
</tr>
<tr>
<td><code><b>scrollby</b></code></td>
<td><code><a href="#scrollby-event">ScrollByEvent</a></code></td>
<td>Fired when the document is panned with the keyboard.</td>
</tr>
<tr>
<td><code><b>scrollto</b></code></td>
<td><code><a href="#scrollto-event">ScrollToEvent</a></code></td>
<td>Fired when the cursor goes out of the viewing area.</td>
</tr>
<tr>
<td><code><b>statusindicator</b></code></td>
<td><code><a href="#statusindicator-event">StatusIndicator</a></code></td>
<td>Fired when leaflet is initialized, during document loading or on reconnection.</td>
</tr>
<tr>
<td><code><b>tilepreview</b></code></td>
<td><code><a href="#tilepreview-event">TilePreviewEvent</a></code></td>
<td>Fired when the rendering of a requested preview is ready.</td>
</tr>
<tr>
<td><code><b>updateparts</b></code></td>
<td><code><a href="#updateparts-event">UpdatePartsEvent</a></code></td>
<td>Fired when a new part has been selected.</td>
</tr>
<tr>
<td><code><b>updatepermission</b></code></td>
<td><code><a href="#permission-event">PermissionEvent</a></code></td>
<td>Fired when the document permission changes.</td>
</tr>
<tr>
<td><code><b>updatescrolloffset</b></code></td>
<td><code><a href="#updatescrolloffset-event">UpdateScrollOffsetEvent</a></code></td>
<td>Fired when the document is panned and the scrollbars should be moved along with the document.</td>
</tr>
<tr>
<td><code><b>updatetoolbarcommandvalues</b></code></td>
<td><code><a href="#updatetoolbarcommandvalues-event">UpdateToolbarCommandValuesEvent</a></code></td>
<td>Fired when the document is loaded and contains the available command values for Font, FontSize, Style, etc.</td>
</tr>
</table>
<h4 id="cellformula-event">CellFormulaEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>formula</b></code></td>
<td><code>String</code></td>
<td>The formula from the selected cell.</td>
</tr>
</table>
<h4 id="commandresult-event">CommandResult</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>commandName</b></code></td>
<td><code><a href="#commandstatechanged-values">CommandStateChangedValues</a></code></td>
<td>UNO command or 'saveas'.</td>
</tr>
<tr>
<td><code><b>success</b></code></td>
<td><code>Boolean or undefined</code></td>
<td>Returns the status code of the command execution, or
undefined if the result is not provided, and the command
only indicates that the operation has finished.</td>
</tr>
</table>
<h4 id="commandstatechanged-event">CommandStateChangedEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>commandName</b></code></td>
<td><code><a href="#commandstatechanged-values">CommandStateChangedValues</a></code></td>
<td>UNO command.</td>
</tr>
<tr>
<td><code><b>state</b></code></td>
<td><code><a href="#commandstate-values">CommandStateValues</a></code></td>
<td>UNO command state.</td>
</tr>
</table>
<h4 id="locontextmenu-event">LOContextMenuEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>menu</b></code></td>
<td><code>String</code></td>
<td>List of the menu entries. The structure looks like:<br/>
<code>
{ "text": "label text1", "type": "command", "command": ".uno:Something1", "enabled": "true" },
{ "text": "label text2", "type": "command", "command": ".uno:Something2", "enabled": "false" },
{ "type": "separator" },
{ "text": "label text2", "type": "menu", "menu": [ { ... }, { ... }, ... ] },
...
</code>
</td>
</tr>
</table>
<h4 id="docsize-event">DocumentSizeEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>x</b></code></td>
<td><code>Number</code></td>
<td>Document width in pixels.</td>
</tr>
<tr>
<td><code><b>y</b></code></td>
<td><code>Number</code></td>
<td>Document height in pixels.</td>
</tr>
</table>
<h4 id="error-event">ErrorEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>id</b></code></td>
<td><code>Number</code></td>
<td>Identificator of the error that can be used as indication
of error message to present to the user.</td>
</tr>
<tr>
<td><code><b>msg</b></code></td>
<td><code>String</code></td>
<td>If present, the error message.</td>
</tr>
<tr>
<td><code><b>cmd</b></code></td>
<td><code>String</code></td>
<td>If present, the server command that caused the error.</td>
</tr>
<tr>
<td><code><b>kind</b></code></td>
<td><code>String</code></td>
<td>If present, the kind of error associated with the command.</td>
</tr>
</table>
The <code>id</code> property of ErrorEvent can have the following values:
<table data-id='events'>
<tr>
<th>value</th>
<th>description</th>
</tr>
<tr>
<td><code><b>1</b></code></td>
<td>Internal error. Things still may work to some extent, but
the session becomes unreliable.</td>
</tr>
<tr>
<td><code><b>2</b></code></td>
<td>Document couldn't be loaded.</td>
</tr>
<tr>
<td><code><b>3</b></code></td>
<td>Socket connection error.</td>
</tr>
<tr>
<td><code><b>4</b></code></td>
<td>Socket connection was closed.</td>
</tr>
<tr>
<td><code><b>5</b></code></td>
<td>Document couldn't be saved.</td>
</tr>
</table>
<h4 id="hyperlinkclicked-event">HyperlinkClickedEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>url</b></code></td>
<td><code>String</code></td>
<td>Target URL of the hyperlink that the user clicked in the
document.</td>
</tr>
</table>
<h4 id="pagenumberchanged-event">PageNumberChangedEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>currentPage</b></code></td>
<td><code>Number</code></td>
<td>The current page in the document.</td>
</tr>
<tr>
<td><code><b>pages</b></code></td>
<td><code>Number</code></td>
<td>The number of pages.</td>
</tr>
<tr>
<td><code><b>docType</b></code></td>
<td><code><a href="#documenttype-values">DocumentTypeValues</a></code></td>
<td>The document type.</td>
</tr>
</table>
<h4 id="print-event">PrintEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>url</b></code></td>
<td><code>String</code></td>
<td>An URL for the PDF exported document.</td>
</tr>
</table>
<h4 id="renderfont-event">RenderFontEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>font</b></code></td>
<td><code>String</code></td>
<td>Font name.</td>
</tr>
<tr>
<td><code><b>img</b></code></td>
<td><code>String</code></td>
<td>The image data URL.</td>
</tr>
</table>
<h4 id="search-event">SearchEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>originalPhrase</b></code></td>
<td><code>String</code></td>
<td>The phrase that has been searched for</td>
</tr>
<tr>
<td><code><b>count</b></code></td>
<td><code>Number</code></td>
<td>Number of search results</td>
</tr>
<tr>
<td><code><b>results</b></code></td>
<td><code><a href="#search-result">SearchResult[]</a></code></td>
<td>An array representing the selections of the search results in the document.</td>
</tr>
</table>
<h4 id="scrollby-event">ScrollByEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>x</b></code></td>
<td><code>Number</code></td>
<td>Scroll right by x pixels, or left if negative.</td>
</tr>
<tr>
<td><code><b>y</b></code></td>
<td><code>Number</code></td>
<td>Scroll down by y pixels, or up if negative.</td>
</tr>
</table>
<h4 id="scrollto-event">ScrollToEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>x</b></code></td>
<td><code>Number</code></td>
<td>View's left border position in pixels.</td>
</tr>
<tr>
<td><code><b>y</b></code></td>
<td><code>Number</code></td>
<td>View's top border position in pixels.</td>
</tr>
</table>
<h4 id="statusindicator-event">StatusIndicatorEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>statusType</b></code></td>
<td><code><a href="#statusindicator-values">StatusIndicatorValues</a></code></td>
<td>Status type.</td>
</tr>
<tr>
<td><code><b>value</b></code></td>
<td><code>Number</code></td>
<td>If present, a number for 0 to 100 representing the loading status.</td>
</tr>
</table>
<h4 id="tilepreview-event">TilePreviewEvent</h4>
<table data-id='events'>
<tr>
<th class="width100">property</th>
<th>type</th>
<th>description</th>
</tr>
<tr>
<td><code><b>tile</b></code></td>
<td><code>Image</code></td>
<td>The actual preview.</td>
</tr>
<tr>
<td><code><b>id</b></code></td>
<td><code>Object</code></td>
<td>Preview id.</td>
</tr>
<tr>
<td><code><b>width</b></code></td>
<td><code>Number</code></td>
<td>Image width.</td>
</tr>
<tr>
<td><code><b>height</b></code></td>
<td><code>Number</code></td>
<td>Image height.</td>
</tr>
<tr>
<td><code><b>docType</b></code></td>
<td><code><a href="#documenttype-values">DocumentTypeValues</a></code></td>
<td>The document type.</td>
</tr>
<tr>
<td><code><b>part</b></code></td>
<td><code>Number</code></td>
<td>If the preview is for a whole part.</td>
</tr>
</table>
<h4 id="updateparts-event">UpdatePartsEvent</h4>