OK, have not ahd much luck posting top [EMAIL PROTECTED], so am trying
again...

Quoting Mathias Bauer <[EMAIL PROTECTED]>:

[Hide Quoted Text]
Anders S. Johansen wrote:

Our goal is to implement a few functions/methods, preferably
encapsulated in an object (but not necessarily) that will allow DW
to integrate with Open
Office/Star Office (OO). The following describes the necessary functions in
detail. See conventions regarding cursor position etc. at the end of this
document.

      bool IsOOoWriterWindow(const HWND w);

Return TRUE if the window referred to by the HWND handle 'w' supports the
functions listed below.

That should be easy to implement if you are fine with using at least
OOo2.0 because in that version we have an API that allows to retrieve
the HWND of all OOo document windows.

OK. I have a way to get the currently forground window, so that will work
nicely. I then need a way to check, say:

bool isOOoWindow(const HWND w);

[Hide Quoted Text]
From this function description I assume that your application will only
interface with "normal" text, but not with text in dialogs etc.?

      bool GetContext(const HWND w, char** Context, int &pos);

Fetches, if possible, the current cursor position, and the current text
from the OO window referred to by the HWND handle 'w'. Cursor position is
returned in the 'pos' value, and the text in the 'Context'. If the
operation is performed
correctly, the function returns TRUE, else it returns FALSE.

We have an API for cursor travelling, but I don't understand how a
single integer value can describe a cursor position. Can you explain?
What is the "reference point" for your position?

OK.

^ is cursor

^hello <-- pos == 0

h^ello <-- pos == 1


[Hide Quoted Text]
      void ChangeRange(const HWND w, char *NewString, const int
start, const int length);

Replace a substring in the current text ranging from position 'start' to
position 'start+length' with the text referred to by 'NewString', in the
window referred to by the HWND handle 'w'.

Once we have clarified the cursor position question I'm sure that this
won't be a problem. That means, we need a "translation" from your
description of a cursor position to what we have for it.

See above.

[Hide Quoted Text]
      void SelRange(const HWND w, const int start, const int length);

Select (highlight) the substring of the current text ranging from position
'start' to position 'start+length' in the window referred to by the HWND
handle 'w'.

      void SetSelpos(const HWND w, const int i);

Ditto.

Ditto ;)
Move the insertion point/cursor to position 'i' in the window referred
to by the HWND handle 'w'.

Ditto.

Ditto ;)

[Hide Quoted Text]
o    If other methods/signatures come more natural to the OO
integration, that´s just fine by me. The important thing is to get
the basic functionality, not
necessarily how it is achieved.

Usually I would recommend to use our API directly, but in your case
where Borland C++ shall be used and only a few, very simple API calls
are needed a C library as an encapsulation is fine. This library needs
to be created with MSVC++ or it has to be implemented using OLE
Automation. Using our API through OLE Automation in C++ is a little bit
tedious, but it's easy once you have got it and for such a few API calls
it's bearable.

A C-style DLL is just fine. In fact, it is quite easy for me to work with.
BTW: I thought that the best list would be dev@api.openoffice.org but
dev@openoffice.org should be OK here also. One move is enough. :-)

OK, I have tried a few times, but it has not shown up in the archives. Not I
experiment with a new method (joining, then mailing to thwe list).

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



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

Reply via email to