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