Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / reportdesign / inc / RptModel.hxx
blob8ee243b8273d475f6d7f917304f70d24ee132ffb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef REPORT_RPTMODEL_HXX
29 #define REPORT_RPTMODEL_HXX
31 #include "dllapi.h"
32 #include <svx/svdmodel.hxx>
33 #include <com/sun/star/report/XReportDefinition.hpp>
36 class Window;
37 namespace dbaui
39 class DBSubComponentController;
41 namespace reportdesign
43 class OReportDefinition;
45 namespace rptui
47 //============================================================================
48 // OReportModel
49 //============================================================================
51 class OReportPage;
52 class OXUndoEnvironment;
54 class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel
56 friend class OReportPage;
58 private:
59 OXUndoEnvironment* m_pUndoEnv;
60 ::dbaui::DBSubComponentController* m_pController;
61 ::reportdesign::OReportDefinition* m_pReportDefinition;
63 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
65 OReportModel( const OReportModel& );
66 void operator=(const OReportModel& rSrcModel);
67 public:
68 TYPEINFO();
70 OReportModel(::reportdesign::OReportDefinition* _pReportDefinition);
71 virtual ~OReportModel();
73 virtual void SetChanged(sal_Bool bFlg = sal_True);
74 virtual SdrPage* AllocPage(bool bMasterPage);
75 virtual Window* GetCurDocViewWin();
76 virtual SdrPage* RemovePage(sal_uInt16 nPgNum);
77 /** returns the numbering type that is used to format page fields in drawing shapes */
78 virtual SvxNumType GetPageNumType() const;
80 OXUndoEnvironment& GetUndoEnv();
81 void SetModified(sal_Bool _bModified);
83 inline dbaui::DBSubComponentController* getController() const { return m_pController; }
84 inline void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; }
85 void detachController();
87 OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
89 /** returns the page which belongs to a section
91 * \param _xSection
92 * \return The page or <NULL/> when t´no page could be found.
94 OReportPage* getPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
96 /// returns the XReportDefinition which the OReportModel belongs to
97 ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >
98 getReportDefinition() const;
100 ::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);
103 #endif
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */