Orb/Doxygen/src/htmldocvisitor.cpp
author Michel Szarindar <Michel.Szarindar@Nokia.com>
Thu, 18 Mar 2010 18:26:18 +0000
changeset 1 82f11024044a
parent 0 42188c7ea2d9
child 4 468f4c8d3d5b
permissions -rw-r--r--
Contribution of a new version of ORB and CXX DITA plug-in bug 1461 bug 1621 bug 1962
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
     1
/******************************************************************************
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
     2
 *
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
     3
 * 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
     4
 *
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
     5
 *
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
     6
 * Copyright (C) 1997-2008 by Dimitri van Heesch.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
     7
 *
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
     8
 * Permission to use, copy, modify, and distribute this software and its
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
     9
 * documentation under the terms of the GNU General Public License is hereby 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    10
 * granted. No representations are made about the suitability of this software 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    11
 * for any purpose. It is provided "as is" without express or implied warranty.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    12
 * See the GNU General Public License for more details.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    13
 *
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    14
 * Documents produced by Doxygen are derivative works derived from the
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    15
 * input used in their production; they are not affected by this license.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    16
 *
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    17
 */
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    18
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    19
#include <qdir.h>
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    20
#include "htmldocvisitor.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    21
#include "docparser.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    22
#include "language.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    23
#include "doxygen.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    24
#include "outputgen.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    25
#include "dot.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    26
#include "message.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    27
#include "config.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    28
#include "htmlgen.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    29
#include "parserintf.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    30
#include "msc.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    31
#include "util.h"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    32
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    33
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    34
static const int NUM_HTML_LIST_TYPES = 4;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    35
static const char types[][NUM_HTML_LIST_TYPES] = {"1", "a", "i", "A"};
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    36
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    37
static QCString convertIndexWordToAnchor(const QString &word)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    38
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    39
  static char hex[] = "0123456789abcdef";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    40
  uint i;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    41
  QCString result;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    42
  for (i=0;i<word.length();i++)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    43
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    44
    int c = word.at(i);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    45
    if (isId(c))
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    46
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    47
      result+=c;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    48
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    49
    else if (isspace(c))
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    50
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    51
      result+="_";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    52
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    53
    else
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    54
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    55
      char cs[3];
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    56
      cs[0]=hex[c>>4];
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    57
      cs[1]=hex[c&0xf];
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    58
      cs[2]=0;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    59
      result+=cs;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    60
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    61
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    62
  return result;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    63
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    64
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    65
static bool mustBeOutsideParagraph(DocNode *n)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    66
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    67
  switch (n->kind())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    68
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    69
          /* <ul> */
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    70
        case DocNode::Kind_HtmlList:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    71
        case DocNode::Kind_SimpleList:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    72
        case DocNode::Kind_AutoList:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    73
          /* <dl> */
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    74
        case DocNode::Kind_SimpleSect:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    75
        case DocNode::Kind_ParamSect:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    76
        case DocNode::Kind_HtmlDescList:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    77
        case DocNode::Kind_XRefItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    78
          /* <table> */
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    79
        case DocNode::Kind_HtmlTable:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    80
          /* <h?> */
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    81
        case DocNode::Kind_Section:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    82
        case DocNode::Kind_HtmlHeader:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    83
          /* <div> */
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    84
        case DocNode::Kind_Verbatim:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    85
        case DocNode::Kind_Include:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    86
        case DocNode::Kind_Image:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    87
        case DocNode::Kind_SecRefList:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    88
          /* <hr> */
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    89
        case DocNode::Kind_HorRuler:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    90
          return TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    91
        case DocNode::Kind_StyleChange:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    92
          return ((DocStyleChange*)n)->style()==DocStyleChange::Preformatted ||
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    93
                 ((DocStyleChange*)n)->style()==DocStyleChange::Div ||
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    94
                 ((DocStyleChange*)n)->style()==DocStyleChange::Center;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    95
        case DocNode::Kind_Formula:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    96
          return !((DocFormula*)n)->isInline();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    97
        default:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    98
          break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
    99
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   100
  return FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   101
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   102
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   103
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   104
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   105
static QString htmlAttribsToString(const HtmlAttribList &attribs)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   106
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   107
  QString result;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   108
  HtmlAttribListIterator li(attribs);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   109
  HtmlAttrib *att;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   110
  for (li.toFirst();(att=li.current());++li)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   111
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   112
    if (!att->value.isEmpty())  // ignore attribute without values as they
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   113
                                // are not XHTML compliant
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   114
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   115
      result+=" ";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   116
      result+=att->name;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   117
      result+="=\""+convertToXML(att->value)+"\"";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   118
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   119
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   120
  return result;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   121
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   122
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   123
//-------------------------------------------------------------------------
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   124
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   125
HtmlDocVisitor::HtmlDocVisitor(QTextStream &t,CodeOutputInterface &ci,
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   126
                               const char *langExt) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   127
  : DocVisitor(DocVisitor_Html), m_t(t), m_ci(ci), m_insidePre(FALSE), 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   128
                                 m_hide(FALSE), m_langExt(langExt)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   129
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   130
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   131
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   132
  //--------------------------------------
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   133
  // visitor functions for leaf nodes
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   134
  //--------------------------------------
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   135
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   136
void HtmlDocVisitor::visit(DocWord *w)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   137
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   138
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   139
  filter(w->word());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   140
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   141
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   142
void HtmlDocVisitor::visit(DocLinkedWord *w)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   143
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   144
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   145
  startLink(w->ref(),w->file(),w->relPath(),w->anchor(),w->tooltip());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   146
  filter(w->word());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   147
  endLink();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   148
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   149
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   150
void HtmlDocVisitor::visit(DocWhiteSpace *w)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   151
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   152
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   153
  if (m_insidePre)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   154
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   155
    m_t << w->chars();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   156
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   157
  else
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   158
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   159
    m_t << " ";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   160
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   161
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   162
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   163
void HtmlDocVisitor::visit(DocSymbol *s)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   164
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   165
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   166
  switch(s->symbol())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   167
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   168
    case DocSymbol::BSlash:  m_t << "\\"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   169
    case DocSymbol::At:      m_t << "@"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   170
    case DocSymbol::Less:    m_t << "&lt;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   171
    case DocSymbol::Greater: m_t << "&gt;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   172
    case DocSymbol::Amp:     m_t << "&amp;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   173
    case DocSymbol::Dollar:  m_t << "$"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   174
    case DocSymbol::Hash:    m_t << "#"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   175
    case DocSymbol::Percent: m_t << "%"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   176
    case DocSymbol::Copy:    m_t << "&copy;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   177
    case DocSymbol::Tm:      m_t << "&trade;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   178
    case DocSymbol::Reg:     m_t << "&reg;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   179
    case DocSymbol::Apos:    m_t << "'"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   180
    case DocSymbol::Quot:    m_t << "\""; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   181
    case DocSymbol::Lsquo:   m_t << "&lsquo;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   182
    case DocSymbol::Rsquo:   m_t << "&rsquo;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   183
    case DocSymbol::Ldquo:   m_t << "&ldquo;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   184
    case DocSymbol::Rdquo:   m_t << "&rdquo;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   185
    case DocSymbol::Ndash:   m_t << "&ndash;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   186
    case DocSymbol::Mdash:   m_t << "&mdash;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   187
    case DocSymbol::Uml:     m_t << "&" << s->letter() << "uml;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   188
    case DocSymbol::Acute:   m_t << "&" << s->letter() << "acute;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   189
    case DocSymbol::Grave:   m_t << "&" << s->letter() << "grave;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   190
    case DocSymbol::Circ:    m_t << "&" << s->letter() << "circ;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   191
    case DocSymbol::Slash:   m_t << "&" << s->letter() << "slash;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   192
    case DocSymbol::Tilde:   m_t << "&" << s->letter() << "tilde;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   193
    case DocSymbol::Szlig:   m_t << "&szlig;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   194
    case DocSymbol::Cedil:   m_t << "&" << s->letter() << "cedil;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   195
    case DocSymbol::Ring:    m_t << "&" << s->letter() << "ring;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   196
    case DocSymbol::Nbsp:    m_t << "&nbsp;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   197
    case DocSymbol::AElig:   m_t << "&AElig;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   198
    case DocSymbol::Aelig:   m_t << "&aelig;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   199
    default:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   200
                             err("Error: unknown symbol found\n");
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   201
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   202
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   203
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   204
void HtmlDocVisitor::visit(DocURL *u)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   205
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   206
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   207
  m_t << "<a href=\"";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   208
  if (u->isEmail()) m_t << "mailto:";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   209
  m_t << u->url() << "\">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   210
  filter(u->url());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   211
  m_t << "</a>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   212
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   213
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   214
void HtmlDocVisitor::visit(DocLineBreak *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   215
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   216
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   217
  m_t << "<br/>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   218
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   219
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   220
void HtmlDocVisitor::visit(DocHorRuler *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   221
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   222
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   223
  m_t << "<hr/>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   224
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   225
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   226
void HtmlDocVisitor::visit(DocStyleChange *s)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   227
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   228
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   229
  switch (s->style())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   230
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   231
    case DocStyleChange::Bold:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   232
      if (s->enable()) m_t << "<b" << htmlAttribsToString(s->attribs()) << ">";      else m_t << "</b>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   233
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   234
    case DocStyleChange::Italic:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   235
      if (s->enable()) m_t << "<em" << htmlAttribsToString(s->attribs()) << ">";     else m_t << "</em>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   236
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   237
    case DocStyleChange::Code:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   238
      if (s->enable()) m_t << "<code" << htmlAttribsToString(s->attribs()) << ">";   else m_t << "</code>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   239
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   240
    case DocStyleChange::Subscript:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   241
      if (s->enable()) m_t << "<sub" << htmlAttribsToString(s->attribs()) << ">";    else m_t << "</sub>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   242
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   243
    case DocStyleChange::Superscript:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   244
      if (s->enable()) m_t << "<sup" << htmlAttribsToString(s->attribs()) << ">";    else m_t << "</sup>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   245
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   246
    case DocStyleChange::Center:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   247
      if (s->enable()) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   248
      {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   249
        forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   250
        m_t << "<center" << htmlAttribsToString(s->attribs()) << ">"; 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   251
      }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   252
      else 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   253
      {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   254
        m_t << "</center>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   255
        forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   256
      }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   257
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   258
    case DocStyleChange::Small:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   259
      if (s->enable()) m_t << "<small" << htmlAttribsToString(s->attribs()) << ">";  else m_t << "</small>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   260
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   261
    case DocStyleChange::Preformatted:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   262
      if (s->enable())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   263
      {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   264
        forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   265
        m_t << "<pre" << htmlAttribsToString(s->attribs()) << ">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   266
        m_insidePre=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   267
      }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   268
      else
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   269
      {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   270
        m_insidePre=FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   271
        m_t << "</pre>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   272
        forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   273
      }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   274
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   275
    case DocStyleChange::Div:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   276
      if (s->enable()) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   277
      {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   278
        forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   279
        m_t << "<div" << htmlAttribsToString(s->attribs()) << ">";  
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   280
      }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   281
      else 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   282
      {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   283
        m_t << "</div>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   284
        forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   285
      }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   286
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   287
    case DocStyleChange::Span:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   288
      if (s->enable()) m_t << "<span" << htmlAttribsToString(s->attribs()) << ">";  else m_t << "</span>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   289
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   290
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   291
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   292
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   293
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   294
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   295
void HtmlDocVisitor::visit(DocVerbatim *s)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   296
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   297
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   298
  switch(s->type())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   299
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   300
    case DocVerbatim::Code: // fall though
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   301
      forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   302
      m_t << PREFRAG_START;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   303
      Doxygen::parserManager->getParser(m_langExt)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   304
                            ->parseCode(m_ci,s->context(),s->text().latin1(),
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   305
                                        s->isExample(),s->exampleFile());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   306
      m_t << PREFRAG_END;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   307
      forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   308
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   309
    case DocVerbatim::Verbatim: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   310
      forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   311
      m_t << PREFRAG_START;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   312
      filter(s->text());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   313
      m_t << PREFRAG_END;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   314
      forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   315
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   316
    case DocVerbatim::HtmlOnly: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   317
      m_t << s->text(); 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   318
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   319
    case DocVerbatim::ManOnly: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   320
    case DocVerbatim::LatexOnly: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   321
    case DocVerbatim::XmlOnly: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   322
      /* nothing */ 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   323
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   324
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   325
    case DocVerbatim::Dot:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   326
      {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   327
        static int dotindex = 1;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   328
        QCString fileName(4096);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   329
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   330
        fileName.sprintf("%s%d%s", 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   331
            (Config_getString("HTML_OUTPUT")+"/inline_dotgraph_").data(), 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   332
            dotindex++,
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   333
            ".dot"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   334
           );
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   335
        QFile file(fileName);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   336
        if (!file.open(IO_WriteOnly))
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   337
        {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   338
          err("Could not open file %s for writing\n",fileName.data());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   339
        }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   340
        file.writeBlock( s->text(), s->text().length() );
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   341
        file.close();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   342
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   343
        forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   344
        m_t << "<div align=\"center\">" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   345
        writeDotFile(fileName,s->relPath(),s->context());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   346
        m_t << "</div>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   347
        forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   348
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   349
        if (Config_getBool("DOT_CLEANUP")) file.remove();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   350
      }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   351
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   352
    case DocVerbatim::Msc:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   353
      {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   354
        static int mscindex = 1;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   355
        QCString baseName(4096);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   356
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   357
        baseName.sprintf("%s%d", 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   358
            (Config_getString("HTML_OUTPUT")+"/inline_mscgraph_").data(), 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   359
            mscindex++
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   360
           );
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   361
        QFile file(baseName+".msc");
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   362
        if (!file.open(IO_WriteOnly))
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   363
        {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   364
          err("Could not open file %s.msc for writing\n",baseName.data());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   365
        }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   366
        QCString text = "msc {";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   367
        text+=s->text();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   368
        text+="}";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   369
        file.writeBlock( text, text.length() );
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   370
        file.close();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   371
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   372
        forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   373
        m_t << "<div align=\"center\">" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   374
        writeMscFile(baseName,s->relPath(),s->context());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   375
        m_t << "</div>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   376
        forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   377
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   378
        if (Config_getBool("DOT_CLEANUP")) file.remove();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   379
      }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   380
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   381
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   382
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   383
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   384
void HtmlDocVisitor::visit(DocAnchor *anc)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   385
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   386
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   387
  m_t << "<a class=\"anchor\" id=\"" << anc->anchor() << "\"></a>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   388
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   389
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   390
void HtmlDocVisitor::visit(DocInclude *inc)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   391
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   392
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   393
  switch(inc->type())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   394
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   395
    case DocInclude::Include: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   396
      forceEndParagraph(inc);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   397
      m_t << PREFRAG_START;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   398
      Doxygen::parserManager->getParser(inc->extension())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   399
                            ->parseCode(m_ci,                 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   400
                                        inc->context(),
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   401
                                        inc->text().latin1(),
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   402
                                        inc->isExample(),
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   403
                                        inc->exampleFile(),
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   404
                                        0,   // fd
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   405
                                        -1,  // startLine
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   406
                                        -1,  // endLine
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   407
                                        TRUE // inlineFragment
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   408
                                       );
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   409
      m_t << PREFRAG_END;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   410
      forceStartParagraph(inc);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   411
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   412
    case DocInclude::IncWithLines:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   413
      { 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   414
         forceEndParagraph(inc);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   415
         m_t << PREFRAG_START;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   416
         QFileInfo cfi( inc->file() );
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   417
         FileDef fd( cfi.dirPath(), cfi.fileName() );
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   418
         Doxygen::parserManager->getParser(inc->extension())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   419
                               ->parseCode(m_ci,
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   420
                                           inc->context(),
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   421
                                           inc->text().latin1(),
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   422
                                           inc->isExample(),
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   423
                                           inc->exampleFile(), &fd);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   424
         m_t << PREFRAG_END;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   425
         forceStartParagraph(inc);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   426
      }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   427
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   428
    case DocInclude::DontInclude: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   429
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   430
    case DocInclude::HtmlInclude: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   431
      m_t << inc->text(); 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   432
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   433
    case DocInclude::VerbInclude: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   434
      forceEndParagraph(inc);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   435
      m_t << PREFRAG_START;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   436
      filter(inc->text());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   437
      m_t << PREFRAG_END;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   438
      forceStartParagraph(inc);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   439
      break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   440
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   441
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   442
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   443
void HtmlDocVisitor::visit(DocIncOperator *op)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   444
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   445
  //printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n",
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   446
  //    op->type(),op->isFirst(),op->isLast(),op->text().data());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   447
  if (op->isFirst()) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   448
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   449
    if (!m_hide) m_t << PREFRAG_START;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   450
    pushEnabled();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   451
    m_hide=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   452
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   453
  if (op->type()!=DocIncOperator::Skip) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   454
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   455
    popEnabled();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   456
    if (!m_hide) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   457
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   458
      Doxygen::parserManager->getParser(m_langExt)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   459
                            ->parseCode(m_ci,op->context(),
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   460
                                op->text().latin1(),op->isExample(),
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   461
                                op->exampleFile());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   462
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   463
    pushEnabled();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   464
    m_hide=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   465
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   466
  if (op->isLast())  
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   467
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   468
    popEnabled();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   469
    if (!m_hide) m_t << PREFRAG_END;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   470
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   471
  else
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   472
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   473
    if (!m_hide) m_t << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   474
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   475
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   476
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   477
void HtmlDocVisitor::visit(DocFormula *f)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   478
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   479
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   480
  bool bDisplay = !f->isInline();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   481
  if (bDisplay) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   482
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   483
    forceEndParagraph(f);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   484
    m_t << "<p class=\"formulaDsp\">" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   485
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   486
  m_t << "<img class=\"formula" 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   487
      << (bDisplay ? "Dsp" : "Inl");
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   488
  m_t << "\" alt=\"";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   489
  filterQuotedCdataAttr(f->text());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   490
  m_t << "\"";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   491
  /// @todo cache image dimensions on formula generation and give height/width
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   492
  /// for faster preloading and better rendering of the page
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   493
  m_t << " src=\"" << f->relPath() << f->name() << ".png\"/>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   494
  if (bDisplay)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   495
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   496
    m_t << endl << "</p>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   497
    forceStartParagraph(f);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   498
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   499
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   500
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   501
void HtmlDocVisitor::visit(DocIndexEntry *e)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   502
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   503
  QCString anchor = convertIndexWordToAnchor(e->entry());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   504
  if (e->member()) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   505
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   506
    anchor.prepend(e->member()->anchor()+"_");
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   507
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   508
  m_t << "<a name=\"" << anchor << "\"></a>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   509
  //printf("*** DocIndexEntry: word='%s' scope='%s' member='%s'\n",
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   510
  //       e->entry().data(),
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   511
  //       e->scope()  ? e->scope()->name().data()  : "<null>",
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   512
  //       e->member() ? e->member()->name().data() : "<null>"
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   513
  //      );
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   514
  Doxygen::indexList.addIndexItem(e->scope(),e->member(),anchor,e->entry());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   515
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   516
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   517
void HtmlDocVisitor::visit(DocSimpleSectSep *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   518
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   519
  m_t << "</dd>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   520
  m_t << "<dd>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   521
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   522
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   523
//--------------------------------------
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   524
// visitor functions for compound nodes
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   525
//--------------------------------------
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   526
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   527
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   528
void HtmlDocVisitor::visitPre(DocAutoList *l)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   529
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   530
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   531
  forceEndParagraph(l);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   532
  if (l->isEnumList())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   533
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   534
    //
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   535
    // Do list type based on depth:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   536
    // 1.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   537
    //   a.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   538
    //     i.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   539
    //       A. 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   540
    //         1. (repeat)...
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   541
    //
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   542
    m_t << "<ol type=\"" << types[l->depth() % NUM_HTML_LIST_TYPES] << "\">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   543
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   544
  else
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   545
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   546
    m_t << "<ul>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   547
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   548
  if (!l->isPreformatted()) m_t << "\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   549
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   550
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   551
void HtmlDocVisitor::visitPost(DocAutoList *l)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   552
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   553
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   554
  if (l->isEnumList())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   555
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   556
    m_t << "</ol>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   557
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   558
  else
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   559
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   560
    m_t << "</ul>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   561
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   562
  if (!l->isPreformatted()) m_t << "\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   563
  forceStartParagraph(l);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   564
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   565
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   566
void HtmlDocVisitor::visitPre(DocAutoListItem *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   567
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   568
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   569
  m_t << "<li>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   570
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   571
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   572
void HtmlDocVisitor::visitPost(DocAutoListItem *li) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   573
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   574
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   575
  m_t << "</li>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   576
  if (!li->isPreformatted()) m_t << "\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   577
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   578
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   579
template<class T> 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   580
bool isFirstChildNode(T *parent, DocNode *node)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   581
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   582
   return parent->children().getFirst()==node;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   583
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   584
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   585
template<class T> 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   586
bool isLastChildNode(T *parent, DocNode *node)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   587
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   588
   return parent->children().getLast()==node;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   589
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   590
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   591
bool isSeparatedParagraph(DocSimpleSect *parent,DocPara *par)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   592
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   593
  QList<DocNode> nodes = parent->children();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   594
  int i = nodes.findRef(par);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   595
  if (i==-1) return FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   596
  int count = parent->children().count();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   597
  if (count>1 && i==0)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   598
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   599
    if (nodes.at(i+1)->kind()==DocNode::Kind_SimpleSectSep)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   600
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   601
      return TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   602
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   603
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   604
  else if (count>1 && i==count-1)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   605
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   606
    if (nodes.at(i-1)->kind()==DocNode::Kind_SimpleSectSep)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   607
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   608
      return TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   609
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   610
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   611
  else if (count>2 && i>0 && i<count-1)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   612
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   613
    if (nodes.at(i-1)->kind()==DocNode::Kind_SimpleSectSep &&
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   614
        nodes.at(i+1)->kind()==DocNode::Kind_SimpleSectSep)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   615
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   616
      return TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   617
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   618
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   619
  return FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   620
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   621
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   622
static int getParagraphContext(DocPara *p,bool &isFirst,bool &isLast)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   623
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   624
  int t=0;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   625
  isFirst=FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   626
  isLast=FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   627
  if (p && p->parent())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   628
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   629
    switch (p->parent()->kind()) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   630
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   631
      case DocNode::Kind_AutoListItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   632
        isFirst=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   633
        isLast =TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   634
        if (isFirst) t=1;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   635
        if (isLast)  t=3;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   636
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   637
      case DocNode::Kind_SimpleListItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   638
        isFirst=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   639
        isLast =TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   640
        if (isFirst) t=1;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   641
        if (isLast)  t=3;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   642
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   643
      case DocNode::Kind_HtmlListItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   644
        isFirst=isFirstChildNode((DocHtmlListItem*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   645
        isLast =isLastChildNode ((DocHtmlListItem*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   646
        if (isFirst) t=1;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   647
        if (isLast)  t=3;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   648
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   649
      case DocNode::Kind_SecRefItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   650
        isFirst=isFirstChildNode((DocSecRefItem*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   651
        isLast =isLastChildNode ((DocSecRefItem*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   652
        if (isFirst) t=1;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   653
        if (isLast)  t=3;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   654
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   655
      case DocNode::Kind_HtmlDescData:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   656
        isFirst=isFirstChildNode((DocHtmlDescData*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   657
        isLast =isLastChildNode ((DocHtmlDescData*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   658
        if (isFirst) t=2;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   659
        if (isLast)  t=4;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   660
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   661
      case DocNode::Kind_XRefItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   662
        isFirst=isFirstChildNode((DocXRefItem*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   663
        isLast =isLastChildNode ((DocXRefItem*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   664
        if (isFirst) t=2;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   665
        if (isLast)  t=4;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   666
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   667
      case DocNode::Kind_HtmlCell:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   668
        isFirst=isFirstChildNode((DocHtmlCell*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   669
        isLast =isLastChildNode ((DocHtmlCell*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   670
        if (isFirst) t=5;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   671
        if (isLast)  t=6;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   672
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   673
      case DocNode::Kind_SimpleSect:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   674
        isFirst=isFirstChildNode((DocSimpleSect*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   675
        isLast =isLastChildNode ((DocSimpleSect*)p->parent(),p);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   676
        if (isFirst) t=2;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   677
        if (isLast)  t=4;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   678
        if (isSeparatedParagraph((DocSimpleSect*)p->parent(),p))
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   679
          // if the paragraph is enclosed with separators it will
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   680
          // be included in <dd>..</dd> so avoid addition paragraph
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   681
          // markers
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   682
        {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   683
          isFirst=isLast=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   684
        }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   685
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   686
      default:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   687
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   688
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   689
    //printf("para=%p parent()->kind=%d isFirst=%d isLast=%d t=%d\n",
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   690
    //    p,p->parent()->kind(),isFirst,isLast,t);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   691
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   692
  return t;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   693
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   694
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   695
void HtmlDocVisitor::visitPre(DocPara *p) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   696
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   697
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   698
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   699
  //printf("Processing docpara with parent of kind %d\n",
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   700
  //       p->parent() ? p->parent()->kind() : -1);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   701
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   702
  bool needsTag = FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   703
  if (p && p->parent()) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   704
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   705
    switch (p->parent()->kind()) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   706
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   707
      case DocNode::Kind_Section:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   708
      case DocNode::Kind_HtmlListItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   709
      case DocNode::Kind_HtmlDescData:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   710
      case DocNode::Kind_HtmlCell:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   711
      case DocNode::Kind_SimpleListItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   712
      case DocNode::Kind_AutoListItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   713
      case DocNode::Kind_SimpleSect:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   714
      case DocNode::Kind_XRefItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   715
        needsTag = TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   716
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   717
      case DocNode::Kind_Root:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   718
        needsTag = !((DocRoot*)p->parent())->singleLine();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   719
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   720
      default:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   721
        needsTag = FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   722
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   723
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   724
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   725
  // if the first element of a paragraph is something that should be outside of
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   726
  // the paragraph (<ul>,<dl>,<table>,..) then that will already started the 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   727
  // paragraph and we don't need to do it here
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   728
  uint nodeIndex = 0;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   729
  if (p && nodeIndex<p->children().count())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   730
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   731
    while (nodeIndex<p->children().count() && 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   732
           p->children().at(nodeIndex)->kind()==DocNode::Kind_WhiteSpace)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   733
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   734
      nodeIndex++;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   735
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   736
    if (nodeIndex<p->children().count())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   737
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   738
      DocNode *n = p->children().at(nodeIndex);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   739
      if (mustBeOutsideParagraph(n))
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   740
      {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   741
        needsTag = FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   742
      }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   743
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   744
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   745
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   746
  // check if this paragraph is the first or last child of a <li> or <dd>.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   747
  // this allows us to mark the tag with a special class so we can
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   748
  // fix the otherwise ugly spacing.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   749
  int t;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   750
  static const char *contexts[7] = 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   751
  { "",                     // 0
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   752
    " class=\"startli\"",   // 1
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   753
    " class=\"startdd\"",   // 2
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   754
    " class=\"endli\"",     // 3
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   755
    " class=\"enddd\"",     // 4
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   756
    " class=\"starttd\"",   // 5
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   757
    " class=\"endtd\""      // 6
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   758
  };
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   759
  bool isFirst;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   760
  bool isLast;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   761
  t = getParagraphContext(p,isFirst,isLast);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   762
  //printf("startPara first=%d last=%d\n",isFirst,isLast);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   763
  if (isFirst && isLast) needsTag=FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   764
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   765
  // write the paragraph tag (if needed)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   766
  if (needsTag) m_t << "<p" << contexts[t] << ">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   767
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   768
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   769
void HtmlDocVisitor::visitPost(DocPara *p)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   770
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   771
//  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   772
//  if (!p->isLast() &&            // omit <p> for last paragraph
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   773
//      !(p->parent() &&           // and for parameter sections
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   774
//        p->parent()->kind()==DocNode::Kind_ParamSect
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   775
//       ) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   776
//     ) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   777
//  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   778
//    m_t << "<p>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   779
//  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   780
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   781
  bool needsTag = FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   782
  if (p && p->parent()) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   783
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   784
    switch (p->parent()->kind()) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   785
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   786
      case DocNode::Kind_Section:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   787
      case DocNode::Kind_HtmlListItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   788
      case DocNode::Kind_HtmlDescData:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   789
      case DocNode::Kind_HtmlCell:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   790
      case DocNode::Kind_SimpleListItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   791
      case DocNode::Kind_AutoListItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   792
      case DocNode::Kind_SimpleSect:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   793
      case DocNode::Kind_XRefItem:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   794
        needsTag = TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   795
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   796
      case DocNode::Kind_Root:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   797
        needsTag = !((DocRoot*)p->parent())->singleLine();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   798
        break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   799
      default:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   800
        needsTag = FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   801
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   802
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   803
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   804
  QCString context;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   805
  // if the last element of a paragraph is something that should be outside of
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   806
  // the paragraph (<ul>,<dl>,<table>) then that will already have ended the 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   807
  // paragraph and we don't need to do it here
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   808
  int nodeIndex = p->children().count()-1;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   809
  if (p && nodeIndex>=0)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   810
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   811
    while (nodeIndex>=0 && p->children().at(nodeIndex)->kind()==DocNode::Kind_WhiteSpace)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   812
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   813
      nodeIndex--;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   814
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   815
    if (nodeIndex>=0)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   816
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   817
      DocNode *n = p->children().at(nodeIndex);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   818
      if (mustBeOutsideParagraph(n))
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   819
      {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   820
        needsTag = FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   821
      }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   822
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   823
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   824
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   825
  bool isFirst;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   826
  bool isLast;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   827
  getParagraphContext(p,isFirst,isLast);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   828
  //printf("endPara first=%d last=%d\n",isFirst,isLast);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   829
  if (isFirst && isLast) needsTag=FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   830
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   831
  if (needsTag) m_t << "</p>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   832
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   833
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   834
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   835
void HtmlDocVisitor::visitPre(DocRoot *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   836
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   837
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   838
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   839
void HtmlDocVisitor::visitPost(DocRoot *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   840
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   841
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   842
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   843
void HtmlDocVisitor::visitPre(DocSimpleSect *s)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   844
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   845
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   846
  forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   847
  m_t << "<dl class=\"" << s->typeString() << "\"><dt><b>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   848
  switch(s->type())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   849
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   850
    case DocSimpleSect::See: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   851
      m_t << theTranslator->trSeeAlso(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   852
    case DocSimpleSect::Return: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   853
      m_t << theTranslator->trReturns(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   854
    case DocSimpleSect::Author: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   855
      m_t << theTranslator->trAuthor(TRUE,TRUE); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   856
    case DocSimpleSect::Authors: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   857
      m_t << theTranslator->trAuthor(TRUE,FALSE); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   858
    case DocSimpleSect::Version: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   859
      m_t << theTranslator->trVersion(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   860
    case DocSimpleSect::Since: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   861
      m_t << theTranslator->trSince(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   862
    case DocSimpleSect::Date: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   863
      m_t << theTranslator->trDate(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   864
    case DocSimpleSect::Note: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   865
      m_t << theTranslator->trNote(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   866
    case DocSimpleSect::Warning:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   867
      m_t << theTranslator->trWarning(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   868
    case DocSimpleSect::Pre:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   869
      m_t << theTranslator->trPrecondition(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   870
    case DocSimpleSect::Post:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   871
      m_t << theTranslator->trPostcondition(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   872
    case DocSimpleSect::Invar:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   873
      m_t << theTranslator->trInvariant(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   874
    case DocSimpleSect::Remark:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   875
      m_t << theTranslator->trRemarks(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   876
    case DocSimpleSect::Attention:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   877
      m_t << theTranslator->trAttention(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   878
    case DocSimpleSect::User: break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   879
    case DocSimpleSect::Rcs: break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   880
    case DocSimpleSect::Unknown:  break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   881
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   882
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   883
  // special case 1: user defined title
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   884
  if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   885
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   886
    m_t << ":</b></dt><dd>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   887
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   888
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   889
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   890
void HtmlDocVisitor::visitPost(DocSimpleSect *s)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   891
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   892
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   893
  m_t << "</dd></dl>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   894
  forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   895
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   896
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   897
void HtmlDocVisitor::visitPre(DocTitle *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   898
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   899
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   900
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   901
void HtmlDocVisitor::visitPost(DocTitle *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   902
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   903
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   904
  m_t << "</b></dt><dd>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   905
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   906
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   907
void HtmlDocVisitor::visitPre(DocSimpleList *sl)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   908
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   909
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   910
  forceEndParagraph(sl);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   911
  m_t << "<ul>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   912
  if (!sl->isPreformatted()) m_t << "\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   913
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   914
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   915
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   916
void HtmlDocVisitor::visitPost(DocSimpleList *sl)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   917
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   918
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   919
  m_t << "</ul>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   920
  if (!sl->isPreformatted()) m_t << "\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   921
  forceStartParagraph(sl);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   922
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   923
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   924
void HtmlDocVisitor::visitPre(DocSimpleListItem *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   925
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   926
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   927
  m_t << "<li>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   928
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   929
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   930
void HtmlDocVisitor::visitPost(DocSimpleListItem *li) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   931
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   932
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   933
  m_t << "</li>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   934
  if (!li->isPreformatted()) m_t << "\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   935
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   936
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   937
void HtmlDocVisitor::visitPre(DocSection *s)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   938
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   939
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   940
  forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   941
  m_t << "<h" << s->level()+1 << ">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   942
  m_t << "<a class=\"anchor\" id=\"" << s->anchor();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   943
  m_t << "\">" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   944
  filter(convertCharEntitiesToUTF8(s->title().data()));
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   945
  m_t << "</a></h" << s->level()+1 << ">\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   946
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   947
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   948
void HtmlDocVisitor::visitPost(DocSection *s) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   949
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   950
  forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   951
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   952
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   953
void HtmlDocVisitor::visitPre(DocHtmlList *s)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   954
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   955
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   956
  forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   957
  if (s->type()==DocHtmlList::Ordered) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   958
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   959
    m_t << "<ol" << htmlAttribsToString(s->attribs()) << ">\n"; 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   960
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   961
  else 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   962
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   963
    m_t << "<ul" << htmlAttribsToString(s->attribs()) << ">\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   964
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   965
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   966
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   967
void HtmlDocVisitor::visitPost(DocHtmlList *s) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   968
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   969
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   970
  if (s->type()==DocHtmlList::Ordered) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   971
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   972
    m_t << "</ol>"; 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   973
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   974
  else
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   975
  { 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   976
    m_t << "</ul>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   977
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   978
  if (!s->isPreformatted()) m_t << "\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   979
  forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   980
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   981
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   982
void HtmlDocVisitor::visitPre(DocHtmlListItem *i)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   983
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   984
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   985
  m_t << "<li" << htmlAttribsToString(i->attribs()) << ">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   986
  if (!i->isPreformatted()) m_t << "\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   987
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   988
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   989
void HtmlDocVisitor::visitPost(DocHtmlListItem *) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   990
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   991
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   992
  m_t << "</li>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   993
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   994
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   995
void HtmlDocVisitor::visitPre(DocHtmlDescList *dl)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   996
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   997
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   998
  forceEndParagraph(dl);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
   999
  m_t << "<dl" << htmlAttribsToString(dl->attribs()) << ">\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1000
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1001
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1002
void HtmlDocVisitor::visitPost(DocHtmlDescList *dl) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1003
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1004
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1005
  m_t << "</dl>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1006
  forceStartParagraph(dl);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1007
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1008
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1009
void HtmlDocVisitor::visitPre(DocHtmlDescTitle *dt)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1010
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1011
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1012
  m_t << "<dt" << htmlAttribsToString(dt->attribs()) << ">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1013
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1014
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1015
void HtmlDocVisitor::visitPost(DocHtmlDescTitle *) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1016
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1017
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1018
  m_t << "</dt>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1019
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1020
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1021
void HtmlDocVisitor::visitPre(DocHtmlDescData *dd)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1022
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1023
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1024
  m_t << "<dd" << htmlAttribsToString(dd->attribs()) << ">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1025
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1026
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1027
void HtmlDocVisitor::visitPost(DocHtmlDescData *) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1028
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1029
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1030
  m_t << "</dd>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1031
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1032
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1033
void HtmlDocVisitor::visitPre(DocHtmlTable *t)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1034
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1035
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1036
  //bool hasBorder      = FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1037
  //bool hasCellSpacing = FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1038
  //bool hasCellPadding = FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1039
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1040
  forceEndParagraph(t);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1041
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1042
  //HtmlAttribListIterator li(t->attribs());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1043
  //HtmlAttrib *att;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1044
  //for (li.toFirst();(att=li.current());++li)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1045
  //{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1046
  // if      (att->name=="border")      hasBorder=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1047
  //  else if (att->name=="cellspacing") hasCellSpacing=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1048
  //  else if (att->name=="cellpadding") hasCellPadding=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1049
  //}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1050
  m_t << "<table class=\"doxtable\"" << htmlAttribsToString(t->attribs());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1051
  //if (!hasBorder)      m_t << " border=\"1\"";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1052
  //if (!hasCellSpacing) m_t << " cellspacing=\"3\"";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1053
  //if (!hasCellPadding) m_t << " cellpadding=\"3\"";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1054
  m_t << ">\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1055
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1056
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1057
void HtmlDocVisitor::visitPost(DocHtmlTable *t) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1058
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1059
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1060
  m_t << "</table>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1061
  forceStartParagraph(t);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1062
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1063
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1064
void HtmlDocVisitor::visitPre(DocHtmlRow *tr)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1065
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1066
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1067
  m_t << "<tr" << htmlAttribsToString(tr->attribs()) << ">\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1068
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1069
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1070
void HtmlDocVisitor::visitPost(DocHtmlRow *) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1071
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1072
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1073
  m_t << "</tr>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1074
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1075
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1076
void HtmlDocVisitor::visitPre(DocHtmlCell *c)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1077
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1078
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1079
  if (c->isHeading()) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1080
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1081
    m_t << "<th" << htmlAttribsToString(c->attribs()) << ">"; 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1082
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1083
  else 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1084
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1085
    m_t << "<td" << htmlAttribsToString(c->attribs()) << ">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1086
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1087
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1088
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1089
void HtmlDocVisitor::visitPost(DocHtmlCell *c) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1090
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1091
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1092
  if (c->isHeading()) m_t << "</th>"; else m_t << "</td>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1093
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1094
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1095
void HtmlDocVisitor::visitPre(DocHtmlCaption *c)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1096
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1097
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1098
  bool hasAlign      = FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1099
  HtmlAttribListIterator li(c->attribs());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1100
  HtmlAttrib *att;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1101
  for (li.toFirst();(att=li.current());++li)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1102
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1103
    if (att->name=="align") hasAlign=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1104
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1105
  m_t << "<caption" << htmlAttribsToString(c->attribs());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1106
  if (!hasAlign) m_t << " align=\"bottom\"";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1107
  m_t << ">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1108
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1109
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1110
void HtmlDocVisitor::visitPost(DocHtmlCaption *) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1111
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1112
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1113
  m_t << "</caption>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1114
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1115
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1116
void HtmlDocVisitor::visitPre(DocInternal *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1117
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1118
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1119
  m_t << "<p><b>" << theTranslator->trForInternalUseOnly() << "</b></p>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1120
  m_t << "<p>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1121
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1122
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1123
void HtmlDocVisitor::visitPost(DocInternal *) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1124
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1125
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1126
  m_t << "</p>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1127
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1128
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1129
void HtmlDocVisitor::visitPre(DocHRef *href)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1130
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1131
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1132
  m_t << "<a href=\"" << convertToXML(href->url())  << "\""
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1133
      << htmlAttribsToString(href->attribs()) << ">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1134
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1135
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1136
void HtmlDocVisitor::visitPost(DocHRef *) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1137
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1138
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1139
  m_t << "</a>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1140
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1141
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1142
void HtmlDocVisitor::visitPre(DocHtmlHeader *header)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1143
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1144
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1145
  forceEndParagraph(header);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1146
  m_t << "<h" << header->level() 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1147
      << htmlAttribsToString(header->attribs()) << ">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1148
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1149
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1150
void HtmlDocVisitor::visitPost(DocHtmlHeader *header) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1151
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1152
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1153
  m_t << "</h" << header->level() << ">\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1154
  forceStartParagraph(header);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1155
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1156
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1157
void HtmlDocVisitor::visitPre(DocImage *img)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1158
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1159
  if (img->type()==DocImage::Html)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1160
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1161
    forceEndParagraph(img);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1162
    if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1163
    QString baseName=img->name();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1164
    int i;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1165
    if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1166
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1167
      baseName=baseName.right(baseName.length()-i-1);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1168
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1169
    m_t << "<div align=\"center\">" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1170
    m_t << "<img src=\"" << img->relPath() << img->name() << "\" alt=\"" 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1171
      << baseName << "\"" << "/>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1172
    if (img->hasCaption())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1173
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1174
      m_t << "<p><strong>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1175
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1176
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1177
  else // other format -> skip
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1178
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1179
    pushEnabled();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1180
    m_hide=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1181
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1182
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1183
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1184
void HtmlDocVisitor::visitPost(DocImage *img) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1185
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1186
  if (img->type()==DocImage::Html)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1187
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1188
    if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1189
    if (img->hasCaption())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1190
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1191
      m_t << "</strong></p>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1192
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1193
    m_t << "</div>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1194
    forceStartParagraph(img);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1195
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1196
  else // other format
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1197
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1198
    popEnabled();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1199
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1200
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1201
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1202
void HtmlDocVisitor::visitPre(DocDotFile *df)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1203
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1204
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1205
  writeDotFile(df->file(),df->relPath(),df->context());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1206
  m_t << "<div align=\"center\">" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1207
  if (df->hasCaption())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1208
  { 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1209
    m_t << "<p><strong>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1210
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1211
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1212
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1213
void HtmlDocVisitor::visitPost(DocDotFile *df) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1214
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1215
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1216
  if (df->hasCaption())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1217
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1218
    m_t << "</strong></p>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1219
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1220
  m_t << "</div>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1221
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1222
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1223
void HtmlDocVisitor::visitPre(DocLink *lnk)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1224
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1225
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1226
  startLink(lnk->ref(),lnk->file(),lnk->relPath(),lnk->anchor());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1227
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1228
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1229
void HtmlDocVisitor::visitPost(DocLink *) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1230
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1231
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1232
  endLink();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1233
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1234
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1235
void HtmlDocVisitor::visitPre(DocRef *ref)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1236
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1237
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1238
  if (!ref->file().isEmpty()) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1239
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1240
    startLink(ref->ref(),ref->file(),ref->relPath(),ref->anchor());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1241
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1242
  if (!ref->hasLinkText()) filter(ref->targetTitle());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1243
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1244
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1245
void HtmlDocVisitor::visitPost(DocRef *ref) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1246
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1247
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1248
  if (!ref->file().isEmpty()) endLink();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1249
  //m_t << " ";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1250
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1251
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1252
void HtmlDocVisitor::visitPre(DocSecRefItem *ref)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1253
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1254
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1255
  QString refName=ref->file();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1256
  if (refName.right(Doxygen::htmlFileExtension.length())!=
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1257
      QString(Doxygen::htmlFileExtension))
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1258
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1259
    refName+=Doxygen::htmlFileExtension;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1260
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1261
  m_t << "<li><a href=\"" << refName << "#" << ref->anchor() << "\">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1262
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1263
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1264
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1265
void HtmlDocVisitor::visitPost(DocSecRefItem *) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1266
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1267
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1268
  m_t << "</a></li>\n";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1269
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1270
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1271
void HtmlDocVisitor::visitPre(DocSecRefList *s)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1272
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1273
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1274
  forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1275
  m_t << "<div class=\"multicol\">" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1276
  m_t << "<ul>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1277
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1278
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1279
void HtmlDocVisitor::visitPost(DocSecRefList *s) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1280
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1281
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1282
  m_t << "</ul>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1283
  m_t << "</div>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1284
  forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1285
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1286
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1287
//void HtmlDocVisitor::visitPre(DocLanguage *l)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1288
//{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1289
//  QString langId = Config_getEnum("OUTPUT_LANGUAGE");
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1290
//  if (l->id().lower()!=langId.lower())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1291
//  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1292
//    pushEnabled();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1293
//    m_hide = TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1294
//  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1295
//}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1296
//
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1297
//void HtmlDocVisitor::visitPost(DocLanguage *l) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1298
//{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1299
//  QString langId = Config_getEnum("OUTPUT_LANGUAGE");
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1300
//  if (l->id().lower()!=langId.lower())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1301
//  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1302
//    popEnabled();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1303
//  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1304
//}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1305
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1306
void HtmlDocVisitor::visitPre(DocParamSect *s)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1307
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1308
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1309
  forceEndParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1310
  m_t << "<dl><dt><b>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1311
  switch(s->type())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1312
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1313
    case DocParamSect::Param: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1314
      m_t << theTranslator->trParameters(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1315
    case DocParamSect::RetVal: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1316
      m_t << theTranslator->trReturnValues(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1317
    case DocParamSect::Exception: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1318
      m_t << theTranslator->trExceptions(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1319
    case DocParamSect::TemplateParam: 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1320
      /* TODO: add this 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1321
      m_t << theTranslator->trTemplateParam(); break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1322
      */
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1323
      m_t << "Template Parameters"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1324
    default:
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1325
      ASSERT(0);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1326
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1327
  m_t << ":";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1328
  m_t << "</b></dt><dd>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1329
  m_t << "  <table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1330
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1331
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1332
void HtmlDocVisitor::visitPost(DocParamSect *s)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1333
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1334
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1335
  m_t << "  </table>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1336
  m_t << "  </dd>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1337
  m_t << "</dl>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1338
  forceStartParagraph(s);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1339
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1340
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1341
void HtmlDocVisitor::visitPre(DocParamList *pl)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1342
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1343
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1344
  m_t << "    <tr><td valign=\"top\">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1345
  if (pl->direction()!=DocParamSect::Unspecified)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1346
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1347
    m_t << "<tt>[";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1348
    if (pl->direction()==DocParamSect::In)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1349
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1350
      m_t << "in";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1351
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1352
    else if (pl->direction()==DocParamSect::Out)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1353
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1354
      m_t << "out";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1355
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1356
    else if (pl->direction()==DocParamSect::InOut)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1357
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1358
      m_t << "in,out";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1359
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1360
    m_t << "]</tt>&nbsp;";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1361
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1362
  m_t << "</td><td valign=\"top\"><em>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1363
  //QStrListIterator li(pl->parameters());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1364
  //const char *s;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1365
  QListIterator<DocNode> li(pl->parameters());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1366
  DocNode *param;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1367
  bool first=TRUE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1368
  for (li.toFirst();(param=li.current());++li)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1369
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1370
    if (!first) m_t << ","; else first=FALSE;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1371
    if (param->kind()==DocNode::Kind_Word)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1372
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1373
      visit((DocWord*)param); 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1374
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1375
    else if (param->kind()==DocNode::Kind_LinkedWord)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1376
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1377
      visit((DocLinkedWord*)param); 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1378
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1379
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1380
  m_t << "</em>&nbsp;</td><td>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1381
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1382
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1383
void HtmlDocVisitor::visitPost(DocParamList *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1384
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1385
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1386
  m_t << "</td></tr>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1387
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1388
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1389
void HtmlDocVisitor::visitPre(DocXRefItem *x)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1390
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1391
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1392
  forceEndParagraph(x);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1393
  bool anonymousEnum = x->file()=="@";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1394
  if (!anonymousEnum)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1395
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1396
    m_t << "<dl class=\"" << x->key() << "\"><dt><b><a class=\"el\" href=\"" 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1397
        << x->relPath() << x->file() << Doxygen::htmlFileExtension 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1398
        << "#" << x->anchor() << "\">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1399
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1400
  else 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1401
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1402
    m_t << "<dl class=\"" << x->key() << "\"><dt><b>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1403
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1404
  filter(x->title());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1405
  m_t << ":";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1406
  if (!anonymousEnum) m_t << "</a>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1407
  m_t << "</b></dt><dd>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1408
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1409
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1410
void HtmlDocVisitor::visitPost(DocXRefItem *x)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1411
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1412
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1413
  m_t << "</dd></dl>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1414
  forceStartParagraph(x);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1415
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1416
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1417
void HtmlDocVisitor::visitPre(DocInternalRef *ref)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1418
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1419
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1420
  startLink(0,ref->file(),ref->relPath(),ref->anchor());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1421
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1422
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1423
void HtmlDocVisitor::visitPost(DocInternalRef *) 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1424
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1425
  if (m_hide) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1426
  endLink();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1427
  m_t << " ";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1428
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1429
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1430
void HtmlDocVisitor::visitPre(DocCopy *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1431
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1432
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1433
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1434
void HtmlDocVisitor::visitPost(DocCopy *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1435
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1436
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1437
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1438
void HtmlDocVisitor::visitPre(DocText *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1439
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1440
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1441
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1442
void HtmlDocVisitor::visitPost(DocText *)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1443
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1444
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1445
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1446
void HtmlDocVisitor::filter(const char *str)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1447
{ 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1448
  if (str==0) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1449
  const char *p=str;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1450
  char c;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1451
  while (*p)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1452
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1453
    c=*p++;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1454
    switch(c)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1455
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1456
      case '<':  m_t << "&lt;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1457
      case '>':  m_t << "&gt;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1458
      case '&':  m_t << "&amp;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1459
      default:   m_t << c;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1460
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1461
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1462
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1463
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1464
/// Escape basic entities to produce a valid CDATA attribute value,
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1465
/// assume that the outer quoting will be using the double quote &quot;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1466
void HtmlDocVisitor::filterQuotedCdataAttr(const char* str)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1467
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1468
  if (str==0) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1469
  const char *p=str;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1470
  char c;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1471
  while (*p)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1472
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1473
    c=*p++;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1474
    switch(c)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1475
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1476
      case '&':  m_t << "&amp;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1477
      case '"':  m_t << "&quot;"; break;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1478
       // For SGML compliance, and given the SGML declaration for HTML syntax,
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1479
       // it's enough to replace these two, provided that the declaration
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1480
       // for the HTML version we generate (and as supported by the browser)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1481
       // specifies that all the other symbols used in rawVal are
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1482
       // within the right charachter class (i.e., they're not
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1483
       // some multinational weird charachters not in the BASESET).
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1484
       // We assume that 1) the browser will support whatever is remaining
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1485
       // in the formula and 2) the TeX formulae are generally governed
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1486
       // by even stricter charachter restrictions so it should be enough.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1487
       //
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1488
       // On some incompliant browsers, additional translation of
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1489
       // '>' and '<' into "&gt;" and "&lt;", respectively, might be needed;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1490
       // but I'm unaware of particular modern (last 4 years) versions
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1491
       // with such problems, so let's not do it for performance.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1492
       // Also, some brousers will (wrongly) not process the entity references
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1493
       // inside the attribute value and show the &...; form instead,  
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1494
       // so we won't create entites unless necessary to minimize clutter there.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1495
       // --vassilii 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1496
      default:   m_t << c;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1497
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1498
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1499
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1500
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1501
void HtmlDocVisitor::startLink(const QString &ref,const QString &file,
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1502
                               const QString &relPath,const QString &anchor,
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1503
                               const QString &tooltip)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1504
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1505
  QCString *dest;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1506
  if (!ref.isEmpty()) // link to entity imported via tag file
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1507
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1508
    m_t << "<a class=\"elRef\" ";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1509
    m_t << "doxygen=\"" << ref << ":";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1510
    if ((dest=Doxygen::tagDestinationDict[ref])) m_t << *dest << "/";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1511
    m_t << "\" ";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1512
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1513
  else // local link
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1514
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1515
    m_t << "<a class=\"el\" ";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1516
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1517
  m_t << "href=\"";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1518
  if (!ref.isEmpty())
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1519
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1520
    if ((dest=Doxygen::tagDestinationDict[ref])) m_t << *dest << "/";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1521
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1522
  else
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1523
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1524
    m_t << relPath;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1525
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1526
  if (!file.isEmpty()) m_t << file << Doxygen::htmlFileExtension;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1527
  if (!anchor.isEmpty()) m_t << "#" << anchor;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1528
  m_t << "\"";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1529
  if (!tooltip.isEmpty()) m_t << " title=\"" << tooltip << "\"";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1530
  m_t << ">";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1531
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1532
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1533
void HtmlDocVisitor::endLink()
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1534
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1535
  m_t << "</a>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1536
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1537
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1538
void HtmlDocVisitor::pushEnabled()
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1539
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1540
  m_enabled.push(new bool(m_hide));
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1541
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1542
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1543
void HtmlDocVisitor::popEnabled()
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1544
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1545
  bool *v=m_enabled.pop();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1546
  ASSERT(v!=0);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1547
  m_hide = *v;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1548
  delete v;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1549
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1550
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1551
void HtmlDocVisitor::writeDotFile(const QString &fileName,const QString &relPath,
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1552
                                  const QString &context)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1553
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1554
  QString baseName=fileName;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1555
  int i;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1556
  if ((i=baseName.findRev('/'))!=-1)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1557
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1558
    baseName=baseName.right(baseName.length()-i-1);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1559
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1560
  QString outDir = Config_getString("HTML_OUTPUT");
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1561
  writeDotGraphFromFile(fileName,outDir,baseName,BITMAP);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1562
  QString mapName = baseName+".map";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1563
  QString mapFile = fileName+".map";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1564
  m_t << "<img src=\"" << relPath << baseName << "." 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1565
    << Config_getEnum("DOT_IMAGE_FORMAT") << "\" alt=\""
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1566
    << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\">" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1567
  QString imap = getDotImageMapFromFile(fileName,outDir,relPath.data(),context);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1568
  m_t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">" << imap << "</map>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1569
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1570
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1571
void HtmlDocVisitor::writeMscFile(const QString &fileName,const QString &relPath,
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1572
                                  const QString &context)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1573
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1574
  QString baseName=fileName;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1575
  int i;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1576
  if ((i=baseName.findRev('/'))!=-1)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1577
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1578
    baseName=baseName.right(baseName.length()-i-1);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1579
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1580
  QString outDir = Config_getString("HTML_OUTPUT");
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1581
  writeMscGraphFromFile(fileName,outDir,baseName,MSC_BITMAP);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1582
  QString mapName = baseName+".map";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1583
  QString mapFile = fileName+".map";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1584
  m_t << "<img src=\"" << relPath << baseName << ".png\" alt=\""
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1585
    << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\">" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1586
  QString imap = getMscImageMapFromFile(fileName,outDir,relPath.data(),context);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1587
  m_t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">" << imap << "</map>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1588
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1589
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1590
/** Used for items found inside a paragraph, which due to XHTML restrictions
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1591
 *  have to be outside of the paragraph. This method will forcefully end
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1592
 *  the current paragraph and forceStartParagraph() will restart it.
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1593
 */
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1594
void HtmlDocVisitor::forceEndParagraph(DocNode *n)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1595
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1596
  //printf("forceEndParagraph(%p) %d\n",n,n->kind());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1597
  if (n->parent() && n->parent()->kind()==DocNode::Kind_Para)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1598
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1599
    DocPara *para = (DocPara*)n->parent();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1600
    int nodeIndex = para->children().findRef(n);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1601
    nodeIndex--;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1602
    if (nodeIndex<0) return; // first node
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1603
    while (nodeIndex>=0 && 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1604
           para->children().at(nodeIndex)->kind()==DocNode::Kind_WhiteSpace
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1605
          )
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1606
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1607
      nodeIndex--;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1608
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1609
    if (nodeIndex>=0)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1610
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1611
      DocNode *n = para->children().at(nodeIndex);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1612
      //printf("n=%p kind=%d outside=%d\n",n,n->kind(),mustBeOutsideParagraph(n));
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1613
      if (mustBeOutsideParagraph(n)) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1614
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1615
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1616
    bool isFirst;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1617
    bool isLast;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1618
    getParagraphContext(para,isFirst,isLast);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1619
    //printf("forceEnd first=%d last=%d\n",isFirst,isLast);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1620
    if (isFirst && isLast) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1621
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1622
    m_t << "</p>" << endl;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1623
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1624
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1625
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1626
/** Used for items found inside a paragraph, which due to XHTML restrictions
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1627
 *  have to be outside of the paragraph. This method will forcefully start
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1628
 *  the paragraph, that was previously ended by forceEndParagraph().
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1629
 */
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1630
void HtmlDocVisitor::forceStartParagraph(DocNode *n)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1631
{
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1632
  //printf("forceStartParagraph(%p) %d\n",n,n->kind());
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1633
  if (n->parent() && n->parent()->kind()==DocNode::Kind_Para) // if we are inside a paragraph
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1634
  {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1635
    DocPara *para = (DocPara*)n->parent();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1636
    int nodeIndex = para->children().findRef(n);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1637
    int numNodes  = para->children().count();
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1638
    nodeIndex++;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1639
    if (nodeIndex==numNodes) return; // last node
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1640
    while (nodeIndex<numNodes && 
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1641
           para->children().at(nodeIndex)->kind()==DocNode::Kind_WhiteSpace
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1642
          )
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1643
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1644
      nodeIndex++;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1645
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1646
    if (nodeIndex<numNodes)
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1647
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1648
      DocNode *n = para->children().at(nodeIndex);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1649
      if (mustBeOutsideParagraph(n)) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1650
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1651
    else
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1652
    {
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1653
      return; // only whitespace at the end!
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1654
    }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1655
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1656
    bool isFirst;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1657
    bool isLast;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1658
    getParagraphContext(para,isFirst,isLast);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1659
    //printf("forceStart first=%d last=%d\n",isFirst,isLast);
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1660
    if (isFirst && isLast) return;
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1661
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1662
    m_t << "<p>";
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1663
  }
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1664
}
42188c7ea2d9 Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff changeset
  1665