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 10cdf0e10cSrcweir * 11*9ee13d13SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 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. 19cdf0e10cSrcweir * 20*9ee13d13SAndrew Rist *************************************************************/ 21*9ee13d13SAndrew Rist 22*9ee13d13SAndrew Rist 23cdf0e10cSrcweir #ifndef REPORT_RPTMODEL_HXX 24cdf0e10cSrcweir #define REPORT_RPTMODEL_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include "dllapi.h" 27cdf0e10cSrcweir #include <svx/svdmodel.hxx> 28cdf0e10cSrcweir #include <com/sun/star/report/XReportDefinition.hpp> 29cdf0e10cSrcweir 30cdf0e10cSrcweir 31cdf0e10cSrcweir class Window; 32cdf0e10cSrcweir namespace dbaui 33cdf0e10cSrcweir { 34cdf0e10cSrcweir class DBSubComponentController; 35cdf0e10cSrcweir } 36cdf0e10cSrcweir namespace reportdesign 37cdf0e10cSrcweir { 38cdf0e10cSrcweir class OReportDefinition; 39cdf0e10cSrcweir } 40cdf0e10cSrcweir namespace rptui 41cdf0e10cSrcweir { 42cdf0e10cSrcweir //============================================================================ 43cdf0e10cSrcweir // OReportModel 44cdf0e10cSrcweir //============================================================================ 45cdf0e10cSrcweir 46cdf0e10cSrcweir class OReportPage; 47cdf0e10cSrcweir class OXUndoEnvironment; 48cdf0e10cSrcweir 49cdf0e10cSrcweir class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel 50cdf0e10cSrcweir { 51cdf0e10cSrcweir friend class OReportPage; 52cdf0e10cSrcweir 53cdf0e10cSrcweir private: 54cdf0e10cSrcweir OXUndoEnvironment* m_pUndoEnv; 55cdf0e10cSrcweir ::dbaui::DBSubComponentController* m_pController; 56cdf0e10cSrcweir ::reportdesign::OReportDefinition* m_pReportDefinition; 57cdf0e10cSrcweir 58cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel(); 59cdf0e10cSrcweir 60cdf0e10cSrcweir OReportModel( const OReportModel& ); 61cdf0e10cSrcweir void operator=(const OReportModel& rSrcModel); 62cdf0e10cSrcweir public: 63cdf0e10cSrcweir TYPEINFO(); 64cdf0e10cSrcweir 65cdf0e10cSrcweir OReportModel(::reportdesign::OReportDefinition* _pReportDefinition); 66cdf0e10cSrcweir virtual ~OReportModel(); 67cdf0e10cSrcweir 68cdf0e10cSrcweir virtual void SetChanged(sal_Bool bFlg = sal_True); 69cdf0e10cSrcweir virtual SdrPage* AllocPage(FASTBOOL bMasterPage); 70cdf0e10cSrcweir virtual Window* GetCurDocViewWin(); 71cdf0e10cSrcweir virtual SdrPage* RemovePage(sal_uInt16 nPgNum); 72cdf0e10cSrcweir /** returns the numbering type that is used to format page fields in drawing shapes */ 73cdf0e10cSrcweir virtual SvxNumType GetPageNumType() const; 74cdf0e10cSrcweir 75cdf0e10cSrcweir OXUndoEnvironment& GetUndoEnv(); 76cdf0e10cSrcweir void SetModified(sal_Bool _bModified); 77cdf0e10cSrcweir getController() const78cdf0e10cSrcweir inline dbaui::DBSubComponentController* getController() const { return m_pController; } attachController(dbaui::DBSubComponentController & _rController)79cdf0e10cSrcweir inline void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; } 80cdf0e10cSrcweir void detachController(); 81cdf0e10cSrcweir 82cdf0e10cSrcweir OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection); 83cdf0e10cSrcweir 84cdf0e10cSrcweir /** returns the page which belongs to a section 85cdf0e10cSrcweir * 86cdf0e10cSrcweir * \param _xSection 87cdf0e10cSrcweir * \return The page or <NULL/> when t�no page could be found. 88cdf0e10cSrcweir */ 89cdf0e10cSrcweir OReportPage* getPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection); 90cdf0e10cSrcweir 91cdf0e10cSrcweir /// returns the XReportDefinition which the OReportModel belongs to 92cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > 93cdf0e10cSrcweir getReportDefinition() const; 94cdf0e10cSrcweir 95cdf0e10cSrcweir ::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); 96cdf0e10cSrcweir }; 97cdf0e10cSrcweir } 98cdf0e10cSrcweir #endif 99cdf0e10cSrcweir 100