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_navi_main.hxx>
33 // NOT FULLY DEFINED SERVICES
34 #include <cosv/tpl/tpltools.hxx>
38 //******************** MainItem and derived ones ***************//
39 class HF_MainItem
: public HtmlMaker
42 virtual ~HF_MainItem() {}
43 void Produce_Item() const { do_ProduceItem(); }
46 Xml::Element
& o_out
)
49 virtual void do_ProduceItem() const = 0;
56 class StdItem
: public HF_MainItem
62 const char * i_sLink
);
66 virtual void do_ProduceItem() const;
73 class SelfItem
: public HF_MainItem
78 const char * i_sText
);
81 virtual void do_ProduceItem() const;
87 class NoneItem
: public HF_MainItem
92 const char * i_sText
);
95 virtual void do_ProduceItem() const;
101 } // anonymous namespace
105 //******************** HF_NaviMainRow ***************//
109 HF_NaviMainRow::HF_NaviMainRow( Xml::Element
& o_out
)
119 << new Html::ClassAttr("navimain")
120 << new Xml::AnAttribute( "border", "0" )
121 << new Xml::AnAttribute( "cellpadding", "3" )
122 >> *new Html::TableRow
126 HF_NaviMainRow::~HF_NaviMainRow()
128 csv::erase_container_of_heap_ptrs(aItems
);
132 HF_NaviMainRow::Add_StdItem( const char * i_sText
,
133 const char * i_sLink
)
135 aItems
.push_back(new StdItem( *pRow
,i_sText
,i_sLink
));
139 HF_NaviMainRow::Add_SelfItem( const char * i_sText
)
141 aItems
.push_back(new SelfItem( *pRow
,i_sText
));
145 HF_NaviMainRow::Add_NoneItem( const char * i_sText
)
147 aItems
.push_back(new NoneItem( *pRow
,i_sText
));
151 HF_NaviMainRow::Produce_Row()
153 ItemList::iterator itEnd
= aItems
.end();
154 for ( ItemList::iterator iter
= aItems
.begin();
158 (*iter
)->Produce_Item();
165 //******************** MainItem and derived ones ***************//
170 StdItem::StdItem( Xml::Element
& o_out
,
171 const char * i_sText
,
172 const char * i_sLink
)
173 : HF_MainItem(o_out
),
184 StdItem::do_ProduceItem() const
187 rCell
= CurOut() >>* new Html::TableCell
;
189 << new Html::ClassAttr( "navimain" )
190 >> *new Html::Link(sLink
.c_str())
191 << new Html::ClassAttr( "navimain" )
195 SelfItem::SelfItem( Xml::Element
& o_out
,
196 const char * i_sText
)
197 : HF_MainItem(o_out
),
202 SelfItem::~SelfItem()
207 SelfItem::do_ProduceItem() const
210 rCell
= CurOut() >>* new Html::TableCell
;
212 << new Html::ClassAttr( "navimainself" )
216 NoneItem::NoneItem( Xml::Element
& o_out
,
217 const char * i_sText
)
218 : HF_MainItem(o_out
),
223 NoneItem::~NoneItem()
228 NoneItem::do_ProduceItem() const
231 rCell
= CurOut() >>* new Html::TableCell
;
233 << new Html::ClassAttr( "navimainnone" )
237 } // anonymous namespace
240 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */