1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dsply_da.cxx,v $
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 ************************************************************************/
32 #include "dsply_da.hxx"
35 // NOT FULLY DEFINED SERVICES
36 #include <cosv/tpl/tpltools.hxx>
37 #include <ary/cpp/c_gate.hxx>
38 #include <ary/cpp/c_vari.hxx>
39 #include <ary/doc/d_docu.hxx>
40 #include <ary/loc/loc_file.hxx>
41 #include <ary/loc/locp_le.hxx>
42 #include <udm/html/htmlitem.hxx>
43 #include "hd_docu.hxx"
45 #include "html_kit.hxx"
46 #include "opageenv.hxx"
47 #include "pagemake.hxx"
54 DataDisplay::DataDisplay( OuputPage_Environment
& io_rEnv
)
55 : aMap_GlobalDataDisplay(),
56 pClassMembersDisplay(0),
58 pDocuShow( new Docu_Display(io_rEnv
) )
62 DataDisplay::~DataDisplay()
64 csv::erase_map_of_heap_ptrs( aMap_GlobalDataDisplay
);
68 DataDisplay::PrepareForConstants()
70 if (pClassMembersDisplay
)
71 pClassMembersDisplay
= 0;
73 csv::erase_map_of_heap_ptrs( aMap_GlobalDataDisplay
);
77 DataDisplay::PrepareForVariables()
79 // Doesn't need to do anything yet.
83 DataDisplay::PrepareForStdMembers()
85 csv::erase_map_of_heap_ptrs( aMap_GlobalDataDisplay
);
87 pClassMembersDisplay
= new PageDisplay(*pEnv
);
88 const ary::cpp::Class
* pClass
= pEnv
->CurClass();
89 csv_assert( pClass
!= 0 );
90 pClassMembersDisplay
->Setup_DataFile_for(*pClass
);
94 DataDisplay::PrepareForStaticMembers()
96 // Doesn't need to do anything yet.
100 DataDisplay::Create_Files()
102 if (pClassMembersDisplay
)
104 pClassMembersDisplay
->Create_File();
105 pClassMembersDisplay
= 0;
109 for ( Map_FileId2PagePtr::const_iterator it
= aMap_GlobalDataDisplay
.begin();
110 it
!= aMap_GlobalDataDisplay
.end();
113 (*it
).second
->Create_File();
115 csv::erase_map_of_heap_ptrs( aMap_GlobalDataDisplay
);
120 DataDisplay::do_Process( const ary::cpp::Variable
& i_rData
)
122 if ( Ce_IsInternal(i_rData
) )
125 PageDisplay
& rPage
= FindPage_for( i_rData
);
127 csi::xml::Element
& rOut
= rPage
.CurOut();
128 Display_SglDatum( rOut
, i_rData
);
131 const ary::cpp::Gate
*
132 DataDisplay::inq_Get_ReFinder() const
134 return & pEnv
->Gate();
138 DataDisplay::FindPage_for( const ary::cpp::Variable
& i_rData
)
140 if ( pClassMembersDisplay
)
141 return *pClassMembersDisplay
;
144 nSourceFile
= i_rData
.Location();
146 pFound
= csv::value_from_map( aMap_GlobalDataDisplay
, nSourceFile
, (PageDisplay
*)0 );
149 pFound
= new PageDisplay( *pEnv
);
150 const ary::loc::File
&
151 rFile
= pEnv
->Gate().Locations().Find_File( nSourceFile
);
152 pFound
->Setup_DataFile_for(rFile
);
153 aMap_GlobalDataDisplay
[nSourceFile
] = pFound
;
160 DataDisplay::Display_SglDatum( csi::xml::Element
& rOut
,
161 const ary::cpp::Variable
& i_rData
)
163 adcdisp::ExplanationList
aDocu(rOut
, true);
167 >> *new html::Label( DataLabel(i_rData
.LocalName()) )
170 << i_rData
.LocalName();
172 dshelp::Get_LinkedTypeText( aDocu
.Def(), *pEnv
, i_rData
.Type() );
176 << i_rData
.LocalName();
177 if ( i_rData
.ArraySize().length() > 0 )
181 << i_rData
.ArraySize()
184 if ( i_rData
.Initialisation().length() > 0 )
188 << i_rData
.Initialisation();
192 << new html::LineBreak
193 << new html::LineBreak
;
195 aDocu
.AddEntry_NoTerm();
197 pDocuShow
->Assign_Out(aDocu
.Def());
198 pDocuShow
->Process(i_rData
.Docu());
199 pDocuShow
->Unassign_Out();
201 rOut
<< new html::HorizontalLine
;