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