1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_SECTIONWINDOW_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_SECTIONWINDOW_HXX
22 #include <com/sun/star/report/XSection.hpp>
23 #include <vcl/window.hxx>
24 #include <vcl/split.hxx>
25 #include <svtools/colorcfg.hxx>
26 #include <comphelper/propmultiplex.hxx>
27 #include <cppuhelper/basemutex.hxx>
29 #include "UITools.hxx"
30 #include <UndoActions.hxx>
31 #include "StartMarker.hxx"
32 #include "EndMarker.hxx"
33 #include "ReportSection.hxx"
40 class OPropertyChangeMultiplexer
;
45 class OSectionWindow
: public vcl::Window
46 , public ::cppu::BaseMutex
47 , public ::comphelper::OPropertyChangeListener
49 VclPtr
<OViewsWindow
> m_pParent
;
50 VclPtr
<OStartMarker
> m_aStartMarker
;
51 VclPtr
<OReportSection
> m_aReportSection
;
52 VclPtr
<Splitter
> m_aSplitter
;
53 VclPtr
<OEndMarker
> m_aEndMarker
;
55 ::rtl::Reference
< comphelper::OPropertyChangeMultiplexer
> m_pSectionMulti
;
56 ::rtl::Reference
< comphelper::OPropertyChangeMultiplexer
> m_pGroupMulti
;
58 OSectionWindow(OSectionWindow
const &) = delete;
59 void operator =(OSectionWindow
const &) = delete;
61 /** set the title of the group header or footer
66 * \param _pIsSectionOn
67 * @return sal_True when title was set otherwise FALSE
69 bool setGroupSectionTitle(
70 const css::uno::Reference
<css::report::XGroup
>& _xGroup
, const char* pResId
,
71 const ::std::function
<css::uno::Reference
<css::report::XSection
>(OGroupHelper
*)>&
73 const ::std::function
<bool(OGroupHelper
*)>& _pIsSectionOn
);
75 /** set the title of the (report/page) header or footer
80 * \param _pIsSectionOn
81 * @return sal_True when title was set otherwise FALSE
83 bool setReportSectionTitle(
84 const css::uno::Reference
<css::report::XReportDefinition
>& _xReport
, const char* pResId
,
85 const ::std::function
<css::uno::Reference
<css::report::XSection
>(OReportHelper
*)>&
87 const ::std::function
<bool(OReportHelper
*)>& _pIsSectionOn
);
88 void ImplInitSettings();
90 DECL_LINK(Collapsed
, OColorListener
&, void);
91 DECL_LINK(StartSplitHdl
, Splitter
*, void);
92 DECL_LINK(SplitHdl
, Splitter
*, void);
93 DECL_LINK(EndSplitHdl
, Splitter
*, void);
96 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) override
;
98 virtual void Resize() override
;
101 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& _rEvent
) override
;
103 OSectionWindow( OViewsWindow
* _pParent
104 ,const css::uno::Reference
< css::report::XSection
>& _xSection
105 ,const OUString
& _sColorEntry
);
106 virtual ~OSectionWindow() override
;
107 virtual void dispose() override
;
109 OStartMarker
& getStartMarker() { return *m_aStartMarker
.get(); }
110 OReportSection
& getReportSection() { return *m_aReportSection
.get(); }
111 OEndMarker
& getEndMarker() { return *m_aEndMarker
.get(); }
112 OViewsWindow
* getViewsWindow() { return m_pParent
; }
114 void setCollapsed(bool _bCollapsed
);
116 /** triggers the property browser with the section
119 void showProperties();
121 /** set the marker as marked or not marked
122 @param _bMark set the new state of the marker
124 void setMarked(bool _bMark
);
126 /** zoom the ruler and view windows
128 void zoom(const Fraction
& _aZoom
);
130 void scrollChildren(long _nThumbPosX
);
135 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_SECTIONWINDOW_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */