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