1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <rtl/ustring.hxx>
25 /** Cache to keep list of graphic filters + the filters themselves. */
26 class FilterConfigCache
28 struct FilterConfigCacheEntry
30 OUString sInternalFilterName
;
32 std::vector
< OUString
> lExtensionList
;
42 bool bIsPixelFormat
: 1;
44 void CreateFilterName( const OUString
& rUserDataEntry
);
45 OUString
GetShortName( );
47 static const char* InternalPixelFilterNameList
[];
51 std::vector
< FilterConfigCacheEntry
> aImport
;
52 std::vector
< FilterConfigCacheEntry
> aExport
;
59 sal_uInt16
GetImportFormatCount() const
60 { return sal::static_int_cast
< sal_uInt16
>(aImport
.size()); };
61 sal_uInt16
GetImportFormatNumber( std::u16string_view rFormatName
);
62 sal_uInt16
GetImportFormatNumberForShortName( std::u16string_view rShortName
);
63 sal_uInt16
GetImportFormatNumberForTypeName( std::u16string_view rType
);
64 sal_uInt16
GetImportFormatNumberForExtension( std::u16string_view rExt
);
65 const OUString
& GetImportFilterName( sal_uInt16 nFormat
);
66 const OUString
& GetImportFormatName( sal_uInt16 nFormat
);
67 const OUString
& GetImportFormatExtension( sal_uInt16 nFormat
, sal_Int32 nEntry
= 0);
68 const OUString
& GetImportFormatMediaType( sal_uInt16 nFormat
);
69 OUString
GetImportFormatShortName( sal_uInt16 nFormat
);
70 OUString
GetImportWildcard( sal_uInt16 nFormat
, sal_Int32 nEntry
);
71 const OUString
& GetImportFilterType( sal_uInt16 nFormat
);
72 const OUString
& GetImportFilterTypeName( sal_uInt16 nFormat
);
75 sal_uInt16
GetExportFormatCount() const
76 { return sal::static_int_cast
< sal_uInt16
>(aExport
.size()); };
77 sal_uInt16
GetExportFormatNumber( std::u16string_view rFormatName
);
78 sal_uInt16
GetExportFormatNumberForMediaType( std::u16string_view rMediaType
);
79 sal_uInt16
GetExportFormatNumberForShortName( std::u16string_view rShortName
);
80 sal_uInt16
GetExportFormatNumberForTypeName( std::u16string_view rType
);
81 const OUString
& GetExportFilterName( sal_uInt16 nFormat
);
82 const OUString
& GetExportFormatName( sal_uInt16 nFormat
);
83 const OUString
& GetExportFormatExtension( sal_uInt16 nFormat
, sal_Int32 nEntry
= 0 );
84 const OUString
& GetExportFormatMediaType( sal_uInt16 nFormat
);
85 OUString
GetExportFormatShortName( sal_uInt16 nFormat
);
86 OUString
GetExportWildcard( sal_uInt16 nFormat
, sal_Int32 nEntry
);
87 const OUString
& GetExportInternalFilterName( sal_uInt16 nFormat
);
89 bool IsExportPixelFormat( sal_uInt16 nFormat
);
91 explicit FilterConfigCache();
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */