LibreOffice Module reportdesign (master)  1
DesignView.cxx
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 #include <DesignView.hxx>
21 #include <ReportController.hxx>
23 #include <unotools/viewoptions.hxx>
24 #include <RptDef.hxx>
25 #include <UITools.hxx>
26 #include <RptObject.hxx>
27 #include <propbrw.hxx>
28 #include <helpids.h>
29 #include <SectionView.hxx>
30 #include <ReportSection.hxx>
31 #include <rptui_slotid.hrc>
32 #include <AddField.hxx>
33 #include <ScrollHelper.hxx>
34 #include <Navigator.hxx>
35 #include <SectionWindow.hxx>
36 
37 #include <vcl/settings.hxx>
38 #include <vcl/svapp.hxx>
39 
40 namespace rptui
41 {
42 using namespace ::dbaui;
43 using namespace ::utl;
44 using namespace ::com::sun::star;
45 using namespace uno;
46 using namespace lang;
47 using namespace beans;
48 using namespace container;
49 
50 #define START_SIZE_TASKPANE 30
51 #define COLSET_ID 1
52 #define REPORT_ID 2
53 #define TASKPANE_ID 3
54 
55 namespace {
56 
57 class OTaskWindow : public vcl::Window
58 {
60 public:
61  explicit OTaskWindow(vcl::Window* _pParent) : Window(_pParent),m_pPropWin(nullptr){}
62  virtual ~OTaskWindow() override { disposeOnce(); }
63  virtual void dispose() override { m_pPropWin.clear(); vcl::Window::dispose(); }
64 
65  void setPropertyBrowser(PropBrw* _pPropWin)
66  {
67  m_pPropWin = _pPropWin;
68  }
69 
70  virtual void Resize() override
71  {
72  const Size aSize = GetOutputSizePixel();
73  if ( m_pPropWin && aSize.Height() && aSize.Width() )
74  m_pPropWin->SetSizePixel(aSize);
75  }
76 };
77 
78 }
79 
80 
81 
83  const Reference< XComponentContext >& _rxOrb,
84  OReportController& _rController) :
85  ODataView( pParent, _rController, _rxOrb, WB_DIALOGCONTROL )
86  ,m_aSplitWin(VclPtr<SplitWindow>::Create(this))
87  ,m_rReportController( _rController )
88  ,m_aScrollWindow(VclPtr<rptui::OScrollWindowHelper>::Create(this))
89  ,m_pPropWin(nullptr)
90  ,m_pCurrentView(nullptr)
91  ,m_aMarkIdle("reportdesign ODesignView Mark Idle")
92  ,m_eMode( DlgEdMode::Select )
93  ,m_eActObj( OBJ_NONE )
94  ,m_aGridSizeCoarse( 1000, 1000 ) // #i93595# 100TH_MM changed to grid using coarse 1 cm grid
95  ,m_aGridSizeFine( 250, 250 ) // and a 0,25 cm subdivision for better visualisation
96  ,m_bDeleted( false )
97 {
98  SetHelpId(UID_RPT_RPT_APP_VIEW);
99  ImplInitSettings();
100 
101  SetMapMode( MapMode( MapUnit::Map100thMM ) );
102 
103  // now create the task pane on the right side :-)
104  m_pTaskPane = VclPtr<OTaskWindow>::Create(this);
105 
106  m_aSplitWin->InsertItem( COLSET_ID,100,SPLITWINDOW_APPEND, 0, SplitWindowItemFlags::PercentSize | SplitWindowItemFlags::ColSet );
107  m_aSplitWin->InsertItem( REPORT_ID, m_aScrollWindow.get(), 100, SPLITWINDOW_APPEND, COLSET_ID, SplitWindowItemFlags::PercentSize);
108 
109  // set up splitter
110  m_aSplitWin->SetSplitHdl(LINK(this, ODesignView,SplitHdl));
111  m_aSplitWin->SetAlign(WindowAlign::Left);
112  m_aSplitWin->Show();
113 
114  m_aMarkIdle.SetInvokeHandler( LINK( this, ODesignView, MarkTimeout ) );
115 }
116 
117 
118 ODesignView::~ODesignView()
119 {
120  disposeOnce();
121 }
122 
123 void ODesignView::dispose()
124 {
125  m_bDeleted = true;
126  Hide();
127  m_aScrollWindow->Hide();
128  m_aMarkIdle.Stop();
129  if ( m_pPropWin )
130  {
132  m_pPropWin.disposeAndClear();
133  }
134  if ( m_xAddField )
135  {
136  SvtViewOptions aDlgOpt( EViewType::Window, UID_RPT_RPT_APP_VIEW );
137  aDlgOpt.SetWindowState(OStringToOUString(m_xAddField->getDialog()->get_window_state(WindowStateMask::All), RTL_TEXTENCODING_ASCII_US));
138 
139  if (m_xAddField->getDialog()->get_visible())
140  m_xAddField->response(RET_CANCEL);
141 
142  m_xAddField.reset();
143  }
144  if ( m_xReportExplorer )
145  {
146  SvtViewOptions aDlgOpt(EViewType::Window, OStringToOUString(m_xReportExplorer->get_help_id(), RTL_TEXTENCODING_UTF8));
147  aDlgOpt.SetWindowState(OStringToOUString(m_xReportExplorer->getDialog()->get_window_state(WindowStateMask::All), RTL_TEXTENCODING_ASCII_US));
148 
149  if (m_xReportExplorer->getDialog()->get_visible())
150  m_xReportExplorer->response(RET_CANCEL);
151 
152  m_xReportExplorer.reset();
153  }
154 
155  m_pTaskPane.disposeAndClear();
156  m_aScrollWindow.disposeAndClear();
157  m_aSplitWin.disposeAndClear();
159 }
160 
161 void ODesignView::initialize()
162 {
163  SetMapMode( MapMode( MapUnit::Map100thMM ) );
164  m_aScrollWindow->initialize();
165  m_aScrollWindow->Show();
166 }
167 
168 void ODesignView::DataChanged( const DataChangedEvent& rDCEvt )
169 {
170  ODataView::DataChanged( rDCEvt );
171 
172  if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
173  (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
174  {
175  ImplInitSettings();
176  Invalidate();
177  }
178 }
179 
180 bool ODesignView::PreNotify( NotifyEvent& rNEvt )
181 {
182  bool bRet = ODataView::PreNotify(rNEvt); // 1 := has to be handled here
183  switch(rNEvt.GetType())
184  {
185  case MouseNotifyEvent::KEYINPUT:
186  {
187  if ( m_pPropWin && m_pPropWin->HasChildPathFocus() )
188  return false;
189  if (m_xAddField && m_xAddField->getDialog()->has_toplevel_focus())
190  return false;
191  if ( m_xReportExplorer && m_xReportExplorer->getDialog()->has_toplevel_focus())
192  return false;
193  const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
194  if ( handleKeyEvent(*pKeyEvent) )
195  bRet = true;
196  else if ( bRet && m_pAccel )
197  {
198  const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
199  util::URL aUrl;
200  aUrl.Complete = m_pAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rCode));
201  if ( aUrl.Complete.isEmpty() || !m_xController->isCommandEnabled( aUrl.Complete ) )
202  bRet = false;
203  }
204  break;
205  }
206  default:
207  break;
208  }
209 
210  return bRet;
211 }
212 
213 void ODesignView::resizeDocumentView(tools::Rectangle& _rPlayground)
214 {
215  if ( !_rPlayground.IsEmpty() )
216  {
217  const Size aPlaygroundSize( _rPlayground.GetSize() );
218 
219  // calc the split pos, and forward it to the controller
220  sal_Int32 nSplitPos = getController().getSplitPos();
221  if ( 0 != aPlaygroundSize.Width() )
222  {
223  if ( ( -1 == nSplitPos )
224  || ( nSplitPos >= aPlaygroundSize.Width() )
225  )
226  {
227  tools::Long nMinWidth = static_cast<tools::Long>(0.1*aPlaygroundSize.Width());
228  if ( m_pPropWin && m_pPropWin->IsVisible() )
229  nMinWidth = m_pPropWin->GetMinOutputSizePixel().Width();
230  nSplitPos = static_cast<sal_Int32>(_rPlayground.Right() - nMinWidth);
231  getController().setSplitPos(nSplitPos);
232  }
233  }
234 
235  if ( m_aSplitWin->IsItemValid(TASKPANE_ID) )
236  {
237  // normalize the split pos
238  const tools::Long nSplitterWidth = StyleSettings::GetSplitSize();
239  Point aTaskPanePos(nSplitPos + nSplitterWidth, _rPlayground.Top());
240  if (m_pTaskPane && m_pTaskPane->IsVisible() && m_pPropWin)
241  {
242  aTaskPanePos.setX( aPlaygroundSize.Width() - m_pTaskPane->GetSizePixel().Width() );
243  sal_Int32 nMinWidth = m_pPropWin->getMinimumSize().Width();
244  if ( nMinWidth > (aPlaygroundSize.Width() - aTaskPanePos.X()) )
245  {
246  aTaskPanePos.setX( aPlaygroundSize.Width() - nMinWidth );
247  }
248  nSplitPos = aTaskPanePos.X() - nSplitterWidth;
249  getController().setSplitPos(nSplitPos);
250 
251  const tools::Long nTaskPaneSize = static_cast<tools::Long>((aPlaygroundSize.Width() - aTaskPanePos.X())*100/aPlaygroundSize.Width());
252  if ( m_aSplitWin->GetItemSize( TASKPANE_ID ) != nTaskPaneSize )
253  {
254  m_aSplitWin->SetItemSize( REPORT_ID, 99 - nTaskPaneSize );
255  m_aSplitWin->SetItemSize( TASKPANE_ID, nTaskPaneSize );
256  }
257  }
258  }
259  // set the size of the report window
260  m_aSplitWin->SetPosSizePixel( _rPlayground.TopLeft(),aPlaygroundSize );
261  }
262  // just for completeness: there is no space left, we occupied it all ...
263  _rPlayground.SetPos( _rPlayground.BottomRight() );
264  _rPlayground.SetSize( Size( 0, 0 ) );
265 
266 }
267 
268 IMPL_LINK_NOARG(ODesignView, MarkTimeout, Timer *, void)
269 {
270  if ( m_pPropWin && m_pPropWin->IsVisible() )
271  {
272  m_pPropWin->Update(m_pCurrentView);
273  uno::Reference<beans::XPropertySet> xProp(m_xReportComponent,uno::UNO_QUERY);
274  if ( xProp.is() )
275  {
276  m_pPropWin->Update(xProp);
277  static_cast<OTaskWindow*>(m_pTaskPane.get())->Resize();
278  }
279  Resize();
280  }
281 }
282 
283 
284 void ODesignView::SetMode( DlgEdMode _eNewMode )
285 {
286  m_eMode = _eNewMode;
287  if ( m_eMode == DlgEdMode::Select )
288  m_eActObj = OBJ_NONE;
289 
290  m_aScrollWindow->SetMode(_eNewMode);
291 }
292 
293 void ODesignView::SetInsertObj( SdrObjKind eObj,const OUString& _sShapeType )
294 {
295  m_eActObj = eObj;
296  m_aScrollWindow->SetInsertObj( eObj,_sShapeType );
297 }
298 
299 OUString const & ODesignView::GetInsertObjString() const
300 {
301  return m_aScrollWindow->GetInsertObjString();
302 }
303 
304 
305 void ODesignView::Cut()
306 {
307  Copy();
308  Delete();
309 }
310 
311 
312 void ODesignView::Copy()
313 {
314  m_aScrollWindow->Copy();
315 }
316 
317 
318 void ODesignView::Paste()
319 {
320  m_aScrollWindow->Paste();
321 }
322 
323 void ODesignView::Delete()
324 {
325  m_aScrollWindow->Delete();
326 }
327 
328 bool ODesignView::HasSelection() const
329 {
330  return m_aScrollWindow->HasSelection();
331 }
332 
333 
334 bool ODesignView::IsPasteAllowed() const
335 {
336  return m_aScrollWindow->IsPasteAllowed();
337 }
338 
339 
340 void ODesignView::UpdatePropertyBrowserDelayed(OSectionView& _rView)
341 {
342  if ( m_pCurrentView != &_rView )
343  {
344  if ( m_pCurrentView )
345  m_aScrollWindow->setMarked(m_pCurrentView,false);
346  m_pCurrentView = &_rView;
347  m_aScrollWindow->setMarked(m_pCurrentView, true);
348  m_xReportComponent.clear();
350  Broadcast( aHint );
351  }
352  m_aMarkIdle.Start();
353 }
354 
355 
356 void ODesignView::toggleGrid(bool _bGridVisible)
357 {
358  m_aScrollWindow->toggleGrid(_bGridVisible);
359 }
360 
361 sal_uInt16 ODesignView::getSectionCount() const
362 {
363  return m_aScrollWindow->getSectionCount();
364 }
365 
366 void ODesignView::showRuler(bool _bShow)
367 {
368  m_aScrollWindow->showRuler(_bShow);
369 }
370 
371 void ODesignView::removeSection(sal_uInt16 _nPosition)
372 {
373  m_aScrollWindow->removeSection(_nPosition);
374 }
375 
376 void ODesignView::addSection(const uno::Reference< report::XSection >& _xSection,const OUString& _sColorEntry,sal_uInt16 _nPosition)
377 {
378  m_aScrollWindow->addSection(_xSection,_sColorEntry,_nPosition);
379 }
380 
381 void ODesignView::GetFocus()
382 {
383  Window::GetFocus();
384 
385  if ( !m_bDeleted )
386  {
387  OSectionWindow* pSectionWindow = m_aScrollWindow->getMarkedSection();
388  if ( pSectionWindow )
389  pSectionWindow->GrabFocus();
390  }
391 }
392 
393 void ODesignView::ImplInitSettings()
394 {
395  SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() ));
396  GetOutDev()->SetFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
397  SetTextFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
398 }
399 
401 {
402  const Size aOutputSize = GetOutputSizePixel();
403  const tools::Long nTest = aOutputSize.Width() * m_aSplitWin->GetItemSize(TASKPANE_ID) / 100;
404  tools::Long nMinWidth = static_cast<tools::Long>(0.1*aOutputSize.Width());
405  if ( m_pPropWin && m_pPropWin->IsVisible() )
406  nMinWidth = m_pPropWin->GetMinOutputSizePixel().Width();
407 
408  if ( (aOutputSize.Width() - nTest) >= nMinWidth && nTest > m_aScrollWindow->getMaxMarkerWidth() )
409  {
410  getController().setSplitPos(nTest);
411  }
412 }
413 
414 void ODesignView::SelectAll(const sal_uInt16 _nObjectType)
415 {
416  m_aScrollWindow->SelectAll(_nObjectType);
417 }
418 
419 void ODesignView::unmarkAllObjects()
420 {
421  m_aScrollWindow->unmarkAllObjects();
422 }
423 
424 void ODesignView::togglePropertyBrowser(bool _bToggleOn)
425 {
426  if ( !m_pPropWin && _bToggleOn )
427  {
428  m_pPropWin = VclPtr<PropBrw>::Create(getController().getORB(), m_pTaskPane,this);
429  m_pPropWin->Invalidate();
430  static_cast<OTaskWindow*>(m_pTaskPane.get())->setPropertyBrowser(m_pPropWin);
432  }
433  if ( !(m_pPropWin && _bToggleOn != m_pPropWin->IsVisible()) )
434  return;
435 
436  if ( !m_pCurrentView && !m_xReportComponent.is() )
437  m_xReportComponent = getController().getReportDefinition();
438 
439  const bool bWillBeVisible = _bToggleOn;
440  m_pPropWin->Show(bWillBeVisible);
441  m_pTaskPane->Show(bWillBeVisible);
442  m_pTaskPane->Invalidate();
443 
444  if ( bWillBeVisible )
445  m_aSplitWin->InsertItem( TASKPANE_ID, m_pTaskPane,START_SIZE_TASKPANE, SPLITWINDOW_APPEND, COLSET_ID, SplitWindowItemFlags::PercentSize);
446  else
447  m_aSplitWin->RemoveItem(TASKPANE_ID);
448 
449  if ( bWillBeVisible )
450  m_aMarkIdle.Start();
451 }
452 
453 void ODesignView::showProperties(const uno::Reference< uno::XInterface>& _xReportComponent)
454 {
455  if ( m_xReportComponent != _xReportComponent )
456  {
457  m_xReportComponent = _xReportComponent;
458  if ( m_pCurrentView )
459  m_aScrollWindow->setMarked(m_pCurrentView,false);
460  m_pCurrentView = nullptr;
461  m_aMarkIdle.Start();
462  }
463 }
464 
465 bool ODesignView::isReportExplorerVisible() const
466 {
467  return m_xReportExplorer && m_xReportExplorer->getDialog()->get_visible();
468 }
469 
470 void ODesignView::toggleReportExplorer()
471 {
472  if ( !m_xReportExplorer )
473  {
474  OReportController& rReportController = getController();
475  m_xReportExplorer = std::make_shared<ONavigator>(GetFrameWeld(), rReportController);
476  SvtViewOptions aDlgOpt(EViewType::Window, OStringToOUString(m_xReportExplorer->get_help_id(), RTL_TEXTENCODING_UTF8));
477  if ( aDlgOpt.Exists() )
478  m_xReportExplorer->getDialog()->set_window_state(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US));
479  }
480 
481  if (!m_xReportExplorer->getDialog()->get_visible())
482  weld::DialogController::runAsync(m_xReportExplorer, [this](sal_Int32 /*nResult*/) { m_xReportExplorer.reset(); });
483  else
484  m_xReportExplorer->response(RET_CANCEL);
485 }
486 
487 bool ODesignView::isAddFieldVisible() const
488 {
489  return m_xAddField && m_xAddField->getDialog()->get_visible();
490 }
491 
492 void ODesignView::toggleAddField()
493 {
494  if (!m_xAddField)
495  {
496  uno::Reference< report::XReportDefinition > xReport(m_xReportComponent,uno::UNO_QUERY);
497  uno::Reference< report::XReportComponent > xReportComponent(m_xReportComponent,uno::UNO_QUERY);
498  OReportController& rReportController = getController();
499  if ( !m_pCurrentView && !xReport.is() )
500  {
501  if ( xReportComponent.is() )
502  xReport = xReportComponent->getSection()->getReportDefinition();
503  else
504  xReport = rReportController.getReportDefinition().get();
505  }
506  else if ( m_pCurrentView )
507  {
508  uno::Reference< report::XSection > xSection = m_pCurrentView->getReportSection()->getSection();
509  xReport = xSection->getReportDefinition();
510  }
511  uno::Reference < beans::XPropertySet > xSet(rReportController.getRowSet(),uno::UNO_QUERY);
512  m_xAddField = std::make_shared<OAddFieldWindow>(GetFrameWeld(), xSet);
513  m_xAddField->SetCreateHdl(LINK( &rReportController, OReportController, OnCreateHdl ) );
514  SvtViewOptions aDlgOpt( EViewType::Window, UID_RPT_RPT_APP_VIEW );
515  if ( aDlgOpt.Exists() )
516  m_xAddField->getDialog()->set_window_state(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US));
517  m_xAddField->Update();
518  }
519  if (!m_xAddField->getDialog()->get_visible())
520  weld::DialogController::runAsync(m_xAddField, [this](sal_Int32 /*nResult*/) { m_xAddField.reset(); });
521  else
522  m_xAddField->response(RET_CANCEL);
523 }
524 
525 uno::Reference< report::XSection > ODesignView::getCurrentSection() const
526 {
527  uno::Reference< report::XSection > xSection;
528  if ( m_pCurrentView )
529  xSection = m_pCurrentView->getReportSection()->getSection();
530 
531  return xSection;
532 }
533 
534 uno::Reference< report::XReportComponent > ODesignView::getCurrentControlModel() const
535 {
536  uno::Reference< report::XReportComponent > xModel;
537  if ( m_pCurrentView )
538  {
539  xModel = m_pCurrentView->getReportSection()->getCurrentControlModel();
540  }
541  return xModel;
542 }
543 
544 OSectionWindow* ODesignView::getMarkedSection(NearSectionAccess nsa) const
545 {
546  return m_aScrollWindow->getMarkedSection(nsa);
547 }
548 
549 OSectionWindow* ODesignView::getSectionWindow(const css::uno::Reference< css::report::XSection>& _xSection) const
550 {
551  return m_aScrollWindow->getSectionWindow(_xSection);
552 }
553 
554 void ODesignView::markSection(const sal_uInt16 _nPos)
555 {
556  m_aScrollWindow->markSection(_nPos);
557 }
558 
559 void ODesignView::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
560 {
561  m_aScrollWindow->fillCollapsedSections(_rCollapsedPositions);
562 }
563 
564 void ODesignView::collapseSections(const uno::Sequence< beans::PropertyValue>& _aCollapsedSections)
565 {
566  m_aScrollWindow->collapseSections(_aCollapsedSections);
567 }
568 
569 OUString ODesignView::getCurrentPage() const
570 {
571  return m_pPropWin ? m_pPropWin->getCurrentPage() : OUString();
572 }
573 
574 void ODesignView::setCurrentPage(const OUString& _sLastActivePage)
575 {
576  if ( m_pPropWin )
577  m_pPropWin->setCurrentPage(_sLastActivePage);
578 }
579 
580 void ODesignView::alignMarkedObjects(ControlModification _nControlModification,bool _bAlignAtSection)
581 {
582  m_aScrollWindow->alignMarkedObjects(_nControlModification, _bAlignAtSection);
583 }
584 
585 bool ODesignView::handleKeyEvent(const KeyEvent& _rEvent)
586 {
587  if ( m_pPropWin && m_pPropWin->HasChildPathFocus() )
588  return false;
589  if (m_xAddField && m_xAddField->getDialog()->has_toplevel_focus())
590  return false;
591  if (m_xReportExplorer && m_xReportExplorer->getDialog()->has_toplevel_focus())
592  return false;
593  return m_aScrollWindow->handleKeyEvent(_rEvent);
594 }
595 
596 void ODesignView::setMarked(const uno::Reference< report::XSection>& _xSection,bool _bMark)
597 {
598  m_aScrollWindow->setMarked(_xSection,_bMark);
599  if ( _bMark )
600  UpdatePropertyBrowserDelayed(getMarkedSection()->getReportSection().getSectionView());
601  else
602  m_pCurrentView = nullptr;
603 }
604 
605 void ODesignView::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _aShapes,bool _bMark)
606 {
607  m_aScrollWindow->setMarked(_aShapes,_bMark);
608  if ( _aShapes.hasElements() && _bMark )
609  showProperties(_aShapes[0]);
610  else
611  m_xReportComponent.clear();
612 }
613 
614 void ODesignView::MouseButtonDown( const MouseEvent& rMEvt )
615 {
616  if ( rMEvt.IsLeft() )
617  {
618  const uno::Sequence< beans::PropertyValue> aArgs;
619  getController().executeChecked(SID_SELECT_REPORT,aArgs);
620  }
621  ODataView::MouseButtonDown(rMEvt);
622 }
623 
624 uno::Any ODesignView::getCurrentlyShownProperty() const
625 {
626  uno::Any aRet;
627  OSectionWindow* pSectionWindow = getMarkedSection();
628  if ( pSectionWindow )
629  {
630  ::std::vector< uno::Reference< uno::XInterface > > aSelection;
631  pSectionWindow->getReportSection().fillControlModelSelection(aSelection);
632  if ( !aSelection.empty() )
633  {
634  uno::Sequence< uno::Reference< report::XReportComponent > > aSeq(aSelection.size());
635  sal_Int32 i = 0;
636  for(const auto& rxInterface : aSelection)
637  {
638  aSeq[i].set(rxInterface,uno::UNO_QUERY);
639  ++i;
640  }
641  aRet <<= aSeq;
642  }
643  }
644  return aRet;
645 }
646 
647 void ODesignView::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const
648 {
649  m_aScrollWindow->fillControlModelSelection(_rSelection);
650 }
651 
652 void ODesignView::setGridSnap(bool bOn)
653 {
654  m_aScrollWindow->setGridSnap(bOn);
655 
656 }
657 
658 void ODesignView::setDragStripes(bool bOn)
659 {
660  m_aScrollWindow->setDragStripes(bOn);
661 }
662 
663 bool ODesignView::isHandleEvent() const
664 {
665  return m_pPropWin && m_pPropWin->HasChildPathFocus();
666 }
667 
668 sal_uInt32 ODesignView::getMarkedObjectCount() const
669 {
670  return m_aScrollWindow->getMarkedObjectCount();
671 }
672 
673 void ODesignView::zoom(const Fraction& _aZoom)
674 {
675  m_aScrollWindow->zoom(_aZoom);
676 }
677 
678 sal_uInt16 ODesignView::getZoomFactor(SvxZoomType _eType) const
679 {
680  return m_aScrollWindow->getZoomFactor(_eType);
681 }
682 
683 } // rptui
684 
685 
686 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetPos(const Point &rPoint)
static sal_Int32 GetSplitSize()
#define SPLITWINDOW_APPEND
virtual void dispose() override
void notifySystemWindow(vcl::Window const *pWindow, vcl::Window *pToRegister, const ::comphelper::mem_fun1_t< TaskPaneList, vcl::Window * > &rMemFunc)
notifySystemWindow adds or remove the given window _pToRegister at the Systemwindow found when search...
Definition: UITools.cxx:857
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
long Long
void disposeAndClear()
static const AllSettings & GetSettings()
static css::awt::KeyEvent st_VCLKey2AWTKey(const vcl::KeyCode &aKey)
DataChangedEventType GetType() const
const KeyEvent * GetKeyEvent() const
virtual void dispose() override
#define UID_RPT_RPT_APP_VIEW
Definition: helpids.h:28
RET_CANCEL
SdrObjKind
ODesignView(ODesignView const &)=delete
constexpr tools::Long Width() const
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
IMPL_LINK_NOARG(ODesignView, SplitHdl, SplitWindow *, void)
Definition: DesignView.cxx:400
#define REPORT_ID
Definition: DesignView.cxx:52
AllSettingsFlags GetFlags() const
ControlModification
Definition: RptDef.hxx:48
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
constexpr bool IsEmpty() const
OReportSection & getReportSection()
Point BottomRight() const
WinBits const WB_DIALOGCONTROL
void clear()
int i
void SetSize(const Size &rSize)
void SetWindowState(const OUString &sState)
MouseNotifyEvent GetType() const
css::uno::Reference< css::sdbc::XRowSet > const & getRowSet()
returns the RowSet which reflects the current settings of the report definition
OUString GetWindowState() const
tools::Long Top() const
#define TASKPANE_ID
Definition: DesignView.cxx:53
void GrabFocus()
VclPtr< PropBrw > m_pPropWin
Definition: DesignView.cxx:59
constexpr Point TopLeft() const
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...
#define COLSET_ID
Definition: DesignView.cxx:51
const vcl::KeyCode & GetKeyCode() const
constexpr Size GetSize() const
constexpr tools::Long Height() const
#define START_SIZE_TASKPANE
Definition: DesignView.cxx:50
bool IsLeft() const
mem_fun1_t< Tp, Arg > mem_fun(void(Tp::*f)(Arg))
static VclPtr< reference_type > Create(Arg &&...arg)
bool Exists() const
Sequence< sal_Int8 > aSeq
void RemoveWindow(vcl::Window *pWindow)
Reference< XModel > xModel
void AddWindow(vcl::Window *pWindow)
SvxZoomType
void dispose()
OBJ_NONE
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
tools::Long Right() const
const css::uno::Reference< css::report::XReportDefinition > & getReportDefinition() const
gives access to the report definition