LCOV - code coverage report
Current view: top level - lotuswordpro/source/filter - lwpfootnote.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 26 27 96.3 %
Date: 2015-06-13 12:38:46 Functions: 24 25 96.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             :  *
       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             :  *  footnote
      59             :  */
      60             : /*************************************************************************
      61             :  * Change History
      62             :  Mar 2005           Created
      63             :  ************************************************************************/
      64             : #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFOOTNOTE_HXX
      65             : #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFOOTNOTE_HXX
      66             : 
      67             : #include "lwpfrib.hxx"
      68             : #include "lwpobj.hxx"
      69             : #include "lwpsection.hxx"
      70             : #include "lwpborderstuff.hxx"
      71             : 
      72             : // Footnote types are built up from these numbers
      73             : #define FN_MASK_ENDNOTE         0x80
      74             : #define FN_MASK_SEPARATE        0x40
      75             : #define FN_MASK_DEACTIVATED     0x20
      76             : #define FN_MASK_BASE            (0x0f | FN_MASK_ENDNOTE)
      77             : #define FN_BASE_DONTCARE        0
      78             : #define FN_BASE_FOOTNOTE        1
      79             : #define FN_BASE_DIVISION        (2 | FN_MASK_ENDNOTE)
      80             : #define FN_BASE_DIVISIONGROUP   (3 | FN_MASK_ENDNOTE)
      81             : #define FN_BASE_DOCUMENT        (4 | FN_MASK_ENDNOTE)
      82             : 
      83             : // Here are the real footnote types
      84             : #define FN_DONTCARE                 (FN_BASE_DONTCARE)
      85             : #define FN_FOOTNOTE                 (FN_BASE_FOOTNOTE)
      86             : #define FN_DIVISION                 (FN_BASE_DIVISION)
      87             : #define FN_DIVISION_SEPARATE        (FN_BASE_DIVISION | FN_MASK_SEPARATE)
      88             : #define FN_DIVISIONGROUP            (FN_BASE_DIVISIONGROUP)
      89             : #define FN_DIVISIONGROUP_SEPARATE   (FN_BASE_DIVISIONGROUP | FN_MASK_SEPARATE)
      90             : #define FN_DOCUMENT                 (FN_BASE_DOCUMENT)
      91             : #define FN_DOCUMENT_SEPARATE        (FN_BASE_DOCUMENT | FN_MASK_SEPARATE)
      92             : #define STRID_FOOTCONTINUEDFROM     "Continued from previous page..."
      93             : #define STRID_FOOTCONTINUEDON       "Continued on next page..."
      94             : //Footnote table types, the string may have to do with local language
      95             : #define STR_DivisionFootnote            "DivisionFootnote"
      96             : #define STR_DivisionEndnote         "DivisionEndnote"
      97             : #define STR_DivisionGroupEndnote    "DivisionGroupEndnote"
      98             : #define STR_DocumentEndnote     "DocumentEndnote"
      99             : 
     100             : /**
     101             :  * @brief   Footnote frib object
     102             : */
     103             : class LwpFootnote;
     104             : class LwpFribFootnote: public LwpFrib
     105             : {
     106             : 
     107             : public:
     108             :     LwpFribFootnote(LwpPara* pPara );
     109           2 :     virtual ~LwpFribFootnote(){}
     110             :     void Read(LwpObjectStream* pObjStrm, sal_uInt16 len) SAL_OVERRIDE;
     111             :     void RegisterNewStyle();
     112             :     void XFConvert(XFContentContainer* pCont);
     113             :     LwpFootnote* GetFootnote();
     114             : 
     115             : private:
     116             :     LwpObjectID m_Footnote;
     117             : };
     118             : 
     119             : /**
     120             :  * @brief   VO_FOOTNOTE object
     121             : */
     122             : class LwpEnSuperTableLayout;
     123             : class LwpCellLayout;
     124             : class LwpDocument;
     125             : class LwpTable;
     126             : class LwpFootnote : public LwpOrderedObject
     127             : {
     128             : public:
     129             :     LwpFootnote(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
     130             :     virtual ~LwpFootnote();
     131             :     void RegisterStyle() SAL_OVERRIDE;
     132             :     void XFConvert(XFContentContainer * pCont) SAL_OVERRIDE;
     133             : protected:
     134             :     void Read() SAL_OVERRIDE;
     135             : private:
     136             :     sal_uInt16 m_nType;
     137             :     sal_uInt16 m_nRow;
     138             :     LwpObjectID m_Content;
     139             : public:
     140           1 :     sal_uInt16 GetType(){ return m_nType;}
     141             : private:
     142             :     LwpCellLayout* GetCellLayout();
     143             :     LwpDocument* GetFootnoteTableDivision();
     144             :     LwpDocument* GetEndnoteDivision(LwpDocument* pPossible);
     145             :     LwpEnSuperTableLayout* FindFootnoteTableLayout();
     146             :     LwpContent* FindFootnoteContent();
     147             :     OUString GetTableClass();
     148             : };
     149             : 
     150             : /**
     151             :  * @brief VO_FOOTNOTETABLE object
     152             : */
     153             : #include "lwptable.hxx"
     154             : class LwpFootnoteTable : public LwpTable
     155             : {
     156             : public:
     157             :     LwpFootnoteTable(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
     158           2 :     virtual ~LwpFootnoteTable(){}
     159             : protected:
     160             :     void Read() SAL_OVERRIDE;
     161             : };
     162             : 
     163             : /**
     164             :  * @brief footnote number options information
     165             : */
     166             : class LwpFootnoteNumberOptions
     167             : {
     168             : public:
     169          16 :     LwpFootnoteNumberOptions()
     170             :         : m_nFlag(0)
     171          16 :         , m_nStartingNumber(0)
     172          16 :         {}
     173             : 
     174          16 :     ~LwpFootnoteNumberOptions(){}
     175             :     void Read(LwpObjectStream* pObjStrm);
     176             : private:
     177             :     sal_uInt16 m_nFlag;
     178             :     sal_uInt16 m_nStartingNumber;
     179             :     LwpAtomHolder m_LeadingText;
     180             :     LwpAtomHolder m_TrailingText;
     181             : public:
     182             :     enum // for flag
     183             :     {
     184             :         RESET_DOCUMENT  = 0x00,     // i.e., never reset the numbering
     185             :         RESET_PAGE  = 0x01,
     186             :         RESET_DIVISION  = 0x02,
     187             :         RESET_DIVISIONGROUP = 0x04,
     188             :         RESET_MASK = (RESET_PAGE | RESET_DIVISION | RESET_DIVISIONGROUP |
     189             :             RESET_DOCUMENT),
     190             :         SUPERSCRIPT_REFERENCE   = 0x10
     191             :     };
     192             : public:
     193           8 :     sal_uInt16 GetStartingNumber(){ return m_nStartingNumber;}
     194           8 :     OUString GetLeadingText(){ return m_LeadingText.str();}
     195           8 :     OUString GetTrailingText(){ return m_TrailingText.str();}
     196           8 :     sal_uInt16 GetReset(){ return static_cast<sal_uInt16>(m_nFlag & RESET_MASK);}
     197             : };
     198             : 
     199             : /**
     200             :  * @brief footnote separator options information
     201             : */
     202             : class LwpFootnoteSeparatorOptions
     203             : {
     204             : public:
     205           8 :     LwpFootnoteSeparatorOptions()
     206             :         : m_nFlag(0)
     207             :         , m_nLength(0)
     208             :         , m_nIndent(0)
     209             :         , m_nAbove(0)
     210           8 :         , m_nBelow(0)
     211           8 :         {}
     212             : 
     213           8 :     ~LwpFootnoteSeparatorOptions(){}
     214             :     void Read(LwpObjectStream* pObjStrm);
     215             : private:
     216             :     sal_uInt16 m_nFlag;
     217             :     sal_uInt32 m_nLength;
     218             :     sal_uInt32 m_nIndent;
     219             :     sal_uInt32 m_nAbove;
     220             :     sal_uInt32 m_nBelow;
     221             :     LwpBorderStuff m_BorderStuff;
     222             : public:
     223             :     enum // for flag
     224             :     {
     225             :         HAS_SEPARATOR   = 0x01,
     226             :         CUSTOM_LENGTH   = 0x02
     227             :     };
     228             : public:
     229             :     sal_uInt32 GetFlag(){ return m_nFlag;}
     230           0 :     sal_uInt32 GetLength(){ return m_nLength;}
     231           8 :     sal_uInt32 GetIndent(){ return m_nIndent;}
     232           8 :     sal_uInt32 GetAbove(){ return m_nAbove;}
     233           8 :     sal_uInt32 GetBelow(){ return m_nBelow;}
     234             :     LwpBorderStuff& GetBorderStuff(){ return m_BorderStuff;}
     235           8 :     bool HasCustomLength(){ return (m_nFlag & CUSTOM_LENGTH) != 0;}
     236           8 :     bool HasSeparator(){ return (m_nFlag & HAS_SEPARATOR) != 0;}
     237           8 :     float GetTopBorderWidth(){ return m_BorderStuff.GetSideWidth(LwpBorderStuff::TOP);}
     238           8 :     LwpColor GetTopBorderColor(){ return m_BorderStuff.GetSideColor(LwpBorderStuff::TOP);}
     239             : };
     240             : 
     241             : /**
     242             :  * @brief   VO_FOOTNOTEOPTS object
     243             : */
     244             : class LwpFootnoteOptions : public LwpObject
     245             : {
     246             : public:
     247             :     LwpFootnoteOptions(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
     248             :     void RegisterStyle() SAL_OVERRIDE;
     249             : protected:
     250             :     void Read() SAL_OVERRIDE;
     251             :     void RegisterFootnoteStyle();
     252             :     void RegisterEndnoteStyle();
     253             : private:
     254             :     virtual ~LwpFootnoteOptions();
     255             : 
     256             :     sal_uInt16 m_nFlag;
     257             :     LwpFootnoteNumberOptions m_FootnoteNumbering;
     258             :     LwpFootnoteNumberOptions m_EndnoteDivisionNumbering;
     259             :     LwpFootnoteNumberOptions m_EndnoteDivisionGroupNumbering;
     260             :     LwpFootnoteNumberOptions m_EndnoteDocNumbering;
     261             :     LwpFootnoteSeparatorOptions m_FootnoteSeparator;
     262             :     LwpFootnoteSeparatorOptions m_FootnoteContinuedSeparator;
     263             :     LwpAtomHolder m_ContinuedOnMessage;
     264             :     LwpAtomHolder m_ContinuedFromMessage;
     265             :     OUString m_strMasterPage;
     266             :     enum
     267             :     {
     268             :         FO_REPEAT           = 0x0001,
     269             :         FO_CONTINUEFROM     = 0x0002,
     270             :         FO_CONTINUEON       = 0x0004,
     271             :         FO_ON_CENTER        = 0x0008,
     272             :         FO_ON_RIGHT         = 0x0010,
     273             :         FO_ON_ALIGNMASK     = FO_ON_CENTER | FO_ON_RIGHT,
     274             :         FO_FROM_CENTER      = 0x0020,
     275             :         FO_FROM_RIGHT       = 0x0040,
     276             :         FO_FROM_ALIGNMASK   = FO_FROM_CENTER | FO_FROM_RIGHT
     277             :     };
     278             : 
     279             : public:
     280             :     LwpFootnoteNumberOptions& GetFootnoteNumbering(){ return m_FootnoteNumbering;}
     281             :     LwpFootnoteNumberOptions& GetEndnoteDivisionNumbering(){ return m_EndnoteDivisionNumbering;}
     282             :     LwpFootnoteNumberOptions& GetEndnoteDivisionGroupNumbering(){ return m_EndnoteDivisionGroupNumbering;}
     283             :     LwpFootnoteNumberOptions& GetEndnoteDocNumbering(){ return m_EndnoteDocNumbering;}
     284           8 :     LwpFootnoteSeparatorOptions& GetFootnoteSeparator(){ return m_FootnoteSeparator;}
     285             :     LwpFootnoteSeparatorOptions& GetFootnoteContinuedSeparator(){ return m_FootnoteContinuedSeparator;}
     286           4 :     bool GetContinuedFrom(){ return ((m_nFlag & FO_CONTINUEFROM) != 0);}
     287           4 :     bool GetContinuedOn(){ return ((m_nFlag & FO_CONTINUEON) != 0);}
     288             :     OUString GetContinuedOnMessage();
     289             :     OUString GetContinuedFromMessage();
     290           4 :     void SetMasterPage(const OUString& strMasterPage){ m_strMasterPage = strMasterPage;}
     291             : };
     292             : 
     293             : #endif
     294             : 
     295             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11