1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 #ifndef _WW8TOOLBAR_HXX
10 #define _WW8TOOLBAR_HXX
12 #include <filter/msfilter/mstoolbar.hxx>
14 class Xst
: public TBBase
19 bool Read(SvStream
&rS
);
20 OUString
getString() { return sString
; }
21 void Print( FILE* fp
);
25 class SwTBC
: public TBBase
28 boost::shared_ptr
< sal_uInt32
> cid
; // optional
29 boost::shared_ptr
<TBCData
> tbcd
;
33 bool Read(SvStream
&rS
);
35 bool ImportToolBarControl( SwCTBWrapper
&, const css::uno::Reference
< css::container::XIndexContainer
>&, CustomToolBarImportHelper
&, bool );
36 OUString
GetCustomText();
39 class SwCTB
: public TBBase
44 std::vector
<TBVisualData
> rVisualData
;
49 std::vector
< SwTBC
> rTBC
;
52 SwCTB
& operator = ( const SwCTB
&);
56 bool Read(SvStream
&rS
);
57 void Print( FILE* fp
);
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
;
72 sal_uInt16 CiTBDE
; // careful of this ( endian matters etc. )
77 bool Read(SvStream
&rS
);
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
92 Tcg255SubStruct(const Tcg255SubStruct
&);
93 Tcg255SubStruct
& operator = ( const Tcg255SubStruct
&);
97 Tcg255SubStruct( bool bReadId
);
99 virtual sal_uInt8
id() const { return ch
; }
100 bool Read(SvStream
&rS
);
104 class Customization
: public TBBase
106 friend class SwCTBWrapper
;
107 sal_Int32 tbidForTBD
;
108 sal_uInt16 reserved1
;
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
& );
116 Customization( SwCTBWrapper
* rapper
);
118 bool Read(SvStream
&rS
);
119 bool ImportCustomToolBar( SwCTBWrapper
&, CustomToolBarImportHelper
& );
120 bool ImportMenu( SwCTBWrapper
&, CustomToolBarImportHelper
& );
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
;
133 sal_uInt16 reserved4
;
134 sal_uInt16 reserved5
;
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
&);
147 SwCTBWrapper( bool bReadId
= true );
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
);
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
174 MCD
& operator = ( const MCD
&);
175 bool Read(SvStream
&rS
);
179 class PlfMcd
: public Tcg255SubStruct
182 std::vector
<MCD
> rgmcd
; // array of MCD's
183 PlfMcd(const PlfMcd
&);
184 PlfMcd
& operator = ( const PlfMcd
&);
186 PlfMcd( bool bReadId
= true );
187 bool Read(SvStream
&rS
);
191 class Acd
: public TBBase
194 sal_uInt16 fciBasedOnABC
; // fciBasedOn(13 bits) A(1bit)B(1bit)C(1Bit)
196 Acd
& operator = ( const Acd
&);
200 bool Read(SvStream
&rS
);
204 class PlfAcd
: public Tcg255SubStruct
208 PlfAcd(const PlfAcd
&);
209 PlfAcd
& operator = ( const PlfAcd
&);
211 PlfAcd( bool bReadId
= true );
213 bool Read(SvStream
&rS
);
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
227 Kme
& operator = ( const Kme
&);
231 bool Read(SvStream
&rS
);
235 class PlfKme
: public Tcg255SubStruct
239 PlfKme(const PlfKme
&);
240 PlfKme
& operator = ( const PlfKme
&);
242 PlfKme( bool bReadId
= true );
244 bool Read(SvStream
&rS
);
248 class TcgSttbfCore
: public TBBase
254 sal_uInt16 extraData
;
255 SBBItem() : cchData(0), extraData(0){}
261 TcgSttbfCore(const TcgSttbfCore
&);
262 TcgSttbfCore
& operator = ( const TcgSttbfCore
&);
266 bool Read(SvStream
&rS
);
267 void Print( FILE* fp
);
270 class TcgSttbf
: public Tcg255SubStruct
273 TcgSttbf(const TcgSttbf
&);
274 TcgSttbf
& operator = ( const TcgSttbf
&);
276 TcgSttbf( bool bReadId
= true );
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.
288 Xstz
& operator = ( const 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.
300 MacroName(const MacroName
&);
301 MacroName
& operator = ( const MacroName
&);
305 bool Read(SvStream
&rS
);
309 class MacroNames
: public Tcg255SubStruct
311 sal_uInt16 iMac
; //An unsigned integer that specifies the number of MacroName structures in rgNames.
314 MacroNames(const MacroNames
&);
315 MacroNames
& operator = ( const MacroNames
&);
317 MacroNames( bool bReadId
= true );
319 bool Read(SvStream
&rS
);
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
& );
332 bool Read(SvStream
&rS
);
334 bool ImportCustomToolBar( SfxObjectShell
& rDocSh
);
337 class Tcg
: public TBBase
340 std::auto_ptr
< Tcg255
> tcg
;
342 Tcg
& operator = ( const Tcg
&);
346 bool Read(SvStream
&rS
);
347 bool ImportCustomToolBar( SfxObjectShell
& rDocSh
);
353 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */