1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_UNOTEST_MACROS_TEST_HXX
11 #define INCLUDED_UNOTEST_MACROS_TEST_HXX
13 #include <sal/config.h>
17 #include <config_gpgme.h>
18 #include <rtl/ustring.hxx>
19 #include <unotest/detail/unotestdllapi.hxx>
21 #include <com/sun/star/lang/XComponent.hpp>
22 #include <com/sun/star/frame/XDesktop2.hpp>
23 #include <com/sun/star/uno/Any.h>
28 OUString sFileBaseName
;
44 namespace com::sun::star::security
48 namespace com::sun::star::xml::crypto
50 class XSecurityEnvironment
;
55 class OOO_DLLPUBLIC_UNOTEST MacrosTest
61 std::function
<void()> m_Func
;
64 Resetter(std::function
<void()> aFunc
)
65 : m_Func(std::move(aFunc
))
74 catch (...) // has to be reliable
76 fprintf(stderr
, "resetter failed with exception\n");
85 css::uno::Reference
<css::lang::XComponent
>
86 loadFromDesktop(const OUString
& rURL
, const OUString
& rDocService
= OUString(),
87 const css::uno::Sequence
<css::beans::PropertyValue
>& rExtra_args
88 = css::uno::Sequence
<css::beans::PropertyValue
>());
91 dispatchCommand(const css::uno::Reference
<css::lang::XComponent
>& xComponent
,
92 const OUString
& rCommand
,
93 const css::uno::Sequence
<css::beans::PropertyValue
>& rPropertyValues
);
95 /// Opens rStreamName from rTempFile, assuming it's a ZIP storage.
96 static std::unique_ptr
<SvStream
> parseExportStream(const OUString
& url
,
97 const OUString
& rStreamName
);
99 // note: there is no tearDownX509
100 void setUpX509(const test::Directories
& rDirectories
, const OUString
& rTestName
);
101 void setUpGpg(const test::Directories
& rDirectories
, const OUString
& rTestName
);
104 static bool IsValid(const css::uno::Reference
<css::security::XCertificate
>& cert
,
105 const css::uno::Reference
<css::xml::crypto::XSecurityEnvironment
>& env
);
106 static css::uno::Reference
<css::security::XCertificate
> GetValidCertificate(
107 const css::uno::Sequence
<css::uno::Reference
<css::security::XCertificate
>>& certs
,
108 const css::uno::Reference
<css::xml::crypto::XSecurityEnvironment
>& env
,
109 const css::uno::Sequence
<css::beans::PropertyValue
>& rFilterData
= {});
112 css::uno::Reference
<css::frame::XDesktop2
> mxDesktop
;
115 std::unique_ptr
<BasicDLL
> mpDll
;
116 #if HAVE_GPGCONF_SOCKETDIR
117 OString m_gpgconfCommandPrefix
;
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */