1 /*******************************************************************************
2 * Copyright (c) 2000, 2007 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.custom;
16 import org.eclipse.swt.internal.SWTEventListener;
19 * This listener is invoked when a new offset is required based on the current
20 * offset and a movement type.
22 * @see org.eclipse.swt.SWT#MOVEMENT_WORD
23 * @see org.eclipse.swt.SWT#MOVEMENT_WORD_END
24 * @see org.eclipse.swt.SWT#MOVEMENT_WORD_START
25 * @see org.eclipse.swt.SWT#MOVEMENT_CHAR
26 * @see org.eclipse.swt.SWT#MOVEMENT_CLUSTER
30 public interface MovementListener extends SWTEventListener {
32 * This method is called when a new offset is required based on the current
33 * offset and a movement type.
36 * The following event fields are used:<ul>
37 * <li>event.lineOffset line start offset (input)</li>
38 * <li>event.lineText line text (input)</li>
39 * <li>event.movement the movement type (input)</li>
40 * <li>event.offset the current offset (input)</li>
41 * <li>event.newOffset the new offset (input, output)</li>
44 * @param event the event
47 * @see StyledText#addWordMovementListener(MovementListener)
49 public void getNextOffset (MovementEvent event);
51 * This method is called when a new offset is required based on the current
52 * offset and a movement type.
55 * The following event fields are used:<ul>
56 * <li>event.lineOffset line start offset (input)</li>
57 * <li>event.lineText line text (input)</li>
58 * <li>event.movement the movement type (input)</li>
59 * <li>event.offset the current offset (input)</li>
60 * <li>event.newOffset the new offset (input, output)</li>
63 * @param event the event
66 * @see StyledText#addWordMovementListener(MovementListener)
68 public void getPreviousOffset (MovementEvent event);