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