List Info

Thread: Smart Tags in Openoffice Writer




Smart Tags in Openoffice Writer
user name
2006-09-12 11:56:23
Hi Jakob,

On 09/12/06 09:44, Jakob Lechner wrote:

> I have written an IDL file and transformed this into a
rdb registry
> and into c header files. I have named the rdb file
"smarttags.rdb" and
> placed it into the program directory of my OOo
installation.
> Up to my ideas every smarttag component has to be
registered in this
> file. Then the smarttag manager can open it and extract
the names of 
> all the registered implemenations of the smarttag
service and
> subsequently create an instance of each implementation.
> I hope this is a reasonable concept.

yes, I think so. But I'd like to discuss this issue with
Juergen Schmidt 
(our expert for these kind of questions), who is currently
attending the 
OOo conference.

> Am Dienstag, den 05.09.2006, 14:58 +0200 schrieb Frank
Meies:
>> 5. For each SmartTagReference in this vector, a
string/action pair is 
>> obtained from the associated SmartTagLibrary, the
strings will appear in 
>> the context menu and the invokeAction function will
be triggered if a 
>> context menu entry is invoked. A UNO textrange
object can be passed as a 
>> parameter of the invokeAction function to enable
the SmartTagLibrary to 
>> change the text etc.
>>
> 
> Currently I'm writing an example component that
implements the smarttag
> service and I have thought again about your proposal to
pass a TextRange
> object to the invokeAction method. Wouldn't it be
better to pass a 
> reference of the whole document as well? May be someone
wants to do
> more complex interactions with the document than just
modifying text.
> 
> In the developers guide I've found a figure about the
Text document 
> model:
> http://api.openoffice.org/docs/Develo
persGuide/Text/Text.xhtml#1_1_Overview
> 
> As far as I have understood the XController service is
the basic service
> that should be passed to provide access to the whole
document in the
> invokeAction method. As far as I've seen there is a
method called
> "getCurrentController" in the
SwXTextDocument class. Probably this
> method could be used to obtain the XController
reference when calling
> the invokeAction method.
 > Are my assumptions correct or completely wrong or is
there are better
 > way to do this?

Yes, you are right. We should pass the TextRange and the
Controller to 
the invokeAction methor. A better way to obtain the
Controller would be 
to use the GetController() method of the SwView object
(which in turn 
inherits it from the SfxViewShell object). This way we make
sure that we 
get the correct controller and do not run into any focus
related issues.

Regards,

Frank


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribesw.openoffice.org
For additional commands, e-mail: dev-helpsw.openoffice.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )