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 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_SWRENAMEXNAMEDDLG_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_SWRENAMEXNAMEDDLG_HXX
21 
22 #include <vcl/textfilter.hxx>
23 #include <vcl/weld.hxx>
24 #include <com/sun/star/container/XNameAccess.hpp>
25 #include <com/sun/star/container/XNamed.hpp>
26 
27 class SwRenameXNamedDlg : public weld::GenericDialogController
28 {
29     css::uno::Reference< css::container::XNamed > &   xNamed;
30     css::uno::Reference< css::container::XNameAccess > & xNameAccess;
31     css::uno::Reference< css::container::XNameAccess >   xSecondAccess;
32     css::uno::Reference< css::container::XNameAccess >   xThirdAccess;
33 
34     TextFilter m_aTextFilter;
35 
36     std::shared_ptr<weld::Entry> m_xNewNameED;
37     std::shared_ptr<weld::Button> m_xOk;
38 
39     DECL_LINK(TextFilterHdl, OUString&, bool);
40     DECL_LINK(OkHdl, weld::Button&, void);
41     DECL_LINK(ModifyHdl, weld::Entry&, void);
42 
43 public:
44     SwRenameXNamedDlg(weld::Window* pParent,
45                       css::uno::Reference< css::container::XNamed > & xNamed,
46                       css::uno::Reference< css::container::XNameAccess > & xNameAccess );
47 
SetForbiddenChars(const OUString & rSet)48     void SetForbiddenChars(const OUString& rSet)
49     {
50         m_aTextFilter.SetForbiddenChars(rSet);
51     }
52 
SetAlternativeAccess(css::uno::Reference<css::container::XNameAccess> const & xSecond,css::uno::Reference<css::container::XNameAccess> const & xThird)53     void SetAlternativeAccess(
54             css::uno::Reference< css::container::XNameAccess > const & xSecond,
55             css::uno::Reference< css::container::XNameAccess > const & xThird )
56     {
57         xSecondAccess = xSecond;
58         xThirdAccess = xThird;
59     }
60 };
61 
62 #endif
63 
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
65