1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: FilterConfigCache.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #ifndef _FILTER_CONFIG_CACHE_HXX_
33 #define _FILTER_CONFIG_CACHE_HXX_
35 #include "svtools/svtdllapi.h"
36 #include <tools/string.hxx>
37 #include <com/sun/star/uno/Sequence.h>
38 #include <com/sun/star/uno/Reference.h>
39 #include <com/sun/star/beans/PropertyValue.hpp>
40 #include <com/sun/star/container/XNameAccess.hpp>
42 #ifndef INCLUDED_VECTOR
44 #define INCLUDED_VECTOR
47 class SVT_DLLPUBLIC FilterConfigCache
49 struct FilterConfigCacheEntry
51 ::rtl::OUString sInternalFilterName
;
52 ::rtl::OUString sType
;
53 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> lExtensionList
;
54 ::rtl::OUString sUIName
;
55 ::rtl::OUString sDocumentService
;
56 ::rtl::OUString sFilterService
;
57 ::rtl::OUString sTemplateName
;
59 ::rtl::OUString sMediaType
;
60 ::rtl::OUString sFilterType
;
63 sal_Int32 nFileFormatVersion
;
67 sal_Bool bHasDialog
: 1;
68 sal_Bool bIsInternalFilter
: 1;
69 sal_Bool bIsPixelFormat
: 1;
72 sal_Bool
CreateFilterName( const ::rtl::OUString
& rUserDataEntry
);
73 String
GetShortName( );
75 static const char* InternalPixelFilterNameList
[];
76 static const char* InternalVectorFilterNameList
[];
77 static const char* ExternalPixelFilterNameList
[];
80 typedef std::vector
< FilterConfigCacheEntry
> CacheVector
;
87 static sal_Bool bInitialized
;
88 static sal_Int32 nIndType
;
89 static sal_Int32 nIndUIName
;
90 static sal_Int32 nIndDocumentService
;
91 static sal_Int32 nIndFilterService
;
92 static sal_Int32 nIndFlags
;
93 static sal_Int32 nIndUserData
;
94 static sal_Int32 nIndFileFormatVersion
;
95 static sal_Int32 nIndTemplateName
;
97 static const char* InternalFilterListForSvxLight
[];
99 SVT_DLLPRIVATE
void ImplInit();
100 SVT_DLLPRIVATE
void ImplInitSmart();
104 sal_uInt16
GetImportFormatCount() const
105 { return sal::static_int_cast
< sal_uInt16
>(aImport
.size()); };
106 sal_uInt16
GetImportFormatNumber( const String
& rFormatName
);
107 sal_uInt16
GetImportFormatNumberForMediaType( const String
& rMediaType
);
108 sal_uInt16
GetImportFormatNumberForShortName( const String
& rShortName
);
109 sal_uInt16
GetImportFormatNumberForTypeName( const String
& rType
);
110 String
GetImportFilterName( sal_uInt16 nFormat
);
111 String
GetImportFormatName( sal_uInt16 nFormat
);
112 String
GetImportFormatExtension( sal_uInt16 nFormat
, sal_Int32 nEntry
= 0);
113 String
GetImportFormatMediaType( sal_uInt16 nFormat
);
114 String
GetImportFormatShortName( sal_uInt16 nFormat
);
115 String
GetImportWildcard( sal_uInt16 nFormat
, sal_Int32 nEntry
);
116 String
GetImportFilterType( sal_uInt16 nFormat
);
117 String
GetImportFilterTypeName( sal_uInt16 nFormat
);
119 sal_Bool
IsImportInternalFilter( sal_uInt16 nFormat
);
120 sal_Bool
IsImportPixelFormat( sal_uInt16 nFormat
);
121 sal_Bool
IsImportDialog( sal_uInt16 nFormat
);
123 sal_uInt16
GetExportFormatCount() const
124 { return sal::static_int_cast
< sal_uInt16
>(aExport
.size()); };
125 sal_uInt16
GetExportFormatNumber( const String
& rFormatName
);
126 sal_uInt16
GetExportFormatNumberForMediaType( const String
& rMediaType
);
127 sal_uInt16
GetExportFormatNumberForShortName( const String
& rShortName
);
128 sal_uInt16
GetExportFormatNumberForTypeName( const String
& rType
);
129 String
GetExportFilterName( sal_uInt16 nFormat
);
130 String
GetExportFormatName( sal_uInt16 nFormat
);
131 String
GetExportFormatExtension( sal_uInt16 nFormat
, sal_Int32 nEntry
= 0 );
132 String
GetExportFormatMediaType( sal_uInt16 nFormat
);
133 String
GetExportFormatShortName( sal_uInt16 nFormat
);
134 String
GetExportWildcard( sal_uInt16 nFormat
, sal_Int32 nEntry
);
135 String
GetExportFilterTypeName( sal_uInt16 nFormat
);
136 String
GetExportInternalFilterName( sal_uInt16 nFormat
);
138 sal_Bool
IsExportInternalFilter( sal_uInt16 nFormat
);
139 sal_Bool
IsExportPixelFormat( sal_uInt16 nFormat
);
140 sal_Bool
IsExportDialog( sal_uInt16 nFormat
);
142 FilterConfigCache( sal_Bool bUseConfig
);
143 ~FilterConfigCache();
147 #endif // _FILTER_CONFIG_CACHE_HXX_