LibreOffice Module sw (master) 1
ww8toolbar.hxx
Go to the documentation of this file.
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#ifndef INCLUDED_SW_SOURCE_FILTER_WW8_WW8TOOLBAR_HXX
10#define INCLUDED_SW_SOURCE_FILTER_WW8_WW8TOOLBAR_HXX
11
12#include <com/sun/star/container/XIndexContainer.hpp>
14#include <memory>
15
16
17class SfxObjectShell;
18class SwCTBWrapper;
19
20class Xst : public TBBase
21{
22 OUString m_sString;
23
24public:
25 Xst(){}
26 bool Read(SvStream &rS) override;
27 const OUString& getString() const { return m_sString; }
28};
29
30class SwTBC : public TBBase
31{
33 std::shared_ptr< sal_uInt32 > m_cid; // optional
34 std::shared_ptr<TBCData> m_tbcd;
35
36public:
37 SwTBC();
38 bool Read(SvStream &rS) override;
39 bool ImportToolBarControl( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper&, bool );
40 OUString GetCustomText();
41};
42
43class SwCTB : public TBBase
44{
46 sal_Int32 m_cbTBData;
48 std::vector<TBVisualData> m_rVisualData;
49 sal_Int32 m_iWCTBl;
50 sal_uInt16 m_reserved;
51 sal_uInt16 m_unused;
52 sal_Int32 m_cCtls;
53 std::vector< SwTBC > m_rTBC;
54
55 SwCTB(const SwCTB&) = delete;
56 SwCTB& operator = ( const SwCTB&) = delete;
57
58public:
59 SwCTB();
60 virtual ~SwCTB() override;
61 bool Read(SvStream &rS) override;
62 bool IsMenuToolbar() const;
64 bool ImportMenuTB( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
65 OUString const & GetName() { return m_tb.getName().getString(); }
66};
67
68class TBDelta : public TBBase
69{
71
73 sal_Int32 m_cidNext;
74 sal_Int32 m_cid;
75 sal_Int32 m_fc;
76 sal_uInt16 m_CiTBDE; // careful of this ( endian matters etc. )
77 sal_uInt16 m_cbTBC;
78
79public:
80 TBDelta();
81 bool Read(SvStream &rS) override;
82 bool ControlIsInserted();
84 sal_Int32 TBCStreamOffset() { return m_fc;}
85 sal_Int16 CustomizationIndex();
86};
87
88class Tcg255SubStruct : public TBBase
89{
90 friend class Tcg255;
91
94
95protected:
97
98public:
99 explicit Tcg255SubStruct();
100 sal_uInt8 id() const { return m_ch; }
101 bool Read(SvStream &rS) override;
102};
103
104class Customization : public TBBase
105{
106 friend class SwCTBWrapper;
107
108 sal_Int32 m_tbidForTBD;
109 sal_uInt16 m_reserved1;
110 sal_uInt16 m_ctbds;
112 std::shared_ptr< SwCTB > m_customizationDataCTB;
113 std::vector< TBDelta > m_customizationDataTBDelta;
115
116public:
117 explicit Customization( SwCTBWrapper* rapper );
118 bool Read(SvStream &rS) override;
122};
123
125{
126 // reserved1 is the ch field of Tcg255SubStruct
127 sal_uInt16 m_reserved2;
129 sal_uInt16 m_reserved4;
130 sal_uInt16 m_reserved5;
131
132 sal_Int16 m_cbTBD;
133 sal_uInt16 m_cCust;
134
135 sal_Int32 m_cbDTBC;
136
137 std::vector< SwTBC > m_rtbdc;
138 std::vector< Customization > m_rCustomizations; // array of Customizations
139 std::vector< sal_Int16 > m_dropDownMenuIndices; // array of indexes of Customization toolbars that are dropped by a menu
140 SwCTBWrapper(const SwCTBWrapper&) = delete;
142
143public:
144 explicit SwCTBWrapper();
145 virtual ~SwCTBWrapper() override;
146 void InsertDropIndex( sal_Int32 aIndex ) { m_dropDownMenuIndices.push_back( aIndex ); }
147 SwTBC* GetTBCAtOffset( sal_uInt32 nStreamOffset );
148 bool Read(SvStream &rS) override;
149 bool ImportCustomToolBar( SfxObjectShell& rDocSh );
150
151 Customization* GetCustomizaton( sal_Int16 index );
152 SwCTB* GetCustomizationData( const OUString& name );
153};
154
155class MCD : public TBBase
156{
157 sal_Int8 m_reserved1; // A signed integer that MUST be 0x56.
158 sal_uInt8 m_reserved2; // MUST be 0.
159 sal_uInt16 m_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.
160 sal_uInt16 m_ibstName; // An unsigned integer that specifies the index into the Command String Table (TcgSttbf.sttbf) where the macro's name and arguments are specified.
161 sal_uInt16 m_reserved3; // An unsigned integer that MUST be 0xFFFF.
162 sal_uInt32 m_reserved4; //MUST be ignored.
163 sal_uInt32 m_reserved5; //MUST be 0.
164 sal_uInt32 m_reserved6; //MUST be ignored.
165 sal_uInt32 m_reserved7; //MUST be ignored
166
167public:
168 MCD();
169 bool Read(SvStream &rS) override;
170};
171
173{
174 sal_Int32 m_iMac;
175 std::vector<MCD> m_rgmcd; // array of MCD's
176 PlfMcd(const PlfMcd&) = delete;
177 PlfMcd& operator = ( const PlfMcd&) = delete;
178
179public:
180 explicit PlfMcd();
181 bool Read(SvStream &rS) override;
182};
183
184class Acd : public TBBase
185{
186 sal_Int16 m_ibst;
187 sal_uInt16 m_fciBasedOnABC; // fciBasedOn(13 bits) A(1bit)B(1bit)C(1Bit)
188 Acd(const Acd&) = delete;
189 Acd& operator = ( const Acd&) = delete;
190
191public:
192 Acd();
193 bool Read(SvStream &rS) override;
194};
195
197{
198 sal_Int32 m_iMac;
199 std::unique_ptr<Acd[]> m_rgacd;
200 PlfAcd(const PlfAcd&) = delete;
201 PlfAcd& operator = ( const PlfAcd&) = delete;
202
203public:
204 explicit PlfAcd();
205 virtual ~PlfAcd() override;
206 bool Read(SvStream &rS) override;
207};
208
209class Kme : public TBBase
210{
211 sal_Int16 m_reserved1; //MUST be zero.
212 sal_Int16 m_reserved2; //MUST be zero.
213 sal_uInt16 m_kcm1; //A Kcm that specifies the primary shortcut key.
214 sal_uInt16 m_kcm2; //A Kcm that specifies the secondary shortcut key, or 0x00FF if there is no secondary shortcut key.
215 sal_uInt16 m_kt; //A Kt that specifies the type of action to be taken when the key combination is pressed.
216 sal_uInt32 m_param; //The meaning of this field depends on the value of kt
217
218 Kme(const Kme&) = delete;
219 Kme& operator = ( const Kme&) = delete;
220
221public:
222 Kme();
223 virtual ~Kme() override;
224 bool Read(SvStream &rS) override;
225};
226
228{
229 sal_Int32 m_iMac;
230 std::unique_ptr<Kme[]> m_rgkme;
231 PlfKme(const PlfKme&) = delete;
232 PlfKme& operator = ( const PlfKme&) = delete;
233
234public:
235 explicit PlfKme();
236 virtual ~PlfKme() override;
237 bool Read(SvStream &rS) override;
238};
239
240class TcgSttbfCore : public TBBase
241{
242 struct SBBItem
243 {
244 sal_uInt16 cchData;
245 OUString data;
246 sal_uInt16 extraData;
248 };
249
250 sal_uInt16 m_fExtend;
251 sal_uInt16 m_cData;
252 sal_uInt16 m_cbExtra;
253 std::unique_ptr<SBBItem[]> m_dataItems;
254 TcgSttbfCore(const TcgSttbfCore&) = delete;
256
257public:
258 TcgSttbfCore();
259 virtual ~TcgSttbfCore() override;
260 bool Read(SvStream &rS) override;
261};
262
264{
266 TcgSttbf(const TcgSttbf&) = delete;
267 TcgSttbf& operator = ( const TcgSttbf&) = delete;
268
269public:
270 explicit TcgSttbf();
271 bool Read(SvStream &rS) override;
272};
273
274class Xstz : public TBBase
275{
276 Xst m_xst; //An Xst specifying the string with its pre-pended length.
277 sal_uInt16 m_chTerm;
278
279 Xstz(const Xstz&) = delete;
280 Xstz& operator = ( const Xstz&) = delete;
281
282public:
283 Xstz();
284 bool Read(SvStream &rS) override;
285};
286
287class MacroName : public TBBase
288{
289 sal_uInt16 m_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.
291 MacroName(const MacroName&) = delete;
292 MacroName& operator = ( const MacroName&) = delete;
293
294public:
295 MacroName();
296 bool Read(SvStream &rS) override;
297};
298
300{
301 sal_uInt16 m_iMac; //An unsigned integer that specifies the number of MacroName structures in rgNames.
302 std::unique_ptr<MacroName[]> m_rgNames;
303
304 MacroNames(const MacroNames&) = delete;
306
307public:
308 explicit MacroNames();
309 virtual ~MacroNames() override;
310 bool Read(SvStream &rS) override;
311};
312
313class Tcg255 : public TBBase
314{
315 std::vector< std::unique_ptr<Tcg255SubStruct> > m_rgtcgData; // array of sub structures
316 Tcg255(const Tcg255&) = delete;
317 Tcg255& operator = ( const Tcg255&) = delete;
318 bool processSubStruct( sal_uInt8 nId, SvStream& );
319
320public:
321 Tcg255();
322 virtual ~Tcg255() override;
323 bool Read(SvStream &rS) override;
324 bool ImportCustomToolBar( SfxObjectShell& rDocSh );
325};
326
327class Tcg: public TBBase
328{
330 std::unique_ptr< Tcg255 > m_tcg;
331 Tcg(const Tcg&) = delete;
332 Tcg& operator = ( const Tcg&) = delete;
333
334public:
335 Tcg();
336 bool Read(SvStream &rS) override;
337 bool ImportCustomToolBar( SfxObjectShell& rDocSh );
338};
339
340#endif
341
342/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Acd(const Acd &)=delete
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:975
sal_uInt16 m_fciBasedOnABC
Definition: ww8toolbar.hxx:187
sal_Int16 m_ibst
Definition: ww8toolbar.hxx:186
Acd & operator=(const Acd &)=delete
sal_uInt16 m_reserved1
Definition: ww8toolbar.hxx:109
std::shared_ptr< SwCTB > m_customizationDataCTB
Definition: ww8toolbar.hxx:112
bool ImportMenu(SwCTBWrapper &, CustomToolBarImportHelper &)
Definition: ww8toolbar.cxx:254
SwCTBWrapper * m_pWrapper
Definition: ww8toolbar.hxx:111
bool ImportCustomToolBar(SwCTBWrapper &, CustomToolBarImportHelper &)
Definition: ww8toolbar.cxx:324
SwCTB * GetCustomizationData()
Definition: ww8toolbar.hxx:121
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:223
Customization(SwCTBWrapper *rapper)
Definition: ww8toolbar.cxx:214
sal_uInt16 m_ctbds
Definition: ww8toolbar.hxx:110
bool m_bIsDroppedMenuTB
Definition: ww8toolbar.hxx:114
std::vector< TBDelta > m_customizationDataTBDelta
Definition: ww8toolbar.hxx:113
sal_Int32 m_tbidForTBD
Definition: ww8toolbar.hxx:108
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:962
Kme(const Kme &)=delete
sal_Int16 m_reserved1
Definition: ww8toolbar.hxx:211
sal_uInt32 m_param
Definition: ww8toolbar.hxx:216
sal_uInt16 m_kt
Definition: ww8toolbar.hxx:215
sal_uInt16 m_kcm1
Definition: ww8toolbar.hxx:213
sal_uInt16 m_kcm2
Definition: ww8toolbar.hxx:214
sal_Int16 m_reserved2
Definition: ww8toolbar.hxx:212
virtual ~Kme() override
Definition: ww8toolbar.cxx:957
Kme & operator=(const Kme &)=delete
sal_uInt32 m_reserved4
Definition: ww8toolbar.hxx:162
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:995
sal_Int8 m_reserved1
Definition: ww8toolbar.hxx:157
sal_uInt16 m_ibst
Definition: ww8toolbar.hxx:159
sal_uInt32 m_reserved5
Definition: ww8toolbar.hxx:163
sal_uInt16 m_ibstName
Definition: ww8toolbar.hxx:160
sal_uInt16 m_reserved3
Definition: ww8toolbar.hxx:161
sal_uInt8 m_reserved2
Definition: ww8toolbar.hxx:158
sal_uInt32 m_reserved7
Definition: ww8toolbar.hxx:165
sal_uInt32 m_reserved6
Definition: ww8toolbar.hxx:164
sal_uInt16 m_ibst
Definition: ww8toolbar.hxx:289
MacroName & operator=(const MacroName &)=delete
MacroName(const MacroName &)=delete
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:923
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:897
std::unique_ptr< MacroName[]> m_rgNames
Definition: ww8toolbar.hxx:302
sal_uInt16 m_iMac
Definition: ww8toolbar.hxx:301
MacroNames & operator=(const MacroNames &)=delete
virtual ~MacroNames() override
Definition: ww8toolbar.cxx:893
MacroNames(const MacroNames &)=delete
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:788
sal_Int32 m_iMac
Definition: ww8toolbar.hxx:198
PlfAcd(const PlfAcd &)=delete
std::unique_ptr< Acd[]> m_rgacd
Definition: ww8toolbar.hxx:199
virtual ~PlfAcd() override
Definition: ww8toolbar.cxx:784
PlfAcd & operator=(const PlfAcd &)=delete
PlfKme(const PlfKme &)=delete
std::unique_ptr< Kme[]> m_rgkme
Definition: ww8toolbar.hxx:230
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:823
virtual ~PlfKme() override
Definition: ww8toolbar.cxx:819
PlfKme & operator=(const PlfKme &)=delete
sal_Int32 m_iMac
Definition: ww8toolbar.hxx:229
sal_Int32 m_iMac
Definition: ww8toolbar.hxx:174
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:753
PlfMcd(const PlfMcd &)=delete
std::vector< MCD > m_rgmcd
Definition: ww8toolbar.hxx:175
PlfMcd & operator=(const PlfMcd &)=delete
bool ImportCustomToolBar(SfxObjectShell &rDocSh)
Definition: ww8toolbar.cxx:187
SwCTB * GetCustomizationData(const OUString &name)
Definition: ww8toolbar.cxx:104
sal_uInt8 m_reserved3
Definition: ww8toolbar.hxx:128
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:116
Customization * GetCustomizaton(sal_Int16 index)
Definition: ww8toolbar.cxx:97
SwCTBWrapper & operator=(const SwCTBWrapper &)=delete
sal_uInt16 m_reserved4
Definition: ww8toolbar.hxx:129
std::vector< SwTBC > m_rtbdc
Definition: ww8toolbar.hxx:137
void InsertDropIndex(sal_Int32 aIndex)
Definition: ww8toolbar.hxx:146
SwCTBWrapper(const SwCTBWrapper &)=delete
sal_Int32 m_cbDTBC
Definition: ww8toolbar.hxx:135
virtual ~SwCTBWrapper() override
Definition: ww8toolbar.cxx:93
sal_uInt16 m_cCust
Definition: ww8toolbar.hxx:133
std::vector< Customization > m_rCustomizations
Definition: ww8toolbar.hxx:138
std::vector< sal_Int16 > m_dropDownMenuIndices
Definition: ww8toolbar.hxx:139
SwTBC * GetTBCAtOffset(sal_uInt32 nStreamOffset)
Definition: ww8toolbar.cxx:178
sal_uInt16 m_reserved5
Definition: ww8toolbar.hxx:130
sal_Int16 m_cbTBD
Definition: ww8toolbar.hxx:132
sal_uInt16 m_reserved2
Definition: ww8toolbar.hxx:127
bool ImportMenuTB(SwCTBWrapper &, const css::uno::Reference< css::container::XIndexContainer > &, CustomToolBarImportHelper &)
Definition: ww8toolbar.cxx:469
sal_uInt16 m_reserved
Definition: ww8toolbar.hxx:50
Xst m_name
Definition: ww8toolbar.hxx:45
std::vector< SwTBC > m_rTBC
Definition: ww8toolbar.hxx:53
std::vector< TBVisualData > m_rVisualData
Definition: ww8toolbar.hxx:48
OUString const & GetName()
Definition: ww8toolbar.hxx:65
SwCTB & operator=(const SwCTB &)=delete
bool ImportCustomToolBar(SwCTBWrapper &, CustomToolBarImportHelper &)
Definition: ww8toolbar.cxx:425
sal_Int32 m_iWCTBl
Definition: ww8toolbar.hxx:49
virtual ~SwCTB() override
Definition: ww8toolbar.cxx:385
sal_Int32 m_cCtls
Definition: ww8toolbar.hxx:52
SwCTB(const SwCTB &)=delete
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:394
bool IsMenuToolbar() const
Definition: ww8toolbar.cxx:389
TB m_tb
Definition: ww8toolbar.hxx:47
sal_uInt16 m_unused
Definition: ww8toolbar.hxx:51
sal_Int32 m_cbTBData
Definition: ww8toolbar.hxx:46
std::shared_ptr< sal_uInt32 > m_cid
Definition: ww8toolbar.hxx:33
bool ImportToolBarControl(SwCTBWrapper &, const css::uno::Reference< css::container::XIndexContainer > &, CustomToolBarImportHelper &, bool)
Definition: ww8toolbar.cxx:506
TBCHeader m_tbch
Definition: ww8toolbar.hxx:32
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:484
std::shared_ptr< TBCData > m_tbcd
Definition: ww8toolbar.hxx:34
OUString GetCustomText()
Definition: ww8toolbar.cxx:604
sal_uInt8 m_doprfatendFlags
Definition: ww8toolbar.hxx:70
sal_Int16 CustomizationIndex()
Definition: ww8toolbar.cxx:360
sal_uInt8 m_ibts
Definition: ww8toolbar.hxx:72
sal_uInt16 m_CiTBDE
Definition: ww8toolbar.hxx:76
sal_Int32 m_fc
Definition: ww8toolbar.hxx:75
sal_Int32 TBCStreamOffset()
Definition: ww8toolbar.hxx:84
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:368
sal_Int32 m_cidNext
Definition: ww8toolbar.hxx:73
sal_Int32 m_cid
Definition: ww8toolbar.hxx:74
bool ControlIsInserted()
Definition: ww8toolbar.cxx:349
sal_uInt16 m_cbTBC
Definition: ww8toolbar.hxx:77
bool ControlDropsToolBar()
Definition: ww8toolbar.cxx:354
WString & getName()
sal_uInt8 id() const
Definition: ww8toolbar.hxx:100
sal_uInt8 m_ch
Definition: ww8toolbar.hxx:96
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:741
Tcg255SubStruct & operator=(const Tcg255SubStruct &)=delete
Tcg255SubStruct(const Tcg255SubStruct &)=delete
bool ImportCustomToolBar(SfxObjectShell &rDocSh)
Definition: ww8toolbar.cxx:697
virtual ~Tcg255() override
Definition: ww8toolbar.cxx:646
Tcg255 & operator=(const Tcg255 &)=delete
std::vector< std::unique_ptr< Tcg255SubStruct > > m_rgtcgData
Definition: ww8toolbar.hxx:315
Tcg255(const Tcg255 &)=delete
bool processSubStruct(sal_uInt8 nId, SvStream &)
Definition: ww8toolbar.cxx:650
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:720
sal_uInt16 m_fExtend
Definition: ww8toolbar.hxx:250
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:868
sal_uInt16 m_cbExtra
Definition: ww8toolbar.hxx:252
sal_uInt16 m_cData
Definition: ww8toolbar.hxx:251
std::unique_ptr< SBBItem[]> m_dataItems
Definition: ww8toolbar.hxx:253
TcgSttbfCore & operator=(const TcgSttbfCore &)=delete
TcgSttbfCore(const TcgSttbfCore &)=delete
virtual ~TcgSttbfCore() override
Definition: ww8toolbar.cxx:864
TcgSttbf & operator=(const TcgSttbf &)=delete
TcgSttbfCore m_sttbf
Definition: ww8toolbar.hxx:265
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:850
TcgSttbf(const TcgSttbf &)=delete
bool ImportCustomToolBar(SfxObjectShell &rDocSh)
Definition: ww8toolbar.cxx:635
std::unique_ptr< Tcg255 > m_tcg
Definition: ww8toolbar.hxx:330
sal_Int8 m_nTcgVer
Definition: ww8toolbar.hxx:329
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:624
Tcg & operator=(const Tcg &)=delete
Tcg(const Tcg &)=delete
const OUString & getString() const
OUString m_sString
Definition: ww8toolbar.hxx:22
const OUString & getString() const
Definition: ww8toolbar.hxx:27
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:612
Xst()
Definition: ww8toolbar.hxx:25
bool Read(SvStream &rS) override
Definition: ww8toolbar.cxx:936
Xst m_xst
Definition: ww8toolbar.hxx:276
sal_uInt16 m_chTerm
Definition: ww8toolbar.hxx:277
Xstz(const Xstz &)=delete
Xstz & operator=(const Xstz &)=delete
std::deque< AttacherIndex_Impl > aIndex
unsigned char sal_uInt8
signed char sal_Int8