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

Generated by: LCOV version 1.11