|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 package com.nokia.s60tools.apiquery.shared.searchmethod; |
|
20 |
|
21 import java.util.Collection; |
|
22 import java.util.Hashtable; |
|
23 import java.util.Set; |
|
24 import org.eclipse.swt.widgets.Composite; |
|
25 import com.nokia.s60tools.apiquery.shared.datatypes.APIDetails; |
|
26 import com.nokia.s60tools.apiquery.shared.datatypes.APIQueryParameters; |
|
27 import com.nokia.s60tools.apiquery.shared.datatypes.APIShortDescription; |
|
28 import com.nokia.s60tools.apiquery.shared.datatypes.APIShortDescriptionSearchResults; |
|
29 import com.nokia.s60tools.apiquery.shared.datatypes.config.AbstractEntryStorage; |
|
30 import com.nokia.s60tools.apiquery.shared.exceptions.QueryOperationFailedException; |
|
31 import com.nokia.s60tools.apiquery.shared.searchmethod.ui.AbstractUiFractionComposite; |
|
32 |
|
33 /** |
|
34 * Interface that has to be implemnted by all |
|
35 * search method instances. |
|
36 */ |
|
37 public interface ISearchMethodExtension { |
|
38 |
|
39 /** |
|
40 * Gets the extension info for the search method. |
|
41 * @return Returns extension info for the search method. |
|
42 */ |
|
43 ISearchMethodExtensionInfo getExtensionInfo(); |
|
44 |
|
45 /** |
|
46 * This method is called when we do not need |
|
47 * the services of this extension. This gives |
|
48 * possibilities for the extension to make |
|
49 * any shutdown related operations it sees |
|
50 * as necessary. |
|
51 */ |
|
52 public void notifyExtensionShutdown(); |
|
53 |
|
54 /** |
|
55 * Returns the search method specific configuration UI as |
|
56 * UI Composite that can be disposed and re-created whenever needed. |
|
57 * @param parent Parent composite for the created configuration UI. |
|
58 * @return Returns the search method specific configuration UI. |
|
59 */ |
|
60 public AbstractUiFractionComposite createExtensionConfigurationUi(Composite parent); |
|
61 |
|
62 /** |
|
63 * Runs API Query with the given parameters. |
|
64 * Throws <code>QueryOperationFailedException</code> if something failed |
|
65 * during query operation. |
|
66 * @param parameters Parameters guiding the query. |
|
67 * @return APIShortDescriptionSearchResults containing Collection of API summary objects |
|
68 * for the APIs found based on the query and possible QueryOperationFailedException search errors Collection. |
|
69 */ |
|
70 public APIShortDescriptionSearchResults runAPIQuery(APIQueryParameters parameters); |
|
71 |
|
72 /** |
|
73 * Gets API details for the given API. |
|
74 * Throws <code>QueryOperationFailedException</code> if something failed |
|
75 * during query operation. |
|
76 * @param summary API summary object to get details for. |
|
77 * @return API details for the given summary object. |
|
78 * @throws QueryOperationFailedException |
|
79 */ |
|
80 public APIDetails getAPIDetails(APIShortDescription summary) throws QueryOperationFailedException; |
|
81 |
|
82 /** |
|
83 * Gets API details for the given APIs. |
|
84 * Throws <code>QueryOperationFailedException</code> if something failed |
|
85 * during query operation. |
|
86 * @param list of API summary objects to get details for. |
|
87 * @return API details for the given summary objects. Given API name as key and APIDetails as value. |
|
88 * If cant found or parse a Details, an empty Details is added to collection. |
|
89 * @throws QueryOperationFailedException |
|
90 */ |
|
91 Hashtable<String, APIDetails> getAPIDetails(Collection<APIShortDescription> apis) throws QueryOperationFailedException; |
|
92 |
|
93 |
|
94 /** |
|
95 * Can be used to check if a certain query type |
|
96 * is supported by the search method. |
|
97 * @param queryType Query type defined in APIQueryParameters to be checked. |
|
98 * @return <code>true</code> if the query type is supported, otherwise <code>false</code>. |
|
99 * @see APIQueryParameters#QUERY_BY_API_NAME |
|
100 * @see APIQueryParameters#QUERY_BY_SUBSYSTEM_NAME |
|
101 * @see APIQueryParameters#QUERY_BY_DLL_NAME |
|
102 * @see APIQueryParameters#QUERY_BY_LIB_NAME |
|
103 * @see APIQueryParameters#QUERY_BY_HEADER_NAME |
|
104 * @see APIQueryParameters#QUERY_BY_CRPS_KEY_NAME |
|
105 */ |
|
106 public boolean isSupportedQueryType(int queryType); |
|
107 |
|
108 /** |
|
109 * Returns search method specific configuration storage instance. |
|
110 * @return Data Source specific configuration storage instance. |
|
111 */ |
|
112 public AbstractEntryStorage getEntryStorageInstance(); |
|
113 |
|
114 /** |
|
115 * Get API details to show in report. |
|
116 * @return API Detail topics to be shown in report |
|
117 */ |
|
118 public String[] getAPIDetailsToReport(Set <String> usedAPIs, Hashtable<String, APIDetails> projectUsingAPIDetails); |
|
119 |
|
120 /** |
|
121 * Maps query type to API Detail topic in API Details. |
|
122 * @param queryType Query type constant. |
|
123 * @return Name of the API Detail. |
|
124 */ |
|
125 public String getAPIDetailNameInDetailsByQueryType(int queryType); |
|
126 |
|
127 /** |
|
128 * Maps API Detail topic in API Details to query type. |
|
129 * @param queryType Query type constant. |
|
130 * @return Query type int described in {@link APIQueryParameters} or -1 if not supported. |
|
131 */ |
|
132 public int getQueryTypeByAPIDetailNameInDetails(String queryType); |
|
133 |
|
134 /** |
|
135 * |
|
136 * @return true for web query and false for other data sources |
|
137 */ |
|
138 public boolean isAsyncQueryPreferred(); |
|
139 |
|
140 /** |
|
141 * if it's for a header serach,then should the headerlink be enabled so that user can click on it and open it. |
|
142 */ |
|
143 public boolean serachHeaderLinkEnable(); |
|
144 |
|
145 /** |
|
146 * opens the supplied header file.Provide an implementation if headerlink is enabled. |
|
147 * @param header : header name |
|
148 * @param source : APIShortDescription.getSource() |
|
149 * @return 0-successfully opened , 1-error |
|
150 */ |
|
151 public int openHeaderFile(String headerName,String source); |
|
152 |
|
153 /* |
|
154 * |
|
155 */ |
|
156 public String[] getHeaderSourceList(); |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 } |