1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SectionWindow.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef RPTUI_SECTIONWINDOW_HXX
31 #define RPTUI_SECTIONWINDOW_HXX
33 #include <com/sun/star/report/XSection.hpp>
34 #include <vcl/window.hxx>
35 #include <vcl/split.hxx>
36 #include <svtools/colorcfg.hxx>
37 #include <comphelper/propmultiplex.hxx>
38 #include <cppuhelper/basemutex.hxx>
40 #include "UITools.hxx"
41 #include "UndoActions.hxx"
42 #include "StartMarker.hxx"
43 #include "EndMarker.hxx"
44 #include "ReportSection.hxx"
48 #include <boost/shared_ptr.hpp>
52 class OPropertyChangeMultiplexer
;
59 class OSectionWindow
: public Window
60 , public ::cppu::BaseMutex
61 , public ::comphelper::OPropertyChangeListener
63 OViewsWindow
* m_pParent
;
64 OStartMarker m_aStartMarker
;
65 OReportSection m_aReportSection
;
67 OEndMarker m_aEndMarker
;
70 ::rtl::Reference
< comphelper::OPropertyChangeMultiplexer
> m_pSectionMulti
;
71 ::rtl::Reference
< comphelper::OPropertyChangeMultiplexer
> m_pGroupMulti
;
73 OSectionWindow(OSectionWindow
&);
74 void operator =(OSectionWindow
&);
76 /** set the title of the group header or footer
81 * \param _pIsSectionOn
82 * @return TRUE when title was set otherwise FALSE
84 bool setGroupSectionTitle(const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XGroup
>& _xGroup
,USHORT _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
);
86 /** set the title of the (report/page) header or footer
91 * \param _pIsSectionOn
92 * @return TRUE when title was set otherwise FALSE
94 bool setReportSectionTitle(const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XReportDefinition
>& _xReport
,USHORT _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
);
95 void ImplInitSettings();
97 DECL_LINK(Collapsed
,OStartMarker
*);
98 DECL_LINK(StartSplitHdl
, Splitter
*);
99 DECL_LINK(SplitHdl
, Splitter
*);
100 DECL_LINK(EndSplitHdl
, Splitter
*);
103 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
105 virtual void Resize();
108 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent
& _rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
110 OSectionWindow( OViewsWindow
* _pParent
111 ,const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XSection
>& _xSection
112 ,const ::rtl::OUString
& _sColorEntry
);
113 virtual ~OSectionWindow();
115 inline OStartMarker
& getStartMarker() { return m_aStartMarker
; }
116 inline OReportSection
& getReportSection() { return m_aReportSection
; }
117 inline OEndMarker
& getEndMarker() { return m_aEndMarker
; }
119 void setCollapsed(sal_Bool _bCollapsed
);
121 /** triggers the property browser with the section
124 void showProperties();
126 /** set the marker as marked or not marked
127 @param _bMark set the new state of the marker
129 void setMarked(sal_Bool _bMark
);
131 OViewsWindow
* getViewsWindow() const { return m_pParent
; }
133 /** zoom the ruler and view windows
135 void zoom(const Fraction
& _aZoom
);
137 void scrollChildren(long _nThumbPosX
);
139 //==============================================================================
141 //==============================================================================
142 #endif // RPTUI_SECTIONWINDOW_HXX