LCOV - code coverage report
Current view: top level - include/svx - nbdtmg.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 42 0.0 %
Date: 2014-04-14 Functions: 0 26 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             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : #ifndef INCLUDED_SVX_NBDTMG_HXX
      20             : #define INCLUDED_SVX_NBDTMG_HXX
      21             : #include <svx/svxdllapi.h>
      22             : #include <boost/shared_ptr.hpp>
      23             : #include <vector>
      24             : #include <editeng/numitem.hxx>
      25             : #include <vcl/font.hxx>
      26             : 
      27             : namespace svx { namespace sidebar {
      28             : 
      29             : #define DEFAULT_BULLET_TYPES                            8
      30             : #define DEFAULT_NONE                                    10
      31             : #define DEFAULT_NUM_TYPE_MEMBER                         5
      32             : #define DEFAULT_NUM_VALUSET_COUNT                       8
      33             : #define DEFAULT_NUMBERING_CACHE_FORMAT_VERSION          0x10
      34             : 
      35             : typedef sal_uInt16 NBOType;
      36             : namespace eNBOType
      37             : {
      38             :     const NBOType BULLETS = 0x01;
      39             :     const NBOType GRAPHICBULLETS = 0x02;
      40             :     const NBOType NUMBERING = 0x03;
      41             :     const NBOType OUTLINE = 0x04;
      42             :     const NBOType MIXBULLETS = 0x05;
      43             : }
      44             : 
      45             : typedef sal_uInt16 NBType;
      46             : namespace eNBType
      47             : {
      48             :     const NBOType BULLETS = 0x01;
      49             :     const NBOType GRAPHICBULLETS = 0x02;
      50             : }
      51             : 
      52             : class  SVX_DLLPUBLIC NumSettings_Impl
      53             : {
      54             :     public:
      55             :         short       nNumberType;
      56             :         short       nParentNumbering;
      57             :         SvxNumberFormat::LabelFollowedBy eLabelFollowedBy;
      58             :         long        nTabValue;
      59             :         SvxAdjust   eNumAlign;
      60             :         long            nNumAlignAt;
      61             :         long            nNumIndentAt;
      62             :         rtl::OUString   sPrefix;
      63             :         rtl::OUString   sSuffix;
      64             :         rtl::OUString   sBulletChar;
      65             :         rtl::OUString   sBulletFont;
      66             :         SvxBrushItem   *pBrushItem;
      67             :         Size            aSize;
      68             : 
      69             :     public:
      70           0 :         NumSettings_Impl()
      71             :             : nNumberType(0)
      72             :             , nParentNumbering(0)
      73             :             , eLabelFollowedBy(SvxNumberFormat::NOTHING)
      74             :             , nTabValue (0)
      75             :             , eNumAlign(SVX_ADJUST_LEFT)
      76             :             , nNumAlignAt(0)
      77             :             , nNumIndentAt(0)
      78             :             , pBrushItem(0)
      79           0 :             , aSize(0,0)
      80           0 :         {}
      81           0 :         ~NumSettings_Impl(){}
      82             : };
      83             : 
      84             : typedef NumSettings_Impl* NumSettings_ImplPtr;
      85             : typedef std::vector< boost::shared_ptr<NumSettings_Impl> > NumSettingsArr_Impl;
      86             : 
      87             : class  SVX_DLLPUBLIC BulletsSettings
      88             : {
      89             :     public:
      90             :         bool            bIsCustomized;
      91             :         rtl::OUString   sDescription;
      92             :         NBType          eType;
      93             :     public:
      94           0 :         BulletsSettings(NBType eTy) :
      95             :             bIsCustomized(false),
      96           0 :             eType(eTy)
      97           0 :             {}
      98           0 :         virtual ~BulletsSettings(){}
      99             : };
     100             : 
     101             : class  SVX_DLLPUBLIC BulletsSettings_Impl:public BulletsSettings
     102             : {
     103             :     public:
     104             :         sal_Unicode cBulletChar;
     105             :         Font            aFont;
     106             : 
     107             :     public:
     108           0 :         BulletsSettings_Impl(NBType eTy)
     109             :             : BulletsSettings(eTy)
     110           0 :             , cBulletChar(0)
     111           0 :             {}
     112           0 :         virtual ~BulletsSettings_Impl(){}
     113             : };
     114             : 
     115             : class  SVX_DLLPUBLIC GrfBulDataRelation: public BulletsSettings
     116             : {
     117             :     public:
     118             :         OUString    sGrfName;
     119             :         sal_uInt16  nTabIndex;
     120             :         sal_uInt16  nGallaryIndex;
     121             :         const Graphic*  pGrfObj;
     122             :         Size aSize;
     123           0 :     GrfBulDataRelation(NBType eTy):
     124             :         BulletsSettings(eTy),
     125             :         nTabIndex((sal_uInt16)0xFFFF),
     126             :         nGallaryIndex((sal_uInt16)0xFFFF),
     127             :         pGrfObj(0),
     128           0 :         aSize(0,0)
     129           0 :     {}
     130           0 :     virtual ~GrfBulDataRelation(){}
     131             : };
     132             : 
     133             : class  SVX_DLLPUBLIC MixBulletsSettings_Impl
     134             : {
     135             :     public:
     136             :         NBType          eType;
     137             :         sal_uInt16          nIndex; //index in the tab page display
     138             :         sal_uInt16          nIndexDefault;
     139             :         BulletsSettings*    pBullets;
     140             :     public:
     141           0 :         MixBulletsSettings_Impl(NBType eTy) :
     142             :             eType(eTy),
     143             :             nIndex((sal_uInt16)0xFFFF),
     144             :             nIndexDefault((sal_uInt16)0xFFFF),
     145           0 :             pBullets(0)
     146           0 :             {}
     147             :         ~MixBulletsSettings_Impl(){}
     148             : };
     149             : 
     150             : class  SVX_DLLPUBLIC NumberSettings_Impl
     151             : {
     152             :     public:
     153             :         bool            bIsCustomized;
     154             :         rtl::OUString   sDescription;
     155             :         sal_uInt16      nIndex; //index in the tab page display
     156             :         sal_uInt16      nIndexDefault;
     157             :         NumSettings_Impl    *pNumSetting;
     158             :     public:
     159           0 :         NumberSettings_Impl() :
     160             :             bIsCustomized(false),
     161             :             nIndex((sal_uInt16)0xFFFF),
     162             :             nIndexDefault((sal_uInt16)0xFFFF),
     163           0 :             pNumSetting(NULL)
     164           0 :             {}
     165           0 :         ~NumberSettings_Impl(){}
     166             : };
     167             : 
     168             : typedef NumberSettings_Impl* NumberSettings_ImplPtr;
     169             : typedef std::vector< boost::shared_ptr<NumberSettings_Impl> > NumberSettingsArr_Impl;
     170             : 
     171             : class  SVX_DLLPUBLIC OutlineSettings_Impl
     172             : {
     173             :     public:
     174             :         bool            bIsCustomized;
     175             :         rtl::OUString   sDescription;
     176             :         NumSettingsArr_Impl *pNumSettingsArr;
     177             :     public:
     178           0 :         OutlineSettings_Impl() :
     179             :             bIsCustomized(false),
     180           0 :             pNumSettingsArr(NULL)
     181           0 :             {}
     182             :         ~OutlineSettings_Impl(){
     183             :         }
     184             : };
     185             : 
     186             : class SVX_DLLPUBLIC NBOTypeMgrBase
     187             : {
     188             :     public:
     189             :         NBOType         eType;
     190             :     private:
     191             :         const SfxItemSet*   pSet;
     192             :         SfxMapUnit      eCoreUnit;
     193             :         // store the attributes passed from pSet
     194             :         OUString        aNumCharFmtName;
     195             :         void            StoreBulCharFmtName_impl();
     196             :         void            StoreMapUnit_impl();
     197             : 
     198             :     public:
     199           0 :         NBOTypeMgrBase(const NBOType aType)
     200             :             : eType(aType)
     201             :             , pSet(0)
     202             :             , eCoreUnit(SFX_MAPUNIT_TWIP)
     203             :             , aNumCharFmtName(OUString())
     204           0 :             , bIsLoading(false)
     205           0 :         {}
     206             :         NBOTypeMgrBase(const NBOType aType,const SfxItemSet* pArg)
     207             :             : eType(aType)
     208             :             , pSet(pArg)
     209             :             , eCoreUnit(SFX_MAPUNIT_TWIP)
     210             :             , aNumCharFmtName(OUString())
     211             :             , bIsLoading(false)
     212             :         {}
     213           0 :         NBOTypeMgrBase(const NBOTypeMgrBase& aTypeMgr)
     214           0 :         {
     215           0 :             eType = aTypeMgr.eType;
     216           0 :             pSet = aTypeMgr.pSet;
     217           0 :             eCoreUnit = aTypeMgr.eCoreUnit;
     218           0 :             aNumCharFmtName = aTypeMgr.aNumCharFmtName;
     219           0 :             bIsLoading = false;
     220           0 :         }
     221           0 :         virtual ~NBOTypeMgrBase() {}
     222             :         virtual void Init()=0;
     223             :         virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0)=0;
     224             :         virtual bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF)=0;
     225             :         virtual bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF, bool isDefault=false,bool isResetSize=false)=0;
     226             :         virtual OUString GetDescription(sal_uInt16 nIndex,bool isDefault=false)=0;
     227             :         virtual bool IsCustomized(sal_uInt16 nIndex)=0;
     228             :         sal_uInt16 IsSingleLevel(sal_uInt16 nCurLevel);
     229             :         const SfxItemSet* GetItems() { return pSet;}
     230             :         // store the attributes passed from pSet
     231           0 :         void SetItems(const SfxItemSet* pArg) { pSet = pArg;StoreBulCharFmtName_impl();StoreMapUnit_impl();}
     232             :     protected:
     233             :         OUString GetBulCharFmtName();
     234             :         SfxMapUnit GetMapUnit();
     235             :     protected:
     236             :         bool    bIsLoading;
     237             :         void    ImplLoad(const OUString& filename);
     238             :         void    ImplStore(const OUString& filename);
     239             : 
     240             : };
     241             : 
     242             : 
     243             : class SVX_DLLPUBLIC BulletsTypeMgr: public NBOTypeMgrBase
     244             : {
     245             :     friend class OutlineTypeMgr;
     246             :     friend class NumberingTypeMgr;
     247             :     public:
     248             :         static sal_Unicode aDynamicBulletTypes[DEFAULT_BULLET_TYPES];
     249             :         static sal_Unicode aDynamicRTLBulletTypes[DEFAULT_BULLET_TYPES];
     250             :         static BulletsSettings_Impl* pActualBullets[DEFAULT_BULLET_TYPES];
     251             :     public:
     252             :         BulletsTypeMgr();
     253             :         BulletsTypeMgr(const BulletsTypeMgr& aTypeMgr);
     254           0 :         virtual ~BulletsTypeMgr() {}
     255             :         virtual void Init() SAL_OVERRIDE;
     256             :         virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) SAL_OVERRIDE;
     257             :         virtual bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF) SAL_OVERRIDE;
     258             :         virtual bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF,bool isDefault=false,bool isResetSize=false) SAL_OVERRIDE;
     259             :         virtual OUString GetDescription(sal_uInt16 nIndex,bool isDefault=false) SAL_OVERRIDE;
     260             :         virtual bool IsCustomized(sal_uInt16 nIndex) SAL_OVERRIDE;
     261             :         sal_Unicode GetBulChar(sal_uInt16 nIndex);
     262             :         Font GetBulCharFont(sal_uInt16 nIndex);
     263             :         static BulletsTypeMgr& GetInstance();
     264             : };
     265             : 
     266             : class SVX_DLLPUBLIC GraphyicBulletsTypeMgr: public NBOTypeMgrBase
     267             : {
     268             :     friend class OutlineTypeMgr;
     269             :     friend class NumberingTypeMgr;
     270             :     public:
     271             :         typedef std::vector<GrfBulDataRelation*> ListType;
     272             :         ListType aGrfDataLst;
     273             :     public:
     274             :         GraphyicBulletsTypeMgr();
     275             :         GraphyicBulletsTypeMgr(const GraphyicBulletsTypeMgr& aTypeMgr);
     276             :         virtual ~GraphyicBulletsTypeMgr();
     277             :         virtual void Init() SAL_OVERRIDE;
     278             :         virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) SAL_OVERRIDE;
     279             :         virtual bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF) SAL_OVERRIDE;
     280             :         virtual bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF,bool isDefault=false,bool isResetSize=false) SAL_OVERRIDE;
     281             :         virtual OUString GetDescription(sal_uInt16 nIndex,bool isDefault=false) SAL_OVERRIDE;
     282             :         virtual bool IsCustomized(sal_uInt16 nIndex) SAL_OVERRIDE;
     283             :         OUString GetGrfName(sal_uInt16 nIndex);
     284             :         static GraphyicBulletsTypeMgr& GetInstance();
     285             : };
     286             : 
     287             : class SVX_DLLPUBLIC MixBulletsTypeMgr: public NBOTypeMgrBase
     288             : {
     289             :     friend class OutlineTypeMgr;
     290             :     friend class NumberingTypeMgr;
     291             :     public:
     292             :         static MixBulletsSettings_Impl* pActualBullets[DEFAULT_BULLET_TYPES];
     293             :         static MixBulletsSettings_Impl* pDefaultActualBullets[DEFAULT_BULLET_TYPES];
     294             :     public:
     295             :         MixBulletsTypeMgr();
     296             :         MixBulletsTypeMgr(const MixBulletsTypeMgr& aTypeMgr);
     297           0 :         virtual ~MixBulletsTypeMgr() {}
     298             :         virtual void Init() SAL_OVERRIDE;
     299             :         virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) SAL_OVERRIDE;
     300             :         virtual bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF) SAL_OVERRIDE;
     301             :         virtual bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF,bool isDefault=false,bool isResetSize=false) SAL_OVERRIDE;
     302             :         virtual OUString GetDescription(sal_uInt16 nIndex,bool isDefault=false) SAL_OVERRIDE;
     303             :         virtual bool IsCustomized(sal_uInt16 nIndex) SAL_OVERRIDE;
     304             :         static MixBulletsTypeMgr& GetInstance();
     305             : };
     306             : 
     307             : class SVX_DLLPUBLIC NumberingTypeMgr: public NBOTypeMgrBase
     308             : {
     309             :     public:
     310             :         NumberSettingsArr_Impl*     pNumberSettingsArr;
     311             :         NumberSettingsArr_Impl*     pDefaultNumberSettingsArr;
     312             :     public:
     313             :         NumberingTypeMgr();
     314             :         NumberingTypeMgr(const NumberingTypeMgr& aTypeMgr);
     315             :         virtual ~NumberingTypeMgr();
     316             :         virtual void Init() SAL_OVERRIDE;
     317             :         virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) SAL_OVERRIDE;
     318             :         virtual bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF) SAL_OVERRIDE;
     319             :         virtual bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF,bool isDefault=false,bool isResetSize=false) SAL_OVERRIDE;
     320             :         virtual OUString GetDescription(sal_uInt16 nIndex,bool isDefault=false) SAL_OVERRIDE;
     321             :         virtual bool IsCustomized(sal_uInt16 nIndex) SAL_OVERRIDE;
     322             :         static NumberingTypeMgr& GetInstance();
     323             : };
     324             : 
     325             : class SVX_DLLPUBLIC OutlineTypeMgr: public NBOTypeMgrBase
     326             : {
     327             :     public:
     328             :         OutlineSettings_Impl*       pOutlineSettingsArrs[DEFAULT_NUM_VALUSET_COUNT];
     329             :         OutlineSettings_Impl*       pDefaultOutlineSettingsArrs[DEFAULT_NUM_VALUSET_COUNT];
     330             :     public:
     331             :         OutlineTypeMgr();
     332             :         OutlineTypeMgr(const OutlineTypeMgr& aTypeMgr);
     333           0 :         virtual ~OutlineTypeMgr() {}
     334             :         virtual void Init() SAL_OVERRIDE;
     335             :         virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) SAL_OVERRIDE;
     336             :         virtual bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF) SAL_OVERRIDE;
     337             :         virtual bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF,bool isDefault=false,bool isResetSize=false) SAL_OVERRIDE;
     338             :         virtual OUString GetDescription(sal_uInt16 nIndex,bool isDefault=false) SAL_OVERRIDE;
     339             :         virtual bool IsCustomized(sal_uInt16 nIndex) SAL_OVERRIDE;
     340             :         static OutlineTypeMgr& GetInstance();
     341             : };
     342             : }}
     343             : #endif
     344             : 
     345             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10