fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / svx / nbdtmg.hxx
blobeb75368a52745285cf252ef7b6304d73d41f5d7e
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #ifndef _NBDTMG_HXX
19 #define _NBDTMG_HXX
20 #include "svx/svxdllapi.h"
21 #include <boost/shared_ptr.hpp>
22 #include <vector>
23 #include <editeng/numitem.hxx>
24 #include <vcl/font.hxx>
26 namespace svx { namespace sidebar {
28 #define DEFAULT_BULLET_TYPES 8
29 #define DEFAULT_NONE 10
30 #define DEFAULT_NUM_TYPE_MEMBER 5
31 #define DEFAULT_NUM_VALUSET_COUNT 8
32 #define DEFAULT_NUMBERING_CACHE_FORMAT_VERSION 0x10
34 typedef sal_uInt16 NBOType;
35 namespace eNBOType
37 const NBOType BULLETS = 0x01;
38 const NBOType GRAPHICBULLETS = 0x02;
39 const NBOType NUMBERING = 0x03;
40 const NBOType OUTLINE = 0x04;
41 const NBOType MIXBULLETS = 0x05;
44 typedef sal_uInt16 NBType;
45 namespace eNBType
47 const NBOType BULLETS = 0x01;
48 const NBOType GRAPHICBULLETS = 0x02;
51 class SVX_DLLPUBLIC NumSettings_Impl
53 public:
54 short nNumberType;
55 short nParentNumbering;
56 SvxNumberFormat::LabelFollowedBy eLabelFollowedBy;
57 long nTabValue;
58 SvxAdjust eNumAlign;
59 long nNumAlignAt;
60 long nNumIndentAt;
61 rtl::OUString sPrefix;
62 rtl::OUString sSuffix;
63 rtl::OUString sBulletChar;
64 rtl::OUString sBulletFont;
65 SvxBrushItem *pBrushItem;
66 Size aSize;
68 public:
69 NumSettings_Impl()
70 : nNumberType(0)
71 , nParentNumbering(0)
72 , pBrushItem(0)
73 , aSize(0,0)
75 ~NumSettings_Impl(){}
78 typedef NumSettings_Impl* NumSettings_ImplPtr;
79 typedef std::vector< boost::shared_ptr<NumSettings_Impl> > NumSettingsArr_Impl;
81 class SVX_DLLPUBLIC BulletsSettings
83 public:
84 sal_Bool bIsCustomized;
85 rtl::OUString sDescription;
86 NBType eType;
87 public:
88 BulletsSettings(NBType eTy) :
89 bIsCustomized(sal_False),
90 eType(eTy)
92 virtual ~BulletsSettings(){}
95 class SVX_DLLPUBLIC BulletsSettings_Impl:public BulletsSettings
97 public:
98 sal_Unicode cBulletChar;
99 //rtl::OUString sBulletFont;
100 Font aFont;
102 public:
103 BulletsSettings_Impl(NBType eTy) :
104 BulletsSettings(eTy)
106 virtual ~BulletsSettings_Impl(){}
109 class SVX_DLLPUBLIC GrfBulDataRelation: public BulletsSettings
111 public:
112 String sGrfName;
113 sal_uInt16 nTabIndex;
114 sal_uInt16 nGallaryIndex;
115 const Graphic* pGrfObj;
116 Size aSize;
117 GrfBulDataRelation(NBType eTy):
118 BulletsSettings(eTy),
119 nTabIndex((sal_uInt16)0xFFFF),
120 nGallaryIndex((sal_uInt16)0xFFFF),
121 pGrfObj(0),
122 aSize(0,0)
124 virtual ~GrfBulDataRelation(){}
127 class SVX_DLLPUBLIC MixBulletsSettings_Impl
129 public:
130 NBType eType;
131 sal_uInt16 nIndex; //index in the tab page display
132 sal_uInt16 nIndexDefault;
133 BulletsSettings* pBullets;
134 public:
135 MixBulletsSettings_Impl(NBType eTy) :
136 eType(eTy),
137 nIndex((sal_uInt16)0xFFFF),
138 nIndexDefault((sal_uInt16)0xFFFF),
139 pBullets(0)
141 ~MixBulletsSettings_Impl(){}
144 class SVX_DLLPUBLIC NumberSettings_Impl
146 public:
147 sal_Bool bIsCustomized;
148 rtl::OUString sDescription;
149 sal_uInt16 nIndex; //index in the tab page display
150 sal_uInt16 nIndexDefault;
151 NumSettings_Impl *pNumSetting;
152 public:
153 NumberSettings_Impl() :
154 bIsCustomized(sal_False),
155 nIndex((sal_uInt16)0xFFFF),
156 nIndexDefault((sal_uInt16)0xFFFF),
157 pNumSetting(NULL)
159 ~NumberSettings_Impl(){}
162 typedef NumberSettings_Impl* NumberSettings_ImplPtr;
163 typedef std::vector< boost::shared_ptr<NumberSettings_Impl> > NumberSettingsArr_Impl;
165 class SVX_DLLPUBLIC OutlineSettings_Impl
167 public:
168 sal_Bool bIsCustomized;
169 rtl::OUString sDescription;
170 NumSettingsArr_Impl *pNumSettingsArr;
171 public:
172 OutlineSettings_Impl() :
173 bIsCustomized(sal_False),
174 pNumSettingsArr(NULL)
176 ~OutlineSettings_Impl(){
180 class SVX_DLLPUBLIC NBOTypeMgrBase
182 public:
183 NBOType eType;
184 private:
185 const SfxItemSet* pSet;
186 SfxMapUnit eCoreUnit;
187 //Sym3_2508 store the attributes passed from pSet
188 String aNumCharFmtName;
189 void StoreBulCharFmtName_impl();
190 void StoreMapUnit_impl();
192 public:
193 NBOTypeMgrBase(const NBOType aType):eType(aType),pSet(0),eCoreUnit(SFX_MAPUNIT_TWIP),aNumCharFmtName(String()){}
194 NBOTypeMgrBase(const NBOType aType,const SfxItemSet* pArg):eType(aType),pSet(pArg),eCoreUnit(SFX_MAPUNIT_TWIP),aNumCharFmtName(String()){}
195 NBOTypeMgrBase(const NBOTypeMgrBase& aTypeMgr){eType = aTypeMgr.eType;pSet = aTypeMgr.pSet;eCoreUnit = aTypeMgr.eCoreUnit;aNumCharFmtName = aTypeMgr.aNumCharFmtName; }
196 virtual ~NBOTypeMgrBase() {}
197 virtual void Init()=0;
198 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0)=0;
199 virtual sal_Bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF)=0;
200 virtual sal_Bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF, sal_Bool isDefault=false,sal_Bool isResetSize=false)=0;
201 virtual String GetDescription(sal_uInt16 nIndex,sal_Bool isDefault=false)=0;
202 virtual sal_Bool IsCustomized(sal_uInt16 nIndex)=0;
203 sal_uInt16 IsSingleLevel(sal_uInt16 nCurLevel);
204 const SfxItemSet* GetItems() { return pSet;}
205 //Sym3_2508 store the attributes passed from pSet
206 void SetItems(const SfxItemSet* pArg) { pSet = pArg;StoreBulCharFmtName_impl();StoreMapUnit_impl();}
207 protected:
208 String GetBulCharFmtName();
209 SfxMapUnit GetMapUnit();
210 protected:
211 sal_Bool bIsLoading;
212 void ImplLoad(String filename);
213 void ImplStore(String filename);
218 class SVX_DLLPUBLIC BulletsTypeMgr: public NBOTypeMgrBase
220 friend class OutlineTypeMgr;
221 friend class NumberingTypeMgr;
222 public:
223 static sal_Unicode aDynamicBulletTypes[DEFAULT_BULLET_TYPES];
224 static sal_Unicode aDynamicRTLBulletTypes[DEFAULT_BULLET_TYPES];
225 static BulletsSettings_Impl* pActualBullets[DEFAULT_BULLET_TYPES];
226 static BulletsTypeMgr* _instance;
227 public:
228 BulletsTypeMgr(const NBOType aType);
229 BulletsTypeMgr(const NBOType aType,const SfxItemSet* pArg);
230 BulletsTypeMgr(const BulletsTypeMgr& aTypeMgr);
231 virtual ~BulletsTypeMgr() {}
232 virtual void Init();
233 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0);
234 virtual sal_Bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF);
235 virtual sal_Bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF,sal_Bool isDefault=false,sal_Bool isResetSize=false);
236 virtual String GetDescription(sal_uInt16 nIndex,sal_Bool isDefault=false);
237 virtual sal_Bool IsCustomized(sal_uInt16 nIndex);
238 sal_Unicode GetBulChar(sal_uInt16 nIndex);
239 Font GetBulCharFont(sal_uInt16 nIndex);
240 static BulletsTypeMgr* GetInstance()
242 if ( _instance == 0 )
244 _instance = new BulletsTypeMgr(eNBOType::BULLETS);
247 return _instance;
252 class SVX_DLLPUBLIC GraphyicBulletsTypeMgr: public NBOTypeMgrBase
254 friend class OutlineTypeMgr;
255 friend class NumberingTypeMgr;
256 public:
257 typedef std::vector<GrfBulDataRelation*> ListType;
258 ListType aGrfDataLst;
259 static GraphyicBulletsTypeMgr* _instance;
260 public:
261 GraphyicBulletsTypeMgr(const NBOType aType);
262 GraphyicBulletsTypeMgr(const NBOType aType,const SfxItemSet* pArg);
263 GraphyicBulletsTypeMgr(const GraphyicBulletsTypeMgr& aTypeMgr);
264 virtual ~GraphyicBulletsTypeMgr();
265 virtual void Init();
266 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0);
267 virtual sal_Bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF);
268 virtual sal_Bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF,sal_Bool isDefault=false,sal_Bool isResetSize=false);
269 virtual String GetDescription(sal_uInt16 nIndex,sal_Bool isDefault=false);
270 virtual sal_Bool IsCustomized(sal_uInt16 nIndex);
271 String GetGrfName(sal_uInt16 nIndex);
272 static GraphyicBulletsTypeMgr* GetInstance()
274 if ( _instance == 0 )
276 _instance = new GraphyicBulletsTypeMgr(eNBOType::BULLETS);
279 return _instance;
284 class SVX_DLLPUBLIC MixBulletsTypeMgr: public NBOTypeMgrBase
286 friend class OutlineTypeMgr;
287 friend class NumberingTypeMgr;
288 public:
289 static MixBulletsSettings_Impl* pActualBullets[DEFAULT_BULLET_TYPES];
290 static MixBulletsSettings_Impl* pDefaultActualBullets[DEFAULT_BULLET_TYPES];
291 static MixBulletsTypeMgr* _instance;
292 public:
293 MixBulletsTypeMgr(const NBOType aType);
294 MixBulletsTypeMgr(const NBOType aType,const SfxItemSet* pArg);
295 MixBulletsTypeMgr(const MixBulletsTypeMgr& aTypeMgr);
296 virtual ~MixBulletsTypeMgr() {}
297 virtual void Init();
298 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0);
299 virtual sal_Bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF);
300 virtual sal_Bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF,sal_Bool isDefault=false,sal_Bool isResetSize=false);
301 virtual String GetDescription(sal_uInt16 nIndex,sal_Bool isDefault=false);
302 virtual sal_Bool IsCustomized(sal_uInt16 nIndex);
303 static MixBulletsTypeMgr* GetInstance()
305 if ( _instance == 0 )
307 _instance = new MixBulletsTypeMgr(eNBOType::MIXBULLETS);
310 return _instance;
315 class SVX_DLLPUBLIC NumberingTypeMgr: public NBOTypeMgrBase
317 public:
318 //NumSettingsArr_Impl* pNumSettingsArr;
319 NumberSettingsArr_Impl* pNumberSettingsArr;
320 NumberSettingsArr_Impl* pDefaultNumberSettingsArr;
321 static NumberingTypeMgr* _instance;
322 public:
323 NumberingTypeMgr(const NBOType aType);
324 NumberingTypeMgr(const NBOType aType,const SfxItemSet* pArg);
325 NumberingTypeMgr(const NumberingTypeMgr& aTypeMgr);
326 virtual ~NumberingTypeMgr() {}
327 virtual void Init();
328 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0);
329 virtual sal_Bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF);
330 virtual sal_Bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF,sal_Bool isDefault=false,sal_Bool isResetSize=false);
331 virtual String GetDescription(sal_uInt16 nIndex,sal_Bool isDefault=false);
332 virtual sal_Bool IsCustomized(sal_uInt16 nIndex);
333 sal_uInt16 GetNumCount() const;
334 NumberSettings_Impl* GetNumSettingByIndex(sal_uInt16 nIndex) const;
335 static NumberingTypeMgr* GetInstance()
337 if ( _instance == 0 )
339 _instance = new NumberingTypeMgr(eNBOType::NUMBERING);
342 return _instance;
346 class SVX_DLLPUBLIC OutlineTypeMgr: public NBOTypeMgrBase
348 public:
349 //NumSettingsArr_Impl* pNumSettingsArrs[DEFAULT_NUM_VALUSET_COUNT];
350 OutlineSettings_Impl* pOutlineSettingsArrs[DEFAULT_NUM_VALUSET_COUNT];
351 OutlineSettings_Impl* pDefaultOutlineSettingsArrs[DEFAULT_NUM_VALUSET_COUNT];
352 static OutlineTypeMgr* _instance;
353 public:
354 OutlineTypeMgr(const NBOType aType);
355 OutlineTypeMgr(const NBOType aType,const SfxItemSet* pArg);
356 OutlineTypeMgr(const OutlineTypeMgr& aTypeMgr);
357 virtual ~OutlineTypeMgr() {}
358 virtual void Init();
359 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0);
360 virtual sal_Bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF);
361 virtual sal_Bool ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF,sal_Bool isDefault=false,sal_Bool isResetSize=false);
362 virtual String GetDescription(sal_uInt16 nIndex,sal_Bool isDefault=false);
363 virtual sal_Bool IsCustomized(sal_uInt16 nIndex);
364 static OutlineTypeMgr* GetInstance()
366 if ( _instance == 0 )
368 _instance = new OutlineTypeMgr(eNBOType::OUTLINE);
371 return _instance;
375 #endif