Update ooo320-m1
[ooovba.git] / filter / source / xsltdialog / xmlfiltersettingsdialog.hxx
blobc454b21a6e38484fd78946c2da0f014ffd4c7ae8
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: xmlfiltersettingsdialog.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 ************************************************************************/
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>
41 #endif
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
52 private:
53 Control* m_pFocusCtrl;
55 public:
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 // --------------------------------------------------------------------
66 class HeaderBar;
68 class XMLFilterListBox : public SvTabListBox
70 private:
71 bool mbFirstPaint;
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;
80 public:
81 XMLFilterListBox( SvxPathControl_Impl* pParent );
82 ~XMLFilterListBox();
84 void Reset();
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
100 public:
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 * );
108 void ShowWindow();
110 void onNew();
111 void onEdit();
112 void onTest();
113 void onDelete();
114 void onSave();
115 void onOpen();
116 void onClose();
118 void updateStates();
120 virtual long Notify( NotifyEvent& rNEvt );
122 bool isClosable();
124 static ResMgr* mpResMgr;
126 private:
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 );
136 private:
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;
147 PushButton maPBNew;
148 PushButton maPBEdit;
149 PushButton maPBTest;
150 PushButton maPBDelete;
151 PushButton maPBSave;
152 PushButton maPBOpen;
153 HelpButton maPBHelp;
154 PushButton maPBClose;
156 bool mbIsClosable;
158 ::rtl::OUString sTemplatePath;
159 ::rtl::OUString sDocTypePrefix;
161 SvtModuleOptions maModuleOpt;
164 #endif