lok: be informative and exit when tilebench fails to initialize
[LibreOffice.git] / odk / examples / examples.html
blob4d3a3acff4c9aa83a5cc0aeded7e00b34f889bef
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <!--
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 -->
19 <html>
20 <head>
21 <title>LibreOffice %PRODUCT_RELEASE% SDK - Examples</title>
22 <link rel="stylesheet" type="text/css" href="../docs/sdk_styles.css"/>
23 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
24 </head>
25 <body>
26 <a name="examples"></a>
27 <div id="BgContainer">
28 <div id="Container">
29 <div id="TopHeader">
30 <a id="Logo" href="http://www.libreoffice.org/" title="Go to the Home of LibreOffice and the LibreOffice Community page"></a>
31 <p id="HeaderTagLine">
32 Software Development Kit %PRODUCT_RELEASE%
33 </p>
34 </div>
35 <div class="clear">
36 </div>
37 <div id="Layout">
38 <div class="typography">
39 <h1>
40 Examples
41 </h1>
43 <table class="table1" cellpadding="0">
44 <tr>
45 <td colspan="3"><img class="nothing10" src="../docs/images/nada.gif"/></td>
46 </tr>
47 <tr>
48 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
49 <td>
50 <table class="table2">
51 <tr>
52 <td colspan="3"><img class="nothing1" src="../docs/images/nada.gif"/></td>
53 </tr>
54 <tr>
55 <td>
56 <table class="table3">
57 <tr>
58 <td colspan="3">
59 <p>The SDK provides a rich set of examples in different programming
60 languages (Java, Python, C++, LibreOffice %PRODUCT_RELEASE% Basic, OLE) to illustrate the use
61 of the API and demonstrate how to benefit from the included word
62 processor, spreadsheet, presentation software, graphics program and
63 database of LibreOffice %PRODUCT_RELEASE%.<br/>
64 Some fo the examples need a running office instance listening on a
65 port. If this is necessary you will get further information in the
66 makefiles.</p>
67 <p>Every makefile contains at least one run target to execute an
68 running example, please see the makefile output in the different
69 example directories. Some of the examples which create a component have
70 no run target. In these cases a document is provided which instantiates
71 and runs the component (see the makefile output). Also the Basic
72 examples provide documents which use and shows the implemented
73 functionality.</p>
74 </td>
75 </tr>
76 <tr>
77 <td><img class="line" src="../docs/images/sdk_line-1.gif"/></td>
78 </tr>
79 </table>
80 </td>
81 </tr>
82 <tr>
83 <td>
84 <table class="table3">
85 <tr valign="top">
86 <td class="content3"><img src="../docs/images/arrow-1.gif"/></td>
87 <td><a href="DevelopersGuide/examples.html" title="link to the Developer's Guide examples overview page">Developer's Guide examples</a></td>
88 <td class="content75">The <a href="http://wiki.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide" title="link to the Developer's Guide in the Wiki">Developer's Guide</a> comes
89 with a rich set of examples which demonstrate the use of the API in
90 the different application areas.</td>
91 </tr>
92 <tr valign="top">
93 <td class="content3"><img src="../docs/images/arrow-1.gif"/></td>
94 <td><a href="#Java_examples" title="link to the Java examples section">Java examples</a></td>
95 <td class="content75">Set of simple and more complex examples which
96 shows the use of the API from Java.</td>
97 </tr>
98 <tr valign="top">
99 <td class="content3"><img src="../docs/images/arrow-1.gif"/></td>
100 <td><a href="#python_examples" title="link to the Python examples section">Python examples</a></td>
101 <td class="content75">Small set of examples which shows the use of the API from Python.</td>
102 </tr>
103 <tr valign="top">
104 <td class="content3"><img src="../docs/images/arrow-1.gif"/></td>
105 <td><a href="#Cpp_examples" title="link to the C++ examples section">C++ examples</a></td>
106 <td class="content75">Small set of examples which shows the use of
107 the API from C++.</td>
108 </tr>
109 <tr valign="top">
110 <td class="content3"><img src="../docs/images/arrow-1.gif"/></td>
111 <td><a href="#Basic_examples" title="link to the LibreOffice %PRODUCT_RELEASE% Basic examples section">LibreOffice %PRODUCT_RELEASE% Basic examples</a></td>
112 <td class="content75">Small set of examples which shows the use of
113 the API from LibreOffice %PRODUCT_RELEASE% Basic.</td>
114 </tr>
115 <tr valign="top">
116 <td class="content3"><img src="../docs/images/arrow-1.gif"/></td>
117 <td><a href="#OLE_examples" title="link to the OLE examples section">Object Linking and Embedding (OLE) examples</a></td>
118 <td class="content75">Examples which show the use of the API from OLE.</td>
119 </tr>
120 <tr valign="top">
121 <td class="content3"><img src="../docs/images/arrow-1.gif"/></td>
122 <td><a href="#CLI_examples" title="link to the CLI examples section">Common Language Infrastructure (CLI) examples</a></td>
123 <td class="content75">Examples which show the use of the API from the CLI.</td>
124 </tr>
125 </table></td>
126 </tr>
127 </table>
128 </td>
129 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
130 </tr>
131 <tr>
132 <td colspan="3"><img class="line" src="../docs/images/sdk_line-1.gif"/></td>
133 </tr>
134 <tr>
135 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
136 <td>
137 <table class="table2">
138 <tr>
139 <td>
140 <table class="table3">
141 <tr>
142 <td colspan="2" class="head1"><a name="Java_examples"/>Java examples</td>
143 <td align="right">
144 <a href="#examples" title="link to the examples overview"><img class="navigate" src="../docs/images/nav_up.png"/></a>
145 <a href="../index.html" title="link to the SDK start page"><img class="navigate" src="../docs/images/nav_home.png"/></a>
146 </td>
147 </tr>
148 </table>
149 </td>
150 </tr>
151 <tr>
152 <td>
153 <table class="table4">
154 <tbody>
155 <tr class="thead">
156 <td class="cell20">Text Document Examples</td>
157 <td class="cell80">Description</td>
158 </tr>
159 <tr>
160 <td class="cell20"><a href="java/Text/" title="link to the source directory of the Java Text examples">BookmarkInsertion</a></td>
161 <td class="cell80">This application connects to the office server and
162 gets the <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XMultiComponentFactory.html" title="link into the IDL reference to the interface com.sun.star.lang.XMultiComponentFactory"> multi component factory</a>. An empty text document will be opened
163 and an example text will be entered. Afterwards, some bookmarks will be
164 inserted.</td>
165 </tr>
166 <tr>
167 <td class="cell20"><a href="java/Text/" title="link to the source directory of the Java Text examples">HardFormatting</a></td>
168 <td class="cell80">This program connects to the office server and gets
169 the <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XMultiComponentFactory.html" title="link into the IDL reference to the interface com.sun.star.lang.XMultiComponentFactory"> multi component factory</a>. Furthermore, an empty text document will be
170 opened, an example text will be entered, some text attributes will be
171 inspected, and the <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1beans.html#PropertyState" title="link into the IDL reference to the enum com.sun.star.beans.PropertyState"> PropertyState</a> will be checked from the selection.</td>
172 </tr>
173 <tr>
174 <td class="cell20"><a href="java/Text/" title="link to the source directory of the Java Text examples">SWriter</a></td>
175 <td class="cell80">The program connects to the office server and gets the
176 <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XMultiComponentFactory.html" title="link into the IDL reference to the interface com.sun.star.lang.XMultiComponentFactory"> multi component factory</a>. An empty text document will be created, some
177 text will be entered, and a text table, a colored text, and text frame
178 will be inserted.</td>
179 </tr>
180 <tr>
181 <td class="cell20"><a href="java/Text/" title="link to the source directory of the Java Text examples">StyleCreation</a></td>
182 <td class="cell80">The example connects to the office server and gets the
183 <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XMultiComponentFactory.html" title="link into the IDL reference to the interface com.sun.star.lang.XMultiComponentFactory"> multi component factory</a>. An empty text document will be opened, a new
184 paragraph style will be created, and applied.</td>
185 </tr>
186 <tr>
187 <td class="cell20"><a href="java/Text/" title="link to the source directory of the Java Text examples">StyleInitialization</a></td>
188 <td class="cell80">The program connects to the office server and gets the
189 <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XMultiComponentFactory.html" title="link into the IDL reference to the interface com.sun.star.lang.XMultiComponentFactory"> multi component factory</a>. Thereafter, an empty text document will be
190 opened and an example text will be entered. The paragraph collection will
191 be used, in order to apply a different paragraph style on the
192 paragraphs.</td>
193 </tr>
194 <tr>
195 <td class="cell20"><a href="java/Text/" title="link to the source directory of the Java Text examples">TextDocumentStructure</a></td>
196 <td class="cell80">The application connects to the office server and gets
197 the <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XMultiComponentFactory.html" title="link into the IDL reference to the interface com.sun.star.lang.XMultiComponentFactory"> multi component factory</a>. An empty text document will be opened, an
198 enumeration of all paragraphs and an enumeration of all text portions
199 will be created.</td>
200 </tr>
201 <tr>
202 <td class="cell20"><a href="java/Text/" title="link to the source directory of the Java Text examples">TextReplace</a></td>
203 <td class="cell80">The example connects to the office server and gets the
204 <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XMultiComponentFactory.html" title="link into the IDL reference to the interface com.sun.star.lang.XMultiComponentFactory"> multi component factory</a>. An empty text document will be created, an
205 example text will be inserted, and some English spelled words will be
206 replaced with US spelled words.</td>
207 </tr>
208 <tr>
209 <td class="cell20"><a href="java/Text/" title="link to the source directory of the Java Text examples">GraphicsInserter</a></td>
210 <td class="cell80">The GraphicsInserter creates a graphics object on an
211 empty text document by setting its position, width, height, and URL.</td>
212 </tr>
213 <tr>
214 <td class="cell20"><a href="java/Text/" title="link to the source directory of the Java Text examples">WriterSelector</a></td>
215 <td class="cell80">This class gives you information on the selected
216 objects (text range, text frame, or graphics) at a LibreOffice
217 Server.</td>
218 </tr>
219 </tbody>
220 </table>
221 </td>
222 </tr>
223 <tr>
224 <td>
225 <table class="table4">
226 <tbody>
227 <tr class="thead">
228 <td class="cell20">Spreadsheet Document Examples</td>
229 <td class="cell80">Description</td>
230 </tr>
231 <tr>
232 <td class="cell20"><a href="java/Spreadsheet/" title="link to the source directory of the Java Spreadsheet examples">CalcAddins</a></td>
233 <td class="cell80">This component adds new functions to the spreadsheet
234 application. After registering the component, the inserted functions can
235 be found with help of the functions autopilot. The new functions are
236 assigned to the category <i>Add-in</i>.</td>
237 </tr>
238 <tr>
239 <td class="cell20"><a href="java/Spreadsheet/" title="link to the source directory of the Java Spreadsheet examples">ChartTypeChange</a></td>
240 <td class="cell80">This class loads a LibreOffice %PRODUCT_RELEASE% Calc document and
241 changes the type of the embedded chart.</td>
242 </tr>
243 <tr>
244 <td class="cell20"><a href="java/Spreadsheet/" title="link to the source directory of the Java Spreadsheet examples">EuroAdaption</a></td>
245 <td class="cell80">The application connects to the office server and gets
246 the <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XMultiComponentFactory.html" title="link into the IDL reference to the interface com.sun.star.lang.XMultiComponentFactory"> multi component factory</a>, opens an empty Calc document, enters an
247 example text, sets the number format to DM, changes the number format to
248 EUR (Euro), and uses the DM/EUR factor on each cell with content.</td>
249 </tr>
250 <tr>
251 <td class="cell20"><a href="java/Spreadsheet/" title="link to the source directory of the Java Spreadsheet examples">SCalc</a></td>
252 <td class="cell80">The program connects to the office server and gets the
253 <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XMultiComponentFactory.html" title="link into the IDL reference to the interface com.sun.star.lang.XMultiComponentFactory"> multi component factory</a>. Then an empty calc document will be opened,
254 cell styles will be created, some data will be inserted into the sheets,
255 and the created cell styles will be applied. Finally, a 3D chart will be
256 inserted.</td>
257 </tr>
258 </tbody>
259 </table>
260 </td>
261 </tr>
262 <tr>
263 <td>
264 <table class="table4">
265 <tbody>
266 <tr class="thead">
267 <td class="cell20">Drawing Document Examples</td>
268 <td class="cell80">Description</td>
269 </tr>
270 <tr>
271 <td class="cell20"><a href="java/Drawing/" title="link to the source directory of the Java Drawing examples">SDraw</a></td>
272 <td class="cell80">This program connects to the office server and gets
273 the <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XMultiComponentFactory.html" title="link into the IDL reference to the interface com.sun.star.lang.XMultiComponentFactory"> multi component factory</a>. Afterwards, an empty text document will
274 be created and some shapes will be inserted on the draw page.</td>
275 </tr>
276 </tbody>
277 </table>
278 </td>
279 </tr>
280 <tr>
281 <td>
282 <table class="table4">
283 <tbody>
284 <tr class="thead">
285 <td class="cell20">Document Handling Examples</td>
286 <td class="cell80">Description</td>
287 </tr>
288 <tr>
289 <td class="cell20"><a href="java/DocumentHandling/" title="link to the source directory of the Java DocumentHandling examples">DocumentConverter</a></td>
290 <td class="cell80">The program offers a service that converts arbitrary
291 documents to a favored document type.</td>
292 </tr>
293 <tr>
294 <td class="cell20"><a href="java/DocumentHandling/" title="link to the source directory of the Java DocumentHandling examples">DocumentLoader</a></td>
295 <td class="cell80">The <i>DocumentLoader</i> can open a new or an
296 existing document.</td>
297 </tr>
298 <tr>
299 <td class="cell20"><a href="java/DocumentHandling/" title="link to the source directory of the Java DocumentHandling examples">DocumentPrinter</a></td>
300 <td class="cell80">The <i>DocumentPrinter</i> allows you to print the
301 favored pages of a specified document on your favored printer.</td>
302 </tr>
303 <tr>
304 <td class="cell20"><a href="java/DocumentHandling/" title="link to the source directory of the Java DocumentHandling examples">DocumentSaver</a></td>
305 <td class="cell80">The DocumentSaver shows how to save a document and
306 how you can change the type of your document.</td>
307 </tr>
308 </tbody>
309 </table>
310 </td>
311 </tr>
312 <tr>
313 <td>
314 <table class="table4">
315 <tbody>
316 <tr class="thead">
317 <td class="cell20">UNO Component Examples</td>
318 <td class="cell80">Description</td>
319 </tr>
320 <tr>
321 <td class="cell20"><a href="http://wiki.openoffice.org/wiki/Object_Inspector" title="link to the Object Inspector project page in the wiki">Object Inspector</a></td>
322 <td class="cell80">The Object Inspector is primarily an auxiliary tool
323 for the developer, which can present information about an object of the
324 LibreOffice %PRODUCT_RELEASE% API at run-time. Depending on the object to be inspected,
325 appropriate methods, interfaces, services, and attributes can be displayed
326 to the developer. The methods, interfaces, services and attributes are
327 represented in a predictable tree. If the attributes contained in an
328 object are to be examined, the appropriate nodes in the tree can be
329 expanded with the help of the mouse. For each non primitive object, five
330 categories are offered to the user, as long as those are available with
331 that object. The Object Inspector is currently available as a NetBeans project
332 only because of major code changes. Please see the <a href="http://wiki.openoffice.org/wiki/Object_Inspector" title="link to the Object Inspector project page in the wiki">project page</a> for further details.</td>
333 </tr>
334 <tr>
335 <td class="cell20"><a href="java/MinimalComponent/" title="link to the source directory of the Java MinimalComponent example">MinimalComponent</a></td>
336 <td class="cell80">This class provides a minimal UNO component. You can
337 take this class as a base for your own components. By extensions of this
338 class it is possible to also extend the function range of the Office.</td>
339 </tr>
340 <tr>
341 <td class="cell20"><a href="java/PropertySet/" title="link to the source directory of the Java PropertySet example">PropTest</a></td>
342 <td class="cell80">Contains a component that provides property set
343 interfaces by means of inheriting <a href="%JAVADOC_PREFIX1%/docs/java/ref/com/sun/star/lib/uno/helper/PropertySet.html" title="link into the Java UNO reference to the PropertySet helper class">com.sun.star.lib.uno.helper.ProperterSet</a>.</td>
344 </tr>
345 <tr>
346 <td class="cell20"><a href="java/ToDo/" title="link to the source directory of the Java ToDo example">ToDo</a></td>
347 <td class="cell80">For every to-do listed in a spreadsheet document, this
348 component calculates the start date, day of week of the start date, the
349 end date, and the day of week of the end date. All calculations are
350 dependent upon the values of &quot;Needed Days&quot;, &quot;Due Date&quot;
351 and &quot;Status&quot;. The columns &quot;Needed Days&quot; and
352 &quot;Status&quot; are mandatory. The first to-do should be placed in
353 row nine. The date to start the calculation should be placed in cell C6.
354 The private holidays should be placed in cell K4/K5 and below.<br/>
355 All rows will be calculated up to the first empty cell in the first
356 column. If a cell in the column &quot;Due Date&quot; is colored red,
357 you should take a look at your entries.</td>
358 </tr>
359 <tr>
360 <td class="cell20"><a href="java/EmbedDocument/EmbeddedObject" title="link to the source directory of the Java EmbeddedObject example">EmbeddedObject</a></td>
361 <td class="cell80">Contains a component that provides an example of embedded object implementation.</td>
362 </tr>
363 </tbody>
364 </table>
365 </td>
366 </tr>
367 <tr>
368 <td>
369 <table class="table3">
370 <tr>
371 <td colspan="3">
372 <p>Additional information:</p>
374 <a href="http://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Simple_Component_in_Java" title="link to the &quot;Simple component in Java&quot; chapter in the Developer's Guide">How to write a UNO component in Java</a><br/>
375 <a href="http://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Java/Java_Language_Binding" title="link to the &quot;Java UNO Language Binding&quot; chapter in the Developer's Guide">Java UNO Language Binding</a><br/>
376 <a href="http://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Debugging" title="link to the &quot;Debugging Java components&quot; chapter in the Developer's Guide">Debugging Java components</a><br/>
377 </p>
378 </td>
379 </tr>
380 </table>
381 </td>
382 </tr>
383 </table>
384 </td>
385 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
386 </tr>
387 <tr>
388 <td colspan="3"><img class="line" src="../docs/images/sdk_line-1.gif"/></td>
389 </tr>
390 <tr>
391 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
392 <td>
393 <table class="table2">
394 <tr>
395 <td>
396 <table class="table3">
397 <tr>
398 <td colspan="2" class="head1"><a name="python_examples"/>Python examples</td>
399 <td align="right">
400 <a href="#examples" title="link to the examples overview"><img class="navigate" src="../docs/images/nav_up.png"/></a>
401 <a href="../index.html" title="link to the SDK start page"><img class="navigate" src="../docs/images/nav_home.png"/></a>
402 </td>
403 </tr>
404 <tr>
405 <td colspan="3"></td>
406 </tr>
407 </table>
408 </td>
409 </tr>
410 <tr>
411 <td>
412 <table class="table4">
413 <tbody>
414 <tr class="thead">
415 <td class="cell20">Example</td>
416 <td class="cell80">Description</td>
417 </tr>
418 <tr>
419 <td class="cell20"><a href="python/toolpanel/" title="link to the source directory of the ToolPanel python example">ToolPanelPoc</a></td>
420 <td class="cell80">This proof of concept extension illustrates how to create a ToolPanel in Calc.</td>
421 </tr>
422 </tbody>
423 </table>
424 </td>
425 </tr>
426 <tr>
427 <td>
428 <table class="table3">
429 <tr>
430 <td colspan="3">
431 <p>No Additional information</p>
432 </td>
433 </tr>
434 </table>
435 </td>
436 </tr>
437 </table>
438 </td>
439 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
440 </tr>
441 <tr>
442 <td colspan="3"><img class="line" src="../docs/images/sdk_line-1.gif"/></td>
443 </tr>
444 <tr>
445 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
446 <td>
447 <table class="table2">
448 <tr>
449 <td>
450 <table class="table3">
451 <tr>
452 <td colspan="2" class="head1"><a name="Cpp_examples"/>C++ examples</td>
453 <td align="right">
454 <a href="#examples" title="link to the examples overview"><img class="navigate" src="../docs/images/nav_up.png"/></a>
455 <a href="../index.html" title="link to the SDK start page"><img class="navigate" src="../docs/images/nav_home.png"/></a>
456 </td>
457 </tr>
458 <tr>
459 <td colspan="3">
460 The DocumentLoader example needs a running office server, before
461 running this program you should invoke the office with the following
462 command:
463 <blockquote>
464 <code>soffice &quot;--accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager&quot;</code>
465 </blockquote>
466 You can also customize the mentioned host and port to your needs.
467 </td>
468 </tr>
469 </table>
470 </td>
471 </tr>
472 <tr>
473 <td>
474 <table class="table4">
475 <tbody>
476 <tr class="thead">
477 <td class="cell20">Example</td>
478 <td class="cell80">Description</td>
479 </tr>
480 <tr>
481 <td class="cell20"><a href="cpp/DocumentLoader/" title="link to the source directory of the C++ DocumentLoader example">DocumentLoader</a></td>
482 <td class="cell80">This component works the same as the appropriate Java
483 example, but is implemented in C++.</td>
484 </tr>
485 <tr>
486 <td class="cell20"><a href="cpp/counter/" title="link to the source directory of the C++ counter example">Counter</a></td>
487 <td class="cell80">This demo shows how to implement a very simple UNO
488 component and how to access the UNO component from an executable.</td>
489 </tr>
490 <tr>
491 <td class="cell20"><a href="cpp/remoteclient/" title="link to the source directory of the C++ remoteclient example">Remote client</a></td>
492 <td class="cell80">The 'uno' program is used to export an arbitrary
493 service to other processes. In this example the com.sun.star.uno.Pipe
494 service (which is built in io-module) is exported. The client component
495 implements the <a href="%DOXYGEN_PREFIX1%/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XMain.html" title="link into the IDL reference to the interface com.sun.star.lang.XMain">
496 com.sun.star.lang.XMain</a> interface. In the run method, it connects to
497 the servers process and retrieves an instance and does some calls on the
498 instance.</td>
499 </tr>
500 <tr>
501 <td class="cell20"><a href="cpp/complextoolbarcontrols/" title="link to the source directory of the C++ complextoolbarcontrols example">complextoolbarcontrols</a></td>
502 <td class="cell80">This example shows how to create a toolbar add-on with complex toolbar controls.
503 It shows how to use an Image Button, a Combo Box, a Spin Field, an Edit Field, a Dropdown Box, a Toggle Dropdown Button and a normal Dropdown Button</td>
504 </tr>
505 </tbody>
506 </table>
507 </td>
508 </tr>
509 <tr>
510 <td>
511 <table class="table3">
512 <tr>
513 <td colspan="3">
514 <p>Additional information:</p>
516 <a href="http://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/C%2B%2B_Component" title="link to the &quot;How to write a UNO component in C++&quot; chapter in the Developer's Guide">How to write a UNO component in C++</a><br/>
517 <a href="http://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/C%2B%2B/C%2B%2B_Language_Binding" title="link to the &quot;C++ UNO Language Binding&quot; chapter in the Developer's Guide">C++ UNO Language Binding</a><br/>
518 <a href="%DOXYGEN_PREFIX1%/docs/cpp/ref/index.html" title="link to the C++ API reference">C++ reference</a>
519 </p>
520 </td>
521 </tr>
522 </table>
523 </td>
524 </tr>
525 </table>
526 </td>
527 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
528 </tr>
529 <tr>
530 <td colspan="3"><img class="line" src="../docs/images/sdk_line-1.gif"/></td>
531 </tr>
532 <tr>
533 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
534 <td>
535 <table class="table2">
536 <tr>
537 <td>
538 <table class="table3">
539 <tr>
540 <td colspan="2" class="head1"><a name="Basic_examples"/>LibreOffice %PRODUCT_RELEASE% Basic examples</td>
541 <td align="right">
542 <a href="#examples" title="link to the examples overview"><img class="navigate" src="../docs/images/nav_up.png"/></a>
543 <a href="../index.html" title="link to the SDK start page"><img class="navigate" src="../docs/images/nav_home.png"/></a>
544 </td>
545 </tr>
546 <tr>
547 <td colspan="3">
548 <p>The example programs are embedded in LibreOffice %PRODUCT_RELEASE% documents in the
549 samples directory. To view or edit the LibreOffice %PRODUCT_RELEASE% Basic source,
550 select the appropriate document and then select Tools-&gt;Macro.</p>
551 <p>Most of the examples are stand-alone, but two of them (Creating an
552 Index and Import/Export of ASCII Files) have an associated data file
553 identified by a .txt file name suffix).</p>
554 <p>Some of the examples are also available in Java, you can find them in
555 the <a href="#Java_examples" title="link to the Java examples section">
556 Java section</a>.</p>
557 </td>
558 </tr>
559 </table>
560 </td>
561 </tr>
562 <tr>
563 <td>
564 <table class="table4">
565 <tbody>
566 <tr class="thead">
567 <td class="cell20">Example</td>
568 <td class="cell80">Description</td>
569 </tr>
570 <tr>
571 <td class="cell20"><a href="basic/text/modifying_text_automatically/" title="link to the source directory of the LibreOffice %PRODUCT_RELEASE% Basic text/modifying_text_automatically examples">Changing Appearance</a></td>
572 <td class="cell80"> To change the style used for certain words, you can
573 start with the following example. This code searches for the regular
574 expression <code>the[a-z]</code>, which stands for the text portion the
575 followed by exactly one lowercase letter. All occurrences of these four
576 letters are then changed to bold characters. The same happens in the next
577 part of the program, this time changing the appearance of
578 <code>all[a-z]</code> to italic. In order for this example to work, you
579 must execute it from an open text document.</td>
580 </tr>
581 <tr>
582 <td class="cell20"><a href="basic/text/modifying_text_automatically/" title="link to the source directory of the LibreOffice %PRODUCT_RELEASE% Basic text/modifying_text_automatically examples">Replacing Text</a></td>
583 <td class="cell80">If you regularly receive documents from other people
584 for editing, you might want to make sure that certain words are always
585 written the same. The next example illustrates this by forcing certain
586 words to be spelled in American English.<br/>
587 In order for this example to work, you must execute it from an open text
588 document. For a real world application, it is a good idea to read the
589 words from an external file.</td>
590 </tr>
591 <tr>
592 <td class="cell20"><a href="basic/text/modifying_text_automatically/" title="link to the source directory of the LibreOffice %PRODUCT_RELEASE% Basic text/modifying_text_automatically examples">Using Regular Expressions</a></td>
593 <td class="cell80">Another application of automatic text modification is
594 related to stylistic questions. Suppose your company&rsquo;s policy is to
595 avoid the use of certain words. You want to replace these words, but you
596 cannot do that automatically because you have to find the appropriate
597 replacement, which depends on the context. So instead of deleting or
598 replacing the offending words automatically, you change their color to
599 make them stand out during a subsequent manual review process.<br/>
600 The following example handles two kinds of unwanted wordings: those
601 which are absolutely forbidden and must be replaced by something else,
602 and those which are considered bad style. A subroutine is responsible
603 for the changes. It can be used to make all words in a list appear in a
604 certain color in the text document. To keep the lists short, we use
605 regular expressions which provide for the variants of the words
606 (plural, adjective etc.).</td>
607 </tr>
608 <tr>
609 <td class="cell20"><a href="basic/text/modifying_text_automatically/" title="link to the source directory of the LibreOffice %PRODUCT_RELEASE% Basic text/modifying_text_automatically examples">Inserting Bookmarks</a></td>
610 <td class="cell80">
611 <p>The next example does something very similar. This time, however, we
612 do not change the color of the words but insert a bookmark at each of
613 them. You can thus use the StarOffice navigator to jump directly from
614 word to word. Bookmarks must first be created using
615 <code>createInstance()</code>. They are then inserted with
616 <code>insertTextContent()</code> at the current text range.</p>
617 <p>The main difference to the preceding example is the For loop in
618 <code>markList()</code>. Instead of changing the color of the current
619 word, it creates a new bookmark, oBookmark, whose name is the current
620 word with an integer appended. It then inserts this bookmark at the
621 word.</p></td>
622 </tr>
623 <tr>
624 <td class="cell20"><a href="basic/text/creating_an_index/" title="link to the source directory of the LibreOffice %PRODUCT_RELEASE% Basic text/create_index example">Creating an Index</a></td>
625 <td class="cell80">Indices for text documents can be created manually in
626 LibreOffice %PRODUCT_RELEASE% Writer by clicking on the words that should appear in the
627 index. If the document is large, or if you have to generate indices for
628 several documents, this task should be automated.</td>
629 </tr>
630 <tr>
631 <td class="cell20"><a href="basic/sheet/" title="link to the source directory of the LibreOffice %PRODUCT_RELEASE% Basic sheet example">Adapting to Euroland</a></td>
632 <td class="cell80">Most of the members of the European Union will abandon
633 their old currency in favor of the new Euro in 2001. This requires
634 modifications to all programs using the old currencies. Since the exchange
635 rates for the old currencies have been fixed at the end of 1999, one can
636 already convert old data. The following program does this for all values
637 in a table that are formatted with the currency string DM.</td>
638 </tr>
639 <tr>
640 <td class="cell20"><a href="basic/drawing/" title="link to the source directory of the LibreOffice %PRODUCT_RELEASE% Basic drawing example">Import/Export of ASCII Files</a></td>
641 <td class="cell80">You can use the drawing facilities of StarOffice API
642 to generate a picture from ASCII input. One application would be a
643 hierarchical representation of a directory listing, based on textual
644 data.</td>
645 </tr>
646 <tr>
647 <td class="cell20"><a href="basic/stock_quotes_updater/" title="link to the source directory of the LibreOffice %PRODUCT_RELEASE% Basic stock_quotes_updater example">Stock Quotes Updater</a></td>
648 <td class="cell80">If you want to display stock charts for certain
649 companies, you can open up your browser every day, go to a search engine,
650 look up the quote and copy it by hand into a table. Or you can use a
651 program that does all this automatically. The following example relies on
652 the sheet module. It uses URLs to obtain the current stock quotes. The
653 quotes are displayed in sheets, one for each company. We show a line
654 diagram and the numerical values for this company on every sheet. The
655 functionality is hidden in the three subroutines <code>GetValue()</code>,
656 <code>UpdateValue()</code>, and <code>UpdateChart()</code>.</td>
657 </tr>
658 <tr>
659 <td class="cell20"><a href="basic/forms_and_controls/" title="link to the source directory of the LibreOffice %PRODUCT_RELEASE% Basic forms_and_controls example">Forms and Controls</a></td>
660 <td class="cell80">The example document Burger Factory offers some forms
661 and controls, which you can use to order your desired burger type,
662 beverage, topping, and sauce. By hitting the button
663 &quot;Order now!&quot;, your order will be placed.</td>
664 </tr>
665 </tbody>
666 </table>
667 </td>
668 </tr>
669 <tr>
670 <td>
671 <table class="table3">
672 <tr>
673 <td colspan="3">
674 Additional information: <a href="http://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Basic/OpenOffice.org_Basic" title="link to the &quot;OpenOffice.org %PRODUCT_RELEASE% Basic language binding&quot; chapter in the Developer's Guide">OpenOffice.org %PRODUCT_RELEASE% Basic language binding</a>
675 </td>
676 </tr>
677 </table>
678 </td>
679 </tr>
680 </table>
681 </td>
682 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
683 </tr>
684 <tr>
685 <td colspan="3"><img class="line" src="../docs/images/sdk_line-1.gif"/></td>
686 </tr>
687 <tr>
688 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
689 <td>
690 <table class="table2">
691 <tr>
692 <td>
693 <table class="table3">
694 <tr>
695 <td colspan="2" class="head1"><a name="OLE_examples"/>Object Linking and Embedding (OLE) examples</td>
696 <td align="right">
697 <a href="#examples" title="link to the examples overview"><img class="navigate" src="../docs/images/nav_up.png"/></a>
698 <a href="../index.html" title="link to the SDK start page"><img class="navigate" src="../docs/images/nav_home.png"/></a>
699 </td>
700 </tr>
701 </table>
702 </td>
703 </tr>
704 <tr>
705 <td>
706 <table class="table4">
707 <tbody>
708 <tr class="thead">
709 <td class="cell20">Example</td>
710 <td class="cell80">Description</td>
711 </tr>
712 <tr>
713 <td class="cell20"><a href="OLE/activex/" title="link to the source directory of the activex plugin example using the OLE bridge">ActiveX Control</a></td>
714 <td class="cell80">The ActiveX control shows an example of access to UNO
715 through COM technology. It requires a properly installed StarOffice
716 version 6.0 or OpenOffice 1.0 or newer. This is a Lite ActiveX control
717 so it can be used only in containers that allow the use of such controls.
718 It can be activated with an &lt;OBJECT&gt; tag from a html-page to embed
719 a document. Without any parameters a new writer document will be opened
720 for editing. For more details please see the <a href="OLE/activex/README.txt" title="link to the README file of the activex example">README</a>.<br/>
721 Note: This example works only under windows and if you don't use the MS
722 .Net C++ compiler please check the makefile and take notice of the
723 comments.</td>
724 </tr>
725 <tr>
726 <td class="cell20"><a href="OLE/vbscript/" title="link to the source directory of the VBScript example using the OLE bridge">WriterDemo</a></td>
727 <td class="cell80">This Visual Basic Script creates an empty text
728 document and inserts text, a table, and a text frame.</td>
729 </tr>
730 </tbody>
731 </table>
732 </td>
733 </tr>
734 <tr>
735 <td>
736 <table class="table3">
737 <tr>
738 <td colspan="3">
739 Additional information: <a href="http://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Bridge/Automation_Bridge" title="link to the &quot;Automation Language Binding&quot; chapter in the Developer's Guide">Automation Language Binding</a>
740 </td>
741 </tr>
742 </table>
743 </td>
744 </tr>
745 </table>
746 </td>
747 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
748 </tr>
749 <tr>
750 <td colspan="3"><img class="line" src="../docs/images/sdk_line-1.gif"/></td>
751 </tr>
752 <tr>
753 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
754 <td>
755 <table class="table2">
756 <tr>
757 <td>
758 <table class="table3">
759 <tr>
760 <td colspan="2" class="head1"><a name="CLI_examples"/>Common Language Infrastructure (CLI) examples</td>
761 <td align="right">
762 <a href="#examples" title="link to the examples overview"><img class="navigate" src="../docs/images/nav_up.png"/></a>
763 <a href="../index.html" title="link to the SDK start page"><img class="navigate" src="../docs/images/nav_home.png"/></a>
764 </td>
765 </tr>
766 </table>
767 </td>
768 </tr>
769 <tr>
770 <td>
771 <table class="table4">
772 <tbody>
773 <tr class="thead">
774 <td class="cell20">Example</td>
775 <td class="cell80">Description</td>
776 </tr>
777 <tr>
778 <td class="cell20"><a href="CLI/CSharp/Spreadsheet/" title="link to the source directory of the Spreadsheet example using the CLI-UNO bridge">Spreadsheet Example</a></td>
779 <td class="cell80">This example is written in C# and shows how Spreadsheet
780 documents are created and filled with content. This example actually
781 consists of three separate executables, SpreadsheetSample.exe,
782 GeneralTableSample.exe, ViewSample.exe.</td>
783 </tr>
784 <tr>
785 <td class="cell20"><a href="CLI/VB.NET/WriterDemo/" title="link to the source directory of the WriterDemo example using the CLI-UNO bridge">WriterDemo</a></td>
786 <td class="cell80">This example is written in VB.NET. It creates a text
787 document and inserts text, a table, and a text frame.</td>
788 </tr>
789 </tbody>
790 </table>
791 </td>
792 </tr>
793 <tr>
794 <td>
795 <table class="table3">
796 <tr>
797 <td colspan="3">
798 Additional information: <a href="http://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/CLI/CLI_Language_Binding" title="link to the &quot;CLI-UNO Language Binding&quot; chapter in the Developer's Guide">CLI-UNO Language Binding</a>
799 </td>
800 </tr>
801 </table>
802 </td>
803 </tr>
804 </table>
805 </td>
806 <td class="content1"><img class="nothing8" src="../docs/images/nada.gif"/></td>
807 </tr>
808 </table>
809 </div>
810 <div id="Footer">
811 <div id="FooterText">
813 Copyright © 20002018 LibreOffice contributors. All rights reserved.
814 <br/>
815 LibreOffice was created by The Document Foundation,
816 based on Apache OpenOffice, which is Copyright 2011
817 The Apache Software Foundation.
818 <br/>
819 The Document Foundation acknowledges all community members, please find more info <a href="https://www.libreoffice.org/about-us/credits/" target="_blank">at our website</a>.
820 </p>
822 &nbsp;
823 </p>
825 <a href="http://www.documentfoundation.org/privacy" target="_blank">Privacy Policy</a> | <a href="http://www.documentfoundation.org/imprint" target="_blank">Impressum (Legal Info)</a>
826 | Copyright information: The source code of LibreOffice is licensed under the Mozilla Public License v2.0 (<a href="http://www.libreoffice.org/download/license/" target="_blank">MPLv2</a>). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our <a href="http://wiki.documentfoundation.org/TradeMark_Policy" target="_blank">trademark policy</a>.
827 </p>
828 </div>
829 </div>
830 </div>
831 </div>
832 </div>
833 </body>
834 </html>