/************************************************************************* * * $RCSfile: hfi_globalindex.cxx,v $ * * $Revision: 1.1 $ * * last change: $Author: np $ $Date: 2002-11-01 17:14:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses * * - GNU Lesser General Public License Version 2.1 * - Sun Industry Standards Source License Version 1.1 * * Sun Microsystems Inc., October, 2000 * * GNU Lesser General Public License Version 2.1 * ============================================= * Copyright 2000 by Sun Microsystems, Inc. * 901 San Antonio Road, Palo Alto, CA 94303, USA * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * * Sun Industry Standards Source License Version 1.1 * ================================================= * The contents of this file are subject to the Sun Industry Standards * Source License Version 1.1 (the "License"); You may not use this file * except in compliance with the License. You may obtain a copy of the * License at http://www.openoffice.org/license.html. * * Software provided under this License is provided on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. * See the License for the specific provisions governing your rights and * obligations concerning the Software. * * The Initial Developer of the Original Code is: Sun Microsystems, Inc. * * Copyright: 2000 by Sun Microsystems, Inc. * * All Rights Reserved. * * Contributor(s): _______________________________________ * * ************************************************************************/ #include #include "hfi_globalindex.hxx" // NOT FULLY DEFINED SERVICES #include #include #include #include #include "hfi_navibar.hxx" #include "hfi_typetext.hxx" #include "hi_linkhelper.hxx" namespace { enum E_Types { t_service = 0, t_interface = 1, t_struct = 2, t_exception = 3, t_enum = 4, t_typedef = 5, t_constantsgroup = 6, t_property = 7, t_function = 8, t_structelement = 9, t_enumvalue = 10, t_constant = 11, t_module = 12, t_singleton = 13, t_attribute = 14, t_MAX }; String G_sDummy; uintt G_nDummy; /* RC-Ids for IDL types (see reposy.cxx): Module 2000 Interface 2001 Function 2002 Service 2003 Property 2004 Enum 2005 EnumValue 2006 Typedef 2007 Struct 2008 StructElement 2009 Exception 2010 ConstantGroup 2011 Constant 2012 Singleton 2013 Attribute 2014 */ const int C_nNumberOfIdlTypes = 15; const char * C_sTypeNames[C_nNumberOfIdlTypes] = { "module ", "interface ", "function ", "service ", "property ", "enum ", "value ", "typedef ", "struct ", "field ", "exception ", "constants group ", "constant ","singleton ", "attribute " }; const char * C_sOwnerNames[C_nNumberOfIdlTypes] = { "module ", "module ", "interface ", "module ", "service ", "module ", "enum ", "module ", "module ", "", // could be struct or exception "module ", "module ", "constants group ", "module ", "interface " }; const char C_cAlphabet[] = "A B C D E " "F G H I J " "K L M N O " "P Q R S T " "U V W X Y " "Z"; typedef std::vector PageData; PageData G_PageData; } // end anonymous namespace HF_IdlGlobalIndex::HF_IdlGlobalIndex( Environment & io_rEnv, Xml::Element & o_rOut ) : HtmlFactory_Idl(io_rEnv, &o_rOut) { } HF_IdlGlobalIndex::~HF_IdlGlobalIndex() { } void HF_IdlGlobalIndex::Produce_Page(ary::idl::alphabetical_index::E_Letter i_letter) const { make_Navibar(); HF_TitleTable aTitle(CurOut()); aTitle.Produce_Title( StreamLock(100)() << "Global Index " << ( i_letter != ary::idl::alphabetical_index::non_alpha ? char(int(i_letter)-'a'+'A') : '_' ) << c_str ); // Letters Index aTitle.Add_Row() << new Xml::XmlCode( "

A B C D E F G H I J" " K L M N O P Q R S T" " U V W X Y Z _

" ); Out().Enter(CurOut() >> *new Html::DefList); csv::erase_container(G_PageData); Env().Data().Get_IndexData(G_PageData, i_letter); static StringVector aModule_; csv::erase_container(aModule_); String sCeMain; String sCeMember; const intt nDiff = intt(ary::idl::Module::class_id); const int nIxModule = 0; const int nIxField = 9; HF_IdlTypeText aLinker(Env(),HF_IdlTypeText::use_for_javacompatible_index); PageData::const_iterator itEnd = G_PageData.end(); for ( PageData::const_iterator iter = G_PageData.begin(); iter != itEnd; ++iter ) { const client & rCe = Env().Data().Find_Ce(*iter); if (NOT rCe.Owner().IsValid()) return; // Omit global namespace. const client & rOwner = Env().Data().Find_Ce(rCe.Owner()); Xml::Element & rDT = CurOut() >> *new Html::DefListTerm; aLinker.Produce_IndexLink(rDT, rCe); rDT << " - "; int nIx = int(rCe.ClassId()-nDiff); csv_assert(csv::in_range(0,nIx,15)); rDT << C_sTypeNames[nIx] << "in "; if (nIx != nIxField) { rDT << C_sOwnerNames[nIx]; } else { uintt nOwnerIx = rOwner.ClassId()-nDiff; rDT << C_sTypeNames[nOwnerIx]; } aLinker.Produce_IndexOwnerLink(rDT, rOwner); CurOut() << new Html::DefListDefinition; } // end for Out().Leave(); CurOut() << new Html::HorizontalLine; } void HF_IdlGlobalIndex::make_Navibar() const { HF_IdlNavigationBar aNaviBar(Env(), CurOut()); aNaviBar.Produce_IndexMainRow(); CurOut() << new Html::HorizontalLine(); } #if 0 void HF_IdlGlobalIndex::StoreString( const String & i_sName, E_Types i_eType, bool i_bUseOwner ) { aText.seekp(0); aText << char('A'+char(i_eType)); aText << i_sName << C_cSplit << sCurModule; if (i_bUseOwner) { aText << "*" << sCurOwner; } int nBegin = tolower(aText.c_str()[1]); if (nBegin >= 'a' AND nBegin <= 'z') aData[nBegin-'a'].push_back(aText.c_str()); else aData[C_nIndexUnderscore].push_back(aText.c_str()); } #endif // 0