Update ooo320-m1
[ooovba.git] / autodoc / source / display / idl / hfi_doc.cxx
blobafb92c3dfc8787dfb0ff29ec69c04c6d9420b02a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hfi_doc.cxx,v $
10 * $Revision: 1.10 $
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 ************************************************************************/
31 #include <precomp.h>
32 #include "hfi_doc.hxx"
35 // NOT FULLY DEFINED SERVICES
36 #include <ary/idl/i_ce.hxx>
37 #include <ary/doc/d_oldidldocu.hxx>
38 #include <ary_i/d_token.hxx>
39 #include <toolkit/hf_docentry.hxx>
40 #include "hfi_tag.hxx"
41 #include "hi_ary.hxx"
46 HF_IdlDocu::HF_IdlDocu( Environment & io_rEnv,
47 HF_DocEntryList & o_rOut )
48 : HtmlFactory_Idl( io_rEnv, &o_rOut.CurOut() ),
49 rOut(o_rOut)
53 HF_IdlDocu::~HF_IdlDocu()
57 void
58 HF_IdlDocu::Produce_byDocu4Reference( const ce_info & i_rDocuForReference,
59 const client & i_rScopeGivingCe ) const
61 Produce_byDocuAndScope(i_rDocuForReference, 0, i_rScopeGivingCe );
64 void
65 HF_IdlDocu::Produce_byDocuAndScope( const ce_info & i_rDocu,
66 const client * i_pClient,
67 const client & i_rScopeGivingCe ) const
69 bool bShort = NOT i_rDocu.Short().IsEmpty();
70 bool bDescr = NOT i_rDocu.Description().IsEmpty();
72 if ( i_rDocu.IsDeprecated()
73 OR (
74 (i_pClient != 0 ? i_pClient->SightLevel() == ary::idl::sl_File : false)
75 AND NOT i_rDocu.IsPublished()
77 OR i_rDocu.IsOptional() )
78 { // any usage restriction
79 rOut.Produce_Term("Usage Restrictions");
81 if ( i_rDocu.IsDeprecated() )
82 rOut.Produce_Definition() >> *new Html::Italic << "deprecated";
83 if ( (i_pClient != 0 ? i_pClient->SightLevel() == ary::idl::sl_File : false)
84 AND NOT i_rDocu.IsPublished() )
85 rOut.Produce_Definition() >> *new Html::Italic << "not published";
86 if ( i_rDocu.IsOptional() )
87 rOut.Produce_Definition() >> *new Html::Italic << "optional";
89 if ( i_rDocu.IsDeprecated() AND
90 // KORR_FUTURE
91 // Workaround, because DocuTex2::IsEmpty() does not
92 // calculate whitespace tokens only as empty.
93 i_rDocu.DeprecatedText().Tokens().size() > 1 )
95 rOut.Produce_Term("Deprecation Info");
97 HF_IdlDocuTextDisplay
98 aDescription( Env(), 0, i_rScopeGivingCe);
99 aDescription.Out().Enter( rOut.Produce_Definition() );
100 i_rDocu.DeprecatedText().DisplayAt( aDescription );
101 aDescription.Out().Leave();
103 } // end if (<any usage restriction>)
105 if ( bShort OR bDescr )
107 rOut.Produce_Term("Description");
108 HF_IdlDocuTextDisplay
109 aDescription( Env(), 0, i_rScopeGivingCe);
110 if (bShort)
112 aDescription.Out().Enter( rOut.Produce_Definition() );
113 i_rDocu.Short().DisplayAt( aDescription );
114 aDescription.Out().Leave();
116 if (bDescr)
118 aDescription.Out().Enter( rOut.Produce_Definition() );
119 i_rDocu.Description().DisplayAt( aDescription );
120 aDescription.Out().Leave();
124 for ( std::vector< ary::inf::AtTag2* >::const_iterator
125 iter = i_rDocu.Tags().begin();
126 iter != i_rDocu.Tags().end();
127 ++iter )
129 if ( strlen( (*iter)->Title() ) > 0 )
131 HF_IdlTag
132 aTag(Env(), i_rScopeGivingCe);
133 Xml::Element &
134 rTerm = rOut.Produce_Term();
135 aTag.Produce_byData( rTerm,
136 rOut.Produce_Definition(),
137 *(*iter) );
139 } // end for