1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hf_funcdecl.cxx,v $
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 ************************************************************************/
32 #include <toolkit/hf_funcdecl.hxx>
35 // NOT FULLY DEFINED SERVICES
37 const String
C_sValignTop("top");
38 const String
C_sValignBottom("bottom");
42 HF_FunctionDeclaration::HF_FunctionDeclaration( Xml::Element
& o_rParent
,
43 const String
& i_sRaisesText
)
44 : HtmlMaker(o_rParent
),
45 sRaisesText(i_sRaisesText
),
50 pLastParameterCell(0),
53 pTable
= new Html::Table
;
56 << new Html::ClassAttr("table-in-method")
57 << new Xml::AnAttribute("border","0");
60 HF_FunctionDeclaration::~HF_FunctionDeclaration()
65 HF_FunctionDeclaration::ReturnCell()
70 pReturnCell
= &( *pTable
71 >> *new Html::TableRow
72 >> *new Html::TableCell
73 << new Html::VAlignAttr(C_sValignTop
)
74 << new Xml::AnAttribute("colspan", "3")
80 HF_FunctionDeclaration::NameCell()
85 pNameCell
= &( ParameterLine()
86 >> *new Html::TableCell
87 << new Html::VAlignAttr(C_sValignTop
)
89 pLastParameterCell
= pNameCell
;
95 HF_FunctionDeclaration::NewParamTypeCell()
97 if (pLastParameterCell
!= pNameCell
)
101 >> *new Html::TableCell
;
105 rParamType
= ParameterLine()
106 >> *new Html::TableCell
107 << new Html::VAlignAttr(C_sValignTop
);
110 >> *new Html::TableCell
111 << new Html::VAlignAttr(C_sValignBottom
)
112 << new Xml::XmlCode(" ")
118 HF_FunctionDeclaration::ParamNameCell()
120 csv_assert(pLastParameterCell
!= pNameCell
);
121 return *pLastParameterCell
;
125 HF_FunctionDeclaration::ExceptionCell()
127 if (pExceptionCell
!= 0)
128 return *pExceptionCell
;
131 rExceptionRow
= *pTable
132 >> *new Html::TableRow
;
134 >> *new Html::TableCell
135 << new Html::VAlignAttr(C_sValignTop
)
136 << new Xml::AnAttribute("align", "right")
140 pExceptionCell
= &( rExceptionRow
141 >> *new Html::TableCell
142 << new Html::VAlignAttr(C_sValignTop
)
143 << new Xml::AnAttribute("colspan", "2")
145 return *pExceptionCell
;
149 HF_FunctionDeclaration::ParameterLine()
151 if (pParameterLine
!= 0)
152 return *pParameterLine
;
154 pParameterLine
= new Html::TableRow
;
158 return *pParameterLine
;
163 HF_FunctionDeclaration::HF_FunctionDeclaration( Xml::Element
& o_rParent
)
164 : HtmlMaker(o_rParent
),
172 << new Xml::AnAttribute("border","0")
173 >> *new Html::TableRow
;
174 pFront
= &(rRow
>> *new Html::TableCell
<< new Html::VAlignAttr(C_sValignTop
));
175 pTypes
= &(rRow
>> *new Html::TableCell
<< new Html::VAlignAttr(C_sValignTop
));
176 pNames
= &(rRow
>> *new Html::TableCell
<< new Html::VAlignAttr(C_sValignTop
));
179 HF_FunctionDeclaration::~HF_FunctionDeclaration()
184 HF_FunctionDeclaration::Add_ReturnLine()
186 (*pTypes
) << new Xml::XmlCode(" <br>\n");
187 (*pNames
) << new Xml::XmlCode(" <br>\n");
192 HF_FunctionDeclaration::Add_RaisesLine( const char * i_sRaisesText
,
193 bool i_bSuppressExtraLine
)
195 if (NOT i_bSuppressExtraLine
)
197 (*pTypes
) << new Xml::XmlCode(" <br>");
198 (*pNames
) << new Xml::XmlCode(" <br>\n");
201 << new Xml::XmlCode("<p class=\"raise\">")
203 << new Xml::XmlCode("( </p>\n");