Hi all,

I am writing an extension that will allow me to keep a selection of previously 
opened files that match certain personal criteria. Picture it as pinning 
specific documents to the recent files list. For that, I need to somehow know 
of when (existing) files are opened or (new files are) saved.

Browsing the IDL Reference in the API at 
http://www.openoffice.org/api/docs/common/ref/com/sun/star/document/module-ix.html
 , I have noticed the XDocumentEventListener class that seems fit to in what 
I'm trying to achieve.

However, from the autogenerated project template and from the sample code, I 
still can't see how/where to register my listener. Implementing the interface 
is no problem. But since (I guess) it won't be enough for the plugging to 
magically happen and therefore for my event handler to be called, I imagine I 
need to call an "addXXXListener" function on an object so I'm registered.

Questions: 

1- What would be the appropriate "object"? Is it a frame (like in the 
StatusListener.java example) or is it another type of objects? 

2- Is the opening/saving of a document a frame event, or is it a document 
event? I can't figure that out.

3- Is there a registry/catalog of all events in the API or is it a 
per-class/per-feature catalog (like the one at 
https://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Document_Events
 )?

Thank you for any input.

Reply via email to