tdf#124162: Crash when trying to accept changes
[LibreOffice.git] / include / unotest / filters-test.hxx
blob5af991e04d47c78dbc7fe8e1c68a04281bae246b
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 <comphelper/documentconstants.hxx>
14 #include <rtl/ustring.hxx>
15 #include <unotest/detail/unotestdllapi.hxx>
16 #include <sot/formats.hxx>
18 namespace test {
20 enum filterStatus
22 fail = 0,
23 pass = 1,
24 indeterminate = 2
28 * NOTE, any files beginning with CVE-, BID- or EDB- will be assumed to be
29 * encrypted using arcfour with key 0x435645, this is to silence panicky
30 * virus/malware-checkers
32 * e.g. m[de]crypt --bare -a arcfour -o hex -k 435645 -s 3
34 /* Implementation of Filters test */
35 class OOO_DLLPUBLIC_UNOTEST FiltersTest
37 public:
38 void testDir(
39 //filter name
40 const OUString &rFilter,
41 //root dir of test files, must contain pass, fail, indeterminate
42 const OUString &rURL,
43 //additional filter data for SfxFilter
44 const OUString &rUserData = OUString(),
45 //SfxFilterFlags for SfxFilter
46 SfxFilterFlags nFilterFlags = SfxFilterFlags::IMPORT,
47 //Clipboard id for SfxFilter
48 SotClipboardFormatId nClipboardID = SotClipboardFormatId::NONE,
49 //additional filter version for SfxFilter
50 unsigned int nFilterVersion = 0,
51 //export or import?
52 bool bExport = false);
54 virtual bool load(
55 const OUString &rFilter,
56 const OUString &rURL,
57 const OUString &rUserData,
58 SfxFilterFlags nFilterFlags,
59 SotClipboardFormatId nClipboardID,
60 unsigned int nFilterVersion) = 0;
62 virtual bool save(
63 const OUString &/*rFilter*/,
64 const OUString &/*rURL*/,
65 const OUString &/*rUserData*/,
66 SfxFilterFlags /*nFilterFlags*/,
67 SotClipboardFormatId /*nClipboardID*/,
68 unsigned int /*nFilterVersion*/)
70 return true;
73 protected:
74 ~FiltersTest() {}
76 void recursiveScan(
77 filterStatus nExpected,
78 const OUString &rFilter,
79 const OUString &rURL,
80 const OUString &rUserData,
81 SfxFilterFlags nFilterFlags,
82 SotClipboardFormatId nClipboardID,
83 unsigned int nFilterVersion,
84 bool bExport);
89 #endif // INCLUDED_UNOTEST_FILTERS_TEST_HXX
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */