LibreOffice Module reportdesign (master)  1
ReportSection.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_REPORTSECTION_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_REPORTSECTION_HXX
21 
22 #include <vcl/window.hxx>
23 #include <RptPage.hxx>
24 #include <com/sun/star/beans/NamedValue.hpp>
26 #include <cppuhelper/basemutex.hxx>
27 #include "ReportDefines.hxx"
28 #include "dlgedfunc.hxx"
29 #include <vcl/transfer.hxx>
30 #include <rtl/ref.hxx>
31 #include <memory>
32 
33 namespace rptui
34 {
35  class OReportModel;
36  class OReportPage;
37  class OSectionView;
38  class OSectionWindow;
39 
40  class OReportSection : public vcl::Window
41  , public ::cppu::BaseMutex
43  , public DropTargetHelper
44  {
48  ::std::unique_ptr<DlgEdFunc> m_pFunc;
49  std::shared_ptr<OReportModel> m_pModel;
52  css::uno::Reference< css::report::XSection > m_xSection;
54 
56 
59  void fill();
62  void impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_Int32 i_nLeftMargin,sal_Int32 i_nRightMargin);
63 
64  OReportSection(OReportSection const &) = delete;
65  void operator =(OReportSection const &) = delete;
66  protected:
67  // DropTargetHelper overridables
68  virtual sal_Int8 AcceptDrop( const AcceptDropEvent& _rEvt ) override;
69  virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& _rEvt ) override;
70 
71  // window overrides
72  virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
73  virtual void MouseMove( const MouseEvent& rMEvt ) override;
74  virtual void Command( const CommandEvent& rCEvt ) override;
75 
76  // OPropertyChangeListener
77  virtual void _propertyChanged(const css::beans::PropertyChangeEvent& _rEvent) override;
78  public:
79  OReportSection(OSectionWindow* _pParent,const css::uno::Reference< css::report::XSection >& _xSection);
80  virtual ~OReportSection() override;
81  virtual void dispose() override;
82 
83  // window overrides
84  virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
85  virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
86 
90  void Copy(css::uno::Sequence< css::beans::NamedValue >& _rAllreadyCopiedObjects);
91 
92  void Copy(css::uno::Sequence< css::beans::NamedValue >& _rAllreadyCopiedObjects,bool _bEraseAnddNoClone);
93 
98  void Paste(const css::uno::Sequence< css::beans::NamedValue >& _aAllreadyCopiedObjects,bool _bForce = false);
99 
103  void Delete();
104 
107  void SelectAll(const sal_uInt16 _nObjectType);
108 
113  void SetGridVisible(bool _bVisible);
114 
116  OSectionView& getSectionView() const { return *m_pView; }
117  OReportPage* getPage() const { return m_pPage; }
118  const css::uno::Reference< css::report::XSection >& getSection() const { return m_xSection; }
119 
120  void SetMode( DlgEdMode m_eMode );
121 
126  bool handleKeyEvent(const KeyEvent& _rEvent);
127 
130  css::uno::Reference< css::report::XReportComponent > getCurrentControlModel() const;
131 
135  void fillControlModelSelection(::std::vector< css::uno::Reference< css::uno::XInterface > >& _rSelection) const;
136 
141  void createDefault(const OUString& _sType);
142 
148  static void createDefault(const OUString& _sType,SdrObject* _pObj);
149  void stopScrollTimer();
150 
153  void deactivateOle();
154 
157  bool isUiActive() const;
158  };
159 
160 } //rptui
161 
162 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_REPORTSECTION_HXX
163 
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void dispose() override
::std::unique_ptr< DlgEdFunc > m_pFunc
::rtl::Reference< comphelper::OPropertyChangeMultiplexer > m_pReportListener
bool handleKeyEvent(const KeyEvent &_rEvent)
checks if the keycode is known by the child windows
const css::uno::Reference< css::report::XSection > & getSection() const
OSectionView * m_pView
signed char sal_Int8
void impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth, sal_Int32 i_nLeftMargin, sal_Int32 i_nRightMargin)
checks all objects if they fit in the new paper width.
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &_rEvt) override
void fill()
fills the section with all control from the report section
sal_Int32 m_nPaintEntranceCount
void operator=(OReportSection const &)=delete
OReportSection(OReportSection const &)=delete
void Paste(const css::uno::Sequence< css::beans::NamedValue > &_aAllreadyCopiedObjects, bool _bForce=false)
paste a new control in this section
bool isUiActive() const
returns true when an ole object is currently active
VclPtr< OSectionWindow > m_pParent
virtual void Command(const CommandEvent &rCEvt) override
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual void MouseMove(const MouseEvent &rMEvt) override
void Delete()
Deletes the current selection in this section.
css::uno::Reference< css::report::XSection > m_xSection
::rtl::Reference< comphelper::OPropertyChangeMultiplexer > m_pMulti
void SetMode(DlgEdMode m_eMode)
virtual ~OReportSection() override
void SetGridVisible(bool _bVisible)
makes the grid visible
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...
OSectionWindow * getSectionWindow() const
void Copy(css::uno::Sequence< css::beans::NamedValue > &_rAllreadyCopiedObjects)
copies the current selection in this section
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
void SelectAll(const sal_uInt16 _nObjectType)
All objects will be marked.
OReportPage * getPage() const
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &_rEvt) override
css::uno::Reference< css::report::XReportComponent > getCurrentControlModel() const
returns the current control report model or
virtual void _propertyChanged(const css::beans::PropertyChangeEvent &_rEvent) override
void deactivateOle()
deactivate the current active ole object if any
void createDefault(const OUString &_sType)
creates a default object (custom shape)
OSectionView & getSectionView() const
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
std::shared_ptr< OReportModel > m_pModel