LCOV - code coverage report
Current view: top level - libreoffice/lotuswordpro/source/filter - lwpfootnote.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 22 23 95.7 %
Date: 2012-12-27 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 _LWPFRIBFOOTNOTE_HXX_
      65             : #define _LWPFRIBFOOTNOTE_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 :     ~LwpFribFootnote(){}
     110             :     void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
     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             :     ~LwpFootnote();
     131             :     void RegisterStyle();
     132             :     void XFConvert(XFContentContainer * pCont);
     133             : protected:
     134             :     void Read();
     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 :     ~LwpFootnoteTable(){}
     159             : protected:
     160             :     void Read();
     161             : };
     162             : 
     163             : /**
     164             :  * @brief footnote number options information
     165             : */
     166             : class LwpFootnoteNumberOptions
     167             : {
     168             : public:
     169          16 :     LwpFootnoteNumberOptions(){}
     170          16 :     ~LwpFootnoteNumberOptions(){}
     171             :     void Read(LwpObjectStream* pObjStrm);
     172             : private:
     173             :     sal_uInt16 m_nFlag;
     174             :     sal_uInt16 m_nStartingNumber;
     175             :     LwpAtomHolder m_LeadingText;
     176             :     LwpAtomHolder m_TrailingText;
     177             : public:
     178             :     enum // for flag
     179             :     {
     180             :         RESET_DOCUMENT  = 0x00,     // i.e., never reset the numbering
     181             :         RESET_PAGE  = 0x01,
     182             :         RESET_DIVISION  = 0x02,
     183             :         RESET_DIVISIONGROUP = 0x04,
     184             :         RESET_MASK = (RESET_PAGE | RESET_DIVISION | RESET_DIVISIONGROUP |
     185             :             RESET_DOCUMENT),
     186             :         SUPERSCRIPT_REFERENCE   = 0x10
     187             :     };
     188             : public:
     189           8 :     sal_uInt16 GetStartingNumber(){ return m_nStartingNumber;}
     190           8 :     OUString GetLeadingText(){ return m_LeadingText.str();}
     191           8 :     OUString GetTrailingText(){ return m_TrailingText.str();}
     192           8 :     sal_uInt16 GetReset(){ return static_cast<sal_uInt16>(m_nFlag & RESET_MASK);}
     193             : };
     194             : 
     195             : /**
     196             :  * @brief footnote separator options information
     197             : */
     198             : class LwpFootnoteSeparatorOptions
     199             : {
     200             : public:
     201           8 :     LwpFootnoteSeparatorOptions(){}
     202           8 :     ~LwpFootnoteSeparatorOptions(){}
     203             :     void Read(LwpObjectStream* pObjStrm);
     204             : private:
     205             :     sal_uInt16 m_nFlag;
     206             :     sal_uInt32 m_nLength;
     207             :     sal_uInt32 m_nIndent;
     208             :     sal_uInt32 m_nAbove;
     209             :     sal_uInt32 m_nBelow;
     210             :     LwpBorderStuff m_BorderStuff;
     211             : public:
     212             :     enum // for flag
     213             :     {
     214             :         HAS_SEPARATOR   = 0x01,
     215             :         CUSTOM_LENGTH   = 0x02
     216             :     };
     217             : public:
     218             :     sal_uInt32 GetFlag(){ return m_nFlag;}
     219           0 :     sal_uInt32 GetLength(){ return m_nLength;}
     220           8 :     sal_uInt32 GetIndent(){ return m_nIndent;}
     221           8 :     sal_uInt32 GetAbove(){ return m_nAbove;}
     222           8 :     sal_uInt32 GetBelow(){ return m_nBelow;}
     223             :     LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;}
     224           8 :     sal_Bool HasCustomLength(){ return (m_nFlag & CUSTOM_LENGTH) != 0;}
     225           8 :     sal_Bool HasSeparator(){ return (m_nFlag & HAS_SEPARATOR) != 0;}
     226           8 :     float GetTopBorderWidth(){ return m_BorderStuff.GetSideWidth(LwpBorderStuff::TOP);}
     227           8 :     LwpColor GetTopBorderColor(){ return m_BorderStuff.GetSideColor(LwpBorderStuff::TOP);}
     228             : };
     229             : 
     230             : /**
     231             :  * @brief   VO_FOOTNOTEOPTS object
     232             : */
     233             : class LwpFootnoteOptions : public LwpObject
     234             : {
     235             : public:
     236             :     LwpFootnoteOptions(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
     237             :     ~LwpFootnoteOptions();
     238             :     void RegisterStyle();
     239             : protected:
     240             :     void Read();
     241             :     void RegisterFootnoteStyle();
     242             :     void RegisterEndnoteStyle();
     243             : private:
     244             :     sal_uInt16 m_nFlag;
     245             :     LwpFootnoteNumberOptions m_FootnoteNumbering;
     246             :     LwpFootnoteNumberOptions m_EndnoteDivisionNumbering;
     247             :     LwpFootnoteNumberOptions m_EndnoteDivisionGroupNumbering;
     248             :     LwpFootnoteNumberOptions m_EndnoteDocNumbering;
     249             :     LwpFootnoteSeparatorOptions m_FootnoteSeparator;
     250             :     LwpFootnoteSeparatorOptions m_FootnoteContinuedSeparator;
     251             :     LwpAtomHolder m_ContinuedOnMessage;
     252             :     LwpAtomHolder m_ContinuedFromMessage;
     253             :     OUString m_strMasterPage;
     254             :     enum
     255             :     {
     256             :         FO_REPEAT           = 0x0001,
     257             :         FO_CONTINUEFROM     = 0x0002,
     258             :         FO_CONTINUEON       = 0x0004,
     259             :         FO_ON_CENTER        = 0x0008,
     260             :         FO_ON_RIGHT         = 0x0010,
     261             :         FO_ON_ALIGNMASK     = FO_ON_CENTER | FO_ON_RIGHT,
     262             :         FO_FROM_CENTER      = 0x0020,
     263             :         FO_FROM_RIGHT       = 0x0040,
     264             :         FO_FROM_ALIGNMASK   = FO_FROM_CENTER | FO_FROM_RIGHT
     265             :     };
     266             : 
     267             : public:
     268             :     LwpFootnoteNumberOptions* GetFootnoteNumbering(){ return &m_FootnoteNumbering;}
     269             :     LwpFootnoteNumberOptions* GetEndnoteDivisionNumbering(){ return &m_EndnoteDivisionNumbering;}
     270             :     LwpFootnoteNumberOptions* GetEndnoteDivisionGroupNumbering(){ return &m_EndnoteDivisionGroupNumbering;}
     271             :     LwpFootnoteNumberOptions* GetEndnoteDocNumbering(){ return &m_EndnoteDocNumbering;}
     272           8 :     LwpFootnoteSeparatorOptions* GetFootnoteSeparator(){ return &m_FootnoteSeparator;}
     273             :     LwpFootnoteSeparatorOptions* GetFootnoteContinuedSeparator(){ return &m_FootnoteContinuedSeparator;}
     274           4 :     sal_Bool GetContinuedFrom(){ return ((m_nFlag & FO_CONTINUEFROM) != 0);}
     275           4 :     sal_Bool GetContinuedOn(){ return ((m_nFlag & FO_CONTINUEON) != 0);}
     276             :     OUString GetContinuedOnMessage();
     277             :     OUString GetContinuedFromMessage();
     278           4 :     void SetMasterPage(OUString strMasterPage){ m_strMasterPage = strMasterPage;}
     279             : };
     280             : 
     281             : #endif
     282             : 
     283             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10