1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hf_navi_main.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #include <toolkit/hf_navi_main.hxx>
35 // NOT FULLY DEFINED SERVICES
36 #include <cosv/tpl/tpltools.hxx>
40 //******************** MainItem and derived ones ***************//
41 class HF_MainItem
: public HtmlMaker
44 virtual ~HF_MainItem() {}
45 void Produce_Item() const { do_ProduceItem(); }
48 Xml::Element
& o_out
)
51 virtual void do_ProduceItem() const = 0;
58 class StdItem
: public HF_MainItem
64 const char * i_sLink
);
68 virtual void do_ProduceItem() const;
75 class SelfItem
: public HF_MainItem
80 const char * i_sText
);
83 virtual void do_ProduceItem() const;
89 class NoneItem
: public HF_MainItem
94 const char * i_sText
);
97 virtual void do_ProduceItem() const;
103 } // anonymous namespace
107 //******************** HF_NaviMainRow ***************//
111 HF_NaviMainRow::HF_NaviMainRow( Xml::Element
& o_out
)
121 << new Html::ClassAttr("navimain")
122 << new Xml::AnAttribute( "border", "0" )
123 << new Xml::AnAttribute( "cellpadding", "3" )
124 >> *new Html::TableRow
128 HF_NaviMainRow::~HF_NaviMainRow()
130 csv::erase_container_of_heap_ptrs(aItems
);
134 HF_NaviMainRow::Add_StdItem( const char * i_sText
,
135 const char * i_sLink
)
137 aItems
.push_back(new StdItem( *pRow
,i_sText
,i_sLink
));
141 HF_NaviMainRow::Add_SelfItem( const char * i_sText
)
143 aItems
.push_back(new SelfItem( *pRow
,i_sText
));
147 HF_NaviMainRow::Add_NoneItem( const char * i_sText
)
149 aItems
.push_back(new NoneItem( *pRow
,i_sText
));
153 HF_NaviMainRow::Produce_Row()
155 ItemList::iterator itEnd
= aItems
.end();
156 for ( ItemList::iterator iter
= aItems
.begin();
160 (*iter
)->Produce_Item();
167 //******************** MainItem and derived ones ***************//
172 StdItem::StdItem( Xml::Element
& o_out
,
173 const char * i_sText
,
174 const char * i_sLink
)
175 : HF_MainItem(o_out
),
186 StdItem::do_ProduceItem() const
189 rCell
= CurOut() >>* new Html::TableCell
;
191 << new Html::ClassAttr( "navimain" )
192 >> *new Html::Link(sLink
.c_str())
193 << new Html::ClassAttr( "navimain" )
197 SelfItem::SelfItem( Xml::Element
& o_out
,
198 const char * i_sText
)
199 : HF_MainItem(o_out
),
204 SelfItem::~SelfItem()
209 SelfItem::do_ProduceItem() const
212 rCell
= CurOut() >>* new Html::TableCell
;
214 << new Html::ClassAttr( "navimainself" )
218 NoneItem::NoneItem( Xml::Element
& o_out
,
219 const char * i_sText
)
220 : HF_MainItem(o_out
),
225 NoneItem::~NoneItem()
230 NoneItem::do_ProduceItem() const
233 rCell
= CurOut() >>* new Html::TableCell
;
235 << new Html::ClassAttr( "navimainnone" )
239 } // anonymous namespace