129
|
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.jface.text.IDocumentInformationMappingExtension;
|
|
14
|
|
15 import dwt.dwthelper.utils;
|
|
16
|
|
17 /**
|
|
18 * Extension to {@link dwtx.jface.text.IDocumentInformationMapping}.
|
|
19 * <p>
|
|
20 * Extends the information available in the mapping by providing explicit access
|
|
21 * to the isomorphic portion of the basically homomorphic information mapping.
|
|
22 *
|
|
23 * @see dwtx.jface.text.IDocumentInformationMapping
|
|
24 * @since 3.0
|
|
25 */
|
|
26 public interface IDocumentInformationMappingExtension {
|
|
27
|
|
28 /**
|
|
29 * Adheres to
|
|
30 * <code>originRegion=toOriginRegion(toExactImageRegion(originRegion))</code>,
|
|
31 * if <code>toExactImageRegion(originRegion) !is null</code>. Returns
|
|
32 * <code>null</code> if there is no image for the given origin region.
|
|
33 *
|
|
34 * @param originRegion the origin region
|
|
35 * @return the exact image region or <code>null</code>
|
|
36 * @throws BadLocationException if origin region is not a valid region in
|
|
37 * the origin document
|
|
38 */
|
|
39 IRegion toExactImageRegion(IRegion originRegion) throws BadLocationException;
|
|
40
|
|
41 /**
|
|
42 * Returns the segments of the image document that exactly correspond to the
|
|
43 * given region of the original document. Returns <code>null</code> if
|
|
44 * there are no such image regions.
|
|
45 *
|
|
46 * @param originRegion the region in the origin document
|
|
47 * @return the segments in the image document or <code>null</code>
|
|
48 * @throws BadLocationException in case the given origin region is not valid
|
|
49 * in the original document
|
|
50 */
|
|
51 IRegion[] toExactImageRegions(IRegion originRegion) throws BadLocationException;
|
|
52
|
|
53 /**
|
|
54 * Returns the fragments of the original document that exactly correspond to
|
|
55 * the given region of the image document.
|
|
56 *
|
|
57 * @param imageRegion the region in the image document
|
|
58 * @return the fragments in the origin document
|
|
59 * @throws BadLocationException in case the given image region is not valid
|
|
60 * in the image document
|
|
61 */
|
|
62 IRegion[] toExactOriginRegions(IRegion imageRegion) throws BadLocationException;
|
|
63
|
|
64 /**
|
|
65 * Returns the length of the image document.
|
|
66 *
|
|
67 * @return the length of the image document
|
|
68 */
|
|
69 int getImageLength();
|
|
70
|
|
71 /**
|
|
72 * Returns the maximal sub-regions of the given origin region which are
|
|
73 * completely covered. I.e. each offset in a sub-region has a corresponding
|
|
74 * image offset. Returns <code>null</code> if there are no such
|
|
75 * sub-regions.
|
|
76 *
|
|
77 * @param originRegion the region in the origin document
|
|
78 * @return the sub-regions with complete coverage or <code>null</code>
|
|
79 * @throws BadLocationException in case the given origin region is not valid
|
|
80 * in the original document
|
|
81 */
|
|
82 IRegion[] getExactCoverage(IRegion originRegion) throws BadLocationException;
|
|
83 }
|