Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / extensions / source / propctrlr / selectlabeldialog.hxx
bloba380dba739ed6607a412191dd00338e3853be68a
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 .
20 #ifndef INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_SELECTLABELDIALOG_HXX
21 #define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_SELECTLABELDIALOG_HXX
23 #include <vcl/weld.hxx>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include "modulepcr.hxx"
27 namespace pcr
29 // OSelectLabelDialog
30 class OSelectLabelDialog final : public weld::GenericDialogController
32 css::uno::Reference< css::beans::XPropertySet > m_xControlModel;
33 OUString m_sRequiredService;
34 OUString m_aRequiredControlImage;
35 std::unique_ptr<weld::TreeIter> m_xInitialSelection;
36 // the entry data of the listbox entries
37 std::vector<std::unique_ptr<css::uno::Reference<css::beans::XPropertySet>>> m_xUserData;
38 css::uno::Reference< css::beans::XPropertySet > m_xInitialLabelControl;
40 css::uno::Reference< css::beans::XPropertySet > m_xSelectedControl;
41 std::unique_ptr<weld::TreeIter> m_xLastSelected;
42 bool m_bLastSelected;
43 bool m_bHaveAssignableControl;
45 std::unique_ptr<weld::Label> m_xMainDesc;
46 std::unique_ptr<weld::TreeView> m_xControlTree;
47 std::unique_ptr<weld::CheckButton> m_xNoAssignment;
49 public:
50 OSelectLabelDialog(weld::Window* pParent, css::uno::Reference< css::beans::XPropertySet > const & _xControlModel);
51 virtual ~OSelectLabelDialog() override;
53 css::uno::Reference< css::beans::XPropertySet > GetSelected() const { return m_xNoAssignment->get_active() ? css::uno::Reference< css::beans::XPropertySet > () : m_xSelectedControl; }
55 private:
56 sal_Int32 InsertEntries(const css::uno::Reference< css::uno::XInterface >& _xContainer, weld::TreeIter& rContainerEntry);
58 DECL_LINK(OnEntrySelected, weld::TreeView&, void);
59 DECL_LINK(OnNoAssignmentClicked, weld::ToggleButton&, void);
61 } // namespace pcr
63 #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_SELECTLABELDIALOG_HXX
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */