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