00001 /****************************************************************************** 00002 * 00003 * 00004 * 00005 * Copyright (C) 1997-2008 by Dimitri van Heesch. 00006 * 00007 * Permission to use, copy, modify, and distribute this software and its 00008 * documentation under the terms of the GNU General Public License is hereby 00009 * granted. No representations are made about the suitability of this software 00010 * for any purpose. It is provided "as is" without express or implied warranty. 00011 * See the GNU General Public License for more details. 00012 * 00013 * Documents produced by Doxygen are derivative works derived from the 00014 * input used in their production; they are not affected by this license. 00015 * 00016 */ 00017 00018 #ifndef TRANSLATOR_H 00019 #define TRANSLATOR_H 00020 00021 #include "qtbc.h" 00022 #include "classdef.h" 00023 #include "util.h" 00024 #include "config.h" 00025 00026 class Translator 00027 { 00028 private: 00029 /* Tables for encoding conversions. */ 00030 static const char Win1250ToISO88592Tab[]; 00031 static const char ISO88592ToWin1250Tab[]; 00032 static const unsigned char Koi8RToWindows1251Tab[128]; 00033 static const unsigned char Windows1251ToKoi8RTab[128]; 00034 00035 protected: 00037 QCString Win1250ToISO88592(const QCString & sInput); 00038 00040 QCString ISO88592ToWin1250(const QCString & sInput); 00041 00043 QCString Koi8RToWindows1251( const QCString & sInput ); 00044 00046 QCString Windows1251ToKoi8R( const QCString & sInput ); 00047 00049 QCString JapaneseEucToSjis( const QCString & sInput ); 00050 00051 public: 00052 00057 virtual QCString updateNeededMessage() { return ""; } 00058 virtual ~Translator() {} 00059 00060 // Please, have a look at comments inside the translator_en.h file 00061 // to learn the meaning of the following methods. The translator_en.h 00062 // file contains the TranslatorEnglish implementation, which is 00063 // always up-to-date (by definition). 00064 00065 // --- Language control methods ------------------- 00066 00067 virtual QCString idLanguage() = 0; 00068 virtual QCString latexLanguageSupportCommand() = 0; 00069 virtual QCString idLanguageCharset() = 0; 00070 00071 // --- Language translation methods ------------------- 00072 00073 virtual QCString trRelatedFunctions() = 0; 00074 virtual QCString trRelatedSubscript() = 0; 00075 virtual QCString trDetailedDescription() = 0; 00076 virtual QCString trMemberTypedefDocumentation() = 0; 00077 virtual QCString trMemberEnumerationDocumentation() = 0; 00078 virtual QCString trMemberFunctionDocumentation() = 0; 00079 virtual QCString trMemberDataDocumentation() = 0; 00080 virtual QCString trMore() = 0; 00081 virtual QCString trListOfAllMembers() = 0; 00082 virtual QCString trMemberList() = 0; 00083 virtual QCString trThisIsTheListOfAllMembers() = 0; 00084 virtual QCString trIncludingInheritedMembers() = 0; 00085 virtual QCString trGeneratedAutomatically(const char *s) = 0; 00086 virtual QCString trEnumName() = 0; 00087 virtual QCString trEnumValue() = 0; 00088 virtual QCString trDefinedIn() = 0; 00089 00090 // quick reference sections 00091 00092 virtual QCString trModules() = 0; 00093 virtual QCString trClassHierarchy() = 0; 00094 virtual QCString trCompoundList() = 0; 00095 virtual QCString trFileList() = 0; 00096 //virtual QCString trHeaderFiles() = 0; 00097 virtual QCString trCompoundMembers() = 0; 00098 virtual QCString trFileMembers() = 0; 00099 virtual QCString trRelatedPages() = 0; 00100 virtual QCString trExamples() = 0; 00101 virtual QCString trSearch() = 0; 00102 virtual QCString trClassHierarchyDescription() = 0; 00103 virtual QCString trFileListDescription(bool extractAll) = 0; 00104 virtual QCString trCompoundListDescription() = 0; 00105 virtual QCString trCompoundMembersDescription(bool extractAll) = 0; 00106 virtual QCString trFileMembersDescription(bool extractAll) = 0; 00107 //virtual QCString trHeaderFilesDescription() = 0; 00108 virtual QCString trExamplesDescription() = 0; 00109 virtual QCString trRelatedPagesDescription() = 0; 00110 virtual QCString trModulesDescription() = 0; 00111 //virtual QCString trNoDescriptionAvailable() = 0; 00112 00113 // index titles (the project name is prepended for these) 00114 00115 virtual QCString trDocumentation() = 0; 00116 virtual QCString trModuleIndex() = 0; 00117 virtual QCString trHierarchicalIndex() = 0; 00118 virtual QCString trCompoundIndex() = 0; 00119 virtual QCString trFileIndex() = 0; 00120 virtual QCString trModuleDocumentation() = 0; 00121 virtual QCString trClassDocumentation() = 0; 00122 virtual QCString trFileDocumentation() = 0; 00123 virtual QCString trExampleDocumentation() = 0; 00124 virtual QCString trPageDocumentation() = 0; 00125 virtual QCString trReferenceManual() = 0; 00126 virtual QCString trDefines() = 0; 00127 virtual QCString trFuncProtos() = 0; 00128 virtual QCString trTypedefs() = 0; 00129 virtual QCString trEnumerations() = 0; 00130 virtual QCString trFunctions() = 0; 00131 virtual QCString trVariables() = 0; 00132 virtual QCString trEnumerationValues() = 0; 00133 virtual QCString trDefineDocumentation() = 0; 00134 virtual QCString trFunctionPrototypeDocumentation() = 0; 00135 virtual QCString trTypedefDocumentation() = 0; 00136 virtual QCString trEnumerationTypeDocumentation() = 0; 00137 virtual QCString trFunctionDocumentation() = 0; 00138 virtual QCString trVariableDocumentation() = 0; 00139 virtual QCString trCompounds() = 0; 00140 virtual QCString trGeneratedAt(const char *date,const char *projName) = 0; 00141 virtual QCString trWrittenBy() = 0; 00142 virtual QCString trClassDiagram(const char *clName) = 0; 00143 virtual QCString trForInternalUseOnly() = 0; 00144 //virtual QCString trReimplementedForInternalReasons() = 0; 00145 virtual QCString trWarning() = 0; 00146 //virtual QCString trBugsAndLimitations() = 0; 00147 virtual QCString trVersion() = 0; 00148 virtual QCString trDate() = 0; 00149 virtual QCString trReturns() = 0; 00150 virtual QCString trSeeAlso() = 0; 00151 virtual QCString trParameters() = 0; 00152 virtual QCString trExceptions() = 0; 00153 virtual QCString trGeneratedBy() = 0; 00154 00156 // new since 0.49-990307 00158 00159 virtual QCString trNamespaceList() = 0; 00160 virtual QCString trNamespaceListDescription(bool extractAll) = 0; 00161 virtual QCString trFriends() = 0; 00162 00164 // new since 0.49-990405 00166 00167 virtual QCString trRelatedFunctionDocumentation() = 0; 00168 00170 // new since 0.49-990425 00172 00173 virtual QCString trCompoundReference(const char *clName, 00174 ClassDef::CompoundType compType, 00175 bool isTemplate) = 0; 00176 00177 virtual QCString trFileReference(const char *fileName) = 0; 00178 virtual QCString trNamespaceReference(const char *namespaceName) = 0; 00179 00180 virtual QCString trPublicMembers() = 0; 00181 virtual QCString trPublicSlots() = 0; 00182 virtual QCString trSignals() = 0; 00183 virtual QCString trStaticPublicMembers() = 0; 00184 virtual QCString trProtectedMembers() = 0; 00185 virtual QCString trProtectedSlots() = 0; 00186 virtual QCString trStaticProtectedMembers() = 0; 00187 virtual QCString trPrivateMembers() = 0; 00188 virtual QCString trPrivateSlots() = 0; 00189 virtual QCString trStaticPrivateMembers() = 0; 00190 virtual QCString trWriteList(int numEntries) = 0; 00191 virtual QCString trInheritsList(int numEntries) = 0; 00192 virtual QCString trInheritedByList(int numEntries) = 0; 00193 virtual QCString trReimplementedFromList(int numEntries) = 0; 00194 virtual QCString trReimplementedInList(int numEntries) = 0; 00195 virtual QCString trNamespaceMembers() = 0; 00196 virtual QCString trNamespaceMemberDescription(bool extractAll) = 0; 00197 virtual QCString trNamespaceIndex() = 0; 00198 virtual QCString trNamespaceDocumentation() = 0; 00199 00201 // new since 0.49-990522 00203 00204 virtual QCString trNamespaces() = 0; 00205 00207 // new since 0.49-990728 00209 00210 virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, 00211 bool single) = 0; 00212 virtual QCString trAlphabeticalList() = 0; 00213 00215 // new since 0.49-990901 00217 00218 virtual QCString trReturnValues() = 0; 00219 virtual QCString trMainPage() = 0; 00220 virtual QCString trPageAbbreviation() = 0; 00221 00223 // new since 0.49-991003 00225 00226 //virtual QCString trSources() = 0; 00227 virtual QCString trDefinedAtLineInSourceFile() = 0; 00228 virtual QCString trDefinedInSourceFile() = 0; 00229 00231 // new since 0.49-991205 00233 00234 virtual QCString trDeprecated() = 0; 00235 00237 // new since 1.0.0 00239 00240 virtual QCString trCollaborationDiagram(const char *clName) = 0; 00241 virtual QCString trInclDepGraph(const char *fName) = 0; 00242 virtual QCString trConstructorDocumentation() = 0; 00243 virtual QCString trGotoSourceCode() = 0; 00244 virtual QCString trGotoDocumentation() = 0; 00245 virtual QCString trPrecondition() = 0; 00246 virtual QCString trPostcondition() = 0; 00247 virtual QCString trInvariant() = 0; 00248 virtual QCString trInitialValue() = 0; 00249 virtual QCString trCode() = 0; 00250 00251 virtual QCString trGraphicalHierarchy() = 0; 00252 virtual QCString trGotoGraphicalHierarchy() = 0; 00253 virtual QCString trGotoTextualHierarchy() = 0; 00254 virtual QCString trPageIndex() = 0; 00255 00257 // new since 1.1.0 00259 00260 virtual QCString trNote() = 0; 00261 virtual QCString trPublicTypes() = 0; 00262 virtual QCString trPublicAttribs() = 0; 00263 virtual QCString trStaticPublicAttribs() = 0; 00264 virtual QCString trProtectedTypes() = 0; 00265 virtual QCString trProtectedAttribs() = 0; 00266 virtual QCString trStaticProtectedAttribs() = 0; 00267 virtual QCString trPrivateTypes() = 0; 00268 virtual QCString trPrivateAttribs() = 0; 00269 virtual QCString trStaticPrivateAttribs() = 0; 00270 00272 // new since 1.1.3 00274 00275 virtual QCString trTodo() = 0; 00276 virtual QCString trTodoList() = 0; 00277 00279 // new since 1.1.4 00281 00282 virtual QCString trReferencedBy() = 0; 00283 virtual QCString trRemarks() = 0; 00284 virtual QCString trAttention() = 0; 00285 virtual QCString trInclByDepGraph() = 0; 00286 virtual QCString trSince() = 0; 00287 00289 // new since 1.1.5 00291 00292 virtual QCString trLegendTitle() = 0; 00293 virtual QCString trLegendDocs() = 0; 00294 virtual QCString trLegend() = 0; 00295 00297 // new since 1.2.0 00299 00300 virtual QCString trTest() = 0; 00301 virtual QCString trTestList() = 0; 00302 00304 // new since 1.2.1 00306 00307 virtual QCString trDCOPMethods() = 0; 00308 00310 // new since 1.2.2 00312 00313 virtual QCString trProperties() = 0; 00314 virtual QCString trPropertyDocumentation() = 0; 00315 00317 // new since 1.2.4 00319 00320 //virtual QCString trInterfaces() = 0; 00321 virtual QCString trClasses() = 0; 00322 virtual QCString trPackage(const char *name) = 0; 00323 virtual QCString trPackageList() = 0; 00324 virtual QCString trPackageListDescription() = 0; 00325 virtual QCString trPackages() = 0; 00326 //virtual QCString trPackageDocumentation() = 0; 00327 virtual QCString trDefineValue() = 0; 00328 00330 // new since 1.2.5 00332 00333 virtual QCString trBug() = 0; 00334 virtual QCString trBugList() = 0; 00335 00337 // new since 1.2.6 00339 00340 virtual QCString trRTFansicp() = 0; 00341 virtual QCString trRTFCharSet() = 0; 00342 virtual QCString trRTFGeneralIndex() = 0; 00343 00344 // Translation of the word 00345 00346 virtual QCString trClass(bool first_capital, bool singular) = 0; 00347 virtual QCString trFile(bool first_capital, bool singular) = 0; 00348 virtual QCString trNamespace(bool first_capital, bool singular) = 0; 00349 virtual QCString trGroup(bool first_capital, bool singular) = 0; 00350 virtual QCString trPage(bool first_capital, bool singular) = 0; 00351 virtual QCString trMember(bool first_capital, bool singular) = 0; 00352 //virtual QCString trField(bool first_capital, bool singular) = 0; 00353 virtual QCString trGlobal(bool first_capital, bool singular) = 0; 00354 00356 // new since 1.2.7 00358 00359 virtual QCString trAuthor(bool first_capital, bool singular) = 0; 00360 00362 // new since 1.2.11 00364 00365 virtual QCString trReferences() = 0; 00366 00368 // new since 1.2.13 00370 00371 virtual QCString trImplementedFromList(int numEntries) = 0; 00372 virtual QCString trImplementedInList(int numEntries) = 0; 00373 00375 // new since 1.2.16 00377 00378 virtual QCString trRTFTableOfContents() = 0; 00379 00381 // new since 1.2.17 00383 00384 virtual QCString trDeprecatedList() = 0; 00385 00387 // new since 1.2.18 00389 00390 virtual QCString trEvents() = 0; 00391 virtual QCString trEventDocumentation() = 0; 00392 00394 // new since 1.3 00396 00397 virtual QCString trPackageTypes() = 0; 00398 virtual QCString trPackageMembers() = 0; 00399 virtual QCString trStaticPackageMembers() = 0; 00400 virtual QCString trPackageAttribs() = 0; 00401 virtual QCString trStaticPackageAttribs() = 0; 00402 00404 // new since 1.3.1 00406 00407 virtual QCString trAll() = 0; 00408 virtual QCString trCallGraph() = 0; 00409 00411 // new since 1.3.3 00413 00414 virtual QCString trSearchForIndex() = 0; 00415 virtual QCString trSearchResultsTitle() = 0; 00416 virtual QCString trSearchResults(int numDocuments) = 0; 00417 virtual QCString trSearchMatches() = 0; 00418 00420 // new since 1.3.8 00422 00423 virtual QCString trSourceFile(QCString& filename) = 0; 00424 00426 // new since 1.3.9 00428 00429 virtual QCString trDirIndex() = 0; 00430 virtual QCString trDirDocumentation() = 0; 00431 virtual QCString trDirectories() = 0; 00432 virtual QCString trDirDescription() = 0; 00433 virtual QCString trDirReference(const char *dirName) = 0; 00434 virtual QCString trDir(bool first_capital, bool singular) = 0; 00435 00437 // new since 1.4.1 00439 00440 virtual QCString trOverloadText() = 0; 00441 00443 // new since 1.4.6 00445 00446 virtual QCString trCallerGraph() = 0; 00447 virtual QCString trEnumerationValueDocumentation() = 0; 00448 00450 // new since 1.5.4 00452 00453 virtual QCString trMemberFunctionDocumentationFortran() = 0; 00454 virtual QCString trCompoundListFortran() = 0; 00455 virtual QCString trCompoundMembersFortran() = 0; 00456 virtual QCString trCompoundListDescriptionFortran() = 0; 00457 virtual QCString trCompoundMembersDescriptionFortran(bool extractAll) = 0; 00458 virtual QCString trCompoundIndexFortran() = 0; 00459 virtual QCString trTypeDocumentation() = 0; 00460 virtual QCString trSubprograms() = 0; 00461 virtual QCString trSubprogramDocumentation() = 0; 00462 virtual QCString trDataTypes() = 0; 00463 virtual QCString trModulesList() = 0; 00464 virtual QCString trModulesListDescription(bool extractAll) = 0; 00465 virtual QCString trCompoundReferenceFortran(const char *clName, 00466 ClassDef::CompoundType compType, 00467 bool isTemplate) = 0; 00468 virtual QCString trModuleReference(const char *namespaceName) = 0; 00469 virtual QCString trModulesMembers() = 0; 00470 virtual QCString trModulesMemberDescription(bool extractAll) = 0; 00471 virtual QCString trModulesIndex() = 0; 00472 virtual QCString trModule(bool first_capital, bool singular) = 0; 00473 virtual QCString trGeneratedFromFilesFortran(ClassDef::CompoundType compType, 00474 bool single) = 0; 00475 virtual QCString trType(bool first_capital, bool singular) = 0; 00476 virtual QCString trSubprogram(bool first_capital, bool singular) = 0; 00477 virtual QCString trTypeConstraints() = 0; 00478 00479 }; 00480 00481 #endif