fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / autodoc / source / display / idl / hfi_doc.cxx
blobe0e053c4afb66806ce94c706f10888d33ad311d5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include <precomp.h>
21 #include "hfi_doc.hxx"
24 // NOT FULLY DEFINED SERVICES
25 #include <ary/idl/i_ce.hxx>
26 #include <ary/doc/d_oldidldocu.hxx>
27 #include <ary_i/d_token.hxx>
28 #include <toolkit/hf_docentry.hxx>
29 #include "hfi_tag.hxx"
30 #include "hi_ary.hxx"
35 HF_IdlDocu::HF_IdlDocu( Environment & io_rEnv,
36 HF_DocEntryList & o_rOut )
37 : HtmlFactory_Idl( io_rEnv, &o_rOut.CurOut() ),
38 rOut(o_rOut)
42 HF_IdlDocu::~HF_IdlDocu()
46 void
47 HF_IdlDocu::Produce_fromCodeEntity( const client & i_ce ) const
49 const ce_info *
50 i_pDocu = Get_IdlDocu(i_ce.Docu());
51 if (i_pDocu != 0)
52 Produce_byDocuAndScope(*i_pDocu, &i_ce, i_ce);
55 void
56 HF_IdlDocu::Produce_fromReference( const ce_info & i_rDocuForReference,
57 const client & i_rScopeGivingCe ) const
59 Produce_byDocuAndScope(i_rDocuForReference, 0, i_rScopeGivingCe );
62 void
63 HF_IdlDocu::Produce_byDocuAndScope( const ce_info & i_rDocu,
64 const client * i_pClient,
65 const client & i_rScopeGivingCe ) const
67 bool bShort = NOT i_rDocu.Short().IsEmpty();
68 bool bDescr = NOT i_rDocu.Description().IsEmpty();
70 if ( i_rDocu.IsDeprecated()
71 OR (
72 (i_pClient != 0 ? i_pClient->SightLevel() == ary::idl::sl_File : false)
73 AND NOT i_rDocu.IsPublished()
75 OR i_rDocu.IsOptional() )
76 { // any usage restriction
77 rOut.Produce_Term("Usage Restrictions");
79 if ( i_rDocu.IsDeprecated() )
80 rOut.Produce_Definition() >> *new Html::Italic << "deprecated";
81 if ( (i_pClient != 0 ? i_pClient->SightLevel() == ary::idl::sl_File : false)
82 AND NOT i_rDocu.IsPublished() )
83 rOut.Produce_Definition() >> *new Html::Italic << "not published";
84 if ( i_rDocu.IsOptional() )
85 rOut.Produce_Definition() >> *new Html::Italic << "optional";
87 if ( i_rDocu.IsDeprecated() AND
88 // KORR_FUTURE
89 // Workaround, because DocuTex2::IsEmpty() does not
90 // calculate whitespace tokens only as empty.
91 i_rDocu.DeprecatedText().Tokens().size() > 1 )
93 rOut.Produce_Term("Deprecation Info");
95 HF_IdlDocuTextDisplay
96 aDescription( Env(), 0, i_rScopeGivingCe);
97 aDescription.Out().Enter( rOut.Produce_Definition() );
98 i_rDocu.DeprecatedText().DisplayAt( aDescription );
99 aDescription.Out().Leave();
101 } // end if (<any usage restriction>)
103 if ( bShort OR bDescr )
105 rOut.Produce_Term("Description");
106 HF_IdlDocuTextDisplay
107 aDescription( Env(), 0, i_rScopeGivingCe);
108 if (bShort)
110 aDescription.Out().Enter( rOut.Produce_Definition() );
111 i_rDocu.Short().DisplayAt( aDescription );
112 aDescription.Out().Leave();
114 if (bDescr)
116 aDescription.Out().Enter( rOut.Produce_Definition() );
117 i_rDocu.Description().DisplayAt( aDescription );
118 aDescription.Out().Leave();
122 std::vector< csi::dsapi::DT_SeeAlsoAtTag* >
123 aSeeAlsosWithoutText;
124 std::vector< csi::dsapi::DT_SeeAlsoAtTag* >
125 aSeeAlsosWithText;
127 for ( std::vector< ary::inf::AtTag2* >::const_iterator
128 iter = i_rDocu.Tags().begin();
129 iter != i_rDocu.Tags().end();
130 ++iter )
132 csi::dsapi::DT_SeeAlsoAtTag*
133 pSeeAlso = dynamic_cast< csi::dsapi::DT_SeeAlsoAtTag * >(*iter);
134 if (pSeeAlso != 0 )
136 if ( pSeeAlso->Text().IsEmpty() )
138 aSeeAlsosWithoutText.push_back(pSeeAlso);
140 else
142 aSeeAlsosWithText.push_back(pSeeAlso);
144 continue;
147 if ( strlen( (*iter)->Title() ) > 0 )
149 HF_IdlTag
150 aTag(Env(), i_rScopeGivingCe);
151 Xml::Element &
152 rTerm = rOut.Produce_Term();
153 aTag.Produce_byData( rTerm,
154 rOut.Produce_Definition(),
155 *(*iter) );
157 } // end for
159 if (!aSeeAlsosWithoutText.empty())
161 HF_IdlTag
162 aSeeAlsoTag(Env(), i_rScopeGivingCe);
163 Xml::Element &
164 rTerm = rOut.Produce_Term();
165 aSeeAlsoTag.Produce_byData( rTerm,
166 rOut.Produce_Definition(),
167 aSeeAlsosWithoutText );
170 for ( std::vector< csi::dsapi::DT_SeeAlsoAtTag* >::const_iterator
171 itSee2 = aSeeAlsosWithText.begin();
172 itSee2 != aSeeAlsosWithText.end();
173 ++itSee2 )
175 HF_IdlTag
176 aTag(Env(), i_rScopeGivingCe);
177 Xml::Element &
178 rTerm = rOut.Produce_Term();
179 aTag.Produce_byData( rTerm,
180 rOut.Produce_Definition(),
181 *(*itSee2) );
182 } // end for
185 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */