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_method.hxx"
24 // NOT FULLY DEFINED SERVICES
25 #include <ary/idl/i_exception.hxx>
26 #include <ary/idl/i_param.hxx>
27 #include <toolkit/hf_docentry.hxx>
28 #include <toolkit/hf_funcdecl.hxx>
29 #include "hfi_doc.hxx"
30 #include "hfi_globalindex.hxx"
31 #include "hfi_typetext.hxx"
37 HF_IdlMethod::HF_IdlMethod( Environment
& io_rEnv
,
38 Xml::Element
& o_cell
)
39 : HtmlFactory_Idl(io_rEnv
,&o_cell
)
44 HF_IdlMethod::~HF_IdlMethod()
50 HF_IdlMethod::Produce_byData( const String
& i_sName
,
51 type_id i_nReturnType
,
52 param_list
& i_rParams
,
53 type_list
& i_rExceptions
,
56 const client
& i_ce
) const
59 >> *new Html::Label(i_sName
)
60 << new Html::ClassAttr(C_sMemberTitle
)
63 write_Declaration( i_sName
,
69 CurOut() << new Html::HorizontalLine
;
70 write_Docu(CurOut(), i_ce
);
75 HF_IdlMethod::write_Declaration( const String
& i_sName
,
76 type_id i_nReturnType
,
77 param_list
& i_rParams
,
78 type_list
& i_rExceptions
,
80 bool i_bEllipse
) const
82 HF_FunctionDeclaration
83 aDecl(CurOut(), "raises") ;
85 rReturnLine
= aDecl
.ReturnCell();
89 rReturnLine
<< "[oneway] ";
90 if (i_nReturnType
.IsValid())
91 { // Normal function, but not constructors:
93 aReturn(Env(), rReturnLine
);
94 aReturn
.Produce_byData(i_nReturnType
);
99 rNameCell
= aDecl
.NameCell();
107 bool bParams
= i_rParams
.operator bool();
113 pParamEnd
= write_Param( aDecl
, *i_rParams
);
114 for (++i_rParams
; i_rParams
; ++i_rParams
)
117 pParamEnd
= write_Param( aDecl
, *i_rParams
);
123 rParamType
= aDecl
.NewParamTypeCell();
126 pParamEnd
= &rParamType
;
137 if ( i_rExceptions
.operator bool() )
140 rExcOut
= aDecl
.ExceptionCell();
142 aExc(Env(), rExcOut
);
143 aExc
.Produce_byData(*i_rExceptions
);
145 for (++i_rExceptions
; i_rExceptions
; ++i_rExceptions
)
149 << new Html::LineBreak
;
150 aExc
.Produce_byData(*i_rExceptions
);
166 HF_IdlMethod::write_Param( HF_FunctionDeclaration
& o_decl
,
167 const ary::idl::Parameter
& i_param
) const
170 rTypeCell
= o_decl
.NewParamTypeCell();
172 rNameCell
= o_decl
.ParamNameCell();
174 switch ( i_param
.Direction() )
176 case ary::idl::param_in
:
177 rTypeCell
<< "[in] ";
179 case ary::idl::param_out
:
180 rTypeCell
<< "[out] ";
182 case ary::idl::param_inout
:
183 rTypeCell
<< "[inout] ";
188 aTypeWriter(Env(), rTypeCell
);
189 aTypeWriter
.Produce_byData( i_param
.Type() );
196 const String
sContentBorder("0");
197 const String
sContentWidth("96%");
198 const String
sContentPadding("5");
199 const String
sContentSpacing("0");
201 const String
sBgWhite("#ffffff");
202 const String
sCenter("center");
205 HF_IdlMethod::enter_ContentCell() const
209 rContentCell
= CurOut()
210 >> *new Html::Table( sContentBorder
,
214 << new Html::ClassAttr("table-in-method")
215 << new Html::BgColorAttr(sBgWhite
)
216 << new Html::AlignAttr(sCenter
)
217 >> *new Html::TableRow
218 >> *new Html::TableCell
;
219 Out().Enter(rContentCell
);
224 HF_IdlMethod::leave_ContentCell() const
229 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */