1 /*******************************************************************************
2  * Copyright (c) 2010, 2011 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  *     alice <stigma@disroot.org>
12  *******************************************************************************/
13 module org.eclipse.swt.accessibility.AccessibleEditableTextListener;
14 
15 import org.eclipse.swt.internal.SWTEventListener;
16 
17 import org.eclipse.swt.accessibility.AccessibleEditableTextEvent;
18 import org.eclipse.swt.accessibility.AccessibleTextAttributeEvent;
19 
20 /**
21  * Classes which implement this interface provide methods
22  * that handle AccessibleEditableText events.
23  * <p>
24  * After creating an instance of a class that implements
25  * this interface it can be added to an accessible using the
26  * <code>addAccessibleEditableTextListener</code> method and removed using
27  * the <code>removeAccessibleEditableTextListener</code> method.
28  * </p>
29  *
30  * @see AccessibleEditableTextAdapter
31  * @see AccessibleEditableTextEvent
32  * @see AccessibleTextAttributeEvent
33  *
34  * @since 3.7
35  */
36 public interface AccessibleEditableTextListener : SWTEventListener {
37     /**
38      * Copies the substring beginning at the specified <code>start</code> offset
39      * and extending to the character at offset <code>end - 1</code> to the clipboard.
40      *
41      * @param e an event object containing the following information:<ul>
42      * <li>[in] start - the 0 based offset of the first character of the substring
43      * 		to be copied to the clipboard</li>
44      * <li>[in] end - the 0 based offset after the last character of the substring
45      * 		to be copied to the clipboard</li>
46      * <li>[out] result - set to {@link ACC#OK} if the operation was completed successfully</li>
47      * </ul>
48      */
49     public void copyText(AccessibleEditableTextEvent e);
50 
51     /**
52      * Moves the substring beginning at the specified <code>start</code> offset
53      * and extending to the character at offset <code>end - 1</code> to the clipboard.
54      *
55      * @param e an event object containing the following information:<ul>
56      * <li>[in] start - the 0 based offset of the first character of the substring
57      * 		to be moved to the clipboard</li>
58      * <li>[in] end - the 0 based offset after the last character of the substring
59      * 		to be moved to the clipboard</li>
60      * <li>[out] result - set to {@link ACC#OK} if the operation was completed successfully</li>
61      * </ul>
62      */
63     public void cutText(AccessibleEditableTextEvent e);
64 
65     /**
66      * Inserts the text in the clipboard at the leading edge of the specified <code>start</code> offset.
67      *
68      * @param e an event object containing the following information:<ul>
69      * <li>[in] start - the offset at which to insert the text from the clipboard.
70      * 		The valid range is 0..length</li>
71      * <li>[out] result - set to {@link ACC#OK} if the operation was completed successfully</li>
72      * </ul>
73      */
74     public void pasteText(AccessibleEditableTextEvent e);
75 
76     /**
77      * Replaces the substring beginning at the specified <code>start</code> offset
78      * and extending to the character at offset <code>end - 1</code> by the specified string.
79      * <p>
80      * This event notification is also used to delete text if <code>string</code> is an empty string,
81      * or to insert text at the leading edge of the specified offset if <code>start</code> and <code>end</code> are equal.
82      * </p>
83      *
84      * @param e an event object containing the following information:<ul>
85      * <li>[in] start - the 0 based offset of the first character of the substring
86      * 		to be replaced</li>
87      * <li>[in] end - the 0 based offset after the last character of the substring
88      * 		to be replaced</li>
89      * <li>[in] string - the string that replaces the substring beginning at
90      * 		<code>start</code> and extending to <code>end - 1</code></li>
91      * <li>[out] result - set to {@link ACC#OK} if the operation was completed successfully</li>
92      * </ul>
93      */
94     public void replaceText(AccessibleEditableTextEvent e);
95 
96     /**
97      * Replaces the set of attributes of the substring beginning at the specified <code>start</code> offset
98      * and extending to the character at offset <code>end - 1</code> by the specified set of attributes.
99      *
100      * @param e an event object containing the following information:<ul>
101      * <li>[in] start - the 0 based offset of the first character of the substring
102      * 		whose attributes are modified</li>
103      * <li>[in] end - the 0 based offset after the last character of the substring
104      * 		whose attributes are modified</li>
105      * <li>[in] textStyle - the TextStyle which contains attributes that replace the old set of attributes.
106      * 		The foreground, background, and font fields of this TextStyle are only valid for the duration of the event.
107      * 		The value of this field may be null if none of the attributes to be set correspond to TextStyle fields.</li>
108      * <li>[in] attributes - an array of alternating key and value Strings that represent the complete
109      * 		set of attributes to replace the old set of attributes.
110      * 		The value of this field may be null if no attributes are to be set.</li>
111      * <li>[out] result - set to {@link ACC#OK} if the operation was completed successfully</li>
112      * </ul>
113      */
114     public void setTextAttributes(AccessibleTextAttributeEvent e);
115 }