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 SFX2_FILTERGROUPING_HXX
21 #define SFX2_FILTERGROUPING_HXX
23 #include <com/sun/star/ui/dialogs/XFilterManager.hpp>
24 #include <com/sun/star/container/XEnumeration.hpp>
25 #include "filedlgimpl.hxx"
27 //........................................................................
30 //........................................................................
32 class TSortedFilterList
36 ::std::vector
< OUString
> m_lFilters
;
37 sal_Int32 m_nIterator
;
41 TSortedFilterList(const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XEnumeration
>& xFilterList
);
42 const SfxFilter
* First();
43 const SfxFilter
* Next();
46 const SfxFilter
* impl_getFilter(sal_Int32 nIndex
);
49 //--------------------------------------------------------------------
50 /** adds the given filters to the filter manager.
51 <p>To be used when saving generic files.</p>
53 void appendFiltersForSave(
54 TSortedFilterList
& _rFilterMatcher
,
55 const ::com::sun::star::uno::Reference
< ::com::sun::star::ui::dialogs::XFilterManager
>& _rFilterManager
,
56 OUString
& /* [out] */ _rFirstNonEmpty
,
57 FileDialogHelper_Impl
& _rFileDlgImpl
,
58 const OUString
& _rFactory
61 void appendExportFilters(
62 TSortedFilterList
& _rFilterMatcher
,
63 const ::com::sun::star::uno::Reference
< ::com::sun::star::ui::dialogs::XFilterManager
>& _rFilterManager
,
64 OUString
& /* [out] */ _rFirstNonEmpty
,
65 FileDialogHelper_Impl
& _rFileDlgImpl
68 //--------------------------------------------------------------------
69 /** adds the given filters to the filter manager.
70 <p>To be used when opening generic files.</p>
72 void appendFiltersForOpen(
73 TSortedFilterList
& _rFilterMatcher
,
74 const ::com::sun::star::uno::Reference
< ::com::sun::star::ui::dialogs::XFilterManager
>& _rFilterManager
,
75 OUString
& /* [out] */ _rFirstNonEmpty
,
76 FileDialogHelper_Impl
& _rFileDlgImpl
79 //--------------------------------------------------------------------
80 /** adds the given extension to the display text.
81 <p>To be used when opening or save generic files.</p>
83 OUString
addExtension(
84 const OUString
& _rDisplayText
,
85 const OUString
& _rExtension
,
87 FileDialogHelper_Impl
& _rFileDlgImpl
90 //........................................................................
92 //........................................................................
94 #endif // SFX2_FILTERGROUPING_HXX
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */