1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski  *
3*b1cdbd2cSJim Jagielski  * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski  * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski  * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski  * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski  * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski  * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski  * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski  *
11*b1cdbd2cSJim Jagielski  *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski  *
13*b1cdbd2cSJim Jagielski  * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski  * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski  * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski  * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski  * under the License.
19*b1cdbd2cSJim Jagielski  *
20*b1cdbd2cSJim Jagielski  *************************************************************/
21*b1cdbd2cSJim Jagielski 
22*b1cdbd2cSJim Jagielski #include <precomp.h>
23*b1cdbd2cSJim Jagielski #include "pm_help.hxx"
24*b1cdbd2cSJim Jagielski 
25*b1cdbd2cSJim Jagielski 
26*b1cdbd2cSJim Jagielski // NOT FULLY DEFINED SERVICES
27*b1cdbd2cSJim Jagielski #include "navibar.hxx"
28*b1cdbd2cSJim Jagielski #include "html_kit.hxx"
29*b1cdbd2cSJim Jagielski 
30*b1cdbd2cSJim Jagielski using namespace csi;
31*b1cdbd2cSJim Jagielski using csi::html::Paragraph;
32*b1cdbd2cSJim Jagielski using csi::html::HorizontalLine;
33*b1cdbd2cSJim Jagielski using csi::html::Headline;
34*b1cdbd2cSJim Jagielski using csi::html::AlignAttr;
35*b1cdbd2cSJim Jagielski using csi::html::Bold;
36*b1cdbd2cSJim Jagielski using csi::html::Link;
37*b1cdbd2cSJim Jagielski using csi::html::Sbr;
38*b1cdbd2cSJim Jagielski using csi::html::LineBreak;
39*b1cdbd2cSJim Jagielski using csi::xml::Element;
40*b1cdbd2cSJim Jagielski 
41*b1cdbd2cSJim Jagielski 
42*b1cdbd2cSJim Jagielski 
43*b1cdbd2cSJim Jagielski const String  C_sHelpText(
44*b1cdbd2cSJim Jagielski "<div style=\"font-size:10pt;\">\n"
45*b1cdbd2cSJim Jagielski "<h3 class=\"help\">The Main Navigationbar</h3>\n"
46*b1cdbd2cSJim Jagielski "<p> On top of every page, there is a main navigationbar on a lightly coloured\n"
47*b1cdbd2cSJim Jagielski "background with the following items:<br>\n"
48*b1cdbd2cSJim Jagielski "</p>\n"
49*b1cdbd2cSJim Jagielski "<ul>\n"
50*b1cdbd2cSJim Jagielski "  <li>Overview - the start page for this document,</li>\n"
51*b1cdbd2cSJim Jagielski "  <li>Namespace - the lowest/deepest namespace of the language objects, described\n"
52*b1cdbd2cSJim Jagielski "on the current page,</li>\n"
53*b1cdbd2cSJim Jagielski "  <li>Class - the class, struct or union, which owns the methods or data,\n"
54*b1cdbd2cSJim Jagielski "described on the current page,</li>\n"
55*b1cdbd2cSJim Jagielski "  <li>Index - the global alphabetical index,</li>\n"
56*b1cdbd2cSJim Jagielski "  <li>Help - this page.</li>\n"
57*b1cdbd2cSJim Jagielski "</ul>\n"
58*b1cdbd2cSJim Jagielski " Each item in this&nbsp; bar can be in three different states:<br>\n"
59*b1cdbd2cSJim Jagielski "<ul>\n"
60*b1cdbd2cSJim Jagielski "  <li>Link - the item is valid and you can get there,</li>\n"
61*b1cdbd2cSJim Jagielski "  <li>Simple - the item does not apply (if this page described a namespace,\n"
62*b1cdbd2cSJim Jagielski "there would be no owning class),</li>\n"
63*b1cdbd2cSJim Jagielski "  <li>Reversed (white text on dark background) - this is the current page.</li>\n"
64*b1cdbd2cSJim Jagielski "</ul>\n"
65*b1cdbd2cSJim Jagielski "<h3 class=\"help\">Lower Navigationbars</h3>\n"
66*b1cdbd2cSJim Jagielski " Just below the main navigation bar, there may be zero to three lower navigationbars\n"
67*b1cdbd2cSJim Jagielski "on white background.<br>\n"
68*b1cdbd2cSJim Jagielski "<br>\n"
69*b1cdbd2cSJim Jagielski "Their items are dependent of the context, but they always link to paragraphs\n"
70*b1cdbd2cSJim Jagielski "on the same, current page.<br>\n"
71*b1cdbd2cSJim Jagielski "Available items appear as links. Unavailable items appear as simple text.<br>\n"
72*b1cdbd2cSJim Jagielski "\n"
73*b1cdbd2cSJim Jagielski "\n"
74*b1cdbd2cSJim Jagielski "<h3 class=\"help\">Namespace Descriptions</h3>\n"
75*b1cdbd2cSJim Jagielski "\n"
76*b1cdbd2cSJim Jagielski "<dl>\n"
77*b1cdbd2cSJim Jagielski "<dt class=\"simple\">Parent namespaces</dt>\n"
78*b1cdbd2cSJim Jagielski "  </dl>\n"
79*b1cdbd2cSJim Jagielski "  <dl>\n"
80*b1cdbd2cSJim Jagielski "  <dd>In front of the namespace title, there is a linked list of the parent\n"
81*b1cdbd2cSJim Jagielski "namespaces. The global namespace is linked with the first \"::\",</dd>\n"
82*b1cdbd2cSJim Jagielski "    <dd>the namespaces between the global and the current one are linked\n"
83*b1cdbd2cSJim Jagielski "by their names.<br>\n"
84*b1cdbd2cSJim Jagielski "      </dd>\n"
85*b1cdbd2cSJim Jagielski "      <dd> </dd>\n"
86*b1cdbd2cSJim Jagielski "        </dl>\n"
87*b1cdbd2cSJim Jagielski "After the title, the documentation of the namespace follows (which is often\n"
88*b1cdbd2cSJim Jagielski "missing, because the namespace name may be self-explaining).<br>\n"
89*b1cdbd2cSJim Jagielski "        <br>\n"
90*b1cdbd2cSJim Jagielski "Below are the lists of nested namspaces and of the classes, functions and\n"
91*b1cdbd2cSJim Jagielski "other program objects, that belong within this namespace.<br>\n"
92*b1cdbd2cSJim Jagielski "Each of this lists is accessible by the lower navigationbar on top of the\n"
93*b1cdbd2cSJim Jagielski "page.<br>\n"
94*b1cdbd2cSJim Jagielski "\n"
95*b1cdbd2cSJim Jagielski "<h3 class=\"help\">Class Descriptions</h3>\n"
96*b1cdbd2cSJim Jagielski "\n"
97*b1cdbd2cSJim Jagielski "        <dl>\n"
98*b1cdbd2cSJim Jagielski "        <dt class=\"simple\">Parent namespaces and classes</dt>\n"
99*b1cdbd2cSJim Jagielski "          </dl>\n"
100*b1cdbd2cSJim Jagielski "          <dl>\n"
101*b1cdbd2cSJim Jagielski "          <dd>In front of the class title, there is a linked list of the\n"
102*b1cdbd2cSJim Jagielski "parent namespaces or classes. The global namespace is linked with the first\n"
103*b1cdbd2cSJim Jagielski "\"::\",</dd>\n"
104*b1cdbd2cSJim Jagielski "            <dd>the namespaces between the global and the current one are\n"
105*b1cdbd2cSJim Jagielski "linked by their names. Enclosing classes are linked as well, but appear in\n"
106*b1cdbd2cSJim Jagielski "<span class=\"nqclass\">green</font> color.&nbsp;</dd>\n"
107*b1cdbd2cSJim Jagielski "              <dd>So you see on the first glance, that this is a parent class,\n"
108*b1cdbd2cSJim Jagielski "no namespace.<br>\n"
109*b1cdbd2cSJim Jagielski "               </dd>\n"
110*b1cdbd2cSJim Jagielski "                <dd><br>\n"
111*b1cdbd2cSJim Jagielski "                  </dd>\n"
112*b1cdbd2cSJim Jagielski "                  </dl>\n"
113*b1cdbd2cSJim Jagielski "After the title, the bases and derivations of the class follow. <br>\n"
114*b1cdbd2cSJim Jagielski "Base classes are displayed as a graph. The text around base classes can appear\n"
115*b1cdbd2cSJim Jagielski "in different styles and colours:<br>\n"
116*b1cdbd2cSJim Jagielski "<ul>\n"
117*b1cdbd2cSJim Jagielski "  <li><span class=\"btpubl\">Green</span> - public inherited,</li>\n"
118*b1cdbd2cSJim Jagielski "  <li><span class=\"btprot\">Orange</span> - protected inherited,</li>\n"
119*b1cdbd2cSJim Jagielski "  <li><span class=\"btpriv\">Red</span> - private inherited,</li>\n"
120*b1cdbd2cSJim Jagielski "  <li><span class=\"btvpubl\">italic</span> - a (public inherited) virtual base class.</li>\n"
121*b1cdbd2cSJim Jagielski "  <li><span class=\"btself\">Bold and black</span> without a link - the placeholder\n"
122*b1cdbd2cSJim Jagielski "for the currently described class.<br>\n"
123*b1cdbd2cSJim Jagielski "  </li>\n"
124*b1cdbd2cSJim Jagielski "</ul>\n"
125*b1cdbd2cSJim Jagielski "There may be many derivations of a class, but only the known ones, which\n"
126*b1cdbd2cSJim Jagielski "are described within this document also, are listed.<br>\n"
127*b1cdbd2cSJim Jagielski "<br>\n"
128*b1cdbd2cSJim Jagielski "Below the derivations is a little table with some properties of the class:<br>\n"
129*b1cdbd2cSJim Jagielski "<ul>\n"
130*b1cdbd2cSJim Jagielski "  <li>virtual - the class owns at least one virtual method,</li>\n"
131*b1cdbd2cSJim Jagielski "  <li>abstract - the class owns at least one abstract method,</li>\n"
132*b1cdbd2cSJim Jagielski "  <li>interface - the class may or may be not abstract,\n"
133*b1cdbd2cSJim Jagielski "but it is intended by its author to be used only as an interface and never\n"
134*b1cdbd2cSJim Jagielski "to be instantiated,</li>\n"
135*b1cdbd2cSJim Jagielski "  <li>template - the class is a template class.<br>\n"
136*b1cdbd2cSJim Jagielski "  </li>\n"
137*b1cdbd2cSJim Jagielski "</ul>\n"
138*b1cdbd2cSJim Jagielski "Next comes further documentation of the class itself.<br>\n"
139*b1cdbd2cSJim Jagielski "<br>\n"
140*b1cdbd2cSJim Jagielski "Lastly, there are listed all members of the class. Public members come first,\n"
141*b1cdbd2cSJim Jagielski "then protected, at last the private ones.<br>\n"
142*b1cdbd2cSJim Jagielski "All member lists are accessible by the lower navigationbars on top of the\n"
143*b1cdbd2cSJim Jagielski "page.<br>\n"
144*b1cdbd2cSJim Jagielski "\n"
145*b1cdbd2cSJim Jagielski "<h3 class=\"help\">Macros and Defines</h3>\n"
146*b1cdbd2cSJim Jagielski "In C++ and C, there are also program constructs, which do not fit into the\n"
147*b1cdbd2cSJim Jagielski "name tree, because they are #define'd: macros and definitions.<br>\n"
148*b1cdbd2cSJim Jagielski "These may be documented, too. Those comments you find <a href=\"def-all.html\">\n"
149*b1cdbd2cSJim Jagielski "here</a>\n"
150*b1cdbd2cSJim Jagielski " or from the \"Overview\" start page.\n"
151*b1cdbd2cSJim Jagielski "<h3 class=\"help\">Links to IDL-Documentation</h3>\n"
152*b1cdbd2cSJim Jagielski "Some types, which appear as links, may refer to classes, enums or other\n"
153*b1cdbd2cSJim Jagielski "entities, which are direct mappings of UNO-IDL entities.<br>\n"
154*b1cdbd2cSJim Jagielski "In those cases the link doesn't lead to the C++ class, enum or whatever,\n"
155*b1cdbd2cSJim Jagielski "but to the description of the IDL entity.\n"
156*b1cdbd2cSJim Jagielski "<h3 class=\"help\">How to Link From Extern Documents</h3>\n"
157*b1cdbd2cSJim Jagielski "If you wish to write an extern html document, which links to types within\n"
158*b1cdbd2cSJim Jagielski "this C++ reference, you can do so, if your links have the following format:<br>\n"
159*b1cdbd2cSJim Jagielski "<br>\n"
160*b1cdbd2cSJim Jagielski "&lt;RootDirectory-of-this-Document&gt;/names/&lt;Namespace-A&gt;/&lt;Namespace-XY&gt;/EnclosingClass-nn&gt;/&lt;TypePreFix&gt;-&lt;MyTypeName&gt;.html<br>\n"
161*b1cdbd2cSJim Jagielski "<br>\n"
162*b1cdbd2cSJim Jagielski "&lt;TypePreFix&gt; can have the following values:<br>\n"
163*b1cdbd2cSJim Jagielski "<ul>\n"
164*b1cdbd2cSJim Jagielski "<li>c - class, struct or union</li>\n"
165*b1cdbd2cSJim Jagielski "<li>e - enum</li>\n"
166*b1cdbd2cSJim Jagielski "<li>t - typedef</li>\n"
167*b1cdbd2cSJim Jagielski "</ul>\n"
168*b1cdbd2cSJim Jagielski "If this document would be located in directory &nbsp;\"/doc/cpp/ref\", examples\n"
169*b1cdbd2cSJim Jagielski "would look like this:<br>\n"
170*b1cdbd2cSJim Jagielski "<br>\n"
171*b1cdbd2cSJim Jagielski "&lt;a href=\"/doc/cpp/ref/names/osl/c-File.html\"&gt;class File&lt;/a&gt;<br>\n"
172*b1cdbd2cSJim Jagielski "&lt;a href=\"/doc/cpp/ref/names/osl/FileBase/e-RC.html\"&gt;enum FileBase::RC&lt;/a&gt;<br>\n"
173*b1cdbd2cSJim Jagielski "&lt;a href=\"/doc/cpp/ref/names/t-oslMutex.html\"&gt;typedef oslMutex&lt;/a&gt;<br>\n"
174*b1cdbd2cSJim Jagielski "<br>\n"
175*b1cdbd2cSJim Jagielski "Namespaces are described in the index.html file within their directory:<br>\n"
176*b1cdbd2cSJim Jagielski "<br>\n"
177*b1cdbd2cSJim Jagielski "&lt;a href=\"/doc/cpp/ref/names/cppu/index.html\"&gt;namespace cppu&lt;/a&gt;<br>\n"
178*b1cdbd2cSJim Jagielski "</div>" );
179*b1cdbd2cSJim Jagielski 
180*b1cdbd2cSJim Jagielski 
181*b1cdbd2cSJim Jagielski 
182*b1cdbd2cSJim Jagielski 
PageMaker_Help(PageDisplay & io_rPage)183*b1cdbd2cSJim Jagielski PageMaker_Help::PageMaker_Help( PageDisplay & io_rPage )
184*b1cdbd2cSJim Jagielski     :   SpecializedPageMaker(io_rPage),
185*b1cdbd2cSJim Jagielski         pNavi(0)
186*b1cdbd2cSJim Jagielski {
187*b1cdbd2cSJim Jagielski }
188*b1cdbd2cSJim Jagielski 
~PageMaker_Help()189*b1cdbd2cSJim Jagielski PageMaker_Help::~PageMaker_Help()
190*b1cdbd2cSJim Jagielski {
191*b1cdbd2cSJim Jagielski }
192*b1cdbd2cSJim Jagielski 
193*b1cdbd2cSJim Jagielski void
MakePage()194*b1cdbd2cSJim Jagielski PageMaker_Help::MakePage()
195*b1cdbd2cSJim Jagielski {
196*b1cdbd2cSJim Jagielski     pNavi = new NavigationBar( Env(), NavigationBar::LOC_Help );
197*b1cdbd2cSJim Jagielski     Write_NavBar();
198*b1cdbd2cSJim Jagielski 
199*b1cdbd2cSJim Jagielski     Write_TopArea();
200*b1cdbd2cSJim Jagielski     Write_DocuArea();
201*b1cdbd2cSJim Jagielski }
202*b1cdbd2cSJim Jagielski 
203*b1cdbd2cSJim Jagielski void
Write_NavBar()204*b1cdbd2cSJim Jagielski PageMaker_Help::Write_NavBar()
205*b1cdbd2cSJim Jagielski {
206*b1cdbd2cSJim Jagielski     pNavi->Write( CurOut() );
207*b1cdbd2cSJim Jagielski     CurOut() << new HorizontalLine;
208*b1cdbd2cSJim Jagielski }
209*b1cdbd2cSJim Jagielski 
210*b1cdbd2cSJim Jagielski void
Write_TopArea()211*b1cdbd2cSJim Jagielski PageMaker_Help::Write_TopArea()
212*b1cdbd2cSJim Jagielski {
213*b1cdbd2cSJim Jagielski     adcdisp::PageTitle_Std fTitle;
214*b1cdbd2cSJim Jagielski     fTitle( CurOut(), "How to Use", "this Reference Document" );
215*b1cdbd2cSJim Jagielski 
216*b1cdbd2cSJim Jagielski     CurOut() << new xml::XmlCode(C_sHelpText);
217*b1cdbd2cSJim Jagielski }
218*b1cdbd2cSJim Jagielski 
219*b1cdbd2cSJim Jagielski void
Write_DocuArea()220*b1cdbd2cSJim Jagielski PageMaker_Help::Write_DocuArea()
221*b1cdbd2cSJim Jagielski {
222*b1cdbd2cSJim Jagielski     CurOut() << new HorizontalLine;
223*b1cdbd2cSJim Jagielski }
224*b1cdbd2cSJim Jagielski 
225*b1cdbd2cSJim Jagielski 
226*b1cdbd2cSJim Jagielski 
227