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#ifndef __com_sun_star_document_XUndoManagerListener_idl__ 23#define __com_sun_star_document_XUndoManagerListener_idl__ 24 25#include <com/sun/star/document/UndoManagerEvent.idl> 26#include <com/sun/star/lang/XEventListener.idl> 27 28module com { module sun { module star { module document { 29 30/** implemented by components which want to be notified of changes in the Undo/Redo stacks of an Undo manager. 31 32 @see XUndoManager 33 @since OpenOffice 3.4 34 */ 35interface XUndoManagerListener : ::com::sun::star::lang::XEventListener 36{ 37 /** is called when an undo action is added to the undo stack. 38 39 <p>Note that the action must not necessarily be the new top element of the stack: In case there's an 40 open Undo context, <member>UndoManagerEvent::UndoContextDepth</member> will be greater <code>0</code>, 41 and the newly added action will be subordinate of the context action.</p> 42 43 @see XUndoManager::addUndoAction 44 */ 45 void undoActionAdded( [in] UndoManagerEvent i_event ); 46 47 /** is called when the top-most action of the undo stack has been undone. 48 49 @see XUndoManager::undo 50 */ 51 void actionUndone( [in] UndoManagerEvent i_event ); 52 53 /** is called when the top-most action of the Redo stack has been re-applied. 54 55 @see XUndoManager::redo 56 */ 57 void actionRedone( [in] UndoManagerEvent i_event ); 58 59 /** is called when both the Undo and the Redo stack have been cleared from all Undo actions. 60 61 @see XUndoManager::clear 62 */ 63 void allActionsCleared( [in] ::com::sun::star::lang::EventObject i_event ); 64 65 /** is called when the the Redo stack has been cleared. 66 67 @see XUndoManager::clearRedo 68 */ 69 void redoActionsCleared( [in] ::com::sun::star::lang::EventObject i_event ); 70 71 /** called when the complete undo manager has been reset 72 */ 73 void resetAll( [in] ::com::sun::star::lang::EventObject i_event ); 74 75 /** is called when a new Undo context has been entered. 76 77 <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and 78 <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, including the 79 one just entered.</p> 80 81 @see XUndoManager::enterUndoContext 82 */ 83 void enteredContext( [in] UndoManagerEvent i_event ); 84 85 /** is called when a new hidden Undo context has been entered. 86 87 <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and 88 <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, including the 89 one just entered.</p> 90 91 @see XUndoManager::enterUndoContext 92 */ 93 void enteredHiddenContext( [in] UndoManagerEvent i_event ); 94 95 /** is called when an Undo context has been left. 96 97 <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and 98 <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, exluding the 99 one just left.</p> 100 101 @see XUndoManager::leaveUndoContext 102 @see leftHiddenUndocontext 103 @see cancelledContext 104 */ 105 void leftContext( [in] UndoManagerEvent i_event ); 106 107 /** is calledn when a hidden Undo context has been left. 108 109 <p><member>UndoManagerEvent::UndoActionTitle</member> is empty, as hidden Undo contexts don't have 110 a title.</p> 111 112 @see XUndoManager::leaveHiddenUndoContext 113 @see leftContext 114 @see cancelledContext 115 */ 116 void leftHiddenContext( [in] UndoManagerEvent i_event ); 117 118 /** is called when an Undo context has been left, but no actions have been added within this context. 119 120 <p>In such a case, the context which has just been left will not contribute to the undo stack, but instead 121 be silently removed. Consequently, the <member>UndoManagerEvent::UndoActionTitle</member> is empty.</p> 122 123 @see XUndoManager::leaveUndoContext 124 @see leftContext 125 @see leftHiddenContext 126 */ 127 void cancelledContext( [in] UndoManagerEvent i_event ); 128}; 129 130}; }; }; }; 131 132#endif 133