Update ooo320-m1
[ooovba.git] / autodoc / source / display / toolkit / hf_funcdecl.cxx
blob51f8bb6819f18cbf34d0e97e3d78af3e7318038a
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: hf_funcdecl.cxx,v $
10 * $Revision: 1.8 $
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 <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),
46 pTable(0),
47 pReturnCell(0),
48 pNameCell(0),
49 pParameterLine(0),
50 pLastParameterCell(0),
51 pExceptionCell(0)
53 pTable = new Html::Table;
54 CurOut()
55 >> *pTable
56 << new Html::ClassAttr("table-in-method")
57 << new Xml::AnAttribute("border","0");
60 HF_FunctionDeclaration::~HF_FunctionDeclaration()
64 Xml::Element &
65 HF_FunctionDeclaration::ReturnCell()
67 if (pReturnCell != 0)
68 return *pReturnCell;
70 pReturnCell = &( *pTable
71 >> *new Html::TableRow
72 >> *new Html::TableCell
73 << new Html::VAlignAttr(C_sValignTop)
74 << new Xml::AnAttribute("colspan", "3")
76 return *pReturnCell;
79 Xml::Element &
80 HF_FunctionDeclaration::NameCell()
82 if (pNameCell != 0)
83 return *pNameCell;
85 pNameCell = &( ParameterLine()
86 >> *new Html::TableCell
87 << new Html::VAlignAttr(C_sValignTop)
89 pLastParameterCell = pNameCell;
91 return *pNameCell;
94 Xml::Element &
95 HF_FunctionDeclaration::NewParamTypeCell()
97 if (pLastParameterCell != pNameCell)
99 pParameterLine = 0;
100 ParameterLine()
101 >> *new Html::TableCell;
104 Xml::Element &
105 rParamType = ParameterLine()
106 >> *new Html::TableCell
107 << new Html::VAlignAttr(C_sValignTop);
108 pLastParameterCell
109 = &( ParameterLine()
110 >> *new Html::TableCell
111 << new Html::VAlignAttr(C_sValignBottom)
112 << new Xml::XmlCode("&nbsp;")
114 return rParamType;
117 Xml::Element &
118 HF_FunctionDeclaration::ParamNameCell()
120 csv_assert(pLastParameterCell != pNameCell);
121 return *pLastParameterCell;
124 Xml::Element &
125 HF_FunctionDeclaration::ExceptionCell()
127 if (pExceptionCell != 0)
128 return *pExceptionCell;
130 Xml::Element &
131 rExceptionRow = *pTable
132 >> *new Html::TableRow;
133 rExceptionRow
134 >> *new Html::TableCell
135 << new Html::VAlignAttr(C_sValignTop)
136 << new Xml::AnAttribute("align", "right")
137 << sRaisesText
138 << "( ";
140 pExceptionCell = &( rExceptionRow
141 >> *new Html::TableCell
142 << new Html::VAlignAttr(C_sValignTop)
143 << new Xml::AnAttribute("colspan", "2")
145 return *pExceptionCell;
148 Html::TableRow &
149 HF_FunctionDeclaration::ParameterLine()
151 if (pParameterLine != 0)
152 return *pParameterLine;
154 pParameterLine = new Html::TableRow;
155 *pTable
156 >> *pParameterLine;
158 return *pParameterLine;
162 #if 0 // old
163 HF_FunctionDeclaration::HF_FunctionDeclaration( Xml::Element & o_rParent )
164 : HtmlMaker(o_rParent),
165 pFront(0),
166 pTypes(0),
167 pNames(0)
169 Xml::Element &
170 rRow = CurOut()
171 >> *new Html::Table
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()
183 Xml::Element &
184 HF_FunctionDeclaration::Add_ReturnLine()
186 (*pTypes) << new Xml::XmlCode("&nbsp;<br>\n");
187 (*pNames) << new Xml::XmlCode("&nbsp;<br>\n");
188 return *pFront;
191 Xml::Element &
192 HF_FunctionDeclaration::Add_RaisesLine( const char * i_sRaisesText,
193 bool i_bSuppressExtraLine )
195 if (NOT i_bSuppressExtraLine)
197 (*pTypes) << new Xml::XmlCode("&nbsp;<br>");
198 (*pNames) << new Xml::XmlCode("&nbsp;<br>\n");
200 (*pTypes)
201 << new Xml::XmlCode("<p class=\"raise\">")
202 << i_sRaisesText
203 << new Xml::XmlCode("( </p>\n");
204 return *pNames;
206 #endif // 0 old