LibreOffice Module reportdesign (master) 1
DesignView.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_DESIGNVIEW_HXX
20#define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_DESIGNVIEW_HXX
21
22#include <dbaccess/dataview.hxx>
23#include <com/sun/star/report/XSection.hpp>
24#include <com/sun/star/report/XReportComponent.hpp>
25#include <tools/link.hxx>
26#include <tools/gen.hxx>
27#include <vcl/timer.hxx>
28#include <vcl/idle.hxx>
30#include "ReportDefines.hxx"
31#include <vcl/splitwin.hxx>
32#include "MarkedSection.hxx"
33#include "ScrollHelper.hxx"
34
35class KeyEvent;
36class MouseEvent;
37class Timer;
38namespace vcl { class Window; }
39
40namespace rptui
41{
42 class OSectionView;
43 class OReportController;
44 class PropBrw;
45 class OAddFieldWindow;
46 class ONavigator;
47
48
50 {
51 private:
53
54 css::uno::Reference< css::uno::XInterface> m_xReportComponent;
59 std::shared_ptr<OAddFieldWindow> m_xAddField;
61 std::shared_ptr<ONavigator> m_xReportExplorer;
68
69
70 DECL_LINK(MarkTimeout, Timer *, void);
71 DECL_LINK( SplitHdl, SplitWindow*, void );
72
73 void ImplInitSettings();
74
75 ODesignView(ODesignView const &) = delete;
76 void operator =(ODesignView const &) = delete;
77 protected:
78 // return the Rectangle where I can paint myself
79 virtual void resizeDocumentView(tools::Rectangle& rRect) override;
80 // return the Rectangle where I can paint myself
81 virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
82
83 public:
85 const css::uno::Reference< css::uno::XComponentContext >&,
86 OReportController& _rController);
87 virtual ~ODesignView() override;
88 virtual void dispose() override;
89
90 // Window overrides
91 virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
92 virtual bool PreNotify( NotifyEvent& rNEvt ) override;
93 virtual void GetFocus() override;
94
95 virtual void initialize() override;
96
98
100 void SetInsertObj( SdrObjKind eObj,const OUString& _sShapeType = OUString());
102 OUString const & GetInsertObjString() const;
103 DlgEdMode GetMode() const { return m_eMode; }
104
107 void Cut();
108
111 void Copy();
112
117 bool IsPasteAllowed() const;
118
121 void Paste();
122
126 void Delete();
127
130 void alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection);
131
134 void SelectAll(const SdrObjKind _nObjectType);
135
137 bool HasSelection() const;
138
140
141 sal_uInt16 getSectionCount() const;
142
147 void removeSection(sal_uInt16 _nPosition);
148
153 void addSection(const css::uno::Reference< css::report::XSection >& _xSection
154 ,const OUString& _sColorEntry
155 ,sal_uInt16 _nPosition = USHRT_MAX);
156
157 const Size& getGridSizeCoarse() const { return m_aGridSizeCoarse; }
158 const Size& getGridSizeFine() const { return m_aGridSizeFine; }
159 void setGridSnap(bool bOn);
160 void setDragStripes(bool bOn);
165 void toggleGrid(bool _bGridVisible);
166
167 void togglePropertyBrowser(bool _bToggleOn);
168
169 bool isAddFieldVisible() const;
170 void toggleAddField();
171
172 bool isReportExplorerVisible() const;
174
177 void showRuler(bool _bShow);
178
181 void unmarkAllObjects();
182
186 void showProperties( const css::uno::Reference< css::uno::XInterface>& _xReportComponent);
187 css::uno::Any getCurrentlyShownProperty() const;
188
191 css::uno::Reference< css::report::XSection > getCurrentSection() const;
192
195 css::uno::Reference< css::report::XReportComponent > getCurrentControlModel() const;
196
197 // IMarkedSection
199 OSectionWindow* getSectionWindow(const css::uno::Reference< css::report::XSection>& _xSection) const;
200 virtual void markSection(const sal_uInt16 _nPos) override;
201
206 void fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const;
207
212 void collapseSections(const css::uno::Sequence< css::beans::PropertyValue>& _aCollapsedSections);
213
214 OUString getCurrentPage() const;
215 void setCurrentPage(const OUString& _sLastActivePage);
216
221 bool handleKeyEvent(const KeyEvent& _rEvent);
222
227 void setMarked(const css::uno::Reference< css::report::XSection>& _xSection,bool _bMark);
228 void setMarked(const css::uno::Sequence< css::uno::Reference< css::report::XReportComponent> >& _xShape,bool _bMark);
229
234 bool isHandleEvent() const;
235
236 sal_uInt32 getMarkedObjectCount() const;
237
240 void zoom(const Fraction& _aZoom);
241
245 void fillControlModelSelection(::std::vector< css::uno::Reference< css::uno::XInterface > >& _rSelection) const;
246
250 sal_uInt16 getZoomFactor(SvxZoomType _eType) const;
251 };
252
253} //rptui
254
255#endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_DESIGNVIEW_HXX
256
257/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DECL_LINK(SplitHdl, SplitWindow *, void)
void setMarked(const css::uno::Sequence< css::uno::Reference< css::report::XReportComponent > > &_xShape, bool _bMark)
virtual ~ODesignView() override
Definition: DesignView.cxx:120
void Delete()
Deletes the current selection in this section.
Definition: DesignView.cxx:325
void Copy()
copies the current selection in this section
Definition: DesignView.cxx:314
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: DesignView.cxx:170
void addSection(const css::uno::Reference< css::report::XSection > &_xSection, const OUString &_sColorEntry, sal_uInt16 _nPosition=USHRT_MAX)
adds a new section at position _nPosition.
Definition: DesignView.cxx:378
bool handleKeyEvent(const KeyEvent &_rEvent)
checks if the keycode is known by the child windows
Definition: DesignView.cxx:587
DECL_LINK(MarkTimeout, Timer *, void)
virtual void resizeDocumentView(tools::Rectangle &rRect) override
Definition: DesignView.cxx:215
OUString const & GetInsertObjString() const
Definition: DesignView.cxx:301
void SetInsertObj(SdrObjKind eObj, const OUString &_sShapeType=OUString())
Definition: DesignView.cxx:295
void unmarkAllObjects()
unmark all objects on the views.
Definition: DesignView.cxx:421
void setCurrentPage(const OUString &_sLastActivePage)
Definition: DesignView.cxx:576
std::shared_ptr< ONavigator > m_xReportExplorer
Definition: DesignView.hxx:61
bool IsPasteAllowed() const
returns if paste is allowed
Definition: DesignView.cxx:336
void setDragStripes(bool bOn)
Definition: DesignView.cxx:658
virtual void GetFocus() override
Definition: DesignView.cxx:383
ODesignView(ODesignView const &)=delete
bool isAddFieldVisible() const
Definition: DesignView.cxx:489
bool HasSelection() const
checks if a selection exists
Definition: DesignView.cxx:330
OSectionView * m_pCurrentView
Definition: DesignView.hxx:60
void showRuler(bool _bShow)
shows or hides the ruler.
Definition: DesignView.cxx:368
virtual void dispose() override
Definition: DesignView.cxx:125
ODesignView(vcl::Window *pParent, const css::uno::Reference< css::uno::XComponentContext > &, OReportController &_rController)
void toggleReportExplorer()
Definition: DesignView.cxx:472
void UpdatePropertyBrowserDelayed(OSectionView &_rView)
Definition: DesignView.cxx:342
void showProperties(const css::uno::Reference< css::uno::XInterface > &_xReportComponent)
triggers the property browser with the section
Definition: DesignView.cxx:455
OSectionWindow * getSectionWindow(const css::uno::Reference< css::report::XSection > &_xSection) const
Definition: DesignView.cxx:551
void togglePropertyBrowser(bool _bToggleOn)
Definition: DesignView.cxx:426
SdrObjKind m_eActObj
Definition: DesignView.hxx:64
css::uno::Reference< css::uno::XInterface > m_xReportComponent
Definition: DesignView.hxx:54
css::uno::Reference< css::report::XReportComponent > getCurrentControlModel() const
returns the current control report model or <NULL>
Definition: DesignView.cxx:536
VclPtr< PropBrw > m_pPropWin
Definition: DesignView.hxx:58
OUString getCurrentPage() const
Definition: DesignView.cxx:571
sal_uInt16 getSectionCount() const
Definition: DesignView.cxx:363
VclPtr< vcl::Window > m_pTaskPane
Definition: DesignView.hxx:57
virtual void markSection(const sal_uInt16 _nPos) override
mark the section on the given position .
Definition: DesignView.cxx:556
bool isHandleEvent() const
returns if the view handles the event by itself
Definition: DesignView.cxx:663
OReportController & getController() const
Definition: DesignView.hxx:97
sal_uInt16 getZoomFactor(SvxZoomType _eType) const
calculates the zoom factor.
Definition: DesignView.cxx:678
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...
Definition: DesignView.cxx:647
SdrObjKind GetInsertObj() const
Definition: DesignView.hxx:101
const Size & getGridSizeCoarse() const
Definition: DesignView.hxx:157
void fillCollapsedSections(::std::vector< sal_uInt16 > &_rCollapsedPositions) const
fills the positions of all collapsed sections.
Definition: DesignView.cxx:561
void alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection)
align all marked objects in all sections
Definition: DesignView.cxx:582
void Cut()
cuts the current selection in this section
Definition: DesignView.cxx:307
sal_uInt32 getMarkedObjectCount() const
Definition: DesignView.cxx:668
VclPtr< SplitWindow > m_aSplitWin
Definition: DesignView.hxx:52
std::shared_ptr< OAddFieldWindow > m_xAddField
Definition: DesignView.hxx:59
void removeSection(sal_uInt16 _nPosition)
removes the section at the given position.
Definition: DesignView.cxx:373
bool isReportExplorerVisible() const
Definition: DesignView.cxx:467
css::uno::Any getCurrentlyShownProperty() const
Definition: DesignView.cxx:626
DlgEdMode GetMode() const
Definition: DesignView.hxx:103
void SetMode(DlgEdMode m_eMode)
Definition: DesignView.cxx:286
VclPtr< OScrollWindowHelper > m_aScrollWindow
Definition: DesignView.hxx:56
void SelectAll(const SdrObjKind _nObjectType)
All objects will be marked.
Definition: DesignView.cxx:416
OSectionWindow * getMarkedSection(NearSectionAccess nsa=CURRENT) const override
returns the section which is currently marked.
Definition: DesignView.cxx:546
void Paste()
paste a new control in this section
Definition: DesignView.cxx:320
void zoom(const Fraction &_aZoom)
zoom the ruler and view windows
Definition: DesignView.cxx:673
virtual void initialize() override
Definition: DesignView.cxx:163
void setGridSnap(bool bOn)
Definition: DesignView.cxx:652
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: DesignView.cxx:182
OReportController & m_rReportController
Definition: DesignView.hxx:55
void collapseSections(const css::uno::Sequence< css::beans::PropertyValue > &_aCollapsedSections)
collapse all sections given by their position
Definition: DesignView.cxx:566
css::uno::Reference< css::report::XSection > getCurrentSection() const
returns the current section or the detail section if no section was selected previously
Definition: DesignView.cxx:527
void toggleGrid(bool _bGridVisible)
turns the grid on or off
Definition: DesignView.cxx:358
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: DesignView.cxx:616
void setMarked(const css::uno::Reference< css::report::XSection > &_xSection, bool _bMark)
set the section as marked or not marked
const Size & getGridSizeFine() const
Definition: DesignView.hxx:158
void operator=(ODesignView const &)=delete
ControlModification
Definition: RptDef.hxx:49
SdrObjKind
SvxZoomType