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 .
19 #ifndef INCLUDED_FILTER_SOURCE_XSLTDIALOG_XMLFILTERSETTINGSDIALOG_HXX
20 #define INCLUDED_FILTER_SOURCE_XSLTDIALOG_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"
36 class XMLFilterListBox
;
38 class SvxPathControl
: public vcl::Window
42 VclPtr
<VclVBox
> m_pVBox
;
43 VclPtr
<HeaderBar
> m_pHeaderBar
;
44 VclPtr
<XMLFilterListBox
> m_pFocusCtrl
;
46 virtual void Resize() override
;
47 virtual Size
GetOptimalSize() const override
;
49 explicit SvxPathControl(vcl::Window
* pParent
);
50 HeaderBar
* getHeaderBar() { return m_pHeaderBar
; }
51 XMLFilterListBox
* getListBox() { return m_pFocusCtrl
; }
52 virtual ~SvxPathControl() override
;
53 virtual void dispose() override
;
55 virtual bool EventNotify( NotifyEvent
& rNEvt
) override
;
60 class XMLFilterListBox
: public SvTabListBox
63 VclPtr
<HeaderBar
> m_pHeaderBar
;
65 DECL_LINK( TabBoxScrollHdl_Impl
, SvTreeListBox
*, void );
66 DECL_LINK( HeaderEndDrag_Impl
, HeaderBar
*, void );
68 static OUString
getEntryString( const filter_info_impl
* pInfo
);
71 XMLFilterListBox(Window
* pParent
, SvxPathControl
* pPathControl
);
72 virtual ~XMLFilterListBox() override
;
73 virtual void dispose() override
;
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
);
82 class XMLFilterSettingsDialog
: public ModelessDialog
85 XMLFilterSettingsDialog(vcl::Window
* pParent
,
86 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
87 Dialog::InitFlag eFlag
= Dialog::InitFlag::Default
);
88 virtual ~XMLFilterSettingsDialog() override
;
89 virtual void dispose() override
;
91 DECL_LINK(ClickHdl_Impl
, Button
*, void );
92 DECL_LINK(SelectionChangedHdl_Impl
, SvTreeListBox
*, void );
93 DECL_LINK(DoubleClickHdl_Impl
, SvTreeListBox
*, bool );
95 virtual short Execute() override
;
106 virtual bool EventNotify( NotifyEvent
& rNEvt
) override
;
108 bool isClosable() { return m_bIsClosable
;}
111 void initFilterList();
112 void disposeFilterList();
114 bool insertOrEdit( filter_info_impl
* pNewInfo
, const filter_info_impl
* pOldInfo
= nullptr );
116 OUString
createUniqueFilterName( const OUString
& rUIName
);
117 OUString
createUniqueTypeName( const OUString
& rTypeName
);
118 OUString
createUniqueInterfaceName( const OUString
& rInterfaceName
);
122 css::uno::Reference
< css::uno::XComponentContext
> mxContext
;
123 css::uno::Reference
< css::container::XNameContainer
> mxFilterContainer
;
124 css::uno::Reference
< css::container::XNameContainer
> mxTypeDetection
;
125 css::uno::Reference
< css::container::XNameContainer
> mxExtendedTypeDetection
;
127 std::vector
< filter_info_impl
* > maFilterVector
;
129 VclPtr
<XMLFilterListBox
> m_pFilterListBox
;
130 VclPtr
<SvxPathControl
> m_pCtrlFilterList
;
131 VclPtr
<PushButton
> m_pPBNew
;
132 VclPtr
<PushButton
> m_pPBEdit
;
133 VclPtr
<PushButton
> m_pPBTest
;
134 VclPtr
<PushButton
> m_pPBDelete
;
135 VclPtr
<PushButton
> m_pPBSave
;
136 VclPtr
<PushButton
> m_pPBOpen
;
137 VclPtr
<CloseButton
> m_pPBClose
;
141 OUString m_sTemplatePath
;
142 OUString m_sDocTypePrefix
;
144 SvtModuleOptions maModuleOpt
;
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */