1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef REPORT_RPTMODEL_HXX
28 #define REPORT_RPTMODEL_HXX
31 #include <svx/svdmodel.hxx>
32 #include <com/sun/star/report/XReportDefinition.hpp>
38 class OSingleDocumentController
;
40 namespace reportdesign
42 class OReportDefinition
;
46 //============================================================================
48 //============================================================================
51 class OXUndoEnvironment
;
53 class REPORTDESIGN_DLLPUBLIC OReportModel
: public SdrModel
55 friend class OReportPage
;
58 OXUndoEnvironment
* m_pUndoEnv
;
59 ::dbaui::OSingleDocumentController
* m_pController
;
60 ::reportdesign::OReportDefinition
* m_pReportDefinition
;
62 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> createUnoModel();
64 OReportModel( const OReportModel
& );
65 void operator=(const OReportModel
& rSrcModel
);
69 OReportModel(::reportdesign::OReportDefinition
* _pReportDefinition
);
70 virtual ~OReportModel();
72 virtual void SetChanged(sal_Bool bFlg
= sal_True
);
73 virtual SdrPage
* AllocPage(FASTBOOL bMasterPage
);
74 virtual Window
* GetCurDocViewWin();
75 virtual SdrPage
* RemovePage(USHORT nPgNum
);
76 /** returns the numbering type that is used to format page fields in drawing shapes */
77 virtual SvxNumType
GetPageNumType() const;
79 OXUndoEnvironment
& GetUndoEnv();
80 void SetModified(sal_Bool _bModified
);
82 inline dbaui::OSingleDocumentController
* getController() const { return m_pController
; }
83 inline void attachController( dbaui::OSingleDocumentController
& _rController
) { m_pController
= &_rController
; }
84 void detachController();
86 OReportPage
* createNewPage(const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XSection
>& _xSection
);
88 /** returns the page which belongs to a section
91 * \return The page or <NULL/> when t´no page could be found.
93 OReportPage
* getPage(const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XSection
>& _xSection
);
95 /// returns the XReportDefinition which the OReportModel belongs to
96 ::com::sun::star::uno::Reference
< ::com::sun::star::report::XReportDefinition
>
97 getReportDefinition() const;
99 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> createShape(const ::rtl::OUString
& aServiceSpecifier
,::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& _rShape
,sal_Int32 nOrientation
= -1);