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