Frank Meies wrote:
Hi,
with OOo 2.2, a first draft of a Smart Tag API has been introduced. That
API only provided some basic Smart Tag functionality which had to be
enhanced in many regards. An overview about Smart Tags and the current
Smart Tag API can be found be:
http://wiki.services.openoffice.org/wiki/Smart_Tags
So here comes my proposal for the new API:
The new/changed services/interfaces are
com.sun.star.smarttags.SmartTagRecognizer
com.sun.star.smarttags.XSmartTagRecognizer
com.sun.star.smarttags.SmartTagAction
com.sun.star.smarttags.XSmartTagAction
com.sun.star.smarttags.SmartTagRecognizerMode
com.sun.star.text.XTextMarkup
com.sun.star.text.TextMarkupType
com.sun.star.container.XStringKeyMap
Short Description of the services/interfaces:
- A SmartTagRecognizer is used to find smart tags in a document. Usually
there are a couple of SmartTagRecognizer components installed.
- A SmartTagAction defines actions associated with smart tags. Usually
there are a couple of SmartTagAction components installed.
Why are those two constructor-less services needed? Who creates
instances of those services, and how are different service
implementations discriminated? (Frank, please ignore this or any of the
following if we already clarified it back then, I simply cannot remember.)
- SmartTagRecognizerMode defines some constants which are used to
specify the type of text (paragraph, cell content, single word) passed
to the recognize function of the SmartTagRecognizer service.
Should that be an enum? (If not, long would probably be more natural
than short.) Are combinations of those values of interest (since the
values are 2^0, 2^1, ... instead of 0, 1, ...)?
XSmartTagRecognizer.recognize parameters nStartPos, nLength: UNO
strings are arbitrary-length sequences of Unicode scalar values. How
shall nStartPos and nLength be interpreted? (The optimization to pass
complete string plus index range instead of just substring might be
great for non-bridged UNO calls, but can be a pessimization in general.)
- The XTextMarkup interface provides functionality to highlight the text
of a paragraph. This interface is used by the recognize function of the
SmartTagRecognizer service to mark text as smart tags.
- TextMarkupType defines some constants to specify the type of the
highlighted text (smart tag, spell check, grammar check).
Enum and long vs. short: questions as above.
- The interface XStringKeyMap provides functions to map strings to anys.
This is used to associate user defined data with the smart tag
identified by a SmartTagRecognizer. This user defined data will be
stored together with the smart tag and passed to a SmartTagAction on
invocation.
Feedback is very much appreciated!
Inconsistent spelling of URL, ID vs. Xml.
Thanks,
Frank
-Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]