24#include <com/sun/star/frame/XModel.hpp>
25#include <com/sun/star/lang/DisposedException.hpp>
26#include <com/sun/star/lang/NoSupportException.hpp>
30#include <officecfg/Office/Common.hxx>
36 using ::com::sun::star::uno::Reference;
37 using ::com::sun::star::uno::XInterface;
38 using ::com::sun::star::uno::UNO_QUERY;
39 using ::com::sun::star::uno::Sequence;
40 using ::com::sun::star::lang::DisposedException;
41 using ::com::sun::star::document::XUndoManager;
42 using ::com::sun::star::document::XUndoAction;
43 using ::com::sun::star::document::XUndoManagerListener;
44 using ::com::sun::star::lang::NoSupportException;
45 using ::com::sun::star::util::XModifyListener;
46 using ::com::sun::star::frame::XModel;
61 officecfg::Office::Common::Undo::Steps::get());
113 ::osl::MutexGuard aGuard(
m_rMutex );
122 throw DisposedException( OUString(),
getThis() );
139 ::osl::MutexGuard aGuard( i_impl.
getMutex() );
143 virtual ~UndoManagerMethodGuard()
148 virtual void clear()
override;
149 virtual ::framework::IMutex& getGuardedMutex()
override;
155 virtual ~DummyMutex() {}
156 virtual void acquire()
override { }
157 virtual void release()
override { }
164 static DummyMutex s_aDummyMutex;
165 return s_aDummyMutex;
168 void UndoManagerMethodGuard::clear()
174 using impl::UndoManagerMethodGuard;
177 :
m_pImpl( new
impl::UndoManager_Impl( *this, i_parent, i_mutex ) )
187 m_pImpl->getParent().acquire();
192 m_pImpl->getParent().release();
202 UndoManagerMethodGuard aGuard( *
m_pImpl );
203 m_pImpl->getUndoHelper().enterUndoContext( i_title, aGuard );
208 UndoManagerMethodGuard aGuard( *
m_pImpl );
209 m_pImpl->getUndoHelper().enterHiddenUndoContext( aGuard );
214 UndoManagerMethodGuard aGuard( *
m_pImpl );
215 m_pImpl->getUndoHelper().leaveUndoContext( aGuard );
220 UndoManagerMethodGuard aGuard( *
m_pImpl );
221 m_pImpl->getUndoHelper().addUndoAction( i_action, aGuard );
226 UndoManagerMethodGuard aGuard( *
m_pImpl );
227 m_pImpl->getUndoHelper().undo( aGuard );
234 UndoManagerMethodGuard aGuard( *
m_pImpl );
235 m_pImpl->getUndoHelper().redo( aGuard );
242 UndoManagerMethodGuard aGuard( *
m_pImpl );
243 return m_pImpl->getUndoHelper().isUndoPossible();
248 UndoManagerMethodGuard aGuard( *
m_pImpl );
249 return m_pImpl->getUndoHelper().isRedoPossible();
254 UndoManagerMethodGuard aGuard( *
m_pImpl );
255 return m_pImpl->getUndoHelper().getCurrentUndoActionTitle();
260 UndoManagerMethodGuard aGuard( *
m_pImpl );
261 return m_pImpl->getUndoHelper().getCurrentRedoActionTitle();
266 UndoManagerMethodGuard aGuard( *
m_pImpl );
267 return m_pImpl->getUndoHelper().getAllUndoActionTitles();
272 UndoManagerMethodGuard aGuard( *
m_pImpl );
273 return m_pImpl->getUndoHelper().getAllRedoActionTitles();
278 UndoManagerMethodGuard aGuard( *
m_pImpl );
279 m_pImpl->getUndoHelper().clear( aGuard );
284 UndoManagerMethodGuard aGuard( *
m_pImpl );
285 m_pImpl->getUndoHelper().clearRedo( aGuard );
290 UndoManagerMethodGuard aGuard( *
m_pImpl );
291 m_pImpl->getUndoHelper().reset( aGuard );
296 UndoManagerMethodGuard aGuard( *
m_pImpl );
297 m_pImpl->getUndoHelper().addUndoManagerListener( i_listener );
302 UndoManagerMethodGuard aGuard( *
m_pImpl );
303 m_pImpl->getUndoHelper().removeUndoManagerListener( i_listener );
308 UndoManagerMethodGuard aGuard( *
m_pImpl );
309 m_pImpl->getUndoHelper().lock();
314 UndoManagerMethodGuard aGuard( *
m_pImpl );
315 m_pImpl->getUndoHelper().unlock();
320 UndoManagerMethodGuard aGuard( *
m_pImpl );
321 return m_pImpl->getUndoHelper().isLocked();
326 UndoManagerMethodGuard aGuard( *
m_pImpl );
332 UndoManagerMethodGuard aGuard( *
m_pImpl );
333 throw NoSupportException( OUString(),
m_pImpl->getThis() );
338 UndoManagerMethodGuard aGuard( *
m_pImpl );
339 m_pImpl->getUndoHelper().addModifyListener( i_listener );
344 UndoManagerMethodGuard aGuard( *
m_pImpl );
345 m_pImpl->getUndoHelper().removeModifyListener( i_listener );
void SetMaxUndoActionCount(size_t nMaxUndoActionCount)
static void setViewToDirtyState(const rtl::Reference<::chart::ChartModel > &xChartModel)
virtual void SAL_CALL redo() override
virtual css::uno::Sequence< OUString > SAL_CALL getAllUndoActionTitles() override
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual void SAL_CALL lock() override
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
virtual sal_Bool SAL_CALL isLocked() override
virtual void SAL_CALL unlock() override
virtual sal_Bool SAL_CALL isUndoPossible() override
virtual void SAL_CALL addUndoAction(const css::uno::Reference< css::document::XUndoAction > &i_action) override
virtual sal_Bool SAL_CALL isRedoPossible() override
virtual OUString SAL_CALL getCurrentUndoActionTitle() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
virtual void SAL_CALL clearRedo() override
virtual void SAL_CALL addUndoManagerListener(const css::uno::Reference< css::document::XUndoManagerListener > &i_listener) override
virtual OUString SAL_CALL getCurrentRedoActionTitle() override
virtual void SAL_CALL enterHiddenUndoContext() override
virtual void SAL_CALL leaveUndoContext() override
virtual void SAL_CALL removeUndoManagerListener(const css::uno::Reference< css::document::XUndoManagerListener > &i_listener) override
virtual void SAL_CALL reset() override
virtual void SAL_CALL acquire() noexcept override
virtual void SAL_CALL enterUndoContext(const OUString &i_title) override
UndoManager(::chart::ChartModel &i_parent, ::osl::Mutex &i_mutex)
virtual void SAL_CALL clear() override
virtual void SAL_CALL undo() override
virtual css::uno::Sequence< OUString > SAL_CALL getAllRedoActionTitles() override
std::unique_ptr< impl::UndoManager_Impl > m_pImpl
virtual SfxUndoManager & getImplUndoManager() override
virtual Reference< XUndoManager > getThis() override
void disposing()
is called when the owner of the UndoManager is being disposed
void checkDisposed_lck()
checks whether we're already disposed, throws a DisposedException if so
::chart::ChartModel & getParent()
virtual ~UndoManager_Impl()
UndoManager & m_rAntiImpl
::chart::ChartModel & m_rParent
::framework::UndoManagerHelper m_aUndoHelper
::framework::UndoManagerHelper & getUndoHelper()
SfxUndoManager m_aUndoManager
::osl::Mutex & getMutex()
UndoManager_Impl(UndoManager &i_antiImpl, ::chart::ChartModel &i_parent, ::osl::Mutex &i_mutex)