Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / reportdesign / inc / RptModel.hxx
blob6085e717c0747d28ebe6726f4d0076b14dac21c3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_REPORTDESIGN_INC_RPTMODEL_HXX
21 #define INCLUDED_REPORTDESIGN_INC_RPTMODEL_HXX
23 #include "dllapi.h"
24 #include <svx/svdmodel.hxx>
25 #include <com/sun/star/report/XReportDefinition.hpp>
27 namespace vcl { class Window; }
28 namespace dbaui
30 class DBSubComponentController;
32 namespace reportdesign
34 class OReportDefinition;
36 namespace rptui
38 class OReportPage;
39 class OXUndoEnvironment;
41 class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel
43 friend class OReportPage;
45 private:
46 rtl::Reference<OXUndoEnvironment> m_xUndoEnv;
47 ::dbaui::DBSubComponentController* m_pController;
48 ::reportdesign::OReportDefinition* m_pReportDefinition;
50 virtual css::uno::Reference< css::uno::XInterface > createUnoModel() override;
52 OReportModel( const OReportModel& ) = delete;
53 void operator=(const OReportModel& rSrcModel) = delete;
55 public:
57 OReportModel(::reportdesign::OReportDefinition* _pReportDefinition);
58 virtual ~OReportModel() override;
60 virtual void SetChanged(bool bFlg = true) override;
61 virtual SdrPage* AllocPage(bool bMasterPage) override;
62 virtual SdrPage* RemovePage(sal_uInt16 nPgNum) override;
63 /** @returns the numbering type that is used to format page fields in drawing shapes */
64 virtual SvxNumType GetPageNumType() const override;
66 OXUndoEnvironment& GetUndoEnv() { return *m_xUndoEnv.get();}
67 void SetModified(bool _bModified);
69 dbaui::DBSubComponentController* getController() const { return m_pController; }
70 void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; }
71 void detachController();
73 OReportPage* createNewPage(const css::uno::Reference< css::report::XSection >& _xSection);
75 /** returns the page which belongs to a section
77 * @param _xSection
78 * @return The page or <NULL/> when no page could be found.
80 OReportPage* getPage(const css::uno::Reference< css::report::XSection >& _xSection);
82 /// returns the XReportDefinition which the OReportModel belongs to
83 css::uno::Reference< css::report::XReportDefinition >
84 getReportDefinition() const;
86 css::uno::Reference< css::uno::XInterface > createShape(const OUString& aServiceSpecifier,css::uno::Reference< css::drawing::XShape >& _rShape,sal_Int32 nOrientation = -1);
90 #endif
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */