fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / autodoc / source / display / idl / hfi_xrefpage.cxx
blob5abfe32a7fdfd5ba26a640fc1c84b6718f72970d
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 "hfi_xrefpage.hxx"
24 // NOT FULLY DEFINED SERVICES
25 #include <ary/idl/i_ce.hxx>
26 #include <ary/idl/i_gate.hxx>
27 #include <ary/idl/ip_ce.hxx>
28 #include <toolkit/hf_title.hxx>
29 #include "hfi_navibar.hxx"
30 #include "hfi_typetext.hxx"
31 #include "hi_env.hxx"
34 namespace
37 const String
38 C_sTitleStart("uses of ");
39 const String
40 C_sCRLF("\n");
41 const String
42 C_sDevMan("References in Developers Guide");
44 } // anonymous namespace
48 HF_IdlXrefs::HF_IdlXrefs( Environment & io_rEnv,
49 Xml::Element & o_rOut,
50 const String & i_prefix,
51 const client & i_ce )
52 : HtmlFactory_Idl(io_rEnv, &o_rOut),
53 rContentDirectory(*new Html::Paragraph),
54 pClient(&i_ce)
56 produce_Main(i_prefix, i_ce);
59 HF_IdlXrefs::~HF_IdlXrefs()
63 void
64 HF_IdlXrefs::Write_ManualLinks( const client & i_ce ) const
66 const StringVector &
67 rLinks2Refs = i_ce.Secondaries().Links2RefsInManual();
68 if ( rLinks2Refs.empty() )
70 rContentDirectory
71 << C_sDevMan
72 << new Html::LineBreak
73 << C_sCRLF;
74 return;
78 rContentDirectory
79 >> *new Html::Link("#devmanrefs")
80 << C_sDevMan
81 << new Html::LineBreak
82 << C_sCRLF;
84 HF_SubTitleTable
85 aList(CurOut(), "devmanrefs", C_sDevMan, 1);
86 Xml::Element &
87 rOutCell = aList.Add_Row() >>* new Html::TableCell;
89 csv_assert(rLinks2Refs.size() % 2 == 0);
90 for ( StringVector::const_iterator it = rLinks2Refs.begin();
91 it != rLinks2Refs.end();
92 ++it )
94 Xml::Element &
95 rLink = rOutCell >> *new Html::Link( Env().Link2Manual(*it));
96 if ( (*(it+1)).empty() )
98 // HACK KORR_FUTURE
99 // Research what happens with manual links which contain normal characters
100 // in non-utf-8 texts. And research, why utfF-8 does not work here.
101 rLink << new Xml::XmlCode(*it);
102 else
103 // HACK KORR_FUTURE, see above.
104 rLink << new Xml::XmlCode( *(it+1) );
105 rOutCell
106 << new Html::LineBreak
107 << C_sCRLF;
108 ++it;
109 } // end for
112 void
113 HF_IdlXrefs::Produce_List( const char * i_title,
114 const char * i_label,
115 ce_list & i_iterator ) const
117 if (NOT i_iterator)
119 rContentDirectory
120 << i_title
121 << new Html::LineBreak
122 << C_sCRLF;
123 return;
126 csv_assert(*i_label == '#');
128 rContentDirectory
129 >> *new Html::Link(i_label)
130 << i_title
131 << new Html::LineBreak
132 << C_sCRLF;
134 HF_SubTitleTable
135 aList(CurOut(), i_label+1, i_title, 1);
136 Xml::Element &
137 rOutCell = aList.Add_Row() >>* new Html::TableCell;
138 HF_IdlTypeText
139 aTypeWriter(Env(), rOutCell, pClient);
140 for ( ce_list & it = i_iterator; it; ++it )
142 aTypeWriter.Produce_byData(*it);
143 rOutCell << new Html::LineBreak;
144 } // end for
147 void
148 HF_IdlXrefs::Produce_Tree( const char * i_title,
149 const char * i_label,
150 const client & i_ce,
151 F_GET_SUBLIST i_sublistcreator ) const
153 dyn_ce_list pResult;
154 (*i_sublistcreator)(pResult, i_ce);
156 if (NOT (*pResult).operator bool())
158 rContentDirectory
159 << i_title
160 << new Html::LineBreak
161 << C_sCRLF;
162 return;
165 csv_assert(*i_label == '#');
167 rContentDirectory
168 >> *new Html::Link(i_label)
169 << i_title
170 << new Html::LineBreak
171 << C_sCRLF;
173 HF_SubTitleTable
174 aList(CurOut(), i_label+1, i_title, 1);
175 Xml::Element &
176 rOut = aList.Add_Row()
177 >>* new Html::TableCell
178 >> *new csi::xml::AnElement("pre")
179 << new csi::html::StyleAttr("font-family:monospace;");
181 recursive_make_ListInTree( rOut,
183 i_ce,
184 *pResult,
185 i_sublistcreator );
188 void
189 HF_IdlXrefs::produce_Main( const String & i_prefix,
190 const client & i_ce ) const
192 make_Navibar(i_ce);
194 HF_TitleTable
195 aTitle(CurOut());
196 StreamLock sl(200);
197 aTitle.Produce_Title( sl()
198 << C_sTitleStart
199 << i_prefix
200 << " "
201 << i_ce.LocalName()
202 << c_str );
204 aTitle.Add_Row() << &rContentDirectory;
205 sl().reset();
206 rContentDirectory
207 >> *new Html::Link( sl() << i_ce.LocalName()
208 << ".html"
209 << c_str )
210 >> *new Html::Bold
211 << "back to "
212 << i_prefix
213 << " "
214 << i_ce.LocalName();
215 rContentDirectory
216 << new Html::LineBreak
217 << new Html::LineBreak
218 << C_sCRLF;
220 CurOut() << new Html::HorizontalLine();
223 void
224 HF_IdlXrefs::make_Navibar( const client & i_ce ) const
226 HF_IdlNavigationBar
227 aNaviBar(Env(), CurOut());
228 aNaviBar.Produce_CeXrefsMainRow(i_ce);
229 CurOut() << new Html::HorizontalLine();
232 void
233 HF_IdlXrefs::recursive_make_ListInTree( Xml::Element & o_rDisplay,
234 uintt i_level,
235 const client & i_ce,
236 ce_list & i_iterator,
237 F_GET_SUBLIST i_sublistcreator ) const
239 const char * sLevelIndentation = " ";
241 HF_IdlTypeText
242 aTypeWriter(Env(), o_rDisplay, &i_ce);
243 for ( ; i_iterator.operator bool(); ++i_iterator )
245 for (uintt i = 0; i < i_level; ++i)
247 o_rDisplay << sLevelIndentation;
248 } // end for
250 aTypeWriter.Produce_byData(*i_iterator);
251 o_rDisplay << C_sCRLF;
253 dyn_ce_list pResult;
254 const client & rCe = Env().Gate().Ces().Find_Ce(*i_iterator);
255 (*i_sublistcreator)(pResult, rCe);
256 if ( (*pResult).operator bool() )
258 recursive_make_ListInTree( o_rDisplay,
259 i_level + 1,
260 rCe,
261 *pResult,
262 i_sublistcreator );
264 } // end for
267 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */