14c5491eaSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 34c5491eaSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 44c5491eaSAndrew Rist * or more contributor license agreements. See the NOTICE file 54c5491eaSAndrew Rist * distributed with this work for additional information 64c5491eaSAndrew Rist * regarding copyright ownership. The ASF licenses this file 74c5491eaSAndrew Rist * to you under the Apache License, Version 2.0 (the 84c5491eaSAndrew Rist * "License"); you may not use this file except in compliance 94c5491eaSAndrew Rist * with the License. You may obtain a copy of the License at 104c5491eaSAndrew Rist * 114c5491eaSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 124c5491eaSAndrew Rist * 134c5491eaSAndrew Rist * Unless required by applicable law or agreed to in writing, 144c5491eaSAndrew Rist * software distributed under the License is distributed on an 154c5491eaSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 164c5491eaSAndrew Rist * KIND, either express or implied. See the License for the 174c5491eaSAndrew Rist * specific language governing permissions and limitations 184c5491eaSAndrew Rist * under the License. 194c5491eaSAndrew Rist * 204c5491eaSAndrew Rist *************************************************************/ 214c5491eaSAndrew Rist 224c5491eaSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _EDITUND2_HXX 25cdf0e10cSrcweir #define _EDITUND2_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "editeng/editengdllapi.h" 28cdf0e10cSrcweir #include <svl/undo.hxx> 29cdf0e10cSrcweir 30cdf0e10cSrcweir class ImpEditEngine; 31cdf0e10cSrcweir 32*69ffbee1SArmin Le Grand class EDITENG_DLLPUBLIC EditUndoManager : public SfxUndoManager 33cdf0e10cSrcweir { 34*69ffbee1SArmin Le Grand private: 35cdf0e10cSrcweir using SfxUndoManager::Undo; 36cdf0e10cSrcweir using SfxUndoManager::Redo; 37*69ffbee1SArmin Le Grand friend class ImpEditEngine; 38*69ffbee1SArmin Le Grand 39*69ffbee1SArmin Le Grand ImpEditEngine* mpImpEE; 40*69ffbee1SArmin Le Grand void SetImpEditEngine(ImpEditEngine* pNew); 41cdf0e10cSrcweir 42cdf0e10cSrcweir public: 43*69ffbee1SArmin Le Grand EditUndoManager(sal_uInt16 nMaxUndoActionCount = 20); 44cdf0e10cSrcweir 45cdf0e10cSrcweir virtual sal_Bool Undo(); 46cdf0e10cSrcweir virtual sal_Bool Redo(); 47cdf0e10cSrcweir }; 48cdf0e10cSrcweir 49cdf0e10cSrcweir // ----------------------------------------------------------------------- 50cdf0e10cSrcweir // EditUndo 51cdf0e10cSrcweir // ------------------------------------------------------------------------ 52cdf0e10cSrcweir class EDITENG_DLLPUBLIC EditUndo : public SfxUndoAction 53cdf0e10cSrcweir { 54cdf0e10cSrcweir private: 55cdf0e10cSrcweir sal_uInt16 nId; 56cdf0e10cSrcweir ImpEditEngine* pImpEE; 57cdf0e10cSrcweir 58cdf0e10cSrcweir public: 59cdf0e10cSrcweir TYPEINFO(); 60cdf0e10cSrcweir EditUndo( sal_uInt16 nI, ImpEditEngine* pImpEE ); 61cdf0e10cSrcweir virtual ~EditUndo(); 62cdf0e10cSrcweir GetImpEditEngine() const63cdf0e10cSrcweir ImpEditEngine* GetImpEditEngine() const { return pImpEE; } 64cdf0e10cSrcweir 65cdf0e10cSrcweir virtual void Undo() = 0; 66cdf0e10cSrcweir virtual void Redo() = 0; 67cdf0e10cSrcweir 68cdf0e10cSrcweir virtual sal_Bool CanRepeat(SfxRepeatTarget&) const; 69cdf0e10cSrcweir virtual String GetComment() const; 70cdf0e10cSrcweir virtual sal_uInt16 GetId() const; 71cdf0e10cSrcweir }; 72cdf0e10cSrcweir 73cdf0e10cSrcweir #endif // _EDITUND2_HXX 74cdf0e10cSrcweir 75cdf0e10cSrcweir 76