LCOV - code coverage report
Current view: top level - libreoffice/autodoc/source/display/html - cfrstd.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 32 43 74.4 %
Date: 2012-12-27 Functions: 9 13 69.2 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <precomp.h>
      21             : #include <cfrstd.hxx>
      22             : 
      23             : 
      24             : // NOT FULLY DEFINED SERVICES
      25             : #include <time.h>
      26             : 
      27             : 
      28             : /*                      CSS Styles
      29             :                         ----------
      30             : 
      31             : Colors:
      32             : -   light background color              #eeeeff
      33             : -   dark background color               #ccccff
      34             : -   self in navibar background color    #2222ad
      35             : 
      36             : 
      37             : Fonts:
      38             : -   page title              20, bold, Arial
      39             : -   navibar main            12, bold, Arial
      40             : -   navibar sub              8, Arial, small caps
      41             : -   attrtable title line     8, bold, Arial, small caps
      42             : -   attrtable value line     8, Arial small caps
      43             : 
      44             : -   namespace chain         13, bold
      45             : -   table title             13, bold
      46             : -   template line           13
      47             : 
      48             : -   member paragraph title  12, bold
      49             : 
      50             : -   docu paragraph title    11, bold
      51             : -   standard text           11
      52             : 
      53             : -   hierarchy               11, monospace
      54             : 
      55             : 
      56             : classes:
      57             : 
      58             :     td.title                page title
      59             :     h3                      table title
      60             :     h4                      member paragraph title
      61             : 
      62             :     td.nmain                navigation main bar
      63             :     td.nsub                 navigation sub bar
      64             :     a.nmain                 links in navigation main bar
      65             :     a.nsub                  links in navigation sub bar
      66             : 
      67             :     td.attr1                attribute table head line
      68             :     td.attr2                attribute table value line
      69             : 
      70             :     p.namechain             namespace chain in head of pages
      71             :     p.tpl                   template line in head of pages
      72             : 
      73             :     pre.doc                 preformatted docu
      74             :     pre.hierarchy           class bases hierarchy graphic
      75             : 
      76             :     dl.syntax               function- or variable-declaration field
      77             :     a.syntax                link in function- or variable-declaration field
      78             : 
      79             :     p.dt                    docu paragraph title
      80             :     dl.dt                   docu paragraph title
      81             : 
      82             :     p                       standard text
      83             :     dl                      standard text
      84             :     dd                      standard text
      85             : */
      86             : 
      87             : 
      88             : #define CRLF "\n"
      89             : 
      90             : namespace
      91             : {
      92             : 
      93             : bool            bUse_OOoFrameDiv = true;
      94             : 
      95             : 
      96             : //***************   These are used for IDL currently only!   ********************
      97             : 
      98             : const char * const C_sStdStyle =
      99             :     "/*See bottom of file for explanations.*/" CRLF
     100             :     CRLF
     101             :     "body { background-color:#ffffff; }" CRLF
     102             :     CRLF
     103             :     "h3             { font-size:13pt; font-weight:bold;" CRLF
     104             :     "                 margin-top:3pt; margin-bottom:1pt; }" CRLF
     105             :     "p, dt, dd, pre { font-size:11pt;" CRLF
     106             :     "                 margin-top:3pt; margin-bottom:1pt; }" CRLF
     107             :     "pre            { font-family:monospace; }" CRLF
     108             :     CRLF
     109             :     "table.navimain { background-color:#eeeeff; }" CRLF
     110             :     "table.subtitle { margin-top:6pt; margin-bottom:6pt; }" CRLF
     111             :     CRLF
     112             :     "td             {                     font-size:11pt; }" CRLF
     113             :     "td.title       { font-family: Arial; font-size:19pt; font-weight:bold;" CRLF
     114             :     "                 line-height:30pt;   background-color:#ccccff; text-align:center; }" CRLF
     115             :     "td.subtitle    { font-family: Arial; font-size:13pt;" CRLF
     116             :     "                 line-height:20pt;   background-color:#ccccff; }" CRLF
     117             :     "td.crosstitle  {                     font-size:12pt; font-weight:bold;" CRLF
     118             :     "                 line-height:15pt;   background-color:#eeeeff; }" CRLF
     119             :     "td.imdetail    { width:100%;         background-color:#eeeeff; }" CRLF
     120             :     CRLF
     121             :     "td.imsum_left  { width:30%;  }" CRLF
     122             :     "td.imsum_right { width:70%;  }" CRLF
     123             :     CRLF
     124             :     "td.navimain, a.navimain" CRLF
     125             :     "                   { text-align:center; font-family: Arial; font-size:12pt; font-weight:bold; }" CRLF
     126             :     "td.navimainself    { text-align:center; font-family: Arial; font-size:12pt; font-weight:bold;" CRLF
     127             :     "                     color:#ffffff; background-color:#2222ad; }" CRLF
     128             :     "td.navimainnone    { text-align:center; font-family: Arial; font-size:12pt; }" CRLF
     129             :     "td.navisub, a.navisub" CRLF
     130             :     "                   { text-align:center; font-family: Arial; font-size:9pt; font-variant:small-caps; }" CRLF
     131             :     "td.navimain, td.navisub" CRLF
     132             :     "                   { padding-left:7pt; padding-right:7pt; }" CRLF
     133             :     CRLF
     134             :     "a.membertitle  { font-size:12pt; font-weight:bold; line-height:18pt; }" CRLF
     135             :     "a.navimain, a.navisub  { color:#000000; }" CRLF
     136             :     ".dt            { font-weight:bold; }" CRLF
     137             :     ".namechain     { font-size:13pt; font-weight:bold;" CRLF
     138             :     "                 margin-top:3pt; margin-bottom:6pt; }" CRLF
     139             :     ".title2        { font-size:13pt; font-style:italic; font-weight:bold; text-align:left; }" CRLF
     140             :     ;
     141             : 
     142             : 
     143             : const char * const C_sCssExplanations =
     144             :     "/* Explanation of CSS classes:" CRLF
     145             :     CRLF
     146             :     ".navimain          Text in main navigation bar." CRLF
     147             :     ".navisub           Text in lower navigation bar." CRLF
     148             :     "td.navimainself    Cell in main navigation bar with \"selected\" shadow: You are here." CRLF
     149             :     "td.navimainnone    Cell in main navigation bar with no link." CRLF
     150             :     CRLF
     151             :     ".namechain         Line with current module path." CRLF
     152             :     CRLF
     153             :     "td.crosstitle      Comment box for bases (base interfaces etc.)" CRLF
     154             :     "td.imsum_left      Left part of such boxes." CRLF
     155             :     "td.imsum_right     Right part of such boxes." CRLF
     156             :     CRLF
     157             :     "td.title           Main title of the page like \"interface XYz\"" CRLF
     158             :     ".subtitle          Tables, and head cells of those, which list members" CRLF
     159             :     "                   like \"method summary\" and \"method details\"." CRLF
     160             :     CRLF
     161             :     "td.imdetail        Background table of method's detail description." CRLF
     162             :     "a.membertitle      Method name (as jump label) in method's detail" CRLF
     163             :     "                   description." CRLF
     164             :     ".title2            smaller font prefixes to page titles" CRLF
     165             :     "*/" CRLF
     166             :     ;
     167             : 
     168             : const char * const C_sStdStyle_withDivFrame =
     169             :     "/*See bottom of file for explanations.*/" CRLF
     170             :     CRLF
     171             :     "body { background-color:#ffffff; }" CRLF
     172             :     CRLF
     173             :     "#adc-idlref h3 { font-size:13pt; font-weight:bold;" CRLF
     174             :     "                 margin-top:3pt; margin-bottom:1pt; }" CRLF
     175             :     "#adc-idlref p, #adc-idlref dt, #adc-idlref dd, #adc-idlref pre" CRLF
     176             :     "               { font-size:11pt;" CRLF
     177             :     "                 margin-top:3pt; margin-bottom:1pt; }" CRLF
     178             :     "#adc-idlref pre    { font-family:monospace; }" CRLF
     179             :     CRLF
     180             :     "#adc-idlref table.navimain { background-color:#eeeeff; }" CRLF
     181             :     "#adc-idlref table.subtitle { margin-top:6pt; margin-bottom:6pt; }" CRLF
     182             :     CRLF
     183             :     "#adc-idlref td             { font-size:11pt; }" CRLF
     184             :     "#adc-idlref td.title       { font-family: Arial; font-size:19pt; font-weight:bold;" CRLF
     185             :     "                             line-height:30pt;   background-color:#ccccff; text-align:center; }" CRLF
     186             :     "#adc-idlref td.subtitle    { font-family: Arial; font-size:13pt;" CRLF
     187             :     "                             line-height:20pt;   background-color:#ccccff; }" CRLF
     188             :     "#adc-idlref td.crosstitle  { font-size:12pt; font-weight:bold;" CRLF
     189             :     "                             line-height:15pt;   background-color:#eeeeff; }" CRLF
     190             :     "#adc-idlref td.imdetail    { width:100%;         background-color:#eeeeff; }" CRLF
     191             :     CRLF
     192             :     "#adc-idlref td.imsum_left  { width:30%;  }" CRLF
     193             :     "#adc-idlref td.imsum_right { width:70%;  }" CRLF
     194             :     CRLF
     195             :     "#adc-idlref td.navimain, #adc-idlref a.navimain" CRLF
     196             :     "                   { text-align:center; font-family: Arial; font-size:12pt; font-weight:bold; }" CRLF
     197             :     "#adc-idlref td.navimainself    { text-align:center; font-family: Arial; font-size:12pt; font-weight:bold;" CRLF
     198             :     "                                 color:#ffffff; background-color:#2222ad; }" CRLF
     199             :     "#adc-idlref td.navimainnone    { text-align:center; font-family: Arial; font-size:12pt; }" CRLF
     200             :     "#adc-idlref td.navisub, #adc-idlref a.navisub" CRLF
     201             :     "                   { text-align:center; font-family: Arial; font-size:9pt; font-variant:small-caps; }" CRLF
     202             :     "#adc-idlref td.navimain, #adc-idlref td.navisub" CRLF
     203             :     "                   { padding-left:7pt; padding-right:7pt; }" CRLF
     204             :     CRLF
     205             :     "#adc-idlref a.membertitle  { font-size:12pt; font-weight:bold; line-height:18pt; }" CRLF
     206             :     "#adc-idlref a.navimain, #adc-idlref a.navisub  { color:#000000; }" CRLF
     207             :     "#adc-idlref .dt            { font-weight:bold; }" CRLF
     208             :     "#adc-idlref .namechain     { font-size:13pt; font-weight:bold;" CRLF
     209             :     "                             margin-top:3pt; margin-bottom:6pt; }" CRLF
     210             :     "#adc-idlref .title2        { font-size:13pt; font-style:italic; font-weight:bold; text-align:left; }" CRLF
     211             :     "" CRLF
     212             :     "#adc-idlref table { empty-cells:show; }" CRLF
     213             :     "" CRLF
     214             :     "#adc-idlref .childlist td, " CRLF
     215             :     "#adc-idlref .commentedlinks td, " CRLF
     216             :     "#adc-idlref .memberlist td, " CRLF
     217             :     "#adc-idlref .subtitle td, " CRLF
     218             :     "#adc-idlref .crosstitle td  { border: .1pt solid #000000; }" CRLF
     219             :     "" CRLF
     220             :     "#adc-idlref .flag-table td { border: .1pt solid #cccccc; } " CRLF
     221             :     "" CRLF
     222             :     "#adc-idlref .title-table td, " CRLF
     223             :     "#adc-idlref .table-in-method td, " CRLF
     224             :     "#adc-idlref .table-in-data td, " CRLF
     225             :     "#adc-idlref .navimain td, " CRLF
     226             :     "#adc-idlref .navisub td, " CRLF
     227             :     "#adc-idlref .expl-table td, " CRLF
     228             :     "#adc-idlref .param-table td  { border: none; }" CRLF
     229             :     ;
     230             : 
     231             : 
     232             : }   // anonymous namespace
     233             : 
     234             : 
     235           1 : StdFrame::StdFrame()
     236             :     :   sDevelopersGuideHtmlRoot(),
     237           1 :         bSimpleLinks(false)
     238             : {
     239           1 : }
     240             : 
     241             : DYN Html_Image *
     242           0 : StdFrame::LogoSrc() const
     243             : {
     244           0 :     return 0;
     245             : 
     246             : //    return  new Html_Image( "logodot-blu.gif",
     247             : //                            "109",
     248             : //                            "54",
     249             : //                            "RIGHT",
     250             : //                            "0",
     251             : //                            "OpenOffice" );
     252             : 
     253             : }
     254             : 
     255             : const char *
     256           0 : StdFrame::LogoLink() const
     257             : {
     258           0 :     return "";
     259             : //  return "http://www.sun.com";
     260             : //  return "http://www.openoffice.org";
     261             : }
     262             : 
     263             : 
     264             : String              MakeCopyRight();
     265             : 
     266             : const char *
     267           1 : StdFrame::CopyrightText() const
     268             : {
     269           1 :     static String sCopyRight_( MakeCopyRight() );
     270           1 :     return sCopyRight_.c_str();
     271             : }
     272             : 
     273             : const char *
     274           1 : StdFrame::CssStyle() const
     275             : {
     276           1 :     if (bUse_OOoFrameDiv)
     277           1 :         return C_sStdStyle_withDivFrame;
     278             :     else
     279           0 :         return C_sStdStyle;
     280             : }
     281             : 
     282             : const char *
     283           1 : StdFrame::CssStylesExplanation() const
     284             : {
     285           1 :     return C_sCssExplanations;
     286             : }
     287             : 
     288             : const char *
     289        3873 : StdFrame::DevelopersGuideHtmlRoot() const
     290             : {
     291        3873 :     return sDevelopersGuideHtmlRoot;
     292             : }
     293             : 
     294             : bool
     295           0 : StdFrame::SimpleLinks() const
     296             : {
     297           0 :     return bSimpleLinks;
     298             : }
     299             : 
     300             : void
     301           1 : StdFrame::Set_DevelopersGuideHtmlRoot( const String & i_directory )
     302             : {
     303           1 :     if (NOT i_directory.empty())
     304             :     {
     305           1 :         if (i_directory.char_at(i_directory.length()-1) == '/')
     306             :         {
     307           0 :             sDevelopersGuideHtmlRoot.assign(i_directory,i_directory.length()-1);
     308           1 :             return;
     309             :         }
     310             :     }
     311           1 :     sDevelopersGuideHtmlRoot = i_directory;
     312             : }
     313             : 
     314             : void
     315           0 : StdFrame::Set_SimpleLinks()
     316             : {
     317           0 :     bSimpleLinks = true;
     318           0 : }
     319             : 
     320             : String
     321           1 : MakeCopyRight()
     322             : {
     323           1 :     StreamStr cr(1400);
     324             :     time_t
     325             :         gt;
     326           1 :     time(&gt);
     327             :     tm *
     328           1 :         plt = localtime(&gt);
     329           1 :     int year = 1900 + plt->tm_year;
     330             : 
     331           1 :     cr  << "Copyright &copy; 2000, "
     332           1 :         << year
     333           1 :         << " LibreOffice contributors and/or their affiliates. All rights reserved.</p>"
     334           1 :         << "<p class=\"copyright\" align=\"center\">LibreOffice was created by The Document Foundation, based on OpenOffice.org, which is Copyright 2000, 2010 Oracle and/or its affiliates.</p>"
     335           1 :         << "<p class=\"copyright\" align=\"center\">The Document Foundation acknowledges all community members, please find more info <a href=\"http://www.libreoffice.org/about-us/credits/\" target=\"_blank\">at our website</a>."
     336           1 :         << "<p>&nbsp;</p>"
     337           1 :         << "<p class=\"copyright\" align=\"center\"><a href=\"http://www.documentfoundation.org/privacy\" target=\"_blank\">Privacy Policy</a> | <a href=\"http://www.documentfoundation.org/imprint\" target=\"_blank\">Impressum (Legal Info)</a> | Copyright information: The source code of LibreOffice is licensed under the GNU Lesser General Public License (<a href=\"http://www.libreoffice.org/download/license/\" target=\"_blank\">LGPLv3</a>). \"LibreOffice\" and \"The Document Foundation\" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our <a href=\"http://wiki.documentfoundation.org/TradeMark_Policy\" target=\"_blank\">trademark policy</a>.";
     338           1 :     return String(cr.c_str());
     339             : 
     340           3 : }
     341             : 
     342             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10