75
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2005 IBM Corporation and others.
|
|
3 * All rights reserved. This program and the accompanying materials
|
|
4 * are made available under the terms of the Eclipse Public License v1.0
|
|
5 * which accompanies this distribution, and is available at
|
|
6 * http://www.eclipse.org/legal/epl-v10.html
|
|
7 *
|
|
8 * Contributors:
|
|
9 * IBM Corporation - initial API and implementation
|
|
10 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.ui.forms.widgets.ILayoutExtension;
|
|
14 import dwt.widgets.Composite;
|
|
15 /**
|
|
16 * Classes that extend abstract class Layout and implement this interface can
|
|
17 * take part in layout computation of the TableWrapLayout manager. This layout
|
|
18 * uses alternative algorithm that computes columns before rows. It allows it
|
|
19 * to 'flow' wrapped text proportionally (similar to the way web browser
|
|
20 * renders tables). Custom layout managers that implement this interface will
|
|
21 * allow TableWrapLayout to properly compute width hint to pass.
|
|
22 *
|
|
23 * @see TableWrapLayout
|
|
24 * @see ColumnLayout
|
|
25 * @since 3.0
|
|
26 */
|
|
27 public interface ILayoutExtension {
|
|
28 /**
|
|
29 * Computes the minimum width of the parent. All widgets capable of word
|
|
30 * wrapping should return the width of the longest word that cannot be
|
|
31 * broken any further.
|
|
32 *
|
|
33 * @param parent the parent composite
|
|
34 * @param changed <code>true</code> if the cached information should be
|
|
35 * flushed, <code>false</code> otherwise.
|
|
36 * @return the minimum width of the parent composite
|
|
37 */
|
|
38 public int computeMinimumWidth(Composite parent, bool changed);
|
|
39 /**
|
|
40 * Computes the maximum width of the parent. All widgets capable of word
|
|
41 * wrapping should return the length of the entire text with wrapping
|
|
42 * turned off.
|
|
43 *
|
|
44 * @param parent the parent composite
|
|
45 * @param changed <code>true</code> if the cached information
|
|
46 * should be flushed, <code>false</code> otherwise.
|
|
47 * @return the maximum width of the parent composite
|
|
48 */
|
|
49 public int computeMaximumWidth(Composite parent, bool changed);
|
|
50 }
|