Bernhard Haumacher wrote:

> I was thinking about something like the formula editor of
> OpenOffice.org. Such formula is displayed within the document, stored
> within the documents ZIP and can be edited from the plugin. Is it
> possible to write something like the formular editor as plugin or UNO
> component for OpenOffice.org?

OOo Math is a so called "Embedded Object". In OOo 1.x these objects
needed to be OOo (internal) C++ objects or (on Windows) COM objects, but
in OOo2.0 it is possible to implement them in Java too (by implementing
some UNO APIs we have defined for this and by providing some
configuration files that make new object types known to OOo), but there
are two obstacles you need to overcome:

What you need first is a "replacement image". This is the graphic OOo
displays when the object isn't active (for various, mainly performance
reasons embedded objects are not loaded except they must be!). It shows
the state of the object when it was edited the last time. After
successful editing, the objects' state is stored into the container
document (the one that embeds the object) and a new replacement image is
retrieved from the object that is stored inside the container document
also. You can study all this in the 1.9.x versions of OOo.

Usually you would like to use a vector graphics format for the
replacement image because of its better scaling capabilities.
Unfortunately the only vector graphics formats OOo supports are "Windows
(Extended) Metafile" and our internal VCL based "GDIMetafile" format. I
assume that the latter is not possible for non-VCL applications, so if
you can't provide a Windows Metafile I'm afraid that you must use a
pixel graphic format (like png). I hope that we will have graphic import
filters for Tiny SVG in the near future so that we no longer need the
proprietary formats.

The other thing that creates a problem is dispensable, it depends on
your goal for user experience. As explained above, embedded objects in
OOo2.0 are not always loaded, they are loaded only when you "activate"
them, e.g. by doubleclicking. Activation in general means that the
object should present its user interface, mostly it will start an
editing session.

Now you can decide: if you want to edit your object "like a plugin" (we
call it "InPlace") you still might need OOo GUI components using the VCL
C++ class library or the AWT package of our UNO API. If you are fine
with "Outplace editing" (means: once your object is doubleclicked it
will launch an external window where you can edit it) you don't need
this. In your external window you don't need any OOo stuff.


Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to