bump product version to 4.1.6.2
[LibreOffice.git] / reportdesign / source / ui / inc / GroupsSorting.hxx
blob53b7d50e4569686436311a0e21072219ec3d5963
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 .
19 #ifndef RPTUI_GROUPS_SORTING_HXX
20 #define RPTUI_GROUPS_SORTING_HXX
22 #include <vcl/floatwin.hxx>
23 #include <vcl/fixed.hxx>
24 #include <vcl/lstbox.hxx>
25 #include <vcl/edit.hxx>
26 #include <vcl/field.hxx>
27 #include <vcl/button.hxx>
28 #include <vcl/toolbox.hxx>
29 #include <com/sun/star/report/XGroups.hpp>
30 #include <com/sun/star/report/XGroup.hpp>
31 #include <com/sun/star/container/XNameAccess.hpp>
32 #include "GroupProperties.hxx"
33 #include <comphelper/propmultiplex.hxx>
34 #include "cppuhelper/basemutex.hxx"
35 #include <svtools/svmedit.hxx>
36 #include <rtl/ref.hxx>
38 #include <vector>
40 #include <dbaccess/ToolBoxHelper.hxx>
42 #include <vcl/ImageListProvider.hxx>
44 namespace comphelper
46 class OPropertyChangeMultiplexer;
48 namespace rptui
50 class OFieldExpressionControl;
51 class OReportController;
52 /*************************************************************************
54 |* Groups and Sorting dialog
56 \************************************************************************/
58 class OGroupsSortingDialog : public FloatingWindow
59 , public ::cppu::BaseMutex
60 , public ::comphelper::OPropertyChangeListener
61 , public dbaui::OToolBoxHelper
62 , public vcl::IImageListProvider
64 friend class OFieldExpressionControl;
66 FixedLine m_aFL2;
67 FixedText m_aMove;
68 ToolBox m_aToolBox;
70 FixedLine m_aFL3;
71 FixedText m_aOrder;
72 ListBox m_aOrderLst;
73 FixedText m_aHeader;
74 ListBox m_aHeaderLst;
75 FixedText m_aFooter;
76 ListBox m_aFooterLst;
77 FixedText m_aGroupOn;
78 ListBox m_aGroupOnLst;
79 FixedText m_aGroupInterval;
80 NumericField m_aGroupIntervalEd;
81 FixedText m_aKeepTogether;
82 ListBox m_aKeepTogetherLst;
83 FixedLine m_aFL;
84 FixedText m_aHelpWindow;
86 OFieldExpressionControl* m_pFieldExpression;
87 ::rptui::OReportController* m_pController;
88 ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pCurrentGroupListener;
89 ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener;
90 ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups> m_xGroups;
91 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xColumns;
92 sal_Bool m_bReadOnly;
93 private:
94 DECL_LINK( OnControlFocusLost, Control* );
95 DECL_LINK( OnControlFocusGot, Control* );
96 DECL_LINK( LBChangeHdl, ListBox* );
97 DECL_LINK( OnFormatAction, ToolBox* );
99 /** returns the groups
100 @return the groups which now have to check which one changes
102 ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups>& getGroups() { return m_xGroups; }
104 ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup> getGroup(sal_Int32 _nPos)
106 OSL_ENSURE(_nPos >= 0 && _nPos < m_xGroups->getCount(),"Invalid count!");
107 return ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>(m_xGroups->getByIndex(_nPos),::com::sun::star::uno::UNO_QUERY);
110 /** updates the listboxes with the new group properties
111 @param _nRow the new group pos
113 void DisplayData( sal_Int32 _nRow );
115 /** saves the values from the listboxes into the group at position _nRow
116 @param _nRow the group pos to store in
118 void SaveData( sal_Int32 _nRow );
120 /** returns <TRUE/> when the dialog should be read only
122 sal_Bool isReadOnly( ) const;
124 /** returns the data type for the given column name
125 @param _sColumnName
127 sal_Int32 getColumnDataType(const OUString& _sColumnName);
129 /** shows the text given by the id in the multiline edit
130 @param _nResId the string id
132 void showHelpText(sal_uInt16 _nResId);
133 /** display the group props
134 @param _xGroup the group to display
136 void displayGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup);
138 /** enables or diables the up and down button
139 @param _nRow the row which will be active
141 void checkButtons(sal_Int32 _nRow);
143 /** clears the m_xColumns member and reset the fields
146 void fillColumns();
147 OGroupsSortingDialog(OGroupsSortingDialog&);
148 void operator =(OGroupsSortingDialog&);
149 protected:
150 // window
151 virtual void Resize();
152 // OPropertyChangeListener
153 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
154 public:
155 OGroupsSortingDialog( Window* pParent
156 ,sal_Bool _bReadOnly
157 ,::rptui::OReportController* _pController);
158 virtual ~OGroupsSortingDialog();
160 /** sets the newe columns at the groups dialog.
161 @param _xColumns the new columns
163 void setColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xColumns);
165 /* updates the current view
167 void UpdateData( );
169 /** will be called when the controls need to be resized.
170 @param _rDiff
171 Contains the difference of the old and new toolbox size.
173 virtual void resizeControls(const Size& _rDiff);
175 /** will be called when the image list is needed.
176 @param _eSymbolsSize
177 <svtools/imgdef.hxx>
179 virtual ImageList getImageList(sal_Int16 _eSymbolsSize) const;
181 // ImageListProvider interface
182 virtual ImageList getImageList(vcl::ImageListType) SAL_THROW ((com::sun::star::lang::IllegalArgumentException ));
185 // =============================================================================
186 } // namespace rptui
187 // =============================================================================
188 #endif // RPTUI_GROUPS_SORTING_HXX
190 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */