bump product version to 6.3.0.0.beta1
[LibreOffice.git] / reportdesign / source / ui / inc / ReportWindow.hxx
blob3e3c16f7eab07c2d1ff41ea256545e8eda71a4e5
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_REPORTWINDOW_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_REPORTWINDOW_HXX
22 #include <com/sun/star/report/XSection.hpp>
23 #include "ReportDefines.hxx"
24 #include "StartMarker.hxx"
25 #include <o3tl/deleter.hxx>
26 #include <svtools/ruler.hxx>
27 #include <svx/svdedtv.hxx>
28 #include <sfx2/zoomitem.hxx>
30 #include <memory>
31 #include <vector>
32 #include <comphelper/propmultiplex.hxx>
34 #include "MarkedSection.hxx"
35 #include "ViewsWindow.hxx"
37 namespace rptui
39 class ODesignView;
40 class OScrollWindowHelper;
41 class OSectionView;
42 class DlgEdFactory;
44 class OReportWindow : public vcl::Window
45 , public IMarkedSection
46 , public ::cppu::BaseMutex
47 , public ::comphelper::OPropertyChangeListener
49 VclPtr<Ruler> m_aHRuler;
50 VclPtr<ODesignView> m_pView;
51 VclPtr<OScrollWindowHelper> m_pParent;
52 VclPtr<OViewsWindow> m_aViewsWindow;
53 rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener;
54 std::unique_ptr<DlgEdFactory, o3tl::default_delete<DlgEdFactory>> m_pObjFac;
56 void ImplInitSettings();
58 sal_Int32 GetTotalHeight() const;
59 sal_Int32 impl_getRealPixelWidth() const;
61 OReportWindow(OReportWindow const &) = delete;
62 void operator =(OReportWindow const &) = delete;
63 protected:
64 virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
65 // OPropertyChangeListener
66 virtual void _propertyChanged(const css::beans::PropertyChangeEvent& _rEvent) override;
67 public:
68 OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView);
69 virtual ~OReportWindow() override;
70 virtual void dispose() override;
72 // Window overrides
73 virtual void Resize() override;
75 ODesignView* getReportView() const { return m_pView; }
76 OScrollWindowHelper* getScrollWindow() const { return m_pParent; }
78 void SetMode( DlgEdMode m_eMode );
79 void SetInsertObj( sal_uInt16 eObj, const OUString& _sShapeType);
80 OUString const & GetInsertObjString() const;
81 void setGridSnap(bool bOn);
82 void setDragStripes(bool bOn);
84 /** copies the current selection in this section
86 void Copy();
88 /** returns if paste is allowed
90 * \return <TRUE/> if paste is allowed
92 bool IsPasteAllowed() const;
94 /** paste a new control in this section
96 void Paste();
98 /** Deletes the current selection in this section
101 void Delete();
103 /** All objects will be marked.
105 void SelectAll(const sal_uInt16 _nObjectType);
107 /** returns <TRUE/> when a object is marked
109 bool HasSelection() const;
111 Point getThumbPos() const;
113 /** removes the section at the given position.
115 * \param _nPosition Zero based.
117 void removeSection(sal_uInt16 _nPosition);
119 /** adds a new section at position _nPosition.
120 If the section is <NULL/> nothing happens.
121 If the position is grater than the current elements, the section will be appended.
123 void addSection(const css::uno::Reference< css::report::XSection >& _xSection
124 ,const OUString& _sColorEntry
125 ,sal_uInt16 _nPosition);
127 sal_uInt16 getSectionCount() const;
129 /** turns the grid on or off
131 * \param _bVisible
133 void toggleGrid(bool _bVisible);
136 /** shows the ruler
138 void showRuler(bool _bShow);
140 sal_Int32 getRulerHeight() const { return m_aHRuler->GetSizePixel().Height(); }
142 /** returns the total width of the first section
144 sal_Int32 GetTotalWidth() const;
146 /** calculate the max width of the markers
147 * The end marker will not be used for calculation.
149 * \return the max width
151 sal_Int32 getMaxMarkerWidth() const;
153 void ScrollChildren(const Point& _aThumbPos);
155 void notifySizeChanged();
157 /** unmark all objects on the views without the given one.
159 void unmarkAllObjects();
161 /** triggers the property browser with the report component or section
162 @param _xReportComponent
164 void showProperties( const css::uno::Reference< css::report::XSection>& _xReportComponent);
166 /** checks if the keycode is known by the child windows
167 @param _rCode the keycode
168 @return <TRUE/> if the keycode is handled otherwise <FALSE/>
170 bool handleKeyEvent(const KeyEvent& _rEvent);
172 /** the section as marked or not marked
173 @param _pSectionView the section where to set the marked flag
174 @param _bMark the marked flag
176 void setMarked(OSectionView const * _pSectionView, bool _bMark);
177 void setMarked(const css::uno::Reference< css::report::XSection>& _xSection, bool _bMark);
178 void setMarked(const css::uno::Sequence< css::uno::Reference< css::report::XReportComponent> >& _xShape, bool _bMark);
180 // IMarkedSection
181 OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const override;
182 OSectionWindow* getSectionWindow(const css::uno::Reference< css::report::XSection>& _xSection) const;
183 virtual void markSection(const sal_uInt16 _nPos) override;
186 /** fills the positions of all collapsed sections.
188 * \param _rCollapsedPositions Out parameter which holds afterwards all positions of the collapsed sections.
190 void fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const;
192 /** collpase all sections given by their position
194 * \param _aCollpasedSections The position of the sections which should be collapsed.
196 void collapseSections(const css::uno::Sequence< css::beans::PropertyValue>& _aCollpasedSections);
198 /** align all marked objects in all sections
200 void alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection);
202 sal_uInt32 getMarkedObjectCount() const;
204 /** zoom the ruler and view windows
206 void zoom(const Fraction& _aZoom);
208 /** fills the vector with all selected control models
209 /param _rSelection The vector will be filled and will not be cleared before.
211 void fillControlModelSelection(::std::vector< css::uno::Reference< css::uno::XInterface > >& _rSelection) const;
213 /** calculates the zoom factor.
214 @param _eType which kind of zoom is needed
216 sal_uInt16 getZoomFactor(SvxZoomType _eType) const;
219 } //rptui
221 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_REPORTWINDOW_HXX
223 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */