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 <comphelper/propmultiplex.hxx>
26 #include <cppuhelper/basemutex.hxx>
28 #include <UndoActions.hxx>
29 #include "StartMarker.hxx"
30 #include "EndMarker.hxx"
31 #include "ReportSection.hxx"
35 class OPropertyChangeMultiplexer
;
40 class OSectionWindow
: public vcl::Window
41 , public ::cppu::BaseMutex
42 , public ::comphelper::OPropertyChangeListener
44 VclPtr
<OViewsWindow
> m_pParent
;
45 VclPtr
<OStartMarker
> m_aStartMarker
;
46 VclPtr
<OReportSection
> m_aReportSection
;
47 VclPtr
<Splitter
> m_aSplitter
;
48 VclPtr
<OEndMarker
> m_aEndMarker
;
50 ::rtl::Reference
< comphelper::OPropertyChangeMultiplexer
> m_pSectionMulti
;
51 ::rtl::Reference
< comphelper::OPropertyChangeMultiplexer
> m_pGroupMulti
;
53 OSectionWindow(OSectionWindow
const &) = delete;
54 void operator =(OSectionWindow
const &) = delete;
56 /** set the title of the group header or footer
61 * \param _pIsSectionOn
62 * @return sal_True when title was set otherwise FALSE
64 bool setGroupSectionTitle(
65 const css::uno::Reference
<css::report::XGroup
>& _xGroup
, TranslateId pResId
,
66 const ::std::function
<css::uno::Reference
<css::report::XSection
>(OGroupHelper
*)>&
68 const ::std::function
<bool(OGroupHelper
*)>& _pIsSectionOn
);
70 /** set the title of the (report/page) header or footer
75 * \param _pIsSectionOn
76 * @return sal_True when title was set otherwise FALSE
78 bool setReportSectionTitle(
79 const css::uno::Reference
<css::report::XReportDefinition
>& _xReport
, TranslateId pResId
,
80 const ::std::function
<css::uno::Reference
<css::report::XSection
>(OReportHelper
*)>&
82 const ::std::function
<bool(OReportHelper
*)>& _pIsSectionOn
);
83 void ImplInitSettings();
85 DECL_LINK(Collapsed
, OColorListener
&, void);
86 DECL_LINK(StartSplitHdl
, Splitter
*, void);
87 DECL_LINK(SplitHdl
, Splitter
*, void);
88 DECL_LINK(EndSplitHdl
, Splitter
*, void);
91 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) override
;
93 virtual void Resize() override
;
96 virtual void _propertyChanged(const css::beans::PropertyChangeEvent
& _rEvent
) override
;
98 OSectionWindow( OViewsWindow
* _pParent
99 ,const css::uno::Reference
< css::report::XSection
>& _xSection
100 ,const OUString
& _sColorEntry
);
101 virtual ~OSectionWindow() override
;
102 virtual void dispose() override
;
104 OStartMarker
& getStartMarker() { return *m_aStartMarker
; }
105 OReportSection
& getReportSection() { return *m_aReportSection
; }
106 OEndMarker
& getEndMarker() { return *m_aEndMarker
; }
107 OViewsWindow
* getViewsWindow() { return m_pParent
; }
109 void setCollapsed(bool _bCollapsed
);
111 /** triggers the property browser with the section
114 void showProperties();
116 /** set the marker as marked or not marked
117 @param _bMark set the new state of the marker
119 void setMarked(bool _bMark
);
121 /** zoom the ruler and view windows
123 void zoom(const Fraction
& _aZoom
);
125 void scrollChildren(tools::Long _nThumbPosX
);
130 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_SECTIONWINDOW_HXX
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */