xref: /aoo42x/main/reportdesign/inc/RptPage.hxx (revision 9ee13d13)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _REPORT_RPTUIPAGE_HXX
24 #define _REPORT_RPTUIPAGE_HXX
25 
26 #include "dllapi.h"
27 #include "svx/svdpage.hxx"
28 #include <com/sun/star/report/XReportComponent.hpp>
29 #include <com/sun/star/report/XSection.hpp>
30 
31 namespace rptui
32 {
33 //============================================================================
34 // OReportPage
35 //============================================================================
36 
37 class OReportModel;
38 //class OReportSection;
39 
40 class REPORTDESIGN_DLLPUBLIC OReportPage : public SdrPage
41 {
42 	OReportModel&           rModel;
43     ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > m_xSection;
44     bool                    m_bSpecialInsertMode;
45 	std::vector<SdrObject*> m_aTemporaryObjectList;
46 
47     OReportPage(const OReportPage&);
48 
49     // methode to remove temporary objects, created by 'special mode'
50 	// (BegDragObj)
51 	void removeTempObject(SdrObject *_pToRemoveObj);
52 
53 	virtual ~OReportPage();
54 
55 protected:
56     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
57 public:
58 	TYPEINFO();
59 
60 	OReportPage( OReportModel& rModel
61                 ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
62                 ,FASTBOOL bMasterPage=sal_False );
63 
64 
65 	virtual SdrPage* Clone() const;
66     using SdrPage::Clone;
67 
68     virtual void NbcInsertObject(SdrObject* pObj, sal_uLong nPos, const SdrInsertReason* pReason);
69     virtual SdrObject* RemoveObject(sal_uLong nObjNum);
70 
71 	/** returns the index inside the object list which belongs to the report component.
72 		@param	_xObject	the report component
73 	*/
74 	sal_uLong getIndexOf(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject);
75 
76 	/** removes the SdrObject which belongs to the report component.
77 		@param	_xObject	the report component
78 	*/
79 	void removeSdrObject(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject);
80 
setSpecialMode()81 	void setSpecialMode() {m_bSpecialInsertMode = true;}
getSpecialMode()82     bool getSpecialMode() {return m_bSpecialInsertMode;}
83     // all temporary objects will remove and destroy
84 	void resetSpecialMode();
85 
86 	/** insert a new SdrObject which belongs to the report component.
87 		@param	_xObject	the report component
88 	*/
89 	void insertObject(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject);
90 
91     ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getSection() const;
92 };
93 }
94 #endif //_REPORT_RPTUIPAGE_HXX
95