LibreOffice Module reportdesign (master) 1
ReportWindow.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_REPORTWINDOW_HXX
20#define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_REPORTWINDOW_HXX
21
22#include <com/sun/star/report/XSection.hpp>
23#include "ReportDefines.hxx"
24#include <o3tl/deleter.hxx>
25#include <svtools/ruler.hxx>
26#include <sfx2/zoomitem.hxx>
27
28#include <memory>
29#include <vector>
31
32#include "MarkedSection.hxx"
33#include "ViewsWindow.hxx"
34
35namespace rptui
36{
37 class ODesignView;
38 class OScrollWindowHelper;
39 class OSectionView;
40 class DlgEdFactory;
41
43 , public IMarkedSection
44 , public ::cppu::BaseMutex
46 {
52 std::unique_ptr<DlgEdFactory, o3tl::default_delete<DlgEdFactory>> m_pObjFac;
53
54 void ImplInitSettings();
55
56 sal_Int32 GetTotalHeight() const;
57 sal_Int32 impl_getRealPixelWidth() const;
58
59 OReportWindow(OReportWindow const &) = delete;
60 void operator =(OReportWindow const &) = delete;
61 protected:
62 virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
63 // OPropertyChangeListener
64 virtual void _propertyChanged(const css::beans::PropertyChangeEvent& _rEvent) override;
65 public:
67 virtual ~OReportWindow() override;
68 virtual void dispose() override;
69
70 // Window overrides
71 virtual void Resize() override;
72
73 ODesignView* getReportView() const { return m_pView; }
75
76 void SetMode( DlgEdMode m_eMode );
77 void SetInsertObj(SdrObjKind eObj, const OUString& _sShapeType);
78 OUString const & GetInsertObjString() const;
79 void setGridSnap(bool bOn);
80 void setDragStripes(bool bOn);
81
84 void Copy();
85
90 bool IsPasteAllowed() const;
91
94 void Paste();
95
99 void Delete();
100
103 void SelectAll(const SdrObjKind _nObjectType);
104
107 bool HasSelection() const;
108
109 Point getThumbPos() const;
110
115 void removeSection(sal_uInt16 _nPosition);
116
121 void addSection(const css::uno::Reference< css::report::XSection >& _xSection
122 ,const OUString& _sColorEntry
123 ,sal_uInt16 _nPosition);
124
125 sal_uInt16 getSectionCount() const;
126
131 void toggleGrid(bool _bVisible);
132
133
136 void showRuler(bool _bShow);
137
138 sal_Int32 getRulerHeight() const { return m_aHRuler->GetSizePixel().Height(); }
139
142 sal_Int32 GetTotalWidth() const;
143
149 sal_Int32 getMaxMarkerWidth() const;
150
151 void ScrollChildren(const Point& _aThumbPos);
152
153 void notifySizeChanged();
154
157 void unmarkAllObjects();
158
162 void showProperties( const css::uno::Reference< css::report::XSection>& _xReportComponent);
163
168 bool handleKeyEvent(const KeyEvent& _rEvent);
169
174 void setMarked(OSectionView const * _pSectionView, bool _bMark);
175 void setMarked(const css::uno::Reference< css::report::XSection>& _xSection, bool _bMark);
176 void setMarked(const css::uno::Sequence< css::uno::Reference< css::report::XReportComponent> >& _xShape, bool _bMark);
177
178 // IMarkedSection
180 OSectionWindow* getSectionWindow(const css::uno::Reference< css::report::XSection>& _xSection) const;
181 virtual void markSection(const sal_uInt16 _nPos) override;
182
183
188 void fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const;
189
194 void collapseSections(const css::uno::Sequence< css::beans::PropertyValue>& _aCollapsedSections);
195
198 void alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection);
199
200 sal_uInt32 getMarkedObjectCount() const;
201
204 void zoom(const Fraction& _aZoom);
205
209 void fillControlModelSelection(::std::vector< css::uno::Reference< css::uno::XInterface > >& _rSelection) const;
210
214 sal_uInt16 getZoomFactor(SvxZoomType _eType) const;
215 };
216
217} //rptui
218
219#endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_REPORTWINDOW_HXX
220
221/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 getSectionCount() const
VclPtr< ODesignView > m_pView
VclPtr< Ruler > m_aHRuler
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
void setMarked(const css::uno::Sequence< css::uno::Reference< css::report::XReportComponent > > &_xShape, bool _bMark)
sal_Int32 GetTotalWidth() const
returns the total width of the first section
void ScrollChildren(const Point &_aThumbPos)
bool handleKeyEvent(const KeyEvent &_rEvent)
checks if the keycode is known by the child windows
rtl::Reference< comphelper::OPropertyChangeMultiplexer > m_pReportListener
virtual void markSection(const sal_uInt16 _nPos) override
mark the section on the given position .
void addSection(const css::uno::Reference< css::report::XSection > &_xSection, const OUString &_sColorEntry, sal_uInt16 _nPosition)
adds a new section at position _nPosition.
bool HasSelection() const
returns <TRUE> when an object is marked
bool IsPasteAllowed() const
returns if paste is allowed
void setMarked(OSectionView const *_pSectionView, bool _bMark)
the section as marked or not marked
OScrollWindowHelper * getScrollWindow() const
void showRuler(bool _bShow)
shows the ruler
void SetMode(DlgEdMode m_eMode)
void zoom(const Fraction &_aZoom)
zoom the ruler and view windows
void SetInsertObj(SdrObjKind eObj, const OUString &_sShapeType)
virtual void Resize() override
void operator=(OReportWindow const &)=delete
void Delete()
Deletes the current selection in this section.
std::unique_ptr< DlgEdFactory, o3tl::default_delete< DlgEdFactory > > m_pObjFac
OSectionWindow * getMarkedSection(NearSectionAccess nsa=CURRENT) const override
returns the section which is currently marked.
void Copy()
copies the current selection in this section
virtual ~OReportWindow() override
sal_uInt32 getMarkedObjectCount() const
sal_Int32 getMaxMarkerWidth() const
calculate the max width of the markers The end marker will not be used for calculation.
void unmarkAllObjects()
unmark all objects on the views without the given one.
void SelectAll(const SdrObjKind _nObjectType)
All objects will be marked.
void removeSection(sal_uInt16 _nPosition)
removes the section at the given position.
sal_Int32 getRulerHeight() const
ODesignView * getReportView() const
VclPtr< OViewsWindow > m_aViewsWindow
VclPtr< OScrollWindowHelper > m_pParent
sal_Int32 GetTotalHeight() const
OSectionWindow * getSectionWindow(const css::uno::Reference< css::report::XSection > &_xSection) const
void showProperties(const css::uno::Reference< css::report::XSection > &_xReportComponent)
triggers the property browser with the report component or section
virtual void dispose() override
void fillCollapsedSections(::std::vector< sal_uInt16 > &_rCollapsedPositions) const
fills the positions of all collapsed sections.
OUString const & GetInsertObjString() const
sal_uInt16 getZoomFactor(SvxZoomType _eType) const
calculates the zoom factor.
Point getThumbPos() const
void alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection)
align all marked objects in all sections
virtual void _propertyChanged(const css::beans::PropertyChangeEvent &_rEvent) override
void setGridSnap(bool bOn)
void setMarked(const css::uno::Reference< css::report::XSection > &_xSection, bool _bMark)
void Paste()
paste a new control in this section
void fillControlModelSelection(::std::vector< css::uno::Reference< css::uno::XInterface > > &_rSelection) const
fills the vector with all selected control models /param _rSelection The vector will be filled and wi...
sal_Int32 impl_getRealPixelWidth() const
void setDragStripes(bool bOn)
void collapseSections(const css::uno::Sequence< css::beans::PropertyValue > &_aCollapsedSections)
collapse all sections given by their position
void toggleGrid(bool _bVisible)
turns the grid on or off
OReportWindow(OReportWindow const &)=delete
ControlModification
Definition: RptDef.hxx:49
SdrObjKind
SvxZoomType