001 /** 002 * jline - Java console input library 003 * Copyright (c) 2002,2003 Marc Prud'hommeaux mwp1@cornell.edu 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library; if not, write to the Free Software 017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 018 */ 019 package jline; 020 021 022 /** 023 * Synbolic constants for Console operations. 024 * 025 * @author <a href="mailto:mwp1@cornell.edu">Marc Prud'hommeaux</a> 026 */ 027 public interface ConsoleOperations 028 { 029 String CR = System.getProperty ("line.separator"); 030 031 char BACKSPACE = '\b'; 032 char RESET_LINE = '\r'; 033 char KEYBOARD_BELL = '\07'; 034 035 036 short ARROW_START = 27; 037 short ARROW_PREFIX = 91; 038 short ARROW_LEFT = 68; 039 short ARROW_RIGHT = 67; 040 short ARROW_UP = 65; 041 short ARROW_DOWN = 66; 042 043 044 /** 045 * Logical constants for key operations. 046 */ 047 048 /** 049 * Unknown operation. 050 */ 051 short UNKNOWN = -99; 052 053 /** 054 * Operation that moves to the beginning of the buffer. 055 */ 056 short MOVE_TO_BEG = -1; 057 058 /** 059 * Operation that moves to the end of the buffer. 060 */ 061 short MOVE_TO_END = -3; 062 063 /** 064 * Operation that moved to the previous character in the buffer. 065 */ 066 short PREV_CHAR = -4; 067 068 /** 069 * Operation that issues a newline. 070 */ 071 short NEWLINE = -6; 072 073 /** 074 * Operation that deletes the buffer from the current character to the end. 075 */ 076 short KILL_LINE = -7; 077 078 /** 079 * Operation that clears the screen. 080 */ 081 short CLEAR_SCREEN = -8; 082 083 /** 084 * Operation that sets the buffer to the next history item. 085 */ 086 short NEXT_HISTORY = -9; 087 088 /** 089 * Operation that sets the buffer to the previous history item. 090 */ 091 short PREV_HISTORY = -11; 092 093 /** 094 * Operation that redisplays the current buffer. 095 */ 096 short REDISPLAY = -13; 097 098 /** 099 * Operation that deletes the buffer from the cursor to the beginning. 100 */ 101 short KILL_LINE_PREV = -15; 102 103 /** 104 * Operation that deletes the previous word in the buffer. 105 */ 106 short DELETE_PREV_WORD = -16; 107 108 /** 109 * Operation that moves to the next character in the buffer. 110 */ 111 short NEXT_CHAR = -19; 112 113 /** 114 * Operation that moves to the previous character in the buffer. 115 */ 116 short REPEAT_PREV_CHAR = -20; 117 118 /** 119 * Operation that searches backwards in the command history. 120 */ 121 short SEARCH_PREV = -21; 122 123 /** 124 * Operation that repeats the character. 125 */ 126 short REPEAT_NEXT_CHAR = -24; 127 128 /** 129 * Operation that searches forward in the command history. 130 */ 131 short SEARCH_NEXT = -25; 132 133 /** 134 * Operation that moved to the previous whitespace. 135 */ 136 short PREV_SPACE_WORD = -27; 137 138 /** 139 * Operation that moved to the end of the current word. 140 */ 141 short TO_END_WORD = -29; 142 143 /** 144 * Operation that 145 */ 146 short REPEAT_SEARCH_PREV = -34; 147 148 /** 149 * Operation that 150 */ 151 short PASTE_PREV = -36; 152 153 /** 154 * Operation that 155 */ 156 short REPLACE_MODE = -37; 157 158 /** 159 * Operation that 160 */ 161 short SUBSTITUTE_LINE = -38; 162 163 /** 164 * Operation that 165 */ 166 short TO_PREV_CHAR = -39; 167 168 /** 169 * Operation that 170 */ 171 short NEXT_SPACE_WORD = -40; 172 173 /** 174 * Operation that 175 */ 176 short DELETE_PREV_CHAR = -41; 177 178 /** 179 * Operation that 180 */ 181 short ADD = -42; 182 183 /** 184 * Operation that 185 */ 186 short PREV_WORD = -43; 187 188 /** 189 * Operation that 190 */ 191 short CHANGE_META = -44; 192 193 /** 194 * Operation that 195 */ 196 short DELETE_META = -45; 197 198 /** 199 * Operation that 200 */ 201 short END_WORD = -46; 202 203 /** 204 * Operation that 205 */ 206 short INSERT = -48; 207 208 /** 209 * Operation that 210 */ 211 short REPEAT_SEARCH_NEXT = -49; 212 213 /** 214 * Operation that 215 */ 216 short PASTE_NEXT = -50; 217 218 /** 219 * Operation that 220 */ 221 short REPLACE_CHAR = -51; 222 223 /** 224 * Operation that 225 */ 226 short SUBSTITUTE_CHAR = -52; 227 228 /** 229 * Operation that 230 */ 231 short TO_NEXT_CHAR = -53; 232 233 /** 234 * Operation that undoes the previous operation. 235 */ 236 short UNDO = -54; 237 238 /** 239 * Operation that moved to the next word. 240 */ 241 short NEXT_WORD = -55; 242 243 /** 244 * Operation that deletes the previous character. 245 */ 246 short DELETE_NEXT_CHAR = -56; 247 248 /** 249 * Operation that toggles between uppercase and lowercase. 250 */ 251 short CHANGE_CASE = -57; 252 253 /** 254 * Operation that performs completion operation on the current word. 255 */ 256 short COMPLETE = -58; 257 258 /** 259 * Operation that exits the command prompt. 260 */ 261 short EXIT = -59; 262 263 /** 264 * Operation that pastes the contents of the cliboard into the line 265 */ 266 short PASTE = -60; 267 } 268