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>
36 class XComponentContext;
40 class XSmartTagRecognizer;
41 class XSmartTagAction;
76 ActionReference( css::uno::Reference< css::smarttags::XSmartTagAction >
const & xSmartTagAction, sal_Int32 nSmartTagIndex )
86 css::util::XChangesListener >
91 std::vector< css::uno::Reference< css::smarttags::XSmartTagRecognizer > >
maRecognizerList;
92 std::vector< css::uno::Reference< css::smarttags::XSmartTagAction > >
maActionList;
95 mutable css::uno::Reference< css::i18n::XBreakIterator >
mxBreakIter;
96 css::uno::Reference< css::uno::XComponentContext>
mxContext;
103 void LoadLibraries();
107 void PrepareConfiguration( std::u16string_view rConfigurationGroupName );
111 void ReadConfiguration(
bool bExcludedTypes,
bool bRecognize );
115 void RegisterListener();
119 void AssociateActionsWithRecognizers();
129 void Init( std::u16string_view rConfigurationGroupName );
153 void RecognizeString(
const OUString& rText,
154 const css::uno::Reference< css::text::XTextMarkup >& rMarkup,
155 const css::uno::Reference< css::frame::XController >& rController,
156 const css::lang::Locale& rLocale,
157 sal_uInt32 nStart, sal_uInt32 nLen )
const;
159 void RecognizeTextRange(
const css::uno::Reference< css::text::XTextRange>& rRange,
160 const css::uno::Reference< css::text::XTextMarkup >& rMarkup,
161 const css::uno::Reference< css::frame::XController >& rController)
const;
174 void GetActionSequences( std::vector< OUString >& rSmartTagTypes,
175 css::uno::Sequence < css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > >& rActionComponentsSequence,
176 css::uno::Sequence < css::uno::Sequence< sal_Int32 > >& rActionIndicesSequence )
const;
186 OUString GetSmartTagCaption(
const OUString& rSmartTagType,
const css::lang::Locale& rLocale )
const;
190 bool IsSmartTagTypeEnabled(
const OUString& rSmartTagType )
const;
202 css::uno::Reference< css::smarttags::XSmartTagRecognizer >
const &
208 IsLabelTextWithSmartTags(); }
212 void WriteConfiguration(
const bool* bLabelTextWithSmartTags,
213 const std::vector< OUString >* pDisabledTypes )
const;
220 virtual void SAL_CALL disposing(
const css::lang::EventObject& Source )
override;
223 virtual void SAL_CALL modified(
const css::lang::EventObject& aEvent )
override;
226 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
ActionReference(css::uno::Reference< css::smarttags::XSmartTagAction > const &xSmartTagAction, sal_Int32 nSmartTagIndex)
css::uno::Reference< css::smarttags::XSmartTagAction > mxSmartTagAction