summaryrefslogtreecommitdiffstats
path: root/browser/cool-api.html
blob: 23f75b4273b1e8e77ff4a01c0449243a61c1e1d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
<!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">&uarr;</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>&lt;HTMLElement|String&gt; <i>id</i>,</nobr>
			<nobr>&lt;<a href="#map-options">Map options</a>&gt; <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>&lt;String&gt; <i>phrase</i>,</nobr>
			<nobr>&lt;Boolean&gt; <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>&lt;String&gt; <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>&lt;<a href="#documentpermission-values">DocumentPermissionValues</a>&gt; <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>&lt;Number&gt;<i>x</i>,</nobr>
			<nobr>&lt;Number&gt;<i>y</i>,</nobr>
			<nobr>&lt;<a href="#scroll-options">ScrollOptions</a>&gt;<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>&lt;Number&gt;<i>y</i>,</nobr>
			<nobr>&lt;<a href="#scroll-options">ScrollOptions</a>&gt;<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>&lt;Number&gt;<i>x</i>,</nobr>
			<nobr>&lt;<a href="#scroll-options">ScrollOptions</a>&gt;<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>&lt;Number&gt;<i>y</i>,</nobr>
			<nobr>&lt;<a href="#scroll-options">ScrollOptions</a>&gt;<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>&lt;Number&gt;<i>x</i>,</nobr>
			<nobr>&lt;<a href="#scroll-options">ScrollOptions</a>&gt;<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>(
            &lt;Object&gt;<i>id</i>,<br>
			&lt;Number&gt;<i>index</i>,<br>
			&lt;Number&gt;<i>maxWidth</i>,<br>
			&lt;Number&gt;<i>maxHeight</i>,<br>
            <nobr>&lt;<a href="#getpreview-options">PreviewOptions</a>&gt;<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>(
            &lt;Object&gt;<i>id</i>,<br>
			&lt;Number&gt;<i>part</i>,<br>
			&lt;Number&gt;<i>width</i>,<br>
			&lt;Number&gt;<i>height</i>,<br>
			&lt;Twips&gt;<i>tilePosX</i>,<br>
			&lt;Twips&gt;<i>tilePosY</i>,<br>
			&lt;Twips&gt;<i>tileWidth</i>,<br>
			&lt;Twips&gt;<i>tileHeight</i>,<br>
            <nobr>&lt;<a href="#getpreview-options">PreviewOptions</a>&gt;<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>&lt;Object&gt;<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>&lt;Number&gt;<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>&lt;<a href="#toolbarcommand-values">ToolbarCommandValues</a>&gt; <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>&lt;<a href="#commandstatechanged-values">CommandValues</a>&gt; <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>&lt;String&gt;<i>url</i>,</nobr>
            <nobr>&lt;String&gt;<i>format?</i>,</nobr>
			<nobr>&lt;String&gt;<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>&lt;String&gt;<i>name</i>,</nobr>
			<nobr>&lt;String&gt;<i>format?</i>,</nobr>
            <nobr>&lt;String&gt;<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>&lt;String&gt;<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>&lt;File&gt;<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>&lt;String&gt;<i>fontName</i>)</nobr></code></td>
		<td><code>undefined</code></td>
        <td>Applies a font.</td>
	</tr>
	<tr>
		<td><code><b>applyFontSize</b>(
            <nobr>&lt;Number&gt;<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>&lt;String&gt;<i>style</i>,</nobr>
            <nobr>&lt;String&gt;<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>&lt;String&gt;<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>&lt;<a href="#cool-uno-commands">String</a>&gt; <i>unoCommand</i>,</nobr>
			<nobr>&lt;<a href="#cool-uno-commands">Object</a>&gt; <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>&lt;Number&gt;<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>&lt;Number&gt;<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>

<table data-id='events'>
	<tr>
		<th class="width100">property</th>
		<th>type</th>
		<th>description</th>
	</tr>
	<tr>
		<td><code><b>selectedPart</b></code></td>
		<td><code>Number</code></td>
		<td>The currently selected part.</td>
	</tr>
	<tr>
		<td><code><b>parts</b></code></td>
		<td><code>Number</code></td>
		<td>The number of parts in the document.</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>partNames</b></code></td>
		<td><code>String[]</code></td>
		<td>If present, an array containing slides' / spreadsheets' names.</td>
	</tr>
</table>

<h4 id="permission-event">PermissionEvent</h4>

<table data-id='events'>
	<tr>
		<th class="width100">property</th>
		<th>type</th>
		<th>description</th>
	</tr>
	<tr>
		<td><code><b>perm</b></code></td>
		<td><code><a href="#documentpermission-values">DocumentPermission</a></code></td>
		<td>Document permission.</td>
	</tr>
</table>

<h4 id="updatescrolloffset-event">UpdateScrollOffsetEvent</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>Difference in pixels between the document's left border and view's left border.</td>
	</tr>
	<tr>
		<td><code><b>y</b></code></td>
		<td><code>Number</code></td>
		<td>Difference in pixels between the document's top border and view's top border.</td>
	</tr>
</table>

<h4 id="updatetoolbarcommandvalues-event">UpdateToolbarCommandValuesEvent</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="#toolbarcommand-values">ToolbarCommandValues</a></code></td>
		<td>UNO command.</td>
	</tr>
	<tr>
		<td><code><b>commandValues</b></code></td>
		<td><code>Object</code></td>
		<td>JSON mapping of the possible values.</td>
	</tr>
</table>

<h3 id="cool-object-values">Object values</h3>

<p>A list of possible values for different event object properties.</p>

<h4 id="search-result">SearchResult</h4>

<table data-id='values'>
	<tr>
		<th class="width100">property</th>
		<th class="width100">type</th>
		<th>description</th>
	</tr>
	<tr>
		<td><code><b>part</b></code></td>
		<td><code>Number</code></td>
        <td>The part in which the selection lies.</td>
	</tr>
	<tr>
		<td><code><b>rectangles</b></code></td>
        <td><code><a href="#bounds">Bounds[]</a></code></td>
        <td>Selection bounds in pixels.</td>
	</tr>
</table>

<h4 id="documentpermission-values">DocumentPermissionValues</h4>

<table data-id='values'>
	<tr>
		<th class="width100">value</th>
		<th class="width100">type</th>
		<th>description</th>
	</tr>
	<tr>
		<td><code><b>'edit'</b></code></td>
		<td><code>String</code></td>
		<td>The document can be edited, dragging is disabled and mouse selection is active.</td>
	</tr>
	<tr>
		<td><code><b>'view'</b></code></td>
		<td><code>String</code></td>
		<td>The document is in viewing mode, dragging is enabled by default and by clicking in it, editing mode is entered.</td>
	</tr>
    <tr>
		<td><code><b>'readonly'</b></code></td>
		<td><code>String</code></td>
		<td>The document is in read-only mode, dragging is enabled by default.</td>
	</tr>
</table>

<h4 id="commandstatechanged-values">CommandStateChangedValues</h4>

<table data-id='values'>
	<tr>
		<th class="width100">value</th>
		<th class="width100">type</th>
		<th>description</th>
	</tr>
	<tr>
		<td><code><b>'.uno:Bold'</b></code></td>
		<td><code>String</code></td>
		<td>Bold.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:Italic'</b></code></td>
		<td><code>String</code></td>
		<td>Italic.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:Underline'</b></code></td>
		<td><code>String</code></td>
		<td>Underline.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:Strikeout'</b></code></td>
		<td><code>String</code></td>
		<td>Strikeout.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:LeftPara'</b></code></td>
		<td><code>String</code></td>
		<td>Align left.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:CenterPara'</b></code></td>
		<td><code>String</code></td>
		<td>Center horizontally.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:RightPara'</b></code></td>
		<td><code>String</code></td>
		<td>Align right.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:JustifyPara'</b></code></td>
		<td><code>String</code></td>
		<td>Justified.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:IncrementIndent'</b></code></td>
		<td><code>String</code></td>
		<td>Increment indent.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:DecrementIndent'</b></code></td>
		<td><code>String</code></td>
		<td>Decrement indent.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:StyleApply'</b></code></td>
		<td><code>String</code></td>
		<td>Style related uno command.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:CharFontName'</b></code></td>
		<td><code>String</code></td>
		<td>Font related uno command.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:FontHeight'</b></code></td>
		<td><code>String</code></td>
		<td>Font size related uno command.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:ModifiedStatus'</b></code></td>
		<td><code>String</code></td>
		<td>If the document is now marked as modified. The value is
			'true' when the document is marked as modified, and
			'false' the user e.g. undoes all the changes or
			saves the document.</td>
	</tr>
</table>

<h4 id="commandstate-values">CommandStateValues</h4>

<table data-id='values'>
	<tr>
		<th class="width100">value</th>
		<th class="width100">type</th>
		<th>description</th>
	</tr>
	<tr>
		<td><code><b>'true'</b></code></td>
		<td><code>String</code></td>
		<td>For '.uno:Bold', '.uno:Italic', etc.</td>
	</tr>
	<tr>
		<td><code><b>'false'</b></code></td>
		<td><code>String</code></td>
		<td>For '.uno:Bold', '.uno:Italic', etc.</td>
	</tr>
	<tr>
		<td><code><b>styleName</b></code></td>
		<td><code>String</code></td>
		<td>For '.uno:StyleApply'.</td>
	</tr>
	<tr>
		<td><code><b>fontName</b></code></td>
		<td><code>String</code></td>
		<td>For '.uno:CharFontName'.</td>
	</tr>
	<tr>
		<td><code><b>fontSize</b></code></td>
		<td><code>String</code></td>
		<td>For '.uno:FontHeight'.</td>
	</tr>
</table>

<h4 id="documenttype-values">DocumentTypeValues</h4>

<table data-id='values'>
	<tr>
		<th class="width100">value</th>
		<th class="width100">type</th>
		<th>description</th>
	</tr>
	<tr>
		<td><code><b>'text'</b></code></td>
		<td><code>String</code></td>
		<td>Text document, usually handled by Writer.</td>
	</tr>
	<tr>
		<td><code><b>'presentation'</b></code></td>
		<td><code>String</code></td>
		<td>Text document, usually handled by Impress.</td>
	</tr>
	<tr>
		<td><code><b>'spreadsheet'</b></code></td>
		<td><code>String</code></td>
		<td>Text document, usually handled by Calc.</td>
	</tr>
	<tr>
		<td><code><b>'drawing'</b></code></td>
		<td><code>String</code></td>
		<td>Text document, usually handled by Draw.</td>
	</tr>
	<tr>
		<td><code><b>'other'</b></code></td>
		<td><code>String</code></td>
		<td>Other document type.</td>
	</tr>
</table>

<h4 id="statusindicator-values">StatusIndicatorValues</h4>

<table data-id='values'>
	<tr>
		<th class="width100">value</th>
		<th class="width100">type</th>
		<th>description</th>
	</tr>
	<tr>
		<td><code><b>'start'</b></code></td>
		<td><code>String</code></td>
		<td>Fired when the progress broadcast is being started.</td>
	</tr>
	<tr>
		<td><code><b>'setvalue'</b></code></td>
		<td><code>String</code></td>
		<td>Set a value between 0 and 100.</td>
	</tr>
	<tr>
		<td><code><b>'finish'</b></code></td>
		<td><code>String</code></td>
		<td>The progress is at 100%.</td>
	</tr>
	<tr>
		<td><code><b>'coolloaded'</b></code></td>
		<td><code>String</code></td>
		<td>Fired when the code has been initialized.</td>
	</tr>
	<tr>
		<td><code><b>'alltilesloaded'</b></code></td>
		<td><code>String</code></td>
		<td>Fired when all empty tiles have been loaded (fired several times).</td>
	</tr>
	<tr>
		<td><code><b>'initializationcomplete'</b></code></td>
		<td><code>String</code></td>
		<td>Fired when everything that is needed for operating on the
		    document is ready: this._docLayer is defined,
		    statusindicatorfinish was received, .uno:StyleApply was
		    received, .uno:CharFontName was received, and
		    updatepermission was received.</td>
	</tr>
</table>

<h4 id="toolbarcommand-values">ToolbarCommandValues</h4>

<table data-id='values'>
	<tr>
		<th class="width100">value</th>
		<th class="width100">type</th>
		<th>description</th>
	</tr>
	<tr>
		<td><code><b>'.uno:StyleApply'</b></code></td>
		<td><code>String</code></td>
		<td>Style related uno command.</td>
	</tr>
	<tr>
		<td><code><b>'.uno:CharFontName'</b></code></td>
		<td><code>String</code></td>
		<td>Font related uno command.</td>
	</tr>
</table>

<h3 id="cool-uno-commands">Uno command</h3>

<p>A list of common uno commands with their additional parameters.</p>
<pre><code class="javascript">map.sendUnoCommand('.uno:Bold')</code></pre>
<pre><code class="javascript">map.sendUnoCommand('.uno:Color',
{
  "Color": {
    "type": "long",
    "value": 16750848
  }
})</code></pre>

<table data-id='values' id='uno-commands-table'>
	<tr>
		<th class="width100">command</th>
		<th class="width100">parameter</th>
		<th>description</th>
	</tr>
</table>


</div>
<script>
	hljs.configure({tabReplace: '    '});
	hljs.initHighlighting();

	(function () {
		if (document.body.className.indexOf('api-page') !== -1) {
			var headers = document.getElementsByTagName('h2');

			for (var i = 0, len = headers.length; i < len; i++) {
				if (headers[i].id) {
					headers[i].onclick = function(e) {
						if (e.offsetX < 0) {
							window.location.hash = '#' + this.id;
						}
					};
				}
			}
		}
	})();
</script>

<script>
var unoCommands = [
{
    header: 'Global operations',
},

{
    uno: '.uno:Redo',
    parameter: null,
    description: 'Redo.'
},

{
    uno: '.uno:Save',
    parameter: null,
    description: 'Save the document.'
},

{
    uno: '.uno:Undo',
    parameter: null,
    description: 'Undo.'
},

{
    header: 'Text formatting',
},

{
    uno: '.uno:BackColor',
    parameter: {
        'BackColor': {
            type: 'long',
            value: 16750848
        }
    },
    description: 'Apply a highlighting color for a text document (the value can be obtained by converting the base 16 color to base 10).'
},

{
    uno: '.uno:CharBackgroundExt',
    parameter: null,
    description: '.uno:CharBackgroundExt is supplementary to .uno:BackColor. When .uno:BackColor is set, Writer turns into a "watercan" mode, where the user directly marks parts of the text with the wanted background color. ' +
                 '.uno:CharBackgroundExt then controls this watercan mode - dispatching it toggles the watercan mode on/off, and also the StateChanged events reflect the on/off mode accordingly.'
},

{
    uno: '.uno:BackgroundColor',
    parameter: {
        'BackgroundColor': {
            type: 'long',
            value: 16750848
        }
    },
    description: 'Apply a highlighting color for a spreadsheet document (the value can be obtained by converting the base 16 color to base 10).'
},

{
    uno: '.uno:Bold',
    parameter: null,
    description: 'Bold.'
},

{
    uno: '.uno:CharBackColor',
    parameter: {
        'CharBackColor': {
            type: 'long',
            value: 16750848
        }
    },
    description: 'Apply a font color for a presentation document (the value can be obtained by converting the base 16 color to base 10).'
},

{
    uno: '.uno:CharFontName',
    parameter: {
        'CharFontName.FamilyName': {
            type: 'string',
            value: 'Arial'
        }
    },
    description: 'Apply font.'
},

{
    uno: '.uno:Color',
    parameter: {
        'Color': {
            type: 'long',
            value: 16750848
        }
    },
    description: 'Apply a font color for a non-text document, like a spreadsheet, presentation, etc (the value can be obtained by converting the base 16 color to base 10).'
},

{
    uno: '.uno:FontColor',
    parameter: {
        'FontColor': {
            type: 'long',
            value: 16750848
        }
    },
    description: 'Apply a font color for a text document (the value can be obtained by converting the base 16 color to base 10).'
},

{
    uno: '.uno:FontHeight',
    parameter: {
        'FontHeight.Height': {
            type: 'float',
            value: '11.5'
        }
    },
    description: 'Apply font size.'
},

{
    uno: '.uno:Italic',
    parameter: null,
    description: 'Italic.'
},

{
    uno: '.uno:OutlineFont',
    parameter: null,
    description: 'Outline.'
},

{
    uno: '.uno:Shadowed',
    parameter: null,
    description: 'Shadowed.'
},

{
    uno: '.uno:SubScript',
    parameter: null,
    description: 'Subscript.'
},

{
    uno: '.uno:SuperScript',
    parameter: null,
    description: 'Superscript.'
},

{
    uno: '.uno:Strikeout',
    parameter: null,
    description: 'Strikeout / strike-through.'
},

{
    uno: '.uno:Underline',
    parameter: null,
    description: 'Underline.'
},

{
    header: 'Paragraph formatting',
},

{
    uno: '.uno:CenterPara',
    parameter: null,
    description: 'Center horizontally.'
},

{
    uno: '.uno:DecrementIndent',
    parameter: null,
    description: 'Decrement paragraph indentation.'
},

{
    uno: '.uno:DefaultBullet',
    parameter: null,
    description: 'Bullets ON/OFF.'
},

{
    uno: '.uno:DefaultNumbering',
    parameter: null,
    description: 'Numbering ON/OFF.'
},

{
    uno: '.uno:IncrementIndent',
    parameter: null,
    description: 'Increment paragraph indentation.'
},

{
    uno: '.uno:JustifyPara',
    parameter: null,
    description: 'Justified.'
},

{
    uno: '.uno:LeftPara',
    parameter: null,
    description: 'Align left.'
},

{
    uno: '.uno:RightPara',
    parameter: null,
    description: 'Align right.'
},

{
    uno: '.uno:SetHyperlink',
    parameter: {
        'Hyperlink.Text': {
            type: 'string',
            value: 'some text'
        },
        'Hyperlink.URL': {
            type: 'string',
            value: 'url'
        }
    },
    description: 'Creates a hyperlink. If Hyperlink.Text is not specified, the hyperlink will be set for the current ' +
                     'selection. Hyperlink.URL can be a web URL or a bookmark from the document.'
},

{
    header: 'Comments',
},

{
    uno: '.uno:DeleteComment',
    parameter: null,
    description: 'Delete comment.'
},

{
    uno: '.uno:InsertAnnotation',
    parameter: {
        'Author': {
            type: 'string',
            value: 'A U Thor'
        }
    },
    description: 'Insert comment.'
},

{
    header: 'Fields',
},

{
    uno: '.uno:InsertPageNumberField',
    parameter: null,
    description: 'Insert Page Number field.'
},

{
    uno: '.uno:InsertPageCountField',
    parameter: null,
    description: 'Insert Page Count field.'
},

{
    uno: '.uno:DateField',
    parameter: null,
    description: 'Insert Date field.'
},

{
    uno: '.uno:TimeField',
    parameter: null,
    description: 'Insert Time field.'
},

{
    uno: '.uno:TitleField',
    parameter: null,
    description: 'Insert Title field.'
},

{
    uno: '.uno:AuthorField',
    parameter: null,
    description: 'Insert Author field.'
},

{
    uno: '.uno:TopicField',
    parameter: null,
    description: 'Insert Topic field.'
},

{
    header: 'Styles',
},

{
    uno: '.uno:DeleteStyle',
    parameter: null,
    description: 'Delete the current style.'
},

{
    uno: '.uno:FormatPaintbrush',
    parameter: null,
    description: 'Copy format of the selected text to another text.'
},

{
    uno: '.uno:ResetAttributes',
    parameter: null,
    description: 'Clear direct formatting.'
},

{
    uno: '.uno:StyleApply',
    parameter: {
        'Style': {
            type: 'string',
            value: 'Title'
        },
        'FamilyName': {
            type: 'string',
            value: 'ParagraphStyles'
        }
    },
    description: 'Apply style from style family.'
},

{
    uno: '.uno:StyleUpdateByExample',
    parameter: null,
    description: 'Update the current style to match the selected text.'
},

{
    header: 'Tables (in a text document)',
},

{
    uno: '.uno:InsertColumnsAfter',
    parameter: null,
    description: 'Insert column after the current cursor position.',
},

{
    uno: '.uno:InsertColumnsBefore',
    parameter: null,
    description: 'Insert column before the current cursor position.',
},

{
    uno: '.uno:InsertRowsAfter',
    parameter: null,
    description: 'Insert row after the current cursor position.',
},

{
    uno: '.uno:InsertRowsBefore',
    parameter: null,
    description: 'Insert row before the current cursor position.',
},

{
    uno: '.uno:InsertTable',
    parameter: {
	'Columns': {
		'type': 'long',
		'value': 6
	},
	'Rows': {
		'type': "long",
		'value': 10
	}
    },
    description: 'Insert table with the given dimensions.'
},

{
    uno: '.uno:DeleteTable',
    parameter: null,
    description: 'Delete table at the current cursor position.'
},

{
    uno: '.uno:DeleteColumns',
    parameter: null,
    description: 'Delete the current column.'
},

{
    uno: '.uno:DeleteRows',
    parameter: null,
    description: 'Delete the current row.'
},

{
    header: 'Tables (in presentations)',
},

{
    uno: '.uno:InsertColumns',
    parameter: null,
    description: 'Insert column after the current cursor position.',
},

{
    uno: '.uno:InsertRows',
    parameter: null,
    description: 'Insert row after the current cursor position.',
},

{
    uno: '.uno:InsertTable',
    parameter: {
	'Columns': {
		'type': 'long',
		'value': 6
	},
	'Rows': {
		'type': "long",
		'value': 10
	}
    },
    description: 'Insert table with the given dimensions.'
},

{
    uno: '.uno:DeleteColumns',
    parameter: null,
    description: 'Delete the current column.'
},

{
    uno: '.uno:DeleteRows',
    parameter: null,
    description: 'Delete the current row.'
},

{
    header: 'Text document-related',
},

{
    uno: '.uno:UpdateAllIndexes',
    parameter: null,
    description: 'Update all Table of X (Content etc.)  Useful for general menus / toolbars.'
},

{
    uno: '.uno:UpdateCurIndex',
    parameter: null,
    description: 'Update the current Table of X (Content etc.)  "Current" means the one in where the cursor is located, useful for context menus.'
},

{
    header: 'Spreadsheet-related',
},

{
    uno: '.uno:DeleteColumns',
    parameter: null,
    description: 'Delete the current column.'
},

{
    uno: '.uno:DeleteRows',
    parameter: null,
    description: 'Delete the current row.'
},

{
    uno: '.uno:EnterString',
    parameter: {
        'StringName': {
            type: 'string',
            value: '=SUM()'
        }
    },
    description: 'Enters the string in the selected cell.'
},

{
    uno: '.uno:Insert',
    parameter: {
        'Name': {
            'type': 'string',
            'value': 'Sheet Name'
        },
        'Index': {
            'type': 'long',
            'value': 0
        }
    },
    description: 'Inserts a new sheet to the spreadsheet. The "Name" parameter can be left as empty string, in that case the sheet name will be generated. The "Index" parameter means the position where it should be inserted - "1" means adding as the 1st sheet, etc. 0 is special, and means adding as the last sheet.'
},

{
    uno: '.uno:InsertColumns',
    parameter: null,
    description: 'Insert column after the current cursor position.',
},

{
    uno: '.uno:InsertRows',
    parameter: null,
    description: 'Insert row before the current cursor position.',
},

{
    uno: '.uno:Name',
    parameter: {
        'Name': {
            'type': 'string',
            'value': 'Sheet Name'
        },
        'Index': {
            'type': 'long',
            'value': 1
        }
    },
    description: 'Rename the given sheet in the spreadsheet. The "Index" parameter means the position of the sheet - "1" means the 1st sheet, etc.'
},

{
    uno: '.uno:Remove',
    parameter: {
        'Index': {
            'type': 'long',
            'value': 5
        }
    },
    description: 'Remove the given sheet from the spreadsheet. The "Index" parameter means the position - "1" means the 1st sheet, etc.'
},

{
    uno: '.uno:SortAscending',
    parameter: null,
    description: 'Sort the current selection ascending.'
},

{
    uno: '.uno:SortDescending',
    parameter: null,
    description: 'Sort the current selection descending.'
},

{
    header: 'Presentation-related',
},

{
    uno: '.uno:AssignLayout',
    parameter: {
        'WhatLayout': {
            'type': 'long',
            'value': 19
        }
    },
    description: 'Changes the layout of the current slide.  Possible values of "WhatLayout" are: <ul>' +
	'<li>20 - Blank</li>' +
	'<li>19 - Title</li>' +
	'<li>0 - Title, Text</li>' +
	'<li>1 - Title, Content</li>' +
	'<li>32 - Centered Text</li>' +
	'<li>3 - Title, 2 Content</li>' +
	'<li>12 - Title, Content and 2 Content on Right</li>' +
	'<li>15 - Title, 2 Content on Left and Content</li>' +
	'<li>14 - Title, Content above Content</li>' +
	'<li>16 - Title, 2 Content above Content</li>' +
	'<li>18 - Title, 4 Content</li>' +
	'<li>34 - Title, 6 Content</li>' +
	'<li>28 - Title, Content (Vertical)</li>' +
	'<li>27 - Title, Content over Content (Vertical)</li>' +
	'<li>29 - Title, Vertical Content</li>' +
	'<li>30 - Title, 2 Vertical Content</li></ul>'
},

{
    header: 'Appearance options',
},

{
    uno: '.uno:HideWhitespace',
    parameter: {
        'type': 'boolean',
        'value': 'false'
    },
    description: 'Continuous web view of the document.'
},

{
    uno: '.uno:ShowBorderShadow',
    parameter: {
        'type': 'boolean',
        'value': 'true'
    },
    description: 'Paint a shadow around Write page / Impress slide border.'
},

{
    header: 'Calling Python scripts',
},

{
    uno: 'vnd.sun.star.script:&lt;filename&gt;$&lt;function&gt;?language=Python&location=share',
    parameter: {
                                                               'sheet': {'type': 'string', 'value': 'Sheet1'},
								'x0': {'type': 'long', 'value': 1},
								'y0': {'type': 'long', 'value': 2},
								'width': {'type': 'long', 'value': 3},
								'height': {'type': 'long', 'value': 4},
								'name': {'type': 'string', 'value': 'Alice'}
    },
    description: 'Calls a Python script. The parameter example here are those taken by the DefineNamedRange function in the NamedRanges.py file.'
},

];
$(document).ready(function() {
    var table = $('#uno-commands-table');
    unoCommands.forEach(function (unoCommand) {
	if ('header' in unoCommand) {

            table.append(
                '<tr>' +
                '	<td colspan="3"><b>' + unoCommand.header + '</b></td>' +
                '</tr>');
	}
	else {
            table.append(
                '<tr>' +
                '	<td><code><b>' + unoCommand.uno + '</b></code></td>' +
                '	<td><code><pre>' + JSON.stringify(unoCommand.parameter, null, 2) + '</pre></code></td>' +
                '	<td>' + unoCommand.description + '</td>' +
                '</tr>');
	}
    });
});
</script>

<script type="text/javascript" src="docs/js/docs.js"></script>
</body>
</html>