LCOV - code coverage report
Current view: top level - libreoffice/lotuswordpro/source/filter - lwpbreaksoverride.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 14 56 25.0 %
Date: 2012-12-27 Functions: 7 24 29.2 %
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             :  *
       4             :  *  The Contents of this file are made available subject to the terms of
       5             :  *  either of the following licenses
       6             :  *
       7             :  *         - GNU Lesser General Public License Version 2.1
       8             :  *         - Sun Industry Standards Source License Version 1.1
       9             :  *
      10             :  *  Sun Microsystems Inc., October, 2000
      11             :  *
      12             :  *  GNU Lesser General Public License Version 2.1
      13             :  *  =============================================
      14             :  *  Copyright 2000 by Sun Microsystems, Inc.
      15             :  *  901 San Antonio Road, Palo Alto, CA 94303, USA
      16             :  *
      17             :  *  This library is free software; you can redistribute it and/or
      18             :  *  modify it under the terms of the GNU Lesser General Public
      19             :  *  License version 2.1, as published by the Free Software Foundation.
      20             :  *
      21             :  *  This library is distributed in the hope that it will be useful,
      22             :  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
      23             :  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      24             :  *  Lesser General Public License for more details.
      25             :  *
      26             :  *  You should have received a copy of the GNU Lesser General Public
      27             :  *  License along with this library; if not, write to the Free Software
      28             :  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
      29             :  *  MA  02111-1307  USA
      30             :  *
      31             :  *
      32             :  *  Sun Industry Standards Source License Version 1.1
      33             :  *  =================================================
      34             :  *  The contents of this file are subject to the Sun Industry Standards
      35             :  *  Source License Version 1.1 (the "License"); You may not use this file
      36             :  *  except in compliance with the License. You may obtain a copy of the
      37             :  *  License at http://www.openoffice.org/license.html.
      38             :  *
      39             :  *  Software provided under this License is provided on an "AS IS" basis,
      40             :  *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
      41             :  *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
      42             :  *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
      43             :  *  See the License for the specific provisions governing your rights and
      44             :  *  obligations concerning the Software.
      45             :  *
      46             :  *  The Initial Developer of the Original Code is: IBM Corporation
      47             :  *
      48             :  *  Copyright: 2008 by IBM Corporation
      49             :  *
      50             :  *  All Rights Reserved.
      51             :  *
      52             :  *  Contributor(s): _______________________________________
      53             :  *
      54             :  *
      55             :  ************************************************************************/
      56             : /*************************************************************************
      57             : * @file
      58             : * Breaks override of Wordpro.
      59             : ************************************************************************/
      60             : #ifndef     _LWPBREAKSOVERRIDE_HXX
      61             : #define     _LWPBREAKSOVERRIDE_HXX
      62             : 
      63             : #include    "lwpoverride.hxx"
      64             : 
      65             : class LwpObjectStream;
      66             : class LwpAtomHolder;
      67             : class LwpBreaksOverride : public LwpOverride
      68             : {
      69             : 
      70             : public:
      71             :     LwpBreaksOverride();
      72             :     virtual ~LwpBreaksOverride();
      73             : 
      74             :     virtual LwpBreaksOverride* clone() const;
      75             : 
      76             :     enum
      77             :     {
      78             :         BO_PAGEBEFORE   = 0x01, // page break before this style
      79             :         BO_PAGEAFTER    = 0x02, // page break after this style
      80             :         BO_KEEPTOGETHER = 0x04,
      81             :         BO_COLBEFORE    = 0x08, // col break before this style
      82             :         BO_COLAFTER     = 0x10, // col break after this style
      83             :         BO_KEEPPREV     = 0x20, // not with-PAGE BEF, COL BEF or WITHIN
      84             :         BO_KEEPNEXT     = 0x40, // not with-PAGE AFT, COL AFT or WITHIN
      85             :         BO_USENEXTSTYLE = 0x80, // use next style name
      86             :         BO_NEXTSTYLE    = 0x100 // next style name
      87             :     };
      88             : public:
      89             :     virtual void Read(LwpObjectStream *pStrm);
      90             : 
      91             :     //add by , 01/28/2005
      92             :     void Override(LwpBreaksOverride* pOther);
      93             : 
      94             :     inline sal_Bool IsPageBreakBefore();
      95             :     inline sal_Bool IsPageBreakAfter();
      96             :     inline sal_Bool IsPageBreakWithin();
      97             :     inline sal_Bool IsColumnBreakBefore();
      98             :     inline sal_Bool IsColumnBreakAfter();
      99             :     inline sal_Bool IsKeepWithNext();
     100             :     inline sal_Bool IsKeepWithPrevious();
     101             :     inline sal_Bool IsUseNextStyle();
     102             : 
     103             :     inline sal_Bool IsPageBreakBeforeOverridden();
     104             :     inline sal_Bool IsPageBreakAfterOverridden();
     105             :     inline sal_Bool IsPageBreakWithinOverridden();
     106             :     inline sal_Bool IsColumnBreakBeforeOverridden();
     107             :     inline sal_Bool IsColumnBreakAfterOverridden();
     108             :     inline sal_Bool IsKeepWithNextOverridden();
     109             :     inline sal_Bool IsKeepWithPreviousOverridden();
     110             :     inline sal_Bool IsUseNextStyleOverridden();
     111             : 
     112             :     inline void RevertPageBreakBefore();
     113             :     inline void RevertPageBreakAfter();
     114             :     inline void RevertPageBreakWithin();
     115             :     inline void RevertColumnBreakBefore();
     116             :     inline void RevertColumnBreakAfter();
     117             :     inline void RevertKeepWithNext();
     118             :     inline void RevertKeepWithPrevious();
     119             :     inline void RevertUseNextStyle();
     120             : 
     121             : 
     122             :     void OverridePageBreakBefore(sal_Bool bVal);
     123             :     void OverridePageBreakAfter(sal_Bool bVal);
     124             :     void OverridePageBreakWithin(sal_Bool bVal);
     125             :     void OverrideColumnBreakBefore(sal_Bool bVal);
     126             :     void OverrideColumnBreakAfter(sal_Bool bVal);
     127             :     void OverrideKeepWithNext(sal_Bool bVal);
     128             :     void OverrideKeepWithPrevious(sal_Bool bVal);
     129             :     void OverrideUseNextStyle(sal_Bool bVal);
     130             : 
     131             : 
     132             :     inline LwpAtomHolder* GetNextStyle();
     133             :     //end add
     134             : 
     135             : protected:
     136             :     LwpBreaksOverride(LwpBreaksOverride const& rOther);
     137             : 
     138             : private:
     139             :     LwpBreaksOverride& operator=(const LwpBreaksOverride& rOther); // not implemented
     140             : 
     141             : private:
     142             :     LwpAtomHolder       *m_pNextStyle;
     143             : };
     144             : 
     145         218 : inline sal_Bool LwpBreaksOverride::IsPageBreakBefore()
     146             : {
     147         218 :     return (sal_Bool)((m_nValues & BO_PAGEBEFORE) != 0);
     148             : }
     149             : 
     150         218 : inline sal_Bool LwpBreaksOverride::IsPageBreakAfter()
     151             : {
     152         218 :     return (sal_Bool)((m_nValues & BO_PAGEAFTER) != 0);
     153             : }
     154         127 : inline sal_Bool LwpBreaksOverride::IsPageBreakWithin()
     155             : {
     156         127 :     return (sal_Bool)((m_nValues & BO_KEEPTOGETHER) != 0);
     157             : }
     158         218 : inline sal_Bool LwpBreaksOverride::IsColumnBreakBefore()
     159             : {
     160         218 :     return (sal_Bool)((m_nValues & BO_COLBEFORE) != 0);
     161             : }
     162         218 : inline sal_Bool LwpBreaksOverride::IsColumnBreakAfter()
     163             : {
     164         218 :     return (sal_Bool)((m_nValues & BO_COLAFTER) != 0);
     165             : }
     166         154 : inline sal_Bool LwpBreaksOverride::IsKeepWithNext()
     167             : {
     168         154 :     return (sal_Bool)((m_nValues & BO_KEEPNEXT) != 0);
     169             : }
     170           0 : inline sal_Bool LwpBreaksOverride::IsKeepWithPrevious()
     171             : {
     172           0 :     return (sal_Bool)((m_nValues & BO_KEEPPREV) != 0);
     173             : }
     174           0 : inline sal_Bool LwpBreaksOverride::IsUseNextStyle()
     175             : {
     176           0 :     return (sal_Bool)((m_nValues & BO_USENEXTSTYLE) != 0);
     177             : }
     178             : 
     179           0 : inline sal_Bool LwpBreaksOverride::IsPageBreakBeforeOverridden()
     180             : {
     181           0 :     return (sal_Bool)((m_nOverride& BO_PAGEBEFORE) != 0);
     182             : }
     183           0 : inline sal_Bool LwpBreaksOverride::IsPageBreakAfterOverridden()
     184             : {
     185           0 :     return (sal_Bool)((m_nOverride& BO_PAGEAFTER) != 0);
     186             : }
     187         127 : inline sal_Bool LwpBreaksOverride::IsPageBreakWithinOverridden()
     188             : {
     189         127 :     return (sal_Bool)((m_nOverride& BO_KEEPTOGETHER) != 0);
     190             : }
     191           0 : inline sal_Bool LwpBreaksOverride::IsColumnBreakBeforeOverridden()
     192             : {
     193           0 :     return (sal_Bool)((m_nOverride& BO_COLBEFORE) != 0);
     194             : }
     195           0 : inline sal_Bool LwpBreaksOverride::IsColumnBreakAfterOverridden()
     196             : {
     197           0 :     return (sal_Bool)((m_nOverride& BO_COLAFTER) != 0);
     198             : }
     199           0 : inline sal_Bool LwpBreaksOverride::IsKeepWithNextOverridden()
     200             : {
     201           0 :     return (sal_Bool)((m_nOverride& BO_KEEPNEXT) != 0);
     202             : }
     203           0 : inline sal_Bool LwpBreaksOverride::IsKeepWithPreviousOverridden()
     204             : {
     205           0 :     return (sal_Bool)((m_nOverride& BO_KEEPPREV) != 0);
     206             : }
     207           0 : inline sal_Bool LwpBreaksOverride::IsUseNextStyleOverridden()
     208             : {
     209           0 :     return (sal_Bool)((m_nOverride& BO_USENEXTSTYLE) != 0);
     210             : }
     211             : 
     212           0 : inline void LwpBreaksOverride::RevertPageBreakBefore()
     213             : {
     214           0 :     LwpOverride::Override(BO_PAGEBEFORE, STATE_STYLE);
     215           0 : }
     216           0 : inline void LwpBreaksOverride::RevertPageBreakAfter()
     217             : {
     218           0 :     LwpOverride::Override(BO_PAGEAFTER, STATE_STYLE);
     219           0 : }
     220           0 : inline void LwpBreaksOverride::RevertPageBreakWithin()
     221             : {
     222           0 :     LwpOverride::Override(BO_KEEPTOGETHER, STATE_STYLE);
     223           0 : }
     224           0 : inline void LwpBreaksOverride::RevertColumnBreakBefore()
     225             : {
     226           0 :     LwpOverride::Override(BO_COLBEFORE, STATE_STYLE);
     227           0 : }
     228           0 : inline void LwpBreaksOverride::RevertColumnBreakAfter()
     229             : {
     230           0 :     LwpOverride::Override(BO_COLAFTER, STATE_STYLE);
     231           0 : }
     232           0 : inline void LwpBreaksOverride::RevertKeepWithNext()
     233             : {
     234           0 :     LwpOverride::Override(BO_KEEPNEXT, STATE_STYLE);
     235           0 : }
     236           0 : inline void LwpBreaksOverride::RevertKeepWithPrevious()
     237             : {
     238           0 :     LwpOverride::Override(BO_KEEPPREV, STATE_STYLE);
     239           0 : }
     240           0 : inline void LwpBreaksOverride::RevertUseNextStyle()
     241             : {
     242           0 :     LwpOverride::Override(BO_USENEXTSTYLE, STATE_STYLE);
     243           0 : }
     244             : 
     245             : inline LwpAtomHolder* LwpBreaksOverride::GetNextStyle()
     246             : {
     247             :     return m_pNextStyle;
     248             : }
     249             : 
     250             : 
     251             : #endif
     252             : 
     253             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10