129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2005 IBM Corporation and others.
|
|
3 * All rights reserved. This program and the accompanying materials
|
|
4 * are made available under the terms of the Eclipse Public License v1.0
|
|
5 * which accompanies this distribution, and is available at
|
|
6 * http://www.eclipse.org/legal/epl-v10.html
|
|
7 *
|
|
8 * Contributors:
|
|
9 * IBM Corporation - initial API and implementation
|
|
10 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.jface.text.link.ILinkedModeListener;
|
|
14
|
131
|
15 import dwtx.jface.text.link.LinkedModeModel; // packageimport
|
|
16 import dwtx.jface.text.link.LinkedPosition; // packageimport
|
|
17 import dwtx.jface.text.link.TabStopIterator; // packageimport
|
|
18 import dwtx.jface.text.link.LinkedModeUI; // packageimport
|
|
19 import dwtx.jface.text.link.InclusivePositionUpdater; // packageimport
|
|
20 import dwtx.jface.text.link.LinkedPositionGroup; // packageimport
|
|
21 import dwtx.jface.text.link.LinkedModeManager; // packageimport
|
|
22 import dwtx.jface.text.link.LinkedPositionAnnotations; // packageimport
|
|
23 import dwtx.jface.text.link.ProposalPosition; // packageimport
|
|
24
|
|
25
|
129
|
26 import dwt.dwthelper.utils;
|
|
27
|
|
28 /**
|
|
29 * Protocol used by {@link LinkedModeModel}s to communicate state changes, such
|
|
30 * as leaving linked mode, suspending it due to a child mode coming up, and
|
|
31 * resuming after a child mode has left.
|
|
32 * <p>
|
|
33 * This interface may implemented by clients.
|
|
34 * </p>
|
|
35 *
|
|
36 * @since 3.0
|
|
37 */
|
|
38 public interface ILinkedModeListener {
|
|
39
|
|
40 /** Flag to <code>leave</code> specifying no special action. */
|
162
|
41 static const int NONE= 0;
|
129
|
42 /**
|
|
43 * Flag to <code>leave</code> specifying that all nested modes should
|
|
44 * exit.
|
|
45 */
|
162
|
46 static const int EXIT_ALL= 1 << 0;
|
129
|
47 /**
|
|
48 * Flag to <code>leave</code> specifying that the caret should be moved to
|
|
49 * the exit position.
|
|
50 */
|
162
|
51 static const int UPDATE_CARET= 1 << 1;
|
129
|
52 /**
|
|
53 * Flag to <code>leave</code> specifying that a UI of a parent mode should
|
|
54 * select the current position.
|
|
55 */
|
162
|
56 static const int SELECT= 1 << 2;
|
129
|
57 /**
|
|
58 * Flag to <code>leave</code> specifying that document content outside of
|
|
59 * a linked position was modified.
|
|
60 */
|
162
|
61 static const int EXTERNAL_MODIFICATION= 1 << 3;
|
129
|
62
|
|
63 /**
|
|
64 * The leave event occurs when linked is left.
|
|
65 *
|
|
66 * @param model the model being left
|
|
67 * @param flags the reason and commands for leaving linked mode
|
|
68 */
|
|
69 void left(LinkedModeModel model, int flags);
|
|
70
|
|
71 /**
|
|
72 * The suspend event occurs when a nested linked mode is installed within
|
|
73 * <code>model</code>.
|
|
74 *
|
|
75 * @param model the model being suspended due to a nested model being
|
|
76 * installed
|
|
77 */
|
|
78 void suspend(LinkedModeModel model);
|
|
79
|
|
80 /**
|
|
81 * The resume event occurs when a nested linked mode exits.
|
|
82 *
|
|
83 * @param model the linked mode model being resumed due to a nested mode
|
|
84 * exiting
|
|
85 * @param flags the commands to execute when resuming after suspend
|
|
86 */
|
|
87 void resume(LinkedModeModel model, int flags);
|
|
88 }
|