Changes:
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / ICompletionRequestor.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.core;
12
13 import net.sourceforge.phpdt.core.compiler.IProblem;
14
15 /**
16  * A completion requestor accepts results as they are computed and is aware
17  * of source positions to complete the various different results.
18  * <p>
19  * This interface may be implemented by clients.
20  * </p>
21  *
22  * @see ICodeAssist
23  * @since 2.0
24  */
25 public interface ICompletionRequestor {
26 /**
27  * Code assist notification of an anonymous type declaration completion.
28  * @param superTypePackageName Name of the package that contains the super type of this 
29  *              new anonymous type declaration .
30  * 
31  * @param superTypeName Name of the super type of this new anonymous type declaration.
32  * 
33  * @param parameterPackageNames Names of the packages in which the parameter types are declared.
34  *      Should contain as many elements as parameterTypeNames.
35  * 
36  * @param parameterTypeNames Names of the parameters types. 
37  *              Should contain as many elements as parameterPackageNames.
38  * 
39  * @param completionName The completion for the anonymous type declaration.
40  *              Can include zero, one or two brackets. If the closing bracket is included,
41  *              then the cursor should be placed before it.
42  * 
43  * @param modifiers The modifiers of the constructor.
44  * 
45  * @param completionStart The start position of insertion of the name of this new anonymous type declaration.
46  * 
47  * @param completionEnd The end position of insertion of the name of this new anonymous type declaration.
48  * 
49  * @param relevance The relevance of the completion proposal
50  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
51  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
52  *              value is higher.
53  * 
54  * NOTE - All package and type names are presented in their readable form:
55  *    Package names are in the form "a.b.c".
56  *    Base types are in the form "int" or "boolean".
57  *    Array types are in the qualified form "M[]" or "int[]".
58  *    Nested type names are in the qualified form "A.M".
59  *    The default package is represented by an empty array.
60  *
61  * NOTE: parameter names can be retrieved from the source model after the user selects a specific method.
62  */
63 void acceptAnonymousType(
64         char[] superTypePackageName,
65         char[] superTypeName,
66         char[][] parameterPackageNames,
67         char[][] parameterTypeNames,
68         char[][] parameterNames,
69         char[] completionName,
70         int modifiers,
71         int completionStart,
72         int completionEnd,
73         int relevance);
74 /**
75  * Code assist notification of a class completion.
76  * 
77  * @param packageName Declaring package name of the class.
78  * @param className Name of the class.
79  * @param completionName The completion for the class.  Can include ';' for imported classes.
80  * @param modifiers The modifiers of the class.
81  * @param completionStart The start position of insertion of the name of the class.
82  * @param completionEnd The end position of insertion of the name of the class.
83  * @param relevance The relevance of the completion proposal
84  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
85  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
86  *              value is higher.
87  *
88  * NOTE - All package and type names are presented in their readable form:
89  *    Package names are in the form "a.b.c".
90  *    Nested type names are in the qualified form "A.M".
91  *    The default package is represented by an empty array.
92  */
93 void acceptClass(
94         char[] packageName,
95         char[] className,
96         char[] completionName,
97         int modifiers,
98         int completionStart,
99         int completionEnd,
100         int relevance);
101 /**
102  * Code assist notification of a compilation error detected during completion.
103  *  @param error Only problems which are categorized as non-syntax errors are notified to the 
104  *     requestor, warnings are silently ignored.
105  *              In case an error got signalled, no other completions might be available,
106  *              therefore the problem message should be presented to the user.
107  *              The source positions of the problem are related to the source where it was
108  *              detected (might be in another compilation unit, if it was indirectly requested
109  *              during the code assist process).
110  *      Note: the problem knows its originating file name.
111  */
112 void acceptError(IProblem error);
113 /**
114  * Code assist notification of a field completion.
115  * 
116  * @param declaringTypePackageName Name of the package in which the type that contains this field is declared.
117  * @param declaringTypeName Name of the type declaring this new field.
118  * @param name Name of the field.
119  * @param typePackageName Name of the package in which the type of this field is declared.
120  * @param typeName Name of the type of this field.
121  * @param completionName The completion for the field.
122  * @param modifiers The modifiers of this field.
123  * @param completionStart The start position of insertion of the name of this field.
124  * @param completionEnd The end position of insertion of the name of this field.
125  * @param relevance The relevance of the completion proposal
126  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
127  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
128  *              value is higher.
129  * 
130  * NOTE - All package and type names are presented in their readable form:
131  *    Package names are in the form "a.b.c".
132  *    Base types are in the form "int" or "boolean".
133  *    Array types are in the qualified form "M[]" or "int[]".
134  *    Nested type names are in the qualified form "A.M".
135  *    The default package is represented by an empty array.
136  */
137 void acceptField(
138         char[] declaringTypePackageName,
139         char[] declaringTypeName,
140         char[] name,
141         char[] typePackageName,
142         char[] typeName,
143         char[] completionName,
144         int modifiers,
145         int completionStart,
146         int completionEnd,
147         int relevance);
148 /**
149  * Code assist notification of an interface completion.
150  * 
151  * @param packageName Declaring package name of the interface.
152  * @param className Name of the interface.
153  * @param completionName The completion for the interface.      Can include ';' for imported interfaces.
154  * @param modifiers The modifiers of the interface.
155  * @param completionStart The start position of insertion of the name of the interface.
156  * @param completionEnd The end position of insertion of the name of the interface.
157  * @param relevance The relevance of the completion proposal
158  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
159  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
160  *              value is higher.
161  *
162  * NOTE - All package and type names are presented in their readable form:
163  *    Package names are in the form "a.b.c".
164  *    Nested type names are in the qualified form "A.M".
165  *    The default package is represented by an empty array.
166  */
167 void acceptInterface(
168         char[] packageName,
169         char[] interfaceName,
170         char[] completionName,
171         int modifiers,
172         int completionStart,
173         int completionEnd,
174         int relevance);
175 /**
176  * Code assist notification of a keyword completion.
177  * @param keywordName The keyword source.
178  * @param completionStart The start position of insertion of the name of this keyword.
179  * @param completionEnd The end position of insertion of the name of this keyword.
180  * @param relevance The relevance of the completion proposal
181  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
182  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
183  *              value is higher.
184  */
185 void acceptKeyword(char[] keywordName, int completionStart, int completionEnd, int relevance);
186 /**
187  * Code assist notification of a label completion.
188  * 
189  * @param labelName The label source.
190  * @param completionStart The start position of insertion of the name of this label.
191  * @param completionEnd The end position of insertion of the name of this label.
192  * @param relevance The relevance of the completion proposal
193  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
194  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
195  *              value is higher.
196  */
197 void acceptLabel(char[] labelName, int completionStart, int completionEnd, int relevance);
198 /**
199  * Code assist notification of a local variable completion.
200  * 
201  * @param name Name of the new local variable.
202  * @param typePackageName Name of the package in which the type of this new local variable is declared.
203  * @param typeName Name of the type of this new local variable.
204  * @param modifiers The modifiers of this new local variable.
205  * @param completionStart The start position of insertion of the name of this new local variable.
206  * @param completionEnd The end position of insertion of the name of this new local variable.
207  * @param relevance The relevance of the completion proposal
208  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
209  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
210  *              value is higher.
211  *
212  * NOTE - All package and type names are presented in their readable form:
213  *    Package names are in the form "a.b.c".
214  *    Base types are in the form "int" or "boolean".
215  *    Array types are in the qualified form "M[]" or "int[]".
216  *    Nested type names are in the qualified form "A.M".
217  *    The default package is represented by an empty array.
218  */
219 void acceptLocalVariable(
220         char[] name,
221         char[] typePackageName,
222         char[] typeName,
223         int modifiers,
224         int completionStart,
225         int completionEnd,
226         int relevance);
227 /**
228  * Code assist notification of a method completion.
229  * 
230  * @param declaringTypePackageName Name of the package in which the type that contains this new method is declared.
231  * @param declaringTypeName Name of the type declaring this new method.
232  * @param selector Name of the new method.
233  * @param parameterPackageNames Names of the packages in which the parameter types are declared.
234  *      Should contain as many elements as parameterTypeNames.
235  * @param parameterTypeNames Names of the parameters types.
236  *      Should contain as many elements as parameterPackageNames.
237  * @param returnTypePackageName Name of the package in which the return type is declared.
238  * @param returnTypeName Name of the return type of this new method, should be <code>null</code> for a constructor.
239  * @param completionName The completion for the method. Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it.
240  * @param modifiers The modifiers of this new method.
241  * @param completionStart The start position of insertion of the name of this new method.
242  * @param completionEnd The end position of insertion of the name of this new method.
243  * @param relevance The relevance of the completion proposal
244  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
245  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
246  *              value is higher.
247  *
248  * NOTE - All package and type names are presented in their readable form:
249  *    Package names are in the form "a.b.c".
250  *    Base types are in the form "int" or "boolean".
251  *    Array types are in the qualified form "M[]" or "int[]".
252  *    Nested type names are in the qualified form "A.M".
253  *    The default package is represented by an empty array.
254  *
255  * NOTE: parameter names can be retrieved from the source model after the user selects a specific method.
256  */
257 void acceptMethod(
258         char[] declaringTypePackageName,
259         char[] declaringTypeName,
260         char[] selector,
261         char[][] parameterPackageNames,
262         char[][] parameterTypeNames,
263         char[][] parameterNames,
264         char[] returnTypePackageName,
265         char[] returnTypeName,
266         char[] completionName,
267         int modifiers,
268         int completionStart,
269         int completionEnd,
270         int relevance);
271
272 /**
273  * Code assist notification of a method completion.
274  * 
275  * @param declaringTypePackageName Name of the package in which the type that contains this new method is declared.
276  * @param declaringTypeName Name of the type declaring this new method.
277  * @param selector Name of the new method.
278  * @param parameterPackageNames Names of the packages in which the parameter types are declared.
279  *      Should contain as many elements as parameterTypeNames.
280  * @param parameterTypeNames Names of the parameters types.
281  *      Should contain as many elements as parameterPackageNames.
282  * @param returnTypePackageName Name of the package in which the return type is declared.
283  * @param returnTypeName Name of the return type of this new method, should be <code>null</code> for a constructor.
284  * @param completionName The completion for the method. Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it.
285  * @param modifiers The modifiers of this new method.
286  * @param completionStart The start position of insertion of the name of this new method.
287  * @param completionEnd The end position of insertion of the name of this new method.
288  * @param relevance The relevance of the completion proposal
289  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
290  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
291  *              value is higher.
292  *
293  * NOTE - All package and type names are presented in their readable form:
294  *    Package names are in the form "a.b.c".
295  *    Base types are in the form "int" or "boolean".
296  *    Array types are in the qualified form "M[]" or "int[]".
297  *    Nested type names are in the qualified form "A.M".
298  *    The default package is represented by an empty array.
299  *
300  * NOTE: parameter names can be retrieved from the source model after the user selects a specific method.
301  */
302 void acceptMethodDeclaration(
303         char[] declaringTypePackageName,
304         char[] declaringTypeName,
305         char[] selector,
306         char[][] parameterPackageNames,
307         char[][] parameterTypeNames,
308         char[][] parameterNames,
309         char[] returnTypePackageName,
310         char[] returnTypeName,
311         char[] completionName,
312         int modifiers,
313         int completionStart,
314         int completionEnd,
315         int relevance);
316 /**
317  * Code assist notification of a modifier completion.
318  * 
319  * @param modifierName The new modifier.
320  * @param completionStart The start position of insertion of the name of this new modifier.
321  * @param completionEnd The end position of insertion of the name of this new modifier.
322  * @param relevance The relevance of the completion proposal
323  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
324  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
325  *              value is higher.
326  */
327 void acceptModifier(char[] modifierName, int completionStart, int completionEnd, int relevance);
328 /**
329  * Code assist notification of a package completion.
330  * 
331  * @param packageName The package name.
332  * @param completionName The completion for the package. Can include '.*;' for imports.
333  * @param completionStart The start position of insertion of the name of this new package.
334  * @param completionEnd The end position of insertion of the name of this new package.
335  * @param relevance The relevance of the completion proposal
336  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
337  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
338  *              value is higher.
339  *
340  * NOTE - All package names are presented in their readable form:
341  *    Package names are in the form "a.b.c".
342  *    The default package is represented by an empty array.
343  */
344 void acceptPackage(
345         char[] packageName,
346         char[] completionName,
347         int completionStart,
348         int completionEnd,
349         int relevance);
350 /**
351  * Code assist notification of a type completion.
352  * 
353  * @param packageName Declaring package name of the type.
354  * @param typeName Name of the type.
355  * @param completionName The completion for the type. Can include ';' for imported types.
356  * @param completionStart The start position of insertion of the name of the type.
357  * @param completionEnd The end position of insertion of the name of the type.
358  * @param relevance The relevance of the completion proposal
359  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
360  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
361  *              value is higher.
362  *
363  * NOTE - All package and type names are presented in their readable form:
364  *    Package names are in the form "a.b.c".
365  *    Nested type names are in the qualified form "A.M".
366  *    The default package is represented by an empty array.
367  */
368 void acceptType(
369         char[] packageName,
370         char[] typeName,
371         char[] completionName,
372         int completionStart,
373         int completionEnd,
374         int relevance);
375         
376 /**
377  * Code assist notification of a variable name completion.
378  * 
379  * @param typePackageName Name of the package in which the type of this variable is declared.
380  * @param typeName Name of the type of this variable.
381  * @param name Name of the variable.
382  * @param completionName The completion for the variable.
383  * @param completionStart The start position of insertion of the name of this variable.
384  * @param completionEnd The end position of insertion of the name of this variable.
385  * @param relevance The relevance of the completion proposal
386  *              It is a positive integer which are used for determine if this proposal is more relevant than another proposal.
387  *              This value can only be used for compare relevance. A proposal is more relevant than another if his relevance
388  *              value is higher.
389  *
390  * NOTE - All package and type names are presented in their readable form:
391  *    Package names are in the form "a.b.c".
392  *    Base types are in the form "int" or "boolean".
393  *    Array types are in the qualified form "M[]" or "int[]".
394  *    Nested type names are in the qualified form "A.M".
395  *    The default package is represented by an empty array.
396  */
397 void acceptVariableName(
398         char[] typePackageName,
399         char[] typeName,
400         char[] name,
401         char[] completionName,
402         int completionStart,
403         int completionEnd,
404         int relevance);
405 }