1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SFX2_SOURCE_DIALOG_FILTERGROUPING_HXX
21 #define INCLUDED_SFX2_SOURCE_DIALOG_FILTERGROUPING_HXX
23 #include <com/sun/star/ui/dialogs/XFilterManager.hpp>
24 #include <com/sun/star/container/XEnumeration.hpp>
25 #include "filedlgimpl.hxx"
33 class TSortedFilterList
36 ::std::vector
< OUString
> m_lFilters
;
37 sal_Int32 m_nIterator
;
40 explicit TSortedFilterList(const css::uno::Reference
< css::container::XEnumeration
>& xFilterList
);
41 std::shared_ptr
<const SfxFilter
> First();
42 std::shared_ptr
<const SfxFilter
> Next();
45 std::shared_ptr
<const SfxFilter
> impl_getFilter(sal_Int32 nIndex
);
49 /** adds the given filters to the filter manager.
50 <p>To be used when saving generic files.</p>
52 void appendFiltersForSave(
53 TSortedFilterList
& _rFilterMatcher
,
54 const css::uno::Reference
< css::ui::dialogs::XFilterManager
>& _rFilterManager
,
55 OUString
& /* [out] */ _rFirstNonEmpty
,
56 FileDialogHelper_Impl
& _rFileDlgImpl
,
57 std::u16string_view _rFactory
60 void appendExportFilters(
61 TSortedFilterList
& _rFilterMatcher
,
62 const css::uno::Reference
< css::ui::dialogs::XFilterManager
>& _rFilterManager
,
63 OUString
& /* [out] */ _rFirstNonEmpty
,
64 FileDialogHelper_Impl
& _rFileDlgImpl
68 /** adds the given filters to the filter manager.
69 <p>To be used when opening generic files.</p>
71 void appendFiltersForOpen(
72 TSortedFilterList
& _rFilterMatcher
,
73 const css::uno::Reference
< css::ui::dialogs::XFilterManager
>& _rFilterManager
,
74 OUString
& /* [out] */ _rFirstNonEmpty
,
75 FileDialogHelper_Impl
& _rFileDlgImpl
79 /** adds the given extension to the display text.
80 <p>To be used when opening or save generic files.</p>
82 OUString
addExtension(
83 const OUString
& _rDisplayText
,
84 const OUString
& _rExtension
,
86 FileDialogHelper_Impl
& _rFileDlgImpl
93 #endif // INCLUDED_SFX2_SOURCE_DIALOG_FILTERGROUPING_HXX
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */