RptModel.hxx 3.25 KB
Newer Older
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */
19

20 21
#ifndef INCLUDED_REPORTDESIGN_INC_RPTMODEL_HXX
#define INCLUDED_REPORTDESIGN_INC_RPTMODEL_HXX
22 23

#include "dllapi.h"
Rüdiger Timm's avatar
Rüdiger Timm committed
24 25
#include <svx/svdmodel.hxx>
#include <com/sun/star/report/XReportDefinition.hpp>
26

Noel Grandin's avatar
Noel Grandin committed
27
namespace vcl { class Window; }
Rüdiger Timm's avatar
Rüdiger Timm committed
28 29
namespace dbaui
{
30
    class DBSubComponentController;
Rüdiger Timm's avatar
Rüdiger Timm committed
31
}
32 33 34 35
namespace reportdesign
{
    class OReportDefinition;
}
Rüdiger Timm's avatar
Rüdiger Timm committed
36 37 38 39 40 41 42 43 44 45
namespace rptui
{
class OReportPage;
class OXUndoEnvironment;

class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel
{
    friend class OReportPage;

private:
46
    rtl::Reference<OXUndoEnvironment>   m_xUndoEnv;
47
    ::dbaui::DBSubComponentController*  m_pController;
48 49
    ::reportdesign::OReportDefinition*  m_pReportDefinition;

50
    virtual css::uno::Reference< css::uno::XInterface > createUnoModel() override;
Rüdiger Timm's avatar
Rüdiger Timm committed
51

52 53
    OReportModel( const OReportModel& ) = delete;
    void operator=(const OReportModel& rSrcModel) = delete;
54

Rüdiger Timm's avatar
Rüdiger Timm committed
55 56
public:

57
    OReportModel(::reportdesign::OReportDefinition* _pReportDefinition);
58
    virtual ~OReportModel() override;
Rüdiger Timm's avatar
Rüdiger Timm committed
59

60 61 62
    virtual void        SetChanged(bool bFlg = true) override;
    virtual SdrPage*    AllocPage(bool bMasterPage) override;
    virtual SdrPage*    RemovePage(sal_uInt16 nPgNum) override;
Philipp Riemer's avatar
Philipp Riemer committed
63
    /** @returns the numbering type that is used to format page fields in drawing shapes */
64
    virtual SvxNumType  GetPageNumType() const override;
Rüdiger Timm's avatar
Rüdiger Timm committed
65

66
    OXUndoEnvironment&  GetUndoEnv() { return *m_xUndoEnv.get();}
67
    void                SetModified(bool _bModified);
Rüdiger Timm's avatar
Rüdiger Timm committed
68

69 70
    dbaui::DBSubComponentController* getController() const { return m_pController; }
    void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; }
Rüdiger Timm's avatar
Rüdiger Timm committed
71 72
    void detachController();

73
    OReportPage* createNewPage(const css::uno::Reference< css::report::XSection >& _xSection);
Rüdiger Timm's avatar
Rüdiger Timm committed
74 75 76

    /** returns the page which belongs to a section
    *
Philipp Riemer's avatar
Philipp Riemer committed
77 78
    * @param _xSection
    * @return The page or <NULL/> when no page could be found.
Rüdiger Timm's avatar
Rüdiger Timm committed
79
    */
80
    OReportPage* getPage(const css::uno::Reference< css::report::XSection >& _xSection);
Rüdiger Timm's avatar
Rüdiger Timm committed
81 82

    /// returns the XReportDefinition which the OReportModel belongs to
83
    css::uno::Reference< css::report::XReportDefinition >
Rüdiger Timm's avatar
Rüdiger Timm committed
84
                getReportDefinition() const;
85

86
    css::uno::Reference< css::uno::XInterface > createShape(const OUString& aServiceSpecifier,css::uno::Reference< css::drawing::XShape >& _rShape,sal_Int32 nOrientation = -1);
Rüdiger Timm's avatar
Rüdiger Timm committed
87 88
};
}
89

Rüdiger Timm's avatar
Rüdiger Timm committed
90 91
#endif

92
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */