LCOV - code coverage report
Current view: top level - libreoffice/autodoc/source/display/inc/toolkit - htmlfactory.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 9 9 100.0 %
Date: 2012-12-27 Functions: 7 7 100.0 %
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             : #ifndef ADC_DISPLAY_HTMLFACTORY_HXX
      21             : #define ADC_DISPLAY_HTMLFACTORY_HXX
      22             : 
      23             : 
      24             : 
      25             : // USED SERVICES
      26             :     // BASE CLASSES
      27             :     // COMPONENTS
      28             : #include "outputstack.hxx"
      29             :     // PARAMETERS
      30             : #include <udm/xml/xmlitem.hxx>
      31             : #include <udm/html/htmlitem.hxx>
      32             : 
      33             : namespace Xml = ::csi::xml;
      34             : namespace Html = ::csi::html;
      35             : 
      36             : /** @resp
      37             :     Base class for HTML page creators (factories) for code entites or
      38             :     similar items.
      39             : */
      40             : template <class ENV>
      41             : class HtmlFactory
      42             : {
      43             :   public:
      44             :     // INQUIRY
      45      808420 :     ENV &               Env() const             { return *pEnv; }
      46     1821889 :     Xml::Element &      CurOut() const          { return aDestination.Out(); }
      47             : 
      48             :     // ACCESS
      49      172435 :     OutputStack &       Out() const             { return aDestination; }
      50             : 
      51             :   protected:
      52      170566 :                         HtmlFactory(
      53             :                             ENV &               io_rEnv,
      54             :                             Xml::Element *      o_pOut = 0 )
      55      170566 :                             :   pEnv(&io_rEnv)  { if (o_pOut != 0) aDestination.Enter(*o_pOut); }
      56      170566 :                         ~HtmlFactory() {}
      57             :   private:
      58             :     // DATA
      59             :     ENV *               pEnv;
      60             :     mutable OutputStack aDestination;
      61             : };
      62             : 
      63             : 
      64             : /** @resp
      65             :     Base class for HTML paragraph creators, which are to be put into
      66             :     a parent HTML element.
      67             : */
      68             : class HtmlMaker
      69             : {
      70             :   public:
      71             : 
      72             :     // INQUIRY
      73      265727 :     Xml::Element &      CurOut() const          { return *pOut; }
      74             : 
      75             :   protected:
      76      105433 :                         HtmlMaker(
      77             :                             Xml::Element &      o_rOut )
      78      105433 :                             :   pOut(&o_rOut)   {}
      79             :   private:
      80             :     // DATA
      81             :     Xml::Element *      pOut;
      82             : };
      83             : 
      84             : 
      85             : 
      86             : 
      87             : // IMPLEMENTATION
      88             : 
      89             : 
      90             : 
      91             : 
      92             : #endif
      93             : 
      94             : 
      95             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10