summaryrefslogtreecommitdiff
path: root/include/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-18 13:03:28 +0200
committerNoel Grandin <noel@peralex.com>2015-03-19 08:25:03 +0200
commit48bb2913a7459edb17a5f62c2f6e6fbc4f1051e2 (patch)
tree7e2f09fc8998bc1016f4d2ba7fa09e3125663361 /include/sfx2
parentbdad6d0fe492a2334cb27ef54fc5d1cba17d1970 (diff)
convert SFX_FILTER_ constants to enum class
Change-Id: I7e53cfc90cefd9da7d6ecd795b09214bd44b1613
Diffstat (limited to 'include/sfx2')
-rw-r--r--include/sfx2/docfac.hxx1
-rw-r--r--include/sfx2/docfilt.hxx15
-rw-r--r--include/sfx2/fcontnr.hxx33
-rw-r--r--include/sfx2/filedlghelper.hxx5
-rw-r--r--include/sfx2/sfxdefs.hxx29
5 files changed, 25 insertions, 58 deletions
diff --git a/include/sfx2/docfac.hxx b/include/sfx2/docfac.hxx
index 509de0f24464..492cb4f61d4e 100644
--- a/include/sfx2/docfac.hxx
+++ b/include/sfx2/docfac.hxx
@@ -29,7 +29,6 @@
#include <rtl/ustring.hxx>
#include <sfx2/objsh.hxx>
-#include <sfx2/sfxdefs.hxx>
class SfxMedium;
class SfxFilter;
diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx
index 5506f44cb9c3..dad0da5db039 100644
--- a/include/sfx2/docfilt.hxx
+++ b/include/sfx2/docfilt.hxx
@@ -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; }
diff --git a/include/sfx2/fcontnr.hxx b/include/sfx2/fcontnr.hxx
index 7a71a130f99a..7e66740176ac 100644
--- a/include/sfx2/fcontnr.hxx
+++ b/include/sfx2/fcontnr.hxx
@@ -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();
};
diff --git a/include/sfx2/filedlghelper.hxx b/include/sfx2/filedlghelper.hxx
index 2afd9ae682d2..34688c14a8c5 100644
--- a/include/sfx2/filedlghelper.hxx
+++ b/include/sfx2/filedlghelper.hxx
@@ -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,
diff --git a/include/sfx2/sfxdefs.hxx b/include/sfx2/sfxdefs.hxx
deleted file mode 100644
index 2533f1f1fbe7..000000000000
--- a/include/sfx2/sfxdefs.hxx
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- 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: */