Bump for 3.6-28
[LibreOffice.git] / autodoc / source / display / toolkit / hf_navi_main.cxx
blobab378a153bcacce1d94468d1168285c2727d62b2
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 ************************************************************************/
29 #include <precomp.h>
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
41 public:
42 virtual ~HF_MainItem() {}
43 void Produce_Item() const { do_ProduceItem(); }
44 protected:
45 HF_MainItem(
46 Xml::Element & o_out )
47 : HtmlMaker(o_out) {}
48 private:
49 virtual void do_ProduceItem() const = 0;
53 namespace
56 class StdItem : public HF_MainItem
58 public:
59 StdItem(
60 Xml::Element & o_out,
61 const char * i_sText,
62 const char * i_sLink );
64 ~StdItem();
65 private:
66 virtual void do_ProduceItem() const;
68 // DATA
69 String sText;
70 String sLink;
73 class SelfItem : public HF_MainItem
75 public:
76 SelfItem(
77 Xml::Element & o_out,
78 const char * i_sText );
79 ~SelfItem();
80 private:
81 virtual void do_ProduceItem() const;
83 // DATA
84 String sText;
87 class NoneItem : public HF_MainItem
89 public:
90 NoneItem(
91 Xml::Element & o_out,
92 const char * i_sText );
93 ~NoneItem();
94 private:
95 virtual void do_ProduceItem() const;
97 // DATA
98 String sText;
101 } // anonymous namespace
105 //******************** HF_NaviMainRow ***************//
109 HF_NaviMainRow::HF_NaviMainRow( Xml::Element & o_out )
110 : HtmlMaker(o_out),
111 aItems(),
112 pRow(0)
114 aItems.reserve(5);
116 pRow =
117 &( CurOut()
118 >> *new Html::Table
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);
131 void
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 ));
138 void
139 HF_NaviMainRow::Add_SelfItem( const char * i_sText )
141 aItems.push_back(new SelfItem( *pRow,i_sText ));
144 void
145 HF_NaviMainRow::Add_NoneItem( const char * i_sText )
147 aItems.push_back(new NoneItem( *pRow,i_sText ));
150 void
151 HF_NaviMainRow::Produce_Row()
153 ItemList::iterator itEnd = aItems.end();
154 for ( ItemList::iterator iter = aItems.begin();
155 iter != itEnd;
156 ++iter )
158 (*iter)->Produce_Item();
165 //******************** MainItem and derived ones ***************//
167 namespace
170 StdItem::StdItem( Xml::Element & o_out,
171 const char * i_sText,
172 const char * i_sLink )
173 : HF_MainItem(o_out),
174 sText(i_sText),
175 sLink(i_sLink)
179 StdItem::~StdItem()
183 void
184 StdItem::do_ProduceItem() const
186 Xml::Element &
187 rCell = CurOut() >>* new Html::TableCell;
188 rCell
189 << new Html::ClassAttr( "navimain" )
190 >> *new Html::Link(sLink.c_str())
191 << new Html::ClassAttr( "navimain" )
192 << sText.c_str();
195 SelfItem::SelfItem( Xml::Element & o_out,
196 const char * i_sText )
197 : HF_MainItem(o_out),
198 sText(i_sText)
202 SelfItem::~SelfItem()
206 void
207 SelfItem::do_ProduceItem() const
209 Xml::Element &
210 rCell = CurOut() >>* new Html::TableCell;
211 rCell
212 << new Html::ClassAttr( "navimainself" )
213 << sText.c_str();
216 NoneItem::NoneItem( Xml::Element & o_out,
217 const char * i_sText )
218 : HF_MainItem(o_out),
219 sText(i_sText)
223 NoneItem::~NoneItem()
227 void
228 NoneItem::do_ProduceItem() const
230 Xml::Element &
231 rCell = CurOut() >>* new Html::TableCell;
232 rCell
233 << new Html::ClassAttr( "navimainnone" )
234 << sText.c_str();
237 } // anonymous namespace
240 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */