LCOV - code coverage report
Current view: top level - libreoffice/idl/inc - object.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 25 31 80.6 %
Date: 2012-12-27 Functions: 30 35 85.7 %
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 _OBJECT_HXX
      21             : #define _OBJECT_HXX
      22             : 
      23             : #include <types.hxx>
      24             : #include <slot.hxx>
      25             : #include <vector>
      26             : 
      27        5509 : struct SvSlotElement
      28             : {
      29             :     SvMetaSlotRef   xSlot;
      30             :     rtl::OString aPrefix;
      31        5509 :     SvSlotElement( SvMetaSlot * pS, const rtl::OString& rPrefix )
      32             :     : xSlot( pS )
      33        5509 :     , aPrefix( rPrefix )
      34             :     {
      35        5509 :     }
      36             : };
      37             : typedef std::vector< SvSlotElement* > SvSlotElementList;
      38             : 
      39             : class SvMetaClass;
      40             : typedef ::std::vector< SvMetaClass* > SvMetaClassList;
      41             : 
      42        6893 : SV_DECL_REF(SvMetaClass)
      43         224 : class SvClassElement : public SvPersistBase
      44             : {
      45             :     SvBOOL                      aAutomation;
      46             :     rtl::OString                aPrefix;
      47             :     SvMetaClassRef              xClass;
      48             : public:
      49         120 :             SV_DECL_PERSIST1( SvClassElement, SvPersistBase, 1 )
      50             :             SvClassElement();
      51             : 
      52           7 :     void            SetPrefix( const rtl::OString& rPrefix )
      53           7 :                     { aPrefix = rPrefix; }
      54         325 :     const rtl::OString&  GetPrefix() const
      55         325 :                     { return aPrefix; }
      56             : 
      57          61 :     void            SetAutomation( sal_Bool rAutomation )
      58          61 :                     { aAutomation = rAutomation; }
      59         112 :     sal_Bool            GetAutomation() const
      60         112 :                     { return aAutomation; }
      61             : 
      62         112 :     void            SetClass( SvMetaClass * pClass )
      63         112 :                     { xClass = pClass; }
      64         132 :     SvMetaClass *   GetClass() const
      65         132 :                     { return xClass; }
      66             : };
      67             : 
      68         516 : SV_DECL_IMPL_REF(SvClassElement)
      69             : 
      70         388 : class SvClassElementMemberList : public SvDeclPersistList<SvClassElement *> {};
      71             : 
      72          32 : class SvMetaClassMemberList : public SvDeclPersistList<SvMetaClass *> {};
      73             : 
      74         388 : class SvMetaClass : public SvMetaType
      75             : {
      76             :     SvMetaAttributeMemberList   aAttrList;
      77             :     SvClassElementMemberList    aClassList;
      78             :     SvMetaClassRef              aSuperClass;
      79             :     SvBOOL                      aAutomation;
      80             :     SvMetaClassRef              xAutomationInterface;
      81             : 
      82             :     sal_Bool                TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInStm,
      83             :                                      SvMetaAttribute & rAttr ) const;
      84             :     void                WriteSlotStubs( const rtl::OString& rShellName,
      85             :                                         SvSlotElementList & rSlotList,
      86             :                                         ByteStringList & rList,
      87             :                                         SvStream & rOutStm );
      88             :     sal_uInt16              WriteSlotParamArray( SvIdlDataBase & rBase,
      89             :                                             SvSlotElementList & rSlotList,
      90             :                                             SvStream & rOutStm );
      91             :     sal_uInt16              WriteSlots( const rtl::OString& rShellName, sal_uInt16 nCount,
      92             :                                     SvSlotElementList & rSlotList,
      93             :                                     SvIdlDataBase & rBase,
      94             :                                     SvStream & rOutStm );
      95             : 
      96             :     void                InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>& rSuperList,
      97             :                                     SvMetaClassList & rClassList,
      98             :                                     const rtl::OString& rPrefix, SvIdlDataBase& rBase );
      99             : 
     100             : protected:
     101             :     virtual void    ReadAttributesSvIdl( SvIdlDataBase & rBase,
     102             :                                       SvTokenStream & rInStm );
     103             :     virtual void    WriteAttributesSvIdl( SvIdlDataBase & rBase,
     104             :                                     SvStream & rOutStm, sal_uInt16 nTab );
     105             :     virtual void    ReadContextSvIdl( SvIdlDataBase &,
     106             :                                      SvTokenStream & rInStm );
     107             :     virtual void    WriteContextSvIdl( SvIdlDataBase & rBase,
     108             :                                      SvStream & rOutStm, sal_uInt16 nTab );
     109             :     void            WriteOdlMembers( ByteStringList & rSuperList,
     110             :                                     sal_Bool bVariable, sal_Bool bWriteTab,
     111             :                                     SvIdlDataBase & rBase,
     112             :                                     SvStream & rOutStm, sal_uInt16 nTab );
     113             : public:
     114         628 :             SV_DECL_META_FACTORY1( SvMetaClass, SvMetaType, 6 )
     115             :             SvMetaClass();
     116             : 
     117           0 :     sal_Bool                GetAutomation() const
     118           0 :                         { return aAutomation; }
     119           0 :     SvMetaClass *       GetSuperClass() const
     120           0 :                         { return aSuperClass; }
     121             : 
     122             :     void                FillClasses( SvMetaClassList & rList );
     123             : 
     124             :     const SvClassElementMemberList&
     125           0 :                         GetClassList() const
     126           0 :                         { return aClassList; }
     127             : 
     128             :     virtual sal_Bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
     129             :     virtual void        WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
     130             :     virtual void        Write( SvIdlDataBase & rBase, SvStream & rOutStm,
     131             :                                  sal_uInt16 nTab,
     132             :                                   WriteType, WriteAttribute = 0 );
     133             :     virtual void        WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm );
     134             :     virtual void        WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
     135             :                                 HelpIdTable& rTable );
     136             : };
     137        1816 : SV_IMPL_REF(SvMetaClass)
     138             : 
     139             : 
     140             : #endif // _OBJECT_HXX
     141             : 
     142             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10