diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
commit | ed5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch) | |
tree | 7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /offapi/com/sun/star/smarttags | |
parent | Initial commit. (diff) | |
download | libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.tar.xz libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.zip |
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'offapi/com/sun/star/smarttags')
6 files changed, 734 insertions, 0 deletions
diff --git a/offapi/com/sun/star/smarttags/SmartTagAction.idl b/offapi/com/sun/star/smarttags/SmartTagAction.idl new file mode 100644 index 000000000..3e494dd09 --- /dev/null +++ b/offapi/com/sun/star/smarttags/SmartTagAction.idl @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_smarttags_SmartTagAction_idl__ +#define __com_sun_star_smarttags_SmartTagAction_idl__ + + +module com { module sun { module star { module smarttags { + interface XSmartTagAction; }; +}; }; }; + + +module com { module sun { module star { module smarttags { + + +/** provides one or more actions for smart tags. + + <p>An implementation of this service defines one or more actions + that can be performed for a smart tag which has been recognized + by a SmartTagRecognizer service.</p> + + @since OOo 2.3 + */ + +service SmartTagAction : XSmartTagAction {}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/smarttags/SmartTagRecognizer.idl b/offapi/com/sun/star/smarttags/SmartTagRecognizer.idl new file mode 100644 index 000000000..95b1d1b39 --- /dev/null +++ b/offapi/com/sun/star/smarttags/SmartTagRecognizer.idl @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_smarttags_SmartTagRecognizer_idl__ +#define __com_sun_star_smarttags_SmartTagRecognizer_idl__ + + +module com { module sun { module star { module smarttags { + interface XSmartTagRecognizer; }; +}; }; }; + + +module com { module sun { module star { module smarttags { + + +/** recognizes smart tags. + + <p>Implementations of this service are used to scan the document + text for smart tags. Smart tags are pieces of text that can be + associated with specific actions which are defined by + implementations of the SmartTagAction service.</p> + + @since OOo 2.3 + */ + +service SmartTagRecognizer : XSmartTagRecognizer {}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/smarttags/SmartTagRecognizerMode.idl b/offapi/com/sun/star/smarttags/SmartTagRecognizerMode.idl new file mode 100644 index 000000000..c1380d522 --- /dev/null +++ b/offapi/com/sun/star/smarttags/SmartTagRecognizerMode.idl @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_smarttags_SmartTagRecognizerMode_idl__ +#define __com_sun_star_smarttags_SmartTagRecognizerMode_idl__ + + + module com { module sun { module star { module smarttags { + + +/** specifies the which type of text is passed to + XSmartTagRecognizer::recognize()</p> + + @since OOo 2.3 + */ + +enum SmartTagRecognizerMode +{ + /// Text passed to the recognizer is a single character. + CHAR, + + /// Text passed to the recognizer is a single word. + SINGLE_WORD, + + /// Text passed to the recognizer is a paragraph. + PARAGRAPH, + + /// Text passed to the recognizer is a cell. + CELL +}; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/smarttags/XRangeBasedSmartTagRecognizer.idl b/offapi/com/sun/star/smarttags/XRangeBasedSmartTagRecognizer.idl new file mode 100644 index 000000000..9a781d623 --- /dev/null +++ b/offapi/com/sun/star/smarttags/XRangeBasedSmartTagRecognizer.idl @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_smarttags_XRangeBasedSmartTagRecognizer_idl__ +#define __com_sun_star_smarttags_XRangeBasedSmartTagRecognizer_idl__ + +#include <com/sun/star/lang/XInitialization.idl> +#include <com/sun/star/lang/Locale.idl> +#include <com/sun/star/smarttags/SmartTagRecognizerMode.idl> +#include <com/sun/star/text/XTextMarkup.idl> +#include <com/sun/star/frame/XController.idl> +#include <com/sun/star/lang/IndexOutOfBoundsException.idl> +#include <com/sun/star/text/XTextRange.idl> + +module com { module sun { module star { module smarttags { + +/** + provides access to a range based smart tag recognizer. + */ + +interface XRangeBasedSmartTagRecognizer: com::sun::star::lang::XInitialization +{ + /** recognizes smart tags. + + @param xRange + The text that should be scanned by the recognizer. + + @param eDataType + This value indicates the type of the passed text. + + @param xTextMarkup + This object is used to submit any recognized smart tags + to the calling application. + + @param aApplicationName + A string containing the name of the calling application. + + @param xController + The current controller of the document. + */ + + void recognizeTextRange( [in] com::sun::star::text::XTextRange xRange, + [in] SmartTagRecognizerMode eDataType, + [in] com::sun::star::text::XTextMarkup xTextMarkup, + [in] string aApplicationName, + [in] com::sun::star::frame::XController xController); +}; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/smarttags/XSmartTagAction.idl b/offapi/com/sun/star/smarttags/XSmartTagAction.idl new file mode 100644 index 000000000..9a94844ba --- /dev/null +++ b/offapi/com/sun/star/smarttags/XSmartTagAction.idl @@ -0,0 +1,323 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_smarttags_XSmartTagAction_idl__ +#define __com_sun_star_smarttags_XSmartTagAction_idl__ + +#include <com/sun/star/container/XStringKeyMap.idl> +#include <com/sun/star/lang/XInitialization.idl> +#include <com/sun/star/lang/Locale.idl> +#include <com/sun/star/text/XTextRange.idl> +#include <com/sun/star/frame/XController.idl> +#include <com/sun/star/lang/IndexOutOfBoundsException.idl> +#include <com/sun/star/lang/IllegalArgumentException.idl> + + +module com { module sun { module star { module smarttags { + + +/** provides access to smart tag actions. + + @since OOo 2.3 + */ + +interface XSmartTagAction: com::sun::star::lang::XInitialization +{ + /** obtains a name that describes this action component. + + @param aLocale + Is used for localization of the name. + + @return + the name describing the action component. + */ + string getName( [in] ::com::sun::star::lang::Locale aLocale ); + + + /** obtains a detailed description of this action component. + + @param aLocale + Is used for localization of the description. + + @return + the description of the action component. + */ + string getDescription( [in] ::com::sun::star::lang::Locale aLocale ); + + + /** the number of smart tag types supported by this action + component. + */ + [attribute, readonly] long SmartTagCount; + + + /** obtains the name of one specific smart tag type supported by + this action component. + + @param nSmartTagIndex + Index of the wanted smart tag type. Value needs to be + between 0 and the number of smarttags available + (exclusively). + + @return + a unique name of the smart tag type. Smart tag type + names are always in the format of namespaceURI#tagname. + + @throws com::sun::star::lang::IndexOutOfBoundsException + if nSmartTagIndex is greater than SmartTagCount. + */ + string getSmartTagName( [in] long nSmartTagIndex) + raises( com::sun::star::lang::IndexOutOfBoundsException ); + + + /** obtains the caption of the smart tag type for using in user + interfaces. + + @param nSmartTagIndex + Index of the wanted smart tag type. Value needs to be + between 0 and the number of smarttags available + (exclusively). + + @param aLocale + Is used for localization of the caption. + + @return + the caption associated with the smart tag type. + + @throws com::sun::star::lang::IndexOutOfBoundsException + if nSmartTagIndex is greater than SmartTagCount + */ + string getSmartTagCaption( [in] long nSmartTagIndex, + [in] ::com::sun::star::lang::Locale aLocale) + raises( com::sun::star::lang::IndexOutOfBoundsException ); + + + /** obtains the number of actions provided for a specified smart tag + type. + + @param aSmartTagName + Name of the wanted smart tag type. This is one of the + names obtained by getSmartTagName() + + @param xController + The current controller of the document. + + @param xProperties + Contains the smart tag properties collected by the smart + tag recognizer. + + @return + the number of actions available for the given smart tag + type. + */ + long getActionCount( [in] string aSmartTagName, + [in] com::sun::star::frame::XController xController, + [in] com::sun::star::container::XStringKeyMap xProperties); + + /** obtains a unique integer identifier for an action. + + @param aSmartTagName + Name of the wanted smart tag type. This is one of the + names obtained by getSmartTagName() + + @param nActionIndex + The index of the action for the given smart tag type. + + @param xController + The current controller of the document. + + @return + the unique integer identifier for the requested action. + + @throws com::sun::star::lang::IllegalArgumentException + if the specified nActionIndex is greater than the number + of available actions for the specified smart tag type. + */ + long getActionID( [in] string aSmartTagName, [in] long nActionIndex, + [in] com::sun::star::frame::XController xController ) + raises( com::sun::star::lang::IllegalArgumentException ); + + + /** obtains a caption for a specified action for use in user + interfaces. + + @param nActionID + The identifier of the requested action. + + @param aApplicationName + A string containing the name of the calling application. + + @param aLocale + Is used for localization of the caption. + + @param xProperties + Contains additional smart tag properties collected by + the smart tag recognizer. + + @param aText + The calling application can pass the text of the smart + tag to the action component. + + @param aXML + A string that is a XML representation of the smart tag. + + @param xController + The current controller of the document. + + @param xTarget + A text range representing the smart tag in the document. + + @return + the caption of the requested action. + + @throws com::sun::star::lang::IllegalArgumentException + if the ActionID is not recognized. + */ + string getActionCaptionFromID( [in] long nActionID, + [in] string aApplicationName, + [in] ::com::sun::star::lang::Locale aLocale, + [in] com::sun::star::container::XStringKeyMap xProperties, + [in] string aText, + [in] string aXML, + [in] com::sun::star::frame::XController xController, + [in] com::sun::star::text::XTextRange xTarget ) + raises( com::sun::star::lang::IllegalArgumentException ); + + + /** obtains a language independent name of an action. + + @param nActionID + The identifier of the requested action. + + @param xController + The current controller of the document. + + @return + the language independent name of the specified action. + + @throws com::sun::star::lang::IllegalArgumentException + if the ActionID is not recognized. + */ + string getActionNameFromID( [in] long nActionID, + [in] com::sun::star::frame::XController xController) + raises( com::sun::star::lang::IllegalArgumentException ); + + + /** invokes an action. + + @param nActionID + The identifier of the requested action. + + @param aApplicationName + A string containing the name of the calling application. + + @param xController + The current controller of the document. + + @param xTarget + A text range representing the smart tag in the document. + + @param xProperties + Contains the smart tag properties collected by the smart + tag recognizer. + + @param aText + The calling application can pass the text of the smart + tag to the action component. + + @param aXML + A string that is a XML representation of the smart tag. + + @param aLocale + Is used for localization of the action. + + @throws com::sun::star::lang::IllegalArgumentException + if the ActionID is not recognized. + */ + void invokeAction( [in] long nActionID, + [in] string aApplicationName, + [in] com::sun::star::frame::XController xController, + [in] com::sun::star::text::XTextRange xTarget, + [in] com::sun::star::container::XStringKeyMap xProperties, + [in] string aText, + [in] string aXML, + [in] ::com::sun::star::lang::Locale aLocale ) + raises( com::sun::star::lang::IllegalArgumentException ); + + + /** determines whether a caption is dynamic. + + @param nActionID + The identifier of the requested action. + + @param aApplicationName + A string containing the name of the calling application. + + @param xController + The current controller of the document. + + @param aLocale + Is used for localization. + + @return + a boolean indicating whether the caption is dynamic. + + @throws com::sun::star::lang::IllegalArgumentException + if the ActionID is not recognized. + */ + boolean isCaptionDynamic( [in] long nActionID, + [in] string aApplicationName, + [in] com::sun::star::frame::XController xController, + [in] ::com::sun::star::lang::Locale aLocale ) + raises( com::sun::star::lang::IllegalArgumentException ); + + + /** determines whether the smart tag indicator should be visible. + + @param nActionID + The identifier of the requested action. + + @param aApplicationName + A string containing the name of the calling application. + + @param xController + The current controller of the document. + + @param aLocale + Is used for localization. + + @return + a boolean indicating whether the smart tag indicator + should be visible. + + @throws com::sun::star::lang::IllegalArgumentException + if the ActionID is not recognized. + */ + boolean isShowSmartTagIndicator( [in] long nActionID, + [in] string aApplicationName, + [in] com::sun::star::frame::XController xController, + [in] ::com::sun::star::lang::Locale aLocale ) + raises( com::sun::star::lang::IllegalArgumentException ); +}; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl b/offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl new file mode 100644 index 000000000..4310a1747 --- /dev/null +++ b/offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl @@ -0,0 +1,194 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_smarttags_XSmartTagRecognizer_idl__ +#define __com_sun_star_smarttags_XSmartTagRecognizer_idl__ + +#include <com/sun/star/lang/XInitialization.idl> +#include <com/sun/star/lang/Locale.idl> +#include <com/sun/star/i18n/XBreakIterator.idl> +#include <com/sun/star/smarttags/SmartTagRecognizerMode.idl> +#include <com/sun/star/text/XTextMarkup.idl> +#include <com/sun/star/text/XTextRange.idl> +#include <com/sun/star/frame/XController.idl> +#include <com/sun/star/lang/IndexOutOfBoundsException.idl> + +module com { module sun { module star { module smarttags { + + +/** + provides access to a smart tag recognizer. + + @since OOo 2.3 + */ + +interface XSmartTagRecognizer: com::sun::star::lang::XInitialization +{ + /** obtains a name that describes this recognizer component. + + @param aLocale + Is used for localization of the name. + + @return + the name of the recognizer component. + */ + string getName( [in] ::com::sun::star::lang::Locale aLocale ); + + + /** obtains a detailed description of this recognizer component. + + @param aLocale + Is used for localization of the description. + + @return + the description of the recognizer component. + */ + string getDescription( [in] ::com::sun::star::lang::Locale aLocale ); + + + /** The number of smart tag types supported by this recognizer + component. + */ + [attribute, readonly] long SmartTagCount; + + + /** obtains the name of one specific smart tag type supported by + this recognizer component. + + @param nSmartTagIndex + Index of the wanted smart tag type. Value needs to be + between 0 and the number of smarttags available + (exclusively). + + @return + the unique name of the smart tag type. Smart tag type + names are always in the format of namespaceURI#tagname. + + @throws com::sun::star::lang::IndexOutOfBoundsException + if nSmartTagIndex is greater than SmartTagCount + */ + string getSmartTagName( [in] long nSmartTagIndex ) + raises( com::sun::star::lang::IndexOutOfBoundsException ); + + + /** obtains the URL that can be used to download new or updated + recognizers. + + @param nSmartTagIndex + Index of the wanted smart tag type. Value needs to be + between 0 and the number of smarttags available + (exclusively). + + @return + the download URL. + + @throws com::sun::star::lang::IndexOutOfBoundsException + if nSmartTagIndex is greater than SmartTagCount + */ + string getSmartTagDownloadURL( [in] long nSmartTagIndex ) + raises( com::sun::star::lang::IndexOutOfBoundsException ); + + + /** recognizes smart tags. + + @param aText + The text that should be scanned by the recognizer. aText + is UTF-16 encoded. + + @param nStart + Denotes the start position of the region to scan. + + @param nLength + Denotes the length of the text to scan. + + @param eDataType + This value indicates the type of the passed text. + + @param aLocale + Is used to indicate the language of the passed text. + + @param xTextMarkup + This object is used to submit any recognized smart tags + to the calling application. + + @param aApplicationName + A string containing the name of the calling application. + + @param xController + The current controller of the document. + + @param xTokenizer + This can be used to tokenize the string to recognize. + */ + void recognize( [in] string aText, + [in] long nStart, + [in] long nLength, + [in] SmartTagRecognizerMode eDataType, + [in] com::sun::star::lang::Locale aLocale, + [in] com::sun::star::text::XTextMarkup xTextMarkup, + [in] string aApplicationName, + [in] com::sun::star::frame::XController xController, + [in] com::sun::star::i18n::XBreakIterator xTokenizer ); + + /** indicates whether there is a property page for a smart tag type. + + @param nSmartTagIndex + Index of the wanted smart tag type. Value needs to be + between 0 and the number of smarttags available + (exclusively). + + @param aLocale + Is used for localization of the property page. + + @return + true if there is a property page matching the requested + smart tag type and locale. + + @throws com::sun::star::lang::IndexOutOfBoundsException + if nSmartTagIndex is greater than SmartTagCount + */ + boolean hasPropertyPage( [in] long nSmartTagIndex, + [in] ::com::sun::star::lang::Locale aLocale ) + raises( com::sun::star::lang::IndexOutOfBoundsException ); + + + /** launches the property page for a smart tag type. + + @param nSmartTagIndex + Index of the wanted smart tag type. Value needs to be + between 0 and the number of smarttags available + (exclusively). + + @param aLocale + Is used for localization of the property page. + + @throws com::sun::star::lang::IndexOutOfBoundsException + if nSmartTagIndex is greater than SmartTagCount + */ + void displayPropertyPage( [in] long nSmartTagIndex, + [in] ::com::sun::star::lang::Locale aLocale ) + raises( com::sun::star::lang::IndexOutOfBoundsException ); + +}; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |