12#include <com/sun/star/drawing/XShape.hpp>
13#include <com/sun/star/graphic/GraphicProvider.hpp>
14#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
21#include <config_folders.h>
22#include <rtl/bootstrap.hxx>
28#include <svx/strings.hrc>
43 OUString aType = rType;
46 aType =
"signature-line.svg";
48 OUString aPath(
"$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER
"/filter/" + aType);
49 rtl::Bootstrap::expandMacros(aPath);
53 SAL_WARN(
"cui.dialogs",
"failed to open " << aType);
57 return OUString::fromUtf8(svg);
73 uno::Reference<security::XDocumentDigitalSignatures> xSigner;
76 xSigner = security::DocumentDigitalSignatures::createDefault(
81 OUString
const aODFVersion(
83 xSigner = security::DocumentDigitalSignatures::createWithVersion(
86 xSigner->setParentWindow(pParent->
GetXWindow());
87 OUString aDescription;
88 security::CertificateKind certificateKind = security::CertificateKind_NONE;
92 certificateKind = security::CertificateKind_X509;
94 uno::Reference<security::XCertificate> xSignCertificate
95 = xSigner->selectSigningCertificateWithType(certificateKind, aDescription);
96 return xSignCertificate;
99OUString
getSignerName(
const css::uno::Reference<css::security::XCertificate>& xCertificate)
102 xCertificate->getCertificateKind());
110 return rLocaleData.
getDate(aDateTime);
113uno::Reference<graphic::XGraphic>
importSVG(std::u16string_view rSVG)
119 uno::Reference<graphic::XGraphicProvider> xProvider
120 = graphic::GraphicProvider::create(xContext);
123 "InputStream", xInputStream) };
124 uno::Reference<graphic::XGraphic> xGraphic(xProvider->queryGraphic(aMediaProperties));
129 const css::uno::Reference<css::security::XCertificate>& xCertificate)
145 uno::Reference<drawing::XShape> xShape = pSignatureLine->
getUnoShape();
146 uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY);
148 aMap[
"SignatureCertificate"] <<= xCertificate;
149 xShapeProps->setPropertyValue(
"InteropGrabBag",
uno::Any(
aMap.getAsConstPropertyValueList()));
153 aSvgImage = aSvgImage.replaceAll(
"[SIGNED_BY]",
SvxResId(RID_SVXSTR_SIGNATURELINE_DSIGNED_BY));
155 aSvgImage = aSvgImage.replaceAll(
"[SIGNER_NAME]", aSignerName);
157 aDate =
SvxResId(RID_SVXSTR_SIGNATURELINE_DATE).replaceFirst(
"%1", aDate);
158 aSvgImage = aSvgImage.replaceAll(
"[DATE]", aDate);
161 xShapeProps->setPropertyValue(
"Graphic",
uno::Any(xGraphic));
OUString getDate(const Date &rDate) const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
Everything a View needs to know about a selected object.
SdrObject * GetMarkedSdrObj() const
virtual css::uno::Reference< css::drawing::XShape > getUnoShape()
const std::shared_ptr< const SfxFilter > & GetFilter() const
SfxMedium * GetMedium() const
css::uno::Reference< css::embed::XStorage > const & GetStorage()
SvStream & WriteOString(std::string_view rStr)
sal_uInt64 remainingSize()
const LocaleDataWrapper & GetLocaleData() const
static OUString GetODFVersionFromStorage(const css::uno::Reference< css::embed::XStorage > &xStorage)
virtual css::uno::Reference< css::awt::XWindow > GetXWindow()=0
OUString SvxResId(TranslateId aId)
#define SAL_WARN(area, stream)
OUString GetContentPart(const OUString &_rRawString, const css::security::CertificateKind &rKind)
Reference< XComponentContext > getProcessComponentContext()
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
OUString getSignerName(const css::uno::Reference< css::security::XCertificate > &xCertificate)
Get a signer name out of a certificate.
uno::Reference< graphic::XGraphic > importSVG(std::u16string_view rSVG)
Interprets rSVG as a graphic and gives back the resulting UNO wrapper.
uno::Reference< security::XCertificate > getSignatureCertificate(SfxObjectShell *pShell, weld::Window *pParent)
Choose a signature for signature line purposes.
void setShapeCertificate(const SdrView *pView, const css::uno::Reference< css::security::XCertificate > &xCertificate)
Sets xCertificate as the signing certificate of the selected shape on pView.
OUString getSignatureImage(const OUString &rType)
Returns an SVG template.
OUString getLocalizedDate()
Gets a localized date string.
HashMap_OWString_Interface aMap
TOOLS_DLLPUBLIC OString read_uInt8s_ToOString(SvStream &rStrm, std::size_t nUnits)