Difference between revisions of "Porting example"
Line 2: | Line 2: | ||
I randomly picked the Filter object e.g. [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/com/sun/star/helper/calc/XFilter.idl XFilter] in the helperapi ( of course you also want to make sure this object isn't already implemented in oovbaapi ). Browse the [http://api.openoffice.org/source/browse/api/helperapi/ helperapi] code to find where XFilter is implemented. It's implemented by [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/impl/com/sun/star/helper/calc/FilterImpl.java FilterImpl.java] and it expects to be initialised by an [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/com/sun/star/helper/calc/XAutoFilter.idl XAutoFilter] implementation object [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/impl/com/sun/star/helper/calc/AutoFilterImpl.java AutoFilterImpl] | I randomly picked the Filter object e.g. [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/com/sun/star/helper/calc/XFilter.idl XFilter] in the helperapi ( of course you also want to make sure this object isn't already implemented in oovbaapi ). Browse the [http://api.openoffice.org/source/browse/api/helperapi/ helperapi] code to find where XFilter is implemented. It's implemented by [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/impl/com/sun/star/helper/calc/FilterImpl.java FilterImpl.java] and it expects to be initialised by an [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/com/sun/star/helper/calc/XAutoFilter.idl XAutoFilter] implementation object [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/impl/com/sun/star/helper/calc/AutoFilterImpl.java AutoFilterImpl] | ||
− | so already | + | so already an implementation not only for XFilter need to be provided but also and implementation for XAutoFilter as well. |
− | looking at XAutoFilter.idl | + | looking at XAutoFilter.idl you see that there is a <tt>Filters()</tt> attribute/method that returns a [[Collection]] of Filters, so additionally an implementation of the XFilters object is needed. The XAutoFilter implementation is the key object that the others are accessed/provided from. Searching through the source code you find this is an attribute of the [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/impl/com/sun/star/helper/calc/SheetImpl.java SheetImpl] object |
− | so, to summarize, after initially choosing one object to have a crack at porting, | + | so, to summarize, after initially choosing one object to have a crack at porting, you actually need to provide implementations for the following interfaces |
* XFilter | * XFilter | ||
* XAutoFilter | * XAutoFilter | ||
* XFilters | * XFilters | ||
− | and also | + | and also you need to add a new attribute to return an <tt>XAutoFilter</tt> implementation |
=== Step 2 Port the idl files === | === Step 2 Port the idl files === |
Revision as of 12:12, 23 February 2007
Step 1 Choose an object to port
I randomly picked the Filter object e.g. XFilter in the helperapi ( of course you also want to make sure this object isn't already implemented in oovbaapi ). Browse the helperapi code to find where XFilter is implemented. It's implemented by FilterImpl.java and it expects to be initialised by an XAutoFilter implementation object AutoFilterImpl
so already an implementation not only for XFilter need to be provided but also and implementation for XAutoFilter as well.
looking at XAutoFilter.idl you see that there is a Filters() attribute/method that returns a Collection of Filters, so additionally an implementation of the XFilters object is needed. The XAutoFilter implementation is the key object that the others are accessed/provided from. Searching through the source code you find this is an attribute of the SheetImpl object
so, to summarize, after initially choosing one object to have a crack at porting, you actually need to provide implementations for the following interfaces
- XFilter
- XAutoFilter
- XFilters
and also you need to add a new attribute to return an XAutoFilter implementation
Step 2 Port the idl files
It's worth taking a look at the idl section in the porting notes and examples of the ported idl files
also modifications to existing files
- makefile.mk add new idl file
- XWorksheet.idl add new AutoFilter attribute