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_navi_main.hxx>
24 // NOT FULLY DEFINED SERVICES
25 #include <cosv/tpl/tpltools.hxx>
29 //******************** MainItem and derived ones ***************//
30 class HF_MainItem
: public HtmlMaker
33 virtual ~HF_MainItem() {}
34 void Produce_Item() const { do_ProduceItem(); }
37 Xml::Element
& o_out
)
40 virtual void do_ProduceItem() const = 0;
47 class StdItem
: public HF_MainItem
53 const char * i_sLink
);
57 virtual void do_ProduceItem() const;
64 class SelfItem
: public HF_MainItem
69 const char * i_sText
);
72 virtual void do_ProduceItem() const;
78 class NoneItem
: public HF_MainItem
83 const char * i_sText
);
86 virtual void do_ProduceItem() const;
92 } // anonymous namespace
96 //******************** HF_NaviMainRow ***************//
100 HF_NaviMainRow::HF_NaviMainRow( Xml::Element
& o_out
)
110 << new Html::ClassAttr("navimain")
111 << new Xml::AnAttribute( "border", "0" )
112 << new Xml::AnAttribute( "cellpadding", "3" )
113 >> *new Html::TableRow
117 HF_NaviMainRow::~HF_NaviMainRow()
119 csv::erase_container_of_heap_ptrs(aItems
);
123 HF_NaviMainRow::Add_StdItem( const char * i_sText
,
124 const char * i_sLink
)
126 aItems
.push_back(new StdItem( *pRow
,i_sText
,i_sLink
));
130 HF_NaviMainRow::Add_SelfItem( const char * i_sText
)
132 aItems
.push_back(new SelfItem( *pRow
,i_sText
));
136 HF_NaviMainRow::Add_NoneItem( const char * i_sText
)
138 aItems
.push_back(new NoneItem( *pRow
,i_sText
));
142 HF_NaviMainRow::Produce_Row()
144 ItemList::iterator itEnd
= aItems
.end();
145 for ( ItemList::iterator iter
= aItems
.begin();
149 (*iter
)->Produce_Item();
156 //******************** MainItem and derived ones ***************//
161 StdItem::StdItem( Xml::Element
& o_out
,
162 const char * i_sText
,
163 const char * i_sLink
)
164 : HF_MainItem(o_out
),
175 StdItem::do_ProduceItem() const
178 rCell
= CurOut() >>* new Html::TableCell
;
180 << new Html::ClassAttr( "navimain" )
181 >> *new Html::Link(sLink
.c_str())
182 << new Html::ClassAttr( "navimain" )
186 SelfItem::SelfItem( Xml::Element
& o_out
,
187 const char * i_sText
)
188 : HF_MainItem(o_out
),
193 SelfItem::~SelfItem()
198 SelfItem::do_ProduceItem() const
201 rCell
= CurOut() >>* new Html::TableCell
;
203 << new Html::ClassAttr( "navimainself" )
207 NoneItem::NoneItem( Xml::Element
& o_out
,
208 const char * i_sText
)
209 : HF_MainItem(o_out
),
214 NoneItem::~NoneItem()
219 NoneItem::do_ProduceItem() const
222 rCell
= CurOut() >>* new Html::TableCell
;
224 << new Html::ClassAttr( "navimainnone" )
228 } // anonymous namespace
231 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */