Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
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.
15 : : *
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).
21 : : *
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.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef REPORT_RPTMODEL_HXX
29 : : #define REPORT_RPTMODEL_HXX
30 : :
31 : : #include "dllapi.h"
32 : : #include <svx/svdmodel.hxx>
33 : : #include <com/sun/star/report/XReportDefinition.hpp>
34 : :
35 : :
36 : : class Window;
37 : : namespace dbaui
38 : : {
39 : : class DBSubComponentController;
40 : : }
41 : : namespace reportdesign
42 : : {
43 : : class OReportDefinition;
44 : : }
45 : : namespace rptui
46 : : {
47 : : //============================================================================
48 : : // OReportModel
49 : : //============================================================================
50 : :
51 : : class OReportPage;
52 : : class OXUndoEnvironment;
53 : :
54 : : class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel
55 : : {
56 : : friend class OReportPage;
57 : :
58 : : private:
59 : : OXUndoEnvironment* m_pUndoEnv;
60 : : ::dbaui::DBSubComponentController* m_pController;
61 : : ::reportdesign::OReportDefinition* m_pReportDefinition;
62 : :
63 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
64 : :
65 : : OReportModel( const OReportModel& );
66 : : void operator=(const OReportModel& rSrcModel);
67 : : public:
68 : : TYPEINFO();
69 : :
70 : : OReportModel(::reportdesign::OReportDefinition* _pReportDefinition);
71 : : virtual ~OReportModel();
72 : :
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;
79 : :
80 : : OXUndoEnvironment& GetUndoEnv();
81 : : void SetModified(sal_Bool _bModified);
82 : :
83 : 0 : inline dbaui::DBSubComponentController* getController() const { return m_pController; }
84 : 0 : inline void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; }
85 : : void detachController();
86 : :
87 : : OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
88 : :
89 : : /** returns the page which belongs to a section
90 : : *
91 : : * \param _xSection
92 : : * \return The page or <NULL/> when tīno page could be found.
93 : : */
94 : : OReportPage* getPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
95 : :
96 : : /// returns the XReportDefinition which the OReportModel belongs to
97 : : ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >
98 : : getReportDefinition() const;
99 : :
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);
101 : : };
102 : : }
103 : : #endif
104 : :
105 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|