Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef REPORT_RPTMODEL_HXX
20 : #define REPORT_RPTMODEL_HXX
21 :
22 : #include "dllapi.h"
23 : #include <svx/svdmodel.hxx>
24 : #include <com/sun/star/report/XReportDefinition.hpp>
25 :
26 :
27 : class Window;
28 : namespace dbaui
29 : {
30 : class DBSubComponentController;
31 : }
32 : namespace reportdesign
33 : {
34 : class OReportDefinition;
35 : }
36 : namespace rptui
37 : {
38 : //============================================================================
39 : // OReportModel
40 : //============================================================================
41 :
42 : class OReportPage;
43 : class OXUndoEnvironment;
44 :
45 : class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel
46 : {
47 : friend class OReportPage;
48 :
49 : private:
50 : OXUndoEnvironment* m_pUndoEnv;
51 : ::dbaui::DBSubComponentController* m_pController;
52 : ::reportdesign::OReportDefinition* m_pReportDefinition;
53 :
54 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
55 :
56 : OReportModel( const OReportModel& );
57 : void operator=(const OReportModel& rSrcModel);
58 : public:
59 : TYPEINFO();
60 :
61 : OReportModel(::reportdesign::OReportDefinition* _pReportDefinition);
62 : virtual ~OReportModel();
63 :
64 : virtual void SetChanged(sal_Bool bFlg = sal_True);
65 : virtual SdrPage* AllocPage(bool bMasterPage);
66 : virtual Window* GetCurDocViewWin();
67 : virtual SdrPage* RemovePage(sal_uInt16 nPgNum);
68 : /** returns the numbering type that is used to format page fields in drawing shapes */
69 : virtual SvxNumType GetPageNumType() const;
70 :
71 : OXUndoEnvironment& GetUndoEnv();
72 : void SetModified(sal_Bool _bModified);
73 :
74 0 : inline dbaui::DBSubComponentController* getController() const { return m_pController; }
75 0 : inline void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; }
76 : void detachController();
77 :
78 : OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
79 :
80 : /** returns the page which belongs to a section
81 : *
82 : * \param _xSection
83 : * \return The page or <NULL/> when tīno page could be found.
84 : */
85 : OReportPage* getPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
86 :
87 : /// returns the XReportDefinition which the OReportModel belongs to
88 : ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >
89 : getReportDefinition() const;
90 :
91 : ::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);
92 : };
93 : }
94 : #endif
95 :
96 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|