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 <toolkit/hf_title.hxx>
24 // NOT FULLY DEFINED SERVICES
28 const String
C_sTitleBorder("0");
29 const String
C_sTitleWidth("100%");
30 const String
C_sTitlePadding("5");
31 const String
C_sTitleSpacing("3");
33 const String
C_sSubTitleBorder("1");
34 const String
C_sSubTitleWidth("100%");
35 const String
C_sSubTitlePadding("5");
36 const String
C_sSubTitleSpacing("0");
37 const String
C_sColSpan("colspan");
40 HF_TitleTable::HF_TitleTable( Xml::Element
& o_rOut
)
41 : HtmlMaker(o_rOut
>> *new Html::Table( C_sTitleBorder
,
45 << new Html::ClassAttr("title-table")
46 << new Html::StyleAttr("margin-bottom:6pt;") )
50 HF_TitleTable::~HF_TitleTable()
55 HF_TitleTable::Produce_Title( const char * i_title
)
58 << new Html::ClassAttr("title")
63 HF_TitleTable::Produce_Title( const char * i_annotations
,
64 const char * i_title
)
66 if (csv::no_str(i_annotations
))
68 Produce_Title(i_title
);
75 << new Html::ClassAttr("title");
80 << new Html::ClassAttr("title-table")
81 << new Html::WidthAttr("99%");
84 >> *new Html::TableRow
;
86 >> *new Html::TableCell
87 << new Html::WidthAttr("25%")
88 << new Html::ClassAttr("title2")
91 >> *new Html::TableCell
92 << new Html::WidthAttr("50%")
93 << new Html::ClassAttr("title")
96 >> *new Html::TableCell
97 << new Html::WidthAttr("*");
101 HF_TitleTable::Add_Row()
104 >> *new Html::TableRow
105 >> *new Html::TableCell
;
110 get_SubTitleCssClass(HF_SubTitleTable::E_SubLevel i_eSubTitleLevel
)
112 return i_eSubTitleLevel
== HF_SubTitleTable::sublevel_1
118 HF_SubTitleTable::HF_SubTitleTable( Xml::Element
& o_rOut
,
119 const String
& i_label
,
120 const String
& i_title
,
122 E_SubLevel i_eSubTitleLevel
)
124 << new Html::Label(i_label
)
125 >> *new Html::Table( C_sSubTitleBorder
,
129 << new Html::ClassAttr(get_SubTitleCssClass(i_eSubTitleLevel
)) )
131 csv_assert(i_nColumns
> 0);
133 if (i_eSubTitleLevel
== sublevel_3
)
138 >> *new Html::TableRow
139 >> *new Html::TableCell
140 << new Html::ClassAttr(get_SubTitleCssClass(i_eSubTitleLevel
)) ;
145 String sColumns
= sl() << i_nColumns
<< c_str
;
147 << new Xml::AnAttribute(C_sColSpan
, sColumns
);
153 HF_SubTitleTable::~HF_SubTitleTable()
158 HF_SubTitleTable::Add_Row()
160 return CurOut() >> *new Html::TableRow
;
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */