1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pm_help.cxx,v $
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 ************************************************************************/
32 #include "pm_help.hxx"
35 // NOT FULLY DEFINED SERVICES
36 #include "navibar.hxx"
37 #include "html_kit.hxx"
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
;
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"
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"
67 " Each item in this bar can be in three different states:<br>\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"
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"
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"
83 "<h3 class=\"help\">Namespace Descriptions</h3>\n"
86 "<dt class=\"simple\">Parent namespaces</dt>\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"
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"
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"
104 "<h3 class=\"help\">Class Descriptions</h3>\n"
107 " <dt class=\"simple\">Parent namespaces and classes</dt>\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"
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. </dd>\n"
116 " <dd>So you see on the first glance, that this is a parent class,\n"
117 "no namespace.<br>\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"
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"
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"
137 "Below the derivations is a little table with some properties of the class:<br>\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"
147 "Next comes further documentation of the class itself.<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"
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"
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"
169 "<RootDirectory-of-this-Document>/names/<Namespace-A>/<Namespace-XY>/EnclosingClass-nn>/<TypePreFix>-<MyTypeName>.html<br>\n"
171 "<TypePreFix> can have the following values:<br>\n"
173 "<li>c - class, struct or union</li>\n"
174 "<li>e - enum</li>\n"
175 "<li>t - typedef</li>\n"
177 "If this document would be located in directory \"/doc/cpp/ref\", examples\n"
178 "would look like this:<br>\n"
180 "<a href=\"/doc/cpp/ref/names/osl/c-File.html\">class File</a><br>\n"
181 "<a href=\"/doc/cpp/ref/names/osl/FileBase/e-RC.html\">enum FileBase::RC</a><br>\n"
182 "<a href=\"/doc/cpp/ref/names/t-oslMutex.html\">typedef oslMutex</a><br>\n"
184 "Namespaces are described in the index.html file within their directory:<br>\n"
186 "<a href=\"/doc/cpp/ref/names/cppu/index.html\">namespace cppu</a><br>\n"
192 PageMaker_Help::PageMaker_Help( PageDisplay
& io_rPage
)
193 : SpecializedPageMaker(io_rPage
),
198 PageMaker_Help::~PageMaker_Help()
203 PageMaker_Help::MakePage()
205 pNavi
= new NavigationBar( Env(), NavigationBar::LOC_Help
);
213 PageMaker_Help::Write_NavBar()
215 pNavi
->Write( CurOut() );
216 CurOut() << new HorizontalLine
;
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
);
229 PageMaker_Help::Write_DocuArea()
231 CurOut() << new HorizontalLine
;