LCOV - code coverage report
Current view: top level - libreoffice/autodoc/source/display/idl - hfi_struct.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 65 65 100.0 %
Date: 2012-12-27 Functions: 8 9 88.9 %
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 "hfi_struct.hxx"
      22             : 
      23             : 
      24             : // NOT FULLY DEFINED SERVICES
      25             : #include <ary/idl/i_ce.hxx>
      26             : #include <ary/idl/i_struct.hxx>
      27             : #include <ary/idl/ik_exception.hxx>
      28             : #include <ary/idl/ik_struct.hxx>
      29             : #include <toolkit/hf_docentry.hxx>
      30             : #include <toolkit/hf_linachain.hxx>
      31             : #include <toolkit/hf_navi_sub.hxx>
      32             : #include <toolkit/hf_title.hxx>
      33             : #include "hfi_navibar.hxx"
      34             : #include "hfi_property.hxx"
      35             : #include "hfi_typetext.hxx"
      36             : #include "hi_linkhelper.hxx"
      37             : 
      38             : 
      39             : extern const String
      40           1 :     C_sCePrefix_Struct("struct");
      41             : extern const String
      42           1 :     C_sCePrefix_Exception("exception");
      43             : 
      44             : 
      45             : namespace
      46             : {
      47             : 
      48             : const String
      49           1 :     C_sBaseStruct("Base Hierarchy");
      50             : const String
      51           1 :     C_sBaseException("Base Hierarchy");
      52             : 
      53             : const String
      54           1 :     C_sList_Elements("Elements' Summary");
      55             : const String
      56           1 :     C_sList_Elements_Label("Elements");
      57             : 
      58             : const String
      59           1 :     C_sList_ElementDetails("Elements' Details");
      60             : const String
      61           1 :     C_sList_ElementDetails_Label("ElementDetails");
      62             : 
      63             : enum E_SubListIndices
      64             : {
      65             :     sli_ElementsSummary = 0,
      66             :     sli_ElementsDetails = 1
      67             : };
      68             : 
      69             : }   // anonymous namespace
      70             : 
      71             : 
      72             : 
      73         624 : HF_IdlStruct::HF_IdlStruct( Environment &         io_rEnv,
      74             :                             Xml::Element &        o_rOut,
      75             :                             bool                  i_bIsException )
      76             :     :   HtmlFactory_Idl(io_rEnv, &o_rOut),
      77         624 :         bIsException(i_bIsException)
      78             : {
      79         624 : }
      80             : 
      81         624 : HF_IdlStruct::~HF_IdlStruct()
      82             : {
      83         624 : }
      84             : 
      85             : void
      86         624 : HF_IdlStruct::Produce_byData( const client & i_ce ) const
      87             : {
      88             :     const ary::idl::Struct *
      89             :         pStruct =
      90             :             bIsException
      91             :                 ?   0
      92         624 :                 :   static_cast< const ary::idl::Struct* >(&i_ce);
      93             :     bool bIsTemplate =
      94             :             pStruct != 0
      95        1005 :                 ?   pStruct->TemplateParameterType().IsValid()
      96        1005 :                 :   false;
      97             : 
      98             :     Dyn<HF_NaviSubRow>
      99         624 :         pNaviSubRow( &make_Navibar(i_ce) );
     100             : 
     101             :     HF_TitleTable
     102         624 :         aTitle(CurOut());
     103             :     HF_LinkedNameChain
     104         624 :         aNameChain(aTitle.Add_Row());
     105             : 
     106         624 :     aNameChain.Produce_CompleteChain(Env().CurPosition(), nameChainLinker);
     107             : 
     108             :     // Title:
     109             :     StreamLock
     110         624 :         slAnnotations(200);
     111         624 :     get_Annotations(slAnnotations(), i_ce);
     112             : 
     113         624 :     StreamLock rTitle(200);
     114         624 :     if (bIsTemplate)
     115           3 :         rTitle() << "template ";
     116         624 :     rTitle()
     117             :         << (bIsException
     118             :             ?   C_sCePrefix_Exception
     119        1248 :             :   C_sCePrefix_Struct)
     120         624 :         << " "
     121        1248 :         << i_ce.LocalName();
     122         624 :     if (bIsTemplate)
     123             :     {
     124             :         csv_assert(pStruct != 0);
     125           3 :         rTitle()
     126           3 :             << "<"
     127           9 :             << pStruct->TemplateParameter()
     128           3 :             << ">";
     129             :     }
     130         624 :     aTitle.Produce_Title(slAnnotations().c_str(), rTitle().c_str());
     131             : 
     132             :     // Bases:
     133         624 :     produce_Bases( aTitle.Add_Row(),
     134             :                    i_ce,
     135             :                    bIsException
     136             :                     ?   C_sBaseException
     137        1248 :                     :   C_sBaseStruct );
     138             : 
     139             :     // Docu:
     140         624 :     write_Docu(aTitle.Add_Row(), i_ce);
     141         624 :     CurOut() << new Html::HorizontalLine();
     142             : 
     143             :     // Elements:
     144             :     dyn_ce_list
     145         624 :         dpElements;
     146         624 :     if (bIsException)
     147         243 :         ary::idl::ifc_exception::attr::Get_Elements(dpElements, i_ce);
     148             :     else
     149         381 :         ary::idl::ifc_struct::attr::Get_Elements(dpElements, i_ce);
     150             : 
     151         624 :     if ( (*dpElements).operator bool() )
     152             :     {
     153         476 :         produce_Members( *dpElements,
     154             :                          C_sList_Elements,
     155             :                          C_sList_Elements_Label,
     156             :                          C_sList_ElementDetails,
     157         476 :                          C_sList_ElementDetails_Label );
     158         476 :         pNaviSubRow->SwitchOn(sli_ElementsSummary);
     159         476 :         pNaviSubRow->SwitchOn(sli_ElementsDetails);
     160             :     }
     161         624 :     pNaviSubRow->Produce_Row();
     162         624 : }
     163             : 
     164             : HtmlFactory_Idl::type_id
     165        1150 : HF_IdlStruct::inq_BaseOf( const client & i_ce ) const
     166             : {
     167             :     return bIsException
     168             :                 ?   ary::idl::ifc_exception::attr::Base(i_ce)
     169        1150 :                 :   ary::idl::ifc_struct::attr::Base(i_ce);
     170             : }
     171             : 
     172             : HF_NaviSubRow &
     173         624 : HF_IdlStruct::make_Navibar( const client & i_ce ) const
     174             : {
     175             :     HF_IdlNavigationBar
     176         624 :         aNaviBar(Env(), CurOut());
     177         624 :     aNaviBar.Produce_CeMainRow(i_ce);
     178             : 
     179             :     DYN HF_NaviSubRow &
     180         624 :         ret = aNaviBar.Add_SubRow();
     181         624 :     ret.AddItem(C_sList_Elements, C_sList_Elements_Label, false);
     182         624 :     ret.AddItem(C_sList_ElementDetails, C_sList_ElementDetails_Label, false);
     183             : 
     184         624 :     CurOut() << new Html::HorizontalLine();
     185         624 :     return ret;
     186             : }
     187             : 
     188             : void
     189        1483 : HF_IdlStruct::produce_MemberDetails( HF_SubTitleTable &  o_table,
     190             :                                      const client &      i_ce) const
     191             : {
     192             :     HF_IdlStructElement
     193        1483 :         aElement( Env(), o_table );
     194        1483 :     aElement.Produce_byData(i_ce);
     195        1486 : }
     196             : 
     197             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10