LCOV - code coverage report
Current view: top level - rsc/inc - rscflag.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 9 14 64.3 %
Date: 2014-11-03 Functions: 7 9 77.8 %
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             : #ifndef INCLUDED_RSC_INC_RSCFLAG_HXX
      20             : #define INCLUDED_RSC_INC_RSCFLAG_HXX
      21             : 
      22             : #include <rscall.h>
      23             : #include <rscerror.h>
      24             : #include <rschash.hxx>
      25             : #include <rscconst.hxx>
      26             : 
      27             : /******************* R s c F l a g ***************************************/
      28        3771 : class RscFlag : public RscConst
      29             : {
      30             :     struct RscFlagInst
      31             :     {
      32             :         sal_uInt32  nFlags;
      33             :         sal_uInt32  nDfltFlags;
      34             :     };
      35             :     RSCINST         CreateBasic( RSCINST * pInst );
      36             : public:
      37             :                     RscFlag( Atom nId, sal_uInt32 nTypId );
      38             :     RSCINST         Create( RSCINST * pInst, const RSCINST & rDflt, bool ) SAL_OVERRIDE;
      39             :     RSCINST         CreateClient( RSCINST * pInst, const RSCINST & rDflt,
      40             :                                   bool bOwnClass, Atom nConsId );
      41             :     sal_uInt32      Size() SAL_OVERRIDE;
      42             : 
      43             :     virtual void    SetToDefault( const RSCINST & rInst ) SAL_OVERRIDE;
      44             :     bool            IsDefault( const RSCINST & rInst ) SAL_OVERRIDE;
      45             :     bool            IsDefault( const RSCINST & rInst, Atom nConstId );
      46             : 
      47             :                     // Ist das Flag gesetzt
      48             :     bool            IsSet( const RSCINST & rInst, Atom nConstId );
      49             : 
      50             :                     // Als Default setzen
      51             :     bool            IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) SAL_OVERRIDE;
      52             :     bool            IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef,
      53             :                                     Atom nConstId );
      54             : 
      55             :     ERRTYPE         SetConst( const RSCINST & rInst, Atom nValueId,
      56             :                               sal_Int32 nValue ) SAL_OVERRIDE;
      57             :     ERRTYPE         SetNotConst( const RSCINST & rInst, Atom nConstId ) SAL_OVERRIDE;
      58             :     void            WriteSrc( const RSCINST & rInst, FILE * fOutput,
      59             :                               RscTypCont * pTC, sal_uInt32 nTab, const char * ) SAL_OVERRIDE;
      60             :     ERRTYPE         WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
      61             :                              RscTypCont * pTC, sal_uInt32, bool bExtra ) SAL_OVERRIDE;
      62             : };
      63             : 
      64             : /******************* R s c C l i e n t ***********************************/
      65       77096 : class RscClient : public RscTop
      66             : {
      67             :     RscFlag *       pRefClass;  //Klasse die als Server benutzt wird
      68             :     Atom            nConstId;   //Id des zu setzenden Wertes
      69             : public:
      70             :                     RscClient( Atom nId, sal_uInt32 nTypId, RscFlag * pClass,
      71             :                                Atom nConstantId );
      72             :     virtual RSCCLASS_TYPE   GetClassType() const SAL_OVERRIDE;
      73             :     RSCINST         Create( RSCINST * pInst, const RSCINST & rDflt, bool ) SAL_OVERRIDE;
      74       38548 :     sal_uInt32      Size() SAL_OVERRIDE { return( pRefClass->Size() ); };
      75             : 
      76             :                     // Eine Zuweisung an eine Variable
      77           0 :     bool            IsDefault( const RSCINST & rInst ) SAL_OVERRIDE {
      78           0 :                         return( pRefClass->IsDefault( rInst, nConstId ) );
      79             :                     };
      80             :                     // Als Default setzen
      81        1017 :     bool            IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) SAL_OVERRIDE
      82             :                         {
      83             :                             return pRefClass->IsValueDefault( rInst,
      84        1017 :                                                               pDef, nConstId );
      85             :                         }
      86        2003 :     ERRTYPE         SetBool( const RSCINST & rInst, bool bValue ) SAL_OVERRIDE
      87             :                         {
      88        2003 :                             if( bValue )
      89        1961 :                                 return( pRefClass->SetConst( rInst, nConstId, sal_Int32(bValue) ) );
      90             :                             else
      91             :                                 return( pRefClass->
      92          42 :                                         SetNotConst( rInst, nConstId ) );
      93             :                         }
      94           0 :     ERRTYPE         GetBool( const RSCINST & rInst, bool * pB ) SAL_OVERRIDE
      95             :                         {
      96           0 :                             *pB = pRefClass->IsSet( rInst, nConstId );
      97           0 :                             return( ERR_OK );
      98             :                         }
      99             :     void            WriteSrc( const RSCINST & rInst, FILE * fOutput,
     100             :                               RscTypCont * pTC, sal_uInt32 nTab, const char * ) SAL_OVERRIDE;
     101             : };
     102             : 
     103             : #endif // INCLUDED_RSC_INC_RSCFLAG_HXX
     104             : 
     105             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10