fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / autodoc / source / display / toolkit / hf_title.cxx
blobaa05ac388a43d10cbb92e4c8d5e6dbce7b2fe6f0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include <precomp.h>
21 #include <toolkit/hf_title.hxx>
24 // NOT FULLY DEFINED SERVICES
25 #include <stdlib.h>
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,
42 C_sTitleWidth,
43 C_sTitlePadding,
44 C_sTitleSpacing )
45 << new Html::ClassAttr("title-table")
46 << new Html::StyleAttr("margin-bottom:6pt;") )
50 HF_TitleTable::~HF_TitleTable()
54 void
55 HF_TitleTable::Produce_Title( const char * i_title )
57 Add_Row()
58 << new Html::ClassAttr("title")
59 << i_title;
62 void
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);
69 return;
72 Xml::Element &
73 rRow = Add_Row();
74 rRow
75 << new Html::ClassAttr("title");
77 Xml::Element &
78 rTable = rRow
79 >> *new Html::Table()
80 << new Html::ClassAttr("title-table")
81 << new Html::WidthAttr("99%");
82 Xml::Element &
83 rInnerRow = rTable
84 >> *new Html::TableRow;
85 rInnerRow
86 >> *new Html::TableCell
87 << new Html::WidthAttr("25%")
88 << new Html::ClassAttr("title2")
89 << i_annotations;
90 rInnerRow
91 >> *new Html::TableCell
92 << new Html::WidthAttr("50%")
93 << new Html::ClassAttr("title")
94 << i_title;
95 rInnerRow
96 >> *new Html::TableCell
97 << new Html::WidthAttr("*");
100 Xml::Element &
101 HF_TitleTable::Add_Row()
103 return CurOut()
104 >> *new Html::TableRow
105 >> *new Html::TableCell;
109 inline const char *
110 get_SubTitleCssClass(HF_SubTitleTable::E_SubLevel i_eSubTitleLevel)
112 return i_eSubTitleLevel == HF_SubTitleTable::sublevel_1
113 ? "subtitle"
114 : "crosstitle";
118 HF_SubTitleTable::HF_SubTitleTable( Xml::Element & o_rOut,
119 const String & i_label,
120 const String & i_title,
121 int i_nColumns,
122 E_SubLevel i_eSubTitleLevel )
123 : HtmlMaker( o_rOut
124 << new Html::Label(i_label)
125 >> *new Html::Table( C_sSubTitleBorder,
126 C_sSubTitleWidth,
127 C_sSubTitlePadding,
128 C_sSubTitleSpacing )
129 << new Html::ClassAttr(get_SubTitleCssClass(i_eSubTitleLevel)) )
131 csv_assert(i_nColumns > 0);
133 if (i_eSubTitleLevel == sublevel_3)
134 return;
136 Xml::Element &
137 rCell = CurOut()
138 >> *new Html::TableRow
139 >> *new Html::TableCell
140 << new Html::ClassAttr(get_SubTitleCssClass(i_eSubTitleLevel)) ;
142 if (i_nColumns > 1)
144 StreamLock sl(20);
145 String sColumns = sl() << i_nColumns << c_str;
146 rCell
147 << new Xml::AnAttribute(C_sColSpan, sColumns);
149 rCell
150 << i_title;
153 HF_SubTitleTable::~HF_SubTitleTable()
157 Xml::Element &
158 HF_SubTitleTable::Add_Row()
160 return CurOut() >> *new Html::TableRow;
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */