1d1766043SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5d1766043SAndrew Rist * distributed with this work for additional information 6d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10d1766043SAndrew Rist * 11d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12d1766043SAndrew Rist * 13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14d1766043SAndrew Rist * software distributed under the License is distributed on an 15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17d1766043SAndrew Rist * specific language governing permissions and limitations 18d1766043SAndrew Rist * under the License. 19d1766043SAndrew Rist * 20d1766043SAndrew Rist *************************************************************/ 21d1766043SAndrew Rist 22d1766043SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir#ifndef __com_sun_star_smarttags_XSmartTagAction_idl__ 25cdf0e10cSrcweir#define __com_sun_star_smarttags_XSmartTagAction_idl__ 26cdf0e10cSrcweir 27cdf0e10cSrcweir#ifndef __com_sun_star_container_XStringKeyMap_idl__ 28cdf0e10cSrcweir#include <com/sun/star/container/XStringKeyMap.idl> 29cdf0e10cSrcweir#endif 30cdf0e10cSrcweir 31cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInitialization_idl__ 32cdf0e10cSrcweir#include <com/sun/star/lang/XInitialization.idl> 33cdf0e10cSrcweir#endif 34cdf0e10cSrcweir 35cdf0e10cSrcweir#ifndef __com_sun_star_lang_Locale_idl__ 36cdf0e10cSrcweir#include <com/sun/star/lang/Locale.idl> 37cdf0e10cSrcweir#endif 38cdf0e10cSrcweir 39cdf0e10cSrcweir#ifndef __com_sun_star_text_XTextRange_idl__ 40cdf0e10cSrcweir#include <com/sun/star/text/XTextRange.idl> 41cdf0e10cSrcweir#endif 42cdf0e10cSrcweir 43cdf0e10cSrcweir#ifndef __com_sun_star_frame_XController_idl__ 44cdf0e10cSrcweir#include <com/sun/star/frame/XController.idl> 45cdf0e10cSrcweir#endif 46cdf0e10cSrcweir 47cdf0e10cSrcweir#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__ 48cdf0e10cSrcweir#include <com/sun/star/lang/IndexOutOfBoundsException.idl> 49cdf0e10cSrcweir#endif 50cdf0e10cSrcweir 51cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 52cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 53cdf0e10cSrcweir#endif 54cdf0e10cSrcweir 55cdf0e10cSrcweir//============================================================================= 56cdf0e10cSrcweir 57cdf0e10cSrcweirmodule com { module sun { module star { module smarttags { 58cdf0e10cSrcweir 59cdf0e10cSrcweir//============================================================================= 60cdf0e10cSrcweir 61cdf0e10cSrcweir/** provides access to smart tag actions. 62cdf0e10cSrcweir 6396af39f7SJürgen Schmidt @since OpenOffice 2.3 64cdf0e10cSrcweir */ 65cdf0e10cSrcweir 66cdf0e10cSrcweirinterface XSmartTagAction: com::sun::star::lang::XInitialization 67cdf0e10cSrcweir{ 68cdf0e10cSrcweir //------------------------------------------------------------------------- 69cdf0e10cSrcweir /** obtains a name that describes this action component. 70cdf0e10cSrcweir 71cdf0e10cSrcweir @param aLocale 72cdf0e10cSrcweir Is used for localization of the name. 73cdf0e10cSrcweir 74cdf0e10cSrcweir @return 75cdf0e10cSrcweir the name describing the action component. 76cdf0e10cSrcweir */ 77cdf0e10cSrcweir string getName( [in] ::com::sun::star::lang::Locale aLocale ); 78cdf0e10cSrcweir 79cdf0e10cSrcweir 80cdf0e10cSrcweir //------------------------------------------------------------------------- 81cdf0e10cSrcweir /** obtains a detailed description of this action component. 82cdf0e10cSrcweir 83cdf0e10cSrcweir @param aLocale 84cdf0e10cSrcweir Is used for localization of the description. 85cdf0e10cSrcweir 86cdf0e10cSrcweir @return 87cdf0e10cSrcweir the description of the action component. 88cdf0e10cSrcweir */ 89cdf0e10cSrcweir string getDescription( [in] ::com::sun::star::lang::Locale aLocale ); 90cdf0e10cSrcweir 91cdf0e10cSrcweir 92cdf0e10cSrcweir //------------------------------------------------------------------------- 93cdf0e10cSrcweir /** the number of smart tag types supported by this action 94cdf0e10cSrcweir component. 95cdf0e10cSrcweir */ 96cdf0e10cSrcweir [attribute, readonly] long SmartTagCount; 97cdf0e10cSrcweir 98cdf0e10cSrcweir 99cdf0e10cSrcweir //------------------------------------------------------------------------- 100cdf0e10cSrcweir /** obtains the name of one specific smart tag type supported by 101cdf0e10cSrcweir this action component. 102cdf0e10cSrcweir 103cdf0e10cSrcweir @param nSmartTagIndex 104cdf0e10cSrcweir Index of the wanted smart tag type. Value needs to be 105cdf0e10cSrcweir between 0 and the number of smarttags available 106cdf0e10cSrcweir (exclusively). 107cdf0e10cSrcweir 108cdf0e10cSrcweir @return 109cdf0e10cSrcweir an unique name of the smart tag type. Smart tag type 110cdf0e10cSrcweir names are always in the format of namespaceURI#tagname. 111cdf0e10cSrcweir 112cdf0e10cSrcweir @throws com::sun::star::lang::IndexOutOfBoundsException 113cdf0e10cSrcweir if nSmartTagIndex is greater than SmartTagCount. 114cdf0e10cSrcweir */ 115b6a68018SJürgen Schmidt string getSmartTagName( [in] long nSmartTagIndex) 116cdf0e10cSrcweir raises( com::sun::star::lang::IndexOutOfBoundsException ); 117cdf0e10cSrcweir 118cdf0e10cSrcweir 119cdf0e10cSrcweir //------------------------------------------------------------------------- 120cdf0e10cSrcweir /** obtains the caption of the smart tag type for using in user 121cdf0e10cSrcweir interfaces. 122cdf0e10cSrcweir 123cdf0e10cSrcweir @param nSmartTagIndex 124cdf0e10cSrcweir Index of the wanted smart tag type. Value needs to be 125cdf0e10cSrcweir between 0 and the number of smarttags available 126cdf0e10cSrcweir (exclusively). 127cdf0e10cSrcweir 128cdf0e10cSrcweir @param aLocale 129cdf0e10cSrcweir Is used for localization of the caption. 130cdf0e10cSrcweir 131cdf0e10cSrcweir @return 132cdf0e10cSrcweir the caption associated with the smart tag type. 133cdf0e10cSrcweir 134cdf0e10cSrcweir @throws com::sun::star::lang::IndexOutOfBoundsException 135cdf0e10cSrcweir if nSmartTagIndex is greater than SmartTagCount 136cdf0e10cSrcweir */ 137cdf0e10cSrcweir string getSmartTagCaption( [in] long nSmartTagIndex, 138b6a68018SJürgen Schmidt [in] ::com::sun::star::lang::Locale aLocale) 139cdf0e10cSrcweir raises( com::sun::star::lang::IndexOutOfBoundsException ); 140cdf0e10cSrcweir 141cdf0e10cSrcweir 142cdf0e10cSrcweir //------------------------------------------------------------------------- 143cdf0e10cSrcweir /** obtains the number of actions provided for a specifiy smart tag 144cdf0e10cSrcweir type. 145cdf0e10cSrcweir 146cdf0e10cSrcweir @param aSmartTagName 147cdf0e10cSrcweir Name of the wanted smart tag type. This is one of the 148cdf0e10cSrcweir names obtained by getSmartTagName() 149cdf0e10cSrcweir 150cdf0e10cSrcweir @param xController 151cdf0e10cSrcweir The current controller of the document. 152cdf0e10cSrcweir 153cdf0e10cSrcweir @return 154cdf0e10cSrcweir the number of actions available for the given smart tag 155cdf0e10cSrcweir type. 156cdf0e10cSrcweir */ 157cdf0e10cSrcweir long getActionCount( [in] string aSmartTagName, 158b6a68018SJürgen Schmidt [in] com::sun::star::frame::XController xController, 159b6a68018SJürgen Schmidt [in] com::sun::star::container::XStringKeyMap xProperties); 160cdf0e10cSrcweir 161cdf0e10cSrcweir //------------------------------------------------------------------------- 162cdf0e10cSrcweir /** obtains a unique integer identifier for an action. 163cdf0e10cSrcweir 164cdf0e10cSrcweir @param aSmartTagName 165cdf0e10cSrcweir Name of the wanted smart tag type. This is one of the 166cdf0e10cSrcweir names obtained by getSmartTagName() 167cdf0e10cSrcweir 168cdf0e10cSrcweir @param nActionIndex 169cdf0e10cSrcweir The index of the action for the given smart tag type. 170cdf0e10cSrcweir 171cdf0e10cSrcweir @param xController 172cdf0e10cSrcweir The current controller of the document. 173cdf0e10cSrcweir 174cdf0e10cSrcweir @return 175cdf0e10cSrcweir the unique integer identifier for the requested action. 176cdf0e10cSrcweir 177cdf0e10cSrcweir @throws com::sun::star::lang::IllegalArgumentException 178cdf0e10cSrcweir if the specified nActionIndex is greater than the number 179cdf0e10cSrcweir of available actions for the specified smart tag type. 180cdf0e10cSrcweir */ 181cdf0e10cSrcweir long getActionID( [in] string aSmartTagName, [in] long nActionIndex, 182cdf0e10cSrcweir [in] com::sun::star::frame::XController xController ) 183cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 184cdf0e10cSrcweir 185cdf0e10cSrcweir 186cdf0e10cSrcweir //------------------------------------------------------------------------- 187cdf0e10cSrcweir /** obtains a caption for a specified action for use in user 188cdf0e10cSrcweir interfaces. 189cdf0e10cSrcweir 190cdf0e10cSrcweir @param nActionID 191cdf0e10cSrcweir The identifier of the requested action. 192cdf0e10cSrcweir 193cdf0e10cSrcweir @param aApplicationName 194cdf0e10cSrcweir A string containing the name of the calling application. 195cdf0e10cSrcweir 196cdf0e10cSrcweir @param aLocale 197cdf0e10cSrcweir Is used for localization of the caption. 198cdf0e10cSrcweir 199cdf0e10cSrcweir @param xProperties 200cdf0e10cSrcweir Contains additional smart tag properties collected by 201cdf0e10cSrcweir the smart tag recognizer. 202cdf0e10cSrcweir 203cdf0e10cSrcweir @param aText 204cdf0e10cSrcweir The calling application can pass the text of the smart 205cdf0e10cSrcweir tag to the action component. 206cdf0e10cSrcweir 207cdf0e10cSrcweir @param aXML 208cdf0e10cSrcweir A string that is a XML representation of the smart tag. 209cdf0e10cSrcweir 210cdf0e10cSrcweir @param xController 211cdf0e10cSrcweir The current controller of the document. 212cdf0e10cSrcweir 213cdf0e10cSrcweir @param xTarget 214cdf0e10cSrcweir A text range representing the smart tag in the document. 215cdf0e10cSrcweir 216cdf0e10cSrcweir @return 217cdf0e10cSrcweir the caption of the requested action. 218cdf0e10cSrcweir 219cdf0e10cSrcweir @throws com::sun::star::lang::IllegalArgumentException 220cdf0e10cSrcweir if the ActionID is not recognized. 221cdf0e10cSrcweir */ 222cdf0e10cSrcweir string getActionCaptionFromID( [in] long nActionID, 223cdf0e10cSrcweir [in] string aApplicationName, 224cdf0e10cSrcweir [in] ::com::sun::star::lang::Locale aLocale, 225cdf0e10cSrcweir [in] com::sun::star::container::XStringKeyMap xProperties, 226cdf0e10cSrcweir [in] string aText, 227cdf0e10cSrcweir [in] string aXML, 228cdf0e10cSrcweir [in] com::sun::star::frame::XController xController, 229cdf0e10cSrcweir [in] com::sun::star::text::XTextRange xTarget ) 230cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 231cdf0e10cSrcweir 232cdf0e10cSrcweir 233cdf0e10cSrcweir //------------------------------------------------------------------------- 234*a893be29SPedro Giffuni /** obtains a language independent name of an action. 235cdf0e10cSrcweir 236cdf0e10cSrcweir @param nActionID 237cdf0e10cSrcweir The identifier of the requested action. 238cdf0e10cSrcweir 239cdf0e10cSrcweir @param xController 240cdf0e10cSrcweir The current controller of the document. 241cdf0e10cSrcweir 242cdf0e10cSrcweir @return 243*a893be29SPedro Giffuni the language independent name of the specified action. 244cdf0e10cSrcweir 245cdf0e10cSrcweir @throws com::sun::star::lang::IllegalArgumentException 246cdf0e10cSrcweir if the ActionID is not recognized. 247cdf0e10cSrcweir */ 248cdf0e10cSrcweir string getActionNameFromID( [in] long nActionID, 249b6a68018SJürgen Schmidt [in] com::sun::star::frame::XController xController) 250cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 251cdf0e10cSrcweir 252cdf0e10cSrcweir 253cdf0e10cSrcweir //------------------------------------------------------------------------- 254cdf0e10cSrcweir /** invokes an action. 255cdf0e10cSrcweir 256cdf0e10cSrcweir @param nActionID 257cdf0e10cSrcweir The identifier of the requested action. 258cdf0e10cSrcweir 259cdf0e10cSrcweir @param aApplicationName 260cdf0e10cSrcweir A string containing the name of the calling application. 261cdf0e10cSrcweir 262cdf0e10cSrcweir @param xController 263cdf0e10cSrcweir The current controller of the document. 264cdf0e10cSrcweir 265cdf0e10cSrcweir @param xTarget 266cdf0e10cSrcweir A text range representing the smart tag in the document. 267cdf0e10cSrcweir 268cdf0e10cSrcweir @param xProperties 269cdf0e10cSrcweir Contains the smart tag properties collected by the smart 270cdf0e10cSrcweir tag recognizer. 271cdf0e10cSrcweir 272cdf0e10cSrcweir @param aText 273cdf0e10cSrcweir The calling application can pass the text of the smart 274cdf0e10cSrcweir tag to the action component. 275cdf0e10cSrcweir 276cdf0e10cSrcweir @param aXML 277cdf0e10cSrcweir A string that is a XML representation of the smart tag. 278cdf0e10cSrcweir 279cdf0e10cSrcweir @param aLocale 280cdf0e10cSrcweir Is used for localization of the action. 281cdf0e10cSrcweir 282cdf0e10cSrcweir @throws com::sun::star::lang::IllegalArgumentException 283cdf0e10cSrcweir if the ActionID is not recognized. 284cdf0e10cSrcweir */ 285cdf0e10cSrcweir void invokeAction( [in] long nActionID, 286cdf0e10cSrcweir [in] string aApplicationName, 287cdf0e10cSrcweir [in] com::sun::star::frame::XController xController, 288cdf0e10cSrcweir [in] com::sun::star::text::XTextRange xTarget, 289cdf0e10cSrcweir [in] com::sun::star::container::XStringKeyMap xProperties, 290cdf0e10cSrcweir [in] string aText, 291cdf0e10cSrcweir [in] string aXML, 292cdf0e10cSrcweir [in] ::com::sun::star::lang::Locale aLocale ) 293cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 294cdf0e10cSrcweir 295cdf0e10cSrcweir 296cdf0e10cSrcweir //------------------------------------------------------------------------- 297cdf0e10cSrcweir /** determines whether a caption is dynamic. 298cdf0e10cSrcweir 299cdf0e10cSrcweir @param nActionID 300cdf0e10cSrcweir The identifier of the requested action. 301cdf0e10cSrcweir 302cdf0e10cSrcweir @param aApplicationName 303cdf0e10cSrcweir A string containing the name of the calling application. 304cdf0e10cSrcweir 305cdf0e10cSrcweir @param xController 306cdf0e10cSrcweir The current controller of the document. 307cdf0e10cSrcweir 308cdf0e10cSrcweir @param aLocale 309cdf0e10cSrcweir Is used for localization. 310cdf0e10cSrcweir 311cdf0e10cSrcweir @return 312cdf0e10cSrcweir a boolean indicating whether the caption is dynamic. 313cdf0e10cSrcweir 314cdf0e10cSrcweir @throws com::sun::star::lang::IllegalArgumentException 315cdf0e10cSrcweir if the ActionID is not recognized. 316cdf0e10cSrcweir */ 317cdf0e10cSrcweir boolean isCaptionDynamic( [in] long nActionID, 318cdf0e10cSrcweir [in] string aApplicationName, 319cdf0e10cSrcweir [in] com::sun::star::frame::XController xController, 320cdf0e10cSrcweir [in] ::com::sun::star::lang::Locale aLocale ) 321cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 322cdf0e10cSrcweir 323cdf0e10cSrcweir 324cdf0e10cSrcweir //------------------------------------------------------------------------- 325cdf0e10cSrcweir /** determines whether the smart tag indicator should be visible. 326cdf0e10cSrcweir 327cdf0e10cSrcweir @param nActionID 328cdf0e10cSrcweir The identifier of the requested action. 329cdf0e10cSrcweir 330cdf0e10cSrcweir @param aApplicationName 331cdf0e10cSrcweir A string containing the name of the calling application. 332cdf0e10cSrcweir 333cdf0e10cSrcweir @param xController 334cdf0e10cSrcweir The current controller of the document. 335cdf0e10cSrcweir 336cdf0e10cSrcweir @param aLocale 337cdf0e10cSrcweir Is used for localization. 338cdf0e10cSrcweir 339cdf0e10cSrcweir @return 340cdf0e10cSrcweir a boolean indicating whether the smart tag indicator 341cdf0e10cSrcweir should be visible. 342cdf0e10cSrcweir 343cdf0e10cSrcweir @throws com::sun::star::lang::IllegalArgumentException 344cdf0e10cSrcweir if the ActionID is not recognized. 345cdf0e10cSrcweir */ 346cdf0e10cSrcweir boolean isShowSmartTagIndicator( [in] long nActionID, 347cdf0e10cSrcweir [in] string aApplicationName, 348cdf0e10cSrcweir [in] com::sun::star::frame::XController xController, 349cdf0e10cSrcweir [in] ::com::sun::star::lang::Locale aLocale ) 350cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 351cdf0e10cSrcweir}; 352cdf0e10cSrcweir 353cdf0e10cSrcweir}; }; }; }; 354cdf0e10cSrcweir 355cdf0e10cSrcweir#endif 356