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_method.hxx"
33 // NOT FULLY DEFINED SERVICES
34 #include <ary/idl/i_exception.hxx>
35 #include <ary/idl/i_param.hxx>
36 #include <toolkit/hf_docentry.hxx>
37 #include <toolkit/hf_funcdecl.hxx>
38 #include "hfi_doc.hxx"
39 #include "hfi_globalindex.hxx"
40 #include "hfi_typetext.hxx"
46 HF_IdlMethod::HF_IdlMethod( Environment
& io_rEnv
,
47 Xml::Element
& o_cell
)
48 : HtmlFactory_Idl(io_rEnv
,&o_cell
)
53 HF_IdlMethod::~HF_IdlMethod()
59 HF_IdlMethod::Produce_byData( const String
& i_sName
,
60 type_id i_nReturnType
,
61 param_list
& i_rParams
,
62 type_list
& i_rExceptions
,
65 const client
& i_ce
) const
68 >> *new Html::Label(i_sName
)
69 << new Html::ClassAttr(C_sMemberTitle
)
72 write_Declaration( i_sName
,
78 CurOut() << new Html::HorizontalLine
;
79 write_Docu(CurOut(), i_ce
);
84 HF_IdlMethod::write_Declaration( const String
& i_sName
,
85 type_id i_nReturnType
,
86 param_list
& i_rParams
,
87 type_list
& i_rExceptions
,
89 bool i_bEllipse
) const
91 HF_FunctionDeclaration
92 aDecl(CurOut(), "raises") ;
94 rReturnLine
= aDecl
.ReturnCell();
98 rReturnLine
<< "[oneway] ";
99 if (i_nReturnType
.IsValid())
100 { // Normal function, but not constructors:
102 aReturn(Env(), rReturnLine
, true);
103 aReturn
.Produce_byData(i_nReturnType
);
108 rNameCell
= aDecl
.NameCell();
116 bool bParams
= i_rParams
.operator bool();
122 pParamEnd
= write_Param( aDecl
, *i_rParams
);
123 for (++i_rParams
; i_rParams
; ++i_rParams
)
126 pParamEnd
= write_Param( aDecl
, *i_rParams
);
132 rParamType
= aDecl
.NewParamTypeCell();
135 pParamEnd
= &rParamType
;
146 if ( i_rExceptions
.operator bool() )
149 rExcOut
= aDecl
.ExceptionCell();
151 aExc(Env(), rExcOut
, true);
152 aExc
.Produce_byData(*i_rExceptions
);
154 for (++i_rExceptions
; i_rExceptions
; ++i_rExceptions
)
158 << new Html::LineBreak
;
159 aExc
.Produce_byData(*i_rExceptions
);
175 HF_IdlMethod::write_Param( HF_FunctionDeclaration
& o_decl
,
176 const ary::idl::Parameter
& i_param
) const
179 rTypeCell
= o_decl
.NewParamTypeCell();
181 rNameCell
= o_decl
.ParamNameCell();
183 switch ( i_param
.Direction() )
185 case ary::idl::param_in
:
186 rTypeCell
<< "[in] ";
188 case ary::idl::param_out
:
189 rTypeCell
<< "[out] ";
191 case ary::idl::param_inout
:
192 rTypeCell
<< "[inout] ";
197 aTypeWriter(Env(), rTypeCell
, true);
198 aTypeWriter
.Produce_byData( i_param
.Type() );
205 const String
sContentBorder("0");
206 const String
sContentWidth("96%");
207 const String
sContentPadding("5");
208 const String
sContentSpacing("0");
210 const String
sBgWhite("#ffffff");
211 const String
sCenter("center");
214 HF_IdlMethod::enter_ContentCell() const
218 rContentCell
= CurOut()
219 >> *new Html::Table( sContentBorder
,
223 << new Html::ClassAttr("table-in-method")
224 << new Html::BgColorAttr(sBgWhite
)
225 << new Html::AlignAttr(sCenter
)
226 >> *new Html::TableRow
227 >> *new Html::TableCell
;
228 Out().Enter(rContentCell
);
233 HF_IdlMethod::leave_ContentCell() const
238 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */