1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
30 #include "hfi_hierarchy.hxx"
33 // NOT FULLY DECLARED SERVICES
34 #include <udm/html/htmlitem.hxx>
35 #include <ary/stdconstiter.hxx>
36 #include <ary/idl/i_ce.hxx>
37 #include <ary/idl/i_gate.hxx>
38 #include <ary/idl/i_type.hxx>
39 #include <ary/idl/ik_interface.hxx>
40 #include <ary/idl/ip_ce.hxx>
41 #include <ary/idl/ip_type.hxx>
42 #include "hfi_interface.hxx"
43 #include "hfi_typetext.hxx"
48 HF_IdlBaseNode::HF_IdlBaseNode( const TYPE
& i_rType
,
50 intt i_nPositionOffset
,
51 HF_IdlBaseNode
& io_rDerived
)
52 : nType(i_rType
.TypeId()),
55 nPosition(i_nPositionOffset
),
56 pDerived(&io_rDerived
)
58 Ce_id nCe
= i_rGate
.Types().Search_CeRelatedTo(nType
);
61 GatherBases(i_rGate
.Ces().Find_Ce(nCe
), i_rGate
);
65 HF_IdlBaseNode::~HF_IdlBaseNode()
70 HF_IdlBaseNode::FillPositionList( std::vector
< const HF_IdlBaseNode
* > & o_rPositionList
) const
72 for ( BaseList::const_iterator it
= aBases
.begin();
76 (*it
)->FillPositionList(o_rPositionList
);
79 o_rPositionList
.push_back(this);
83 HF_IdlBaseNode::GatherBases( const CE
& i_rCe
,
84 const GATE
& i_rGate
)
86 ary::Dyn_StdConstIterator
<ary::idl::CommentedRelation
>
88 ary::idl::ifc_interface::attr::Get_Bases(aHelp
,i_rCe
);
90 for ( ary::StdConstIterator
<ary::idl::CommentedRelation
> & it
= *aHelp
;
95 rBaseType
= i_rGate
.Types().Find_Type((*it
).Type());
98 pBaseNode( new HF_IdlBaseNode( rBaseType
,
104 intt nAddedBases
= pBaseNode
->BaseCount() + 1;
105 nCountBases
+= nAddedBases
;
106 nPosition
+= nAddedBases
;
107 aBases
.push_back( pBaseNode
.Release() );
113 Write_BaseHierarchy( csi::xml::Element
& o_rOut
,
114 HtmlEnvironment_Idl
& i_env
,
115 const ary::idl::CodeEntity
& i_ce
)
119 >> *new csi::xml::AnElement("pre")
120 << new csi::html::StyleAttr("font-family:monospace;");
125 >> *new csi::html::Strong
140 Write_Bases( csi::xml::Element
& o_out
,
141 HtmlEnvironment_Idl
& i_env
,
142 const ary::idl::CodeEntity
& i_rCe
,
143 std::vector
<uintt
> & io_setColumns
)
145 ary::Dyn_StdConstIterator
<ary::idl::CommentedRelation
>
147 ary::idl::ifc_interface::attr::Get_Bases(aHelp
,i_rCe
);
149 for ( ary::StdConstIterator
<ary::idl::CommentedRelation
> & it
= *aHelp
;
151 // NO INCREMENT HERE, see below
155 nType
= (*it
).Type();
158 bThereComesMore
= it
.operator bool();
161 nCe
= i_env
.Gate().Types().Search_CeRelatedTo(nType
);
165 // Rather check for id(!) of com::sun::star::uno::XInterface.
166 if (i_env
.Gate().Ces().Find_Ce(nCe
).LocalName() == "XInterface")
170 for (uintt i
= 0; i
< io_setColumns
.size(); ++i
)
172 if (io_setColumns
[i
] == 1)
173 o_out
<< new csi::xml::XmlCode("┃");
180 o_out
<< new csi::xml::XmlCode("┣");
182 o_out
<< new csi::xml::XmlCode("┗");
186 aDisplay( i_env
, o_out
, true, i_env
.CurPageCe());
187 aDisplay
.Produce_byData(nType
);
192 io_setColumns
.push_back(bThereComesMore
? 1 : 0);
194 const ary::idl::CodeEntity
&
195 rCe
= i_env
.Gate().Ces().Find_Ce(nCe
);
200 io_setColumns
.pop_back();
205 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */