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 #ifndef INCLUDED_VCL_SOURCE_FILTER_FILTERCONFIGCACHE_HXX
21 #define INCLUDED_VCL_SOURCE_FILTER_FILTERCONFIGCACHE_HXX
22 
23 #include <rtl/ustring.hxx>
24 #include <vector>
25 
28 {
30  {
32  OUString sType;
33  std::vector< OUString > lExtensionList;
34  OUString sUIName;
36 
37  OUString sMediaType;
38  OUString sFilterType;
39 
40  sal_Int32 nFlags;
41 
42  // user data
43  OUString sFilterName;
45  bool bIsPixelFormat : 1;
46 
47  void CreateFilterName( const OUString& rUserDataEntry );
48  OUString GetShortName( );
49 
50  static const char* InternalPixelFilterNameList[];
51  static const char* InternalVectorFilterNameList[];
52  static const char* ExternalPixelFilterNameList[];
53  };
54 
55 
56  std::vector< FilterConfigCacheEntry > aImport;
57  std::vector< FilterConfigCacheEntry > aExport;
58 
59  static const char* InternalFilterListForSvxLight[];
60 
61  void ImplInit();
62  void ImplInitSmart();
63 
64 public:
65 
66  sal_uInt16 GetImportFormatCount() const
67  { return sal::static_int_cast< sal_uInt16 >(aImport.size()); };
68  sal_uInt16 GetImportFormatNumber( const OUString& rFormatName );
69  sal_uInt16 GetImportFormatNumberForShortName( const OUString& rShortName );
70  sal_uInt16 GetImportFormatNumberForTypeName( const OUString& rType );
71  sal_uInt16 GetImportFormatNumberForExtension( const OUString& rExt );
72  OUString GetImportFilterName( sal_uInt16 nFormat );
73  OUString GetImportFormatName( sal_uInt16 nFormat );
74  OUString GetImportFormatExtension( sal_uInt16 nFormat, sal_Int32 nEntry = 0);
75  OUString GetImportFormatMediaType( sal_uInt16 nFormat );
76  OUString GetImportFormatShortName( sal_uInt16 nFormat );
77  OUString GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry );
78  OUString GetImportFilterType( sal_uInt16 nFormat );
79  OUString GetImportFilterTypeName( sal_uInt16 nFormat );
80  OUString GetExternalFilterName(sal_uInt16 nFormat, bool bExport);
81 
82 
83  bool IsImportInternalFilter( sal_uInt16 nFormat );
84 
85  sal_uInt16 GetExportFormatCount() const
86  { return sal::static_int_cast< sal_uInt16 >(aExport.size()); };
87  sal_uInt16 GetExportFormatNumber( const OUString& rFormatName );
88  sal_uInt16 GetExportFormatNumberForMediaType( const OUString& rMediaType );
89  sal_uInt16 GetExportFormatNumberForShortName( const OUString& rShortName );
90  sal_uInt16 GetExportFormatNumberForTypeName( const OUString& rType );
91  OUString GetExportFilterName( sal_uInt16 nFormat );
92  OUString GetExportFormatName( sal_uInt16 nFormat );
93  OUString GetExportFormatExtension( sal_uInt16 nFormat, sal_Int32 nEntry = 0 );
94  OUString GetExportFormatMediaType( sal_uInt16 nFormat );
95  OUString GetExportFormatShortName( sal_uInt16 nFormat );
96  OUString GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry );
97  OUString GetExportInternalFilterName( sal_uInt16 nFormat );
98 
99  bool IsExportInternalFilter( sal_uInt16 nFormat );
100  bool IsExportPixelFormat( sal_uInt16 nFormat );
101 
102  explicit FilterConfigCache( bool bUseConfig );
104 };
105 
106 #endif // INCLUDED_VCL_SOURCE_FILTER_FILTERCONFIGCACHE_HXX
107 
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString GetExternalFilterName(sal_uInt16 nFormat, bool bExport)
OUString GetImportFormatExtension(sal_uInt16 nFormat, sal_Int32 nEntry=0)
OUString GetExportFormatName(sal_uInt16 nFormat)
OUString GetImportFilterName(sal_uInt16 nFormat)
sal_uInt16 GetExportFormatNumber(const OUString &rFormatName)
OUString GetExportFormatExtension(sal_uInt16 nFormat, sal_Int32 nEntry=0)
OUString GetExportInternalFilterName(sal_uInt16 nFormat)
OUString GetImportFilterType(sal_uInt16 nFormat)
bool IsExportPixelFormat(sal_uInt16 nFormat)
OUString GetImportFormatShortName(sal_uInt16 nFormat)
sal_uInt16 GetImportFormatCount() const
OUString GetExportWildcard(sal_uInt16 nFormat, sal_Int32 nEntry)
std::vector< FilterConfigCacheEntry > aExport
FilterConfigCache(bool bUseConfig)
OUString GetImportFormatMediaType(sal_uInt16 nFormat)
Cache to keep list of graphic filters + the filters themselves.
sal_uInt16 GetImportFormatNumberForShortName(const OUString &rShortName)
sal_uInt16 GetImportFormatNumber(const OUString &rFormatName)
sal_uInt16 GetExportFormatNumberForShortName(const OUString &rShortName)
sal_uInt16 GetImportFormatNumberForExtension(const OUString &rExt)
get the index of the filter that matches this extension
OUString GetImportFilterTypeName(sal_uInt16 nFormat)
OUString GetImportFormatName(sal_uInt16 nFormat)
void CreateFilterName(const OUString &rUserDataEntry)
bool IsImportInternalFilter(sal_uInt16 nFormat)
OUString GetExportFormatMediaType(sal_uInt16 nFormat)
sal_uInt16 GetImportFormatNumberForTypeName(const OUString &rType)
sal_uInt16 GetExportFormatNumberForTypeName(const OUString &rType)
sal_uInt16 GetExportFormatNumberForMediaType(const OUString &rMediaType)
std::vector< FilterConfigCacheEntry > aImport
OUString GetExportFilterName(sal_uInt16 nFormat)
OUString GetExportFormatShortName(sal_uInt16 nFormat)
sal_uInt16 GetExportFormatCount() const
bool IsExportInternalFilter(sal_uInt16 nFormat)
static const char * InternalFilterListForSvxLight[]
OUString GetImportWildcard(sal_uInt16 nFormat, sal_Int32 nEntry)