fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / autodoc / source / display / toolkit / hf_navi_sub.cxx
bloba5dbcf65d4c4c61960a6326714cf209dbfb825e1
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_sub.hxx>
24 // NOT FULLY DEFINED SERVICES
27 HF_NaviSubRow::HF_NaviSubRow( Xml::Element & o_rOut )
28 : HtmlMaker(o_rOut),
29 aRow(),
30 pMyRow(0)
32 Setup_Row();
35 HF_NaviSubRow::~HF_NaviSubRow()
39 void
40 HF_NaviSubRow::AddItem( const String & i_sText,
41 const String & i_sLink,
42 bool i_bSwitchOn )
44 aRow.push_back( SubRow_Item( SubRow_Data(i_sText,i_sLink),
45 i_bSwitchOn ));
48 void
49 HF_NaviSubRow::SwitchOn( int i_nIndex )
51 if ( i_nIndex < int(aRow.size()) )
52 aRow[i_nIndex].second = true;
55 void
56 HF_NaviSubRow::Setup_Row()
58 Html::Table *
59 pTable = new Html::Table;
60 CurOut()
61 >> *pTable
62 << new Html::ClassAttr("navisub")
63 << new Xml::AnAttribute( "border", "0" )
64 << new Xml::AnAttribute( "cellpadding", "0" );
65 pMyRow = &pTable->AddRow();
68 void
69 HF_NaviSubRow::Produce_Row()
71 for ( SubRow::const_iterator it = aRow.begin();
72 it != aRow.end();
73 ++it )
75 Xml::Element &
76 rCell = *pMyRow
77 >> *new Html::TableCell
78 << new Html::ClassAttr("navisub");
79 StreamLock sl(100);
80 Xml::Element &
81 rGoon = (*it).second
82 ? ( rCell
83 >> *new Html::Link( sl()
84 << "#"
85 << (*it).first.second
86 << c_str )
87 << new Html::ClassAttr("navisub")
89 : rCell;
90 rGoon
91 << (*it).first.first;
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */