LibreOffice Module vcl (master) 1
FilterConfigCache.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 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <rtl/ustring.hxx>
23#include <vector>
24
27{
29 {
31 OUString sType;
32 std::vector< OUString > lExtensionList;
33 OUString sUIName;
34
35 OUString sMediaType;
36 OUString sFilterType;
37
38 sal_Int32 nFlags;
39
40 // user data
41 OUString sFilterName;
43
44 void CreateFilterName( const OUString& rUserDataEntry );
45 OUString GetShortName( );
46
47 static const char* InternalPixelFilterNameList[];
48 };
49
50
51 std::vector< FilterConfigCacheEntry > aImport;
52 std::vector< FilterConfigCacheEntry > aExport;
53
54 static const char* InternalFilterListForSvxLight[];
55
56 void ImplInit();
57 void ImplInitSmart();
58
59public:
60
61 sal_uInt16 GetImportFormatCount() const
62 { return sal::static_int_cast< sal_uInt16 >(aImport.size()); };
63 sal_uInt16 GetImportFormatNumber( std::u16string_view rFormatName );
64 sal_uInt16 GetImportFormatNumberForShortName( std::u16string_view rShortName );
65 sal_uInt16 GetImportFormatNumberForTypeName( std::u16string_view rType );
66 sal_uInt16 GetImportFormatNumberForExtension( std::u16string_view rExt );
67 OUString GetImportFilterName( sal_uInt16 nFormat );
68 OUString GetImportFormatName( sal_uInt16 nFormat );
69 OUString GetImportFormatExtension( sal_uInt16 nFormat, sal_Int32 nEntry = 0);
70 OUString GetImportFormatMediaType( sal_uInt16 nFormat );
71 OUString GetImportFormatShortName( sal_uInt16 nFormat );
72 OUString GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry );
73 OUString GetImportFilterType( sal_uInt16 nFormat );
74 OUString GetImportFilterTypeName( sal_uInt16 nFormat );
75
76
77 sal_uInt16 GetExportFormatCount() const
78 { return sal::static_int_cast< sal_uInt16 >(aExport.size()); };
79 sal_uInt16 GetExportFormatNumber( std::u16string_view rFormatName );
80 sal_uInt16 GetExportFormatNumberForMediaType( std::u16string_view rMediaType );
81 sal_uInt16 GetExportFormatNumberForShortName( std::u16string_view rShortName );
82 sal_uInt16 GetExportFormatNumberForTypeName( std::u16string_view rType );
83 OUString GetExportFilterName( sal_uInt16 nFormat );
84 OUString GetExportFormatName( sal_uInt16 nFormat );
85 OUString GetExportFormatExtension( sal_uInt16 nFormat, sal_Int32 nEntry = 0 );
86 OUString GetExportFormatMediaType( sal_uInt16 nFormat );
87 OUString GetExportFormatShortName( sal_uInt16 nFormat );
88 OUString GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry );
89 OUString GetExportInternalFilterName( sal_uInt16 nFormat );
90
91 bool IsExportPixelFormat( sal_uInt16 nFormat );
92
93 explicit FilterConfigCache( bool bUseConfig );
95};
96
97/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Cache to keep list of graphic filters + the filters themselves.
bool IsExportPixelFormat(sal_uInt16 nFormat)
sal_uInt16 GetExportFormatNumberForShortName(std::u16string_view rShortName)
OUString GetImportFormatName(sal_uInt16 nFormat)
sal_uInt16 GetImportFormatNumber(std::u16string_view rFormatName)
sal_uInt16 GetExportFormatNumber(std::u16string_view rFormatName)
sal_uInt16 GetImportFormatNumberForShortName(std::u16string_view rShortName)
FilterConfigCache(bool bUseConfig)
OUString GetExportWildcard(sal_uInt16 nFormat, sal_Int32 nEntry)
OUString GetImportFormatShortName(sal_uInt16 nFormat)
sal_uInt16 GetImportFormatNumberForExtension(std::u16string_view rExt)
get the index of the filter that matches this extension
OUString GetImportWildcard(sal_uInt16 nFormat, sal_Int32 nEntry)
OUString GetImportFilterTypeName(sal_uInt16 nFormat)
OUString GetExportFilterName(sal_uInt16 nFormat)
static const char * InternalFilterListForSvxLight[]
OUString GetExportFormatShortName(sal_uInt16 nFormat)
OUString GetExportFormatName(sal_uInt16 nFormat)
OUString GetExportFormatExtension(sal_uInt16 nFormat, sal_Int32 nEntry=0)
OUString GetImportFilterName(sal_uInt16 nFormat)
sal_uInt16 GetExportFormatNumberForTypeName(std::u16string_view rType)
std::vector< FilterConfigCacheEntry > aExport
sal_uInt16 GetImportFormatCount() const
sal_uInt16 GetExportFormatNumberForMediaType(std::u16string_view rMediaType)
sal_uInt16 GetImportFormatNumberForTypeName(std::u16string_view rType)
OUString GetImportFormatExtension(sal_uInt16 nFormat, sal_Int32 nEntry=0)
OUString GetImportFilterType(sal_uInt16 nFormat)
sal_uInt16 GetExportFormatCount() const
OUString GetExportFormatMediaType(sal_uInt16 nFormat)
OUString GetImportFormatMediaType(sal_uInt16 nFormat)
std::vector< FilterConfigCacheEntry > aImport
OUString GetExportInternalFilterName(sal_uInt16 nFormat)
void CreateFilterName(const OUString &rUserDataEntry)