sync master with lastest vba changes
[ooovba.git] / reportdesign / source / ui / inc / SectionWindow.hxx
blobe84b19d99cd7fe5c260ac164c093feec91a1fbda
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;
68 //Window m_aFill;
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
78 * \param _xGroup
79 * \param _nResId
80 * \param _pGetSection
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
88 * \param _xGroup
89 * \param _nResId
90 * \param _pGetSection
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 );
104 // windows overload
105 virtual void Resize();
107 protected:
108 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
109 public:
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
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