LibreOffice Module reportdesign (master)  1
GroupsSorting.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 #ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_GROUPSSORTING_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_GROUPSSORTING_HXX
21 
22 #include <com/sun/star/report/XGroups.hpp>
23 #include <com/sun/star/report/XGroup.hpp>
24 #include <com/sun/star/container/XNameAccess.hpp>
26 #include <cppuhelper/basemutex.hxx>
27 #include <rtl/ref.hxx>
28 #include <vcl/weld.hxx>
29 #include <osl/diagnose.h>
30 
31 namespace comphelper
32 {
33  class OPropertyChangeMultiplexer;
34 }
35 namespace rptui
36 {
37 class OFieldExpressionControl;
38 class OReportController;
39 /*************************************************************************
40 |*
41 |* Groups and Sorting dialog
42 |*
43 \************************************************************************/
44 
46  , public ::cppu::BaseMutex
48 {
50 
54  css::uno::Reference< css::report::XGroups> m_xGroups;
55  css::uno::Reference< css::container::XNameAccess > m_xColumns;
57 
58  std::unique_ptr<weld::Toolbar> m_xToolBox;
59  std::unique_ptr<weld::Widget> m_xProperties;
60  std::unique_ptr<weld::ComboBox> m_xOrderLst;
61  std::unique_ptr<weld::ComboBox> m_xHeaderLst;
62  std::unique_ptr<weld::ComboBox> m_xFooterLst;
63  std::unique_ptr<weld::ComboBox> m_xGroupOnLst;
64  std::unique_ptr<weld::SpinButton> m_xGroupIntervalEd;
65  std::unique_ptr<weld::ComboBox> m_xKeepTogetherLst;
66  std::unique_ptr<weld::Label> m_xHelpWindow;
67  std::unique_ptr<weld::Container> m_xBox;
68  css::uno::Reference<css::awt::XWindow> m_xTableCtrlParent;
70 
71 private:
72  DECL_LINK( OnWidgetFocusLost, weld::Widget&, void );
73  DECL_LINK( OnWidgetFocusGot, weld::Widget&, void );
74 
75  DECL_LINK( OnControlFocusGot, LinkParamNone*, void );
76 
77  DECL_LINK( LBChangeHdl, weld::ComboBox&, void );
78  DECL_LINK( OnFormatAction, const OString&, void );
79 
83  css::uno::Reference< css::report::XGroups>& getGroups() { return m_xGroups; }
84 
85  css::uno::Reference< css::report::XGroup> getGroup(sal_Int32 _nPos)
86  {
87  OSL_ENSURE(_nPos >= 0 && _nPos < m_xGroups->getCount(),"Invalid count!");
88  return css::uno::Reference< css::report::XGroup>(m_xGroups->getByIndex(_nPos),css::uno::UNO_QUERY);
89  }
90 
94  void DisplayData( sal_Int32 _nRow );
95 
99  void SaveData( sal_Int32 _nRow );
100 
103  bool isReadOnly( ) const { return m_bReadOnly;}
104 
108  sal_Int32 getColumnDataType(const OUString& _sColumnName);
109 
113  void displayGroup(const css::uno::Reference< css::report::XGroup>& _xGroup);
114 
118  void checkButtons(sal_Int32 _nRow);
119 
123  void fillColumns();
124  OGroupsSortingDialog(OGroupsSortingDialog const &) = delete;
125  void operator =(OGroupsSortingDialog const &) = delete;
126 protected:
127  // OPropertyChangeListener
128  virtual void _propertyChanged(const css::beans::PropertyChangeEvent& _rEvent) override;
129 public:
131  bool _bReadOnly,
132  ::rptui::OReportController* _pController);
133  virtual ~OGroupsSortingDialog() override;
134 
135  /* updates the current view
136  */
137  void UpdateData( );
138 };
139 
140 } // namespace rptui
141 
142 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_GROUPSSORTING_HXX
143 
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::ComboBox > m_xKeepTogetherLst
css::uno::Reference< css::report::XGroups > & getGroups()
returns the groups
void operator=(OGroupsSortingDialog const &)=delete
std::unique_ptr< weld::ComboBox > m_xHeaderLst
void DisplayData(sal_Int32 _nRow)
updates the listboxes with the new group properties
::rptui::OReportController * m_pController
sal_Int32 getColumnDataType(const OUString &_sColumnName)
returns the data type for the given column name
css::uno::Reference< css::report::XGroups > m_xGroups
std::unique_ptr< weld::SpinButton > m_xGroupIntervalEd
css::uno::Reference< css::awt::XWindow > m_xTableCtrlParent
::rtl::Reference< comphelper::OPropertyChangeMultiplexer > m_pCurrentGroupListener
std::unique_ptr< weld::Label > m_xHelpWindow
std::unique_ptr< weld::ComboBox > m_xFooterLst
std::unique_ptr< weld::ComboBox > m_xGroupOnLst
VclPtr< OFieldExpressionControl > m_xFieldExpression
std::unique_ptr< weld::Toolbar > m_xToolBox
DECL_LINK(OnWidgetFocusLost, weld::Widget &, void)
virtual void _propertyChanged(const css::beans::PropertyChangeEvent &_rEvent) override
css::uno::Reference< css::report::XGroup > getGroup(sal_Int32 _nPos)
std::unique_ptr< weld::ComboBox > m_xOrderLst
void checkButtons(sal_Int32 _nRow)
enables or disables the up and down button
OGroupsSortingDialog(OGroupsSortingDialog const &)=delete
bool isReadOnly() const
returns when the dialog should be read only
std::unique_ptr< weld::Widget > m_xProperties
void fillColumns()
clears the m_xColumns member and reset the fields
::rtl::Reference< comphelper::OPropertyChangeMultiplexer > m_pReportListener
std::unique_ptr< weld::Container > m_xBox
virtual ~OGroupsSortingDialog() override
void SaveData(sal_Int32 _nRow)
saves the values from the listboxes into the group at position _nRow
css::uno::Reference< css::container::XNameAccess > m_xColumns
void displayGroup(const css::uno::Reference< css::report::XGroup > &_xGroup)
display the group props