20#ifndef INCLUDED_SVX_SMARTTAGMGR_HXX
21#define INCLUDED_SVX_SMARTTAGMGR_HXX
24#include <com/sun/star/uno/Reference.hxx>
25#include <com/sun/star/uno/Sequence.hxx>
26#include <com/sun/star/util/XModifyListener.hpp>
27#include <com/sun/star/util/XChangesListener.hpp>
37 class XComponentContext;
41 class XSmartTagRecognizer;
42 class XSmartTagAction;
77 ActionReference( css::uno::Reference< css::smarttags::XSmartTagAction > xSmartTagAction, sal_Int32 nSmartTagIndex )
87 css::util::XChangesListener >
92 std::vector< css::uno::Reference< css::smarttags::XSmartTagRecognizer > >
maRecognizerList;
93 std::vector< css::uno::Reference< css::smarttags::XSmartTagAction > >
maActionList;
96 mutable css::uno::Reference< css::i18n::XBreakIterator >
mxBreakIter;
97 css::uno::Reference< css::uno::XComponentContext>
mxContext;
104 void LoadLibraries();
108 void PrepareConfiguration( std::u16string_view rConfigurationGroupName );
112 void ReadConfiguration(
bool bExcludedTypes,
bool bRecognize );
116 void RegisterListener();
120 void AssociateActionsWithRecognizers();
130 void Init( std::u16string_view rConfigurationGroupName );
154 void RecognizeString(
const OUString& rText,
155 const css::uno::Reference< css::text::XTextMarkup >& rMarkup,
156 const css::uno::Reference< css::frame::XController >& rController,
157 const css::lang::Locale& rLocale,
158 sal_uInt32 nStart, sal_uInt32 nLen )
const;
160 void RecognizeTextRange(
const css::uno::Reference< css::text::XTextRange>& rRange,
161 const css::uno::Reference< css::text::XTextMarkup >& rMarkup,
162 const css::uno::Reference< css::frame::XController >& rController)
const;
175 void GetActionSequences( std::vector< OUString >& rSmartTagTypes,
176 css::uno::Sequence < css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > >& rActionComponentsSequence,
177 css::uno::Sequence < css::uno::Sequence< sal_Int32 > >& rActionIndicesSequence )
const;
187 OUString GetSmartTagCaption(
const OUString& rSmartTagType,
const css::lang::Locale& rLocale )
const;
191 bool IsSmartTagTypeEnabled(
const OUString& rSmartTagType )
const;
203 css::uno::Reference< css::smarttags::XSmartTagRecognizer >
const &
209 IsLabelTextWithSmartTags(); }
213 void WriteConfiguration(
const bool* bLabelTextWithSmartTags,
214 const std::vector< OUString >* pDisabledTypes )
const;
221 virtual void SAL_CALL disposing(
const css::lang::EventObject& Source )
override;
224 virtual void SAL_CALL modified(
const css::lang::EventObject& aEvent )
override;
227 virtual void SAL_CALL changesOccurred(
const css::util::ChangesEvent& Event )
override;
The smart tag manager maintains all installed action and recognizer services.
css::uno::Reference< css::beans::XPropertySet > mxConfigurationSettings
bool IsLabelTextWithSmartTags() const
Enable or disable smart tags.
css::uno::Reference< css::uno::XComponentContext > mxContext
const OUString & GetApplicationName() const
Returns the name of the application this instance has been created by.
sal_uInt32 NumberOfRecognizers() const
Returns the number of registered recognizers.
std::vector< css::uno::Reference< css::smarttags::XSmartTagAction > > maActionList
std::vector< css::uno::Reference< css::smarttags::XSmartTagRecognizer > > maRecognizerList
const OUString maApplicationName
std::set< OUString > maDisabledSmartTagTypes
css::uno::Reference< css::i18n::XBreakIterator > mxBreakIter
bool mbLabelTextWithSmartTags
css::uno::Reference< css::smarttags::XSmartTagRecognizer > const & GetRecognizer(sal_uInt32 i) const
Returns a recognizer.
std::multimap< OUString, ActionReference > maSmartTagMap
bool IsSmartTagsEnabled() const
Is smart tag recognition active?
class SAL_NO_VTABLE XPropertySet
A reference to a smart tag action.
sal_Int32 mnSmartTagIndex
css::uno::Reference< css::smarttags::XSmartTagAction > mxSmartTagAction
ActionReference(css::uno::Reference< css::smarttags::XSmartTagAction > xSmartTagAction, sal_Int32 nSmartTagIndex)