Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / unotest / filters-test.hxx
blob01570b78637a039658ce392a550d9bc87c8b3cdf
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 */
10 #ifndef INCLUDED_UNOTEST_FILTERS_TEST_HXX
11 #define INCLUDED_UNOTEST_FILTERS_TEST_HXX
13 #include <sal/config.h>
15 #include <string_view>
17 #include <comphelper/documentconstants.hxx>
18 #include <rtl/ustring.hxx>
19 #include <unotest/detail/unotestdllapi.hxx>
20 #include <sot/formats.hxx>
22 namespace test {
24 enum filterStatus
26 fail = 0,
27 pass = 1,
28 indeterminate = 2
32 * NOTE, any files beginning with CVE-, BID- or EDB- will be assumed to be
33 * encrypted using arcfour with key 0x435645, this is to silence panicky
34 * virus/malware-checkers
36 * e.g. m[de]crypt --bare -a arcfour -o hex -k 435645 -s 3
38 /* Implementation of Filters test */
39 class OOO_DLLPUBLIC_UNOTEST FiltersTest
41 public:
42 void testDir(
43 //filter name
44 const OUString &rFilter,
45 //root dir of test files, must contain pass, fail, indeterminate
46 std::u16string_view rURL,
47 //additional filter data for SfxFilter
48 const OUString &rUserData = OUString(),
49 //SfxFilterFlags for SfxFilter
50 SfxFilterFlags nFilterFlags = SfxFilterFlags::IMPORT,
51 //Clipboard id for SfxFilter
52 SotClipboardFormatId nClipboardID = SotClipboardFormatId::NONE,
53 //additional filter version for SfxFilter
54 unsigned int nFilterVersion = 0,
55 //export or import?
56 bool bExport = false);
58 virtual bool load(
59 const OUString &rFilter,
60 const OUString &rURL,
61 const OUString &rUserData,
62 SfxFilterFlags nFilterFlags,
63 SotClipboardFormatId nClipboardID,
64 unsigned int nFilterVersion) = 0;
66 virtual bool save(
67 const OUString &/*rFilter*/,
68 const OUString &/*rURL*/,
69 const OUString &/*rUserData*/,
70 SfxFilterFlags /*nFilterFlags*/,
71 SotClipboardFormatId /*nClipboardID*/,
72 unsigned int /*nFilterVersion*/)
74 return true;
77 protected:
78 ~FiltersTest() {}
80 void recursiveScan(
81 filterStatus nExpected,
82 const OUString &rFilter,
83 const OUString &rURL,
84 const OUString &rUserData,
85 SfxFilterFlags nFilterFlags,
86 SotClipboardFormatId nClipboardID,
87 unsigned int nFilterVersion,
88 bool bExport);
93 #endif // INCLUDED_UNOTEST_FILTERS_TEST_HXX
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */