summaryrefslogtreecommitdiff
path: root/offapi/com/sun/star/document/XUndoManagerListener.idl
blob: a2da8ec83905957313a56df96ad55d7a21750bff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

#ifndef __com_sun_star_document_XUndoManagerListener_idl__
#define __com_sun_star_document_XUndoManagerListener_idl__

#include <com/sun/star/document/UndoManagerEvent.idl>
#include <com/sun/star/lang/XEventListener.idl>


module com { module sun { module star { module document {


/** implemented by components which want to be notified of changes in the Undo/Redo stacks of an Undo manager.

    @see XUndoManager
 */
interface XUndoManagerListener : ::com::sun::star::lang::XEventListener
{
    /** is called when an undo action is added to the undo stack.

        <p>Note that the action must not necessarily be the new top element of the stack: In case there's an
        open Undo context, <member>UndoManagerEvent::UndoContextDepth</member> will be greater <code>0</code>,
        and the newly added action will be subordinate of the context action.</p>

        @see XUndoManager::addUndoAction
    */
    void    undoActionAdded( [in] UndoManagerEvent i_event );

    /** is called when the top-most action of the undo stack has been undone.

        @see XUndoManager::undo
    */
    void    actionUndone( [in] UndoManagerEvent i_event );

    /** is called when the top-most action of the Redo stack has been re-applied.

        @see XUndoManager::redo
    */
    void    actionRedone( [in] UndoManagerEvent i_event );

    /** is called when both the Undo and the Redo stack have been cleared from all Undo actions.

        @see XUndoManager::clear
    */
    void    allActionsCleared( [in] ::com::sun::star::lang::EventObject i_event );

    /** is called when the the Redo stack has been cleared.

        @see XUndoManager::clearRedo
    */
    void    redoActionsCleared( [in] ::com::sun::star::lang::EventObject i_event );

    /** called when the complete undo manager has been reset
    */
    void    resetAll( [in] ::com::sun::star::lang::EventObject i_event );

    /** is called when a new Undo context has been entered.

        <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and
        <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, including the
        one just entered.</p>

        @see XUndoManager::enterUndoContext
    */
    void    enteredContext( [in] UndoManagerEvent i_event );

    /** is called when a new hidden Undo context has been entered.

        <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and
        <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, including the
        one just entered.</p>

        @see XUndoManager::enterUndoContext
    */
    void    enteredHiddenContext( [in] UndoManagerEvent i_event );

    /** is called when an Undo context has been left.

        <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and
        <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, exluding the
        one just left.</p>

        @see XUndoManager::leaveUndoContext
        @see leftHiddenUndocontext
        @see cancelledContext
    */
    void    leftContext( [in] UndoManagerEvent i_event );

    /** is calledn when a hidden Undo context has been left.

        <p><member>UndoManagerEvent::UndoActionTitle</member> is empty, as hidden Undo contexts don't have
        a title.</p>

        @see XUndoManager::leaveHiddenUndoContext
        @see leftContext
        @see cancelledContext
    */
    void    leftHiddenContext( [in] UndoManagerEvent i_event );

    /** is called when an Undo context has been left, but no actions have been added within this context.

        <p>In such a case, the context which has just been left will not contribute to the undo stack, but instead
        be silently removed. Consequently, the <member>UndoManagerEvent::UndoActionTitle</member> is empty.</p>

        @see XUndoManager::leaveUndoContext
        @see leftContext
        @see leftHiddenContext
    */
    void    cancelledContext( [in] UndoManagerEvent i_event );
};


}; }; }; };


#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */