LibreOffice Module reportdesign (master)  1
UITools.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_UITOOLS_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_UITOOLS_HXX
21 
22 #include <com/sun/star/report/XGroup.hpp>
23 #include <com/sun/star/report/XReportControlFormat.hpp>
24 #include <com/sun/star/report/XShape.hpp>
25 #include <com/sun/star/awt/XWindow.hpp>
26 #include <com/sun/star/beans/NamedValue.hpp>
27 #include <com/sun/star/container/XIndexAccess.hpp>
28 #include <com/sun/star/sdbc/XRowSet.hpp>
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include "ReportSection.hxx"
31 #include <rtl/ref.hxx>
32 #include <vcl/taskpanelist.hxx>
33 #include <comphelper/stl_types.hxx>
34 
35 class SdrPage;
36 class SdrObject;
37 class SdrUnoObj;
38 class SdrView;
39 namespace tools { class Rectangle; }
40 namespace comphelper
41 {
42  class OPropertyChangeMultiplexer;
43  class OPropertyChangeListener;
44 }
45 namespace rptui
46 {
52  template<typename T> sal_Int32 getPositionInIndexAccess(
53  const css::uno::Reference< css::container::XIndexAccess >& _xCollection
54  ,const css::uno::Reference< T >& _xSearch)
55  {
56  sal_Int32 nCount = _xCollection->getCount();
57  sal_Int32 i = (nCount == 0) ? -1 : 0;
58  for (;i<nCount ; ++i)
59  {
60  css::uno::Reference< T > xObject(_xCollection->getByIndex(i),css::uno::UNO_QUERY);
61  if ( xObject == _xSearch )
62  break;
63  }
64  return i;
65  }
66 
70  void adjustSectionName(const css::uno::Reference< css::report::XGroup >& _xGroup,sal_Int32 _nPos);
71 
78  ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> addStyleListener( const css::uno::Reference< css::report::XReportDefinition >& _xReportDefinition
80 
83  bool openCharDialog(
84  const css::uno::Reference< css::report::XReportControlFormat>& _xReportControlFormat,
85  const css::uno::Reference< css::awt::XWindow>& _xWindow,
86  css::uno::Sequence< css::beans::NamedValue >& _out_rNewValues
87  );
88 
91  bool openAreaDialog(
92  const css::uno::Reference< css::report::XShape >& _xShape
93  ,const css::uno::Reference< css::awt::XWindow>& _xWindow
94  );
95 
104  bool openDialogFormula_nothrow( OUString& _in_out_rFormula
105  , const css::uno::Reference< css::uno::XComponentContext >& _xContext
106  , const css::uno::Reference< css::awt::XWindow>& _xWindow
107  , const css::uno::Reference < css::beans::XPropertySet >& _xRowSet
108  );
109 
113  const css::uno::Reference< css::report::XReportControlFormat >& _rxReportControlFormat,
114  const css::uno::Sequence< css::beans::NamedValue >& _rSettings
115  );
116 
128  void notifySystemWindow(vcl::Window const * pWindow, vcl::Window* pToRegister, const ::comphelper::mem_fun1_t<TaskPaneList, vcl::Window*>& rMemFunc);
129 
130 
131  const sal_Int16 ISOVER_IGNORE_CUSTOMSHAPES = 1;
132 
140  SdrObject* isOver(const tools::Rectangle& _rRect,SdrPage const & _rPage,SdrView const & _rView,bool _bAllObjects = false,SdrObject const * _pIgnore = nullptr, sal_Int16 _nIgnoreType=0);
141 
142  SdrObject* isOver(const tools::Rectangle& _rRect,SdrPage const & _rPage,SdrView const & _rView,bool _bAllObjects, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp> _pIgnoreList[], int _nIgnoreListLength);
143 
151  SdrObject* isOver(SdrObject const * _pObj,SdrPage const & _rPage,SdrView const & _rView);
152 
155  css::uno::Sequence< OUString >
156  getParameterNames( const css::uno::Reference< css::sdbc::XRowSet >& _rxRowSet );
157 
164  void correctOverlapping(SdrObject* pControl,OReportSection const & _aReportSection,bool _bInsert = true);
165 
172 
177  void setZoomFactor(const Fraction& _aZoom, vcl::Window& _rWindow);
178 }
179 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_UITOOLS_HXX
180 
181 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrObject * isOver(const tools::Rectangle &_rRect, SdrPage const &_rPage, SdrView const &_rView, bool _bAllObjects=false, SdrObject const *_pIgnore=nullptr, sal_Int16 _nIgnoreType=0)
checks whether the given rectangle overlapps another OUnoObject object in that view.
Definition: UITools.cxx:867
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
tools::Rectangle getRectangleFromControl(SdrObject *pControl)
returns a Rectangle of a given SdrObject
Definition: UITools.cxx:980
bool openDialogFormula_nothrow(OUString &_in_out_rFormula, const css::uno::Reference< css::uno::XComponentContext > &_xContext, const css::uno::Reference< css::awt::XWindow > &_xWindow, const css::uno::Reference< css::beans::XPropertySet > &_xRowSet)
opens the formula dialog
int nCount
int i
void correctOverlapping(SdrObject *pControl, OReportSection const &_aReportSection, bool _bInsert=true)
ensures that no control overlaps the given one.
Definition: UITools.cxx:997
void adjustSectionName(const css::uno::Reference< css::report::XGroup > &_xGroup, sal_Int32 _nPos)
set the name of the header and footer of the group by the expression appended by the localized name o...
bool openCharDialog(const css::uno::Reference< css::report::XReportControlFormat > &_xReportControlFormat, const css::uno::Reference< css::awt::XWindow > &_xWindow, css::uno::Sequence< css::beans::NamedValue > &_out_rNewValues)
opens the common character font dialog
sal_Int32 getPositionInIndexAccess(const css::uno::Reference< css::container::XIndexAccess > &_xCollection, const css::uno::Reference< T > &_xSearch)
returns the position of the object inside the index container
Definition: UITools.hxx:52
void applyCharacterSettings(const css::uno::Reference< css::report::XReportControlFormat > &_rxReportControlFormat, const css::uno::Sequence< css::beans::NamedValue > &_rSettings)
applies the character settings previously obtained via openCharDialog
const sal_Int16 ISOVER_IGNORE_CUSTOMSHAPES
Definition: UITools.hxx:131
::rtl::Reference< comphelper::OPropertyChangeMultiplexer > addStyleListener(const css::uno::Reference< css::report::XReportDefinition > &_xReportDefinition,::comphelper::OPropertyChangeListener *_pListener)
add a listener for the properties size, left margin, right margin to the page style ...
css::uno::Sequence< OUString > getParameterNames(const css::uno::Reference< css::sdbc::XRowSet > &_rxRowSet)
retrieves the names of the parameters of the command which the given RowSet is bound to ...
void setZoomFactor(const Fraction &_aZoom, vcl::Window &_rWindow)
sets the map mode at the window
Definition: UITools.cxx:1019
bool openAreaDialog(const css::uno::Reference< css::report::XShape > &_xShape, const css::uno::Reference< css::awt::XWindow > &_xWindow)
opens the area dialog for shapes