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