LibreOffice Module reportdesign (master) 1
AddField.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
20#ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_ADDFIELD_HXX
21#define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_ADDFIELD_HXX
22
23#include <com/sun/star/lang/XComponent.hpp>
24#include <com/sun/star/container/XNameAccess.hpp>
25#include <com/sun/star/sdbc/XConnection.hpp>
28
30#include <svx/dbaexchange.hxx>
32
33#include <vcl/weld.hxx>
34
35#include <rtl/ref.hxx>
36
37#include "ColumnInfo.hxx"
38
39namespace rptui
40{
41
42class OAddFieldWindow;
43
45 , public ::cppu::BaseMutex
48{
49 css::uno::Reference< css::lang::XComponent> m_xHoldAlive;
50 css::uno::Reference< css::container::XNameAccess> m_xColumns;
51 css::uno::Reference< css::beans::XPropertySet > m_xRowSet;
52
53 std::unique_ptr<weld::Toolbar> m_xActions;
54 std::unique_ptr<weld::TreeView> m_xListBox;
55
58 OUString m_sFilter;
59 sal_Int32 m_nCommandType;
64
65 std::vector<std::unique_ptr<ColumnInfo>> m_aListBoxData;
66
67 DECL_LINK( OnDoubleClickHdl, weld::TreeView&, bool );
68 DECL_LINK( OnSelectHdl, weld::TreeView&, void );
69 DECL_LINK( DragBeginHdl, bool&, bool );
70 DECL_LINK( OnSortAction, const OUString&, void );
71 DECL_LINK( FocusChangeHdl, weld::Container&, void );
72
73 void addToList(const css::uno::Sequence<OUString>& rEntries);
74 void addToList(const css::uno::Reference<css::container::XNameAccess>& i_xColumns);
75
77 void operator =(const OAddFieldWindow&) = delete;
78public:
80 css::uno::Reference< css::beans::XPropertySet > xRowSet);
81
82 virtual ~OAddFieldWindow() override;
83
84 const OUString& GetCommand() const { return m_aCommandName; }
85 sal_Int32 GetCommandType() const { return m_nCommandType; }
86 void SetCreateHdl(const Link<OAddFieldWindow&,void>& _aCreateLink) { m_aCreateLink = _aCreateLink; }
87
88 css::uno::Reference< css::sdbc::XConnection> getConnection() const;
89
90 css::uno::Sequence< css::beans::PropertyValue > getSelectedFieldDescriptors();
91
93 void Update();
94
100 void fillDescriptor(const weld::TreeIter& rSelected, svx::ODataAccessDescriptor& rDescriptor);
101
102private:
103 // FmXChangeListener
104 virtual void _propertyChanged(const css::beans::PropertyChangeEvent& evt) override;
105 // OContainerListener
106 virtual void _elementInserted( const css::container::ContainerEvent& _rEvent ) override;
107 virtual void _elementRemoved( const css::container::ContainerEvent& _rEvent ) override;
108 virtual void _elementReplaced( const css::container::ContainerEvent& _rEvent ) override;
109};
110
111} // rptui
112
113#endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_ADDFIELD_HXX
114
115/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::sdbc::XConnection > getConnection() const
Definition: AddField.cxx:248
css::uno::Reference< css::container::XNameAccess > m_xColumns
Definition: AddField.hxx:50
DECL_LINK(OnSelectHdl, weld::TreeView &, void)
virtual void _elementInserted(const css::container::ContainerEvent &_rEvent) override
Definition: AddField.cxx:281
virtual ~OAddFieldWindow() override
Definition: AddField.cxx:111
OAddFieldWindow(const OAddFieldWindow &)=delete
std::unique_ptr< weld::TreeView > m_xListBox
Definition: AddField.hxx:54
sal_Int32 GetCommandType() const
Definition: AddField.hxx:85
std::vector< std::unique_ptr< ColumnInfo > > m_aListBoxData
Definition: AddField.hxx:65
virtual void _elementRemoved(const css::container::ContainerEvent &_rEvent) override
Definition: AddField.cxx:299
void addToList(const css::uno::Reference< css::container::XNameAccess > &i_xColumns)
DECL_LINK(OnDoubleClickHdl, weld::TreeView &, bool)
::rtl::Reference< svx::OMultiColumnTransferable > m_xHelper
Definition: AddField.hxx:63
DECL_LINK(FocusChangeHdl, weld::Container &, void)
virtual void _propertyChanged(const css::beans::PropertyChangeEvent &evt) override
Definition: AddField.cxx:143
void fillDescriptor(const weld::TreeIter &rSelected, svx::ODataAccessDescriptor &rDescriptor)
fills the descriptor with the column name, column object, command and command type
Definition: AddField.cxx:253
void operator=(const OAddFieldWindow &)=delete
const OUString & GetCommand() const
Definition: AddField.hxx:84
sal_Int32 m_nCommandType
Definition: AddField.hxx:59
void SetCreateHdl(const Link< OAddFieldWindow &, void > &_aCreateLink)
Definition: AddField.hxx:86
css::uno::Sequence< css::beans::PropertyValue > getSelectedFieldDescriptors()
Definition: AddField.cxx:126
Link< OAddFieldWindow &, void > m_aCreateLink
Definition: AddField.hxx:56
std::unique_ptr< weld::Toolbar > m_xActions
Definition: AddField.hxx:53
OAddFieldWindow(weld::Window *pParent, css::uno::Reference< css::beans::XPropertySet > xRowSet)
css::uno::Reference< css::lang::XComponent > m_xHoldAlive
Definition: AddField.hxx:49
DECL_LINK(OnSortAction, const OUString &, void)
DECL_LINK(DragBeginHdl, bool &, bool)
::rtl::Reference< comphelper::OContainerListenerAdapter > m_pContainerListener
Definition: AddField.hxx:62
void Update()
Updates the current field list.
Definition: AddField.cxx:177
css::uno::Reference< css::beans::XPropertySet > m_xRowSet
Definition: AddField.hxx:51
::rtl::Reference< comphelper::OPropertyChangeMultiplexer > m_pChangeListener
Definition: AddField.hxx:61
void addToList(const css::uno::Sequence< OUString > &rEntries)
virtual void _elementReplaced(const css::container::ContainerEvent &_rEvent) override
Definition: AddField.cxx:307