summaryrefslogtreecommitdiffstats
path: root/autodoc/source/display/html/pm_help.cxx
blob: ed482cedbc4fe2d472cf1c5fce4dab91e4d7ef94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
/*************************************************************************
 *
 *  $RCSfile: pm_help.cxx,v $
 *
 *  $Revision: 1.1.1.1 $
 *
 *  last change: $Author: np $ $Date: 2002-03-08 14:45:24 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2000
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2000 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (the "License"); You may not use this file
 *  except in compliance with the License. You may obtain a copy of the
 *  License at http://www.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2000 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/


#include <precomp.h>
#include "pm_help.hxx"


// NOT FULLY DEFINED SERVICES
#include "navibar.hxx"
#include "html_kit.hxx"

using namespace csi;
using csi::html::Paragraph;
using csi::html::HorizontalLine;
using csi::html::Headline;
using csi::html::AlignAttr;
using csi::html::Bold;
using csi::html::Link;
using csi::html::Sbr;
using csi::html::LineBreak;
using csi::xml::Element;



const udmstri C_sHelpText(
"<div style=\"font-size:10pt;\">\n"
"<h3 style=\"background-color: rgb(238,238,255); \">The Main Navigationbar</h3>\n"
"<p> On top of every page, there is a main navigationbar on a lightly coloured\n"
"background with the following items:<br>\n"
"</p>\n"
"<ul>\n"
"  <li>Overview - the start page for this document,</li>\n"
"  <li>Namespace - the lowest/deepest namespace of the language objects, described\n"
"on the current page,</li>\n"
"  <li>Class - the class, struct or union, which owns the methods or data,\n"
"described on the current page,</li>\n"
"  <li>Index - the global alphabetical index,</li>\n"
"  <li>Help - this page.</li>\n"
"</ul>\n"
" Each item in this&nbsp; bar can be in three different states:<br>\n"
"<ul>\n"
"  <li>Link - the item is valid and you can get there,</li>\n"
"  <li>Simple - the item does not apply (if this page described a namespace,\n"
"there would be no owning class),</li>\n"
"  <li>Reversed (white text on dark background) - this is the current page.</li>\n"
"</ul>\n"
"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">Lower Navigationbars</h3>\n"
" Just below the main navigation bar, there may be zero to three lower navigationbars\n"
"on white background.<br>\n"
"<br>\n"
"Their items are dependent of the context, but they always link to paragraphs\n"
"on the same, current page.<br>\n"
"Available items appear as links. Unavailable items appear as simple text.<br>\n"
"\n"
"\n"
"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">Namespace Descriptions</h3>\n"
"\n"
"<dl>\n"
"<dt class=\"simple\">Parent namespaces</dt>\n"
"  </dl>\n"
"  <dl>\n"
"  <dd>In front of the namespace title, there is a linked list of the parent\n"
"namespaces. The global namespace is linked with the first \"::\",</dd>\n"
"    <dd>the namespaces between the global and the current one are linked\n"
"by their names.<br>\n"
"      </dd>\n"
"      <dd> </dd>\n"
"        </dl>\n"
"After the title, the documentation of the namespace follows (which is often\n"
"missing, because the namespace name may be self-explaining).<br>\n"
"        <br>\n"
"Below are the lists of nested namspaces and of the classes, functions and\n"
"other program objects, that belong within this namespace.<br>\n"
"Each of this lists is accessible by the lower navigationbar on top of the\n"
"page.<br>\n"
"\n"
"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">Class Descriptions</h3>\n"
"\n"
"        <dl>\n"
"        <dt class=\"simple\">Parent namespaces and classes</dt>\n"
"          </dl>\n"
"          <dl>\n"
"          <dd>In front of the class title, there is a linked list of the\n"
"parent namespaces or classes. The global namespace is linked with the first\n"
"\"::\",</dd>\n"
"            <dd>the namespaces between the global and the current one are\n"
"linked by their names. Parent classes are linked as well, but appear in <font color=\"#33cc00\">\n"
"green</font> color.&nbsp;</dd>\n"
"              <dd>So you see on the first glance, that this is a parent class,\n"
"no namespace.<br>\n"
"               </dd>\n"
"                <dd><br>\n"
"                  </dd>\n"
"                  </dl>\n"
"After the title, the bases and derivations of the class follow. <br>\n"
"Base classes are displayed as a graph. The text around base classes can appear\n"
"in different styles and colours:<br>\n"
"<ul>\n"
"  <li><font color=\"#33ff33\">Green</font> - public inherited,</li>\n"
"  <li><font color=\"#ffcc00\">Orange</font> - protected inherited,</li>\n"
"  <li><font color=\"#ff0000\">Red </font>-&nbsp;private inherited,</li>\n"
"  <li><font color=\"#33ff33\"><i>italic </i></font>- a (public inherited) virtual base class.</li>\n"
"  <li><b>Bold and black</b> without a link - the placeholder\n"
"for the currently described class.<br>\n"
"  </li>\n"
"</ul>\n"
"There may be many derivations of a class, but only the known ones, which\n"
"are described within this document also, are listed.<br>\n"
"<br>\n"
"Below the derivations is a little table with some properties of the class:<br>\n"
"<ul>\n"
"  <li>virtual - the class owns at least one virtual method,</li>\n"
"  <li>abstract - the class owns at least one abstract method,</li>\n"
"  <li>interface - the class may or may be not abstract,\n"
"but it is intended by its author to be used only as an interface and never\n"
"to be instantiated,</li>\n"
"  <li>template - the class is a template class.<br>\n"
"  </li>\n"
"</ul>\n"
"Next comes further documentation of the class itself.<br>\n"
"<br>\n"
"Lastly, there are listed all members of the class. Public members come first,\n"
"then protected, at last the private ones.<br>\n"
"All member lists are accessible by the lower navigationbars on top of the\n"
"page.<br>\n"
"\n"
"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">Macros\n"
"and Defines</h3>\n"
"In C++ and C, there are also program constructs, which do not fit into the\n"
"name tree, because they are #define'd: macros and definitions.<br>\n"
"These may be documented, too. Those comments you find <a href=\"def-all.html\">\n"
"here</a>\n"
" or from the \"Overview\" start page.\n"
"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">Links\n"
"to IDL-Documentation</h3>\n"
"Some types, which appear as links, may refer to classes, enums or other\n"
"entities, which are direct mappings of UNO-IDL entities.<br>\n"
"In those cases the link doesn't lead to the C++ class, enum or whatever,\n"
"but to the description of the IDL entity.\n"
"<h3 style=\"background-color: rgb(238,238,255); margin-top:12pt;\">How to\n"
"Link From Extern Documents</h3>\n"
"If you wish to write an extern html document, which links to types within\n"
"this C++ reference, you can do so, if your links have the following format:<br>\n"
"<br>\n"
"&lt;RootDirectory-of-this-Document&gt;/names/&lt;Namespace-A&gt;/&lt;Namespace-XY&gt;/ParentClass-nn&gt;/&lt;TypePreFix&gt;-&lt;MyTypeName&gt;.html<br>\n"
"<br>\n"
"&lt;TypePreFix&gt; can have the following values:<br>\n"
"<ul>\n"
"<li>c - class, struct or union</li>\n"
"<li>e - enum</li>\n"
"<li>t - typedef</li>\n"
"</ul>\n"
"If this document would be located in directory &nbsp;\"/doc/cpp/ref\", examples\n"
"would look like this:<br>\n"
"<br>\n"
"&lt;a href=\"/doc/cpp/ref/names/osl/c-File.html\"&gt;class File&lt;/a&gt;<br>\n"
"&lt;a href=\"/doc/cpp/ref/names/osl/FileBase/e-RC.html\"&gt;enum FileBase::RC&lt;/a&gt;<br>\n"
"&lt;a href=\"/doc/cpp/ref/names/t-oslMutex.html\"&gt;typedef oslMutex&lt;/a&gt;<br>\n"
"<br>\n"
"Namespaces are described in the index.html file within their directory:<br>\n"
"<br>\n"
"&lt;a href=\"/doc/cpp/ref/names/cppu/index.html\"&gt;namespace cppu&lt;/a&gt;<br>\n"
"</div>" );




PageMaker_Help::PageMaker_Help( PageDisplay & io_rPage )
    :   SpecializedPageMaker(io_rPage),
        pNavi(0)
{
}

PageMaker_Help::~PageMaker_Help()
{
}

void
PageMaker_Help::MakePage()
{
    pNavi = new NavigationBar( Env(), NavigationBar::LOC_Help );
    Write_NavBar();

    Write_TopArea();
    Write_DocuArea();
}

void
PageMaker_Help::Write_NavBar()
{
    pNavi->Write( CurOut() );
    CurOut() << new HorizontalLine;
}

void
PageMaker_Help::Write_TopArea()
{
    adcdisp::PageTitle_Std fTitle;
    fTitle( CurOut(), "How to Use", "this Reference Document" );

    CurOut() << new xml::XmlCode(C_sHelpText);
}

void
PageMaker_Help::Write_DocuArea()
{
    CurOut() << new HorizontalLine;
}