Hello John, On Saturday 14 May 2011, 02:01, John Gillanders wrote: > Hello all, > > After quite some reading and experimenting, I have figured out how to catch > events on an OpenOffice Writer document using an > XDocumentEventBroadcaster/XDocumentEventListener pair (I am using > Java/NetBeans on Windows with the OpenOffice.org Dev 3.4 version), but the > events I am notified of are not the ones I am interested in (I most > frequently see 'OnLayoutFinished', but I do not think it is of use to me). > > I see in the API documentation several events that I want to catch, but I > cannot figure out how. I think I need to find some sub-object within the > document and add an event listener to it - but cannot figure out how to do > this (or maybe I am on the wrong track). > > Can someone please help point me to how to catch the following events?: > OnAlphaCharInput, OnInsertStart, OnInsertDone, OnNonAlphaCharInput
You won't get notified for those event adding an XDocumentEventListener, those events are not document-wide, but related to some kind of object. OnAlphaCharInput and OnNonAlphaCharInput are frame objects events (insert a frame, select Format - Frame/Object... , see the tab "Macro", there you'll see the "Input of non-alphanumeric char" and "Input of alphanumeric char" Frame events). OnInsertStart, OnInsertDone are events related to an AutoTextk entry. See http://svn.services.openoffice.org/opengrok/xref/DEV300_m106/sw/source/core/unocore/unoevent.cxx#119 http://svn.services.openoffice.org/opengrok/xref/DEV300_m106/sw/source/core/unocore/unoevent.cxx#126 and http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Text/Shape_Objects_in_Text#Base_Frames "The interface com.sun.star.document.XEventsSupplier is not a part of the BaseFrame service, but is available in text frames, graphic objects and embedded objects. This interface provides access to the event macros that may be attached to the object in the GUI." So, depending on what you are trying to do, you'll need to take a different approach. Note that these kind of questions belong to d...@api.openoffice.org Regards -- Ariel Constenla-Haile La Plata, Argentina
signature.asc
Description: This is a digitally signed message part.