1 #ifndef _WW8TOOLBAR_HXX
2 #define _WW8TOOLBAR_HXX
4 #include <svx/mstoolbar.hxx>
6 namespace css
= ::com::sun::star
;
8 class Xst
: public TBBase
10 rtl::OUString sString
;
13 bool Read(SvStream
*pS
);
14 rtl::OUString
getString() { return sString
; }
15 void Print( FILE* fp
);
19 class TBC
: public TBBase
22 boost::shared_ptr
< sal_uInt32
> cid
; // optional
23 boost::shared_ptr
<TBCData
> tbcd
;
27 bool Read(SvStream
*pS
);
29 bool ImportToolBarControl( CTBWrapper
&, const css::uno::Reference
< css::container::XIndexContainer
>&, CustomToolBarImportHelper
&, bool );
30 rtl::OUString
GetCustomText();
33 class CTB
: public TBBase
38 std::vector
<TBVisualData
> rVisualData
;
43 std::vector
< TBC
> rTBC
;
46 CTB
& operator = ( const CTB
&);
50 bool Read(SvStream
*pS
);
51 void Print( FILE* fp
);
53 bool ImportCustomToolBar( CTBWrapper
&, CustomToolBarImportHelper
& );
54 bool ImportMenuTB( CTBWrapper
&, const css::uno::Reference
< css::container::XIndexContainer
>&, CustomToolBarImportHelper
& );
55 rtl::OUString
GetName() { return tb
.getName().getString(); }
58 class TBDelta
: public TBBase
60 sal_uInt8 doprfatendFlags
;
66 sal_uInt16 CiTBDE
; // careful of this ( endian matters etc. )
71 bool Read(SvStream
*pS
);
73 bool ControlIsModified();
74 bool ControlIsInserted();
75 bool ControlIsChanged();
76 bool ControlDropsToolBar();
77 sal_Int32
TBCStreamOffset();
78 sal_Int16
CustomizationIndex();
82 class Tcg255SubStruct
: public TBBase
86 Tcg255SubStruct(const Tcg255SubStruct
&);
87 Tcg255SubStruct
& operator = ( const Tcg255SubStruct
&);
91 Tcg255SubStruct( bool bReadId
);
93 virtual sal_uInt8
id() const { return ch
; }
94 bool Read(SvStream
*pS
);
98 class Customization
: public TBBase
100 friend class CTBWrapper
;
101 sal_Int32 tbidForTBD
;
102 sal_uInt16 reserved1
;
104 CTBWrapper
* pWrapper
;
105 boost::shared_ptr
< CTB
> customizationDataCTB
;
106 std::vector
< TBDelta
> customizationDataTBDelta
;
107 bool bIsDroppedMenuTB
;
108 bool ImportMenu( CTBWrapper
&, const css::uno::Reference
< css::container::XIndexContainer
>&, CustomToolBarImportHelper
& );
110 Customization( CTBWrapper
* rapper
);
112 bool Read(SvStream
*pS
);
113 bool ImportCustomToolBar( CTBWrapper
&, CustomToolBarImportHelper
& );
114 bool ImportMenu( CTBWrapper
&, CustomToolBarImportHelper
& );
116 sal_Int32
GetTBIDForTB(){ return tbidForTBD
; }
117 CTB
* GetCustomizationData() { return customizationDataCTB
.get(); };
120 class SfxObjectShell
;
122 class CTBWrapper
: public Tcg255SubStruct
124 // reserved1 is the ch field of Tcg255SubStruct
125 sal_uInt16 reserved2
;
127 sal_uInt16 reserved4
;
128 sal_uInt16 reserved5
;
135 std::vector
< TBC
> rtbdc
; //
136 std::vector
< Customization
> rCustomizations
; // array of Customizations
137 std::vector
< sal_Int16
> dropDownMenuIndices
; // array of indexes of Customization toolbars that are dropped by a menu
138 CTBWrapper(const CTBWrapper
&);
139 CTBWrapper
& operator = ( const CTBWrapper
&);
141 CTBWrapper( bool bReadId
= true );
143 void InsertDropIndex( sal_Int32 aIndex
) { dropDownMenuIndices
.push_back( aIndex
); }
144 TBC
* GetTBCAtOffset( sal_uInt32 nStreamOffset
);
145 bool Read(SvStream
*pS
);
146 bool ImportCustomToolBar( SfxObjectShell
& rDocSh
);
148 Customization
* GetCustomizaton( sal_Int16 index
);
149 CTB
* GetCustomizationData( const rtl::OUString
& name
);
153 class MCD
: public TBBase
155 sal_Int8 reserved1
; // A signed integer that MUST be 0x56.
156 sal_uInt8 reserved2
; // MUST be 0.
157 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.
158 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.
159 sal_uInt16 reserved3
; // An unsigned integer that MUST be 0xFFFF.
160 sal_uInt32 reserved4
; //MUST be ignored.
161 sal_uInt32 reserved5
; //MUST be 0.
162 sal_uInt32 reserved6
; //MUST be ignored.
163 sal_uInt32 reserved7
; //MUST be ignored
166 MCD
& operator = ( const MCD
&);
170 bool Read(SvStream
*pS
);
174 class PlfMcd
: public Tcg255SubStruct
177 MCD
* rgmcd
; // array of MCD's
178 PlfMcd(const PlfMcd
&);
179 PlfMcd
& operator = ( const PlfMcd
&);
181 PlfMcd( bool bReadId
= true );
183 bool Read(SvStream
*pS
);
187 class Acd
: public TBBase
190 sal_uInt16 fciBasedOnABC
; // fciBasedOn(13 bits) A(1bit)B(1bit)C(1Bit)
192 Acd
& operator = ( const Acd
&);
196 bool Read(SvStream
*pS
);
200 class PlfAcd
: public Tcg255SubStruct
204 PlfAcd(const PlfAcd
&);
205 PlfAcd
& operator = ( const PlfAcd
&);
207 PlfAcd( bool bReadId
= true );
209 bool Read(SvStream
*pS
);
213 class Kme
: public TBBase
215 sal_Int16 reserved1
; //MUST be zero.
216 sal_Int16 reserved2
; //MUST be zero.
217 sal_uInt16 kcm1
; //A Kcm that specifies the primary shortcut key.
218 sal_uInt16 kcm2
; //A Kcm that specifies the secondary shortcut key, or 0x00FF if there is no secondary shortcut key.
219 sal_uInt16 kt
; //A Kt that specifies the type of action to be taken when the key combination is pressed.
220 sal_uInt32 param
; //The meaning of this field depends on the value of kt
223 Kme
& operator = ( const Kme
&);
227 bool Read(SvStream
*pS
);
231 class PlfKme
: public Tcg255SubStruct
235 PlfKme(const PlfKme
&);
236 PlfKme
& operator = ( const PlfKme
&);
238 PlfKme( bool bReadId
= true );
240 bool Read(SvStream
*pS
);
244 class TcgSttbfCore
: public TBBase
250 sal_uInt16 extraData
;
251 SBBItem() : cchData(0), extraData(0){}
257 TcgSttbfCore(const TcgSttbfCore
&);
258 TcgSttbfCore
& operator = ( const TcgSttbfCore
&);
262 bool Read(SvStream
*pS
);
263 void Print( FILE* fp
);
266 class TcgSttbf
: public Tcg255SubStruct
269 TcgSttbf(const TcgSttbf
&);
270 TcgSttbf
& operator = ( const TcgSttbf
&);
272 TcgSttbf( bool bReadId
= true );
274 bool Read(SvStream
*pS
);
275 void Print( FILE* fp
);
278 class Xstz
: public TBBase
280 Xst xst
; //An Xst specifying the string with its pre-pended length.
284 Xstz
& operator = ( const Xstz
&);
288 bool Read(SvStream
*pS
);
289 void Print( FILE* fp
);
292 class MacroName
: public TBBase
294 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.
296 MacroName(const MacroName
&);
297 MacroName
& operator = ( const MacroName
&);
301 bool Read(SvStream
*pS
);
305 class MacroNames
: public Tcg255SubStruct
307 sal_uInt16 iMac
; //An unsigned integer that specifies the number of MacroName structures in rgNames.
310 MacroNames(const MacroNames
&);
311 MacroNames
& operator = ( const MacroNames
&);
313 MacroNames( bool bReadId
= true );
315 bool Read(SvStream
*pS
);
319 class Tcg255
: public TBBase
321 std::vector
< Tcg255SubStruct
* > rgtcgData
; // array of sub structures
322 Tcg255(const Tcg255
&);
323 Tcg255
& operator = ( const Tcg255
&);
324 bool processSubStruct( sal_uInt8 nId
, SvStream
* );
328 bool Read(SvStream
*pS
);
330 bool ImportCustomToolBar( SfxObjectShell
& rDocSh
);
333 class Tcg
: public TBBase
336 std::auto_ptr
< Tcg255
> tcg
;
338 Tcg
& operator = ( const Tcg
&);
342 bool Read(SvStream
*pS
);
343 bool ImportCustomToolBar( SfxObjectShell
& rDocSh
);