tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / reportdesign / inc / RptModel.hxx
blob5f5c84a033d60a8aa81bd7776f0b289846216bdc
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 dbaui
29 class DBSubComponentController;
31 namespace reportdesign
33 class OReportDefinition;
35 namespace rptui
37 class OReportPage;
38 class OXUndoEnvironment;
40 class UNLESS_MERGELIBS_MORE(REPORTDESIGN_DLLPUBLIC) OReportModel final : public SdrModel
42 friend class OReportPage;
44 private:
45 rtl::Reference<OXUndoEnvironment> m_xUndoEnv;
46 ::dbaui::DBSubComponentController* m_pController;
47 ::reportdesign::OReportDefinition* m_pReportDefinition;
49 virtual css::uno::Reference< css::frame::XModel > createUnoModel() override;
51 OReportModel( const OReportModel& ) = delete;
52 void operator=(const OReportModel& rSrcModel) = delete;
54 public:
56 OReportModel(::reportdesign::OReportDefinition* _pReportDefinition);
57 virtual ~OReportModel() override;
59 virtual void SetChanged(bool bFlg = true) override;
60 virtual rtl::Reference<SdrPage> AllocPage(bool bMasterPage) override;
61 virtual rtl::Reference<SdrPage> RemovePage(sal_uInt16 nPgNum) override;
62 /** @returns the numbering type that is used to format page fields in drawing shapes */
63 virtual SvxNumType GetPageNumType() const override;
65 OXUndoEnvironment& GetUndoEnv() { return *m_xUndoEnv;}
66 void SetModified(bool _bModified);
68 dbaui::DBSubComponentController* getController() const { return m_pController; }
69 void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; }
70 void detachController();
72 OReportPage* createNewPage(const css::uno::Reference< css::report::XSection >& _xSection);
74 /** returns the page which belongs to a section
76 * @param _xSection
77 * @return The page or <NULL/> when no page could be found.
79 OReportPage* getPage(const css::uno::Reference< css::report::XSection >& _xSection);
81 /// returns the XReportDefinition which the OReportModel belongs to
82 css::uno::Reference< css::report::XReportDefinition >
83 getReportDefinition() const;
85 css::uno::Reference< css::uno::XInterface > createShape(const OUString& aServiceSpecifier,css::uno::Reference< css::drawing::XShape >& _rShape,sal_Int32 nOrientation = -1);
89 #endif
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */