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 <toolkit/hf_title.hxx>
33 // NOT FULLY DEFINED SERVICES
37 const String
C_sTitleBorder("0");
38 const String
C_sTitleWidth("100%");
39 const String
C_sTitlePadding("5");
40 const String
C_sTitleSpacing("3");
42 const String
C_sSubTitleBorder("1");
43 const String
C_sSubTitleWidth("100%");
44 const String
C_sSubTitlePadding("5");
45 const String
C_sSubTitleSpacing("0");
46 const String
C_sColSpan("colspan");
49 HF_TitleTable::HF_TitleTable( Xml::Element
& o_rOut
)
50 : HtmlMaker(o_rOut
>> *new Html::Table( C_sTitleBorder
,
54 << new Html::ClassAttr("title-table")
55 << new Html::StyleAttr("margin-bottom:6pt;") )
59 HF_TitleTable::~HF_TitleTable()
64 HF_TitleTable::Produce_Title( const char * i_title
)
67 << new Html::ClassAttr("title")
72 HF_TitleTable::Produce_Title( const char * i_annotations
,
73 const char * i_title
)
75 if (csv::no_str(i_annotations
))
77 Produce_Title(i_title
);
84 << new Html::ClassAttr("title");
89 << new Html::ClassAttr("title-table")
90 << new Html::WidthAttr("99%");
93 >> *new Html::TableRow
;
95 >> *new Html::TableCell
96 << new Html::WidthAttr("25%")
97 << new Html::ClassAttr("title2")
100 >> *new Html::TableCell
101 << new Html::WidthAttr("50%")
102 << new Html::ClassAttr("title")
105 >> *new Html::TableCell
106 << new Html::WidthAttr("*");
110 HF_TitleTable::Add_Row()
113 >> *new Html::TableRow
114 >> *new Html::TableCell
;
119 get_SubTitleCssClass(HF_SubTitleTable::E_SubLevel i_eSubTitleLevel
)
121 return i_eSubTitleLevel
== HF_SubTitleTable::sublevel_1
127 HF_SubTitleTable::HF_SubTitleTable( Xml::Element
& o_rOut
,
128 const String
& i_label
,
129 const String
& i_title
,
131 E_SubLevel i_eSubTitleLevel
)
133 << new Html::Label(i_label
)
134 >> *new Html::Table( C_sSubTitleBorder
,
138 << new Html::ClassAttr(get_SubTitleCssClass(i_eSubTitleLevel
)) )
140 csv_assert(i_nColumns
> 0);
142 if (i_eSubTitleLevel
== sublevel_3
)
147 >> *new Html::TableRow
148 >> *new Html::TableCell
149 << new Html::ClassAttr(get_SubTitleCssClass(i_eSubTitleLevel
)) ;
154 String sColumns
= sl() << i_nColumns
<< c_str
;
156 << new Xml::AnAttribute(C_sColSpan
, sColumns
);
162 HF_SubTitleTable::~HF_SubTitleTable()
167 HF_SubTitleTable::Add_Row()
169 return CurOut() >> *new Html::TableRow
;
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */