1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlfiltersettingsdialog.hxx,v $
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 ************************************************************************/
30 #ifndef _XMLFILTERSETTINGSDIALOG_HXX_
31 #define _XMLFILTERSETTINGSDIALOG_HXX_
33 #include <com/sun/star/lang/XComponent.hpp>
34 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35 #include <com/sun/star/container/XHierarchicalName.hpp>
36 #include <com/sun/star/container/XNameContainer.hpp>
37 #include <vcl/wrkwin.hxx>
39 #ifndef _SV_BUTTON_HXX
40 #include <vcl/button.hxx>
42 #include <svtools/svtabbx.hxx>
43 #include <svtools/poolitem.hxx>
44 #include <svtools/moduleoptions.hxx>
46 #include "xmlfiltercommon.hxx"
48 // --------------------------------------------------------------------
50 class SvxPathControl_Impl
: public Control
53 Control
* m_pFocusCtrl
;
56 SvxPathControl_Impl( Window
* pParent
, const ResId
& rId
) :
57 Control( pParent
, rId
), m_pFocusCtrl( NULL
) {}
59 void SetFocusControl( Control
* pCtrl
) { m_pFocusCtrl
= pCtrl
; }
61 virtual long Notify( NotifyEvent
& rNEvt
);
64 // --------------------------------------------------------------------
68 class XMLFilterListBox
: public SvTabListBox
72 HeaderBar
* mpHeaderBar
;
74 DECL_LINK( TabBoxScrollHdl_Impl
, SvTabListBox
* );
75 DECL_LINK( HeaderSelect_Impl
, HeaderBar
* );
76 DECL_LINK( HeaderEndDrag_Impl
, HeaderBar
* );
78 String
getEntryString( const filter_info_impl
* pInfo
) const;
81 XMLFilterListBox( SvxPathControl_Impl
* pParent
);
86 /** adds a new filter info entry to the ui filter list */
87 void addFilterEntry( const filter_info_impl
* pInfo
);
89 void changeEntry( const filter_info_impl
* pInfo
);
91 virtual void Paint( const Rectangle
& rRect
);
94 // --------------------------------------------------------------------
96 class XMLFilterTestDialog
;
98 class XMLFilterSettingsDialog
: public WorkWindow
101 XMLFilterSettingsDialog( Window
* pParent
, ResMgr
& rResMgr
, const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rxMSF
);
102 virtual ~XMLFilterSettingsDialog();
104 DECL_LINK(ClickHdl_Impl
, PushButton
* );
105 DECL_LINK(SelectionChangedHdl_Impl
, void * );
106 DECL_LINK(DoubleClickHdl_Impl
, void * );
120 virtual long Notify( NotifyEvent
& rNEvt
);
124 static ResMgr
* mpResMgr
;
127 void initFilterList();
128 void disposeFilterList();
130 bool insertOrEdit( filter_info_impl
* pNewInfo
, const filter_info_impl
* pOldInfo
= NULL
);
132 rtl::OUString
createUniqueFilterName( const rtl::OUString
& rUIName
);
133 rtl::OUString
createUniqueTypeName( const rtl::OUString
& rTypeName
);
134 rtl::OUString
createUniqueInterfaceName( const rtl::OUString
& rInterfaceName
);
138 com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
> mxMSF
;
139 com::sun::star::uno::Reference
< com::sun::star::container::XNameContainer
> mxFilterContainer
;
140 com::sun::star::uno::Reference
< com::sun::star::container::XNameContainer
> mxTypeDetection
;
141 com::sun::star::uno::Reference
< com::sun::star::container::XNameContainer
> mxExtendedTypeDetection
;
143 std::vector
< filter_info_impl
* > maFilterVector
;
145 XMLFilterListBox
* mpFilterListBox
;
146 SvxPathControl_Impl maCtrlFilterList
;
150 PushButton maPBDelete
;
154 PushButton maPBClose
;
158 ::rtl::OUString sTemplatePath
;
159 ::rtl::OUString sDocTypePrefix
;
161 SvtModuleOptions maModuleOpt
;