1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 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. 14 * 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). 20 * 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. 25 * 26 ************************************************************************/ 27 #ifndef REPORT_RPTMODEL_HXX 28 #define REPORT_RPTMODEL_HXX 29 30 #include "dllapi.h" 31 #include <svx/svdmodel.hxx> 32 #include <com/sun/star/report/XReportDefinition.hpp> 33 34 35 class Window; 36 namespace dbaui 37 { 38 class DBSubComponentController; 39 } 40 namespace reportdesign 41 { 42 class OReportDefinition; 43 } 44 namespace rptui 45 { 46 //============================================================================ 47 // OReportModel 48 //============================================================================ 49 50 class OReportPage; 51 class OXUndoEnvironment; 52 53 class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel 54 { 55 friend class OReportPage; 56 57 private: 58 OXUndoEnvironment* m_pUndoEnv; 59 ::dbaui::DBSubComponentController* m_pController; 60 ::reportdesign::OReportDefinition* m_pReportDefinition; 61 62 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel(); 63 64 OReportModel( const OReportModel& ); 65 void operator=(const OReportModel& rSrcModel); 66 public: 67 TYPEINFO(); 68 69 OReportModel(::reportdesign::OReportDefinition* _pReportDefinition); 70 virtual ~OReportModel(); 71 72 virtual void SetChanged(sal_Bool bFlg = sal_True); 73 virtual SdrPage* AllocPage(FASTBOOL bMasterPage); 74 virtual Window* GetCurDocViewWin(); 75 virtual SdrPage* RemovePage(sal_uInt16 nPgNum); 76 /** returns the numbering type that is used to format page fields in drawing shapes */ 77 virtual SvxNumType GetPageNumType() const; 78 79 OXUndoEnvironment& GetUndoEnv(); 80 void SetModified(sal_Bool _bModified); 81 82 inline dbaui::DBSubComponentController* getController() const { return m_pController; } 83 inline void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; } 84 void detachController(); 85 86 OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection); 87 88 /** returns the page which belongs to a section 89 * 90 * \param _xSection 91 * \return The page or <NULL/> when t�no page could be found. 92 */ 93 OReportPage* getPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection); 94 95 /// returns the XReportDefinition which the OReportModel belongs to 96 ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > 97 getReportDefinition() const; 98 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); 100 }; 101 } 102 #endif 103 104