LCOV - code coverage report
Current view: top level - lotuswordpro/source/filter - lwpfoundry.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 33 34 97.1 %
Date: 2012-08-25 Functions: 31 32 96.9 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     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
      59                 :            :  ************************************************************************/
      60                 :            : /*************************************************************************
      61                 :            :  * Change History
      62                 :            :  Jan 2005           Created
      63                 :            :  ************************************************************************/
      64                 :            : 
      65                 :            : #ifndef _LWPFOUNDRY_HXX
      66                 :            : #define _LWPFOUNDRY_HXX
      67                 :            : 
      68                 :            : #include "lwpheader.hxx"
      69                 :            : 
      70                 :            : #ifndef _LWPOBJECTID_HXX
      71                 :            : #include "lwpobjid.hxx"
      72                 :            : #endif
      73                 :            : 
      74                 :            : #ifndef _LWPOBJECTSTREAM_HXX
      75                 :            : #include "lwpobjstrm.hxx"
      76                 :            : #endif
      77                 :            : 
      78                 :            : #include "lwpcolor.hxx"
      79                 :            : #include "lwpbasetype.hxx"
      80                 :            : #include "lwpfont.hxx"
      81                 :            : #include "lwpdropcapmgr.hxx"
      82                 :            : class LwpDocument;
      83                 :            : class LwpBookMark;
      84                 :            : 
      85                 :            : #include <vector>
      86                 :            : #define TAG_USER_VERSION    0x72655655UL        // "UVer"
      87                 :            : 
      88                 :            : 
      89                 :            : class LwpVersionManager
      90                 :            : {
      91                 :            : public:
      92                 :         27 :     LwpVersionManager(){}
      93                 :         24 :     ~LwpVersionManager(){}
      94                 :            : public:
      95                 :            :     void Read(LwpObjectStream *pStrm);
      96                 :            :     void Skip(LwpObjectStream *pStrm);
      97                 :            : };
      98                 :            : 
      99                 :            : class LwpObjectManager
     100                 :            : {
     101                 :            : public:
     102                 :         27 :     LwpObjectManager(){}
     103                 :         24 :     ~LwpObjectManager(){}
     104                 :            : private:
     105                 :            :     LwpObjectID m_Division;
     106                 :            : public:
     107                 :            :     void Read(LwpObjectStream *pStrm);
     108                 :            : };
     109                 :            : 
     110                 :            : class LwpNumberManager
     111                 :            : {
     112                 :            : public:
     113                 :         27 :     LwpNumberManager(){}
     114                 :         24 :     ~LwpNumberManager(){}
     115                 :            : private:
     116                 :            :     LwpObjectID m_TableRange;
     117                 :            : public:
     118                 :            :     void Read(LwpObjectStream *pStrm);
     119                 :          3 :     LwpObjectID GetTableRangeID(){ return m_TableRange;}
     120                 :            : };
     121                 :            : 
     122                 :            : class LwpBulletManager
     123                 :            : {
     124                 :            : public:
     125                 :         27 :     LwpBulletManager(){}
     126                 :         24 :     ~LwpBulletManager(){}
     127                 :            : private:
     128                 :            :     LwpObjectID m_Head;
     129                 :            : public:
     130                 :            :     void Read(LwpObjectStream *pStrm);
     131                 :         24 :     LwpObjectID* GetHeadID() { return &m_Head;}
     132                 :            : };
     133                 :            : 
     134                 :            : class LwpContent;
     135                 :            : class LwpContentManager
     136                 :            : {
     137                 :            : public:
     138                 :         27 :     LwpContentManager(){}
     139                 :         24 :     ~LwpContentManager(){}
     140                 :            : private:
     141                 :            :     LwpObjectID m_ContentList;
     142                 :            :     LwpObjectID m_EnumHead;
     143                 :            :     LwpObjectID m_EnumTail;
     144                 :            :     LwpObjectID m_OleObjCount;
     145                 :            :     sal_uInt32 m_oldOleObjCount;
     146                 :            : 
     147                 :            :     LwpObjectID m_GrapHead;
     148                 :            :     LwpObjectID m_GrapTail;
     149                 :            :     LwpObjectID m_OleHead;
     150                 :            :     LwpObjectID m_OleTail;
     151                 :            : public:
     152                 :         24 :     inline LwpObjectID* GetContentList() { return &m_ContentList; }
     153                 :         24 :     inline LwpObjectID* GetGraphicListHead() { return &m_GrapHead; }
     154                 :            :     LwpContent* EnumContents(LwpContent* pContent);
     155                 :            : 
     156                 :            : public:
     157                 :            :     void Read(LwpObjectStream *pStrm);
     158                 :            : };
     159                 :            : 
     160                 :            : class LwpPieceManager
     161                 :            : {
     162                 :            : public:
     163                 :         15 :     LwpPieceManager(){}
     164                 :         12 :     ~LwpPieceManager(){}
     165                 :            : private:
     166                 :            :     LwpObjectID m_GeometryPieceList;
     167                 :            :     LwpObjectID m_ScalePieceList;
     168                 :            :     LwpObjectID m_MarginsPieceList;
     169                 :            :     LwpObjectID m_ColumnsPieceList;
     170                 :            :     LwpObjectID m_BorderStuffPieceList;
     171                 :            :     LwpObjectID m_GutterStuffPieceList;
     172                 :            :     LwpObjectID m_BackgroundStuffPieceList;
     173                 :            :     LwpObjectID m_JoinStuffPieceList;
     174                 :            :     LwpObjectID m_ShadowPieceList;
     175                 :            :     LwpObjectID m_NumericsPieceList;
     176                 :            :     LwpObjectID m_RelativityPieceList;
     177                 :            :     LwpObjectID m_AlignmentPieceList;
     178                 :            :     LwpObjectID m_IndentPieceList;
     179                 :            :     LwpObjectID m_ParaBorderPieceList;
     180                 :            :     LwpObjectID m_SpacingPieceList;
     181                 :            :     LwpObjectID m_BreaksPieceList;
     182                 :            :     LwpObjectID m_NumberingPieceList;
     183                 :            :     LwpObjectID m_TabPieceList;
     184                 :            :     LwpObjectID m_CharacterBorderPieceList;
     185                 :            :     LwpObjectID m_AmikakePieceList;
     186                 :            : 
     187                 :            :     LwpObjectID m_ParaBackgroundPieceList;
     188                 :            :     LwpObjectID m_ExternalBorderStuffPieceList;
     189                 :            :     LwpObjectID m_ExternalJoinStuffPieceList;
     190                 :            : 
     191                 :            : public:
     192                 :            :     void Read(LwpObjectStream *pStrm);
     193                 :            : };
     194                 :            : 
     195                 :            : class LwpOrderedObject;
     196                 :            : class LwpListList;
     197                 :            : class LwpOrderedObjectManager
     198                 :            : {
     199                 :            : public:
     200                 :         27 :     LwpOrderedObjectManager(){}
     201                 :         24 :     ~LwpOrderedObjectManager(){}
     202                 :            : protected:
     203                 :            :     LwpObjectID m_Head;
     204                 :            : public:
     205                 :            :     void Read(LwpObjectStream *pStrm);
     206                 :            :     LwpObjectID* GetHeadID() { return &m_Head;}
     207                 :            :     LwpOrderedObject* Enumerate(LwpOrderedObject* pLast);
     208                 :            : protected:
     209                 :            :     LwpListList* GetNextActiveListList(LwpListList* pLast);
     210                 :            : };
     211                 :            : 
     212                 :            : class LwpStyleManager;
     213                 :            : class LwpSection;
     214                 :            : class LwpBulletStyleMgr;
     215                 :            : class LwpFoundry
     216                 :            : {
     217                 :            : public:
     218                 :            :     LwpFoundry( LwpObjectStream *pStrm, LwpDocument* pDoc );
     219                 :            :     ~LwpFoundry();
     220                 :            :     void Read(LwpObjectStream *pStrm);
     221                 :            :     void RegisterAllLayouts();
     222                 :            : private:
     223                 :            :     LwpDocument* m_pDoc;
     224                 :            :     bool m_bRegisteredAll;
     225                 :            : private: //file members
     226                 :            :     LwpVersionManager m_VerMgr;
     227                 :            :     LwpObjectManager m_ObjMgr;
     228                 :            :     LwpObjectID m_MarkerHead;
     229                 :            :     LwpObjectID m_FootnoteMgr;
     230                 :            :     LwpNumberManager m_NumMgr;
     231                 :            :     LwpBulletManager m_BulMgr;
     232                 :            :     LwpOrderedObjectManager m_SectionList;
     233                 :            : 
     234                 :            :     LwpObjectID m_Layout;   //The head layout
     235                 :            :     LwpObjectID m_TextStyle;
     236                 :            :     LwpObjectID m_DefaultTextStyle;
     237                 :            :     LwpObjectID m_DefaultClickStyle;
     238                 :            :     LwpObjectID m_PageStyle;
     239                 :            :     LwpObjectID m_FrameStyle;
     240                 :            :     LwpObjectID m_TableStyle;
     241                 :            :     LwpObjectID m_CellStyle;
     242                 :            :     LwpObjectID m_DftFrameStyle;
     243                 :            :     LwpObjectID m_DftPageStyle;
     244                 :            :     LwpObjectID m_DftTableStyle;
     245                 :            :     LwpObjectID m_DftCellStyle;
     246                 :            :     LwpObjectID m_DftColumnStyle;
     247                 :            :     LwpObjectID m_DftLeftColumnStyle;
     248                 :            :     LwpObjectID m_DftRighColumnStyle;
     249                 :            : 
     250                 :            :     LwpObjectID m_BookMarkHead;
     251                 :            :     LwpObjectID m_DdeLinkHead;
     252                 :            :     LwpObjectID m_DirtBagHead;
     253                 :            :     LwpObjectID m_NamedOutlineSeqHead;
     254                 :            :     LwpObjectID m_EnumLayoutHead;
     255                 :            :     LwpObjectID m_EnumLayoutTail;
     256                 :            : 
     257                 :            :     LwpObjectID m_NamedObjects;
     258                 :            :     sal_uInt32 m_nLastClickHere;
     259                 :            : 
     260                 :            :     LwpObjectID m_SmartTextMgr;
     261                 :            : 
     262                 :            :     LwpContentManager m_ContentMgr;
     263                 :            :     LwpFontManager m_FontMgr;
     264                 :            :     LwpPieceManager* m_pPieceMgr;
     265                 :            : 
     266                 :            :     LwpObjectID m_DftDropCapStyle;
     267                 :            :     LwpObjectID m_DftHeaderStyle;
     268                 :            : 
     269                 :            :     LwpObjectID m_DftFooterStyle;
     270                 :            : private:
     271                 :            :     void ReadStyles(LwpObjectStream *pStrm);
     272                 :            : public:
     273                 :         24 :     inline LwpContentManager* GetContentManager() { return &m_ContentMgr; }
     274                 :         24 :     inline LwpObjectID* GetGraphicListHead() { return m_ContentMgr.GetGraphicListHead(); }
     275                 :        774 :     inline LwpFontManager* GetFontManger() { return &m_FontMgr;}
     276                 :         24 :     inline LwpObjectID* GetTextStyleHead()  { return &m_TextStyle;}
     277                 :         21 :     inline LwpObjectID* GetLayout() {return &m_Layout;}
     278                 :         24 :     inline LwpObjectID* GetBulletManagerID() { return m_BulMgr.GetHeadID();}
     279                 :        714 :     inline LwpDocument* GetDocument(){ return m_pDoc;}
     280                 :          3 :     inline LwpNumberManager* GetNumberManager() { return &m_NumMgr;}
     281                 :            :     LwpObjectID * GetDefaultTextStyle() ;
     282                 :            : private:
     283                 :            :     LwpStyleManager* m_pStyleMgr;
     284                 :            :     LwpDropcapMgr* m_pDropcapMgr;
     285                 :            :     LwpBulletStyleMgr* m_pBulletStyleMgr;
     286                 :            : public:
     287                 :        990 :     inline LwpStyleManager* GetStyleManager() { return m_pStyleMgr;}
     288                 :            :     LwpBookMark* GetBookMark(LwpObjectID objMarker);
     289                 :          0 :     LwpDropcapMgr* GetDropcapMgr(){return m_pDropcapMgr;}
     290                 :            :     LwpContent* EnumContents(LwpContent* pContent);
     291                 :            :     LwpSection* EnumSections(LwpSection* pSection);
     292                 :       1233 :     LwpBulletStyleMgr* GetBulletStyleMgr(){return m_pBulletStyleMgr;}
     293                 :            : 
     294                 :            :     LwpObjectID* FindParaStyleByName(OUString name);
     295                 :            :     OUString FindActuralStyleName(OUString name);
     296                 :            : };
     297                 :            : 
     298                 :            : class LwpStyleManager
     299                 :            : {
     300                 :            : public:
     301                 :            :     LwpStyleManager();
     302                 :            :     ~LwpStyleManager();
     303                 :            : private:
     304                 :            :     LwpFoundry* m_pFoundry;
     305                 :            :     struct hashFunc
     306                 :            :     {
     307                 :        990 :             size_t operator()( const LwpObjectID& rName ) const
     308                 :            :             {
     309                 :        990 :                 return rName.HashCode();
     310                 :            :             }
     311                 :            :     };
     312                 :            :     struct eqFunc
     313                 :            :     {
     314                 :        792 :             bool operator()( const LwpObjectID& rKey1, const LwpObjectID& rKey2 ) const
     315                 :            :             {
     316                 :        792 :                 return(rKey1==rKey2);
     317                 :            :             }
     318                 :            :     };
     319                 :            : 
     320                 :            :     typedef boost::unordered_map<LwpObjectID, IXFStyle*, hashFunc, eqFunc> LwpStyleMap;
     321                 :            :     LwpStyleMap m_StyleList;
     322                 :            : public:
     323                 :         27 :     void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;}
     324                 :            :     IXFStyle* AddStyle(LwpObjectID styleObjID, IXFStyle* pStyle);
     325                 :            :     IXFStyle* GetStyle(const LwpObjectID &styleObjID);
     326                 :            : };
     327                 :            : #endif
     328                 :            : 
     329                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10