Update ooo320-m1
[ooovba.git] / autodoc / source / display / html / chd_udk2.cxx
bloba9533508f310ac32da002b1f02382a865ed62bae
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: chd_udk2.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <precomp.h>
32 #include <html/chd_udk2.hxx>
35 // NOT FULLY DEFINED SERVICES
36 #include <cosv/tpl/tpltools.hxx>
37 #include <ary/ary_disp.hxx>
38 #include <ary/ceslot.hxx>
39 #include <ary/cpp/c_gate.hxx>
40 #include <ary/cpp/c_namesp.hxx>
41 #include <ary/cpp/cp_ce.hxx>
43 #include "dsply_cl.hxx"
44 #include "dsply_da.hxx"
45 #include "dsply_op.hxx"
46 #include "opageenv.hxx"
47 #include "outfile.hxx"
48 #include "pagemake.hxx"
52 //******************** CppHtmlDisplay_Udk2 ********************//
55 CppHtmlDisplay_Udk2::CppHtmlDisplay_Udk2()
56 : pCurPageEnv(0)
60 CppHtmlDisplay_Udk2::~CppHtmlDisplay_Udk2()
64 void
65 CppHtmlDisplay_Udk2::do_Run( const char * i_sOutputDirectory,
66 const ary::cpp::Gate & i_rAryGate,
67 const display::CorporateFrame & i_rLayout )
69 SetRunData( i_sOutputDirectory, i_rAryGate, i_rLayout );
71 Create_Css_File();
72 Create_Overview_File();
73 Create_Help_File();
74 Create_AllDefs_File();
76 CreateFiles_InSubTree_Namespaces();
77 CreateFiles_InSubTree_Index();
80 void
81 CppHtmlDisplay_Udk2::SetRunData( const char * i_sOutputDirectory,
82 const ary::cpp::Gate & i_rAryGate,
83 const display::CorporateFrame & i_rLayout )
85 csv::ploc::Path aOutputDir( i_sOutputDirectory, true );
86 pCurPageEnv = new OuputPage_Environment( aOutputDir, i_rAryGate, i_rLayout );
89 void
90 CppHtmlDisplay_Udk2::Create_Css_File()
92 pCurPageEnv->MoveDir_2Root();
93 pCurPageEnv->SetFile_Css();
94 HtmlDocuFile::WriteCssFile(pCurPageEnv->CurPath());
97 void
98 CppHtmlDisplay_Udk2::Create_Overview_File()
100 pCurPageEnv->MoveDir_2Root();
101 PageDisplay aPageMaker( *pCurPageEnv );
102 aPageMaker.Create_OverviewFile();
105 void
106 CppHtmlDisplay_Udk2::Create_Help_File()
108 PageDisplay aPageMaker( *pCurPageEnv );
109 aPageMaker.Create_HelpFile();
112 void
113 CppHtmlDisplay_Udk2::Create_AllDefs_File()
115 PageDisplay aPageMaker( *pCurPageEnv );
116 aPageMaker.Create_AllDefsFile();
119 void
120 CppHtmlDisplay_Udk2::CreateFiles_InSubTree_Namespaces()
122 Cout() << "\nCreate files in subtree namespaces" << Endl();
124 const ary::cpp::Namespace &
125 rGlobalNsp = Gate().Ces().GlobalNamespace();
127 RecursiveDisplay_Namespace(rGlobalNsp);
128 Cout() << Endl();
131 void
132 CppHtmlDisplay_Udk2::CreateFiles_InSubTree_Index()
134 Cout() << "\nCreate files in subtree index" << Endl();
135 Cout() << Endl();
137 PageDisplay aPageMaker( *pCurPageEnv );
138 aPageMaker.Create_IndexFiles();
141 void
142 CppHtmlDisplay_Udk2::RecursiveDisplay_Namespace( const ary::cpp::Namespace & i_rNsp )
144 if (i_rNsp.Owner().IsValid())
145 pCurPageEnv->MoveDir_Down2( i_rNsp );
146 else
147 pCurPageEnv->MoveDir_2Names();
148 DisplayFiles_InNamespace( i_rNsp );
150 typedef std::vector< const ary::cpp::Namespace* > NspList;
151 NspList aSubNspList;
152 i_rNsp.Get_SubNamespaces( aSubNspList );
153 for ( NspList::const_iterator it = aSubNspList.begin();
154 it != aSubNspList.end();
155 ++it )
157 RecursiveDisplay_Namespace( *(*it) );
158 } // end for
160 pCurPageEnv->MoveDir_Up();
163 void
164 CppHtmlDisplay_Udk2::DisplayFiles_InNamespace( const ary::cpp::Namespace & i_rNsp )
166 PageDisplay aPageMaker( *pCurPageEnv );
168 ary::Slot_AutoPtr pSlot;
170 // Namespace
171 aPageMaker.Create_NamespaceFile();
173 // Classes
174 ClassDisplayer aClassDisplayer( *pCurPageEnv );
175 DisplaySlot( aClassDisplayer, i_rNsp, ary::cpp::Namespace::SLOT_Classes );
177 // Enums
178 DisplaySlot( aPageMaker, i_rNsp, ary::cpp::Namespace::SLOT_Enums );
180 // Typedefs
181 DisplaySlot( aPageMaker, i_rNsp, ary::cpp::Namespace::SLOT_Typedefs );
183 // Operations
184 OperationsDisplay aOperationsDisplayer( *pCurPageEnv );
185 DisplaySlot( aOperationsDisplayer, i_rNsp, ary::cpp::Namespace::SLOT_Operations );
186 aOperationsDisplayer.Create_Files();
188 // Data
189 DataDisplay aDataDisplayer( *pCurPageEnv );
191 aDataDisplayer.PrepareForConstants();
192 DisplaySlot( aDataDisplayer, i_rNsp, ary::cpp::Namespace::SLOT_Constants );
194 aDataDisplayer.PrepareForVariables();
195 DisplaySlot( aDataDisplayer, i_rNsp, ary::cpp::Namespace::SLOT_Variables );
197 aDataDisplayer.Create_Files();
200 const ary::cpp::Gate &
201 CppHtmlDisplay_Udk2::Gate() const
203 return pCurPageEnv->Gate();