update emoji autocorrect entries from po-files
[LibreOffice.git] / reportdesign / source / ui / inc / GroupsSorting.hxx
blobe1a7fb3770943fbb61587ab819cd59b9a52aa169
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 INCLUDED_REPORTDESIGN_SOURCE_UI_INC_GROUPSSORTING_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_GROUPSSORTING_HXX
22 #include <vcl/floatwin.hxx>
23 #include <vcl/fixed.hxx>
24 #include <vcl/layout.hxx>
25 #include <vcl/lstbox.hxx>
26 #include <vcl/edit.hxx>
27 #include <vcl/field.hxx>
28 #include <vcl/button.hxx>
29 #include <vcl/toolbox.hxx>
30 #include <com/sun/star/report/XGroups.hpp>
31 #include <com/sun/star/report/XGroup.hpp>
32 #include <com/sun/star/container/XNameAccess.hpp>
33 #include "GroupProperties.hxx"
34 #include <comphelper/propmultiplex.hxx>
35 #include <cppuhelper/basemutex.hxx>
36 #include <svtools/svmedit.hxx>
37 #include <rtl/ref.hxx>
39 #include <vector>
41 #include <dbaccess/ToolBoxHelper.hxx>
43 namespace comphelper
45 class OPropertyChangeMultiplexer;
47 namespace rptui
49 class OFieldExpressionControl;
50 class OReportController;
51 /*************************************************************************
53 |* Groups and Sorting dialog
55 \************************************************************************/
57 class OGroupsSortingDialog : public FloatingWindow
58 , public ::cppu::BaseMutex
59 , public ::comphelper::OPropertyChangeListener
61 friend class OFieldExpressionControl;
63 VclPtr<ToolBox> m_pToolBox;
64 sal_uInt16 m_nMoveUpId;
65 sal_uInt16 m_nMoveDownId;
66 sal_uInt16 m_nDeleteId;
68 VclPtr<VclContainer> m_pProperties;
69 VclPtr<ListBox> m_pOrderLst;
70 VclPtr<ListBox> m_pHeaderLst;
71 VclPtr<ListBox> m_pFooterLst;
72 VclPtr<ListBox> m_pGroupOnLst;
73 VclPtr<NumericField> m_pGroupIntervalEd;
74 VclPtr<ListBox> m_pKeepTogetherLst;
75 VclPtr<FixedText> m_pHelpWindow;
77 VclPtr<OFieldExpressionControl> m_pFieldExpression;
78 ::rptui::OReportController* m_pController;
79 ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pCurrentGroupListener;
80 ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener;
81 ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups> m_xGroups;
82 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xColumns;
83 bool m_bReadOnly;
84 private:
85 DECL_LINK( OnControlFocusLost, Control* );
86 DECL_LINK( OnControlFocusGot, Control* );
87 DECL_LINK( LBChangeHdl, ListBox* );
88 DECL_LINK_TYPED( OnFormatAction, ToolBox*, void );
90 /** returns the groups
91 @return the groups which now have to check which one changes
93 ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups>& getGroups() { return m_xGroups; }
95 ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup> getGroup(sal_Int32 _nPos)
97 OSL_ENSURE(_nPos >= 0 && _nPos < m_xGroups->getCount(),"Invalid count!");
98 return ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>(m_xGroups->getByIndex(_nPos),::com::sun::star::uno::UNO_QUERY);
101 /** updates the listboxes with the new group properties
102 @param _nRow the new group pos
104 void DisplayData( sal_Int32 _nRow );
106 /** saves the values from the listboxes into the group at position _nRow
107 @param _nRow the group pos to store in
109 void SaveData( sal_Int32 _nRow );
111 /** returns <TRUE/> when the dialog should be read only
113 bool isReadOnly( ) const { return m_bReadOnly;}
115 /** returns the data type for the given column name
116 @param _sColumnName
118 sal_Int32 getColumnDataType(const OUString& _sColumnName);
120 /** shows the text given by the id in the multiline edit
121 @param _nResId the string id
123 void showHelpText(sal_uInt16 _nResId);
124 /** display the group props
125 @param _xGroup the group to display
127 void displayGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup);
129 /** enables or diables the up and down button
130 @param _nRow the row which will be active
132 void checkButtons(sal_Int32 _nRow);
134 /** clears the m_xColumns member and reset the fields
137 void fillColumns();
138 OGroupsSortingDialog(OGroupsSortingDialog&) SAL_DELETED_FUNCTION;
139 void operator =(OGroupsSortingDialog&) SAL_DELETED_FUNCTION;
140 protected:
141 // OPropertyChangeListener
142 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
143 public:
144 OGroupsSortingDialog( vcl::Window* pParent
145 ,bool _bReadOnly
146 ,::rptui::OReportController* _pController);
147 virtual ~OGroupsSortingDialog();
148 virtual void dispose() SAL_OVERRIDE;
150 /** sets the newe columns at the groups dialog.
151 @param _xColumns the new columns
153 void setColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xColumns);
155 /* updates the current view
157 void UpdateData( );
160 } // namespace rptui
162 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_GROUPSSORTING_HXX
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */