LibreOffice Module unotest (master) 1
filters-test.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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
10#ifndef INCLUDED_UNOTEST_FILTERS_TEST_HXX
11#define INCLUDED_UNOTEST_FILTERS_TEST_HXX
12
13#include <sal/config.h>
14
15#include <string_view>
16
18#include <rtl/ustring.hxx>
20#include <sot/formats.hxx>
21
22namespace test {
23
25{
26 fail = 0,
27 pass = 1,
29};
30
31/*
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
35 *
36 * e.g. m[de]crypt --bare -a arcfour -o hex -k 435645 -s 3
37 */
38/* Implementation of Filters test */
40{
41public:
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);
57
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;
65
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*/)
73 {
74 return true;
75 }
76
77protected:
79
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);
89};
90
91}
92
93#endif // INCLUDED_UNOTEST_FILTERS_TEST_HXX
94
95/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool save(const OUString &, const OUString &, const OUString &, SfxFilterFlags, SotClipboardFormatId, unsigned int)
virtual bool load(const OUString &rFilter, const OUString &rURL, const OUString &rUserData, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID, unsigned int nFilterVersion)=0
SfxFilterFlags
SotClipboardFormatId
@ indeterminate
#define OOO_DLLPUBLIC_UNOTEST