Mercurial > projects > dwt-addons
comparison dwtx/ui/internal/forms/widgets/ParagraphSegment.d @ 75:5d489b9f966c
Fix continue porting
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 24 May 2008 05:11:16 +0200 |
parents | |
children | 04b47443bb01 |
comparison
equal
deleted
inserted
replaced
74:dad2e11b8ae4 | 75:5d489b9f966c |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2000, 2007 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.internal.forms.widgets.ParagraphSegment; | |
14 | |
15 import dwtx.ui.internal.forms.widgets.Locator; | |
16 import dwtx.ui.internal.forms.widgets.SelectionData; | |
17 | |
18 import dwt.graphics.GC; | |
19 import dwt.graphics.Rectangle; | |
20 | |
21 import dwt.dwthelper.utils; | |
22 | |
23 import tango.util.collection.HashMap; | |
24 | |
25 /** | |
26 * @version 1.0 | |
27 * @author | |
28 */ | |
29 public abstract class ParagraphSegment { | |
30 | |
31 alias HashMap!(String,Object) Hashtable; | |
32 /** | |
33 * Moves the locator according to the content of this segment. | |
34 * @param gc | |
35 * @param wHint | |
36 * @param loc | |
37 * @param objectTable | |
38 * @param computeHeightOnly | |
39 * @return <code>true</code> if text wrapped to the new line, <code>false</code> otherwise. | |
40 */ | |
41 public abstract bool advanceLocator(GC gc, int wHint, Locator loc, Hashtable objectTable, bool computeHeightOnly); | |
42 /** | |
43 * Computes bounding rectangles and row heights of this segments. | |
44 * @param gc | |
45 * @param width | |
46 * @param loc | |
47 * @param resourceTable | |
48 * @param selected | |
49 */ | |
50 public abstract void layout(GC gc, int width, Locator loc, Hashtable resourceTable, bool selected); | |
51 /** | |
52 * Paints this segment. | |
53 * @param gc | |
54 * @param hover | |
55 * @param resourceTable | |
56 * @param selected | |
57 * @param selData | |
58 * @param region | |
59 */ | |
60 public abstract void paint(GC gc, bool hover, Hashtable resourceTable, bool selected, SelectionData selData, Rectangle region); | |
61 /** | |
62 * Paints this segment. | |
63 * @param gc | |
64 * @param resourceTable | |
65 * @param selData | |
66 */ | |
67 public abstract void computeSelection(GC gc, Hashtable resourceTable, SelectionData selData); | |
68 /** | |
69 * Tests if the coordinates are contained in one of the | |
70 * bounding rectangles of this segment. | |
71 * @param x | |
72 * @param y | |
73 * @return true if inside the bounding rectangle, false otherwise. | |
74 */ | |
75 public abstract bool contains(int x, int y); | |
76 /** | |
77 * Tests if the source rectangle intersects with | |
78 * one of the bounding rectangles of this segment. | |
79 * @param rect | |
80 * @return true if the two rectangles intersect, false otherwise. | |
81 */ | |
82 public abstract bool intersects(Rectangle rect); | |
83 /** | |
84 * Returns the tool tip of this segment or <code>null</code> | |
85 * if not defined. | |
86 * @return tooltip or <code>null</code>. | |
87 */ | |
88 public String getTooltipText() { | |
89 return null; | |
90 } | |
91 /** | |
92 * Clears the text metrics cache for the provided font id. | |
93 * @param fontId the id of the font that the cache is kept for. | |
94 * | |
95 */ | |
96 public void clearCache(String fontId) { | |
97 } | |
98 } |