1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24#ifndef __com_sun_star_document_XUndoManagerListener_idl__ 25#define __com_sun_star_document_XUndoManagerListener_idl__ 26 27#include <com/sun/star/document/UndoManagerEvent.idl> 28#include <com/sun/star/lang/XEventListener.idl> 29 30//================================================================================================================== 31 32module com { module sun { module star { module document { 33 34//================================================================================================================== 35 36/** implemented by components which want to be notified of changes in the Undo/Redo stacks of an Undo manager. 37 38 @see XUndoManager 39 @since OpenOffice 3.4 40 */ 41published interface XUndoManagerListener : ::com::sun::star::lang::XEventListener 42{ 43 /** is called when an undo action is added to the undo stack. 44 45 <p>Note that the action must not necessarily be the new top element of the stack: In case there's an 46 open Undo context, <member>UndoManagerEvent::UndoContextDepth</member> will be greater <code>0</code>, 47 and the newly added action will be subordinate of the context action.</p> 48 49 @see XUndoManager::addUndoAction 50 */ 51 void undoActionAdded( [in] UndoManagerEvent i_event ); 52 53 /** is called when the top-most action of the undo stack has been undone. 54 55 @see XUndoManager::undo 56 */ 57 void actionUndone( [in] UndoManagerEvent i_event ); 58 59 /** is called when the top-most action of the Redo stack has been re-applied. 60 61 @see XUndoManager::redo 62 */ 63 void actionRedone( [in] UndoManagerEvent i_event ); 64 65 /** is called when both the Undo and the Redo stack have been cleared from all Undo actions. 66 67 @see XUndoManager::clear 68 */ 69 void allActionsCleared( [in] ::com::sun::star::lang::EventObject i_event ); 70 71 /** is called when the the Redo stack has been cleared. 72 73 @see XUndoManager::clearRedo 74 */ 75 void redoActionsCleared( [in] ::com::sun::star::lang::EventObject i_event ); 76 77 /** called when the complete undo manager has been reset 78 */ 79 void resetAll( [in] ::com::sun::star::lang::EventObject i_event ); 80 81 /** is called when a new Undo context has been entered. 82 83 <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and 84 <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, including the 85 one just entered.</p> 86 87 @see XUndoManager::enterUndoContext 88 */ 89 void enteredContext( [in] UndoManagerEvent i_event ); 90 91 /** is called when a new hidden Undo context has been entered. 92 93 <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and 94 <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, including the 95 one just entered.</p> 96 97 @see XUndoManager::enterUndoContext 98 */ 99 void enteredHiddenContext( [in] UndoManagerEvent i_event ); 100 101 /** is called when an Undo context has been left. 102 103 <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and 104 <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, exluding the 105 one just left.</p> 106 107 @see XUndoManager::leaveUndoContext 108 @see leftHiddenUndocontext 109 @see cancelledContext 110 */ 111 void leftContext( [in] UndoManagerEvent i_event ); 112 113 /** is calledn when a hidden Undo context has been left. 114 115 <p><member>UndoManagerEvent::UndoActionTitle</member> is empty, as hidden Undo contexts don't have 116 a title.</p> 117 118 @see XUndoManager::leaveHiddenUndoContext 119 @see leftContext 120 @see cancelledContext 121 */ 122 void leftHiddenContext( [in] UndoManagerEvent i_event ); 123 124 /** is called when an Undo context has been left, but no actions have been added within this context. 125 126 <p>In such a case, the context which has just been left will not contribute to the undo stack, but instead 127 be silently removed. Consequently, the <member>UndoManagerEvent::UndoActionTitle</member> is empty.</p> 128 129 @see XUndoManager::leaveUndoContext 130 @see leftContext 131 @see leftHiddenContext 132 */ 133 void cancelledContext( [in] UndoManagerEvent i_event ); 134}; 135 136//================================================================================================================== 137 138}; }; }; }; 139 140//================================================================================================================== 141 142#endif 143