Update ooo320-m1
[ooovba.git] / sw / source / filter / ww8 / ww8toolbar.hxx
blob3dcf2de3abb5b54dca294bceda75c5ff20d4e05c
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;
11 public:
12 Xst(){}
13 bool Read(SvStream *pS);
14 rtl::OUString getString() { return sString; }
15 void Print( FILE* fp );
18 class CTBWrapper;
19 class TBC : public TBBase
21 TBCHeader tbch;
22 boost::shared_ptr< sal_uInt32 > cid; // optional
23 boost::shared_ptr<TBCData> tbcd;
24 public:
25 TBC();
26 ~TBC();
27 bool Read(SvStream *pS);
28 void Print( FILE* );
29 bool ImportToolBarControl( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper&, bool );
30 rtl::OUString GetCustomText();
33 class CTB : public TBBase
35 Xst name;
36 sal_Int32 cbTBData;
37 TB tb;
38 std::vector<TBVisualData> rVisualData;
39 sal_Int32 iWCTBl;
40 sal_uInt16 reserved;
41 sal_uInt16 unused;
42 sal_Int32 cCtls;
43 std::vector< TBC > rTBC;
45 CTB(const CTB&);
46 CTB& operator = ( const CTB&);
47 public:
48 CTB();
49 ~CTB();
50 bool Read(SvStream *pS);
51 void Print( FILE* fp );
52 bool IsMenuToolbar();
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;
62 sal_uInt8 ibts;
63 sal_Int32 cidNext;
64 sal_Int32 cid;
65 sal_Int32 fc;
66 sal_uInt16 CiTBDE; // careful of this ( endian matters etc. )
67 sal_uInt16 cbTBC;
68 public:
69 TBDelta();
70 ~TBDelta(){}
71 bool Read(SvStream *pS);
72 void Print( FILE* );
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
84 friend class Tcg255;
85 bool mbReadId;
86 Tcg255SubStruct(const Tcg255SubStruct&);
87 Tcg255SubStruct& operator = ( const Tcg255SubStruct&);
88 protected:
89 sal_uInt8 ch;
90 public:
91 Tcg255SubStruct( bool bReadId );
92 ~Tcg255SubStruct(){}
93 virtual sal_uInt8 id() const { return ch; }
94 bool Read(SvStream *pS);
97 class CTBWrapper;
98 class Customization : public TBBase
100 friend class CTBWrapper;
101 sal_Int32 tbidForTBD;
102 sal_uInt16 reserved1;
103 sal_Int16 ctbds;
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& );
109 public:
110 Customization( CTBWrapper* rapper );
111 ~Customization();
112 bool Read(SvStream *pS);
113 bool ImportCustomToolBar( CTBWrapper&, CustomToolBarImportHelper& );
114 bool ImportMenu( CTBWrapper&, CustomToolBarImportHelper& );
115 void Print( FILE* );
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;
126 sal_uInt8 reserved3;
127 sal_uInt16 reserved4;
128 sal_uInt16 reserved5;
130 sal_Int16 cbTBD;
131 sal_Int16 cCust;
133 sal_Int32 cbDTBC;
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&);
140 public:
141 CTBWrapper( bool bReadId = true );
142 ~CTBWrapper();
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 );
150 void Print( FILE* );
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
165 MCD(const MCD&);
166 MCD& operator = ( const MCD&);
167 public:
168 MCD();
169 ~MCD(){}
170 bool Read(SvStream *pS);
171 void Print( FILE* );
174 class PlfMcd : public Tcg255SubStruct
176 sal_Int32 iMac;
177 MCD* rgmcd; // array of MCD's
178 PlfMcd(const PlfMcd&);
179 PlfMcd& operator = ( const PlfMcd&);
180 public:
181 PlfMcd( bool bReadId = true );
182 ~PlfMcd();
183 bool Read(SvStream *pS);
184 void Print( FILE* );
187 class Acd : public TBBase
189 sal_Int16 ibst;
190 sal_uInt16 fciBasedOnABC; // fciBasedOn(13 bits) A(1bit)B(1bit)C(1Bit)
191 Acd(const Acd&);
192 Acd& operator = ( const Acd&);
193 public:
194 Acd();
195 ~Acd(){}
196 bool Read(SvStream *pS);
197 void Print( FILE* );
200 class PlfAcd: public Tcg255SubStruct
202 sal_Int32 iMac;
203 Acd* rgacd;
204 PlfAcd(const PlfAcd&);
205 PlfAcd& operator = ( const PlfAcd&);
206 public:
207 PlfAcd( bool bReadId = true );
208 ~PlfAcd();
209 bool Read(SvStream *pS);
210 void Print(FILE*);
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
222 Kme(const Kme&);
223 Kme& operator = ( const Kme&);
224 public:
225 Kme();
226 ~Kme();
227 bool Read(SvStream *pS);
228 void Print( FILE* );
231 class PlfKme : public Tcg255SubStruct
233 sal_Int32 iMac;
234 Kme* rgkme;
235 PlfKme(const PlfKme&);
236 PlfKme& operator = ( const PlfKme&);
237 public:
238 PlfKme( bool bReadId = true );
239 ~PlfKme();
240 bool Read(SvStream *pS);
241 void Print( FILE* );
244 class TcgSttbfCore : public TBBase
246 struct SBBItem
248 sal_uInt16 cchData;
249 rtl::OUString data;
250 sal_uInt16 extraData;
251 SBBItem() : cchData(0), extraData(0){}
253 sal_uInt16 fExtend;
254 sal_uInt16 cData;
255 sal_uInt16 cbExtra;
256 SBBItem* dataItems;
257 TcgSttbfCore(const TcgSttbfCore&);
258 TcgSttbfCore& operator = ( const TcgSttbfCore&);
259 public:
260 TcgSttbfCore();
261 ~TcgSttbfCore();
262 bool Read(SvStream *pS);
263 void Print( FILE* fp );
266 class TcgSttbf : public Tcg255SubStruct
268 TcgSttbfCore sttbf;
269 TcgSttbf(const TcgSttbf&);
270 TcgSttbf& operator = ( const TcgSttbf&);
271 public:
272 TcgSttbf( bool bReadId = true );
273 ~TcgSttbf(){}
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.
281 sal_uInt16 chTerm;
283 Xstz(const Xstz&);
284 Xstz& operator = ( const Xstz&);
285 public:
286 Xstz();
287 ~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.
295 Xstz xstz;
296 MacroName(const MacroName&);
297 MacroName& operator = ( const MacroName&);
298 public:
299 MacroName();
300 ~MacroName(){}
301 bool Read(SvStream *pS);
302 void Print( FILE* );
305 class MacroNames : public Tcg255SubStruct
307 sal_uInt16 iMac; //An unsigned integer that specifies the number of MacroName structures in rgNames.
308 MacroName* rgNames;
310 MacroNames(const MacroNames&);
311 MacroNames& operator = ( const MacroNames&);
312 public:
313 MacroNames( bool bReadId = true );
314 ~MacroNames();
315 bool Read(SvStream *pS);
316 void Print( FILE* );
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* );
325 public:
326 Tcg255();
327 ~Tcg255();
328 bool Read(SvStream *pS);
329 void Print( FILE* );
330 bool ImportCustomToolBar( SfxObjectShell& rDocSh );
333 class Tcg: public TBBase
335 sal_Int8 nTcgVer;
336 std::auto_ptr< Tcg255 > tcg;
337 Tcg(const Tcg&);
338 Tcg& operator = ( const Tcg&);
339 public:
340 Tcg();
341 ~Tcg(){}
342 bool Read(SvStream *pS);
343 bool ImportCustomToolBar( SfxObjectShell& rDocSh );
344 void Print( FILE* );
347 #endif