LCOV - code coverage report
Current view: top level - lotuswordpro/source/filter - lwptblcell.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 0 48 0.0 %
Date: 2014-11-03 Functions: 0 24 0.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             :  *  For LWP filter architecture prototype - table object
      59             :  */
      60             : /*************************************************************************
      61             :  * Change History
      62             :  Mar 2005           Created
      63             :  ************************************************************************/
      64             : #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_HXX
      65             : #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPTBLCELL_HXX
      66             : 
      67             : #include "lwpobj.hxx"
      68             : #include "lwpatomholder.hxx"
      69             : #include "lwpstory.hxx"
      70             : 
      71             : #include "xfilter/xfcell.hxx"
      72             : 
      73             : // temporily added for compile
      74             : class LwpObject;
      75             : 
      76             : class LwpContent;
      77             : class LwpTableLayout;
      78             : /**
      79             :  * @brief
      80             :  * VO_CELLLIST object
      81             :  */
      82             : class LwpCellList : public LwpDLVList
      83             : {
      84             : public:
      85             :     LwpCellList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
      86             : 
      87             :     virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
      88           0 :     LwpObjectID GetNextID(){return GetNext();}
      89           0 :     sal_uInt8 GetColumnID(){return cColumn;}
      90           0 :     virtual bool IsFormula(){return false;}
      91           0 :     LwpObjectID GetValueID(){return cValue;}
      92             : 
      93             :     virtual void Convert(XFCell * pCell, LwpTableLayout* pCellsMap=NULL);
      94             : protected:
      95             :     virtual ~LwpCellList();
      96             : 
      97             :     sal_uInt8 cColumn;
      98             :     LwpObjectID cParent;
      99             : 
     100             :     void Read() SAL_OVERRIDE;
     101             :     LwpObjectID cValue;
     102             : };
     103             : /**
     104             :  * @brief
     105             :  * VO_ROWLIST object
     106             :  */
     107             : class LwpRowList : public LwpDLVList
     108             : {
     109             : public:
     110             :     LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
     111             : 
     112             :     void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
     113           0 :     LwpObjectID GetChildHeadID(){return cChild.GetHead();}
     114           0 :     LwpObjectID GetNextID(){return GetNext();}
     115           0 :     sal_uInt16 GetRowID(){return cRowID;}
     116             : protected:
     117             :     LwpDLVListHeadTail cChild;
     118             :     LwpObjectID cParent;
     119             :     sal_uInt16 cRowID;
     120             :     void Read() SAL_OVERRIDE;
     121             : private:
     122             :     virtual ~LwpRowList();
     123             : };
     124             : /**
     125             :  * @brief
     126             :  * VO_NUMERICVALUE object
     127             :  */
     128             : class LwpNumericValue : public LwpObject
     129             : {
     130             : public:
     131             :     LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
     132             : 
     133           0 :     double GetValue(){return cNumber;}
     134             :     void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
     135             : protected:
     136             :     double cNumber;
     137             :     //LwpContent m_TheContent;
     138             :     void Read() SAL_OVERRIDE;
     139             : private:
     140             :     virtual ~LwpNumericValue();
     141             : };
     142             : 
     143             : /**
     144             :  * @brief
     145             :  * VO_TABLERANGE object
     146             :  */
     147             : class LwpTableRange: public LwpDLVList
     148             : {
     149             : public:
     150             :     LwpTableRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
     151             : 
     152             :     void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
     153           0 :     LwpObjectID GetCellRangeID(){return cpCellRange;}
     154           0 :     LwpObjectID GetTableID(){ return cqTable;}
     155           0 :     LwpTableRange* GetNext() { return static_cast<LwpTableRange*>(LwpDLVList::GetNext().obj().get());}
     156             : protected:
     157             :     LwpObjectID cqTable;
     158             :     LwpObjectID cpCellRange;
     159             :     void Read() SAL_OVERRIDE;
     160             : private:
     161             :     virtual ~LwpTableRange();
     162             : };
     163             : /**
     164             :  * @brief
     165             :  * VO_CELLRANGE object
     166             :  */
     167             : class LwpCellRange: public LwpObject
     168             : {
     169             : public:
     170             :     LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
     171             : 
     172             :     void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
     173           0 :     LwpObjectID GetFolderID(){return cpFolder;}
     174             : protected:
     175             :     LwpObjectID cpFolder;
     176             :     void Read() SAL_OVERRIDE;
     177             : private:
     178             :     virtual ~LwpCellRange();
     179             : };
     180             : /**
     181             :  * @brief
     182             :  * VO_FOLDER object
     183             :  */
     184             : class LwpFolder: public LwpDLVList
     185             : {
     186             : public:
     187             :     LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
     188             : 
     189             :     void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
     190           0 :     LwpObjectID GetChildHeadID(){ return cChild.GetHead();}
     191             : protected:
     192             :     LwpDLVListHeadTail cChild;
     193             :     LwpObjectID cParent;
     194             :     LwpObjectID cqTable;
     195             :     void Read() SAL_OVERRIDE;
     196             : private:
     197             :     virtual ~LwpFolder();
     198             : };
     199             : /**
     200             :  * @brief
     201             :  * VO_DEPENDENT object
     202             :  */
     203             : class LwpDependent: public LwpDLVList
     204             : {
     205             : public:
     206             :     LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
     207             : 
     208             :     void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
     209             : protected:
     210             :     void Read() SAL_OVERRIDE;
     211             :     LwpObjectID cFormulaInfo;
     212             :     sal_uInt16 cReferenceOffset;    // Used to fix dependent formula when we're
     213             :                                 //  dropped, sorted.
     214             :     // Flags:
     215             :     enum
     216             :     {
     217             :         START_CELL  = 0x01,
     218             :         END_CELL    = 0x02,
     219             :         REGISTERED  = 0x04
     220             :     };
     221             :     sal_uInt8 cFlags;                // Used to fix dependent formula when we're
     222             :                                 //  dropped, sorted.
     223             : private:
     224             :     virtual ~LwpDependent();
     225             : };
     226             : 
     227             : /**
     228             :  * @brief
     229             :  * row or column id
     230             :  */
     231             : class LwpRowColumnQualifier
     232             : {
     233             : public:
     234             :     LwpRowColumnQualifier(void);
     235           0 :     ~LwpRowColumnQualifier(){}
     236             : 
     237             :     inline void SetAbsolute(void);
     238             :     inline void ClearAbsolute(void);
     239             :     bool IsAbsolute(void);
     240             : 
     241             :     inline void SetAfter(void);
     242             :     inline void ClearAfter(void);
     243             :     bool IsAfter(void);
     244             : 
     245             :     void SetBad(bool Bad);
     246             :     bool IsBad(void);
     247             : 
     248             :     void QuickRead(LwpObjectStream *pStrm);
     249             : 
     250             : private:
     251             :     enum    // cFlags bit definitions
     252             :     {
     253             :         REF_ABSOLUTE    = 0x01,
     254             :         REF_AFTER       = 0x02,
     255             :         REF_BAD         = 0x04
     256             :     };
     257             :     sal_uInt8 cFlags;
     258             : };
     259             : 
     260             : inline void
     261             : LwpRowColumnQualifier::SetAbsolute(void)
     262             : {
     263             :     cFlags |= REF_ABSOLUTE;
     264             : }
     265             : 
     266             : inline void
     267             : LwpRowColumnQualifier::ClearAbsolute(void)
     268             : {
     269             :     cFlags &= ~REF_ABSOLUTE;
     270             : }
     271             : 
     272             : inline void
     273             : LwpRowColumnQualifier::SetAfter(void)
     274             : {
     275             :     cFlags |= REF_AFTER;
     276             : }
     277             : 
     278             : inline void
     279             : LwpRowColumnQualifier::ClearAfter(void)
     280             : {
     281             :     cFlags &= ~REF_AFTER;
     282             : }
     283             : 
     284             : inline
     285           0 : LwpRowColumnQualifier::LwpRowColumnQualifier()
     286             : {
     287           0 :     cFlags = 0;
     288           0 : }
     289             : 
     290             : inline bool
     291           0 : LwpRowColumnQualifier::IsAfter()
     292             : {
     293           0 :     return cFlags & REF_AFTER ? sal_True : sal_False;
     294             : }
     295             : 
     296             : inline bool
     297           0 : LwpRowColumnQualifier::IsBad()
     298             : {
     299           0 :     return cFlags & REF_BAD ? sal_True : sal_False;
     300             : }
     301             : 
     302             : inline bool
     303           0 : LwpRowColumnQualifier::IsAbsolute()
     304             : {
     305           0 :     return cFlags & REF_ABSOLUTE ? sal_True : sal_False;
     306             : }
     307             : /**
     308             :  * @brief
     309             :  * row id
     310             :  */
     311             : class LwpRowSpecifier
     312             : {
     313             : public:
     314           0 :     LwpRowSpecifier(void)
     315           0 :         : cRow(0)
     316           0 :         {}
     317           0 :     ~LwpRowSpecifier(){}
     318             : 
     319             :     void QuickRead(LwpObjectStream *pStrm);
     320             :     OUString ToString(sal_uInt16 nFormulaRow);
     321             : 
     322             :     sal_uInt16 RowID(sal_uInt16 FormulaRow);
     323             :     sal_uInt16 &Row(void);
     324             : 
     325             :     void SetAbsolute(void);
     326             :     void ClearAbsolute(void);
     327             :     bool IsAbsolute(void);
     328             : 
     329             :     void SetAfter(void);
     330             :     void ClearAfter(void);
     331             :     bool IsAfter(void);
     332             : 
     333             :     void SetBad(bool Bad);
     334             :     bool IsBad(void);
     335             :     void SetRowDelta(sal_uInt16 ReferenceRowID, sal_uInt16 FormulaRowID);
     336             : 
     337             : private:
     338             :     sal_uInt16 cRow;
     339             :     LwpRowColumnQualifier cQualifier;
     340             : };
     341             : 
     342             : inline sal_uInt16
     343           0 : LwpRowSpecifier::RowID(sal_uInt16 FormulaRow)
     344             : {
     345           0 :     if (cQualifier.IsBad())
     346             :     {
     347           0 :         return 0xffff;
     348             :     }
     349           0 :     if (cQualifier.IsAbsolute())
     350           0 :         return cRow;
     351             : 
     352           0 :     if (cQualifier.IsAfter())
     353           0 :         return FormulaRow + cRow;
     354           0 :     return FormulaRow - cRow;
     355             : }
     356             : 
     357             : inline sal_uInt16 &
     358             : LwpRowSpecifier::Row()
     359             : {
     360             :     return cRow;
     361             : }
     362             : 
     363             : inline void
     364             : LwpRowSpecifier::SetAbsolute(void)
     365             : {
     366             :     cQualifier.SetAbsolute();
     367             : }
     368             : 
     369             : inline void
     370             : LwpRowSpecifier::ClearAbsolute(void)
     371             : {
     372             :     cQualifier.ClearAbsolute();
     373             : }
     374             : 
     375             : inline bool
     376             : LwpRowSpecifier::IsAbsolute()
     377             : {
     378             :     return cQualifier.IsAbsolute();
     379             : }
     380             : 
     381             : inline void
     382             : LwpRowSpecifier::SetAfter(void)
     383             : {
     384             :     cQualifier.SetAfter();
     385             : }
     386             : 
     387             : inline void
     388             : LwpRowSpecifier::ClearAfter(void)
     389             : {
     390             :     cQualifier.ClearAfter();
     391             : }
     392             : 
     393             : inline bool
     394             : LwpRowSpecifier::IsAfter()
     395             : {
     396             :     return cQualifier.IsAfter();
     397             : }
     398             : 
     399             : inline void
     400             : LwpRowSpecifier::SetBad(bool Bad)
     401             : {
     402             :     cQualifier.SetBad(Bad);
     403             : }
     404             : 
     405             : inline bool
     406             : LwpRowSpecifier::IsBad()
     407             : {
     408             :     return cQualifier.IsBad();
     409             : }
     410             : /**
     411             :  * @brief
     412             :  * column id
     413             :  */
     414             : class LwpColumnSpecifier
     415             : {
     416             : public:
     417           0 :     LwpColumnSpecifier(void)
     418           0 :         : cColumn(0)
     419           0 :         {}
     420           0 :     ~LwpColumnSpecifier()
     421           0 :         {}
     422             : 
     423             :     void QuickRead(LwpObjectStream *pStrm);
     424             :     sal_uInt8 Column(){return cColumn;}
     425             :     OUString ToString(sal_uInt8 nFormulaCol);
     426             : 
     427             :     sal_uInt8 ColumnID(sal_uInt8 FormulaColumn);
     428             :     void SetAbsolute(void);
     429             :     void ClearAbsolute(void);
     430             :     bool IsAbsolute(void);
     431             :     void SetAfter(void);
     432             :     void ClearAfter(void);
     433             :     bool IsAfter(void);
     434             :     void SetBad(bool Bad);
     435             :     bool IsBad(void);
     436             :     void SetColumnDelta(sal_uInt8 ReferenceColumnID, sal_uInt8 FormulaColumnID);
     437             : 
     438             : private:
     439             :     sal_uInt8 cColumn;
     440             :     LwpRowColumnQualifier cQualifier;
     441             : };
     442             : 
     443             : inline sal_uInt8
     444           0 : LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn)
     445             : {
     446           0 :     if (cQualifier.IsBad())
     447             :     {
     448           0 :         return 0xff;
     449             :     }
     450           0 :     if (cQualifier.IsAbsolute())
     451           0 :         return cColumn;
     452           0 :     if (cQualifier.IsAfter())
     453           0 :         return FormulaColumn + cColumn;
     454           0 :     return FormulaColumn - cColumn;
     455             : }
     456             : 
     457             : inline void
     458             : LwpColumnSpecifier::SetAbsolute(void)
     459             : {
     460             :     cQualifier.SetAbsolute();
     461             : }
     462             : 
     463             : inline void
     464             : LwpColumnSpecifier::ClearAbsolute(void)
     465             : {
     466             :     cQualifier.ClearAbsolute();
     467             : }
     468             : 
     469             : inline bool
     470             : LwpColumnSpecifier::IsAbsolute()
     471             : {
     472             :     return cQualifier.IsAbsolute();
     473             : }
     474             : 
     475             : inline void
     476             : LwpColumnSpecifier::SetAfter(void)
     477             : {
     478             :     cQualifier.SetAfter();
     479             : }
     480             : 
     481             : inline void
     482             : LwpColumnSpecifier::ClearAfter(void)
     483             : {
     484             :     cQualifier.ClearAfter();
     485             : }
     486             : 
     487             : inline bool
     488             : LwpColumnSpecifier::IsAfter()
     489             : {
     490             :     return cQualifier.IsAfter();
     491             : }
     492             : 
     493             : inline void
     494             : LwpColumnSpecifier::SetBad(bool Bad)
     495             : {
     496             :     cQualifier.SetBad(Bad);
     497             : }
     498             : 
     499             : inline bool
     500             : LwpColumnSpecifier::IsBad()
     501             : {
     502             :     return cQualifier.IsBad();
     503             : }
     504             : #endif
     505             : 
     506             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10