fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / autodoc / source / display / toolkit / hf_navi_main.cxx
blob45e157d5a69bc534088cf763e64f00fa8c5fb3f2
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_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
32 public:
33 virtual ~HF_MainItem() {}
34 void Produce_Item() const { do_ProduceItem(); }
35 protected:
36 HF_MainItem(
37 Xml::Element & o_out )
38 : HtmlMaker(o_out) {}
39 private:
40 virtual void do_ProduceItem() const = 0;
44 namespace
47 class StdItem : public HF_MainItem
49 public:
50 StdItem(
51 Xml::Element & o_out,
52 const char * i_sText,
53 const char * i_sLink );
55 ~StdItem();
56 private:
57 virtual void do_ProduceItem() const;
59 // DATA
60 String sText;
61 String sLink;
64 class SelfItem : public HF_MainItem
66 public:
67 SelfItem(
68 Xml::Element & o_out,
69 const char * i_sText );
70 ~SelfItem();
71 private:
72 virtual void do_ProduceItem() const;
74 // DATA
75 String sText;
78 class NoneItem : public HF_MainItem
80 public:
81 NoneItem(
82 Xml::Element & o_out,
83 const char * i_sText );
84 ~NoneItem();
85 private:
86 virtual void do_ProduceItem() const;
88 // DATA
89 String sText;
92 } // anonymous namespace
96 //******************** HF_NaviMainRow ***************//
100 HF_NaviMainRow::HF_NaviMainRow( Xml::Element & o_out )
101 : HtmlMaker(o_out),
102 aItems(),
103 pRow(0)
105 aItems.reserve(5);
107 pRow =
108 &( CurOut()
109 >> *new Html::Table
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);
122 void
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 ));
129 void
130 HF_NaviMainRow::Add_SelfItem( const char * i_sText )
132 aItems.push_back(new SelfItem( *pRow,i_sText ));
135 void
136 HF_NaviMainRow::Add_NoneItem( const char * i_sText )
138 aItems.push_back(new NoneItem( *pRow,i_sText ));
141 void
142 HF_NaviMainRow::Produce_Row()
144 ItemList::iterator itEnd = aItems.end();
145 for ( ItemList::iterator iter = aItems.begin();
146 iter != itEnd;
147 ++iter )
149 (*iter)->Produce_Item();
156 //******************** MainItem and derived ones ***************//
158 namespace
161 StdItem::StdItem( Xml::Element & o_out,
162 const char * i_sText,
163 const char * i_sLink )
164 : HF_MainItem(o_out),
165 sText(i_sText),
166 sLink(i_sLink)
170 StdItem::~StdItem()
174 void
175 StdItem::do_ProduceItem() const
177 Xml::Element &
178 rCell = CurOut() >>* new Html::TableCell;
179 rCell
180 << new Html::ClassAttr( "navimain" )
181 >> *new Html::Link(sLink.c_str())
182 << new Html::ClassAttr( "navimain" )
183 << sText.c_str();
186 SelfItem::SelfItem( Xml::Element & o_out,
187 const char * i_sText )
188 : HF_MainItem(o_out),
189 sText(i_sText)
193 SelfItem::~SelfItem()
197 void
198 SelfItem::do_ProduceItem() const
200 Xml::Element &
201 rCell = CurOut() >>* new Html::TableCell;
202 rCell
203 << new Html::ClassAttr( "navimainself" )
204 << sText.c_str();
207 NoneItem::NoneItem( Xml::Element & o_out,
208 const char * i_sText )
209 : HF_MainItem(o_out),
210 sText(i_sText)
214 NoneItem::~NoneItem()
218 void
219 NoneItem::do_ProduceItem() const
221 Xml::Element &
222 rCell = CurOut() >>* new Html::TableCell;
223 rCell
224 << new Html::ClassAttr( "navimainnone" )
225 << sText.c_str();
228 } // anonymous namespace
231 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */