1*2e2212a7SAndrew Rist /************************************************************** 2*2e2212a7SAndrew Rist * 3*2e2212a7SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*2e2212a7SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*2e2212a7SAndrew Rist * distributed with this work for additional information 6*2e2212a7SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*2e2212a7SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*2e2212a7SAndrew Rist * "License"); you may not use this file except in compliance 9*2e2212a7SAndrew Rist * with the License. You may obtain a copy of the License at 10*2e2212a7SAndrew Rist * 11*2e2212a7SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*2e2212a7SAndrew Rist * 13*2e2212a7SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*2e2212a7SAndrew Rist * software distributed under the License is distributed on an 15*2e2212a7SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2e2212a7SAndrew Rist * KIND, either express or implied. See the License for the 17*2e2212a7SAndrew Rist * specific language governing permissions and limitations 18*2e2212a7SAndrew Rist * under the License. 19*2e2212a7SAndrew Rist * 20*2e2212a7SAndrew Rist *************************************************************/ 21*2e2212a7SAndrew Rist 22*2e2212a7SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef DBACCESS_DBAUNDOMANAGER_HXX 25cdf0e10cSrcweir #define DBACCESS_DBAUNDOMANAGER_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "dbaccessdllapi.h" 28cdf0e10cSrcweir 29cdf0e10cSrcweir /** === begin UNO includes === **/ 30cdf0e10cSrcweir #include <com/sun/star/document/XUndoManager.hpp> 31cdf0e10cSrcweir /** === end UNO includes === **/ 32cdf0e10cSrcweir 33cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> 34cdf0e10cSrcweir 35cdf0e10cSrcweir #include <boost/scoped_ptr.hpp> 36cdf0e10cSrcweir 37cdf0e10cSrcweir class SfxUndoManager; 38cdf0e10cSrcweir 39cdf0e10cSrcweir //...................................................................................................................... 40cdf0e10cSrcweir namespace dbaui 41cdf0e10cSrcweir { 42cdf0e10cSrcweir //...................................................................................................................... 43cdf0e10cSrcweir 44cdf0e10cSrcweir //================================================================================================================== 45cdf0e10cSrcweir //= UndoManager 46cdf0e10cSrcweir //================================================================================================================== 47cdf0e10cSrcweir struct UndoManager_Impl; 48cdf0e10cSrcweir typedef ::cppu::ImplHelper1< ::com::sun::star::document::XUndoManager > UndoManager_Base; 49cdf0e10cSrcweir class DBACCESS_DLLPUBLIC UndoManager : public UndoManager_Base 50cdf0e10cSrcweir { 51cdf0e10cSrcweir public: 52cdf0e10cSrcweir UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ); 53cdf0e10cSrcweir virtual ~UndoManager(); 54cdf0e10cSrcweir 55cdf0e10cSrcweir SfxUndoManager& GetSfxUndoManager() const; 56cdf0e10cSrcweir 57cdf0e10cSrcweir // XInterface 58cdf0e10cSrcweir virtual void SAL_CALL acquire( ) throw (); 59cdf0e10cSrcweir virtual void SAL_CALL release( ) throw (); 60cdf0e10cSrcweir 61cdf0e10cSrcweir // XComponent equivalents 62cdf0e10cSrcweir void disposing(); 63cdf0e10cSrcweir 64cdf0e10cSrcweir // XUndoManager 65cdf0e10cSrcweir virtual void SAL_CALL enterUndoContext( const ::rtl::OUString& i_title ) throw (::com::sun::star::uno::RuntimeException); 66cdf0e10cSrcweir virtual void SAL_CALL enterHiddenUndoContext( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); 67cdf0e10cSrcweir virtual void SAL_CALL leaveUndoContext( ) throw (::com::sun::star::util::InvalidStateException, ::com::sun::star::uno::RuntimeException); 68cdf0e10cSrcweir virtual void SAL_CALL addUndoAction( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoAction >& i_action ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 69cdf0e10cSrcweir virtual void SAL_CALL undo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException); 70cdf0e10cSrcweir virtual void SAL_CALL redo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException); 71cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL isUndoPossible( ) throw (::com::sun::star::uno::RuntimeException); 72cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL isRedoPossible( ) throw (::com::sun::star::uno::RuntimeException); 73cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getCurrentUndoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); 74cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getCurrentRedoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); 75cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllUndoActionTitles( ) throw (::com::sun::star::uno::RuntimeException); 76cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllRedoActionTitles( ) throw (::com::sun::star::uno::RuntimeException); 77cdf0e10cSrcweir virtual void SAL_CALL clear( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException); 78cdf0e10cSrcweir virtual void SAL_CALL clearRedo( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException); 79cdf0e10cSrcweir virtual void SAL_CALL reset( ) throw (::com::sun::star::uno::RuntimeException); 80cdf0e10cSrcweir virtual void SAL_CALL addUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException); 81cdf0e10cSrcweir virtual void SAL_CALL removeUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException); 82cdf0e10cSrcweir 83cdf0e10cSrcweir // XLockable (base of XUndoManager) 84cdf0e10cSrcweir virtual void SAL_CALL lock( ) throw (::com::sun::star::uno::RuntimeException); 85cdf0e10cSrcweir virtual void SAL_CALL unlock( ) throw (::com::sun::star::util::NotLockedException, ::com::sun::star::uno::RuntimeException); 86cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException); 87cdf0e10cSrcweir 88cdf0e10cSrcweir // XChild (base of XUndoManager) 89cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException); 90cdf0e10cSrcweir virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); 91cdf0e10cSrcweir 92cdf0e10cSrcweir private: 93cdf0e10cSrcweir ::boost::scoped_ptr< UndoManager_Impl > m_pImpl; 94cdf0e10cSrcweir }; 95cdf0e10cSrcweir 96cdf0e10cSrcweir //...................................................................................................................... 97cdf0e10cSrcweir } // namespace dbaui 98cdf0e10cSrcweir //...................................................................................................................... 99cdf0e10cSrcweir 100cdf0e10cSrcweir #endif // DBACCESS_DBAUNDOMANAGER_HXX 101