LibreOffice Module reportdesign (master) 1
ScrollHelper.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
20#pragma once
21
23#include <com/sun/star/report/XSection.hpp>
25#include "ReportDefines.hxx"
27#include <rtl/ref.hxx>
28#include "MarkedSection.hxx"
29#include "ReportWindow.hxx"
30
31namespace rptui
32{
33 class ODesignView;
34 class OReportWindow;
35 class OSectionView;
36
42 , public OScrollWindowHelper_BASE/*TabPage*/
44 , public IMarkedSection
45 {
46 private:
53 m_pReportDefinitionMultiPlexer; // listener for property changes
54
55 DECL_LINK( ScrollHdl, weld::Scrollbar&, void);
57 void ImplInitSettings();
58 void impl_initScrollBar(ScrollAdaptor& rScrollBar) const;
59
61 void operator =(OScrollWindowHelper const &) = delete;
62 protected:
63 virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
64 // window
65 virtual void Resize() override;
66 virtual bool EventNotify( NotifyEvent& rNEvt ) override;
67 // OPropertyChangeListener
68 virtual void _propertyChanged(const css::beans::PropertyChangeEvent& _rEvent) override;
69 public:
70 OScrollWindowHelper( ODesignView* _pReportDesignView);
71 virtual ~OScrollWindowHelper() override;
72 virtual void dispose() override;
73
76 void initialize();
77
78 Point getThumbPos() const { return Point(m_aHScroll->GetThumbPos(),m_aVScroll->GetThumbPos())/*m_aScrollOffset*/; }
79 void setTotalSize(sal_Int32 _nWidth, sal_Int32 _nHeight);
80 const Size& getTotalSize() const { return m_aTotalPixelSize; }
83
84 // forwards
85 void SetMode( DlgEdMode _eMode );
86 void SetInsertObj(SdrObjKind eObj, const OUString& _sShapeType);
87 OUString const & GetInsertObjString() const;
88 void setGridSnap(bool bOn);
89 void setDragStripes(bool bOn);
92 void Copy();
93
98 bool IsPasteAllowed() const;
99
102 void Paste();
103
107 void Delete();
108
111 void SelectAll(const SdrObjKind _nObjectType);
112
115 bool HasSelection() const;
116
121 void removeSection(sal_uInt16 _nPosition);
122
127 void addSection(const css::uno::Reference< css::report::XSection >& _xSection
128 ,const OUString& _sColorEntry
129 ,sal_uInt16 _nPosition);
130
131 sal_uInt16 getSectionCount() const;
132
137 void toggleGrid(bool _bVisible);
138
141 void unmarkAllObjects();
142
145 void showRuler(bool _bShow);
146
152 sal_Int32 getMaxMarkerWidth() const;
153
158 bool handleKeyEvent(const KeyEvent& _rEvent);
159
164 void setMarked(OSectionView const * _pSectionView, bool _bMark);
165 void setMarked(const css::uno::Reference< css::report::XSection>& _xSection, bool _bMark);
166 void setMarked(const css::uno::Sequence< css::uno::Reference< css::report::XReportComponent> >& _xShape, bool _bMark);
167
168 // IMarkedSection
170 OSectionWindow* getSectionWindow(const css::uno::Reference< css::report::XSection>& _xSection) const;
171 virtual void markSection(const sal_uInt16 _nPos) override;
172
173
178 void fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const;
179
184 void collapseSections(const css::uno::Sequence< css::beans::PropertyValue>& _aCollapsedSections);
185
188 void alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection);
189
190 sal_uInt32 getMarkedObjectCount() const;
191
194 void zoom(const Fraction& _aZoom);
195
199 void fillControlModelSelection(::std::vector< css::uno::Reference< css::uno::XInterface > >& _rSelection) const;
200
204 sal_uInt16 getZoomFactor(SvxZoomType _eType) const;
205 };
206}
207
208/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetMode(DlgEdMode _eMode)
const Size & getTotalSize() const
sal_Int32 getMaxMarkerWidth() const
calculate the max width of the markers
DECL_LINK(ScrollHdl, weld::Scrollbar &, void)
virtual ~OScrollWindowHelper() override
virtual void dispose() override
void fillCollapsedSections(::std::vector< sal_uInt16 > &_rCollapsedPositions) const
fills the positions of all collapsed sections.
VclPtr< ODesignView > m_pParent
virtual void markSection(const sal_uInt16 _nPos) override
mark the section on the given position .
void toggleGrid(bool _bVisible)
turns the grid on or off
void setMarked(const css::uno::Sequence< css::uno::Reference< css::report::XReportComponent > > &_xShape, bool _bMark)
VclPtr< OReportWindow > m_aReportWindow
sal_uInt16 getZoomFactor(SvxZoomType _eType) const
calculates the zoom factor.
void operator=(OScrollWindowHelper const &)=delete
ScrollAdaptor & GetVScroll()
void zoom(const Fraction &_aZoom)
zoom the ruler and view windows
bool HasSelection() const
returns <TRUE> when an object is marked
VclPtr< ScrollAdaptor > m_aHScroll
void Paste()
paste a new control in this section
::rtl::Reference< comphelper::OPropertyChangeMultiplexer > m_pReportDefinitionMultiPlexer
void setTotalSize(sal_Int32 _nWidth, sal_Int32 _nHeight)
void setMarked(const css::uno::Reference< css::report::XSection > &_xSection, bool _bMark)
void removeSection(sal_uInt16 _nPosition)
removes the section at the given position.
virtual void _propertyChanged(const css::beans::PropertyChangeEvent &_rEvent) override
OSectionWindow * getMarkedSection(NearSectionAccess nsa=CURRENT) const override
returns the section which is currently marked.
VclPtr< ScrollAdaptor > m_aVScroll
void alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection)
align all marked objects in all sections
void unmarkAllObjects()
unmark all objects on the views.
OSectionWindow * getSectionWindow(const css::uno::Reference< css::report::XSection > &_xSection) const
sal_uInt32 getMarkedObjectCount() const
void SelectAll(const SdrObjKind _nObjectType)
All objects will be marked.
OUString const & GetInsertObjString() const
void SetInsertObj(SdrObjKind eObj, const OUString &_sShapeType)
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
void addSection(const css::uno::Reference< css::report::XSection > &_xSection, const OUString &_sColorEntry, sal_uInt16 _nPosition)
adds a new section at position _nPosition.
ScrollAdaptor & GetHScroll()
void collapseSections(const css::uno::Sequence< css::beans::PropertyValue > &_aCollapsedSections)
collapse all sections given by their position
bool handleKeyEvent(const KeyEvent &_rEvent)
checks if the keycode is known by the child windows
sal_uInt16 getSectionCount() const
OScrollWindowHelper(OScrollWindowHelper const &)=delete
virtual void Resize() override
void impl_initScrollBar(ScrollAdaptor &rScrollBar) const
void Delete()
Deletes the current selection in this section.
virtual bool EventNotify(NotifyEvent &rNEvt) override
void showRuler(bool _bShow)
shows or hides the ruler.
void initialize()
late ctor
void setMarked(OSectionView const *_pSectionView, bool _bMark)
the section as marked or not marked
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...
void Copy()
copies the current selection in this section
bool IsPasteAllowed() const
returns if paste is allowed
vcl::Window OScrollWindowHelper_BASE
This class defines the scrollable area of the report design.
ControlModification
Definition: RptDef.hxx:49
SdrObjKind
SvxZoomType