tdf#163215: Enable kashida justification for AAT fonts
[LibreOffice.git] / include / test / bootstrapfixture.hxx
blobf512cabc77848bd933659e4b6d6565b0577735a5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
9 #pragma once
11 #include <sal/config.h>
13 #include <rtl/string.hxx>
14 #include <tools/link.hxx>
15 #include <vcl/salctype.hxx>
16 #include <com/sun/star/uno/XComponentContext.hpp>
17 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
18 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
20 #include <cppunit/TestAssert.h>
21 #include <cppunit/TestFixture.h>
22 #include <cppunit/extensions/HelperMacros.h>
23 #include <cppunit/plugin/TestPlugIn.h>
24 #include <unotest/bootstrapfixturebase.hxx>
25 #include <test/testdllapi.hxx>
27 namespace test
29 enum ValidationFormat
31 OOXML,
32 ODF,
33 MSBINARY
36 // Class to do lots of heavy-lifting UNO & environment
37 // bootstrapping for unit tests, such that we can use
38 // almost an entire LibreOffice during compile - so
39 // that we can get pieces of code alone to beat them up.
41 // NB. this class is instantiated multiple times during a
42 // run of unit tests ...
43 class OOO_DLLPUBLIC_TEST BootstrapFixture : public BootstrapFixtureBase
45 bool m_bNeedUCB;
46 bool m_bAssertOnDialog;
48 protected:
49 // A convenience function to be used to conditionally exclude tests not behaving properly
50 // on UI scaling other than 1:1. Using this should be considered a temporary workaround,
51 // until a proper fix is implemented that either considers the DPI properly in the test, or
52 // makes the invariants that test uses independent of DPI.
53 static bool IsDefaultDPI();
54 static std::pair<double, double> getDPIScaling();
56 public:
57 DECL_DLLPRIVATE_STATIC_LINK(BootstrapFixture, ImplInitFilterHdl, ConvertData&, bool);
59 BootstrapFixture(bool bAssertOnDialog = true, bool bNeedUCB = true);
60 virtual ~BootstrapFixture() override;
62 virtual void setUp() override;
64 void validate(const OUString& rURL, ValidationFormat) const;
66 // Allows to exclude tests dependent on color depth of the default virtual device
67 static sal_uInt16 getDefaultDeviceBitCount();
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */