1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24#ifndef __com_sun_star_smarttags_XSmartTagRecognizer_idl__ 25#define __com_sun_star_smarttags_XSmartTagRecognizer_idl__ 26 27#ifndef __com_sun_star_uno_XInitialization_idl__ 28#include <com/sun/star/lang/XInitialization.idl> 29#endif 30 31#ifndef __com_sun_star_lang_Locale_idl__ 32#include <com/sun/star/lang/Locale.idl> 33#endif 34 35#ifndef __com_sun_star_i18n_XBreakIterator_idl__ 36#include <com/sun/star/i18n/XBreakIterator.idl> 37#endif 38 39#ifndef __com_sun_star_smarttags_SmartTagRecognizerMode_idl__ 40#include <com/sun/star/smarttags/SmartTagRecognizerMode.idl> 41#endif 42 43#ifndef __com_sun_star_text_XTextMarkup_idl__ 44#include <com/sun/star/text/XTextMarkup.idl> 45#endif 46 47#ifndef __com_sun_star_frame_XController_idl__ 48#include <com/sun/star/frame/XController.idl> 49#endif 50 51#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__ 52#include <com/sun/star/lang/IndexOutOfBoundsException.idl> 53#endif 54 55#ifndef __com_sun_star_text_XTextRange_idl__ 56#include <com/sun/star/text/XTextRange.idl> 57#endif 58 59 60//============================================================================= 61 62module com { module sun { module star { module smarttags { 63 64//============================================================================= 65 66/** 67 provides access to a smart tag recognizer. 68 69 @since OOo 2.3 70 */ 71 72interface XSmartTagRecognizer: com::sun::star::lang::XInitialization 73{ 74 //------------------------------------------------------------------------- 75 /** obtains a name that describes this recognizer component. 76 77 @param aLocale 78 Is used for localization of the name. 79 80 @return 81 the name of the recognizer component. 82 */ 83 string getName( [in] ::com::sun::star::lang::Locale aLocale ); 84 85 86 //------------------------------------------------------------------------- 87 /** obtains a detailed description of this recognizer component. 88 89 @param aLocale 90 Is used for localization of the description. 91 92 @return 93 the description of the recognizer component. 94 */ 95 string getDescription( [in] ::com::sun::star::lang::Locale aLocale ); 96 97 98 //------------------------------------------------------------------------- 99 /** The number of smart tag types supported by this recognizer 100 component. 101 */ 102 [attribute, readonly] long SmartTagCount; 103 104 105 //------------------------------------------------------------------------- 106 /** obtains the name of one specific smart tag type supported by 107 this recognizer component. 108 109 @param nSmartTagIndex 110 Index of the wanted smart tag type. Value needs to be 111 between 0 and the number of smarttags available 112 (exclusively). 113 114 @return 115 the unique name of the smart tag type. Smart tag type 116 names are always in the format of namespaceURI#tagname. 117 118 @throws com::sun::star::lang::IndexOutOfBoundsException 119 if nSmartTagIndex is greater than SmartTagCount 120 */ 121 string getSmartTagName( [in] long nSmartTagIndex ) 122 raises( com::sun::star::lang::IndexOutOfBoundsException ); 123 124 125 //------------------------------------------------------------------------- 126 /** obtains the URL that can be used to download new or updated 127 recognizers. 128 129 @param nSmartTagIndex 130 Index of the wanted smart tag type. Value needs to be 131 between 0 and the number of smarttags available 132 (exclusively). 133 134 @return 135 the download URL. 136 137 @throws com::sun::star::lang::IndexOutOfBoundsException 138 if nSmartTagIndex is greater than SmartTagCount 139 */ 140 string getSmartTagDownloadURL( [in] long nSmartTagIndex ) 141 raises( com::sun::star::lang::IndexOutOfBoundsException ); 142 143 144 //------------------------------------------------------------------------- 145 /** recognizes smart tags. 146 147 @param aText 148 The text that should be scanned by the recognizer. aText 149 is UFT16 encoded. 150 151 @param nStart 152 Denotes the start position of the region to scan. 153 154 @param nLength 155 Denotes the length of the text to scan. 156 157 @param eDataType 158 This value indicates the type of the passed text. 159 160 @param aLocale 161 Is used to indicate the language of the passed text. 162 163 @param xTextMarkup 164 This object is used to submit any recognized smart tags 165 to the calling application. 166 167 @param aApplicationName 168 A string containing the name of the calling application. 169 170 @param xController 171 The current controller of the document. 172 173 @param xTokenizer 174 This can be used to tokenize the string to recognize. 175 */ 176 void recognize( [in] string aText, 177 [in] long nStart, 178 [in] long nLength, 179 [in] SmartTagRecognizerMode eDataType, 180 [in] com::sun::star::lang::Locale aLocale, 181 [in] com::sun::star::text::XTextMarkup xTextMarkup, 182 [in] string aApplicationName, 183 [in] com::sun::star::frame::XController xController, 184 [in] com::sun::star::i18n::XBreakIterator xTokenizer ); 185 186 //------------------------------------------------------------------------- 187 /** indicates whether there is a property page for a smart tag type. 188 189 @param nSmartTagIndex 190 Index of the wanted smart tag type. Value needs to be 191 between 0 and the number of smarttags available 192 (exclusively). 193 194 @param aLocale 195 Is used for localization of the property page. 196 197 @return 198 true if there is a property page matching the requested 199 smart tag type and locale. 200 201 @throws com::sun::star::lang::IndexOutOfBoundsException 202 if nSmartTagIndex is greater than SmartTagCount 203 */ 204 boolean hasPropertyPage( [in] long nSmartTagIndex, 205 [in] ::com::sun::star::lang::Locale aLocale ) 206 raises( com::sun::star::lang::IndexOutOfBoundsException ); 207 208 209 //------------------------------------------------------------------------- 210 /** launches the property page for a smart tag type. 211 212 @param nSmartTagIndex 213 Index of the wanted smart tag type. Value needs to be 214 between 0 and the number of smarttags available 215 (exclusively). 216 217 @param aLocale 218 Is used for localization of the property page. 219 220 @throws com::sun::star::lang::IndexOutOfBoundsException 221 if nSmartTagIndex is greater than SmartTagCount 222 */ 223 void displayPropertyPage( [in] long nSmartTagIndex, 224 [in] ::com::sun::star::lang::Locale aLocale ) 225 raises( com::sun::star::lang::IndexOutOfBoundsException ); 226 227}; 228 229}; }; }; }; 230 231#endif 232