Orb/Doxygen/src/namespacedef.cpp
changeset 4 468f4c8d3d5b
parent 0 42188c7ea2d9
equal deleted inserted replaced
3:d8fccb2cd802 4:468f4c8d3d5b
     1 /******************************************************************************
     1 /******************************************************************************
     2  *
     2  *
     3  * 
     3  * 
     4  *
     4  *
     5  * Copyright (C) 1997-2008 by Dimitri van Heesch.
     5  * Copyright (C) 1997-2010 by Dimitri van Heesch.
     6  *
     6  *
     7  * Permission to use, copy, modify, and distribute this software and its
     7  * Permission to use, copy, modify, and distribute this software and its
     8  * documentation under the terms of the GNU General Public License is hereby 
     8  * documentation under the terms of the GNU General Public License is hereby 
     9  * granted. No representations are made about the suitability of this software 
     9  * granted. No representations are made about the suitability of this software 
    10  * for any purpose. It is provided "as is" without express or implied warranty.
    10  * for any purpose. It is provided "as is" without express or implied warranty.
   370   ol.endGroupHeader();
   370   ol.endGroupHeader();
   371   ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString("PROJECT_NAME")));
   371   ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString("PROJECT_NAME")));
   372   ol.popGeneratorState();
   372   ol.popGeneratorState();
   373 }
   373 }
   374 
   374 
       
   375 void NamespaceDef::writeSummaryLinks(OutputList &ol)
       
   376 {
       
   377   ol.pushGeneratorState();
       
   378   ol.disableAllBut(OutputGenerator::Html);
       
   379   QListIterator<LayoutDocEntry> eli(
       
   380       LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace));
       
   381   LayoutDocEntry *lde;
       
   382   bool first=TRUE;
       
   383   for (eli.toFirst();(lde=eli.current());++eli)
       
   384   {
       
   385     if ((lde->kind()==LayoutDocEntry::NamespaceClasses && classSDict && classSDict->declVisible()) || 
       
   386         (lde->kind()==LayoutDocEntry::NamespaceNestedNamespaces && namespaceSDict && namespaceSDict->declVisible())
       
   387        )
       
   388     {
       
   389       LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
       
   390       QCString label = lde->kind()==LayoutDocEntry::NamespaceClasses ? "nested-classes" : "namespaces";
       
   391       writeSummaryLink(ol,label,ls->title,first);
       
   392     }
       
   393     else if (lde->kind()== LayoutDocEntry::MemberDecl)
       
   394     {
       
   395       LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
       
   396       MemberList * ml = getMemberList(lmd->type);
       
   397       if (ml && ml->declVisible())
       
   398       {
       
   399         writeSummaryLink(ol,ml->listTypeAsString(),lmd->title,first);
       
   400       }
       
   401     }
       
   402   }
       
   403   if (!first)
       
   404   {
       
   405     ol.writeString("  </div>\n");
       
   406   }
       
   407   ol.popGeneratorState();
       
   408 }
       
   409 
   375 void NamespaceDef::writeDocumentation(OutputList &ol)
   410 void NamespaceDef::writeDocumentation(OutputList &ol)
   376 {
   411 {
   377   bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
   412   bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
   378 
   413 
   379   QCString pageTitle;
   414   QCString pageTitle;
   393   if (getOuterScope()!=Doxygen::globalScope)
   428   if (getOuterScope()!=Doxygen::globalScope)
   394   {
   429   {
   395     writeNavigationPath(ol);
   430     writeNavigationPath(ol);
   396   }
   431   }
   397   ol.endQuickIndices();
   432   ol.endQuickIndices();
   398   ol.startContents();
   433   startTitle(ol,getOutputFileBase(),this);
   399   startTitle(ol,getOutputFileBase());
       
   400   ol.parseText(pageTitle);
   434   ol.parseText(pageTitle);
   401   addGroupListToTitle(ol,this);
   435   addGroupListToTitle(ol,this);
   402   endTitle(ol,getOutputFileBase(),displayName());
   436   endTitle(ol,getOutputFileBase(),displayName());
       
   437   ol.startContents();
   403   
   438   
   404   if (Doxygen::searchIndex)
   439   if (Doxygen::searchIndex)
   405   {
   440   {
   406     Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase());
   441     Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase());
   407     Doxygen::searchIndex->addWord(localName(),TRUE);
   442     Doxygen::searchIndex->addWord(localName(),TRUE);
   728       }
   763       }
   729     }
   764     }
   730   }
   765   }
   731 }
   766 }
   732 
   767 
       
   768 bool NamespaceSDict::declVisible() const
       
   769 {
       
   770   SDict<NamespaceDef>::Iterator ni(*this);
       
   771   NamespaceDef *nd;
       
   772   for (ni.toFirst();(nd=ni.current());++ni)
       
   773   {
       
   774     if (nd->isLinkable())
       
   775     {
       
   776       return TRUE;
       
   777     }
       
   778   }
       
   779   return FALSE;
       
   780 }
       
   781 
   733 void NamespaceSDict::writeDeclaration(OutputList &ol,const char *title,bool localName)
   782 void NamespaceSDict::writeDeclaration(OutputList &ol,const char *title,bool localName)
   734 {
   783 {
   735   if (count()==0) return; // no namespaces in the list
   784   if (count()==0) return; // no namespaces in the list
   736 
   785 
   737   SDict<NamespaceDef>::Iterator ni(*this);
   786   SDict<NamespaceDef>::Iterator ni(*this);
   742     if (nd->isLinkable()) found=TRUE;
   791     if (nd->isLinkable()) found=TRUE;
   743   }
   792   }
   744   if (!found) return; // no linkable namespaces in the list
   793   if (!found) return; // no linkable namespaces in the list
   745 
   794 
   746   // write list of namespaces
   795   // write list of namespaces
   747   ol.startMemberHeader();
   796   ol.startMemberHeader("namespaces");
   748   bool javaOpt    = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
   797   bool javaOpt    = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
   749   bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
   798   bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
   750 #if 0
   799 #if 0
   751   if (javaOpt)
   800   if (javaOpt)
   752   {
   801   {