001    /*
002     * Copyright (c) 2002-2006, Marc Prud'hommeaux. All rights reserved.
003     *
004     * This software is distributable under the BSD license. See the terms of the
005     * BSD license in the documentation provided with this software.
006     */
007    package jline;
008    
009    import java.awt.event.KeyEvent;
010    
011    /**
012     *  Symbolic constants for Console operations and virtual key bindings.
013     *  @see KeyEvent
014     *
015     *  @author  <a href="mailto:mwp1@cornell.edu">Marc Prud'hommeaux</a>
016     */
017    public interface ConsoleOperations {
018        final String CR = System.getProperty("line.separator");
019        final char BACKSPACE = '\b';
020        final char RESET_LINE = '\r';
021        final char KEYBOARD_BELL = '\07';
022        final char CTRL_A = 1;
023        final char CTRL_B = 2;
024        final char CTRL_C = 3;
025        final char CTRL_D = 4;
026        final char CTRL_E = 5;
027        final char CTRL_F = 6;
028        final char CTRL_N = 14;
029        final char CTRL_P = 16;
030    
031        /**
032         *        Logical constants for key operations.
033         */
034    
035        /**
036         *  Unknown operation.
037         */
038        final short UNKNOWN = -99;
039    
040        /**
041         *  Operation that moves to the beginning of the buffer.
042         */
043        final short MOVE_TO_BEG = -1;
044    
045        /**
046         *  Operation that moves to the end of the buffer.
047         */
048        final short MOVE_TO_END = -3;
049    
050        /**
051         *  Operation that moved to the previous character in the buffer.
052         */
053        final short PREV_CHAR = -4;
054    
055        /**
056         *  Operation that issues a newline.
057         */
058        final short NEWLINE = -6;
059    
060        /**
061         *  Operation that deletes the buffer from the current character to the end.
062         */
063        final short KILL_LINE = -7;
064    
065        /**
066         *  Operation that clears the screen.
067         */
068        final short CLEAR_SCREEN = -8;
069    
070        /**
071         *  Operation that sets the buffer to the next history item.
072         */
073        final short NEXT_HISTORY = -9;
074    
075        /**
076         *  Operation that sets the buffer to the previous history item.
077         */
078        final short PREV_HISTORY = -11;
079    
080        /**
081         *  Operation that redisplays the current buffer.
082         */
083        final short REDISPLAY = -13;
084    
085        /**
086         *  Operation that deletes the buffer from the cursor to the beginning.
087         */
088        final short KILL_LINE_PREV = -15;
089    
090        /**
091         *  Operation that deletes the previous word in the buffer.
092         */
093        final short DELETE_PREV_WORD = -16;
094    
095        /**
096         *  Operation that moves to the next character in the buffer.
097         */
098        final short NEXT_CHAR = -19;
099    
100        /**
101         *  Operation that moves to the previous character in the buffer.
102         */
103        final short REPEAT_PREV_CHAR = -20;
104    
105        /**
106         *  Operation that searches backwards in the command history.
107         */
108        final short SEARCH_PREV = -21;
109    
110        /**
111         *  Operation that repeats the character.
112         */
113        final short REPEAT_NEXT_CHAR = -24;
114    
115        /**
116         *  Operation that searches forward in the command history.
117         */
118        final short SEARCH_NEXT = -25;
119    
120        /**
121         *  Operation that moved to the previous whitespace.
122         */
123        final short PREV_SPACE_WORD = -27;
124    
125        /**
126         *  Operation that moved to the end of the current word.
127         */
128        final short TO_END_WORD = -29;
129    
130        /**
131         *  Operation that
132         */
133        final short REPEAT_SEARCH_PREV = -34;
134    
135        /**
136         *  Operation that
137         */
138        final short PASTE_PREV = -36;
139    
140        /**
141         *  Operation that
142         */
143        final short REPLACE_MODE = -37;
144    
145        /**
146         *  Operation that
147         */
148        final short SUBSTITUTE_LINE = -38;
149    
150        /**
151         *  Operation that
152         */
153        final short TO_PREV_CHAR = -39;
154    
155        /**
156         *  Operation that
157         */
158        final short NEXT_SPACE_WORD = -40;
159    
160        /**
161         *  Operation that
162         */
163        final short DELETE_PREV_CHAR = -41;
164    
165        /**
166         *  Operation that
167         */
168        final short ADD = -42;
169    
170        /**
171         *  Operation that
172         */
173        final short PREV_WORD = -43;
174    
175        /**
176         *  Operation that
177         */
178        final short CHANGE_META = -44;
179    
180        /**
181         *  Operation that
182         */
183        final short DELETE_META = -45;
184    
185        /**
186         *  Operation that
187         */
188        final short END_WORD = -46;
189    
190        /**
191         *  Operation that
192         */
193        final short INSERT = -48;
194    
195        /**
196         *  Operation that
197         */
198        final short REPEAT_SEARCH_NEXT = -49;
199    
200        /**
201         *  Operation that
202         */
203        final short PASTE_NEXT = -50;
204    
205        /**
206         *  Operation that
207         */
208        final short REPLACE_CHAR = -51;
209    
210        /**
211         *  Operation that
212         */
213        final short SUBSTITUTE_CHAR = -52;
214    
215        /**
216         *  Operation that
217         */
218        final short TO_NEXT_CHAR = -53;
219    
220        /**
221         *  Operation that undoes the previous operation.
222         */
223        final short UNDO = -54;
224    
225        /**
226         *  Operation that moved to the next word.
227         */
228        final short NEXT_WORD = -55;
229    
230        /**
231         *  Operation that deletes the previous character.
232         */
233        final short DELETE_NEXT_CHAR = -56;
234    
235        /**
236         *  Operation that toggles between uppercase and lowercase.
237         */
238        final short CHANGE_CASE = -57;
239    
240        /**
241         *  Operation that performs completion operation on the current word.
242         */
243        final short COMPLETE = -58;
244    
245        /**
246         *  Operation that exits the command prompt.
247         */
248        final short EXIT = -59;
249    
250        /**
251         *  Operation that pastes the contents of the cliboard into the line
252         */
253        final short PASTE = -60;
254    }