66
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Public interface for listening TextEditor changes.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// PACKAGE
|
|
19 |
package com.nokia.mid.ui;
|
|
20 |
|
|
21 |
/**
|
|
22 |
* <P>
|
|
23 |
* A listener for receiving notification of content changes and other editor
|
|
24 |
* events from <code>TextEditor</code> objects. The events are generated on
|
|
25 |
* content changes that are either a result of a programmatical change or due to
|
|
26 |
* an user input.
|
|
27 |
* </P>
|
|
28 |
*
|
|
29 |
* @since 1.4
|
|
30 |
*/
|
|
31 |
|
|
32 |
public interface TextEditorListener
|
|
33 |
{
|
|
34 |
/**
|
|
35 |
* Indicates that the content of this <code>TextEditor</code> has changed.
|
|
36 |
*/
|
|
37 |
public static final int ACTION_CONTENT_CHANGE = 0x1;
|
|
38 |
|
|
39 |
/**
|
|
40 |
* Indicates that the options of this <code>TextEditor</code> have changed.
|
|
41 |
*/
|
|
42 |
public static final int ACTION_OPTIONS_CHANGE = 0x2;
|
|
43 |
|
|
44 |
/**
|
|
45 |
* Indicates that the caret in this <code>TextEditor</code> has moved.
|
|
46 |
*/
|
|
47 |
public static final int ACTION_CARET_MOVE = 0x4;
|
|
48 |
|
|
49 |
/**
|
|
50 |
* Indicates that the user tries to exit this <code>TextEditor</code>
|
|
51 |
* upwards.
|
|
52 |
*/
|
|
53 |
public static final int ACTION_TRAVERSE_PREVIOUS = 0x8;
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Indicates that the user tries to exit this <code>TextEditor</code>
|
|
57 |
* downwards.
|
|
58 |
*/
|
|
59 |
public static final int ACTION_TRAVERSE_NEXT = 0x10;
|
|
60 |
|
|
61 |
/**
|
|
62 |
* Indicates that this TextEditor has to be repainted. The application
|
|
63 |
* should service this request by refreshing at least the region covered by
|
|
64 |
* the TextEditor in its Canvas, which will also cause the TextEditor itself
|
|
65 |
* to be redrawn. This can be accomplished by the MIDlet calling either
|
|
66 |
* Canvas#repaint(x,y,width,height) or
|
|
67 |
* GameCanvas#flushGraphics(x,y,width,height).
|
|
68 |
*/
|
|
69 |
public static final int ACTION_PAINT_REQUEST = 0x20;
|
|
70 |
|
|
71 |
/**
|
|
72 |
* Indicates that the direction of the writing-language has changed.
|
|
73 |
*/
|
|
74 |
public static final int ACTION_DIRECTION_CHANGE = 0x40;
|
|
75 |
|
|
76 |
/**
|
|
77 |
* Indicates that the current input-mode has changed.
|
|
78 |
*/
|
|
79 |
public static final int ACTION_INPUT_MODE_CHANGE = 0x80;
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Indicates that the current input-language has changed.
|
|
83 |
*/
|
|
84 |
public static final int ACTION_LANGUAGE_CHANGE = 0x100;
|
|
85 |
|
|
86 |
/**
|
|
87 |
* Indicates that the editor cannot scroll up anymore.
|
|
88 |
*/
|
|
89 |
public static final int ACTION_TRAVERSE_OUT_SCROLL_UP = 0x200;
|
|
90 |
|
|
91 |
/**
|
|
92 |
* Indicates that the editor cannot scroll down anymore.
|
|
93 |
*/
|
|
94 |
public static final int ACTION_TRAVERSE_OUT_SCROLL_DOWN = 0x400;
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Indicates that scrollbar should be updated.
|
|
98 |
*/
|
|
99 |
public static final int ACTION_SCROLLBAR_CHANGED = 0x800;
|
|
100 |
|
|
101 |
// Events 0x1000 and 0x2000 are used in s60 extension
|
|
102 |
|
|
103 |
/**
|
|
104 |
* This method is called by the platform to notify the client about events
|
|
105 |
* in a TextEditor. A call to this method may represent more than one event.
|
|
106 |
* The events are masked into the actions-parameter, so an application can
|
|
107 |
* determine which events have occured via<br>
|
|
108 |
*
|
|
109 |
* <code>
|
|
110 |
* if( (actions&TextEditorListener.ACTION_CONTENT_CHANGE)!=0){<br>
|
|
111 |
* ...<br>
|
|
112 |
* }<br>
|
|
113 |
* if( (actions&TextEditorListener.ACTION_CARET_CHANGE)!=0){<br>
|
|
114 |
* ...<br>
|
|
115 |
* }<br>
|
|
116 |
* </code>
|
|
117 |
*
|
|
118 |
* @param textEditor
|
|
119 |
* the TextEditor instance where the event occured
|
|
120 |
* @param actions
|
|
121 |
* the events that occured.
|
|
122 |
*/
|
|
123 |
public void inputAction(TextEditor textEditor, int actions);
|
|
124 |
}
|
|
125 |
|
|
126 |
// End of file
|