Difference between revisions of "Constructing Components"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
(See also)
Line 1: Line 1:
 +
Our purpose is to extend OpenOffice.org in any way. All the possibilities of extensions come not in spirit at the first time you ask yourself how is it possible ? But at first, if I say you : realize first a (shared/not shared) library and second says OpenOffice.org you have to use this library, are you shocked ? Not at all I suppose. Then we have to produce a shared library with suffix uno.so under Linux or uno.dll under Windows. To indicate OpenOffice.org to use this new library and where to find it, we use a rdb file and an operation called registry. Registry has been already presented in the [[chapter 11]], but we have to go further in this chapter.
 +
==Danny Brewer's Terminology==
 +
We can read [http://www.oooforum.org/forum/viewtopic.php?t=13335&postdays=0&postorder=asc&start=0 here]
 +
Let's clarify (and perhaps even invent) some terminology.
 +
 +
* Add On
 +
A menu item on the Tools menu, and an icon on the toolbar.
 +
By modifying the Configuration sub node for AddOn, you can add new menu items and toolbar icon items to the AddOn menu or toolbar icon.
 +
Basic programs can modify the Configuration to add some Add On items to the menu. It is not necessary to use pkgchk.
 +
Components (see below) can also add things to the AddOn menu or toolbar when the component is installed using pkgchk.
 +
 +
* Add In
 +
A component (see below) which provides new Calc spreadsheet functions.
 +
These functions show up on the Function List and Insert --> Function... dialog box. The dialog box can then fully describe your functions, their parameters, provide tooltips, etc.
 +
 +
* Component
 +
An UNO component, written in any supported programming language, which must be installed using the pkgchk command. (This would be "pkgchk.exe" for users afflicted with Windows.)
 +
A component provides one or more new Services which are registered in the OOo registry. These services can be instantiated just like the factory installed services in OOo. For instance, in Basic, you can just call createUnoService( "name.DannyBrewer.magic.SomeService" ) to get an instance of the service, and then immediately call its methods or properties. Similarly, Python or Java, or Visual Basic, or any other language can use the newly installed service.
 +
 +
A component provides one or more services.
 +
 +
* Service
 +
An UNO abstraction for an Object. A service may not actually represent a single underlying object. A service may have many different interfaces which it implements. A service has properties. What methods are callable on the service are determined purely by what interfaces the service implements.
 +
 +
Since a Calc Add-In is just a component, which implements certain particular interfaces and services, the Calc AddIn is installed and registered in the same way as any other component. That is, a Calc AddIn is installed or removed by using pkgchk.
 +
Making a Calc Add-In is just like making any other service. You must be a particular com.sun.star.sheet.AddIn service, and must properly implement all of its interfaces, of which there are several. But once you do this, your service magically provides new functions to the spreadsheet. Calc Add-In are tackled next [[CompleteAddIn|chapter]].
 +
 
=See also=
 
=See also=
 
* Using C++ with OOo SDK : [[Using_Cpp_with_the_OOo_SDK | Main Page]]
 
* Using C++ with OOo SDK : [[Using_Cpp_with_the_OOo_SDK | Main Page]]

Revision as of 15:00, 20 May 2006

Our purpose is to extend OpenOffice.org in any way. All the possibilities of extensions come not in spirit at the first time you ask yourself how is it possible ? But at first, if I say you : realize first a (shared/not shared) library and second says OpenOffice.org you have to use this library, are you shocked ? Not at all I suppose. Then we have to produce a shared library with suffix uno.so under Linux or uno.dll under Windows. To indicate OpenOffice.org to use this new library and where to find it, we use a rdb file and an operation called registry. Registry has been already presented in the chapter 11, but we have to go further in this chapter.

Danny Brewer's Terminology

We can read here Let's clarify (and perhaps even invent) some terminology.

  • Add On

A menu item on the Tools menu, and an icon on the toolbar. By modifying the Configuration sub node for AddOn, you can add new menu items and toolbar icon items to the AddOn menu or toolbar icon. Basic programs can modify the Configuration to add some Add On items to the menu. It is not necessary to use pkgchk. Components (see below) can also add things to the AddOn menu or toolbar when the component is installed using pkgchk.

  • Add In

A component (see below) which provides new Calc spreadsheet functions. These functions show up on the Function List and Insert --> Function... dialog box. The dialog box can then fully describe your functions, their parameters, provide tooltips, etc.

  • Component

An UNO component, written in any supported programming language, which must be installed using the pkgchk command. (This would be "pkgchk.exe" for users afflicted with Windows.) A component provides one or more new Services which are registered in the OOo registry. These services can be instantiated just like the factory installed services in OOo. For instance, in Basic, you can just call createUnoService( "name.DannyBrewer.magic.SomeService" ) to get an instance of the service, and then immediately call its methods or properties. Similarly, Python or Java, or Visual Basic, or any other language can use the newly installed service.

A component provides one or more services.

  • Service

An UNO abstraction for an Object. A service may not actually represent a single underlying object. A service may have many different interfaces which it implements. A service has properties. What methods are callable on the service are determined purely by what interfaces the service implements.

Since a Calc Add-In is just a component, which implements certain particular interfaces and services, the Calc AddIn is installed and registered in the same way as any other component. That is, a Calc AddIn is installed or removed by using pkgchk. Making a Calc Add-In is just like making any other service. You must be a particular com.sun.star.sheet.AddIn service, and must properly implement all of its interfaces, of which there are several. But once you do this, your service magically provides new functions to the spreadsheet. Calc Add-In are tackled next chapter.

See also

Personal tools