|
1 /****************************************************************************** |
|
2 * |
|
3 * |
|
4 * |
|
5 * Copyright (C) 1997-2008 by Dimitri van Heesch. |
|
6 * |
|
7 * Permission to use, copy, modify, and distribute this software and its |
|
8 * documentation under the terms of the GNU General Public License is hereby |
|
9 * granted. No representations are made about the suitability of this software |
|
10 * for any purpose. It is provided "as is" without express or implied warranty. |
|
11 * See the GNU General Public License for more details. |
|
12 * |
|
13 * Documents produced by Doxygen are derivative works derived from the |
|
14 * input used in their production; they are not affected by this license. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TRANSLATOR_H |
|
19 #define TRANSLATOR_H |
|
20 |
|
21 #include "qtbc.h" |
|
22 #include "classdef.h" |
|
23 #include "util.h" |
|
24 #include "config.h" |
|
25 |
|
26 class Translator |
|
27 { |
|
28 private: |
|
29 /* Tables for encoding conversions. */ |
|
30 static const char Win1250ToISO88592Tab[]; |
|
31 static const char ISO88592ToWin1250Tab[]; |
|
32 static const unsigned char Koi8RToWindows1251Tab[128]; |
|
33 static const unsigned char Windows1251ToKoi8RTab[128]; |
|
34 |
|
35 protected: |
|
36 /*! Returns the string converted from windows-1250 to iso-8859-2. */ |
|
37 QCString Win1250ToISO88592(const QCString & sInput); |
|
38 |
|
39 /*! Returns the string converted from iso-8859-2 to windows-1250. */ |
|
40 QCString ISO88592ToWin1250(const QCString & sInput); |
|
41 |
|
42 /*! Returns the string converted from koi8-r to windows-1251. */ |
|
43 QCString Koi8RToWindows1251( const QCString & sInput ); |
|
44 |
|
45 /*! Returns the string converted from windows-1251 to koi8-r. */ |
|
46 QCString Windows1251ToKoi8R( const QCString & sInput ); |
|
47 |
|
48 /*! Returns the string converted from Japanese-EUC to SJIS. */ |
|
49 QCString JapaneseEucToSjis( const QCString & sInput ); |
|
50 |
|
51 public: |
|
52 |
|
53 /*! This method is used to provide warning message that is displayed |
|
54 * if the user chooses a language whose translation is not up to date. |
|
55 * It is implemented by the adapter classes. |
|
56 */ |
|
57 virtual QCString updateNeededMessage() { return ""; } |
|
58 virtual ~Translator() {} |
|
59 |
|
60 // Please, have a look at comments inside the translator_en.h file |
|
61 // to learn the meaning of the following methods. The translator_en.h |
|
62 // file contains the TranslatorEnglish implementation, which is |
|
63 // always up-to-date (by definition). |
|
64 |
|
65 // --- Language control methods ------------------- |
|
66 |
|
67 virtual QCString idLanguage() = 0; |
|
68 virtual QCString latexLanguageSupportCommand() = 0; |
|
69 virtual QCString idLanguageCharset() = 0; |
|
70 |
|
71 // --- Language translation methods ------------------- |
|
72 |
|
73 virtual QCString trRelatedFunctions() = 0; |
|
74 virtual QCString trRelatedSubscript() = 0; |
|
75 virtual QCString trDetailedDescription() = 0; |
|
76 virtual QCString trMemberTypedefDocumentation() = 0; |
|
77 virtual QCString trMemberEnumerationDocumentation() = 0; |
|
78 virtual QCString trMemberFunctionDocumentation() = 0; |
|
79 virtual QCString trMemberDataDocumentation() = 0; |
|
80 virtual QCString trMore() = 0; |
|
81 virtual QCString trListOfAllMembers() = 0; |
|
82 virtual QCString trMemberList() = 0; |
|
83 virtual QCString trThisIsTheListOfAllMembers() = 0; |
|
84 virtual QCString trIncludingInheritedMembers() = 0; |
|
85 virtual QCString trGeneratedAutomatically(const char *s) = 0; |
|
86 virtual QCString trEnumName() = 0; |
|
87 virtual QCString trEnumValue() = 0; |
|
88 virtual QCString trDefinedIn() = 0; |
|
89 |
|
90 // quick reference sections |
|
91 |
|
92 virtual QCString trModules() = 0; |
|
93 virtual QCString trClassHierarchy() = 0; |
|
94 virtual QCString trCompoundList() = 0; |
|
95 virtual QCString trFileList() = 0; |
|
96 //virtual QCString trHeaderFiles() = 0; |
|
97 virtual QCString trCompoundMembers() = 0; |
|
98 virtual QCString trFileMembers() = 0; |
|
99 virtual QCString trRelatedPages() = 0; |
|
100 virtual QCString trExamples() = 0; |
|
101 virtual QCString trSearch() = 0; |
|
102 virtual QCString trClassHierarchyDescription() = 0; |
|
103 virtual QCString trFileListDescription(bool extractAll) = 0; |
|
104 virtual QCString trCompoundListDescription() = 0; |
|
105 virtual QCString trCompoundMembersDescription(bool extractAll) = 0; |
|
106 virtual QCString trFileMembersDescription(bool extractAll) = 0; |
|
107 //virtual QCString trHeaderFilesDescription() = 0; |
|
108 virtual QCString trExamplesDescription() = 0; |
|
109 virtual QCString trRelatedPagesDescription() = 0; |
|
110 virtual QCString trModulesDescription() = 0; |
|
111 //virtual QCString trNoDescriptionAvailable() = 0; |
|
112 |
|
113 // index titles (the project name is prepended for these) |
|
114 |
|
115 virtual QCString trDocumentation() = 0; |
|
116 virtual QCString trModuleIndex() = 0; |
|
117 virtual QCString trHierarchicalIndex() = 0; |
|
118 virtual QCString trCompoundIndex() = 0; |
|
119 virtual QCString trFileIndex() = 0; |
|
120 virtual QCString trModuleDocumentation() = 0; |
|
121 virtual QCString trClassDocumentation() = 0; |
|
122 virtual QCString trFileDocumentation() = 0; |
|
123 virtual QCString trExampleDocumentation() = 0; |
|
124 virtual QCString trPageDocumentation() = 0; |
|
125 virtual QCString trReferenceManual() = 0; |
|
126 virtual QCString trDefines() = 0; |
|
127 virtual QCString trFuncProtos() = 0; |
|
128 virtual QCString trTypedefs() = 0; |
|
129 virtual QCString trEnumerations() = 0; |
|
130 virtual QCString trFunctions() = 0; |
|
131 virtual QCString trVariables() = 0; |
|
132 virtual QCString trEnumerationValues() = 0; |
|
133 virtual QCString trDefineDocumentation() = 0; |
|
134 virtual QCString trFunctionPrototypeDocumentation() = 0; |
|
135 virtual QCString trTypedefDocumentation() = 0; |
|
136 virtual QCString trEnumerationTypeDocumentation() = 0; |
|
137 virtual QCString trFunctionDocumentation() = 0; |
|
138 virtual QCString trVariableDocumentation() = 0; |
|
139 virtual QCString trCompounds() = 0; |
|
140 virtual QCString trGeneratedAt(const char *date,const char *projName) = 0; |
|
141 virtual QCString trWrittenBy() = 0; |
|
142 virtual QCString trClassDiagram(const char *clName) = 0; |
|
143 virtual QCString trForInternalUseOnly() = 0; |
|
144 //virtual QCString trReimplementedForInternalReasons() = 0; |
|
145 virtual QCString trWarning() = 0; |
|
146 //virtual QCString trBugsAndLimitations() = 0; |
|
147 virtual QCString trVersion() = 0; |
|
148 virtual QCString trDate() = 0; |
|
149 virtual QCString trReturns() = 0; |
|
150 virtual QCString trSeeAlso() = 0; |
|
151 virtual QCString trParameters() = 0; |
|
152 virtual QCString trExceptions() = 0; |
|
153 virtual QCString trGeneratedBy() = 0; |
|
154 |
|
155 ////////////////////////////////////////////////////////////////////////// |
|
156 // new since 0.49-990307 |
|
157 ////////////////////////////////////////////////////////////////////////// |
|
158 |
|
159 virtual QCString trNamespaceList() = 0; |
|
160 virtual QCString trNamespaceListDescription(bool extractAll) = 0; |
|
161 virtual QCString trFriends() = 0; |
|
162 |
|
163 ////////////////////////////////////////////////////////////////////////// |
|
164 // new since 0.49-990405 |
|
165 ////////////////////////////////////////////////////////////////////////// |
|
166 |
|
167 virtual QCString trRelatedFunctionDocumentation() = 0; |
|
168 |
|
169 ////////////////////////////////////////////////////////////////////////// |
|
170 // new since 0.49-990425 |
|
171 ////////////////////////////////////////////////////////////////////////// |
|
172 |
|
173 virtual QCString trCompoundReference(const char *clName, |
|
174 ClassDef::CompoundType compType, |
|
175 bool isTemplate) = 0; |
|
176 |
|
177 virtual QCString trFileReference(const char *fileName) = 0; |
|
178 virtual QCString trNamespaceReference(const char *namespaceName) = 0; |
|
179 |
|
180 virtual QCString trPublicMembers() = 0; |
|
181 virtual QCString trPublicSlots() = 0; |
|
182 virtual QCString trSignals() = 0; |
|
183 virtual QCString trStaticPublicMembers() = 0; |
|
184 virtual QCString trProtectedMembers() = 0; |
|
185 virtual QCString trProtectedSlots() = 0; |
|
186 virtual QCString trStaticProtectedMembers() = 0; |
|
187 virtual QCString trPrivateMembers() = 0; |
|
188 virtual QCString trPrivateSlots() = 0; |
|
189 virtual QCString trStaticPrivateMembers() = 0; |
|
190 virtual QCString trWriteList(int numEntries) = 0; |
|
191 virtual QCString trInheritsList(int numEntries) = 0; |
|
192 virtual QCString trInheritedByList(int numEntries) = 0; |
|
193 virtual QCString trReimplementedFromList(int numEntries) = 0; |
|
194 virtual QCString trReimplementedInList(int numEntries) = 0; |
|
195 virtual QCString trNamespaceMembers() = 0; |
|
196 virtual QCString trNamespaceMemberDescription(bool extractAll) = 0; |
|
197 virtual QCString trNamespaceIndex() = 0; |
|
198 virtual QCString trNamespaceDocumentation() = 0; |
|
199 |
|
200 ////////////////////////////////////////////////////////////////////////// |
|
201 // new since 0.49-990522 |
|
202 ////////////////////////////////////////////////////////////////////////// |
|
203 |
|
204 virtual QCString trNamespaces() = 0; |
|
205 |
|
206 ////////////////////////////////////////////////////////////////////////// |
|
207 // new since 0.49-990728 |
|
208 ////////////////////////////////////////////////////////////////////////// |
|
209 |
|
210 virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, |
|
211 bool single) = 0; |
|
212 virtual QCString trAlphabeticalList() = 0; |
|
213 |
|
214 ////////////////////////////////////////////////////////////////////////// |
|
215 // new since 0.49-990901 |
|
216 ////////////////////////////////////////////////////////////////////////// |
|
217 |
|
218 virtual QCString trReturnValues() = 0; |
|
219 virtual QCString trMainPage() = 0; |
|
220 virtual QCString trPageAbbreviation() = 0; |
|
221 |
|
222 ////////////////////////////////////////////////////////////////////////// |
|
223 // new since 0.49-991003 |
|
224 ////////////////////////////////////////////////////////////////////////// |
|
225 |
|
226 //virtual QCString trSources() = 0; |
|
227 virtual QCString trDefinedAtLineInSourceFile() = 0; |
|
228 virtual QCString trDefinedInSourceFile() = 0; |
|
229 |
|
230 ////////////////////////////////////////////////////////////////////////// |
|
231 // new since 0.49-991205 |
|
232 ////////////////////////////////////////////////////////////////////////// |
|
233 |
|
234 virtual QCString trDeprecated() = 0; |
|
235 |
|
236 ////////////////////////////////////////////////////////////////////////// |
|
237 // new since 1.0.0 |
|
238 ////////////////////////////////////////////////////////////////////////// |
|
239 |
|
240 virtual QCString trCollaborationDiagram(const char *clName) = 0; |
|
241 virtual QCString trInclDepGraph(const char *fName) = 0; |
|
242 virtual QCString trConstructorDocumentation() = 0; |
|
243 virtual QCString trGotoSourceCode() = 0; |
|
244 virtual QCString trGotoDocumentation() = 0; |
|
245 virtual QCString trPrecondition() = 0; |
|
246 virtual QCString trPostcondition() = 0; |
|
247 virtual QCString trInvariant() = 0; |
|
248 virtual QCString trInitialValue() = 0; |
|
249 virtual QCString trCode() = 0; |
|
250 |
|
251 virtual QCString trGraphicalHierarchy() = 0; |
|
252 virtual QCString trGotoGraphicalHierarchy() = 0; |
|
253 virtual QCString trGotoTextualHierarchy() = 0; |
|
254 virtual QCString trPageIndex() = 0; |
|
255 |
|
256 ////////////////////////////////////////////////////////////////////////// |
|
257 // new since 1.1.0 |
|
258 ////////////////////////////////////////////////////////////////////////// |
|
259 |
|
260 virtual QCString trNote() = 0; |
|
261 virtual QCString trPublicTypes() = 0; |
|
262 virtual QCString trPublicAttribs() = 0; |
|
263 virtual QCString trStaticPublicAttribs() = 0; |
|
264 virtual QCString trProtectedTypes() = 0; |
|
265 virtual QCString trProtectedAttribs() = 0; |
|
266 virtual QCString trStaticProtectedAttribs() = 0; |
|
267 virtual QCString trPrivateTypes() = 0; |
|
268 virtual QCString trPrivateAttribs() = 0; |
|
269 virtual QCString trStaticPrivateAttribs() = 0; |
|
270 |
|
271 ////////////////////////////////////////////////////////////////////////// |
|
272 // new since 1.1.3 |
|
273 ////////////////////////////////////////////////////////////////////////// |
|
274 |
|
275 virtual QCString trTodo() = 0; |
|
276 virtual QCString trTodoList() = 0; |
|
277 |
|
278 ////////////////////////////////////////////////////////////////////////// |
|
279 // new since 1.1.4 |
|
280 ////////////////////////////////////////////////////////////////////////// |
|
281 |
|
282 virtual QCString trReferencedBy() = 0; |
|
283 virtual QCString trRemarks() = 0; |
|
284 virtual QCString trAttention() = 0; |
|
285 virtual QCString trInclByDepGraph() = 0; |
|
286 virtual QCString trSince() = 0; |
|
287 |
|
288 ////////////////////////////////////////////////////////////////////////// |
|
289 // new since 1.1.5 |
|
290 ////////////////////////////////////////////////////////////////////////// |
|
291 |
|
292 virtual QCString trLegendTitle() = 0; |
|
293 virtual QCString trLegendDocs() = 0; |
|
294 virtual QCString trLegend() = 0; |
|
295 |
|
296 ////////////////////////////////////////////////////////////////////////// |
|
297 // new since 1.2.0 |
|
298 ////////////////////////////////////////////////////////////////////////// |
|
299 |
|
300 virtual QCString trTest() = 0; |
|
301 virtual QCString trTestList() = 0; |
|
302 |
|
303 ////////////////////////////////////////////////////////////////////////// |
|
304 // new since 1.2.1 |
|
305 ////////////////////////////////////////////////////////////////////////// |
|
306 |
|
307 virtual QCString trDCOPMethods() = 0; |
|
308 |
|
309 ////////////////////////////////////////////////////////////////////////// |
|
310 // new since 1.2.2 |
|
311 ////////////////////////////////////////////////////////////////////////// |
|
312 |
|
313 virtual QCString trProperties() = 0; |
|
314 virtual QCString trPropertyDocumentation() = 0; |
|
315 |
|
316 ////////////////////////////////////////////////////////////////////////// |
|
317 // new since 1.2.4 |
|
318 ////////////////////////////////////////////////////////////////////////// |
|
319 |
|
320 //virtual QCString trInterfaces() = 0; |
|
321 virtual QCString trClasses() = 0; |
|
322 virtual QCString trPackage(const char *name) = 0; |
|
323 virtual QCString trPackageList() = 0; |
|
324 virtual QCString trPackageListDescription() = 0; |
|
325 virtual QCString trPackages() = 0; |
|
326 //virtual QCString trPackageDocumentation() = 0; |
|
327 virtual QCString trDefineValue() = 0; |
|
328 |
|
329 ////////////////////////////////////////////////////////////////////////// |
|
330 // new since 1.2.5 |
|
331 ////////////////////////////////////////////////////////////////////////// |
|
332 |
|
333 virtual QCString trBug() = 0; |
|
334 virtual QCString trBugList() = 0; |
|
335 |
|
336 ////////////////////////////////////////////////////////////////////////// |
|
337 // new since 1.2.6 |
|
338 ////////////////////////////////////////////////////////////////////////// |
|
339 |
|
340 virtual QCString trRTFansicp() = 0; |
|
341 virtual QCString trRTFCharSet() = 0; |
|
342 virtual QCString trRTFGeneralIndex() = 0; |
|
343 |
|
344 // Translation of the word |
|
345 |
|
346 virtual QCString trClass(bool first_capital, bool singular) = 0; |
|
347 virtual QCString trFile(bool first_capital, bool singular) = 0; |
|
348 virtual QCString trNamespace(bool first_capital, bool singular) = 0; |
|
349 virtual QCString trGroup(bool first_capital, bool singular) = 0; |
|
350 virtual QCString trPage(bool first_capital, bool singular) = 0; |
|
351 virtual QCString trMember(bool first_capital, bool singular) = 0; |
|
352 //virtual QCString trField(bool first_capital, bool singular) = 0; |
|
353 virtual QCString trGlobal(bool first_capital, bool singular) = 0; |
|
354 |
|
355 ////////////////////////////////////////////////////////////////////////// |
|
356 // new since 1.2.7 |
|
357 ////////////////////////////////////////////////////////////////////////// |
|
358 |
|
359 virtual QCString trAuthor(bool first_capital, bool singular) = 0; |
|
360 |
|
361 ////////////////////////////////////////////////////////////////////////// |
|
362 // new since 1.2.11 |
|
363 ////////////////////////////////////////////////////////////////////////// |
|
364 |
|
365 virtual QCString trReferences() = 0; |
|
366 |
|
367 ////////////////////////////////////////////////////////////////////////// |
|
368 // new since 1.2.13 |
|
369 ////////////////////////////////////////////////////////////////////////// |
|
370 |
|
371 virtual QCString trImplementedFromList(int numEntries) = 0; |
|
372 virtual QCString trImplementedInList(int numEntries) = 0; |
|
373 |
|
374 ////////////////////////////////////////////////////////////////////////// |
|
375 // new since 1.2.16 |
|
376 ////////////////////////////////////////////////////////////////////////// |
|
377 |
|
378 virtual QCString trRTFTableOfContents() = 0; |
|
379 |
|
380 ////////////////////////////////////////////////////////////////////////// |
|
381 // new since 1.2.17 |
|
382 ////////////////////////////////////////////////////////////////////////// |
|
383 |
|
384 virtual QCString trDeprecatedList() = 0; |
|
385 |
|
386 ////////////////////////////////////////////////////////////////////////// |
|
387 // new since 1.2.18 |
|
388 ////////////////////////////////////////////////////////////////////////// |
|
389 |
|
390 virtual QCString trEvents() = 0; |
|
391 virtual QCString trEventDocumentation() = 0; |
|
392 |
|
393 ////////////////////////////////////////////////////////////////////////// |
|
394 // new since 1.3 |
|
395 ////////////////////////////////////////////////////////////////////////// |
|
396 |
|
397 virtual QCString trPackageTypes() = 0; |
|
398 virtual QCString trPackageMembers() = 0; |
|
399 virtual QCString trStaticPackageMembers() = 0; |
|
400 virtual QCString trPackageAttribs() = 0; |
|
401 virtual QCString trStaticPackageAttribs() = 0; |
|
402 |
|
403 ////////////////////////////////////////////////////////////////////////// |
|
404 // new since 1.3.1 |
|
405 ////////////////////////////////////////////////////////////////////////// |
|
406 |
|
407 virtual QCString trAll() = 0; |
|
408 virtual QCString trCallGraph() = 0; |
|
409 |
|
410 ////////////////////////////////////////////////////////////////////////// |
|
411 // new since 1.3.3 |
|
412 ////////////////////////////////////////////////////////////////////////// |
|
413 |
|
414 virtual QCString trSearchForIndex() = 0; |
|
415 virtual QCString trSearchResultsTitle() = 0; |
|
416 virtual QCString trSearchResults(int numDocuments) = 0; |
|
417 virtual QCString trSearchMatches() = 0; |
|
418 |
|
419 ////////////////////////////////////////////////////////////////////////// |
|
420 // new since 1.3.8 |
|
421 ////////////////////////////////////////////////////////////////////////// |
|
422 |
|
423 virtual QCString trSourceFile(QCString& filename) = 0; |
|
424 |
|
425 ////////////////////////////////////////////////////////////////////////// |
|
426 // new since 1.3.9 |
|
427 ////////////////////////////////////////////////////////////////////////// |
|
428 |
|
429 virtual QCString trDirIndex() = 0; |
|
430 virtual QCString trDirDocumentation() = 0; |
|
431 virtual QCString trDirectories() = 0; |
|
432 virtual QCString trDirDescription() = 0; |
|
433 virtual QCString trDirReference(const char *dirName) = 0; |
|
434 virtual QCString trDir(bool first_capital, bool singular) = 0; |
|
435 |
|
436 ////////////////////////////////////////////////////////////////////////// |
|
437 // new since 1.4.1 |
|
438 ////////////////////////////////////////////////////////////////////////// |
|
439 |
|
440 virtual QCString trOverloadText() = 0; |
|
441 |
|
442 ////////////////////////////////////////////////////////////////////////// |
|
443 // new since 1.4.6 |
|
444 ////////////////////////////////////////////////////////////////////////// |
|
445 |
|
446 virtual QCString trCallerGraph() = 0; |
|
447 virtual QCString trEnumerationValueDocumentation() = 0; |
|
448 |
|
449 ////////////////////////////////////////////////////////////////////////// |
|
450 // new since 1.5.4 |
|
451 ////////////////////////////////////////////////////////////////////////// |
|
452 |
|
453 virtual QCString trMemberFunctionDocumentationFortran() = 0; |
|
454 virtual QCString trCompoundListFortran() = 0; |
|
455 virtual QCString trCompoundMembersFortran() = 0; |
|
456 virtual QCString trCompoundListDescriptionFortran() = 0; |
|
457 virtual QCString trCompoundMembersDescriptionFortran(bool extractAll) = 0; |
|
458 virtual QCString trCompoundIndexFortran() = 0; |
|
459 virtual QCString trTypeDocumentation() = 0; |
|
460 virtual QCString trSubprograms() = 0; |
|
461 virtual QCString trSubprogramDocumentation() = 0; |
|
462 virtual QCString trDataTypes() = 0; |
|
463 virtual QCString trModulesList() = 0; |
|
464 virtual QCString trModulesListDescription(bool extractAll) = 0; |
|
465 virtual QCString trCompoundReferenceFortran(const char *clName, |
|
466 ClassDef::CompoundType compType, |
|
467 bool isTemplate) = 0; |
|
468 virtual QCString trModuleReference(const char *namespaceName) = 0; |
|
469 virtual QCString trModulesMembers() = 0; |
|
470 virtual QCString trModulesMemberDescription(bool extractAll) = 0; |
|
471 virtual QCString trModulesIndex() = 0; |
|
472 virtual QCString trModule(bool first_capital, bool singular) = 0; |
|
473 virtual QCString trGeneratedFromFilesFortran(ClassDef::CompoundType compType, |
|
474 bool single) = 0; |
|
475 virtual QCString trType(bool first_capital, bool singular) = 0; |
|
476 virtual QCString trSubprogram(bool first_capital, bool singular) = 0; |
|
477 virtual QCString trTypeConstraints() = 0; |
|
478 |
|
479 ////////////////////////////////////////////////////////////////////////// |
|
480 // new since 1.6.0 |
|
481 ////////////////////////////////////////////////////////////////////////// |
|
482 |
|
483 virtual QCString trDirRelation(const char *name) = 0; |
|
484 virtual QCString trLoading() = 0; |
|
485 virtual QCString trGlobalNamespace() = 0; |
|
486 virtual QCString trSearching() = 0; |
|
487 virtual QCString trNoMatches() = 0; |
|
488 |
|
489 }; |
|
490 |
|
491 #endif |