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 class Control;
32 
33 namespace comphelper
34 {
35  class OPropertyChangeMultiplexer;
36 }
37 namespace rptui
38 {
39 class OFieldExpressionControl;
40 class OReportController;
41 /*************************************************************************
42 |*
43 |* Groups and Sorting dialog
44 |*
45 \************************************************************************/
46 
48  , public ::cppu::BaseMutex
50 {
52 
56  css::uno::Reference< css::report::XGroups> m_xGroups;
57  css::uno::Reference< css::container::XNameAccess > m_xColumns;
59 
60  std::unique_ptr<weld::Toolbar> m_xToolBox;
61  std::unique_ptr<weld::Widget> m_xProperties;
62  std::unique_ptr<weld::ComboBox> m_xOrderLst;
63  std::unique_ptr<weld::ComboBox> m_xHeaderLst;
64  std::unique_ptr<weld::ComboBox> m_xFooterLst;
65  std::unique_ptr<weld::ComboBox> m_xGroupOnLst;
66  std::unique_ptr<weld::SpinButton> m_xGroupIntervalEd;
67  std::unique_ptr<weld::ComboBox> m_xKeepTogetherLst;
68  std::unique_ptr<weld::Label> m_xHelpWindow;
69  std::unique_ptr<weld::Container> m_xBox;
70  css::uno::Reference<css::awt::XWindow> m_xTableCtrlParent;
72 
73 private:
74  DECL_LINK( OnWidgetFocusLost, weld::Widget&, void );
75  DECL_LINK( OnWidgetFocusGot, weld::Widget&, void );
76 
77  DECL_LINK( OnControlFocusGot, LinkParamNone*, void );
78 
79  DECL_LINK( LBChangeHdl, weld::ComboBox&, void );
80  DECL_LINK( OnFormatAction, const OString&, void );
81 
85  css::uno::Reference< css::report::XGroups>& getGroups() { return m_xGroups; }
86 
87  css::uno::Reference< css::report::XGroup> getGroup(sal_Int32 _nPos)
88  {
89  OSL_ENSURE(_nPos >= 0 && _nPos < m_xGroups->getCount(),"Invalid count!");
90  return css::uno::Reference< css::report::XGroup>(m_xGroups->getByIndex(_nPos),css::uno::UNO_QUERY);
91  }
92 
96  void DisplayData( sal_Int32 _nRow );
97 
101  void SaveData( sal_Int32 _nRow );
102 
105  bool isReadOnly( ) const { return m_bReadOnly;}
106 
110  sal_Int32 getColumnDataType(const OUString& _sColumnName);
111 
115  void displayGroup(const css::uno::Reference< css::report::XGroup>& _xGroup);
116 
120  void checkButtons(sal_Int32 _nRow);
121 
125  void fillColumns();
126  OGroupsSortingDialog(OGroupsSortingDialog const &) = delete;
127  void operator =(OGroupsSortingDialog const &) = delete;
128 protected:
129  // OPropertyChangeListener
130  virtual void _propertyChanged(const css::beans::PropertyChangeEvent& _rEvent) override;
131 public:
133  bool _bReadOnly,
134  ::rptui::OReportController* _pController);
135  virtual ~OGroupsSortingDialog() override;
136 
137  /* updates the current view
138  */
139  void UpdateData( );
140 };
141 
142 } // namespace rptui
143 
144 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_GROUPSSORTING_HXX
145 
146 /* 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