bump product version to 5.0.4.1
[LibreOffice.git] / reportdesign / inc / RptModel.hxx
blobd3a606240033524bef6989a0cc921b1624275e92
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 OXUndoEnvironment* m_pUndoEnv;
47 ::dbaui::DBSubComponentController* m_pController;
48 ::reportdesign::OReportDefinition* m_pReportDefinition;
50 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel() SAL_OVERRIDE;
52 OReportModel( const OReportModel& ) SAL_DELETED_FUNCTION;
53 void operator=(const OReportModel& rSrcModel) SAL_DELETED_FUNCTION;
55 public:
56 TYPEINFO_OVERRIDE();
58 OReportModel(::reportdesign::OReportDefinition* _pReportDefinition);
59 virtual ~OReportModel();
61 virtual void SetChanged(bool bFlg = true) SAL_OVERRIDE;
62 virtual SdrPage* AllocPage(bool bMasterPage) SAL_OVERRIDE;
63 virtual SdrPage* RemovePage(sal_uInt16 nPgNum) SAL_OVERRIDE;
64 /** @returns the numbering type that is used to format page fields in drawing shapes */
65 virtual SvxNumType GetPageNumType() const SAL_OVERRIDE;
67 OXUndoEnvironment& GetUndoEnv() { return *m_pUndoEnv;}
68 void SetModified(bool _bModified);
70 inline dbaui::DBSubComponentController* getController() const { return m_pController; }
71 inline void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; }
72 void detachController();
74 OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
76 /** returns the page which belongs to a section
78 * @param _xSection
79 * @return The page or <NULL/> when no page could be found.
81 OReportPage* getPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
83 /// returns the XReportDefinition which the OReportModel belongs to
84 ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >
85 getReportDefinition() const;
87 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createShape(const OUString& aServiceSpecifier,::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _rShape,sal_Int32 nOrientation = -1);
91 #endif
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */