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: hfi_linklist.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 "hfi_linklist.hxx"
35 // NOT FULLY DEFINED SERVICES
36 #include <ary/idl/i_ce.hxx>
37 #include <ary/idl/i_gate.hxx>
38 #include <ary/idl/ip_ce.hxx>
39 #include <ary/idl/ip_type.hxx>
40 #include <toolkit/hf_docentry.hxx>
41 #include <toolkit/hf_title.hxx>
42 #include "hfi_doc.hxx"
43 #include "hfi_tag.hxx"
44 #include "hfi_typetext.hxx"
51 //******************* HF_CommentedLink_Table **********************************//
53 HF_CommentedLink_Table::HF_CommentedLink_Table( Environment
& io_rEnv
,
54 Xml::Element
& o_rOut
,
55 const String
& i_sTitle
,
56 const String
& i_sLabel
,
58 : HtmlFactory_Idl(io_rEnv
,&o_rOut
),
59 pTable( new Html::Table( (i_bBorder
? "1" : "0"), "100%", "5", "0") ),
64 << new Html::ClassAttr("commentedlinks");
67 >> *new Html::Label(i_sLabel
)
68 << new Html::LineBreak
;
71 // HF_SubTitle aTitle(*pTable);
72 // aTitle.Produce_it(i_sTitle);
75 HF_CommentedLink_Table::~HF_CommentedLink_Table()
80 HF_CommentedLink_Table::Add_Line()
83 rRow
= pTable
->AddRow();
85 pCurLinkColumn
= & (rRow
.AddCell()
86 << new Html::WidthAttr("30%")
87 << new Xml::AnAttribute("valign","top") );
88 pCurCommentColumn
= & rRow
.AddCell();
92 HF_CommentedLink_Table::Cur_LinkColumn()
94 csv_assert(pCurLinkColumn
!= 0);
95 return *pCurLinkColumn
;
99 HF_CommentedLink_Table::Cur_CommentColumn()
101 csv_assert(pCurCommentColumn
!= 0);
102 return *pCurCommentColumn
;
106 //******************* HF_MemberTable **********************************//
108 HF_MemberTable::HF_MemberTable( Environment
& io_rEnv
,
109 Xml::Element
& o_rOut
,
110 const String
& i_sTitle
,
111 const String
& i_sLabel
,
113 : HtmlFactory_Idl(io_rEnv
,&o_rOut
),
114 pTable( new Html::Table("1", "100%", "5", "0") ),
120 << new Html::ClassAttr("memberlist");
123 >> *new Html::Label(i_sLabel
)
124 << new Html::LineBreak
;
127 // HF_SubTitle aTitle(*pTable);
128 // aTitle.Produce_it(i_sTitle);
131 HF_MemberTable::~HF_MemberTable()
136 HF_MemberTable::Add_Line()
140 Html::TableRow
& rRow
= pTable
->AddRow();
142 pCurDeclaration
= &( rRow
.AddCell()
143 << new Xml::AnAttribute("valign","top")
144 << new Html::WidthAttr("30%") );
145 pCurDescription
= & rRow
.AddCell();
150 pMemberSpace
= new Html::DefList
;
152 << new Html::ClassAttr("member");
154 pTable
->AddRow().AddCell() << pMemberSpace
;
158 >> *new Html::DefListTerm
159 << new Html::ClassAttr("member") );
162 >> *new Html::DefListDefinition()
163 << new Html::ClassAttr("member") );
168 HF_MemberTable::Cur_Declaration()
170 csv_assert(pCurDeclaration
!= 0);
171 return *pCurDeclaration
;
175 HF_MemberTable::Cur_Description()
177 csv_assert(pCurDescription
!= 0);
178 return *pCurDescription
;
183 //******************* HF_IdlLinkList **********************************//
185 HF_IdlLinkList::HF_IdlLinkList( Environment
& io_rEnv
,
186 Xml::Element
* o_pOut
)
187 : HtmlFactory_Idl(io_rEnv
,o_pOut
)
191 HF_IdlLinkList::~HF_IdlLinkList()
196 HF_IdlLinkList::Produce_NamespaceMembers( const String
& i_sTitle
,
197 const String
& i_sLabel
,
198 const std::vector
<ary::idl::Ce_id
> & i_rList
,
199 bool i_bNestedNamespaces
) const
201 HF_CommentedLink_Table
202 aTableMaker( Env(), CurOut(),
206 std::vector
<ary::idl::Ce_id
>::const_iterator itEnd
= i_rList
.end();
207 for ( std::vector
<ary::idl::Ce_id
>::const_iterator it
= i_rList
.begin();
211 static String sEntryName
;
212 static String sEntryLink
;
215 Get_EntryData_NamespaceMembers( sEntryName
, sEntryLink
, pDocu
, *it
, i_bNestedNamespaces
);
216 aTableMaker
.Add_Line();
218 aTableMaker
.Cur_LinkColumn()
219 >> *new Html::Link(sEntryLink
)
225 aTextDisplay(Env(), aTableMaker
.Cur_CommentColumn() );
226 aTextDisplay
.Produce_byData( pDocu
);
232 HF_IdlLinkList::Produce_GlobalLinks( const String
& i_sTitle
,
233 const String
& i_sLabel
,
234 ce_list
& i_rList
) const
236 HF_CommentedLink_Table
237 aTableMaker( Env(), CurOut(),
241 for ( ; i_rList
; ++i_rList
)
243 aTableMaker
.Add_Line();
245 aLinkText( Env(), aTableMaker
.Cur_LinkColumn(), true );
246 aLinkText
.Produce_byData(*i_rList
);
249 pDocu
= Get_EntryDocu(*i_rList
);
253 aTextDisplay(Env(), aTableMaker
.Cur_CommentColumn() );
254 aTextDisplay
.Produce_byData( pDocu
, *i_rList
);
260 HF_IdlLinkList::Produce_GlobalCommentedLinks( const String
& i_sTitle
,
261 const String
& i_sLabel
,
262 comref_list
& i_rList
) const
264 HF_CommentedLink_Table
265 aTableMaker( Env(), CurOut(),
269 for ( ; i_rList; ++i_rList )
271 aTableMaker.Add_Line();
273 aLinkText( Env(), aTableMaker.Cur_LinkColumn(), true );
274 aLinkText.Produce_byData( (*i_rList).first );
277 aDocList( aTableMaker.Cur_CommentColumn() );
278 if ( (*i_rList).second != 0 )
281 aDocuDisplay( Env(), aDocList );
282 aDocuDisplay.Produce_byData( (*i_rList).second );
287 pShort = Get_EntryDocu(
288 Env().Gate().Types().Search_CeRelatedTo(
292 if (pShort->IsDeprecated())
294 aDocList.Produce_Term()
297 if (pShort->IsOptional())
299 aDocList.Produce_Term()
303 aDocList.Produce_Term()
306 HF_IdlDocuTextDisplay
307 aShortDisplay( Env(), &aDocList.Produce_Definition() );
308 aShortDisplay.Set_CurScopeTo(
309 Env().Gate().Types().Search_CeRelatedTo((*i_rList).first) );
310 pShort->Short().DisplayAt(aShortDisplay);
318 HF_IdlLinkList::Produce_MemberLinks( const String
& i_sTitle
,
319 const String
& i_sLabel
,
320 ce_list
& i_rList
) const
322 HF_CommentedLink_Table
323 aTableMaker( Env(), CurOut(),
328 for ( ; i_rList; ++i_rList )
330 const ary::idl::CodeEntity &
331 rCe = Env().Gate().Ces().Find_Ce(*i_rList);
333 aTableMaker.Add_Line();
334 aTableMaker.Cur_LinkColumn()
336 StreamLock(200)() << "#" << rCe.LocalName() << c_str)
344 aTextDisplay(Env(), aTableMaker.Cur_CommentColumn() );
345 aTextDisplay.Produce_byData( *pDocu );
352 HF_IdlLinkList::Get_EntryData_NamespaceMembers(
353 String
& o_sEntryName
,
354 String
& o_sEntryLink
,
355 const ce_info
* & o_pDocu
,
357 bool i_bIsNestedNamespace
) const
359 const ary::idl::CodeEntity
&
360 rCe
= Env().Data().Find_Ce(i_nMemberId
);
362 o_sEntryName
= rCe
.LocalName();
363 o_sEntryLink
= StreamLock(200)() << rCe
.LocalName()
364 << ( i_bIsNestedNamespace
369 o_pDocu
= rCe
.Docu();
372 const ary::doc::OldIdlDocu
*
373 HF_IdlLinkList::Get_EntryDocu(ce_id i_nMemberId
) const
375 if (i_nMemberId
.IsValid())
376 return Env().Data().Find_Ce(i_nMemberId
).Docu();