Kaydet (Commit) 48bb2913 authored tarafından Noel Grandin's avatar Noel Grandin

convert SFX_FILTER_ constants to enum class

Change-Id: I7e53cfc90cefd9da7d6ecd795b09214bd44b1613
üst bdad6d0f
......@@ -706,7 +706,7 @@ sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile(
{
sal_Int32 nFlags = GetFilterFlags( aFilterName );
// check the OWN flag
bResult = ( nFlags & SFX_FILTER_OWN );
bResult = ( nFlags & SfxFilterFlags::OWN );
}
return bResult;
......@@ -742,22 +742,22 @@ OUString MimeConfigurationHelper::GetDefaultFilterFromServiceName( const OUStrin
if ( xFilterEnum->nextElement() >>= aProps )
{
SequenceAsHashMap aPropsHM( aProps );
sal_Int32 nFlags = aPropsHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 );
SfxFilterFlags nFlags = static_cast<SfxFilterFlags>(aPropsHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 ));
// that should be import, export, own filter and not a template filter ( TemplatePath flag )
sal_Int32 const nRequired = (SFX_FILTER_OWN
SfxFilterFlags const nRequired = (SfxFilterFlags::OWN
// fdo#78159 for OOoXML, there is code to convert
// to ODF in OCommonEmbeddedObject::store*
// so accept it even though there's no export
| (SOFFICE_FILEFORMAT_60 == nVersion ? 0 : SFX_FILTER_EXPORT)
| SFX_FILTER_IMPORT );
if ( ( ( nFlags & nRequired ) == nRequired ) && !( nFlags & SFX_FILTER_TEMPLATEPATH ) )
| (SOFFICE_FILEFORMAT_60 == nVersion ? SfxFilterFlags::NONE : SfxFilterFlags::EXPORT)
| SfxFilterFlags::IMPORT );
if ( ( ( nFlags & nRequired ) == nRequired ) && !( nFlags & SfxFilterFlags::TEMPLATEPATH ) )
{
// if there are more than one filter the preffered one should be used
// if there is no preffered filter the first one will be used
if ( aResult.isEmpty() || ( nFlags & SFX_FILTER_PREFERED ) )
if ( aResult.isEmpty() || ( nFlags & SfxFilterFlags::PREFERED ) )
aResult = aPropsHM.getUnpackedValueOrDefault( "Name", OUString() );
if ( nFlags & SFX_FILTER_PREFERED )
if ( nFlags & SfxFilterFlags::PREFERED )
break; // the preferred filter was found
}
}
......@@ -787,15 +787,15 @@ OUString MimeConfigurationHelper::GetExportFilterFromImportFilter( const OUStrin
if ( aImpFilterAny >>= aImpData )
{
SequenceAsHashMap aImpFilterHM( aImpData );
sal_Int32 nFlags = aImpFilterHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 );
SfxFilterFlags nFlags = static_cast<SfxFilterFlags>(aImpFilterHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 ));
if ( !( nFlags & SFX_FILTER_IMPORT ) )
if ( !( nFlags & SfxFilterFlags::IMPORT ) )
{
OSL_FAIL( "This is no import filter!" );
throw uno::Exception();
}
if ( nFlags & SFX_FILTER_EXPORT )
if ( nFlags & SfxFilterFlags::EXPORT )
{
aExportFilterName = aImportFilterName;
}
......@@ -816,8 +816,8 @@ OUString MimeConfigurationHelper::GetExportFilterFromImportFilter( const OUStrin
uno::Sequence< beans::PropertyValue > aExportFilterProps = SearchForFilter(
uno::Reference< container::XContainerQuery >( xFilterFactory, uno::UNO_QUERY_THROW ),
aSearchRequest,
SFX_FILTER_EXPORT,
SFX_FILTER_INTERNAL );
SfxFilterFlags::EXPORT,
SfxFilterFlags::INTERNAL );
if ( aExportFilterProps.getLength() )
{
......@@ -840,8 +840,8 @@ OUString MimeConfigurationHelper::GetExportFilterFromImportFilter( const OUStrin
uno::Sequence< beans::PropertyValue > MimeConfigurationHelper::SearchForFilter(
const uno::Reference< container::XContainerQuery >& xFilterQuery,
const uno::Sequence< beans::NamedValue >& aSearchRequest,
sal_Int32 nMustFlags,
sal_Int32 nDontFlags )
SfxFilterFlags nMustFlags,
SfxFilterFlags nDontFlags )
{
uno::Sequence< beans::PropertyValue > aFilterProps;
uno::Reference< container::XEnumeration > xFilterEnum =
......@@ -857,11 +857,11 @@ uno::Sequence< beans::PropertyValue > MimeConfigurationHelper::SearchForFilter(
if ( xFilterEnum->nextElement() >>= aProps )
{
SequenceAsHashMap aPropsHM( aProps );
sal_Int32 nFlags = aPropsHM.getUnpackedValueOrDefault("Flags",
(sal_Int32)0 );
SfxFilterFlags nFlags = static_cast<SfxFilterFlags>(aPropsHM.getUnpackedValueOrDefault("Flags",
(sal_Int32)0 ));
if ( ( ( nFlags & nMustFlags ) == nMustFlags ) && !( nFlags & nDontFlags ) )
{
if ( ( nFlags & SFX_FILTER_DEFAULT ) == SFX_FILTER_DEFAULT )
if ( ( nFlags & SfxFilterFlags::DEFAULT ) == SfxFilterFlags::DEFAULT )
{
aFilterProps = aProps;
break;
......
......@@ -397,7 +397,6 @@
#include <sfx2/printopt.hxx>
#include <sfx2/request.hxx>
#include <sfx2/sfxcommands.h>
#include <sfx2/sfxdefs.hxx>
#include <sfx2/sfxdlg.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/sfxuno.hxx>
......
......@@ -29,7 +29,6 @@
#include <tools/diagnose_ex.h>
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/sfxdefs.hxx>
#include <com/sun/star/container/NoSuchElementException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <dialmgr.hxx>
......
......@@ -44,7 +44,6 @@
#include <sfx2/sfxcommands.h>
#include "about.hxx"
#include <config_buildid.h>
#include <sfx2/sfxdefs.hxx>
#include <sfx2/app.hxx>
#include <rtl/ustrbuf.hxx>
#include <vcl/bitmap.hxx>
......
......@@ -403,9 +403,9 @@ void SfxSaveTabPage::Reset( const SfxItemSet* )
sal_IntPtr nData = reinterpret_cast<sal_IntPtr>(aDocTypeLB->GetEntryData(n));
OUString sCommand;
sCommand = "matchByDocumentService=%1:iflags=" +
OUString::number(SFX_FILTER_IMPORT|SFX_FILTER_EXPORT) +
OUString::number(static_cast<sal_Int32>(SfxFilterFlags::IMPORT|SfxFilterFlags::EXPORT)) +
":eflags=" +
OUString::number(SFX_FILTER_NOTINFILEDLG) +
OUString::number(static_cast<sal_Int32>(SfxFilterFlags::NOTINFILEDLG)) +
":default_first";
OUString sReplace;
switch(nData)
......@@ -430,9 +430,9 @@ void SfxSaveTabPage::Reset( const SfxItemSet* )
OUString sFilter = aFilter.getUnpackedValueOrDefault("Name",OUString());
if (!sFilter.isEmpty())
{
sal_Int32 nFlags = aFilter.getUnpackedValueOrDefault("Flags",sal_Int32());
SfxFilterFlags nFlags = static_cast<SfxFilterFlags>(aFilter.getUnpackedValueOrDefault("Flags",sal_Int32()));
lList.push_back(sFilter);
lAlienList.push_back(0 != (nFlags & SFX_FILTER_ALIEN));
lAlienList.push_back(bool(nFlags & SfxFilterFlags::ALIEN));
lODFList.push_back( isODFFormat( sFilter ) );
}
}
......
......@@ -221,7 +221,7 @@ namespace dbaui
ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
0,
aModule.GetFactoryEmptyDocumentURL(SvtModuleOptions::E_CALC)
,SFX_FILTER_IMPORT);
,SfxFilterFlags::IMPORT);
askForFileName(aFileDlg);
}
break;
......
......@@ -95,9 +95,9 @@ const SfxFilter* impl_lookupExportFilterForUrl( const rtl::OUString& rUrl, const
sQuery.append(":module=");
sQuery.append(rFactory); // use long name here !
sQuery.append(":iflags=");
sQuery.append(OUString::number(SFX_FILTER_EXPORT));
sQuery.append(OUString::number(static_cast<sal_Int32>(SfxFilterFlags::EXPORT)));
sQuery.append(":eflags=");
sQuery.append(OUString::number(SFX_FILTER_NOTINSTALLED));
sQuery.append(OUString::number(static_cast<sal_Int32>(SFX_FILTER_NOTINSTALLED)));
const Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const Reference< XContainerQuery > xFilterFactory(
......@@ -117,7 +117,7 @@ const SfxFilter* impl_lookupExportFilterForUrl( const rtl::OUString& rUrl, const
const SfxFilter* const pFilter( SfxFilter::GetFilterByName( aName ) );
if ( pFilter && pFilter->CanExport() && pFilter->GetWildcard().Matches( rUrl ) )
{
if ( !pBestMatch || ( SFX_FILTER_PREFERED & pFilter->GetFilterFlags() ) )
if ( !pBestMatch || ( SfxFilterFlags::PREFERED & pFilter->GetFilterFlags() ) )
pBestMatch = pFilter;
}
}
......@@ -134,7 +134,7 @@ const SfxFilter* impl_getExportFilterFromUrl( const rtl::OUString& rUrl, const r
UNO_QUERY_THROW );
const rtl::OUString aTypeName( xTypeDetector->queryTypeByURL( rUrl ) );
const SfxFilter* pFilter( SfxFilterMatcher( rFactory ).GetFilter4EA( aTypeName, SFX_FILTER_EXPORT ) );
const SfxFilter* pFilter( SfxFilterMatcher( rFactory ).GetFilter4EA( aTypeName, SfxFilterFlags::EXPORT ) );
if ( !pFilter )
pFilter = impl_lookupExportFilterForUrl( rUrl, rFactory );
if ( !pFilter )
......
......@@ -36,7 +36,7 @@ public:
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
/**
* Ensure CVEs remain unbroken
......@@ -50,7 +50,7 @@ public:
bool DxfFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
......
......@@ -36,7 +36,7 @@ public:
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
/**
* Ensure CVEs remain unbroken
......@@ -50,7 +50,7 @@ public:
bool EpsFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
......
......@@ -36,7 +36,7 @@ public:
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
/**
* Ensure CVEs remain unbroken
......@@ -50,7 +50,7 @@ public:
bool MetFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
......
......@@ -36,7 +36,7 @@ public:
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
/**
* Ensure CVEs remain unbroken
......@@ -50,7 +50,7 @@ public:
bool PcdFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
......
......@@ -36,7 +36,7 @@ public:
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
/**
* Ensure CVEs remain unbroken
......@@ -50,7 +50,7 @@ public:
bool PcxFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
......
......@@ -42,7 +42,7 @@ public:
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
OUString pictURL()
{
......@@ -64,7 +64,7 @@ public:
bool PictFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
......
......@@ -36,7 +36,7 @@ public:
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
/**
* Ensure CVEs remain unbroken
......@@ -50,7 +50,7 @@ public:
bool PpmFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
......
......@@ -36,7 +36,7 @@ public:
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
/**
* Ensure CVEs remain unbroken
......@@ -50,7 +50,7 @@ public:
bool PsdFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
......
......@@ -36,7 +36,7 @@ public:
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
/**
* Ensure CVEs remain unbroken
......@@ -50,7 +50,7 @@ public:
bool RasFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
......
......@@ -36,7 +36,7 @@ public:
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
/**
* Ensure CVEs remain unbroken
......@@ -50,7 +50,7 @@ public:
bool TgaFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
......
......@@ -36,7 +36,7 @@ public:
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
/**
* Ensure CVEs remain unbroken
......@@ -50,7 +50,7 @@ public:
bool TiffFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
......
......@@ -28,7 +28,7 @@ namespace
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
void test();
......@@ -51,7 +51,7 @@ namespace
bool HwpFilterTest::load(const OUString &,
const OUString &rURL, const OUString &,
unsigned int, SotClipboardFormatId, unsigned int)
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
uno::Sequence< beans::PropertyValue > aDescriptor(1);
aDescriptor[0].Name = "URL";
......
......@@ -20,6 +20,7 @@
#define INCLUDED_COMPHELPER_DOCUMENTCONSTANTS_HXX
#include <rtl/ustring.hxx>
#include <o3tl/typed_flags_set.hxx>
// formats of SO6/7
#define MIMETYPE_VND_SUN_XML_WRITER_ASCII "application/vnd.sun.xml.writer"
......@@ -72,8 +73,6 @@
#define ODFVER_011_TEXT "1.1"
#define ODFVER_012_TEXT "1.2"
#endif
// filter flags
// TODO/LATER: The flags should be part of the UNO specification
......@@ -105,33 +104,43 @@
// in filter, and rename the obscure ones to describe their meaning
// using terms that are understandable.
#define SFX_FILTER_IMPORT 0x00000001L
#define SFX_FILTER_EXPORT 0x00000002L
#define SFX_FILTER_TEMPLATE 0x00000004L
#define SFX_FILTER_INTERNAL 0x00000008L
#define SFX_FILTER_TEMPLATEPATH 0x00000010L
#define SFX_FILTER_OWN 0x00000020L
#define SFX_FILTER_ALIEN 0x00000040L
#define SFX_FILTER_USESOPTIONS 0x00000080L
enum class SfxFilterFlags
{
IMPORT = 0x00000001L,
EXPORT = 0x00000002L,
TEMPLATE = 0x00000004L,
INTERNAL = 0x00000008L,
TEMPLATEPATH = 0x00000010L,
OWN = 0x00000020L,
ALIEN = 0x00000040L,
USESOPTIONS = 0x00000080L,
#define SFX_FILTER_DEFAULT 0x00000100L
#define SFX_FILTER_EXECUTABLE 0x00000200L
#define SFX_FILTER_SUPPORTSSELECTION 0x00000400L
#define SFX_FILTER_NOTINFILEDLG 0x00001000L
#define SFX_FILTER_OPENREADONLY 0x00010000L
#define SFX_FILTER_MUSTINSTALL 0x00020000L
#define SFX_FILTER_CONSULTSERVICE 0x00040000L
DEFAULT = 0x00000100L,
EXECUTABLE = 0x00000200L,
SUPPORTSSELECTION = 0x00000400L,
NOTINFILEDLG = 0x00001000L,
OPENREADONLY = 0x00010000L,
MUSTINSTALL = 0x00020000L,
CONSULTSERVICE = 0x00040000L,
#define SFX_FILTER_STARONEFILTER 0x00080000L
#define SFX_FILTER_PACKED 0x00100000L
STARONEFILTER = 0x00080000L,
PACKED = 0x00100000L,
ENCRYPTION = 0x01000000L,
PASSWORDTOMODIFY = 0x02000000L,
#define SFX_FILTER_ENCRYPTION 0x01000000L
#define SFX_FILTER_PASSWORDTOMODIFY 0x02000000L
PREFERED = 0x10000000L,
#define SFX_FILTER_PREFERED 0x10000000L
STARTPRESENTATION = 0x20000000L,
#define SFX_FILTER_VERSION_NONE 0
#define SFX_FILTER_NOTINSTALLED SFX_FILTER_MUSTINSTALL | SFX_FILTER_CONSULTSERVICE
NONE = 0
};
namespace o3tl
{
template<> struct typed_flags<SfxFilterFlags> : is_typed_flags<SfxFilterFlags, 0x331f17ffL> {};
}
#define SFX_FILTER_NOTINSTALLED (SfxFilterFlags::MUSTINSTALL | SfxFilterFlags::CONSULTSERVICE)
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -32,6 +32,8 @@
#include <comphelper/comphelperdllapi.h>
enum class SfxFilterFlags;
namespace comphelper {
class COMPHELPER_DLLPUBLIC MimeConfigurationHelper
......@@ -124,8 +126,8 @@ public:
static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SearchForFilter(
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery >& xFilterQuery,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aSearchRequest,
sal_Int32 nMustFlags,
sal_Int32 nDontFlags );
SfxFilterFlags nMustFlags,
SfxFilterFlags nDontFlags );
static bool ClassIDsEqual( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID1,
const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID2 );
......
......@@ -29,7 +29,6 @@
#include <rtl/ustring.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/sfxdefs.hxx>
class SfxMedium;
class SfxFilter;
......
......@@ -30,7 +30,6 @@
#include <sal/types.h>
#include <sot/formats.hxx>
#include <sfx2/dllapi.h>
#include <sfx2/sfxdefs.hxx>
#include <tools/wldcrd.hxx>
#define SFX_FILTER_STARTPRESENTATION 0x20000000L
......@@ -78,13 +77,13 @@ public:
const OUString& rServiceName );
~SfxFilter();
bool IsAllowedAsTemplate() const { return (nFormatType & SFX_FILTER_TEMPLATE) != 0; }
bool IsOwnFormat() const { return (nFormatType & SFX_FILTER_OWN) != 0; }
bool IsOwnTemplateFormat() const { return (nFormatType & SFX_FILTER_TEMPLATEPATH) != 0; }
bool IsAlienFormat() const { return (nFormatType & SFX_FILTER_ALIEN) != 0; }
bool CanImport() const { return (nFormatType & SFX_FILTER_IMPORT) != 0; }
bool CanExport() const { return (nFormatType & SFX_FILTER_EXPORT) != 0; }
bool IsInternal() const { return (nFormatType & SFX_FILTER_INTERNAL) != 0; }
bool IsAllowedAsTemplate() const { return bool(nFormatType & SfxFilterFlags::TEMPLATE); }
bool IsOwnFormat() const { return bool(nFormatType & SfxFilterFlags::OWN); }
bool IsOwnTemplateFormat() const { return bool(nFormatType & SfxFilterFlags::TEMPLATEPATH); }
bool IsAlienFormat() const { return bool(nFormatType & SfxFilterFlags::ALIEN); }
bool CanImport() const { return bool(nFormatType & SfxFilterFlags::IMPORT); }
bool CanExport() const { return bool(nFormatType & SfxFilterFlags::EXPORT); }
bool IsInternal() const { return bool(nFormatType & SfxFilterFlags::INTERNAL); }
SfxFilterFlags GetFilterFlags() const { return nFormatType; }
const OUString& GetFilterName() const { return maFilterName; }
const OUString& GetMimeType() const { return aMimeType; }
......
......@@ -29,7 +29,6 @@
#include <vcl/window.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/sfxdefs.hxx>
#include <tools/ref.hxx>
......@@ -85,10 +84,10 @@ public:
const OUString GetName() const;
const SfxFilter* GetAnyFilter( SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4EA( const OUString& rEA, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4Extension( const OUString& rExt, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4FilterName( const OUString& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetAnyFilter( SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4EA( const OUString& rEA, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4Extension( const OUString& rExt, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4FilterName( const OUString& rName, SfxFilterFlags nMust = SfxFilterFlags::NONE, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
SAL_DLLPRIVATE static void ReadFilters_Impl( bool bUpdate=false );
SAL_DLLPRIVATE static void ReadSingleFilter_Impl( const OUString& rName,
......@@ -112,19 +111,19 @@ public:
SAL_DLLPRIVATE static bool IsFilterInstalled_Impl( const SfxFilter* pFilter );
DECL_DLLPRIVATE_STATIC_LINK( SfxFilterMatcher, MaybeFileHdl_Impl, OUString* );
sal_uInt32 GuessFilterIgnoringContent( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
sal_uInt32 GuessFilter( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
sal_uInt32 GuessFilterControlDefaultUI( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED, bool bDefUI = true ) const;
sal_uInt32 GuessFilterIgnoringContent( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
sal_uInt32 GuessFilter( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
sal_uInt32 GuessFilterControlDefaultUI( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED, bool bDefUI = true ) const;
sal_uInt32 DetectFilter( SfxMedium& rMedium, const SfxFilter **, bool bPlugIn, bool bAPI = false ) const;
const SfxFilter* GetFilter4Mime( const OUString& rMime, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED) const;
const SfxFilter* GetFilter4ClipBoardId( SotClipboardFormatId nId, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4EA( const OUString& rEA, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4Extension( const OUString& rExt, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4FilterName( const OUString& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4UIName( const OUString& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilterForProps( const com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue >& aSeq, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetAnyFilter( SfxFilterFlags nMust=0, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4Mime( const OUString& rMime, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED) const;
const SfxFilter* GetFilter4ClipBoardId( SotClipboardFormatId nId, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4EA( const OUString& rEA, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4Extension( const OUString& rExt, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4FilterName( const OUString& rName, SfxFilterFlags nMust = SfxFilterFlags::NONE, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilter4UIName( const OUString& rName, SfxFilterFlags nMust = SfxFilterFlags::NONE, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetFilterForProps( const com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue >& aSeq, SfxFilterFlags nMust = SfxFilterFlags::NONE, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
const SfxFilter* GetAnyFilter( SfxFilterFlags nMust=SfxFilterFlags::NONE, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED ) const;
};
class SfxFilterContainer_Impl;
......@@ -139,7 +138,7 @@ class SFX2_DLLPUBLIC SfxFilterMatcherIter : private boost::noncopyable
SAL_DLLPRIVATE const SfxFilter* Find_Impl();
public:
SfxFilterMatcherIter( const SfxFilterMatcher& rMatcher, SfxFilterFlags nMask = 0, SfxFilterFlags nNotMask = SFX_FILTER_NOTINSTALLED );
SfxFilterMatcherIter( const SfxFilterMatcher& rMatcher, SfxFilterFlags nMask = SfxFilterFlags::NONE, SfxFilterFlags nNotMask = SFX_FILTER_NOTINSTALLED );
const SfxFilter* First();
const SfxFilter* Next();
};
......
......@@ -30,7 +30,6 @@
#include <vcl/edit.hxx>
#include <vcl/button.hxx>
#include <vcl/graph.hxx>
#include <sfx2/sfxdefs.hxx>
#include <sfx2/sfxuno.hxx>
#include <sfx2/docfilt.hxx>
......@@ -108,8 +107,8 @@ public:
FileDialogHelper( sal_Int16 nDialogType,
sal_Int64 nFlags,
const OUString& rFactory,
SfxFilterFlags nMust = 0,
SfxFilterFlags nDont = 0 );
SfxFilterFlags nMust = SfxFilterFlags::NONE,
SfxFilterFlags nDont = SfxFilterFlags::NONE );
FileDialogHelper( sal_Int16 nDialogType,
sal_Int64 nFlags,
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SFX2_SFXDEFS_HXX
#define INCLUDED_SFX2_SFXDEFS_HXX
#include <sal/types.h>
typedef sal_uInt32 SfxFilterFlags;
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -43,7 +43,7 @@ public:
//additional filter data for SfxFilter
const OUString &rUserData = OUString(),