view dwtx/jface/fieldassist/IControlContentAdapter2.d @ 192:c3583c6ec027

Added missing default cases for switch statements
author Frank Benoit <benoit@tionex.de>
date Mon, 03 Nov 2008 22:52:26 +0100
parents 46a6e0e6ccd4
children
line wrap: on
line source

/*******************************************************************************
 * Copyright (c) 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 * Port to the D programming language:
 *     Frank Benoit <benoit@tionex.de>
 *******************************************************************************/
module dwtx.jface.fieldassist.IControlContentAdapter2;

import dwt.graphics.Point;
import dwt.widgets.Control;

/**
 * This interface is used by a {@link ContentProposalAdapter} in order to
 * retrieve and set the selection range in a control.
 * 
 * @since 3.4
 */
public interface IControlContentAdapter2 {
    /**
     * Get the current selection range in the control. The x coordinate of the
     * returned point is the position of the first selected character and the y
     * coordinate of the returned point is the position of the last selected
     * character. The positions are specified as a zero-based index into the
     * string. Valid ranges are from 0 to N, where N is the size of the contents
     * string. A value of N indicates that the last character is in the
     * selection.
     * 
     * @param control
     *            the control whose position is to be retrieved.
     * @return a point representing the selection start and end
     */
    public Point getSelection(Control control);

    /**
     * Set the current selection range in the control. The x coordinate of the
     * provided point is the position of the first selected character and the y
     * coordinate of the point is the position of the last selected character.
     * The positions are specified as a zero-based index into the string. Valid
     * ranges are from 0 to N, where N is the size of the contents string. A
     * value of N indicates that the last character is in the selection. If the
     * x and y coordinates are the same, then there is no selection.
     * 
     * @param control
     *            the control whose position is to be retrieved.
     * @param range
     *            a point representing the selection start and end
     */
    public void setSelection(Control control, Point range);

}