196de5490SAndrew Rist /**************************************************************
296de5490SAndrew Rist  *
396de5490SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
496de5490SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
596de5490SAndrew Rist  * distributed with this work for additional information
696de5490SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
796de5490SAndrew Rist  * to you under the Apache License, Version 2.0 (the
896de5490SAndrew Rist  * "License"); you may not use this file except in compliance
996de5490SAndrew Rist  * with the License.  You may obtain a copy of the License at
1096de5490SAndrew Rist  *
1196de5490SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1296de5490SAndrew Rist  *
1396de5490SAndrew Rist  * Unless required by applicable law or agreed to in writing,
1496de5490SAndrew Rist  * software distributed under the License is distributed on an
1596de5490SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1696de5490SAndrew Rist  * KIND, either express or implied.  See the License for the
1796de5490SAndrew Rist  * specific language governing permissions and limitations
1896de5490SAndrew Rist  * under the License.
1996de5490SAndrew Rist  *
2096de5490SAndrew Rist  *************************************************************/
2196de5490SAndrew Rist 
2296de5490SAndrew Rist 
23cdf0e10cSrcweir 
24*b63233d8Sdamjan #include "precompiled_dbui.hxx"
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "dbaundomanager.hxx"
27cdf0e10cSrcweir 
28cdf0e10cSrcweir /** === begin UNO includes === **/
29cdf0e10cSrcweir #include <com/sun/star/lang/DisposedException.hpp>
30cdf0e10cSrcweir /** === end UNO includes === **/
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <svl/undo.hxx>
33cdf0e10cSrcweir #include <vcl/svapp.hxx>
34cdf0e10cSrcweir #include <vos/mutex.hxx>
35cdf0e10cSrcweir #include <framework/undomanagerhelper.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //......................................................................................................................
38cdf0e10cSrcweir namespace dbaui
39cdf0e10cSrcweir {
40cdf0e10cSrcweir //......................................................................................................................
41cdf0e10cSrcweir 
42cdf0e10cSrcweir 	/** === begin UNO using === **/
43cdf0e10cSrcweir 	using ::com::sun::star::uno::Reference;
44cdf0e10cSrcweir 	using ::com::sun::star::uno::XInterface;
45cdf0e10cSrcweir 	using ::com::sun::star::uno::UNO_QUERY;
46cdf0e10cSrcweir 	using ::com::sun::star::uno::UNO_QUERY_THROW;
47cdf0e10cSrcweir 	using ::com::sun::star::uno::UNO_SET_THROW;
48cdf0e10cSrcweir 	using ::com::sun::star::uno::Exception;
49cdf0e10cSrcweir 	using ::com::sun::star::uno::RuntimeException;
50cdf0e10cSrcweir 	using ::com::sun::star::uno::Any;
51cdf0e10cSrcweir 	using ::com::sun::star::uno::makeAny;
52cdf0e10cSrcweir 	using ::com::sun::star::uno::Sequence;
53cdf0e10cSrcweir 	using ::com::sun::star::uno::Type;
54cdf0e10cSrcweir     using ::com::sun::star::document::XUndoManager;
55cdf0e10cSrcweir     using ::com::sun::star::lang::DisposedException;
56cdf0e10cSrcweir     using ::com::sun::star::document::UndoContextNotClosedException;
57cdf0e10cSrcweir     using ::com::sun::star::document::UndoFailedException;
58cdf0e10cSrcweir     using ::com::sun::star::document::EmptyUndoStackException;
59cdf0e10cSrcweir     using ::com::sun::star::util::InvalidStateException;
60cdf0e10cSrcweir     using ::com::sun::star::document::XUndoAction;
61cdf0e10cSrcweir     using ::com::sun::star::lang::IllegalArgumentException;
62cdf0e10cSrcweir     using ::com::sun::star::document::XUndoManagerListener;
63cdf0e10cSrcweir     using ::com::sun::star::util::NotLockedException;
64cdf0e10cSrcweir     using ::com::sun::star::lang::NoSupportException;
65cdf0e10cSrcweir 	/** === end UNO using === **/
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 	//==================================================================================================================
68cdf0e10cSrcweir 	//= UndoManager_Impl
69cdf0e10cSrcweir 	//==================================================================================================================
70cdf0e10cSrcweir     struct UndoManager_Impl : public ::framework::IUndoManagerImplementation
71cdf0e10cSrcweir     {
UndoManager_Impldbaui::UndoManager_Impl72cdf0e10cSrcweir         UndoManager_Impl( UndoManager& i_antiImpl, ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
73cdf0e10cSrcweir             :rAntiImpl( i_antiImpl )
74cdf0e10cSrcweir             ,rParent( i_parent )
75cdf0e10cSrcweir             ,rMutex( i_mutex )
76cdf0e10cSrcweir             ,bDisposed( false )
77cdf0e10cSrcweir             ,aUndoManager()
78cdf0e10cSrcweir             ,aUndoHelper( *this )
79cdf0e10cSrcweir         {
80cdf0e10cSrcweir         }
81cdf0e10cSrcweir 
~UndoManager_Impldbaui::UndoManager_Impl82cdf0e10cSrcweir         virtual ~UndoManager_Impl()
83cdf0e10cSrcweir         {
84cdf0e10cSrcweir         }
85cdf0e10cSrcweir 
86cdf0e10cSrcweir         UndoManager&                    rAntiImpl;
87cdf0e10cSrcweir         ::cppu::OWeakObject&            rParent;
88cdf0e10cSrcweir         ::osl::Mutex&                   rMutex;
89cdf0e10cSrcweir         bool                            bDisposed;
90cdf0e10cSrcweir         SfxUndoManager                  aUndoManager;
91cdf0e10cSrcweir         ::framework::UndoManagerHelper  aUndoHelper;
92cdf0e10cSrcweir 
93cdf0e10cSrcweir         // IUndoManagerImplementation
94cdf0e10cSrcweir         virtual ::svl::IUndoManager&        getImplUndoManager();
95cdf0e10cSrcweir         virtual Reference< XUndoManager >   getThis();
96cdf0e10cSrcweir     };
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
getImplUndoManager()99cdf0e10cSrcweir     ::svl::IUndoManager& UndoManager_Impl::getImplUndoManager()
100cdf0e10cSrcweir     {
101cdf0e10cSrcweir         return aUndoManager;
102cdf0e10cSrcweir     }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
getThis()105cdf0e10cSrcweir     Reference< XUndoManager > UndoManager_Impl::getThis()
106cdf0e10cSrcweir     {
107cdf0e10cSrcweir         return static_cast< XUndoManager* >( &rAntiImpl );
108cdf0e10cSrcweir     }
109cdf0e10cSrcweir 
110cdf0e10cSrcweir     //==============================================================================================================
111cdf0e10cSrcweir     //= OslMutexFacade
112cdf0e10cSrcweir     //==============================================================================================================
113cdf0e10cSrcweir     class OslMutexFacade : public ::framework::IMutex
114cdf0e10cSrcweir     {
115cdf0e10cSrcweir     public:
OslMutexFacade(::osl::Mutex & i_mutex)116cdf0e10cSrcweir         OslMutexFacade( ::osl::Mutex& i_mutex )
117cdf0e10cSrcweir             :m_rMutex( i_mutex )
118cdf0e10cSrcweir         {
119cdf0e10cSrcweir         }
120cdf0e10cSrcweir 
121cdf0e10cSrcweir         virtual void acquire();
122cdf0e10cSrcweir         virtual void release();
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     private:
125cdf0e10cSrcweir         ::osl::Mutex&   m_rMutex;
126cdf0e10cSrcweir     };
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     //--------------------------------------------------------------------------------------------------------------
acquire()129cdf0e10cSrcweir     void OslMutexFacade::acquire()
130cdf0e10cSrcweir     {
131cdf0e10cSrcweir         m_rMutex.acquire();
132cdf0e10cSrcweir     }
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     //--------------------------------------------------------------------------------------------------------------
release()135cdf0e10cSrcweir     void OslMutexFacade::release()
136cdf0e10cSrcweir     {
137cdf0e10cSrcweir         m_rMutex.release();
138cdf0e10cSrcweir     }
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     //==============================================================================================================
141cdf0e10cSrcweir     //= UndoManagerMethodGuard
142cdf0e10cSrcweir     //==============================================================================================================
143cdf0e10cSrcweir     /** guard for public UNO methods of the UndoManager
144cdf0e10cSrcweir     */
145cdf0e10cSrcweir     class UndoManagerMethodGuard : public ::framework::IMutexGuard
146cdf0e10cSrcweir     {
147cdf0e10cSrcweir     public:
UndoManagerMethodGuard(UndoManager_Impl & i_impl)148cdf0e10cSrcweir         UndoManagerMethodGuard( UndoManager_Impl& i_impl )
149cdf0e10cSrcweir             :m_aGuard( i_impl.rMutex )
150cdf0e10cSrcweir             ,m_aMutexFacade( i_impl.rMutex )
151cdf0e10cSrcweir         {
152cdf0e10cSrcweir             // throw if the instance is already disposed
153cdf0e10cSrcweir             if ( i_impl.bDisposed )
154cdf0e10cSrcweir                 throw DisposedException( ::rtl::OUString(), i_impl.getThis() );
155cdf0e10cSrcweir         }
~UndoManagerMethodGuard()156cdf0e10cSrcweir         virtual ~UndoManagerMethodGuard()
157cdf0e10cSrcweir         {
158cdf0e10cSrcweir         }
159cdf0e10cSrcweir 
160cdf0e10cSrcweir         // IMutexGuard
161cdf0e10cSrcweir         virtual ::framework::IMutex& getGuardedMutex();
162cdf0e10cSrcweir 
163cdf0e10cSrcweir         // IGuard
164cdf0e10cSrcweir         virtual void clear();
165cdf0e10cSrcweir         virtual void reset();
166cdf0e10cSrcweir 
167cdf0e10cSrcweir     private:
168cdf0e10cSrcweir         ::osl::ResettableMutexGuard m_aGuard;
169cdf0e10cSrcweir         OslMutexFacade              m_aMutexFacade;
170cdf0e10cSrcweir     };
171cdf0e10cSrcweir 
172cdf0e10cSrcweir     //--------------------------------------------------------------------------------------------------------------
getGuardedMutex()173cdf0e10cSrcweir     ::framework::IMutex& UndoManagerMethodGuard::getGuardedMutex()
174cdf0e10cSrcweir     {
175cdf0e10cSrcweir         return m_aMutexFacade;
176cdf0e10cSrcweir     }
177cdf0e10cSrcweir 
178cdf0e10cSrcweir     //--------------------------------------------------------------------------------------------------------------
clear()179cdf0e10cSrcweir     void UndoManagerMethodGuard::clear()
180cdf0e10cSrcweir     {
181cdf0e10cSrcweir         m_aGuard.clear();
182cdf0e10cSrcweir     }
183cdf0e10cSrcweir 
184cdf0e10cSrcweir     //--------------------------------------------------------------------------------------------------------------
reset()185cdf0e10cSrcweir     void UndoManagerMethodGuard::reset()
186cdf0e10cSrcweir     {
187cdf0e10cSrcweir         m_aGuard.reset();
188cdf0e10cSrcweir     }
189cdf0e10cSrcweir 
190cdf0e10cSrcweir 	//==================================================================================================================
191cdf0e10cSrcweir 	//= UndoManager
192cdf0e10cSrcweir 	//==================================================================================================================
193cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
UndoManager(::cppu::OWeakObject & i_parent,::osl::Mutex & i_mutex)194cdf0e10cSrcweir     UndoManager::UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
195cdf0e10cSrcweir         :m_pImpl( new UndoManager_Impl( *this, i_parent, i_mutex ) )
196cdf0e10cSrcweir     {
197cdf0e10cSrcweir     }
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
~UndoManager()200cdf0e10cSrcweir     UndoManager::~UndoManager()
201cdf0e10cSrcweir     {
202cdf0e10cSrcweir     }
203cdf0e10cSrcweir 
204cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
GetSfxUndoManager() const205cdf0e10cSrcweir     SfxUndoManager& UndoManager::GetSfxUndoManager() const
206cdf0e10cSrcweir     {
207cdf0e10cSrcweir         return m_pImpl->aUndoManager;
208cdf0e10cSrcweir     }
209cdf0e10cSrcweir 
210cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
acquire()211cdf0e10cSrcweir     void SAL_CALL UndoManager::acquire(  ) throw ()
212cdf0e10cSrcweir     {
213cdf0e10cSrcweir         m_pImpl->rParent.acquire();
214cdf0e10cSrcweir     }
215cdf0e10cSrcweir 
216cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
release()217cdf0e10cSrcweir     void SAL_CALL UndoManager::release(  ) throw ()
218cdf0e10cSrcweir     {
219cdf0e10cSrcweir         m_pImpl->rParent.release();
220cdf0e10cSrcweir     }
221cdf0e10cSrcweir 
222cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
disposing()223cdf0e10cSrcweir     void UndoManager::disposing()
224cdf0e10cSrcweir     {
225cdf0e10cSrcweir         {
226cdf0e10cSrcweir             ::osl::MutexGuard aGuard( m_pImpl->rMutex );
227cdf0e10cSrcweir             m_pImpl->bDisposed = true;
228cdf0e10cSrcweir         }
229cdf0e10cSrcweir         m_pImpl->aUndoHelper.disposing();
230cdf0e10cSrcweir     }
231cdf0e10cSrcweir 
232cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
enterUndoContext(const::rtl::OUString & i_title)233cdf0e10cSrcweir     void SAL_CALL UndoManager::enterUndoContext( const ::rtl::OUString& i_title ) throw (RuntimeException)
234cdf0e10cSrcweir     {
235cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
236cdf0e10cSrcweir         m_pImpl->aUndoHelper.enterUndoContext( i_title, aGuard );
237cdf0e10cSrcweir     }
238cdf0e10cSrcweir 
239cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
enterHiddenUndoContext()240cdf0e10cSrcweir     void SAL_CALL UndoManager::enterHiddenUndoContext(  ) throw (EmptyUndoStackException, RuntimeException)
241cdf0e10cSrcweir     {
242cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
243cdf0e10cSrcweir         m_pImpl->aUndoHelper.enterHiddenUndoContext( aGuard );
244cdf0e10cSrcweir     }
245cdf0e10cSrcweir 
246cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
leaveUndoContext()247cdf0e10cSrcweir     void SAL_CALL UndoManager::leaveUndoContext(  ) throw (InvalidStateException, RuntimeException)
248cdf0e10cSrcweir     {
249cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
250cdf0e10cSrcweir         m_pImpl->aUndoHelper.leaveUndoContext( aGuard );
251cdf0e10cSrcweir     }
252cdf0e10cSrcweir 
253cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
addUndoAction(const Reference<XUndoAction> & i_action)254cdf0e10cSrcweir     void SAL_CALL UndoManager::addUndoAction( const Reference< XUndoAction >& i_action ) throw (IllegalArgumentException, RuntimeException)
255cdf0e10cSrcweir     {
256cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
257cdf0e10cSrcweir         m_pImpl->aUndoHelper.addUndoAction( i_action, aGuard );
258cdf0e10cSrcweir     }
259cdf0e10cSrcweir 
260cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
undo()261cdf0e10cSrcweir     void SAL_CALL UndoManager::undo(  ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
262cdf0e10cSrcweir     {
263cdf0e10cSrcweir         ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
264cdf0e10cSrcweir             // (all our UndoActions work directly on VCL code, usually, so ...)
265cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
266cdf0e10cSrcweir         m_pImpl->aUndoHelper.undo( aGuard );
267cdf0e10cSrcweir     }
268cdf0e10cSrcweir 
269cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
redo()270cdf0e10cSrcweir     void SAL_CALL UndoManager::redo(  ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
271cdf0e10cSrcweir     {
272cdf0e10cSrcweir         ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
273cdf0e10cSrcweir             // (all our UndoActions work directly on VCL code, usually, so ...)
274cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
275cdf0e10cSrcweir         m_pImpl->aUndoHelper.redo( aGuard );
276cdf0e10cSrcweir     }
277cdf0e10cSrcweir 
278cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
isUndoPossible()279cdf0e10cSrcweir     ::sal_Bool SAL_CALL UndoManager::isUndoPossible(  ) throw (RuntimeException)
280cdf0e10cSrcweir     {
281cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
282cdf0e10cSrcweir         return m_pImpl->aUndoHelper.isUndoPossible();
283cdf0e10cSrcweir     }
284cdf0e10cSrcweir 
285cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
isRedoPossible()286cdf0e10cSrcweir     ::sal_Bool SAL_CALL UndoManager::isRedoPossible(  ) throw (RuntimeException)
287cdf0e10cSrcweir     {
288cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
289cdf0e10cSrcweir         return m_pImpl->aUndoHelper.isRedoPossible();
290cdf0e10cSrcweir     }
291cdf0e10cSrcweir 
292cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
getCurrentUndoActionTitle()293cdf0e10cSrcweir     ::rtl::OUString SAL_CALL UndoManager::getCurrentUndoActionTitle(  ) throw (EmptyUndoStackException, RuntimeException)
294cdf0e10cSrcweir     {
295cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
296cdf0e10cSrcweir         return m_pImpl->aUndoHelper.getCurrentUndoActionTitle();
297cdf0e10cSrcweir     }
298cdf0e10cSrcweir 
299cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
getCurrentRedoActionTitle()300cdf0e10cSrcweir     ::rtl::OUString SAL_CALL UndoManager::getCurrentRedoActionTitle(  ) throw (EmptyUndoStackException, RuntimeException)
301cdf0e10cSrcweir     {
302cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
303cdf0e10cSrcweir         return m_pImpl->aUndoHelper.getCurrentRedoActionTitle();
304cdf0e10cSrcweir     }
305cdf0e10cSrcweir 
306cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
getAllUndoActionTitles()307cdf0e10cSrcweir     Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllUndoActionTitles(  ) throw (RuntimeException)
308cdf0e10cSrcweir     {
309cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
310cdf0e10cSrcweir         return m_pImpl->aUndoHelper.getAllUndoActionTitles();
311cdf0e10cSrcweir     }
312cdf0e10cSrcweir 
313cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
getAllRedoActionTitles()314cdf0e10cSrcweir     Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllRedoActionTitles(  ) throw (RuntimeException)
315cdf0e10cSrcweir     {
316cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
317cdf0e10cSrcweir         return m_pImpl->aUndoHelper.getAllRedoActionTitles();
318cdf0e10cSrcweir     }
319cdf0e10cSrcweir 
320cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
clear()321cdf0e10cSrcweir     void SAL_CALL UndoManager::clear(  ) throw (UndoContextNotClosedException, RuntimeException)
322cdf0e10cSrcweir     {
323cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
324cdf0e10cSrcweir         m_pImpl->aUndoHelper.clear( aGuard );
325cdf0e10cSrcweir     }
326cdf0e10cSrcweir 
327cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
clearRedo()328cdf0e10cSrcweir     void SAL_CALL UndoManager::clearRedo(  ) throw (UndoContextNotClosedException, RuntimeException)
329cdf0e10cSrcweir     {
330cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
331cdf0e10cSrcweir         m_pImpl->aUndoHelper.clearRedo( aGuard );
332cdf0e10cSrcweir     }
333cdf0e10cSrcweir 
334cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
reset()335cdf0e10cSrcweir     void SAL_CALL UndoManager::reset(  ) throw (RuntimeException)
336cdf0e10cSrcweir     {
337cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
338cdf0e10cSrcweir         m_pImpl->aUndoHelper.reset( aGuard );
339cdf0e10cSrcweir     }
340cdf0e10cSrcweir 
341cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
addUndoManagerListener(const Reference<XUndoManagerListener> & i_listener)342cdf0e10cSrcweir     void SAL_CALL UndoManager::addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException)
343cdf0e10cSrcweir     {
344cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
345cdf0e10cSrcweir         m_pImpl->aUndoHelper.addUndoManagerListener( i_listener );
346cdf0e10cSrcweir     }
347cdf0e10cSrcweir 
348cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
removeUndoManagerListener(const Reference<XUndoManagerListener> & i_listener)349cdf0e10cSrcweir     void SAL_CALL UndoManager::removeUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException)
350cdf0e10cSrcweir     {
351cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
352cdf0e10cSrcweir         m_pImpl->aUndoHelper.removeUndoManagerListener( i_listener );
353cdf0e10cSrcweir     }
354cdf0e10cSrcweir 
355cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
lock()356cdf0e10cSrcweir     void SAL_CALL UndoManager::lock(  ) throw (RuntimeException)
357cdf0e10cSrcweir     {
358cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
359cdf0e10cSrcweir         m_pImpl->aUndoHelper.lock();
360cdf0e10cSrcweir     }
361cdf0e10cSrcweir 
362cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
unlock()363cdf0e10cSrcweir     void SAL_CALL UndoManager::unlock(  ) throw (NotLockedException, RuntimeException)
364cdf0e10cSrcweir     {
365cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
366cdf0e10cSrcweir         m_pImpl->aUndoHelper.unlock();
367cdf0e10cSrcweir     }
368cdf0e10cSrcweir 
369cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
isLocked()370cdf0e10cSrcweir     ::sal_Bool SAL_CALL UndoManager::isLocked(  ) throw (RuntimeException)
371cdf0e10cSrcweir     {
372cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
373cdf0e10cSrcweir         return m_pImpl->aUndoHelper.isLocked();
374cdf0e10cSrcweir     }
375cdf0e10cSrcweir 
376cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
getParent()377cdf0e10cSrcweir     Reference< XInterface > SAL_CALL UndoManager::getParent(  ) throw (RuntimeException)
378cdf0e10cSrcweir     {
379cdf0e10cSrcweir         UndoManagerMethodGuard aGuard( *m_pImpl );
380cdf0e10cSrcweir         return *&m_pImpl->rParent;
381cdf0e10cSrcweir     }
382cdf0e10cSrcweir 
383cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
setParent(const Reference<XInterface> & i_parent)384cdf0e10cSrcweir     void SAL_CALL UndoManager::setParent( const Reference< XInterface >& i_parent ) throw (NoSupportException, RuntimeException)
385cdf0e10cSrcweir     {
386cdf0e10cSrcweir         (void)i_parent;
387cdf0e10cSrcweir         throw NoSupportException( ::rtl::OUString(), m_pImpl->getThis() );
388cdf0e10cSrcweir     }
389cdf0e10cSrcweir 
390cdf0e10cSrcweir //......................................................................................................................
391cdf0e10cSrcweir } // namespace dbaui
392cdf0e10cSrcweir //......................................................................................................................
393