bump product version to 4.1.6.2
[LibreOffice.git] / filter / source / xsltdialog / xmlfiltersettingsdialog.hxx
blob80176e02128c9ca8451fd1c5669d7134b99150a0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef _XMLFILTERSETTINGSDIALOG_HXX_
20 #define _XMLFILTERSETTINGSDIALOG_HXX_
22 #include <com/sun/star/lang/XComponent.hpp>
23 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
24 #include <com/sun/star/container/XHierarchicalName.hpp>
25 #include <com/sun/star/container/XNameContainer.hpp>
26 #include <vcl/button.hxx>
27 #include <vcl/dialog.hxx>
28 #include <vcl/layout.hxx>
29 #include <svtools/svtabbx.hxx>
30 #include <svl/poolitem.hxx>
31 #include <unotools/moduleoptions.hxx>
33 #include "xmlfiltercommon.hxx"
35 // --------------------------------------------------------------------
37 class HeaderBar;
38 class XMLFilterListBox;
40 class SvxPathControl : public VclVBox
42 private:
43 bool bHasBeenShown;
44 HeaderBar* m_pHeaderBar;
45 XMLFilterListBox* m_pFocusCtrl;
46 protected:
47 virtual void setAllocation(const Size &rAllocation);
48 public:
49 SvxPathControl(Window* pParent);
50 HeaderBar* getHeaderBar() { return m_pHeaderBar; }
51 XMLFilterListBox* getListBox() { return m_pFocusCtrl; }
52 ~SvxPathControl();
54 virtual long Notify( NotifyEvent& rNEvt );
57 // --------------------------------------------------------------------
59 class HeaderBar;
61 class XMLFilterListBox : public SvTabListBox
63 private:
64 bool mbFirstPaint;
65 HeaderBar* m_pHeaderBar;
67 DECL_LINK( TabBoxScrollHdl_Impl, SvTabListBox* );
68 DECL_LINK( HeaderEndDrag_Impl, HeaderBar* );
70 OUString getEntryString( const filter_info_impl* pInfo ) const;
72 public:
73 XMLFilterListBox(SvxPathControl* pParent);
75 /** adds a new filter info entry to the ui filter list */
76 void addFilterEntry( const filter_info_impl* pInfo );
78 void changeEntry( const filter_info_impl* pInfo );
80 virtual void Paint( const Rectangle& rRect );
83 // --------------------------------------------------------------------
85 class XMLFilterSettingsDialog : public ModelessDialog
87 public:
88 XMLFilterSettingsDialog(Window* pParent,
89 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxMSF);
91 DECL_LINK(ClickHdl_Impl, PushButton * );
92 DECL_LINK(SelectionChangedHdl_Impl, void * );
93 DECL_LINK(DoubleClickHdl_Impl, void * );
95 virtual short Execute();
97 void onNew();
98 void onEdit();
99 void onTest();
100 void onDelete();
101 void onSave();
102 void onOpen();
103 void onClose();
105 void updateStates();
107 virtual long Notify( NotifyEvent& rNEvt );
109 bool isClosable();
111 private:
112 void initFilterList();
113 void disposeFilterList();
115 bool insertOrEdit( filter_info_impl* pNewInfo, const filter_info_impl* pOldInfo = NULL );
117 OUString createUniqueFilterName( const OUString& rUIName );
118 OUString createUniqueTypeName( const OUString& rTypeName );
119 OUString createUniqueInterfaceName( const OUString& rInterfaceName );
121 private:
123 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF;
124 com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxFilterContainer;
125 com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxTypeDetection;
126 com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxExtendedTypeDetection;
128 std::vector< filter_info_impl* > maFilterVector;
130 XMLFilterListBox* m_pFilterListBox;
131 SvxPathControl* m_pCtrlFilterList;
132 PushButton* m_pPBNew;
133 PushButton* m_pPBEdit;
134 PushButton* m_pPBTest;
135 PushButton* m_pPBDelete;
136 PushButton* m_pPBSave;
137 PushButton* m_pPBOpen;
138 CloseButton* m_pPBClose;
140 bool m_bIsClosable;
142 OUString m_sTemplatePath;
143 OUString m_sDocTypePrefix;
145 SvtModuleOptions maModuleOpt;
148 #endif
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */