LCOV - code coverage report
Current view: top level - libreoffice/sw/source/filter/inc - rtf.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 16 16 100.0 %
Date: 2012-12-27 Functions: 6 6 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             : #ifndef _RTF_HXX
      20             : #define _RTF_HXX
      21             : 
      22             : #include <tools/solar.h>
      23             : 
      24             : // Umsetzung einiger FlyFrame-Attribute
      25             : class RTFVertOrient
      26             : {
      27             :     union {
      28             :         struct {
      29             :             sal_uInt16 nOrient : 4;
      30             :             sal_uInt16 nRelOrient : 1;
      31             :         } Flags;
      32             :         sal_uInt16 nVal;
      33             :     } Value;
      34             : 
      35             : public:
      36             :     RTFVertOrient( sal_uInt16 nValue ) { Value.nVal = nValue; }
      37             : 
      38           3 :     RTFVertOrient( sal_uInt16 nOrient, sal_uInt16 nRelOrient )  {
      39           3 :         Value.Flags.nOrient = nOrient;
      40           3 :         Value.Flags.nRelOrient = nRelOrient;
      41           3 :     }
      42             : 
      43             :     sal_uInt16 GetOrient()   const { return Value.Flags.nOrient; }
      44             :     sal_uInt16 GetRelation() const { return Value.Flags.nRelOrient; }
      45           3 :     sal_uInt16 GetValue()    const { return Value.nVal; }
      46             : };
      47             : 
      48             : 
      49             : class RTFHoriOrient
      50             : {
      51             :     union {
      52             :         struct {
      53             :             sal_uInt16 nOrient : 4;
      54             :             sal_uInt16 nRelAnchor : 4;
      55             :             sal_uInt16 nRelOrient : 1;
      56             :         } Flags;
      57             :         sal_uInt16 nVal;
      58             :     } Value;
      59             : 
      60             : public:
      61             :     RTFHoriOrient( sal_uInt16 nValue ) { Value.nVal = nValue; }
      62             : 
      63           3 :     RTFHoriOrient( sal_uInt16 nOrient, sal_uInt16 nRelOrient ) {
      64           3 :         Value.Flags.nOrient = nOrient;
      65           3 :         Value.Flags.nRelOrient = nRelOrient;
      66           3 :         Value.Flags.nRelAnchor = 0;
      67           3 :     }
      68             : 
      69             :     sal_uInt16 GetOrient()   const { return Value.Flags.nOrient; }
      70             :     sal_uInt16 GetRelation() const { return Value.Flags.nRelOrient; }
      71           3 :     sal_uInt16 GetValue()    const { return Value.nVal; }
      72             : };
      73             : 
      74             : class RTFProtect
      75             : {
      76             :     union {
      77             :         struct {
      78             :             sal_Bool bCntnt : 1;
      79             :             sal_Bool bSize : 1;
      80             :             sal_Bool bPos : 1;
      81             :         } Flags;
      82             :         sal_uInt8 nVal;
      83             :     } Value;
      84             : public:
      85             :     RTFProtect( sal_uInt8 nValue ) { Value.nVal = nValue; }
      86             : 
      87             :     RTFProtect( sal_Bool bCntnt, sal_Bool bSize, sal_Bool bPos ) {
      88             :         Value.Flags.bCntnt = bCntnt;
      89             :         Value.Flags.bSize = bSize;
      90             :         Value.Flags.bPos = bPos;
      91             :     }
      92             : 
      93             :     sal_Bool GetCntnt()     const { return Value.Flags.bCntnt; }
      94             :     sal_Bool GetSize()      const { return Value.Flags.bSize; }
      95             :     sal_Bool GetPos()       const { return Value.Flags.bPos; }
      96             :     sal_uInt16 GetValue()   const { return Value.nVal; }
      97             : };
      98             : 
      99             : 
     100             : class RTFSurround
     101             : {
     102             :     union {
     103             :         struct {
     104             :             sal_uInt16 nGoldCut : 1;
     105             :             sal_uInt16 nOrder : 4;
     106             :         } Flags;
     107             :         sal_uInt8 nVal;
     108             :     } Value;
     109             : public:
     110             :     RTFSurround( sal_uInt8 nValue ) { Value.nVal = nValue; }
     111             : 
     112           3 :     RTFSurround( sal_Bool bGoldCut, sal_uInt8 nOrder ) {
     113           3 :         Value.Flags.nOrder = nOrder;
     114           3 :         Value.Flags.nGoldCut = bGoldCut;
     115           3 :     }
     116             : 
     117             :     sal_uInt8 GetOrder()     const { return (sal_uInt8)Value.Flags.nOrder; }
     118             :     sal_Bool GetGoldCut()   const { return (sal_Bool)Value.Flags.nGoldCut; }
     119           3 :     sal_uInt16 GetValue()   const { return Value.nVal; }
     120             : };
     121             : 
     122             : #endif // _RTF_HXX
     123             : 
     124             : 
     125             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10