LibreOffice Module filter (master) 1
xmlfiltersettingsdialog.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include <com/sun/star/container/XNameContainer.hpp>
22#include <com/sun/star/uno/XComponentContext.hpp>
23#include <vcl/weld.hxx>
24#include <vcl/locktoplevels.hxx>
26
27#include "xmlfiltercommon.hxx"
28
30{
31public:
33 const css::uno::Reference< css::uno::XComponentContext >& rxContext);
34 virtual ~XMLFilterSettingsDialog() override;
35
36 DECL_LINK(ClickHdl_Impl, weld::Button&, void );
37 DECL_LINK(SelectionChangedHdl_Impl, weld::TreeView&, void);
38 DECL_LINK(DoubleClickHdl_Impl, weld::TreeView&, bool);
39
40 void UpdateWindow();
41
42 void present() { m_xDialog->present(); }
43
44 void onNew();
45 void onEdit();
46 void onTest();
47 void onDelete();
48 void onSave();
49 void onOpen();
50
51 void updateStates();
52private:
53 void initFilterList();
54 void disposeFilterList();
55
56 void incBusy() { maBusy.incBusy(m_xDialog.get()); }
57 void decBusy() { maBusy.decBusy(); }
58
59 bool insertOrEdit( filter_info_impl* pNewInfo, const filter_info_impl* pOldInfo = nullptr );
60
61 OUString createUniqueFilterName( const OUString& rUIName );
62 OUString createUniqueTypeName( const OUString& rTypeName );
63 OUString createUniqueInterfaceName( const OUString& rInterfaceName );
64
66 void addFilterEntry( const filter_info_impl* pInfo );
67
68 void changeEntry( const filter_info_impl* pInfo );
69
70 static OUString getEntryString( const filter_info_impl* pInfo );
71
72private:
73 css::uno::Reference< css::uno::XComponentContext > mxContext;
74 css::uno::Reference< css::container::XNameContainer > mxFilterContainer;
75 css::uno::Reference< css::container::XNameContainer > mxTypeDetection;
76 css::uno::Reference< css::container::XNameContainer > mxExtendedTypeDetection;
77
78 std::vector< std::unique_ptr<filter_info_impl> > maFilterVector;
79
81
84
86
87 std::unique_ptr<weld::Button> m_xPBNew;
88 std::unique_ptr<weld::Button> m_xPBEdit;
89 std::unique_ptr<weld::Button> m_xPBTest;
90 std::unique_ptr<weld::Button> m_xPBDelete;
91 std::unique_ptr<weld::Button> m_xPBSave;
92 std::unique_ptr<weld::Button> m_xPBOpen;
93 std::unique_ptr<weld::Button> m_xPBClose;
94 std::unique_ptr<weld::TreeView> m_xFilterListBox;
95};
96
97/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void incBusy(const weld::Widget *pIgnore)
DECL_LINK(SelectionChangedHdl_Impl, weld::TreeView &, void)
void onEdit()
is called when the user clicks on the "Edit" Button
bool insertOrEdit(filter_info_impl *pNewInfo, const filter_info_impl *pOldInfo=nullptr)
inserts a new filter into the ui and configuration if pOldInfo is NULL.
css::uno::Reference< css::uno::XComponentContext > mxContext
void onTest()
is called when the user clicks the "Test" button
virtual ~XMLFilterSettingsDialog() override
css::uno::Reference< css::container::XNameContainer > mxTypeDetection
DECL_LINK(DoubleClickHdl_Impl, weld::TreeView &, bool)
void onNew()
is called when the user clicks on the "New" button
DECL_LINK(ClickHdl_Impl, weld::Button &, void)
std::unique_ptr< weld::TreeView > m_xFilterListBox
css::uno::Reference< css::container::XNameContainer > mxFilterContainer
std::unique_ptr< weld::Button > m_xPBEdit
OUString createUniqueInterfaceName(const OUString &rInterfaceName)
checks if the given name is a unique ui name inside the filter factory.
XMLFilterSettingsDialog(weld::Window *pParent, const css::uno::Reference< css::uno::XComponentContext > &rxContext)
OUString createUniqueTypeName(const OUString &rTypeName)
checks if the given name is unique inside the type detection.
void changeEntry(const filter_info_impl *pInfo)
std::unique_ptr< weld::Button > m_xPBDelete
std::unique_ptr< weld::Button > m_xPBTest
OUString createUniqueFilterName(const OUString &rUIName)
checks if the given name is unique inside the filter factory.
css::uno::Reference< css::container::XNameContainer > mxExtendedTypeDetection
std::unique_ptr< weld::Button > m_xPBClose
std::unique_ptr< weld::Button > m_xPBSave
void addFilterEntry(const filter_info_impl *pInfo)
adds a new filter info entry to the ui filter list
static OUString getEntryString(const filter_info_impl *pInfo)
std::unique_ptr< weld::Button > m_xPBNew
std::unique_ptr< weld::Button > m_xPBOpen
std::vector< std::unique_ptr< filter_info_impl > > maFilterVector
std::shared_ptr< weld::Dialog > m_xDialog