001 /* This file is part of the project "Hilbert II" - http://www.qedeq.org
002 *
003 * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>.
004 *
005 * "Hilbert II" is free software; you can redistribute
006 * it and/or modify it under the terms of the GNU General Public
007 * License as published by the Free Software Foundation; either
008 * version 2 of the License, or (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013 * GNU General Public License for more details.
014 */
015
016 package org.qedeq.kernel.bo.common;
017
018 import org.qedeq.kernel.se.base.module.Qedeq;
019 import org.qedeq.kernel.se.common.ModuleAddress;
020 import org.qedeq.kernel.se.common.Plugin;
021 import org.qedeq.kernel.se.common.SourceFileExceptionList;
022 import org.qedeq.kernel.se.state.AbstractState;
023 import org.qedeq.kernel.se.state.DependencyState;
024 import org.qedeq.kernel.se.state.FormallyProvedState;
025 import org.qedeq.kernel.se.state.LoadingImportsState;
026 import org.qedeq.kernel.se.state.LoadingState;
027 import org.qedeq.kernel.se.state.WellFormedState;
028
029
030 /**
031 * Represents a module and its states.
032 *
033 * @author Michael Meyling
034 */
035 public interface QedeqBo {
036
037 /**
038 * Has the module any basic failures? This includes errors during loading the module, during load
039 * of imported modules and logical checking. This includes no plugin errors.
040 *
041 * @return wWre there any basic errors?
042 */
043 public boolean hasBasicFailures();
044
045 /**
046 * Is this a error state the module is in?
047 *
048 * @return Were there any errors?
049 */
050 public boolean hasErrors();
051
052 /**
053 * Is this a warning state the module is in?
054 *
055 * @return Were there any warnings?
056 */
057 public boolean hasWarnings();
058
059 /**
060 * Get {@link ModuleAddress} of module.
061 *
062 * @return Address of module.
063 */
064 public ModuleAddress getModuleAddress();
065
066 /**
067 * Get the last successful state of the module.
068 *
069 * @return Last successful module state.
070 */
071 public AbstractState getLastSuccessfulState();
072
073 /**
074 * Get the current state of the module.
075 *
076 * @return Current module state.
077 */
078 public AbstractState getCurrentState();
079
080 /**
081 * Get currently running plugin.
082 *
083 * @return Currently running plugin. Might be <code>null</code>.
084 */
085 public Plugin getCurrentlyRunningPlugin();
086
087 /**
088 * Get module loading state.
089 *
090 * @return Module state.
091 */
092 public LoadingState getLoadingState();
093
094 /**
095 * Set completeness percentage.
096 *
097 * @return completeness Completeness of loading into memory in percent.
098 */
099 public int getLoadingCompleteness();
100
101 /**
102 * Get module loading imports state.
103 *
104 * @return module state.
105 */
106 public LoadingImportsState getLoadingImportsState();
107
108 /**
109 * Get module dependency state.
110 *
111 * @return module state.
112 */
113 public DependencyState getDependencyState();
114
115 /**
116 * Get module logical well formed state.
117 *
118 * @return module state.
119 */
120 public WellFormedState getWellFormedState();
121
122 /**
123 * Get module logical formally proved state.
124 *
125 * @return module state.
126 */
127 public FormallyProvedState getFormallyProvedState();
128
129 /**
130 * Get error list.
131 *
132 * @return Error list.
133 */
134 public SourceFileExceptionList getErrors();
135
136 /**
137 * Get warning list.
138 *
139 * @return Warning list.
140 */
141 public SourceFileExceptionList getWarnings();
142
143 /**
144 * Get module state description.
145 *
146 * @return module state description.
147 */
148 public String getStateDescription();
149
150 /**
151 * Get name of module.
152 *
153 * @return module name.
154 */
155 public String getName();
156
157 /**
158 * Get rule version information.
159 *
160 * @return rule version.
161 */
162 public String getRuleVersion();
163
164 /**
165 * Get original URL of module.
166 *
167 * @return URL of module.
168 */
169 public String getUrl();
170
171 /**
172 * Is this module already loaded?
173 *
174 * @return Is this module already loaded?
175 */
176 public boolean isLoaded();
177
178 /**
179 * Get module. Works only if module is already completely loaded.
180 *
181 * @return QEDEQ module if it is already loaded.
182 */
183 public Qedeq getQedeq();
184
185 /**
186 * Are all directly imported modules loaded?
187 *
188 * @return Are all directly imported modules loaded?
189 */
190 public boolean hasLoadedImports();
191
192 /**
193 * Are all required modules loaded?
194 *
195 * @return Are all required modules loaded?
196 */
197 public boolean hasLoadedRequiredModules();
198
199 /**
200 * Get labels and URLs of all referenced modules. Only available if module has loaded
201 * all required modules. Otherwise a runtime exception is thrown.
202 *
203 * @return URLs of all referenced modules.
204 * @throws IllegalStateException Module not yet loaded.
205 */
206 public ModuleReferenceList getRequiredModules();
207
208 /**
209 * Was the module successfully checked for being well formed?
210 *
211 *
212 * @return Module was checked?
213 */
214 public boolean isWellFormed();
215
216 /**
217 * Was the module successfully checked for being fully formal correct proved?
218 *
219 *
220 * @return Module was checked?
221 */
222 public boolean isFullyFormallyProved();
223
224 /**
225 * Get all supported languages for this QEDEQ module.
226 *
227 * @return Array of supported languages.
228 */
229 public String[] getSupportedLanguages();
230
231 /**
232 * Is the given language supported.
233 *
234 * @param language Language.
235 * @return Is this language supported?
236 */
237 public boolean isSupportedLanguage(String language);
238
239 /**
240 * Get default language for this QEDEQ module. This should be the original language
241 * of the module before it was translated. This value should be also within
242 * {@link #getSupportedLanguages()}.
243 *
244 * @return Original language.
245 */
246 public String getOriginalLanguage();
247
248 }
|