Hello,
We would like to implement "Smart Tags"-like functionality in
Openoffice Writer.
According to our current plans we want to realize this feature as
described below:
1. Similar to MS Office recognized words in a document are underlined
in a special color.
2. If the user clicks with the left mouse button holding the ctrl key
on the underlined word a dropdown menu is opened where the user
can select one of the predefined actions provided from the smarttag
library that matched this word.
3. In case of MS Office there are simple and complex smarttag
libraries. For simple libraries just a xml smarttag specification
has to be provided (see [1]). Complex libraries require a COM DLL
that implements a special interface [2]. The actions that can be
specified with xml smarttags facilitate basically the invokation of
an URL. It is though possible to include the recognized smarttag
word as a parameter in the URL. In smart tag DLLs of course
arbitrary actions can be programmed. In a first step we want to
provide support for xml smarttags.
4. The xml files have to be put into the smarttag directory in the
shared data folder of the openoffice installation
(i.e. $INSTALL_PATH/share/smarttags).
5. Smarttag libraries comparable to the COM DLLs that Microsoft uses
could be implemented as UNO components in openoffice. A simple
interface could look quite similar to the Microsoft interface for
smarttag DLLs.
Basically the methods that have to be provided are:
1. Recognize method:
This method checks if a given word is part of the smarttag
library.
2. getActionCaption method:
Returns the captions of the possible actions for a given
smarttag.
3. invokeAction method:
Executes a specified action.
6. In order to be able to provide access to multiple smarttag
libraries there should also be a Smarttag manager. This class loads
available smarttag libraries implementing the specified interface
and constitutes the access point to smarttag libraries for the other
parts of the program. The smarttag manager should be able handle xml
smarttags but later on it could be extended to deal with UNO
components as well.
7. Beside UNO components for complex smarttags it would also be
possible to build a support for native COM smarttags on the Windows
platform.
8. For a more detailed description of the mentioned interface and the
architecture of the smarttag classes have a look at our UML diagram
in the attachments.
9. Implementation details:
The smarttag implementation consists of three parts:
1. Underlining recognized smarttag terms in the opened document.
2. Xml smarttag classes that process xml files, provide the
recognize function and execute the defined actions.
3. GUI integration of applicable actions by a popup menu.
The process of recognizing and underlining words is very similar to
the online spell checking function. Therefore we would implement
another list just like the wrong list that is used for maintaining
misspelled words.
---------------------------------------------------------------------
[1] Paul Cornell: Developing Simple Smart Tags. Microsoft Corporation.
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dnsmarttag/html/odc_stxml.asp?frame=true
[2] Paul Cornell: Developing Smart Tag DLLs. Microsoft Corporation.
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dnsmarttag/html/odc_smarttags.asp
---------------------------------------------------------------------
Best regards
--
Jakob Lechner
Research & Development
Fabalabs Software GmbH
Honauerstraße 4
A-4020 Linz
Tel.: [+43] (70) 60 61 62
Fax: [+43] (70) 60 61 62-609
E-Mail: [EMAIL PROTECTED]
Web: http://www.fabalabs.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]