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