bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / filter / ww8 / ww8toolbar.hxx
blob36a94d4f6c90edceafc0b8d2b1aa0829801fb536
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 #ifndef _WW8TOOLBAR_HXX
10 #define _WW8TOOLBAR_HXX
12 #include <filter/msfilter/mstoolbar.hxx>
14 class Xst : public TBBase
16 OUString sString;
17 public:
18 Xst(){}
19 bool Read(SvStream &rS);
20 OUString getString() { return sString; }
21 void Print( FILE* fp );
24 class SwCTBWrapper;
25 class SwTBC : public TBBase
27 TBCHeader tbch;
28 boost::shared_ptr< sal_uInt32 > cid; // optional
29 boost::shared_ptr<TBCData> tbcd;
30 public:
31 SwTBC();
32 ~SwTBC();
33 bool Read(SvStream &rS);
34 void Print( FILE* );
35 bool ImportToolBarControl( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper&, bool );
36 OUString GetCustomText();
39 class SwCTB : public TBBase
41 Xst name;
42 sal_Int32 cbTBData;
43 TB tb;
44 std::vector<TBVisualData> rVisualData;
45 sal_Int32 iWCTBl;
46 sal_uInt16 reserved;
47 sal_uInt16 unused;
48 sal_Int32 cCtls;
49 std::vector< SwTBC > rTBC;
51 SwCTB(const SwCTB&);
52 SwCTB& operator = ( const SwCTB&);
53 public:
54 SwCTB();
55 ~SwCTB();
56 bool Read(SvStream &rS);
57 void Print( FILE* fp );
58 bool IsMenuToolbar();
59 bool ImportCustomToolBar( SwCTBWrapper&, CustomToolBarImportHelper& );
60 bool ImportMenuTB( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
61 OUString GetName() { return tb.getName().getString(); }
64 class TBDelta : public TBBase
66 sal_uInt8 doprfatendFlags;
68 sal_uInt8 ibts;
69 sal_Int32 cidNext;
70 sal_Int32 cid;
71 sal_Int32 fc;
72 sal_uInt16 CiTBDE; // careful of this ( endian matters etc. )
73 sal_uInt16 cbTBC;
74 public:
75 TBDelta();
76 ~TBDelta(){}
77 bool Read(SvStream &rS);
78 void Print( FILE* );
79 bool ControlIsModified();
80 bool ControlIsInserted();
81 bool ControlIsChanged();
82 bool ControlDropsToolBar();
83 sal_Int32 TBCStreamOffset();
84 sal_Int16 CustomizationIndex();
88 class Tcg255SubStruct : public TBBase
90 friend class Tcg255;
91 bool mbReadId;
92 Tcg255SubStruct(const Tcg255SubStruct&);
93 Tcg255SubStruct& operator = ( const Tcg255SubStruct&);
94 protected:
95 sal_uInt8 ch;
96 public:
97 Tcg255SubStruct( bool bReadId );
98 ~Tcg255SubStruct(){}
99 virtual sal_uInt8 id() const { return ch; }
100 bool Read(SvStream &rS);
103 class SwCTBWrapper;
104 class Customization : public TBBase
106 friend class SwCTBWrapper;
107 sal_Int32 tbidForTBD;
108 sal_uInt16 reserved1;
109 sal_Int16 ctbds;
110 SwCTBWrapper* pWrapper;
111 boost::shared_ptr< SwCTB > customizationDataCTB;
112 std::vector< TBDelta > customizationDataTBDelta;
113 bool bIsDroppedMenuTB;
114 bool ImportMenu( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
115 public:
116 Customization( SwCTBWrapper* rapper );
117 ~Customization();
118 bool Read(SvStream &rS);
119 bool ImportCustomToolBar( SwCTBWrapper&, CustomToolBarImportHelper& );
120 bool ImportMenu( SwCTBWrapper&, CustomToolBarImportHelper& );
121 void Print( FILE* );
122 sal_Int32 GetTBIDForTB(){ return tbidForTBD; }
123 SwCTB* GetCustomizationData() { return customizationDataCTB.get(); };
126 class SfxObjectShell;
128 class SwCTBWrapper : public Tcg255SubStruct
130 // reserved1 is the ch field of Tcg255SubStruct
131 sal_uInt16 reserved2;
132 sal_uInt8 reserved3;
133 sal_uInt16 reserved4;
134 sal_uInt16 reserved5;
136 sal_Int16 cbTBD;
137 sal_Int16 cCust;
139 sal_Int32 cbDTBC;
141 std::vector< SwTBC > rtbdc; //
142 std::vector< Customization > rCustomizations; // array of Customizations
143 std::vector< sal_Int16 > dropDownMenuIndices; // array of indexes of Customization toolbars that are dropped by a menu
144 SwCTBWrapper(const SwCTBWrapper&);
145 SwCTBWrapper& operator = ( const SwCTBWrapper&);
146 public:
147 SwCTBWrapper( bool bReadId = true );
148 ~SwCTBWrapper();
149 void InsertDropIndex( sal_Int32 aIndex ) { dropDownMenuIndices.push_back( aIndex ); }
150 SwTBC* GetTBCAtOffset( sal_uInt32 nStreamOffset );
151 bool Read(SvStream &rS);
152 bool ImportCustomToolBar( SfxObjectShell& rDocSh );
154 Customization* GetCustomizaton( sal_Int16 index );
155 SwCTB* GetCustomizationData( const OUString& name );
156 void Print( FILE* );
159 class MCD : public TBBase
161 sal_Int8 reserved1; // A signed integer that MUST be 0x56.
162 sal_uInt8 reserved2; // MUST be 0.
163 sal_uInt16 ibst; // Unsigned integer that specifies the name of the macro. Macro name is specified by MacroName.xstz of the MacroName entry in the MacroNames such that MacroName.ibst equals ibst. MacroNames MUST contain such an entry.
164 sal_uInt16 ibstName; // An unsigned integer that specifies the index into the Command String Table (TcgSttbf.sttbf) where the macro‘s name and arguments are specified.
165 sal_uInt16 reserved3; // An unsigned integer that MUST be 0xFFFF.
166 sal_uInt32 reserved4; //MUST be ignored.
167 sal_uInt32 reserved5; //MUST be 0.
168 sal_uInt32 reserved6; //MUST be ignored.
169 sal_uInt32 reserved7; //MUST be ignored
171 public:
172 MCD();
173 MCD(const MCD&);
174 MCD& operator = ( const MCD&);
175 bool Read(SvStream &rS);
176 void Print( FILE* );
179 class PlfMcd : public Tcg255SubStruct
181 sal_Int32 iMac;
182 std::vector<MCD> rgmcd; // array of MCD's
183 PlfMcd(const PlfMcd&);
184 PlfMcd& operator = ( const PlfMcd&);
185 public:
186 PlfMcd( bool bReadId = true );
187 bool Read(SvStream &rS);
188 void Print( FILE* );
191 class Acd : public TBBase
193 sal_Int16 ibst;
194 sal_uInt16 fciBasedOnABC; // fciBasedOn(13 bits) A(1bit)B(1bit)C(1Bit)
195 Acd(const Acd&);
196 Acd& operator = ( const Acd&);
197 public:
198 Acd();
199 ~Acd(){}
200 bool Read(SvStream &rS);
201 void Print( FILE* );
204 class PlfAcd: public Tcg255SubStruct
206 sal_Int32 iMac;
207 Acd* rgacd;
208 PlfAcd(const PlfAcd&);
209 PlfAcd& operator = ( const PlfAcd&);
210 public:
211 PlfAcd( bool bReadId = true );
212 ~PlfAcd();
213 bool Read(SvStream &rS);
214 void Print(FILE*);
217 class Kme : public TBBase
219 sal_Int16 reserved1; //MUST be zero.
220 sal_Int16 reserved2; //MUST be zero.
221 sal_uInt16 kcm1; //A Kcm that specifies the primary shortcut key.
222 sal_uInt16 kcm2; //A Kcm that specifies the secondary shortcut key, or 0x00FF if there is no secondary shortcut key.
223 sal_uInt16 kt; //A Kt that specifies the type of action to be taken when the key combination is pressed.
224 sal_uInt32 param; //The meaning of this field depends on the value of kt
226 Kme(const Kme&);
227 Kme& operator = ( const Kme&);
228 public:
229 Kme();
230 ~Kme();
231 bool Read(SvStream &rS);
232 void Print( FILE* );
235 class PlfKme : public Tcg255SubStruct
237 sal_Int32 iMac;
238 Kme* rgkme;
239 PlfKme(const PlfKme&);
240 PlfKme& operator = ( const PlfKme&);
241 public:
242 PlfKme( bool bReadId = true );
243 ~PlfKme();
244 bool Read(SvStream &rS);
245 void Print( FILE* );
248 class TcgSttbfCore : public TBBase
250 struct SBBItem
252 sal_uInt16 cchData;
253 OUString data;
254 sal_uInt16 extraData;
255 SBBItem() : cchData(0), extraData(0){}
257 sal_uInt16 fExtend;
258 sal_uInt16 cData;
259 sal_uInt16 cbExtra;
260 SBBItem* dataItems;
261 TcgSttbfCore(const TcgSttbfCore&);
262 TcgSttbfCore& operator = ( const TcgSttbfCore&);
263 public:
264 TcgSttbfCore();
265 ~TcgSttbfCore();
266 bool Read(SvStream &rS);
267 void Print( FILE* fp );
270 class TcgSttbf : public Tcg255SubStruct
272 TcgSttbfCore sttbf;
273 TcgSttbf(const TcgSttbf&);
274 TcgSttbf& operator = ( const TcgSttbf&);
275 public:
276 TcgSttbf( bool bReadId = true );
277 ~TcgSttbf(){}
278 bool Read(SvStream &rS);
279 void Print( FILE* fp );
282 class Xstz : public TBBase
284 Xst xst; //An Xst specifying the string with its pre-pended length.
285 sal_uInt16 chTerm;
287 Xstz(const Xstz&);
288 Xstz& operator = ( const Xstz&);
289 public:
290 Xstz();
291 ~Xstz(){}
292 bool Read(SvStream &rS);
293 void Print( FILE* fp );
296 class MacroName : public TBBase
298 sal_uInt16 ibst; //An unsigned integer that specifies the index of the current entry in the macro name table. MUST NOT be the same as the index of any other entry.
299 Xstz xstz;
300 MacroName(const MacroName&);
301 MacroName& operator = ( const MacroName&);
302 public:
303 MacroName();
304 ~MacroName(){}
305 bool Read(SvStream &rS);
306 void Print( FILE* );
309 class MacroNames : public Tcg255SubStruct
311 sal_uInt16 iMac; //An unsigned integer that specifies the number of MacroName structures in rgNames.
312 MacroName* rgNames;
314 MacroNames(const MacroNames&);
315 MacroNames& operator = ( const MacroNames&);
316 public:
317 MacroNames( bool bReadId = true );
318 ~MacroNames();
319 bool Read(SvStream &rS);
320 void Print( FILE* );
323 class Tcg255 : public TBBase
325 std::vector< Tcg255SubStruct* > rgtcgData; // array of sub structures
326 Tcg255(const Tcg255&);
327 Tcg255& operator = ( const Tcg255&);
328 bool processSubStruct( sal_uInt8 nId, SvStream& );
329 public:
330 Tcg255();
331 ~Tcg255();
332 bool Read(SvStream &rS);
333 void Print( FILE* );
334 bool ImportCustomToolBar( SfxObjectShell& rDocSh );
337 class Tcg: public TBBase
339 sal_Int8 nTcgVer;
340 std::auto_ptr< Tcg255 > tcg;
341 Tcg(const Tcg&);
342 Tcg& operator = ( const Tcg&);
343 public:
344 Tcg();
345 ~Tcg(){}
346 bool Read(SvStream &rS);
347 bool ImportCustomToolBar( SfxObjectShell& rDocSh );
348 void Print( FILE* );
351 #endif
353 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */