Development/Extension Development/en

Introduction
LibreOffice has 3 kinds of extensions.


 * If you are an extension developer, you can use several languages to develop LibreOffice extensions. Supported programming languages are Basic, Python, JavaScript, Java and BeanShell. For the higher level of integrity and possibilities you can use C++, Python and Java languages to develop UNO complements based extensions. They are bundled as  files and can be shared on extensions.libreoffice.org.


 * Extensions are the preferred way for sysadmins to modify default settings. A guide for developing configuration extensions is available in [[Media:LibreOffice config extension writing.pdf|PDF]] or [[Media:LibreOffice config extension writing.odt|ODT]] format. A sample [[Media:Sample LO configuration extension.oxt|OXT configuration extension]] accompanies the guide.


 * There are also special Calc extensions known as Add-Ins that add spreadsheet functions to Calc. As a UNO components you can provide new implementations of existing functionality or specialized components like Calc Add-Ins, Add-Ons, DataPilots, Chart Add-Ins, or linguistic components: Spellchecker, Hyphenator or Thesaurus (see Add-Ins documentation).


 * You can also pack extensions for additional Templates, Gallery and Autotexts.

Resources
In an effort to not duplicate information, you can refer to OpenOffice's documentation. They are still largely compatible, but extra check should be performed since LibreOffice is moving forwards rapidly (see Compatibility notes below).


 * Extension development - this page in the Apache OpenOffice wiki
 * Extension development starters and tutorials

Current resources are currently being consolidated on the LibreOffice help pages.

Before you can start, you need to install the SDK.

Languages tutorials

 * Libreoffice extension development with C++ - Part 1 - Getting to know UNO;

Samples
To jump-start development, you can take a look at the source of existing extensions.

Examples:

Java

 * Starter Extension Starter extension to be used as a base for own extensions
 * Sidebar Extension Similiar to starter extension, but for creating an own Sidebar Deck
 * NOA-libre is an object-oriented lightweight Java wrapper around LibreOffice UNO API, providing higher-level abstraction of many UNO interfaces.
 * UNOHelper offers helper functions for working with the the UNO API. It wraps commonly used functions from the UNO API for easier use.
 * WollMux is a large Java Extension with enhanced template, form, and autotext functionality.

Eclipse Plugin
TDF offers the Eclipse Plugin LOEclipse which helps with developing LibreOffice extensions/components in Java. You can find it on the Eclipse Marketplace.

Python

 * unodit automate some of the tedious tasks with dialogs in order to help you write your own extension for LibreOffice in Python
 * the LibreOffice Love Letter Writer

See also Python Extensions Development

C++

 * the LibreOffice Search extensions which adds a context menu entry in order to search online for the selected text]

The LibreOffice source code also has a collection of SDK examples.

Compatibility notes
The LibreOffice developers are conservative when it comes to changes to the public (UNO) API and thus, most extensions written for OpenOffice.org or Apache OpenOffice will still work with LibreOffice. If changes happen, they are noted in the ReleaseNotes (API changes in 4.2, 4.1 and 4.0).


 * The  dependency states that an extension works in the specified OpenOffice.org versions as well as in LibreOffice versions that correspond to at least the specified OpenOffice.org reference version. All LibreOffice versions up to 4.2.3 report that they correspond to OpenOffice.org reference version 3.4, while LibreOffice versions since 4.2.4 report that they correspond to OpenOffice.org reference version 4.1. Using this dependency, the extension declares that it only uses features found in the specified OpenOffice.org reference version (and that it consequently works across all the products, not only for OpenOffice.org itself).


 * If an extension makes use of features specific to LibreOffice, starting with LibreOffice 3.5 it can specify a new dependency  with namespace  . Its required   attribute (without namespace) specifies the minimally supported LibreOffice version; it should not contain a micro version number, and it should not be less than  . The generally required   attribute (with namespace  ) should be &ldquo; &rdquo; (where   is the given version value). Examples may be found in core/tree/desktop/test/deployment/dependencies: loversion35.oxt or loversion36.oxt.


 * If an extension is intended for a specific version of LibreOffice, starting with LibreOffice 7.0 it can specify a new dependency  with namespace   in addition to the dependency  . This should be needed very rarely.