update dev300-m58
[ooovba.git] / reportdesign / inc / RptModel.hxx
blob9df615e0c8852accf6c3e21dd9b3296407dc1f78
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: RptModel.hxx,v $
10 * $Revision: 1.4 $
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 REPORT_RPTMODEL_HXX
31 #define REPORT_RPTMODEL_HXX
33 #include "dllapi.h"
34 #include <svx/svdmodel.hxx>
35 #include <com/sun/star/report/XReportDefinition.hpp>
38 class Window;
39 namespace dbaui
41 class OSingleDocumentController;
43 namespace reportdesign
45 class OReportDefinition;
47 namespace rptui
49 //============================================================================
50 // OReportModel
51 //============================================================================
53 class OReportPage;
54 class OXUndoEnvironment;
56 class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel
58 friend class OReportPage;
60 private:
61 OXUndoEnvironment* m_pUndoEnv;
62 ::dbaui::OSingleDocumentController* m_pController;
63 ::reportdesign::OReportDefinition* m_pReportDefinition;
65 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
67 OReportModel( const OReportModel& );
68 void operator=(const OReportModel& rSrcModel);
69 public:
70 TYPEINFO();
72 OReportModel(::reportdesign::OReportDefinition* _pReportDefinition);
73 virtual ~OReportModel();
75 virtual void SetChanged(sal_Bool bFlg = sal_True);
76 virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
77 virtual Window* GetCurDocViewWin();
78 virtual SdrPage* RemovePage(USHORT nPgNum);
79 /** returns the numbering type that is used to format page fields in drawing shapes */
80 virtual SvxNumType GetPageNumType() const;
82 OXUndoEnvironment& GetUndoEnv();
83 void SetModified(sal_Bool _bModified);
85 inline dbaui::OSingleDocumentController* getController() const { return m_pController; }
86 inline void attachController( dbaui::OSingleDocumentController& _rController ) { m_pController = &_rController; }
87 void detachController();
89 OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
91 /** returns the page which belongs to a section
93 * \param _xSection
94 * \return The page or <NULL/> when t´no page could be found.
96 OReportPage* getPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
98 /// returns the XReportDefinition which the OReportModel belongs to
99 ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >
100 getReportDefinition() const;
102 ::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);
105 #endif