1*9ee13d13SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9ee13d13SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9ee13d13SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9ee13d13SAndrew Rist  * distributed with this work for additional information
6*9ee13d13SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9ee13d13SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9ee13d13SAndrew Rist  * "License"); you may not use this file except in compliance
9*9ee13d13SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9ee13d13SAndrew Rist  *
11*9ee13d13SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9ee13d13SAndrew Rist  *
13*9ee13d13SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9ee13d13SAndrew Rist  * software distributed under the License is distributed on an
15*9ee13d13SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9ee13d13SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9ee13d13SAndrew Rist  * specific language governing permissions and limitations
18*9ee13d13SAndrew Rist  * under the License.
19*9ee13d13SAndrew Rist  *
20*9ee13d13SAndrew Rist  *************************************************************/
21*9ee13d13SAndrew Rist 
22*9ee13d13SAndrew Rist 
23cdf0e10cSrcweir #ifndef RPTUI_SECTIONWINDOW_HXX
24cdf0e10cSrcweir #define RPTUI_SECTIONWINDOW_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/report/XSection.hpp>
27cdf0e10cSrcweir #include <vcl/window.hxx>
28cdf0e10cSrcweir #include <vcl/split.hxx>
29cdf0e10cSrcweir #include <svtools/colorcfg.hxx>
30cdf0e10cSrcweir #include <comphelper/propmultiplex.hxx>
31cdf0e10cSrcweir #include <cppuhelper/basemutex.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include "UITools.hxx"
34cdf0e10cSrcweir #include "UndoActions.hxx"
35cdf0e10cSrcweir #include "StartMarker.hxx"
36cdf0e10cSrcweir #include "EndMarker.hxx"
37cdf0e10cSrcweir #include "ReportSection.hxx"
38cdf0e10cSrcweir 
39cdf0e10cSrcweir #include <list>
40cdf0e10cSrcweir #include <map>
41cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
42cdf0e10cSrcweir 
43cdf0e10cSrcweir namespace comphelper
44cdf0e10cSrcweir {
45cdf0e10cSrcweir 	class OPropertyChangeMultiplexer;
46cdf0e10cSrcweir }
47cdf0e10cSrcweir namespace rptui
48cdf0e10cSrcweir {
49cdf0e10cSrcweir 	class OReportWindow;
50cdf0e10cSrcweir 	class ODesignView;
51cdf0e10cSrcweir     class OViewsWindow;
52cdf0e10cSrcweir     class OSectionWindow :      public Window
53cdf0e10cSrcweir                             ,	public ::cppu::BaseMutex
54cdf0e10cSrcweir 							,	public ::comphelper::OPropertyChangeListener
55cdf0e10cSrcweir     {
56cdf0e10cSrcweir         OViewsWindow*   m_pParent;
57cdf0e10cSrcweir         OStartMarker    m_aStartMarker;
58cdf0e10cSrcweir         OReportSection  m_aReportSection;
59cdf0e10cSrcweir         Splitter        m_aSplitter;
60cdf0e10cSrcweir         OEndMarker      m_aEndMarker;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir         ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pSectionMulti;
63cdf0e10cSrcweir         ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pGroupMulti;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir         OSectionWindow(OSectionWindow&);
66cdf0e10cSrcweir         void operator =(OSectionWindow&);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir         /** set the title of the group header or footer
69cdf0e10cSrcweir         *
70cdf0e10cSrcweir         * \param _xGroup
71cdf0e10cSrcweir         * \param _nResId
72cdf0e10cSrcweir         * \param _pGetSection
73cdf0e10cSrcweir         * \param _pIsSectionOn
74cdf0e10cSrcweir         * @return sal_True when title was set otherwise FALSE
75cdf0e10cSrcweir         */
76cdf0e10cSrcweir         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);
77cdf0e10cSrcweir 
78cdf0e10cSrcweir         /** set the title of the (report/page) header or footer
79cdf0e10cSrcweir         *
80cdf0e10cSrcweir         * \param _xGroup
81cdf0e10cSrcweir         * \param _nResId
82cdf0e10cSrcweir         * \param _pGetSection
83cdf0e10cSrcweir         * \param _pIsSectionOn
84cdf0e10cSrcweir         * @return sal_True when title was set otherwise FALSE
85cdf0e10cSrcweir         */
86cdf0e10cSrcweir         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);
87cdf0e10cSrcweir         void ImplInitSettings();
88cdf0e10cSrcweir 
89cdf0e10cSrcweir         DECL_LINK(Collapsed,OColorListener*);
90cdf0e10cSrcweir         DECL_LINK(StartSplitHdl, Splitter*);
91cdf0e10cSrcweir 		DECL_LINK(SplitHdl, Splitter*);
92cdf0e10cSrcweir 		DECL_LINK(EndSplitHdl, Splitter*);
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 
95cdf0e10cSrcweir         virtual void DataChanged( const DataChangedEvent& rDCEvt );
96cdf0e10cSrcweir         // windows overload
97cdf0e10cSrcweir 		virtual void Resize();
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     protected:
100cdf0e10cSrcweir         virtual void	_propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
101cdf0e10cSrcweir     public:
102cdf0e10cSrcweir         OSectionWindow( OViewsWindow* _pParent
103cdf0e10cSrcweir                         ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
104cdf0e10cSrcweir 				        ,const ::rtl::OUString& _sColorEntry);
105cdf0e10cSrcweir         virtual ~OSectionWindow();
106cdf0e10cSrcweir 
getStartMarker()107cdf0e10cSrcweir         inline OStartMarker&    getStartMarker()    { return m_aStartMarker;     }
getReportSection()108cdf0e10cSrcweir         inline OReportSection&  getReportSection()  { return m_aReportSection;   }
getEndMarker()109cdf0e10cSrcweir         inline OEndMarker&      getEndMarker()      { return m_aEndMarker;       }
getViewsWindow()110cdf0e10cSrcweir         inline OViewsWindow*    getViewsWindow()    { return m_pParent;          }
111cdf0e10cSrcweir 
112cdf0e10cSrcweir         void	setCollapsed(sal_Bool _bCollapsed);
113cdf0e10cSrcweir 
114cdf0e10cSrcweir         /** triggers the property browser with the section
115cdf0e10cSrcweir 			@param	_pStartMarker
116cdf0e10cSrcweir 		*/
117cdf0e10cSrcweir 		void			showProperties();
118cdf0e10cSrcweir 
119cdf0e10cSrcweir         /** set the marker as marked or not marked
120cdf0e10cSrcweir 			@param	_bMark	set the new state of the marker
121cdf0e10cSrcweir 		*/
122cdf0e10cSrcweir 		void	setMarked(sal_Bool _bMark);
123cdf0e10cSrcweir 
getViewsWindow() const124cdf0e10cSrcweir         OViewsWindow* getViewsWindow() const { return m_pParent; }
125cdf0e10cSrcweir 
126cdf0e10cSrcweir         /** zoom the ruler and view windows
127cdf0e10cSrcweir         */
128cdf0e10cSrcweir         void zoom(const Fraction& _aZoom);
129cdf0e10cSrcweir 
130cdf0e10cSrcweir         void scrollChildren(long _nThumbPosX);
131cdf0e10cSrcweir     };
132cdf0e10cSrcweir //==============================================================================
133cdf0e10cSrcweir } // rptui
134cdf0e10cSrcweir //==============================================================================
135cdf0e10cSrcweir #endif // RPTUI_SECTIONWINDOW_HXX
136cdf0e10cSrcweir 
137