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 .
20 #ifndef INCLUDED_VCL_SOURCE_FILTER_FILTERCONFIGCACHE_HXX
21 #define INCLUDED_VCL_SOURCE_FILTER_FILTERCONFIGCACHE_HXX
23 #include <com/sun/star/uno/Sequence.h>
24 #include <com/sun/star/beans/PropertyValue.hpp>
25 #include <com/sun/star/container/XNameAccess.hpp>
26 #include <rtl/ustring.hxx>
29 /** Cache to keep list of graphic filters + the filters themselves. */
30 class FilterConfigCache
32 struct FilterConfigCacheEntry
34 OUString sInternalFilterName
;
36 css::uno::Sequence
< OUString
> lExtensionList
;
38 OUString sExternalFilterName
;
47 bool bIsInternalFilter
: 1;
48 bool bIsPixelFormat
: 1;
50 void CreateFilterName( const OUString
& rUserDataEntry
);
51 OUString
GetShortName( );
53 static const char* InternalPixelFilterNameList
[];
54 static const char* InternalVectorFilterNameList
[];
55 static const char* ExternalPixelFilterNameList
[];
59 std::vector
< FilterConfigCacheEntry
> aImport
;
60 std::vector
< FilterConfigCacheEntry
> aExport
;
63 static bool bInitialized
;
64 static sal_Int32 nIndType
;
65 static sal_Int32 nIndUIName
;
66 static sal_Int32 nIndDocumentService
;
67 static sal_Int32 nIndFilterService
;
68 static sal_Int32 nIndFlags
;
69 static sal_Int32 nIndUserData
;
70 static sal_Int32 nIndFileFormatVersion
;
71 static sal_Int32 nIndTemplateName
;
73 static const char* InternalFilterListForSvxLight
[];
80 sal_uInt16
GetImportFormatCount() const
81 { return sal::static_int_cast
< sal_uInt16
>(aImport
.size()); };
82 sal_uInt16
GetImportFormatNumber( const OUString
& rFormatName
);
83 sal_uInt16
GetImportFormatNumberForShortName( const OUString
& rShortName
);
84 sal_uInt16
GetImportFormatNumberForTypeName( const OUString
& rType
);
85 sal_uInt16
GetImportFormatNumberForExtension( const OUString
& rExt
);
86 OUString
GetImportFilterName( sal_uInt16 nFormat
);
87 OUString
GetImportFormatName( sal_uInt16 nFormat
);
88 OUString
GetImportFormatExtension( sal_uInt16 nFormat
, sal_Int32 nEntry
= 0);
89 OUString
GetImportFormatMediaType( sal_uInt16 nFormat
);
90 OUString
GetImportFormatShortName( sal_uInt16 nFormat
);
91 OUString
GetImportWildcard( sal_uInt16 nFormat
, sal_Int32 nEntry
);
92 OUString
GetImportFilterType( sal_uInt16 nFormat
);
93 OUString
GetImportFilterTypeName( sal_uInt16 nFormat
);
94 OUString
GetExternalFilterName(sal_uInt16 nFormat
, bool bExport
);
97 bool IsImportInternalFilter( sal_uInt16 nFormat
);
99 sal_uInt16
GetExportFormatCount() const
100 { return sal::static_int_cast
< sal_uInt16
>(aExport
.size()); };
101 sal_uInt16
GetExportFormatNumber( const OUString
& rFormatName
);
102 sal_uInt16
GetExportFormatNumberForMediaType( const OUString
& rMediaType
);
103 sal_uInt16
GetExportFormatNumberForShortName( const OUString
& rShortName
);
104 sal_uInt16
GetExportFormatNumberForTypeName( const OUString
& rType
);
105 OUString
GetExportFilterName( sal_uInt16 nFormat
);
106 OUString
GetExportFormatName( sal_uInt16 nFormat
);
107 OUString
GetExportFormatExtension( sal_uInt16 nFormat
, sal_Int32 nEntry
= 0 );
108 OUString
GetExportFormatMediaType( sal_uInt16 nFormat
);
109 OUString
GetExportFormatShortName( sal_uInt16 nFormat
);
110 OUString
GetExportWildcard( sal_uInt16 nFormat
, sal_Int32 nEntry
);
111 OUString
GetExportInternalFilterName( sal_uInt16 nFormat
);
113 bool IsExportInternalFilter( sal_uInt16 nFormat
);
114 bool IsExportPixelFormat( sal_uInt16 nFormat
);
116 explicit FilterConfigCache( bool bUseConfig
);
117 ~FilterConfigCache();
120 #endif // INCLUDED_VCL_SOURCE_FILTER_FILTERCONFIGCACHE_HXX
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */