Use o3tl::convert in Math
[LibreOffice.git] / reportdesign / source / ui / inc / ReportControllerObserver.hxx
blobd77fb3f2ef78fd34e58b93c7c9890bfcb9e9f226
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 .
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_REPORTCONTROLLEROBSERVER_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_REPORTCONTROLLEROBSERVER_HXX
22 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
23 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
24 #include <cppuhelper/implbase.hxx>
26 #include <memory>
28 #include <tools/link.hxx>
30 #include "FormattedFieldBeautifier.hxx"
31 #include "FixedTextColor.hxx"
33 class VclSimpleEvent;
35 namespace rptui
37 class OReportController;
38 class OXReportControllerObserverImpl;
41 class OXReportControllerObserver
42 : public ::cppu::WeakImplHelper< css::beans::XPropertyChangeListener
43 , css::container::XContainerListener
44 , css::util::XModifyListener
48 const ::std::unique_ptr<OXReportControllerObserverImpl> m_pImpl;
50 FormattedFieldBeautifier m_aFormattedFieldBeautifier;
51 FixedTextColor m_aFixedTextColor;
53 // do not allow copy
54 OXReportControllerObserver(const OXReportControllerObserver&) = delete;
55 OXReportControllerObserver& operator=(const OXReportControllerObserver&) = delete;
56 virtual ~OXReportControllerObserver() override; // UNO Object must have private destructor!
57 public:
58 OXReportControllerObserver(const OReportController& _rController);
60 // XPropertyChangeListener
61 virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent& evt) override;
63 // XEventListener
64 virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
66 // XContainerListener
67 virtual void SAL_CALL elementInserted(const css::container::ContainerEvent& rEvent) override;
68 virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent& rEvent) override;
69 virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent& rEvent) override;
71 // XModifyListener
72 virtual void SAL_CALL modified( const css::lang::EventObject& aEvent ) override;
75 void AddElement(const css::uno::Reference< css::uno::XInterface>& Element);
76 void RemoveElement(const css::uno::Reference< css::uno::XInterface>& Element);
78 void AddSection( const css::uno::Reference< css::report::XSection>& _xSection);
79 void RemoveSection( const css::uno::Reference< css::report::XSection>& _xSection );
81 /**
82 Create an object ob OUndoEnvLock locks the undo possibility
83 As long as in the OUndoEnvLock scope, no undo is possible for manipulated object.
85 class OEnvLock
87 OXReportControllerObserver& m_rObserver;
88 public:
89 OEnvLock(OXReportControllerObserver& _rObserver): m_rObserver(_rObserver){m_rObserver.Lock();}
90 ~OEnvLock(){ m_rObserver.UnLock(); }
93 void Lock();
94 void UnLock();
96 void Clear();
97 private:
99 void switchListening( const css::uno::Reference< css::container::XIndexAccess >& _rxContainer, bool _bStartListening );
100 void switchListening( const css::uno::Reference< css::uno::XInterface >& _rxObject, bool _bStartListening );
102 DECL_LINK(SettingsChanged, VclSimpleEvent&, void );
105 } // namespace rptui
107 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_REPORTCONTROLLEROBSERVER_HXX
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */