merge the formfield patch from ooo-build
[ooovba.git] / reportdesign / source / ui / inc / SectionWindow.hxx
blob4fd739e028aca02081e82e11b4e6c5c4563c7dc2
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SectionWindow.hxx,v $
10 * $Revision: 1.2 $
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"
46 #include <list>
47 #include <map>
48 #include <boost/shared_ptr.hpp>
50 namespace comphelper
52 class OPropertyChangeMultiplexer;
54 namespace rptui
56 class OReportWindow;
57 class ODesignView;
58 class OViewsWindow;
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;
66 Splitter m_aSplitter;
67 OEndMarker m_aEndMarker;
69 ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pSectionMulti;
70 ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pGroupMulti;
72 OSectionWindow(OSectionWindow&);
73 void operator =(OSectionWindow&);
75 /** set the title of the group header or footer
77 * \param _xGroup
78 * \param _nResId
79 * \param _pGetSection
80 * \param _pIsSectionOn
81 * @return TRUE when title was set otherwise FALSE
83 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);
85 /** set the title of the (report/page) header or footer
87 * \param _xGroup
88 * \param _nResId
89 * \param _pGetSection
90 * \param _pIsSectionOn
91 * @return TRUE when title was set otherwise FALSE
93 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);
94 void ImplInitSettings();
96 DECL_LINK(Collapsed,OColorListener*);
97 DECL_LINK(StartSplitHdl, Splitter*);
98 DECL_LINK(SplitHdl, Splitter*);
99 DECL_LINK(EndSplitHdl, Splitter*);
102 virtual void DataChanged( const DataChangedEvent& rDCEvt );
103 // windows overload
104 virtual void Resize();
106 protected:
107 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
108 public:
109 OSectionWindow( OViewsWindow* _pParent
110 ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
111 ,const ::rtl::OUString& _sColorEntry);
112 virtual ~OSectionWindow();
114 inline OStartMarker& getStartMarker() { return m_aStartMarker; }
115 inline OReportSection& getReportSection() { return m_aReportSection; }
116 inline OEndMarker& getEndMarker() { return m_aEndMarker; }
117 inline OViewsWindow* getViewsWindow() { return m_pParent; }
119 void setCollapsed(sal_Bool _bCollapsed);
121 /** triggers the property browser with the section
122 @param _pStartMarker
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 //==============================================================================
140 } // rptui
141 //==============================================================================
142 #endif // RPTUI_SECTIONWINDOW_HXX