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