1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "hfi_hierarchy.hxx"
24 // NOT FULLY DECLARED SERVICES
25 #include <udm/html/htmlitem.hxx>
26 #include <ary/stdconstiter.hxx>
27 #include <ary/idl/i_ce.hxx>
28 #include <ary/idl/i_gate.hxx>
29 #include <ary/idl/i_type.hxx>
30 #include <ary/idl/ik_interface.hxx>
31 #include <ary/idl/ip_ce.hxx>
32 #include <ary/idl/ip_type.hxx>
33 #include "hfi_interface.hxx"
34 #include "hfi_typetext.hxx"
39 HF_IdlBaseNode::HF_IdlBaseNode( const TYPE
& i_rType
,
41 intt i_nPositionOffset
,
42 HF_IdlBaseNode
& io_rDerived
)
43 : nType(i_rType
.TypeId()),
46 nPosition(i_nPositionOffset
),
47 pDerived(&io_rDerived
)
49 Ce_id nCe
= i_rGate
.Types().Search_CeRelatedTo(nType
);
52 GatherBases(i_rGate
.Ces().Find_Ce(nCe
), i_rGate
);
56 HF_IdlBaseNode::~HF_IdlBaseNode()
61 HF_IdlBaseNode::FillPositionList( std::vector
< const HF_IdlBaseNode
* > & o_rPositionList
) const
63 for ( BaseList::const_iterator it
= aBases
.begin();
67 (*it
)->FillPositionList(o_rPositionList
);
70 o_rPositionList
.push_back(this);
74 HF_IdlBaseNode::GatherBases( const CE
& i_rCe
,
75 const GATE
& i_rGate
)
77 ary::Dyn_StdConstIterator
<ary::idl::CommentedRelation
>
79 ary::idl::ifc_interface::attr::Get_Bases(aHelp
,i_rCe
);
81 for ( ary::StdConstIterator
<ary::idl::CommentedRelation
> & it
= *aHelp
;
86 rBaseType
= i_rGate
.Types().Find_Type((*it
).Type());
89 pBaseNode( new HF_IdlBaseNode( rBaseType
,
95 intt nAddedBases
= pBaseNode
->BaseCount() + 1;
96 nCountBases
+= nAddedBases
;
97 nPosition
+= nAddedBases
;
98 aBases
.push_back( pBaseNode
.Release() );
104 Write_BaseHierarchy( csi::xml::Element
& o_rOut
,
105 HtmlEnvironment_Idl
& i_env
,
106 const ary::idl::CodeEntity
& i_ce
)
110 >> *new csi::xml::AnElement("pre")
111 << new csi::html::StyleAttr("font-family:monospace;");
116 >> *new csi::html::Strong
131 Write_Bases( csi::xml::Element
& o_out
,
132 HtmlEnvironment_Idl
& i_env
,
133 const ary::idl::CodeEntity
& i_rCe
,
134 std::vector
<uintt
> & io_setColumns
)
136 ary::Dyn_StdConstIterator
<ary::idl::CommentedRelation
>
138 ary::idl::ifc_interface::attr::Get_Bases(aHelp
,i_rCe
);
140 for ( ary::StdConstIterator
<ary::idl::CommentedRelation
> & it
= *aHelp
;
142 // NO INCREMENT HERE, see below
146 nType
= (*it
).Type();
149 bThereComesMore
= it
.operator bool();
152 nCe
= i_env
.Gate().Types().Search_CeRelatedTo(nType
);
156 // Rather check for id(!) of com::sun::star::uno::XInterface.
157 if (i_env
.Gate().Ces().Find_Ce(nCe
).LocalName() == "XInterface")
161 for (uintt i
= 0; i
< io_setColumns
.size(); ++i
)
163 if (io_setColumns
[i
] == 1)
164 o_out
<< new csi::xml::XmlCode("┃");
171 o_out
<< new csi::xml::XmlCode("┣");
173 o_out
<< new csi::xml::XmlCode("┗");
177 aDisplay( i_env
, o_out
, i_env
.CurPageCe());
178 aDisplay
.Produce_byData(nType
);
183 io_setColumns
.push_back(bThereComesMore
? 1 : 0);
185 const ary::idl::CodeEntity
&
186 rCe
= i_env
.Gate().Ces().Find_Ce(nCe
);
191 io_setColumns
.pop_back();
196 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */