10#ifndef INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX
11#define INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX
13#include <com/sun/star/uno/Reference.hxx>
14#include <com/sun/star/lang/XComponent.hpp>
15#include <com/sun/star/frame/XModel.hpp>
16#include <com/sun/star/drawing/XDrawPage.hpp>
19#include <rtl/ustring.hxx>
69 std::vector<::Size>& aPageSizes, sal_Int32 nPages,
76 addPagesToDraw(
const uno::Reference<XComponent>& xComponent, sal_Int32 nPages,
77 const std::vector<GDIMetaFile>& aMetaFiles,
78 const std::vector<::Size>& aPageSizes,
const PageMargins& aPageMargins,
79 const std::vector<std::pair<RedactionTarget, OUString>>& r_aTableTargets,
106 std::vector<tools::Rectangle>& aRedactionRectangles,
107 const uno::Reference<XComponent>& xComponent);
113 const uno::Reference<drawing::XDrawPage>& xPage,
114 const std::vector<tools::Rectangle>& aNewRectangles);
122 const uno::Reference<drawing::XDrawPage>& xPage,
123 const uno::Reference<XComponent>& xComponent);
131 u"\\b(?:\\d[ -]*?){13,16}\\b",
132 u"\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\\b",
133 u"\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
134 "\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
136 u"([12]\\d{3}[./-](0[1-9]|1[0-2])[./"
137 "-](0[1-9]|[12]\\d|3[01]))|((0[1-9]|[12]\\d|3[01])[./-](0[1-9]|1[0-2])[./"
139 u"\\s*[a-zA-Z]{2}(?:\\s*\\d\\s*){6}[a-zA-Z]?\\s*",
140 u"([1-9])(?!\\1{2}-\\1{2}-\\1{4})[1-9]{2}-[1-9]{2}-[1-9]{4}"
static void addPagesToDraw(const uno::Reference< XComponent > &xComponent, sal_Int32 nPages, const std::vector< GDIMetaFile > &aMetaFiles, const std::vector<::Size > &aPageSizes, const PageMargins &aPageMargins, const std::vector< std::pair< RedactionTarget, OUString > > &r_aTableTargets, bool bIsAutoRedact)
static void fillSearchOptions(i18nutil::SearchOptions2 &rSearchOpt, const RedactionTarget &rTarget)
Fill the search options based on the given redaction target.
static void autoRedactPage(const RedactionTarget &rRedactionTarget, const GDIMetaFile &rGDIMetaFile, const uno::Reference< drawing::XDrawPage > &xPage, const uno::Reference< XComponent > &xComponent)
static constexpr std::u16string_view m_aPredefinedTargets[6]
static void addRedactionRectToPage(const uno::Reference< XComponent > &xComponent, const uno::Reference< drawing::XDrawPage > &xPage, const std::vector< tools::Rectangle > &aNewRectangles)
static PageMargins getPageMarginsForCalc(const css::uno::Reference< css::frame::XModel > &xModel)
static OUString getStringParam(const SfxRequest &rReq, sal_uInt16 nParamId)
static PageMargins getPageMarginsForWriter(const css::uno::Reference< css::frame::XModel > &xModel)
static void showRedactionToolbar(const SfxViewFrame *pViewFrame)
static void searchInMetaFile(const RedactionTarget &rRedactionTarget, const GDIMetaFile &rMtf, std::vector< tools::Rectangle > &aRedactionRectangles, const uno::Reference< XComponent > &xComponent)
static bool isRedactMode(const SfxRequest &rReq)
Checks to see if the request has a parameter of IsRedactMode:bool=true.
static void getPageMetaFilesFromDoc(std::vector< GDIMetaFile > &aMetaFiles, std::vector<::Size > &aPageSizes, sal_Int32 nPages, DocumentToGraphicRenderer &aRenderer)
Keeps information for a single redaction target.
Reference< XModel > xModel