Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _FILTER_CONFIG_CACHE_HXX_
30 : : #define _FILTER_CONFIG_CACHE_HXX_
31 : :
32 : : #include <tools/string.hxx>
33 : : #include <com/sun/star/uno/Sequence.h>
34 : : #include <com/sun/star/uno/Reference.h>
35 : : #include <com/sun/star/beans/PropertyValue.hpp>
36 : : #include <com/sun/star/container/XNameAccess.hpp>
37 : :
38 : : #include <vector>
39 : :
40 : : class FilterConfigCache
41 : : {
42 [ + - ][ + - ]: 58812 : struct FilterConfigCacheEntry
[ + - ][ + - ]
[ + - ][ + - ]
43 : : {
44 : : ::rtl::OUString sInternalFilterName;
45 : : ::rtl::OUString sType;
46 : : ::com::sun::star::uno::Sequence< ::rtl::OUString > lExtensionList;
47 : : ::rtl::OUString sUIName;
48 : : ::rtl::OUString sDocumentService;
49 : : ::rtl::OUString sFilterService;
50 : : ::rtl::OUString sTemplateName;
51 : :
52 : : ::rtl::OUString sMediaType;
53 : : ::rtl::OUString sFilterType;
54 : :
55 : : sal_Int32 nFlags;
56 : : sal_Int32 nFileFormatVersion;
57 : :
58 : : // user data
59 : : String sFilterName;
60 : : sal_Bool bHasDialog : 1;
61 : : sal_Bool bIsInternalFilter : 1;
62 : : sal_Bool bIsPixelFormat : 1;
63 : :
64 : : sal_Bool CreateFilterName( const ::rtl::OUString& rUserDataEntry );
65 : : String GetShortName( );
66 : :
67 : : static const char* InternalPixelFilterNameList[];
68 : : static const char* InternalVectorFilterNameList[];
69 : : static const char* ExternalPixelFilterNameList[];
70 : : };
71 : :
72 : : typedef std::vector< FilterConfigCacheEntry > CacheVector;
73 : :
74 : :
75 : : CacheVector aImport;
76 : : CacheVector aExport;
77 : : sal_Bool bUseConfig;
78 : :
79 : : static sal_Bool bInitialized;
80 : : static sal_Int32 nIndType;
81 : : static sal_Int32 nIndUIName;
82 : : static sal_Int32 nIndDocumentService;
83 : : static sal_Int32 nIndFilterService;
84 : : static sal_Int32 nIndFlags;
85 : : static sal_Int32 nIndUserData;
86 : : static sal_Int32 nIndFileFormatVersion;
87 : : static sal_Int32 nIndTemplateName;
88 : :
89 : : static const char* InternalFilterListForSvxLight[];
90 : :
91 : : void ImplInit();
92 : : void ImplInitSmart();
93 : :
94 : : public :
95 : :
96 : 9206 : sal_uInt16 GetImportFormatCount() const
97 : 9206 : { return sal::static_int_cast< sal_uInt16 >(aImport.size()); };
98 : : sal_uInt16 GetImportFormatNumber( const String& rFormatName );
99 : : sal_uInt16 GetImportFormatNumberForMediaType( const String& rMediaType );
100 : : sal_uInt16 GetImportFormatNumberForShortName( const String& rShortName );
101 : : sal_uInt16 GetImportFormatNumberForTypeName( const String& rType );
102 : : String GetImportFilterName( sal_uInt16 nFormat );
103 : : String GetImportFormatName( sal_uInt16 nFormat );
104 : : String GetImportFormatExtension( sal_uInt16 nFormat, sal_Int32 nEntry = 0);
105 : : String GetImportFormatMediaType( sal_uInt16 nFormat );
106 : : String GetImportFormatShortName( sal_uInt16 nFormat );
107 : : String GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry );
108 : : String GetImportFilterType( sal_uInt16 nFormat );
109 : : String GetImportFilterTypeName( sal_uInt16 nFormat );
110 : :
111 : : sal_Bool IsImportInternalFilter( sal_uInt16 nFormat );
112 : : sal_Bool IsImportPixelFormat( sal_uInt16 nFormat );
113 : :
114 : 298 : sal_uInt16 GetExportFormatCount() const
115 : 298 : { return sal::static_int_cast< sal_uInt16 >(aExport.size()); };
116 : : sal_uInt16 GetExportFormatNumber( const String& rFormatName );
117 : : sal_uInt16 GetExportFormatNumberForMediaType( const String& rMediaType );
118 : : sal_uInt16 GetExportFormatNumberForShortName( const String& rShortName );
119 : : sal_uInt16 GetExportFormatNumberForTypeName( const String& rType );
120 : : String GetExportFilterName( sal_uInt16 nFormat );
121 : : String GetExportFormatName( sal_uInt16 nFormat );
122 : : String GetExportFormatExtension( sal_uInt16 nFormat, sal_Int32 nEntry = 0 );
123 : : String GetExportFormatMediaType( sal_uInt16 nFormat );
124 : : String GetExportFormatShortName( sal_uInt16 nFormat );
125 : : String GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry );
126 : : String GetExportFilterTypeName( sal_uInt16 nFormat );
127 : : String GetExportInternalFilterName( sal_uInt16 nFormat );
128 : :
129 : : sal_Bool IsExportInternalFilter( sal_uInt16 nFormat );
130 : : sal_Bool IsExportPixelFormat( sal_uInt16 nFormat );
131 : : sal_Bool IsExportDialog( sal_uInt16 nFormat );
132 : :
133 : : FilterConfigCache( sal_Bool bUseConfig );
134 : : ~FilterConfigCache();
135 : :
136 : : };
137 : :
138 : : #endif // _FILTER_CONFIG_CACHE_HXX_
139 : :
140 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|