1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: UndoEnv.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef INCLUDED_REPORTCONTROLLEROBSERVER_HXX
31 #define INCLUDED_REPORTCONTROLLEROBSERVER_HXX
33 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
34 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
35 #include <com/sun/star/report/XReportDefinition.hpp>
36 #include <cppuhelper/implbase3.hxx>
42 // #include <svtools/lstner.hxx>
43 #include <vcl/svapp.hxx>
44 #include <tools/link.hxx>
46 #include <FormattedFieldBeautifier.hxx>
47 #include <FixedTextColor.hxx>
51 class OReportController
;
52 class OXReportControllerObserverImpl
;
54 //========================================================================
55 class /* REPORTDESIGN_DLLPUBLIC */ OXReportControllerObserver
56 : public ::cppu::WeakImplHelper3
< ::com::sun::star::beans::XPropertyChangeListener
57 , ::com::sun::star::container::XContainerListener
58 , ::com::sun::star::util::XModifyListener
60 /*,public SfxListener*/
63 const ::std::auto_ptr
<OXReportControllerObserverImpl
> m_pImpl
;
65 FormattedFieldBeautifier m_aFormattedFieldBeautifier
;
66 FixedTextColor m_aFixedTextColor
;
69 OXReportControllerObserver(const OXReportControllerObserver
&);
70 OXReportControllerObserver
& operator=(const OXReportControllerObserver
&);
74 void switchListening(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rxObject
, sal_Bool _bStartListening
);
76 virtual ~OXReportControllerObserver(); // UNO Object must have private destructor!
78 OXReportControllerObserver(const OReportController
& _rController
);
81 // XPropertyChangeListener
82 virtual void SAL_CALL
propertyChange(const ::com::sun::star::beans::PropertyChangeEvent
& evt
) throw(::com::sun::star::uno::RuntimeException
);
85 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw( ::com::sun::star::uno::RuntimeException
);
88 virtual void SAL_CALL
elementInserted(const ::com::sun::star::container::ContainerEvent
& rEvent
) throw(::com::sun::star::uno::RuntimeException
);
89 virtual void SAL_CALL
elementReplaced(const ::com::sun::star::container::ContainerEvent
& rEvent
) throw(::com::sun::star::uno::RuntimeException
);
90 virtual void SAL_CALL
elementRemoved(const ::com::sun::star::container::ContainerEvent
& rEvent
) throw(::com::sun::star::uno::RuntimeException
);
93 virtual void SAL_CALL
modified( const ::com::sun::star::lang::EventObject
& aEvent
) throw (::com::sun::star::uno::RuntimeException
);
96 void AddElement(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& Element
);
97 void RemoveElement(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& Element
);
99 void AddSection( const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XSection
>& _xSection
);
100 void RemoveSection( const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XSection
>& _xSection
);
103 // virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
106 Create an object ob OUndoEnvLock locks the undo possibility
107 As long as in the OUndoEnvLock scope, no undo is possible for manipulated object.
111 OXReportControllerObserver
& m_rObserver
;
113 OEnvLock(OXReportControllerObserver
& _rObserver
): m_rObserver(_rObserver
){m_rObserver
.Lock();}
114 ~OEnvLock(){ m_rObserver
.UnLock(); }
119 sal_Bool
IsLocked() const;
124 void TogglePropertyListening(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& Element
);
125 void switchListening( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
>& _rxContainer
, bool _bStartListening
) SAL_THROW(());
126 void switchListening( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rxObject
, bool _bStartListening
) SAL_THROW(());
128 // void ModeChanged(); // will be called from 'Notify'
129 DECL_LINK(SettingsChanged
, VclWindowEvent
* );
132 ::std::vector
< ::com::sun::star::uno::Reference
< ::com::sun::star::container::XChild
> >::const_iterator
getSection(const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XChild
>& _xContainer
) const;
138 #endif /* INCLUDED_REPORTCONTROLLEROBSERVER_HXX */