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 RPTUI_SECTIONWINDOW_HXX
20 #define RPTUI_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"
37 #include <boost/shared_ptr.hpp>
41 class OPropertyChangeMultiplexer
;
46 class OSectionWindow
: public Window
47 , public ::cppu::BaseMutex
48 , public ::comphelper::OPropertyChangeListener
50 OViewsWindow
* m_pParent
;
51 OStartMarker m_aStartMarker
;
52 OReportSection m_aReportSection
;
54 OEndMarker m_aEndMarker
;
56 ::rtl::Reference
< comphelper::OPropertyChangeMultiplexer
> m_pSectionMulti
;
57 ::rtl::Reference
< comphelper::OPropertyChangeMultiplexer
> m_pGroupMulti
;
59 OSectionWindow(OSectionWindow
&);
60 void operator =(OSectionWindow
&);
62 /** set the title of the group header or footer
67 * \param _pIsSectionOn
68 * @return sal_True when title was set otherwise FALSE
70 bool setGroupSectionTitle(const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XGroup
>& _xGroup
,sal_uInt16 _nResId
,::std::mem_fun_t
< ::com::sun::star::uno::Reference
< ::com::sun::star::report::XSection
> , OGroupHelper
> _pGetSection
,::std::mem_fun_t
<sal_Bool
, OGroupHelper
> _pIsSectionOn
);
72 /** set the title of the (report/page) header or footer
77 * \param _pIsSectionOn
78 * @return sal_True when title was set otherwise FALSE
80 bool setReportSectionTitle(const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XReportDefinition
>& _xReport
,sal_uInt16 _nResId
,::std::mem_fun_t
< ::com::sun::star::uno::Reference
< ::com::sun::star::report::XSection
> , OReportHelper
> _pGetSection
,::std::mem_fun_t
<sal_Bool
, OReportHelper
> _pIsSectionOn
);
81 void ImplInitSettings();
83 DECL_LINK(Collapsed
,OColorListener
*);
84 DECL_LINK(StartSplitHdl
, Splitter
*);
85 DECL_LINK(SplitHdl
, Splitter
*);
86 DECL_LINK(EndSplitHdl
, Splitter
*);
89 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
91 virtual void Resize();
94 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent
& _rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
96 OSectionWindow( OViewsWindow
* _pParent
97 ,const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XSection
>& _xSection
98 ,const OUString
& _sColorEntry
);
99 virtual ~OSectionWindow();
101 inline OStartMarker
& getStartMarker() { return m_aStartMarker
; }
102 inline OReportSection
& getReportSection() { return m_aReportSection
; }
103 inline OEndMarker
& getEndMarker() { return m_aEndMarker
; }
104 inline OViewsWindow
* getViewsWindow() { return m_pParent
; }
106 void setCollapsed(sal_Bool _bCollapsed
);
108 /** triggers the property browser with the section
111 void showProperties();
113 /** set the marker as marked or not marked
114 @param _bMark set the new state of the marker
116 void setMarked(sal_Bool _bMark
);
118 OViewsWindow
* getViewsWindow() const { return m_pParent
; }
120 /** zoom the ruler and view windows
122 void zoom(const Fraction
& _aZoom
);
124 void scrollChildren(long _nThumbPosX
);
126 //==============================================================================
128 //==============================================================================
129 #endif // RPTUI_SECTIONWINDOW_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */