001 package echopoint.able;
002 /*
003 * This file is part of the Echo Point Project. This project is a collection
004 * of Components that have extended the Echo Web Application Framework.
005 *
006 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
007 *
008 * The contents of this file are subject to the Mozilla Public License Version
009 * 1.1 (the "License"); you may not use this file except in compliance with
010 * the License. You may obtain a copy of the License at
011 * http://www.mozilla.org/MPL/
012 *
013 * Software distributed under the License is distributed on an "AS IS" basis,
014 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
015 * for the specific language governing rights and limitations under the
016 * License.
017 *
018 * Alternatively, the contents of this file may be used under the terms of
019 * either the GNU General Public License Version 2 or later (the "GPL"), or
020 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
021 * in which case the provisions of the GPL or the LGPL are applicable instead
022 * of those above. If you wish to allow use of your version of this file only
023 * under the terms of either the GPL or the LGPL, and not to allow others to
024 * use your version of this file under the terms of the MPL, indicate your
025 * decision by deleting the provisions above and replace them with the notice
026 * and other provisions required by the GPL or the LGPL. If you do not delete
027 * the provisions above, a recipient may use your version of this file under
028 * the terms of any one of the MPL, the GPL or the LGPL.
029 */
030
031
032 /**
033 * The <code>MouseCursorable</code> interface is used to set a
034 * new cursor value when the mouse is moved over a component.
035 */
036 public interface MouseCursorable extends Delegateable {
037
038 public static final String PROPERTY_MOUSE_CURSOR = "mouseCursor";
039 public static final String PROPERTY_MOUSE_CURSOR_URI = "mouseCursorUri";
040
041 /**
042 * The UA determines the cursor to display based on the current context.
043 * This is the starting value for MouseCursorables
044 */
045 public static final int CURSOR_AUTO = 0;
046
047 /** The platform-dependent default cursor. Often rendered as an arrow. */
048 public static final int CURSOR_DEFAULT = 1;
049
050 /** A simple crosshair (e.g., short line segments resembling a "+" sign). */
051 public static final int CURSOR_CROSSHAIR = 2;
052
053 /** The cursor is a pointer that indicates a link. */
054 public static final int CURSOR_POINTER = 3;
055
056 /** Indicates something is to be moved. */
057 public static final int CURSOR_MOVE = 4;
058
059 /** Used when the movement starts from the east corner of the box. */
060 public static final int CURSOR_E_RESIZE = 5;
061
062 /** Used when the movement starts from the northeast corner of the box. */
063 public static final int CURSOR_NE_RESIZE = 6;
064
065 /** Used when the movement starts from the northwest corner of the box. */
066 public static final int CURSOR_NW_RESIZE = 7;
067
068 /** Used when the movement starts from the north corner of the box. */
069 public static final int CURSOR_N_RESIZE = 8;
070
071 /** Used when the movement starts from the southeast corner of the box. */
072 public static final int CURSOR_SE_RESIZE = 9;
073
074 /** Used when the movement starts from the southwest corner of the box. */
075 public static final int CURSOR_SW_RESIZE = 10;
076
077 /** Used when the movement starts from the south corner of the box. */
078 public static final int CURSOR_S_RESIZE = 11;
079
080 /** Used when the movement starts from the west corner of the box. */
081 public static final int CURSOR_W_RESIZE = 12;
082
083 /** Indicates text that may be selected. Often rendered as an I-bar. */
084 public static final int CURSOR_TEXT = 13;
085
086 /** Indicates that the program is busy and the user should wait. Often rendered as a watch or hourglass. */
087 public static final int CURSOR_WAIT = 14;
088
089 /** Help is available for the object under the cursor. Often rendered as a question mark or a balloon. */
090 public static final int CURSOR_HELP = 15;
091
092 /** The user agent retrieves the cursor from the resource designated by the URI. */
093 public static final int CURSOR_CUSTOM_URI = 16;
094
095 /**
096 * Returns the current mouse cursor in use. This will be one of the following values.
097 * <ul>
098 * <li>CURSOR_DEFAULT</li>
099 * <li>CURSOR_AUTO</li>
100 * <li>CURSOR_CROSSHAIR</li>
101 * <li>CURSOR_POINTER</li>
102 * <li>CURSOR_MOVE</li>
103 * <li>CURSOR_E_RESIZE</li>
104 * <li>CURSOR_NE_RESIZE</li>
105 * <li>CURSOR_NW_RESIZE</li>
106 * <li>CURSOR_N_RESIZE</li>
107 * <li>CURSOR_SE_RESIZE</li>
108 * <li>CURSOR_SW_RESIZE</li>
109 * <li>CURSOR_S_RESIZE</li>
110 * <li>CURSOR_W_RESIZE</li>
111 * <li>CURSOR_TEXT</li>
112 * <li>CURSOR_WAIT</li>
113 * <li>CURSOR_HELP</li>
114 * <li>CURSOR_CUSTOM</li>
115 * </ul>
116 * @return The current mouse cursor in use.
117 */
118 public int getMouseCursor();
119
120 /**
121 * @return The custom URI for the mouse cursor or null
122 */
123 public String getMouseCursorUri();
124
125 /**
126 * Sets the mouse cursor to use. This will be one of the following values.
127 * <ul>
128 * <li>CURSOR_DEFAULT</li>
129 * <li>CURSOR_AUTO</li>
130 * <li>CURSOR_CROSSHAIR</li>
131 * <li>CURSOR_POINTER</li>
132 * <li>CURSOR_MOVE</li>
133 * <li>CURSOR_E_RESIZE</li>
134 * <li>CURSOR_NE_RESIZE</li>
135 * <li>CURSOR_NW_RESIZE</li>
136 * <li>CURSOR_N_RESIZE</li>
137 * <li>CURSOR_SE_RESIZE</li>
138 * <li>CURSOR_SW_RESIZE</li>
139 * <li>CURSOR_S_RESIZE</li>
140 * <li>CURSOR_W_RESIZE</li>
141 * <li>CURSOR_TEXT</li>
142 * <li>CURSOR_WAIT</li>
143 * <li>CURSOR_HELP</li>
144 * <li>CURSOR_CUSTOM</li>
145 * </ul>
146 * @param mouseCursor - the mouse cursor to use
147 */
148 public void setMouseCursor(int mouseCursor);
149
150 /**
151 * Sets the URI to a custom platform mouse cursor. This will only
152 * be used if the mosue cusor is set to CURSOR_CUSTOM.
153 *
154 * @param mouseCursorUri the URI to a custom platform mouse cursor.
155 */
156 public void setMouseCursorUri(String mouseCursorUri);
157 }