1 /******************************************************************************
3 * $Id: rtfgen.cpp,v 1.14 2001/03/19 19:27:41 root Exp $
5 * Copyright (C) 1997-2012 by Parker Waechter & Dimitri van Heesch.
7 * Style sheet additions by Alexander Bartolich
9 * Permission to use, copy, modify, and distribute this software and its
10 * documentation under the terms of the GNU General Public License is hereby
11 * granted. No representations are made about the suitability of this software
12 * for any purpose. It is provided "as is" without express or implied warranty.
13 * See the GNU General Public License for more details.
15 * Documents produced by Doxygen are derivative works derived from the
16 * input used in their production; they are not affected by this license.
37 #include "rtfdocvisitor.h"
38 #include "docparser.h"
40 #include "vhdldocgen.h"
43 //#define DBG_RTF(x) x;
46 static QCString dateToRTFDateString()
48 const QDateTime &d = QDateTime::currentDateTime();
50 result.sprintf("\\yr%d\\mo%d\\dy%d\\hr%d\\min%d\\sec%d",
51 d.date().year(), d.date().month(), d.date().day(),
52 d.time().hour(),d.time().minute(),d.time().second());
56 RTFGenerator::RTFGenerator() : OutputGenerator()
58 dir=Config_getString("RTF_OUTPUT");
60 //insideTabbing=FALSE;
62 m_bstartedBody = FALSE;
63 m_omitParagraph = FALSE;
67 RTFGenerator::~RTFGenerator()
71 //void RTFGenerator::append(const OutputGenerator *g)
73 // t << g->getContents();
74 // col+=((RTFGenerator *)g)->col;
75 // //insideTabbing=insideTabbing || ((RTFGenerator *)g)->insideTabbing;
76 // m_listLevel=((RTFGenerator *)g)->m_listLevel;
77 // m_omitParagraph=((RTFGenerator *)g)->m_omitParagraph;
78 // //printf("RTFGenerator::append(%s) insideTabbing=%s\n", g->getContents().data(),
79 // // insideTabbing ? "TRUE" : "FALSE" );
82 //OutputGenerator *RTFGenerator::copy()
84 // RTFGenerator *result = new RTFGenerator;
85 // //result->insideTabbing=insideTabbing;
86 // result->m_listLevel=m_listLevel;
87 // result->m_omitParagraph=m_omitParagraph;
91 void RTFGenerator::writeStyleSheetFile(QFile &file)
94 t << "# Generated by doxygen " << versionString << "\n\n";
95 t << "# This file describes styles used for generating RTF output.\n";
96 t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
97 t << "# Remove a hash to activate a line.\n\n";
100 for ( i=0 ; rtf_Style_Default[i].reference!=0 ; i++ )
102 t << "# " << rtf_Style_Default[i].name << " = "
103 << rtf_Style_Default[i].reference
104 << rtf_Style_Default[i].definition << endl;
108 void RTFGenerator::writeExtensionsFile(QFile &file)
110 QTextStream t(&file);
111 t << "# Generated by doxygen " << versionString << "\n\n";
112 t << "# This file describes extensions used for generating RTF output.\n";
113 t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
114 t << "# Remove a hash to activate a line.\n\n";
116 t << "# Overrides the project title.\n";
118 t << "#Title = \n\n";
120 t << "# Name of the company that produced this document.\n";
121 t << "#Company = \n\n";
123 t << "# Filename of a company or project logo.\n";
124 t << "#LogoFilename = \n\n";
126 t << "# Author of the document.\n";
127 t << "#Author = \n\n";
129 t << "# Type of document (e.g. Design Specification, User Manual, etc.).\n";
130 t << "#DocumentType = \n\n";
132 t << "# Document tracking number.\n";
133 t << "#DocumentId = \n\n";
135 t << "# Name of the author's manager.\n";
136 t << "# This field is not displayed in the document itself, but it is \n";
137 t << "# available in the information block of the rtf file. In Microsoft \n";
138 t << "# Word, it is available under File:Properties.\n";
139 t << "#Manager = \n\n";
141 t << "# Subject of the document.\n";
142 t << "# This field is not displayed in the document itself, but it is \n";
143 t << "# available in the information block of the rtf file. In Microsoft \n";
144 t << "# Word, it is available under File:Properties.\n";
145 t << "#Subject = \n\n";
147 t << "# Comments regarding the document.\n";
148 t << "# This field is not displayed in the document itself, but it is \n";
149 t << "# available in the information block of the rtf file. In Microsoft \n";
150 t << "# Word, it is available under File:Properties.\n";
151 t << "#Comments = \n\n";
153 t << "# Keywords associated with the document.\n";
154 t << "# This field is not displayed in the document itself, but it is \n";
155 t << "# available in the information block of the rtf file. In Microsoft \n";
156 t << "# Word, it is available under File:Properties.\n";
157 t << "#Keywords = \n\n";
161 void RTFGenerator::init()
163 QCString dir=Config_getString("RTF_OUTPUT");
165 if (!d.exists() && !d.mkdir(dir))
167 err("Could not create output directory %s\n",dir.data());
170 rtf_Style.setAutoDelete(TRUE);
172 // first duplicate strings of rtf_Style_Default
173 const struct Rtf_Style_Default* def = rtf_Style_Default;
174 while(def->reference != 0)
176 if (def->definition == 0)
177 err("Internal error: rtf_Style_Default[%s] has no definition.\n", def->name);
178 StyleData* styleData = new StyleData(def->reference, def->definition);
179 rtf_Style.insert(def->name, styleData);
183 // overwrite some (or all) definitions from file
184 QCString &rtfStyleSheetFile = Config_getString("RTF_STYLESHEET_FILE");
185 if (!rtfStyleSheetFile.isEmpty())
187 loadStylesheet(rtfStyleSheetFile, rtf_Style);
190 // If user has defined an extension file, load its contents.
191 QCString &rtfExtensionsFile = Config_getString("RTF_EXTENSIONS_FILE");
192 if (!rtfExtensionsFile.isEmpty())
194 loadExtensions(rtfExtensionsFile);
200 static QCString makeIndexName(const char *s,int i)
203 result+=(char)(i+'0');
207 void RTFGenerator::beginRTFDocument()
209 /* all the included RTF files should begin with the
212 t <<"{\\rtf1\\ansi\\ansicpg" << theTranslator->trRTFansicp();
213 t <<"\\uc1 \\deff0\\deflang1033\\deflangfe1033\n";
215 DBG_RTF(t <<"{\\comment Beginning font list}\n")
217 t <<"{\\f0\\froman\\fcharset" << theTranslator->trRTFCharSet();
218 t <<"\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\n";
219 t <<"{\\f1\\fswiss\\fcharset" << theTranslator->trRTFCharSet();
220 t <<"\\fprq2{\\*\\panose 020b0604020202020204}Arial;}\n";
221 t <<"{\\f2\\fmodern\\fcharset" << theTranslator->trRTFCharSet();
222 t <<"\\fprq1{\\*\\panose 02070309020205020404}Courier New;}\n";
223 t <<"{\\f3\\froman\\fcharset2\\fprq2{\\*\\panose 05050102010706020507}Symbol;}\n";
225 DBG_RTF(t <<"{\\comment begin colors}\n")
227 t <<"\\red0\\green0\\blue0;";
228 t <<"\\red0\\green0\\blue255;";
229 t <<"\\red0\\green255\\blue255;";
230 t <<"\\red0\\green255\\blue0;";
231 t <<"\\red255\\green0\\blue255;";
232 t <<"\\red255\\green0\\blue0;";
233 t <<"\\red255\\green255\\blue0;";
234 t <<"\\red255\\green255\\blue255;";
235 t <<"\\red0\\green0\\blue128;";
236 t <<"\\red0\\green128\\blue128;";
237 t <<"\\red0\\green128\\blue0;";
238 t <<"\\red128\\green0\\blue128;";
239 t <<"\\red128\\green0\\blue0;";
240 t <<"\\red128\\green128\\blue0;";
241 t <<"\\red128\\green128\\blue128;";
242 t <<"\\red192\\green192\\blue192;}" << endl;
244 DBG_RTF(t <<"{\\comment Beginning style list}\n")
245 t <<"{\\stylesheet\n";
246 t <<"{\\widctlpar\\adjustright \\fs20\\cgrid \\snext0 Normal;}\n";
248 // sort styles ascending by \s-number via an intermediate QArray
249 QArray<const StyleData*> array(128);
251 QDictIterator<StyleData> iter(rtf_Style);
252 const StyleData* style;
253 for(; (style = iter.current()); ++iter)
255 unsigned index = style->index;
256 unsigned size = array.size();
259 // +1 to add at least one element, then align up to multiple of 8
260 array.resize((index + 1 + 7) & ~7);
262 ASSERT(index < array.size());
264 if (array.at(index) != 0)
266 QCString key(convertToQCString(iter.currentKey()));
267 msg("Style '%s' redefines \\s%d.\n", key.data(), index);
269 array.at(index) = style;
272 // write array elements
273 unsigned size = array.size();
274 for(unsigned i = 0; i < size; i++)
276 const StyleData* style = array.at(i);
278 t <<"{" << style->reference << style->definition << ";}\n";
282 // this comment is needed for postprocessing!
283 t <<"{\\comment begin body}" << endl;
287 void RTFGenerator::beginRTFChapter()
290 DBG_RTF(t << "{\\comment BeginRTFChapter}\n")
291 t << rtf_Style_Reset;
293 // if we are compact, no extra page breaks...
294 if (Config_getBool("COMPACT_RTF"))
296 // t <<"\\sect\\sectd\\sbknone\n";
297 t <<"\\sect\\sbknone\n";
298 rtfwriteRuler_thick();
301 t <<"\\sect\\sbkpage\n";
302 //t <<"\\sect\\sectd\\sbkpage\n";
304 t << rtf_Style["Heading1"]->reference << "\n";
307 void RTFGenerator::beginRTFSection()
310 DBG_RTF(t << "{\\comment BeginRTFSection}\n")
311 t << rtf_Style_Reset;
313 // if we are compact, no extra page breaks...
314 if (Config_getBool("COMPACT_RTF"))
316 // t <<"\\sect\\sectd\\sbknone\n";
317 t <<"\\sect\\sbknone\n";
318 rtfwriteRuler_emboss();
321 t <<"\\sect\\sbkpage\n";
322 //t <<"\\sect\\sectd\\sbkpage\n";
324 t << rtf_Style["Heading2"]->reference << "\n";
327 void RTFGenerator::startFile(const char *name,const char *,const char *)
329 //setEncoding(QCString().sprintf("CP%s",theTranslator->trRTFansicp()));
330 QCString fileName=name;
331 relPath = relativePathToRoot(fileName);
333 if (fileName.right(4)!=".rtf" ) fileName+=".rtf";
334 startPlainFile(fileName);
338 void RTFGenerator::endFile()
340 DBG_RTF(t << "{\\comment endFile}\n")
346 void RTFGenerator::startProjectNumber()
348 DBG_RTF(t <<"{\\comment startProjectNumber }" << endl)
352 void RTFGenerator::endProjectNumber()
354 DBG_RTF(t <<"{\\comment endProjectNumber }" << endl)
357 void RTFGenerator::startIndexSection(IndexSections is)
359 //QCString paperName;
365 case isTitlePageStart:
367 // get readyfor author etc
370 t << "{\\title {\\comment ";
372 case isTitlePageAuthor:
374 if (rtf_subject) t << "{\\subject " << rtf_subject << "}\n";
375 if (rtf_comments) t << "{\\comment " << rtf_comments << "}\n";
376 if (rtf_company) t << "{\\company " << rtf_company << "}\n";
377 if (rtf_author) t << "{\\author " << rtf_author << "}\n";
378 if (rtf_manager) t << "{\\manager " << rtf_manager << "}\n";
379 if (rtf_documentType) t << "{\\category " << rtf_documentType << "}\n";
380 if (rtf_keywords) t << "{\\keywords " << rtf_keywords << "}\n";
387 //case isPackageIndex:
389 // beginRTFChapter();
399 case isNamespaceIndex:
403 case isClassHierarchyIndex:
405 DBG_RTF(t << "{\\comment start classhierarchy}\n")
408 case isCompoundIndex:
409 //Annotated Compound Index
413 //Annotated File Index
420 case isModuleDocumentation:
422 //Module Documentation
423 GroupSDict::Iterator gli(*Doxygen::groupSDict);
426 for (gli.toFirst();(gd=gli.current()) && !found;++gli)
428 if (!gd->isReference())
436 case isDirDocumentation:
438 //Directory Documentation
439 SDict<DirDef>::Iterator dli(*Doxygen::directories);
442 for (dli.toFirst();(dd=dli.current()) && !found;++dli)
444 if (dd->isLinkableInProject())
452 case isNamespaceDocumentation:
454 // Namespace Documentation
455 NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
458 for (nli.toFirst();(nd=nli.current()) && !found;++nli)
460 if (nd->isLinkableInProject())
468 case isClassDocumentation:
470 //Compound Documentation
471 ClassSDict::Iterator cli(*Doxygen::classSDict);
474 for (cli.toFirst();(cd=cli.current()) && !found;++cli)
476 if (cd->isLinkableInProject() &&
477 cd->templateMaster()==0 &&
478 !cd->isEmbeddedInOuterScope()
487 case isFileDocumentation:
491 FileName *fn=Doxygen::inputNameList->first();
494 FileDef *fd=fn->first();
497 if (fd->isLinkableInProject())
508 fn=Doxygen::inputNameList->next();
512 case isExampleDocumentation:
514 //Example Documentation
518 case isPageDocumentation:
524 case isPageDocumentation2:
534 void RTFGenerator::endIndexSection(IndexSections is)
536 bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
537 bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
540 case isTitlePageStart:
542 // User has overridden document title in extensions file
543 t << "}" << rtf_title;
545 t << "}" << Config_getString("PROJECT_NAME");
547 case isTitlePageAuthor:
550 t << "{\\creatim " << dateToRTFDateString() << "}\n}";
551 DBG_RTF(t << "{\\comment end of infoblock}\n");
552 // setup for this section
553 t << rtf_Style_Reset <<"\n";
554 t <<"\\sectd\\pgnlcrm\n";
555 t <<"{\\footer "<<rtf_Style["Footer"]->reference << "{\\chpgn}}\n";
557 DBG_RTF(t << "{\\comment begin title page}\n")
560 t << rtf_Style_Reset << rtf_Style["SubTitle"]->reference << endl; // set to title style
562 t << "\\vertalc\\qc\\par\\par\\par\\par\\par\\par\\par\n";
563 if (rtf_logoFilename)
565 t << "{\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << rtf_logoFilename;
566 t << "\" \\\\d \\\\*MERGEFORMAT} {\\fldrslt IMAGE }}\\par\\par\n";
570 t << rtf_company << "\\par\\par\n";
573 t << rtf_Style_Reset << rtf_Style["Title"]->reference << endl; // set to title style
574 t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt TITLE}}\\par" << endl;
576 t << rtf_Style_Reset << rtf_Style["SubTitle"]->reference << endl; // set to title style
578 if (rtf_documentType)
580 t << rtf_documentType << "\\par\n";
584 t << rtf_documentId << "\\par\n";
586 t << "\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\n";
588 t << rtf_Style_Reset << rtf_Style["SubTitle"]->reference << endl; // set to subtitle style
589 t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt AUTHOR}}\\par" << endl;
590 t << "Version " << Config_getString("PROJECT_NUMBER") << "\\par";
591 t << "{\\field\\fldedit {\\*\\fldinst CREATEDATE \\\\*MERGEFORMAT}"
592 "{\\fldrslt CREATEDATE}}\\par"<<endl;
594 DBG_RTF(t << "{\\comment End title page}" << endl)
596 // table of contents section
597 DBG_RTF(t << "{\\comment Table of contents}\n")
599 t << rtf_Style_Reset << endl;
600 t << rtf_Style["Heading1"]->reference;
601 t << theTranslator->trRTFTableOfContents() << "\\par"<< endl;
602 t << rtf_Style_Reset << "\\par" << endl;
603 t << "{\\field\\fldedit {\\*\\fldinst TOC \\\\f \\\\*MERGEFORMAT}{\\fldrslt Table of contents}}\\par\n";
604 t << rtf_Style_Reset << endl;
608 t << "\\par " << rtf_Style_Reset << endl;
609 if (!Doxygen::mainPage || Doxygen::mainPage->title().isEmpty())
611 t << "{\\tc \\v " << theTranslator->trMainPage() << "}"<< endl;
615 t << "{\\tc \\v " << substitute(Doxygen::mainPage->title(),"%","") << "}"<< endl;
617 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
618 //if (Config_getBool("GENERATE_TREEVIEW")) t << "main"; else t << "index";
620 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
622 //case isPackageIndex:
623 // t << "\\par " << rtf_Style_Reset << endl;
624 // t << "{\\tc \\v " << theTranslator->trPackageList() << "}"<< endl;
625 // t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"packages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
628 t << "\\par " << rtf_Style_Reset << endl;
629 t << "{\\tc \\v " << theTranslator->trModuleIndex() << "}"<< endl;
630 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"modules.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
633 t << "\\par " << rtf_Style_Reset << endl;
634 t << "{\\tc \\v " << theTranslator->trDirIndex() << "}"<< endl;
635 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"dirs.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
637 case isNamespaceIndex:
638 t << "\\par " << rtf_Style_Reset << endl;
641 t << "{\\tc \\v " << theTranslator->trModulesIndex() << "}" << endl;
645 t << "{\\tc \\v " << theTranslator->trNamespaceIndex() << "}" << endl;
648 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"namespaces.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
650 case isClassHierarchyIndex:
651 t << "\\par " << rtf_Style_Reset << endl;
652 t << "{\\tc \\v " << theTranslator->trHierarchicalIndex() << "}"<< endl;
653 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"hierarchy.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
655 case isCompoundIndex:
656 t << "\\par " << rtf_Style_Reset << endl;
659 t << "{\\tc \\v " << theTranslator->trCompoundIndexFortran() << "}"<< endl;
663 t << "{\\tc \\v " << VhdlDocGen::trDesignUnitIndex() << "}"<< endl;
667 t << "{\\tc \\v " << theTranslator->trCompoundIndex() << "}"<< endl;
669 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"annotated.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
672 t << "\\par " << rtf_Style_Reset << endl;
673 t << "{\\tc \\v " << theTranslator->trFileIndex() << "}"<< endl;
674 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"files.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
677 t << "\\par " << rtf_Style_Reset << endl;
678 t << "{\\tc \\v " << theTranslator->trPageIndex() << "}"<< endl;
679 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"pages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
681 case isModuleDocumentation:
683 GroupSDict::Iterator gli(*Doxygen::groupSDict);
685 t << "{\\tc \\v " << theTranslator->trModuleDocumentation() << "}"<< endl;
686 for (gli.toFirst();(gd=gli.current());++gli)
688 if (!gd->isReference())
690 t << "\\par " << rtf_Style_Reset << endl;
691 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
692 t << gd->getOutputFileBase();
693 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
698 case isDirDocumentation:
700 SDict<DirDef>::Iterator dli(*Doxygen::directories);
702 t << "{\\tc \\v " << theTranslator->trDirDocumentation() << "}"<< endl;
703 for (dli.toFirst();(dd=dli.current());++dli)
705 if (dd->isLinkableInProject())
707 t << "\\par " << rtf_Style_Reset << endl;
708 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
709 t << dd->getOutputFileBase();
710 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
715 case isNamespaceDocumentation:
717 NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
720 for (nli.toFirst();(nd=nli.current()) && !found;++nli)
722 if (nd->isLinkableInProject())
724 t << "\\par " << rtf_Style_Reset << endl;
725 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
726 t << nd->getOutputFileBase();
727 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
731 while ((nd=nli.current()))
733 if (nd->isLinkableInProject())
735 t << "\\par " << rtf_Style_Reset << endl;
737 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
738 t << nd->getOutputFileBase();
739 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
745 case isClassDocumentation:
747 ClassSDict::Iterator cli(*Doxygen::classSDict);
752 t << "{\\tc \\v " << theTranslator->trTypeDocumentation() << "}"<< endl;
756 t << "{\\tc \\v " << theTranslator->trClassDocumentation() << "}"<< endl;
758 for (cli.toFirst();(cd=cli.current()) && !found;++cli)
760 if (cd->isLinkableInProject() &&
761 cd->templateMaster()==0 &&
762 !cd->isEmbeddedInOuterScope()
765 t << "\\par " << rtf_Style_Reset << endl;
766 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
767 t << cd->getOutputFileBase();
768 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
772 for (;(cd=cli.current());++cli)
774 if (cd->isLinkableInProject() &&
775 cd->templateMaster()==0 &&
776 !cd->isEmbeddedInOuterScope()
779 t << "\\par " << rtf_Style_Reset << endl;
781 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
782 t << cd->getOutputFileBase();
783 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
788 case isFileDocumentation:
791 FileName *fn=Doxygen::inputNameList->first();
793 t << "{\\tc \\v " << theTranslator->trFileDocumentation() << "}"<< endl;
796 FileDef *fd=fn->first();
799 if (fd->isLinkableInProject())
803 t << "\\par " << rtf_Style_Reset << endl;
804 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
805 t << fd->getOutputFileBase();
806 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
811 t << "\\par " << rtf_Style_Reset << endl;
813 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
814 t << fd->getOutputFileBase();
815 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
820 fn=Doxygen::inputNameList->next();
824 case isExampleDocumentation:
827 t << "{\\tc \\v " << theTranslator->trExampleDocumentation() << "}"<< endl;
828 PageSDict::Iterator pdi(*Doxygen::exampleSDict);
829 PageDef *pd=pdi.toFirst();
832 t << "\\par " << rtf_Style_Reset << endl;
833 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
834 t << pd->getOutputFileBase();
835 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
837 for (++pdi;(pd=pdi.current());++pdi)
839 t << "\\par " << rtf_Style_Reset << endl;
841 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
842 t << pd->getOutputFileBase();
843 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
847 case isPageDocumentation:
849 //#error "fix me in the same way as the latex index..."
850 //t << "{\\tc \\v " << theTranslator->trPageDocumentation() << "}"<< endl;
852 //PageSDict::Iterator pdi(*Doxygen::pageSDict);
853 //PageDef *pd=pdi.toFirst();
855 //for (pdi.toFirst();(pd=pdi.current());++pdi)
857 // if (!pd->getGroupDef() && !pd->isReference())
859 // if (first) t << "\\par " << rtf_Style_Reset << endl;
860 // t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
861 // t << pd->getOutputFileBase();
862 // t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
868 case isPageDocumentation2:
871 t << "\\par " << rtf_Style_Reset << endl;
876 t << rtf_Style["Heading1"]->reference;
877 t << theTranslator->trRTFGeneralIndex() << "\\par "<< endl;
878 t << rtf_Style_Reset << endl;
879 t << "{\\tc \\v " << theTranslator->trRTFGeneralIndex() << "}" << endl;
880 t << "{\\field\\fldedit {\\*\\fldinst INDEX \\\\c2 \\\\*MERGEFORMAT}{\\fldrslt INDEX}}\n";
886 void RTFGenerator::writePageLink(const char *name,bool first)
888 if (first) t << "\\par " << rtf_Style_Reset << endl;
889 t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
891 t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
894 void RTFGenerator::lastIndexPage()
896 DBG_RTF(t <<"{\\comment Beginning Body of RTF Document}\n")
897 // end page and setup for rest of document
898 t <<"\\sect \\sbkpage \\pgndec \\pgnrestart\n";
899 t <<"\\sect \\sectd \\sbknone\n";
901 // set new footer with arabic numbers
902 t <<"{\\footer "<< rtf_Style["Footer"]->reference << "{\\chpgn}}\n";
903 //t << rtf_Style["Heading1"]->reference << "\n";
907 void RTFGenerator::writeStyleInfo(int)
911 void RTFGenerator::lineBreak(const char *)
913 DBG_RTF(t << "{\\comment (lineBreak)}" << endl)
914 t << "\\par" << endl;
915 m_omitParagraph = TRUE;
918 void RTFGenerator::writeString(const char *text)
923 void RTFGenerator::startIndexList()
925 DBG_RTF(t << "{\\comment (startIndexList)}" << endl)
927 t << "\\par" << endl;
928 incrementIndentLevel();
929 t << rtf_Style_Reset << rtf_LCList_DepthStyle() << endl;
930 m_omitParagraph = TRUE;
933 void RTFGenerator::endIndexList()
935 DBG_RTF(t << "{\\comment (endIndexList)}" << endl)
936 if (!m_omitParagraph)
939 m_omitParagraph = TRUE;
942 decrementIndentLevel();
945 /*! start bullet list */
946 void RTFGenerator::startItemList()
949 DBG_RTF(t << "{\\comment (startItemList level=" << m_listLevel << ") }" << endl)
951 incrementIndentLevel();
952 rtf_listItemInfo[m_listLevel].isEnum = FALSE;
955 /*! end bullet list */
956 void RTFGenerator::endItemList()
959 DBG_RTF(t << "{\\comment (endItemList level=" << m_listLevel << ")}" << endl)
961 decrementIndentLevel();
962 m_omitParagraph = TRUE;
965 ///*! start enumeration list */
966 //void RTFGenerator::startEnumList() // starts an enumeration list
968 // DBG_RTF(t << "{\\comment (startEnumList)}" << endl)
970 // incrementIndentLevel();
971 // rtf_listItemInfo[m_listLevel].isEnum = TRUE;
972 // rtf_listItemInfo[m_listLevel].number = 1;
975 ///*! end enumeration list */
976 //void RTFGenerator::endEnumList()
979 // DBG_RTF(t << "{\\comment (endEnumList)}" << endl)
981 // decrementIndentLevel();
982 // m_omitParagraph = TRUE;
985 /*! write bullet or enum item */
986 void RTFGenerator::startItemListItem()
988 DBG_RTF(t << "{\\comment (startItemListItem)}" << endl)
990 t << rtf_Style_Reset;
991 if (rtf_listItemInfo[m_listLevel].isEnum)
993 t << rtf_EList_DepthStyle() << endl;
994 t << rtf_listItemInfo[m_listLevel].number << ".\\tab ";
995 rtf_listItemInfo[m_listLevel].number++;
999 t << rtf_BList_DepthStyle() << endl;
1001 m_omitParagraph = TRUE;
1004 void RTFGenerator::endItemListItem()
1006 DBG_RTF(t << "{\\comment (endItemListItem)}" << endl)
1009 void RTFGenerator::startIndexItem(const char *,const char *)
1011 DBG_RTF(t << "{\\comment (startIndexItem)}" << endl)
1013 if (!m_omitParagraph)
1015 t << "\\par" << endl;
1016 m_omitParagraph = TRUE;
1020 void RTFGenerator::endIndexItem(const char *ref,const char *fn)
1022 DBG_RTF(t << "{\\comment (endIndexItem)}" << endl)
1026 writeRTFReference(fn);
1033 m_omitParagraph = TRUE;
1036 //void RTFGenerator::writeIndexFileItem(const char *,const char *text)
1038 // t << "\\item\\contentsline{section}{";
1040 // t << "}{\\pageref{" << text << "}}" << endl;
1043 void RTFGenerator::startHtmlLink(const char *url)
1046 if (Config_getBool("RTF_HYPERLINKS"))
1048 t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
1051 t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
1059 void RTFGenerator::endHtmlLink()
1061 if (Config_getBool("RTF_HYPERLINKS"))
1071 //void RTFGenerator::writeMailLink(const char *url)
1073 // startTypewriter();
1078 void RTFGenerator::writeStartAnnoItem(const char *,const char *f,
1079 const char *path,const char *name)
1081 DBG_RTF(t << "{\\comment (writeStartAnnoItem)}" << endl)
1083 if (path) docify(path);
1084 if (f && Config_getBool("RTF_HYPERLINKS"))
1086 t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
1087 t << rtfFormatBmkStr(f);
1089 t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
1102 void RTFGenerator::writeEndAnnoItem(const char *name)
1104 DBG_RTF(t << "{\\comment (writeEndAnnoItem)}" << endl)
1108 writeRTFReference(name);
1118 void RTFGenerator::startIndexKey()
1120 DBG_RTF(t << "{\\comment (startIndexKey)}" << endl)
1124 void RTFGenerator::endIndexKey()
1126 DBG_RTF(t << "{\\comment (endIndexKey)}" << endl)
1129 void RTFGenerator::startIndexValue(bool hasBrief)
1131 DBG_RTF(t << "{\\comment (startIndexValue)}" << endl)
1133 if (hasBrief) t << "(";
1136 void RTFGenerator::endIndexValue(const char *name,bool hasBrief)
1138 DBG_RTF(t << "{\\comment (endIndexValue)}" << endl)
1139 if (hasBrief) t << ")";
1144 writeRTFReference(name);
1151 m_omitParagraph=FALSE;
1155 void RTFGenerator::startSubsection()
1157 //beginRTFSubSection();
1159 DBG_RTF(t << "{\\comment Begin SubSection}\n")
1160 t << rtf_Style_Reset;
1161 t << rtf_Style["Heading3"]->reference << "\n";
1164 void RTFGenerator::endSubsection()
1167 t << rtf_Style_Reset << endl;
1170 void RTFGenerator::startSubsubsection()
1172 //beginRTFSubSubSection();
1174 DBG_RTF(t << "{\\comment Begin SubSubSection}\n")
1176 t << rtf_Style_Reset << rtf_Style["Heading4"]->reference << "\n";
1179 void RTFGenerator::endSubsubsection()
1186 //void RTFGenerator::writeClassLink(const char *,const char *,
1187 // const char *,const char *name)
1194 //void RTFGenerator::startTable(bool,int colNumbers)
1196 // DBG_RTF(t << "{\\comment startTable}\n";)
1197 // m_numCols=colNumbers;
1201 //void RTFGenerator::endTable(bool hasCaption)
1203 // DBG_RTF(t << "{\\comment endTable}\n";)
1205 // t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n";
1206 // t << "\\pard\n" << endl;
1209 //void RTFGenerator::startCaption()
1211 // DBG_RTF(t << "{\\comment startCaption}\n";)
1213 // t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 \\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 \\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 \\trbrdrv\\brdrs\\brdrw10" << endl;
1214 // t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 \\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb \\cellx"<<rtf_pageWidth<<"\\pard \\qc\\nowidctlpar\\widctlpar\\intbl\\adjustright " << endl;
1215 // nextTableColumn();
1218 //void RTFGenerator::endCaption()
1220 // DBG_RTF(t << "{\\comment endCaption}\n";)
1221 // endTableColumn();
1225 //void RTFGenerator::nextTableRow()
1227 // DBG_RTF(t << "{\\comment nextTableRow}\n";)
1228 // ASSERT(m_numCols>0 && m_numCols<25);
1229 // uint columnWidth=rtf_pageWidth/m_numCols;
1230 // t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 "
1231 // "\\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 "
1232 // "\\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 "
1233 // "\\trbrdrv\\brdrs\\brdrw10 "<<endl;
1234 // for (int i=0;i<m_numCols;i++)
1236 // t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 "
1237 // "\\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb "
1238 // "\\cellx" << (i*columnWidth) << endl;
1240 // t << "\\pard \\widctlpar\\intbl\\adjustright\n{";
1243 //void RTFGenerator::endTableRow()
1245 // DBG_RTF(t << "{\\comment endTableRow}\n";)
1246 // t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n";
1249 //void RTFGenerator::nextTableColumn()
1251 // DBG_RTF(t << "{\\comment nextTableColumn}\n";)
1255 //void RTFGenerator::endTableColumn()
1257 // DBG_RTF(t << "{\\comment endTableColumn}\n";)
1258 // t << " \\cell }";
1261 void RTFGenerator::startTextLink(const char *f,const char *anchor)
1263 if (Config_getBool("RTF_HYPERLINKS"))
1276 t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
1277 t << rtfFormatBmkStr(ref);
1279 t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
1283 void RTFGenerator::endTextLink()
1285 if (Config_getBool("RTF_HYPERLINKS"))
1291 void RTFGenerator::writeObjectLink(const char *ref, const char *f,
1292 const char *anchor, const char *text)
1294 if (!ref && Config_getBool("RTF_HYPERLINKS"))
1307 t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
1308 t << rtfFormatBmkStr(refName);
1310 t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
1324 void RTFGenerator::startPageRef()
1330 void RTFGenerator::endPageRef(const char *clname, const char *anchor)
1342 writeRTFReference(ref);
1347 void RTFGenerator::writeCodeLink(const char *ref,const char *f,
1348 const char *anchor,const char *name,
1351 if (!ref && Config_getBool("RTF_HYPERLINKS"))
1364 t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
1365 t << rtfFormatBmkStr(refName);
1367 t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
1379 void RTFGenerator::startTitleHead(const char *)
1381 DBG_RTF(t <<"{\\comment startTitleHead}" << endl)
1383 // beginRTFSection();
1384 t << rtf_Style_Reset << rtf_Style["Heading2"]->reference << endl;
1387 void RTFGenerator::endTitleHead(const char *fileName,const char *name)
1389 DBG_RTF(t <<"{\\comment endTitleHead}" << endl)
1390 t << "\\par " << rtf_Style_Reset << endl;
1393 // make table of contents entry
1394 t << "{\\tc\\tcl2 \\v ";
1398 // make an index entry
1399 addIndexItem(name,0);
1403 // writeAnchor(0,name);
1406 //if (Config_getBool("RTF_HYPERLINKS") && fileName)
1408 writeAnchor(fileName,0);
1413 void RTFGenerator::startTitle()
1415 DBG_RTF(t <<"{\\comment startTitle}" << endl)
1416 if (Config_getBool("COMPACT_RTF"))
1422 void RTFGenerator::startGroupHeader(int extraIndent)
1424 DBG_RTF(t <<"{\\comment startGroupHeader}" << endl)
1426 t << rtf_Style_Reset;
1429 t << rtf_Style["Heading5"]->reference;
1431 else if (extraIndent==1)
1433 t << rtf_Style["Heading4"]->reference;
1435 else // extraIndent==0
1437 t << rtf_Style["Heading3"]->reference;
1442 void RTFGenerator::endGroupHeader(int)
1444 DBG_RTF(t <<"{\\comment endGroupHeader}" << endl)
1445 t << "\\par" << endl;
1446 t << rtf_Style_Reset << endl;
1449 void RTFGenerator::startMemberDoc(const char *clname,
1450 const char *memname,
1455 DBG_RTF(t << "{\\comment startMemberDoc}" << endl)
1456 if (memname && memname[0]!='@')
1458 addIndexItem(memname,clname);
1459 addIndexItem(clname,memname);
1461 t << rtf_Style_Reset << rtf_Style[showInline ? "Heading5" : "Heading4"]->reference;
1462 //styleStack.push(rtf_Style_Heading4);
1464 //printf("RTFGenerator::startMemberDoc() `%s'\n",rtf_Style["Heading4"]->reference);
1469 void RTFGenerator::endMemberDoc(bool)
1471 DBG_RTF(t << "{\\comment endMemberDoc}" << endl)
1472 //const char *style = styleStack.pop();
1473 //printf("RTFGenerator::endMemberDoc() `%s'\n",style);
1474 //ASSERT(style==rtf_Style["Heading4"]->reference);
1480 void RTFGenerator::startDoxyAnchor(const char *,const char *,
1481 const char *,const char *,
1485 DBG_RTF(t << "{\\comment startDoxyAnchor}" << endl)
1488 void RTFGenerator::endDoxyAnchor(const char *fName,const char *anchor)
1501 DBG_RTF(t << "{\\comment endDoxyAnchor}" << endl)
1502 t << "{\\bkmkstart ";
1503 t << rtfFormatBmkStr(ref);
1506 t << rtfFormatBmkStr(ref);
1511 //void RTFGenerator::writeLatexLabel(const char *clName,const char *anchor)
1513 // writeDoxyAnchor(0,clName,anchor,0);
1516 void RTFGenerator::addIndexItem(const char *s1,const char *s2)
1531 void RTFGenerator::startIndent()
1533 incrementIndentLevel();
1534 DBG_RTF(t << "{\\comment (startIndent) }" << endl)
1536 t << rtf_Style_Reset << rtf_CList_DepthStyle() << endl;
1539 void RTFGenerator::endIndent()
1542 decrementIndentLevel();
1546 void RTFGenerator::startDescription()
1548 DBG_RTF(t << "{\\comment (startDescription)}" << endl)
1550 t << rtf_Style_Reset << rtf_DList_DepthStyle();
1553 void RTFGenerator::endDescription()
1555 DBG_RTF(t << "{\\comment (endDescription)}" << endl)
1560 void RTFGenerator::startDescItem()
1563 DBG_RTF(t << "{\\comment (startDescItem)}" << endl)
1567 void RTFGenerator::endDescItem()
1569 DBG_RTF(t << "{\\comment (endDescItem)}" << endl)
1574 void RTFGenerator::startMemberDescription(const char *,const char *)
1576 DBG_RTF(t << "{\\comment (startMemberDescription)}" << endl)
1578 incrementIndentLevel();
1579 t << rtf_Style_Reset << rtf_CList_DepthStyle();
1583 void RTFGenerator::endMemberDescription()
1585 DBG_RTF(t << "{\\comment (endMemberDescription)}" << endl)
1588 decrementIndentLevel();
1591 //m_omitParagraph = TRUE;
1594 void RTFGenerator::startDescList(SectionTypes)
1596 DBG_RTF(t << "{\\comment (startDescList)}" << endl)
1597 t << "{"; // ends at endDescList
1598 t << "{"; // ends at endDescTitle
1603 //void RTFGenerator::endDescTitle()
1605 // DBG_RTF(t << "{\\comment (endDescTitle) }" << endl)
1609 // incrementIndentLevel();
1610 // t << rtf_Style_Reset << rtf_DList_DepthStyle();
1613 void RTFGenerator::startDescForItem()
1615 DBG_RTF(t << "{\\comment (startDescForItem) }" << endl)
1618 void RTFGenerator::endDescForItem()
1620 DBG_RTF(t << "{\\comment (endDescForItem) }" << endl)
1623 //void RTFGenerator::endDescList()
1625 // DBG_RTF(t << "{\\comment (endDescList)}" << endl)
1627 // decrementIndentLevel();
1628 // m_omitParagraph = TRUE;
1633 void RTFGenerator::startSection(const char *,const char *title,SectionInfo::SectionType type)
1635 DBG_RTF(t << "{\\comment (startSection)}" << endl)
1637 t<< rtf_Style_Reset;
1641 case SectionInfo::Page: num=2; break;
1642 case SectionInfo::Section: num=3; break;
1643 case SectionInfo::Subsection: num=4; break;
1644 case SectionInfo::Subsubsection: num=4; break;
1645 case SectionInfo::Paragraph: num=4; break;
1646 default: ASSERT(0); break;
1649 heading.sprintf("Heading%d",num);
1651 t << rtf_Style[heading]->reference;
1652 // make table of contents entry
1653 t << "{\\tc\\tcl" << num << " \\v ";
1658 void RTFGenerator::endSection(const char *lab,SectionInfo::SectionType)
1660 DBG_RTF(t << "{\\comment (endSection)}" << endl)
1662 m_omitParagraph=FALSE;
1668 //void RTFGenerator::writeSectionRef(const char *ref,const char *,
1669 // const char *lab,const char *title)
1681 // docify(theTranslator->trPageAbbreviation());
1682 // writeRTFReference(lab);
1683 // t << ")" << endl;
1687 //void RTFGenerator::writeSectionRefItem(const char *,const char *lab,
1688 // const char *title)
1692 // writeRTFReference(lab);
1696 //void RTFGenerator::writeSectionRefAnchor(const char *name,const char *lab,
1697 // const char *title)
1699 // writeSectionRef(name,lab,title);
1702 //char* RTFGenerator::getMultiByte(int c)
1704 // static char s[10];
1706 // sprintf(s,"\\'%X",c);
1710 void RTFGenerator::docify(const char *str)
1714 const unsigned char *p=(const unsigned char *)str;
1716 //unsigned char pc='\0';
1719 //static bool MultiByte = FALSE;
1725 t << getMultiByte( c );
1732 t << getMultiByte( c );
1739 case '{': t << "\\{"; break;
1740 case '}': t << "\\}"; break;
1741 case '\\': t << "\\\\"; break;
1744 // see if we can insert an hyphenation hint
1745 //if (isupper(c) && islower(pc) && !insideTabbing) t << "\\-";
1750 m_omitParagraph = FALSE;
1755 void RTFGenerator::codify(const char *str)
1757 // note that RTF does not have a "verbatim", so "\n" means
1758 // nothing... add a "newParagraph()";
1759 //static char spaces[]=" ";
1762 const unsigned char *p=(const unsigned char *)str;
1764 int spacesToNextTabStop;
1768 //static bool MultiByte = FALSE;
1775 t << getMultiByte( c );
1782 t << getMultiByte( c );
1789 case '\t': spacesToNextTabStop = Config_getInt("TAB_SIZE") - (col%Config_getInt("TAB_SIZE"));
1790 t << Doxygen::spaces.left(spacesToNextTabStop);
1791 col+=spacesToNextTabStop;
1793 case '\n': newParagraph();
1796 case '{': t << "\\{"; col++; break;
1797 case '}': t << "\\}"; col++; break;
1798 case '\\': t << "\\\\"; col++; break;
1799 default: t << (char)c; col++; break;
1805 void RTFGenerator::writeChar(char c)
1813 void RTFGenerator::startClassDiagram()
1815 DBG_RTF(t <<"{\\comment startClassDiagram }" << endl)
1818 void RTFGenerator::endClassDiagram(const ClassDiagram &d,
1819 const char *fileName,const char *)
1823 // create a png file
1824 d.writeImage(t,dir,relPath,fileName,FALSE);
1828 t << rtf_Style_Reset << endl;
1829 t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1830 t << fileName << ".png\"";
1831 t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
1835 //void RTFGenerator::writeFormula(const char *,const char *text)
1840 void RTFGenerator::startMemberItem(const char *,int,const char *)
1842 DBG_RTF(t <<"{\\comment startMemberItem }" << endl)
1843 t << rtf_Style_Reset << rtf_BList_DepthStyle() << endl; // set style to appropriate depth
1846 void RTFGenerator::endMemberItem()
1848 DBG_RTF(t <<"{\\comment endMemberItem }" << endl)
1852 void RTFGenerator::writeAnchor(const char *fileName,const char *name)
1859 if (fileName && name)
1868 DBG_RTF(t <<"{\\comment writeAnchor (" << anchor << ")}" << endl)
1869 t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}" << endl;
1870 t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}" << endl;
1873 void RTFGenerator::writeRTFReference(const char *label)
1875 t << "{\\field\\fldedit {\\*\\fldinst PAGEREF ";
1876 t << rtfFormatBmkStr(label);
1877 t << " \\\\*MERGEFORMAT}{\\fldrslt pagenum}}";
1880 void RTFGenerator::startCodeFragment()
1882 DBG_RTF(t << "{\\comment (startCodeFragment) }" << endl)
1885 t << rtf_Style_Reset << rtf_Code_DepthStyle();
1886 //styleStack.push(rtf_Style_CodeExample);
1889 void RTFGenerator::endCodeFragment()
1893 //printf("RTFGenerator::endCodeFrament() top=%s\n",styleStack.top());
1894 //t << rtf_Style_Reset << styleStack.top() << endl;
1895 DBG_RTF(t << "{\\comment (endCodeFragment) }" << endl)
1897 m_omitParagraph = TRUE;
1900 void RTFGenerator::writeNonBreakableSpace(int)
1906 void RTFGenerator::startMemberList()
1909 DBG_RTF(t << "{\\comment (startMemberList) }" << endl)
1913 t << "\\begin{CompactItemize}" << endl;
1917 void RTFGenerator::endMemberList()
1919 DBG_RTF(t << "{\\comment (endMemberList) }" << endl)
1923 t << "\\end{CompactItemize}" << endl;
1927 //void RTFGenerator::startImage(const char *name,const char *,bool)
1930 // t << "{" << endl;
1931 // t << rtf_Style_Reset << endl;
1932 // t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";
1934 // t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
1935 // t << "}" << endl;
1938 //void RTFGenerator::endImage(bool)
1940 // // not yet implemented
1943 //void RTFGenerator::startDotFile(const char *name,bool)
1945 // QCString baseName=name;
1947 // if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)
1949 // baseName=baseName.right(baseName.length()-i-1);
1951 // QCString outDir = Config_getString("RTF_OUTPUT");
1952 // writeDotGraphFromFile(name,outDir,baseName,BITMAP);
1954 // t << "{" << endl;
1955 // t << rtf_Style_Reset << endl;
1956 // t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";
1957 // t << outDir << "\\" << baseName;
1958 // t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
1959 // t << "}" << endl;
1962 //void RTFGenerator::endDotFile(bool)
1964 // // not yet implemented
1967 void RTFGenerator::startDescTable()
1969 DBG_RTF(t << "{\\comment (startDescTable) }" << endl)
1971 //incrementIndentLevel();
1972 //t << rtf_Style_Reset << rtf_CList_DepthStyle();
1975 void RTFGenerator::endDescTable()
1977 //decrementIndentLevel();
1978 DBG_RTF(t << "{\\comment (endDescTable)}" << endl)
1980 //t << rtf_Style_Reset << styleStack.top();
1983 void RTFGenerator::startDescTableTitle()
1985 //t << rtf_BList_DepthStyle() << endl;
1986 DBG_RTF(t << "{\\comment (startDescTableTitle) }" << endl)
1991 void RTFGenerator::endDescTableTitle()
1993 DBG_RTF(t << "{\\comment (endDescTableTitle) }" << endl)
1999 void RTFGenerator::startDescTableData()
2001 DBG_RTF(t << "{\\comment (startDescTableData) }" << endl)
2002 m_omitParagraph = FALSE;
2005 void RTFGenerator::endDescTableData()
2007 DBG_RTF(t << "{\\comment (endDescTableData) }" << endl)
2009 m_omitParagraph = TRUE;
2012 // a style for list formatted as a "bulleted list"
2014 void RTFGenerator::incrementIndentLevel()
2017 if (m_listLevel>rtf_maxIndentLevels-1)
2019 err("error: Maximum indent level (%d) exceeded while generating RTF output!\n",rtf_maxIndentLevels);
2020 m_listLevel=rtf_maxIndentLevels-1;
2024 void RTFGenerator::decrementIndentLevel()
2029 err("error: Negative indent level while generating RTF output!\n");
2034 // a style for list formatted with "list continue" style
2035 const char * RTFGenerator::rtf_CList_DepthStyle()
2037 QCString n=makeIndexName("ListContinue",m_listLevel);
2038 return rtf_Style[n]->reference;
2041 // a style for list formatted as a "latext style" table of contents
2042 const char * RTFGenerator::rtf_LCList_DepthStyle()
2044 QCString n=makeIndexName("LatexTOC",m_listLevel);
2045 return rtf_Style[n]->reference;
2048 // a style for list formatted as a "bullet" style
2049 const char * RTFGenerator::rtf_BList_DepthStyle()
2051 QCString n=makeIndexName("ListBullet",m_listLevel);
2052 return rtf_Style[n]->reference;
2055 // a style for list formatted as a "enumeration" style
2056 const char * RTFGenerator::rtf_EList_DepthStyle()
2058 QCString n=makeIndexName("ListEnum",m_listLevel);
2059 return rtf_Style[n]->reference;
2062 const char * RTFGenerator::rtf_DList_DepthStyle()
2064 QCString n=makeIndexName("DescContinue",m_listLevel);
2065 return rtf_Style[n]->reference;
2068 const char * RTFGenerator::rtf_Code_DepthStyle()
2070 QCString n=makeIndexName("CodeExample",m_listLevel);
2071 return rtf_Style[n]->reference;
2074 void RTFGenerator::startTextBlock(bool dense)
2076 DBG_RTF(t << "{\\comment startTextBlock}" << endl)
2078 t << rtf_Style_Reset;
2079 if (dense) // no spacing between "paragraphs"
2081 t << rtf_Style["DenseText"]->reference;
2083 else // some spacing
2085 t << rtf_Style["BodyText"]->reference;
2089 void RTFGenerator::endTextBlock(bool /*paraBreak*/)
2092 DBG_RTF(t << "{\\comment endTextBlock}" << endl)
2094 //m_omitParagraph = TRUE;
2097 void RTFGenerator::newParagraph()
2099 if (!m_omitParagraph)
2101 DBG_RTF(t << "{\\comment (newParagraph)}" << endl)
2102 t << "\\par" << endl;
2104 m_omitParagraph = FALSE;
2107 void RTFGenerator::startParagraph()
2109 DBG_RTF(t << "{\\comment startParagraph}" << endl)
2114 void RTFGenerator::endParagraph()
2116 DBG_RTF(t << "{\\comment endParagraph}" << endl)
2117 t << "}\\par" << endl;
2118 m_omitParagraph = TRUE;
2121 void RTFGenerator::startMemberSubtitle()
2123 DBG_RTF(t << "{\\comment startMemberSubtitle}" << endl)
2125 t << rtf_Style_Reset << rtf_CList_DepthStyle() << endl;
2128 void RTFGenerator::endMemberSubtitle()
2130 DBG_RTF(t << "{\\comment endMemberSubtitle}" << endl)
2135 //void RTFGenerator::writeUmlaut(char c)
2139 // case 'A' : t << '\304'; break;
2140 // case 'E' : t << '\313'; break;
2141 // case 'I' : t << '\317'; break;
2142 // case 'O' : t << '\326'; break;
2143 // case 'U' : t << '\334'; break;
2144 // case 'Y' : t << 'Y'; break;
2145 // case 'a' : t << '\344'; break;
2146 // case 'e' : t << '\353'; break;
2147 // case 'i' : t << '\357'; break;
2148 // case 'o' : t << '\366'; break;
2149 // case 'u' : t << '\374'; break;
2150 // case 'y' : t << '\377'; break;
2151 // default: t << '?'; break;
2155 //void RTFGenerator::writeAcute(char c)
2159 // case 'A' : t << '\301'; break;
2160 // case 'E' : t << '\311'; break;
2161 // case 'I' : t << '\315'; break;
2162 // case 'O' : t << '\323'; break;
2163 // case 'U' : t << '\332'; break;
2164 // case 'Y' : t << '\335'; break;
2165 // case 'a' : t << '\341'; break;
2166 // case 'e' : t << '\351'; break;
2167 // case 'i' : t << '\355'; break;
2168 // case 'o' : t << '\363'; break;
2169 // case 'u' : t << '\372'; break;
2170 // case 'y' : t << '\375'; break;
2171 // default: t << '?'; break;
2175 //void RTFGenerator::writeGrave(char c)
2179 // case 'A' : t << '\300'; break;
2180 // case 'E' : t << '\310'; break;
2181 // case 'I' : t << '\314'; break;
2182 // case 'O' : t << '\322'; break;
2183 // case 'U' : t << '\331'; break;
2184 // case 'a' : t << '\340'; break;
2185 // case 'e' : t << '\350'; break;
2186 // case 'i' : t << '\354'; break;
2187 // case 'o' : t << '\362'; break;
2188 // case 'u' : t << '\371'; break;
2189 // default: t << '?'; break;
2193 //void RTFGenerator::writeCirc(char c)
2197 // case 'A' : t << '\302'; break;
2198 // case 'E' : t << '\312'; break;
2199 // case 'I' : t << '\316'; break;
2200 // case 'O' : t << '\324'; break;
2201 // case 'U' : t << '\333'; break;
2202 // case 'a' : t << '\342'; break;
2203 // case 'e' : t << '\352'; break;
2204 // case 'i' : t << '\356'; break;
2205 // case 'o' : t << '\364'; break;
2206 // case 'u' : t << '\373'; break;
2207 // default: t << '?'; break;
2211 //void RTFGenerator::writeTilde(char c)
2215 // case 'A' : t << '\303'; break;
2216 // case 'N' : t << '\321'; break;
2217 // case 'O' : t << '\325'; break;
2218 // case 'a' : t << '\343'; break;
2219 // case 'n' : t << '\361'; break;
2220 // case 'o' : t << '\365'; break;
2221 // default: t << '?'; break;
2225 //void RTFGenerator::writeRing(char c)
2229 // case 'A' : t << '\305'; break;
2230 // case 'a' : t << '\345'; break;
2231 // default: t << '?'; break;
2235 //void RTFGenerator::writeCCedil(char c)
2239 // case 'C' : t << '\307'; break;
2240 // case 'c' : t << '\347'; break;
2241 // default: t << '?'; break;
2246 bool isLeadBytes(int c)
2250 QCString codePage = theTranslator->trRTFansicp();
2252 if (codePage == "932") // cp932 (Japanese Shift-JIS)
2254 result = (0x81<=c && c<=0x9f) || (0xe0<=c && c<=0xfc);
2256 else if (codePage == "936") // cp936 (Simplified Chinese GBK)
2258 result = 0x81<=c && c<=0xFE;
2260 else if (codePage == "949") // cp949 (Korean)
2262 result = 0x81<=c && c<=0xFE;
2264 else if (codePage == "950") // cp950 (Traditional Chinese Big5)
2266 result = 0x81<=c && c<=0xFE;
2268 else // for SBCS Codepages (cp1252,1251 etc...)
2277 // note: function is not reentrant!
2278 static void encodeForOutput(FTextStream &t,const QCString &s)
2281 bool converted=FALSE;
2283 static QByteArray enc;
2284 if (l*4>(int)enc.size()) enc.resize(l*4); // worst case
2285 encoding.sprintf("CP%s",theTranslator->trRTFansicp().data());
2286 if (!encoding.isEmpty())
2288 // convert from UTF-8 back to the output encoding
2289 void *cd = portable_iconv_open(encoding,"UTF-8");
2290 if (cd!=(void *)(-1))
2293 size_t oLeft=enc.size();
2294 char *inputPtr = s.data();
2295 char *outputPtr = enc.data();
2296 if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft))
2298 enc.resize(enc.size()-oLeft);
2301 portable_iconv_close(cd);
2304 if (!converted) // if we did not convert anything, copy as is.
2306 memcpy(enc.data(),s.data(),l);
2310 bool multiByte = FALSE;
2312 for (i=0;i<enc.size();i++)
2314 uchar c = (uchar)enc.at(i);
2316 if (c>=0x80 || multiByte)
2319 sprintf(esc,"\\'%X",c); // escape sequence for SBCS and DBCS(1st&2nd bytes).
2324 multiByte = isLeadBytes(c); // It may be DBCS Codepages.
2328 multiByte = FALSE; // end of Double Bytes Character.
2339 * VERY brittle routine inline RTF's included by other RTF's.
2340 * it is recursive and ugly.
2342 static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncludeHeader=TRUE)
2345 if (!f.open(IO_ReadOnly))
2347 err("error: problems opening rtf file %s for reading\n",infName.data());
2351 const int maxLineLength = 10240;
2352 static QCString lineBuf(maxLineLength);
2354 // scan until find end of header
2355 // this is EXTREEEEEEEMLY brittle. It works on OUR rtf
2356 // files because the first line before the body
2357 // ALWAYS contains "{\comment begin body}"
2360 if (f.readLine(lineBuf.data(),maxLineLength)==-1)
2362 err("ERROR - read error in %s before end of RTF header!\n",infName.data());
2365 if (bIncludeHeader) encodeForOutput(t,lineBuf);
2366 } while (lineBuf.find("\\comment begin body")==-1);
2369 while (f.readLine(lineBuf.data(),maxLineLength)!=-1)
2372 if ((pos=lineBuf.find("INCLUDETEXT"))!=-1)
2374 int startNamePos = lineBuf.find('"',pos)+1;
2375 int endNamePos = lineBuf.find('"',startNamePos);
2376 QCString fileName = lineBuf.mid(startNamePos,endNamePos-startNamePos);
2377 DBG_RTF(t << "{\\comment begin include " << fileName << "}" << endl)
2378 if (!preProcessFile(d,fileName,t,FALSE)) return FALSE;
2379 DBG_RTF(t << "{\\comment end include " << fileName << "}" << endl)
2381 else // no INCLUDETEXT on this line
2383 // elaborate hoopla to skip the final "}" if we didn't include the
2385 if (!f.atEnd() || bIncludeHeader)
2387 encodeForOutput(t,lineBuf);
2389 else // last line of included file
2391 // null terminate at the last '}'
2392 //char *str = strrchr(buffer,'}');
2393 int pos = lineBuf.findRev('}');
2396 lineBuf.at(pos) = '\0';
2398 err("Strange, the last char was not a '}'\n");
2399 encodeForOutput(t,lineBuf);
2404 // remove temporary file
2409 void RTFGenerator::startDotGraph()
2411 DBG_RTF(t << "{\\comment (startDotGraph)}" << endl)
2414 void RTFGenerator::endDotGraph(const DotClassGraph &g)
2419 g.writeGraph(t,BITMAP,Config_getString("RTF_OUTPUT"),fileName,relPath,TRUE,FALSE);
2423 t << rtf_Style_Reset << endl;
2424 t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
2425 t << fn << "." << Config_getEnum("DOT_IMAGE_FORMAT");
2426 t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
2429 DBG_RTF(t << "{\\comment (endDotGraph)}" << endl)
2432 void RTFGenerator::startInclDepGraph()
2434 DBG_RTF(t << "{\\comment (startInclDepGraph)}" << endl)
2437 void RTFGenerator::endInclDepGraph(const DotInclDepGraph &g)
2441 QCString fn = g.writeGraph(t,BITMAP,Config_getString("RTF_OUTPUT"),
2442 fileName,relPath,FALSE);
2446 t << rtf_Style_Reset << endl;
2447 t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
2448 t << fn << "." << Config_getEnum("DOT_IMAGE_FORMAT");
2449 t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
2451 DBG_RTF(t << "{\\comment (endInclDepGraph)}" << endl)
2454 void RTFGenerator::startGroupCollaboration()
2458 void RTFGenerator::endGroupCollaboration(const DotGroupCollaboration &)
2462 void RTFGenerator::startCallGraph()
2464 DBG_RTF(t << "{\\comment (startCallGraph)}" << endl)
2467 void RTFGenerator::endCallGraph(const DotCallGraph &g)
2471 QCString fn = g.writeGraph(t,BITMAP,Config_getString("RTF_OUTPUT"),
2472 fileName,relPath,FALSE);
2476 t << rtf_Style_Reset << endl;
2477 t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
2478 t << fn << "." << Config_getEnum("DOT_IMAGE_FORMAT");
2479 t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
2481 DBG_RTF(t << "{\\comment (endCallGraph)}" << endl)
2484 void RTFGenerator::startDirDepGraph()
2486 DBG_RTF(t << "{\\comment (startDirDepGraph)}" << endl)
2489 void RTFGenerator::endDirDepGraph(const DotDirDeps &g)
2493 QCString fn = g.writeGraph(t,BITMAP,Config_getString("RTF_OUTPUT"),
2494 fileName,relPath,FALSE);
2498 t << rtf_Style_Reset << endl;
2499 t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
2500 t << fn << "." << Config_getEnum("DOT_IMAGE_FORMAT");
2501 t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
2503 DBG_RTF(t << "{\\comment (endDirDepGraph)}" << endl)
2506 /** Tests the integrity of the result by counting brackets.
2509 void testRTFOutput(const char *name)
2515 if (f.open(IO_ReadOnly))
2517 while ((c=f.getch())!=-1)
2519 if (c=='\\') // escape char
2524 else if (c=='{') // open bracket
2528 else if (c=='}') // close bracket
2537 else if (c=='\n') // newline
2543 if (bcount==0) return; // file is OK.
2545 err("error: RTF integrity test failed at line %d of %s due to a bracket mismatch.\n",line,name);
2546 err(" Please try to create a small code example that produces this error \n"
2547 " and send that to dimitri@stack.nl.\n");
2551 * This is an API to a VERY brittle RTF preprocessor that combines nested
2552 * RTF files. This version replaces the infile with the new file
2554 bool RTFGenerator::preProcessFileInplace(const char *path,const char *name)
2557 // store the original directory
2560 err("error: Output dir %s does not exist!\n",path);
2563 QCString oldDir = convertToQCString(QDir::currentDirPath());
2565 // go to the html output directory (i.e. path)
2566 QDir::setCurrent(d.absPath());
2569 QCString combinedName = (QCString)path+"/combined.rtf";
2570 QCString mainRTFName = (QCString)path+"/"+name;
2572 QFile outf(combinedName);
2573 if (!outf.open(IO_WriteOnly))
2575 err("Failed to open %s for writing!\n",combinedName.data());
2578 FTextStream outt(&outf);
2580 if (!preProcessFile(thisDir,mainRTFName,outt))
2582 // it failed, remove the temp file
2584 thisDir.remove(combinedName);
2585 QDir::setCurrent(oldDir);
2589 // everything worked, move the files
2591 thisDir.remove(mainRTFName);
2592 thisDir.rename(combinedName,mainRTFName);
2594 testRTFOutput(mainRTFName);
2596 QDir::setCurrent(oldDir);
2600 void RTFGenerator::startMemberGroupHeader(bool hasHeader)
2602 DBG_RTF(t << "{\\comment startMemberGroupHeader}" << endl)
2604 if (hasHeader) incrementIndentLevel();
2605 t << rtf_Style_Reset << rtf_Style["GroupHeader"]->reference;
2608 void RTFGenerator::endMemberGroupHeader()
2610 DBG_RTF(t << "{\\comment endMemberGroupHeader}" << endl)
2612 t << rtf_Style_Reset << rtf_CList_DepthStyle();
2615 void RTFGenerator::startMemberGroupDocs()
2617 DBG_RTF(t << "{\\comment startMemberGroupDocs}" << endl)
2621 void RTFGenerator::endMemberGroupDocs()
2623 DBG_RTF(t << "{\\comment endMemberGroupDocs}" << endl)
2628 void RTFGenerator::startMemberGroup()
2630 DBG_RTF(t << "{\\comment startMemberGroup}" << endl)
2631 t << rtf_Style_Reset << rtf_BList_DepthStyle() << endl;
2634 void RTFGenerator::endMemberGroup(bool hasHeader)
2636 DBG_RTF(t << "{\\comment endMemberGroup}" << endl)
2637 if (hasHeader) decrementIndentLevel();
2641 void RTFGenerator::startSimpleSect(SectionTypes,const char *file,const char *anchor,const char *title)
2643 DBG_RTF(t << "{\\comment (startSimpleSect)}" << endl)
2644 t << "{"; // ends at endDescList
2645 t << "{"; // ends at endDescTitle
2650 writeObjectLink(0,file,anchor,title);
2659 incrementIndentLevel();
2660 t << rtf_Style_Reset << rtf_DList_DepthStyle();
2663 void RTFGenerator::endSimpleSect()
2665 DBG_RTF(t << "{\\comment (endSimpleSect)}" << endl)
2667 decrementIndentLevel();
2668 m_omitParagraph = TRUE;
2672 void RTFGenerator::startParamList(ParamListTypes,const char *title)
2674 DBG_RTF(t << "{\\comment (startParamList)}" << endl)
2675 t << "{"; // ends at endParamList
2676 t << "{"; // ends at endDescTitle
2683 incrementIndentLevel();
2684 t << rtf_Style_Reset << rtf_DList_DepthStyle();
2687 void RTFGenerator::endParamList()
2689 DBG_RTF(t << "{\\comment (endParamList)}" << endl)
2691 decrementIndentLevel();
2692 m_omitParagraph = TRUE;
2696 void RTFGenerator::startParameterType(bool first,const char *key)
2698 DBG_RTF(t << "{\\comment (startParameterType)}" << endl)
2701 t << " " << key << " ";
2705 void RTFGenerator::endParameterType()
2707 DBG_RTF(t << "{\\comment (endParameterType)}" << endl)
2711 void RTFGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *)
2713 RTFDocVisitor *visitor = new RTFDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""));
2716 m_omitParagraph = TRUE;
2719 void RTFGenerator::rtfwriteRuler_doubleline()
2721 DBG_RTF(t << "{\\comment (rtfwriteRuler_doubleline)}" << endl)
2722 t << "{\\pard\\widctlpar\\brdrb\\brdrdb\\brdrw15\\brsp20 \\adjustright \\par}" << endl;
2725 void RTFGenerator::rtfwriteRuler_emboss()
2727 DBG_RTF(t << "{\\comment (rtfwriteRuler_emboss)}" << endl)
2728 t << "{\\pard\\widctlpar\\brdrb\\brdremboss\\brdrw15\\brsp20 \\adjustright \\par}" << endl;
2731 void RTFGenerator::rtfwriteRuler_thick()
2733 DBG_RTF(t << "{\\comment (rtfwriteRuler_thick)}" << endl)
2734 t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw75\\brsp20 \\adjustright \\par}" << endl;
2737 void RTFGenerator::rtfwriteRuler_thin()
2739 DBG_RTF(t << "{\\comment (rtfwriteRuler_thin)}" << endl)
2740 t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}" << endl;
2744 void RTFGenerator::postProcess(QByteArray &a)
2746 QByteArray enc(a.size()*4); // worst case
2750 for (i=0;i<a.size();i++)
2752 unsigned char c = (unsigned char)a.at(i);
2754 // treat characters > 0x80 as multibyte characters, except when they
2755 // are control characters
2756 if (c>0x80 || (mbFlag && c!='\\' && c!='{' && c!='}'))
2759 sprintf(s,"\\'%X",c);
2760 qstrcpy(enc.data()+off,s);
2774 void RTFGenerator::startConstraintList(const char *header)
2776 DBG_RTF(t << "{\\comment (startConstraintList)}" << endl)
2777 t << "{"; // ends at endConstraintList
2785 incrementIndentLevel();
2786 t << rtf_Style_Reset << rtf_DList_DepthStyle();
2789 void RTFGenerator::startConstraintParam()
2791 DBG_RTF(t << "{\\comment (startConstraintParam)}" << endl)
2795 void RTFGenerator::endConstraintParam()
2797 DBG_RTF(t << "{\\comment (endConstraintParam)}" << endl)
2802 void RTFGenerator::startConstraintType()
2804 DBG_RTF(t << "{\\comment (startConstraintType)}" << endl)
2808 void RTFGenerator::endConstraintType()
2810 DBG_RTF(t << "{\\comment (endConstraintType)}" << endl)
2815 void RTFGenerator::startConstraintDocs()
2817 DBG_RTF(t << "{\\comment (startConstraintDocs)}" << endl)
2820 void RTFGenerator::endConstraintDocs()
2822 DBG_RTF(t << "{\\comment (endConstraintDocs)}" << endl)
2826 void RTFGenerator::endConstraintList()
2828 DBG_RTF(t << "{\\comment (endConstraintList)}" << endl)
2830 decrementIndentLevel();
2831 m_omitParagraph = TRUE;
2835 void RTFGenerator::startIndexListItem()
2837 DBG_RTF(t << "{\\comment (startIndexListItem)}" << endl)
2840 void RTFGenerator::endIndexListItem()
2842 DBG_RTF(t << "{\\comment (endIndexListItem)}" << endl)
2843 t << "\\par" << endl;
2846 void RTFGenerator::startInlineHeader()
2848 DBG_RTF(t << "{\\comment (startInlineHeader)}" << endl)
2850 t << rtf_Style_Reset << rtf_Style["Heading5"]->reference;
2854 void RTFGenerator::endInlineHeader()
2856 DBG_RTF(t << "{\\comment (endInlineHeader)}" << endl)
2862 void RTFGenerator::startMemberDocSimple()
2864 DBG_RTF(t << "{\\comment (startMemberDocSimple)}" << endl)
2865 t << "{\\par" << endl;
2866 t << "{" << rtf_Style["Heading5"]->reference << endl;
2867 t << theTranslator->trCompoundMembers() << ":\\par}" << endl;
2868 t << rtf_Style_Reset << rtf_DList_DepthStyle();
2869 t << "\\trowd \\trgaph108\\trleft426\\tblind426"
2870 "\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 "
2871 "\\trbrdrl\\brdrs\\brdrw10\\brdrcf15 "
2872 "\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 "
2873 "\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 "
2874 "\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 "
2875 "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< endl;
2876 int i,columnPos[3] = { 25, 50, 100 };
2879 t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
2880 "\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 "
2881 "\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 "
2882 "\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 "
2884 "\\cellx" << (rtf_pageWidth*columnPos[i]/100) << endl;
2886 t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
2889 void RTFGenerator::endMemberDocSimple()
2891 DBG_RTF(t << "{\\comment (endMemberDocSimple)}" << endl)
2895 void RTFGenerator::startInlineMemberType()
2897 DBG_RTF(t << "{\\comment (startInlineMemberType)}" << endl)
2901 void RTFGenerator::endInlineMemberType()
2903 DBG_RTF(t << "{\\comment (endInlineMemberType)}" << endl)
2907 void RTFGenerator::startInlineMemberName()
2909 DBG_RTF(t << "{\\comment (startInlineMemberName)}" << endl)
2913 void RTFGenerator::endInlineMemberName()
2915 DBG_RTF(t << "{\\comment (endInlineMemberName)}" << endl)
2919 void RTFGenerator::startInlineMemberDoc()
2921 DBG_RTF(t << "{\\comment (startInlineMemberDoc)}" << endl)
2925 void RTFGenerator::endInlineMemberDoc()
2927 DBG_RTF(t << "{\\comment (endInlineMemberDoc)}" << endl)
2928 t << "\\cell }{\\row }" << endl;
2931 void RTFGenerator::startLabels()
2935 void RTFGenerator::writeLabel(const char *l,bool isLast)
2937 t << "{\\f2 [" << l << "]}";
2938 if (!isLast) t << ", ";
2941 void RTFGenerator::endLabels()