Exemple #1
0
/*!
 * \brief Finish generation of the Eclipse specific help files
 *
 * This method writes footers of the files and closes them.
 * \sa initialize()
 */
void EclipseHelp::finalize() 
{
  closedTag(); // -- close previous tag

  // -- write ending tag 
  --m_depth;
  m_tocstream << "</toc>" << endl;

  // -- close the content file
  m_tocstream.unsetDevice();
  m_tocfile->close();
  delete m_tocfile; m_tocfile = 0;

  QCString name = Config_getString("HTML_OUTPUT") + "/plugin.xml";
  QFile pluginFile(name);
  if (pluginFile.open(IO_WriteOnly))
  {
    QString docId = Config_getString("ECLIPSE_DOC_ID");
    FTextStream t(&pluginFile);
    t << "<plugin name=\""  << docId << "\" id=\"" << docId << "\"" << endl;
    t << "        version=\"1.0.0\" provider-name=\"Doxygen\">" << endl;
    t << "  <extension point=\"org.eclipse.help.toc\">" << endl;
    t << "    <toc file=\"toc.xml\" primary=\"true\" />" << endl;
    t << "  </extension>" << endl;
    t << "</plugin>" << endl;
  }
}
/*!
 * \brief Finish generation of the Eclipse specific help files
 *
 * This method writes footers of the files and closes them.
 * \sa initialize()
 */
void EclipseHelp::finalize()
{
   closedTag(); // -- close previous tag

   // -- write ending tag
   --m_depth;
   m_tocstream << "</toc>" << endl;

   // -- close the content file
   m_tocstream.setDevice(0);
   m_tocfile->close();
   delete m_tocfile;
   m_tocfile = 0;

   QString name = Config::getString("html-output") + "/plugin.xml";
   QFile pluginFile(name);

   if (pluginFile.open(QIODevice::WriteOnly)) {
      QString docId = Config::getString("eclipse-doc-id");

      QTextStream t(&pluginFile);
      t << "<plugin name=\""  << docId << "\" id=\"" << docId << "\"" << endl;
      t << "        version=\"1.0.0\" provider-name=\"DoxyPress\">" << endl;
      t << "  <extension point=\"org.eclipse.help.toc\">" << endl;
      t << "    <toc file=\"toc.xml\" primary=\"true\" />" << endl;
      t << "  </extension>" << endl;
      t << "</plugin>" << endl;
   }
}
/*!
 * \brief Decrease the level of content hierarchy
 *
 * It closes currently opened topic tag.
 */
void EclipseHelp::decContentsDepth()
{
   // -- end of the opened topic
   closedTag();
   --m_depth;

   if (m_openTags == m_depth) {
      --m_openTags;
      indent();
      m_tocstream << "</topic>" << endl;
   }
}
Exemple #4
0
/*!
 * \brief Add an item to the content
 *
 * @param isDir Flag whether the argument \a file is a directory or a file entry
 * @param name Name of the item
 * @param ref URL of the item
 * @param file Name of a file which the item is defined in (without extension)
 * @param anchor Name of an anchor of the item.
 * @param separateIndex not used.
 * @param addToNavIndex not used.
 * @param def not used.
 */
void EclipseHelp::addContentsItem(
    bool /* isDir */,
    const char *name,
    const char * /* ref */,
    const char *file,
    const char *anchor,
    bool /* separateIndex */,
    bool /* addToNavIndex */,
    Definition * /*def*/) 
{
  // -- write the topic tag 
  closedTag();
  if (file) 
  { 
    switch (file[0]) // check for special markers (user defined URLs)
    {
      case '^':
        // URL not supported by eclipse toc.xml
	break;

      case '!':
        indent();
        m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
        m_tocstream << " href=\"" << convertToXML(m_pathprefix) << &file[1] << "\"";
        m_endtag = TRUE;
	break;

      default:
        indent();
        m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
        m_tocstream << " href=\"" << convertToXML(m_pathprefix) 
                    << file << Doxygen::htmlFileExtension;
        if (anchor)
        {
          m_tocstream << "#" << anchor;
        }
        m_tocstream << "\"";
        m_endtag = TRUE;
	break;
    }
  }
  else
  {
    indent();
    m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
    m_endtag = TRUE;
  }
}
/*!
 * \brief Add an item to the content
 *
 * @param isDir Flag whether the argument \a file is a directory or a file entry
 * @param name Name of the item
 * @param ref URL of the item
 * @param file Name of a file which the item is defined in (without extension)
 * @param anchor Name of an anchor of the item.
 * @param separateIndex not used.
 * @param addToNavIndex not used.
 * @param def not used.
 */
void EclipseHelp::addContentsItem(bool, const QString &name, const QString &, const QString &file, const QString &anchor,
                  bool, bool, QSharedPointer<Definition>)
{
   // -- write the topic tag
   closedTag();

   if (! file.isEmpty() ) {

      switch (file[0].unicode()) { // check for special markers (user defined URLs)
         case '^':
            // URL not supported by eclipse toc.xml
            break;

         case '!':
            indent();
            m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
            m_tocstream << " href=\"" << convertToXML(m_pathprefix) << file.mid(1) << "\"";
            m_endtag = true;
            break;

         default:
            indent();
            m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
            m_tocstream << " href=\"" << convertToXML(m_pathprefix)
                        << file << Doxy_Globals::htmlFileExtension;

            if (! anchor.isEmpty()) {
               m_tocstream << "#" << anchor;
            }

            m_tocstream << "\"";
            m_endtag = true;
            break;
      }

   } else {
      indent();
      m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
      m_endtag = true;
   }
}