update dev300-m57
[ooovba.git] / sfx2 / source / dialog / filtergrouping.hxx
blobf8c2acf8daaea07609b72de1ee5190daf51f2eaf
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: filtergrouping.hxx,v $
10 * $Revision: 1.9 $
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 ************************************************************************/
31 #ifndef SFX2_FILTERGROUPING_HXX
32 #define SFX2_FILTERGROUPING_HXX
34 #include <com/sun/star/ui/dialogs/XFilterManager.hpp>
35 #include <com/sun/star/container/XEnumeration.hpp>
36 #include "filedlgimpl.hxx"
38 class SfxFilterMatcherIter;
40 //........................................................................
41 namespace sfx2
43 //........................................................................
45 class TSortedFilterList
47 private:
49 ::std::vector< ::rtl::OUString > m_lFilters;
50 sal_Int32 m_nIterator;
52 public:
54 TSortedFilterList(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >& xFilterList);
55 const SfxFilter* First();
56 const SfxFilter* Next();
58 private:
59 const SfxFilter* impl_getFilter(sal_Int32 nIndex);
62 //--------------------------------------------------------------------
63 /** adds the given filters to the filter manager.
64 <p>To be used when saving generic files.</p>
66 void appendFiltersForSave(
67 TSortedFilterList& _rFilterMatcher,
68 const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilterManager >& _rFilterManager,
69 ::rtl::OUString& /* [out] */ _rFirstNonEmpty,
70 FileDialogHelper_Impl& _rFileDlgImpl,
71 const ::rtl::OUString& _rFactory
74 void appendExportFilters(
75 TSortedFilterList& _rFilterMatcher,
76 const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilterManager >& _rFilterManager,
77 ::rtl::OUString& /* [out] */ _rFirstNonEmpty,
78 FileDialogHelper_Impl& _rFileDlgImpl
81 //--------------------------------------------------------------------
82 /** adds the given filters to the filter manager.
83 <p>To be used when opening generic files.</p>
85 void appendFiltersForOpen(
86 TSortedFilterList& _rFilterMatcher,
87 const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilterManager >& _rFilterManager,
88 ::rtl::OUString& /* [out] */ _rFirstNonEmpty,
89 FileDialogHelper_Impl& _rFileDlgImpl
92 //--------------------------------------------------------------------
93 /** adds the given extension to the display text.
94 <p>To be used when opening or save generic files.</p>
96 ::rtl::OUString addExtension(
97 const ::rtl::OUString& _rDisplayText,
98 const ::rtl::OUString& _rExtension,
99 sal_Bool _bForOpen,
100 FileDialogHelper_Impl& _rFileDlgImpl
103 //........................................................................
104 } // namespace sfx2
105 //........................................................................
107 #endif // SFX2_FILTERGROUPING_HXX