Hi Christian
For a document revising tool I'd like to get from the X/Y
coordinates on a page to the object at that position in the writer
document via the API. The ideal way would be similar to the
accessibility API's "getAccessibleAtPoint" which returns the
accessible object at a given coordinate on the visible screen.
Instead of relative to the screen the coordinates would have to be
relative to the page.
Alternatively getting the bounding boxes (again relative to page
coordinates) of the (printable) objects would be sufficient as
well.
Is there a possibility to get that kind of information via the API
or is there another way to somehow get at the layouting engine? Any
ideas (however half-baked) are very welcome.
I doubt there is one. You probably have to go with listeners, like a
mousemotionlistener or css::awt::XMouseClickHandler depending on
*when* you want to influence sth.. By hand you then probably need to
track all objects upon loading of the document, a mapping of them and
their positions, then of course you need to register some more
listeners to get notified when a new object is inserted or an
existing one's position is changed. If you only deal with Writer
documents, then Cursors could be a friend as well (XPageCursor to get
the page nr. and then multiplicating with page size etc.).
These are just vague suggestions, I hope they give you some hint to
start off. A lot of stuff is covered in the Developer's Guide of
course.
Thanks for your suggestions. The XPageCursor will certainly be useful.
What I don't understand is where the mousemotionlister or
XMouseClickHandler would come into play. Do you suggest getting the
positions of the objects via their accessibility API and to then make a
transformation from the screen coordinates to page coordinates?
I don't think I need the listeners right now. For the time being it's a
rather static problem. For a given writer document I only need its
objects current positions on the pages. How those positions change upon
editing is at least for now not important for me.
BTW, even though I've written in my last mail that I'm looking for a
solution via the API: Any other solution is just as welcome.
Thanks again for your input.
Arthur
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]