1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Initial Developer of the Original Code is
* Noel Power <noel.power@novell.com>
* Portions created by the Initial Developer are Copyright (C) 2010 the
* Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Noel Power <noel.power@novell.com>
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#ifndef _WW8TOOLBAR_HXX
#define _WW8TOOLBAR_HXX
#include <filter/msfilter/mstoolbar.hxx>
namespace css = ::com::sun::star;
class Xst : public TBBase
{
rtl::OUString sString;
public:
Xst(){}
bool Read(SvStream &rS);
rtl::OUString getString() { return sString; }
void Print( FILE* fp );
};
class CTBWrapper;
class TBC : public TBBase
{
TBCHeader tbch;
boost::shared_ptr< sal_uInt32 > cid; // optional
boost::shared_ptr<TBCData> tbcd;
public:
TBC();
~TBC();
bool Read(SvStream &rS);
void Print( FILE* );
bool ImportToolBarControl( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper&, bool );
rtl::OUString GetCustomText();
};
class CTB : public TBBase
{
Xst name;
sal_Int32 cbTBData;
TB tb;
std::vector<TBVisualData> rVisualData;
sal_Int32 iWCTBl;
sal_uInt16 reserved;
sal_uInt16 unused;
sal_Int32 cCtls;
std::vector< TBC > rTBC;
CTB(const CTB&);
CTB& operator = ( const CTB&);
public:
CTB();
~CTB();
bool Read(SvStream &rS);
void Print( FILE* fp );
bool IsMenuToolbar();
bool ImportCustomToolBar( CTBWrapper&, CustomToolBarImportHelper& );
bool ImportMenuTB( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
rtl::OUString GetName() { return tb.getName().getString(); }
};
class TBDelta : public TBBase
{
sal_uInt8 doprfatendFlags;
sal_uInt8 ibts;
sal_Int32 cidNext;
sal_Int32 cid;
sal_Int32 fc;
sal_uInt16 CiTBDE; // careful of this ( endian matters etc. )
sal_uInt16 cbTBC;
public:
TBDelta();
~TBDelta(){}
bool Read(SvStream &rS);
void Print( FILE* );
bool ControlIsModified();
bool ControlIsInserted();
bool ControlIsChanged();
bool ControlDropsToolBar();
sal_Int32 TBCStreamOffset();
sal_Int16 CustomizationIndex();
};
class Tcg255SubStruct : public TBBase
{
friend class Tcg255;
bool mbReadId;
Tcg255SubStruct(const Tcg255SubStruct&);
Tcg255SubStruct& operator = ( const Tcg255SubStruct&);
protected:
sal_uInt8 ch;
public:
Tcg255SubStruct( bool bReadId );
~Tcg255SubStruct(){}
virtual sal_uInt8 id() const { return ch; }
bool Read(SvStream &rS);
};
class CTBWrapper;
class Customization : public TBBase
{
friend class CTBWrapper;
sal_Int32 tbidForTBD;
sal_uInt16 reserved1;
sal_Int16 ctbds;
CTBWrapper* pWrapper;
boost::shared_ptr< CTB > customizationDataCTB;
std::vector< TBDelta > customizationDataTBDelta;
bool bIsDroppedMenuTB;
bool ImportMenu( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
public:
Customization( CTBWrapper* rapper );
~Customization();
bool Read(SvStream &rS);
bool ImportCustomToolBar( CTBWrapper&, CustomToolBarImportHelper& );
bool ImportMenu( CTBWrapper&, CustomToolBarImportHelper& );
void Print( FILE* );
sal_Int32 GetTBIDForTB(){ return tbidForTBD; }
CTB* GetCustomizationData() { return customizationDataCTB.get(); };
};
class SfxObjectShell;
class CTBWrapper : public Tcg255SubStruct
{
// reserved1 is the ch field of Tcg255SubStruct
sal_uInt16 reserved2;
sal_uInt8 reserved3;
sal_uInt16 reserved4;
sal_uInt16 reserved5;
sal_Int16 cbTBD;
sal_Int16 cCust;
sal_Int32 cbDTBC;
std::vector< TBC > rtbdc; //
std::vector< Customization > rCustomizations; // array of Customizations
std::vector< sal_Int16 > dropDownMenuIndices; // array of indexes of Customization toolbars that are dropped by a menu
CTBWrapper(const CTBWrapper&);
CTBWrapper& operator = ( const CTBWrapper&);
public:
CTBWrapper( bool bReadId = true );
~CTBWrapper();
void InsertDropIndex( sal_Int32 aIndex ) { dropDownMenuIndices.push_back( aIndex ); }
TBC* GetTBCAtOffset( sal_uInt32 nStreamOffset );
bool Read(SvStream &rS);
bool ImportCustomToolBar( SfxObjectShell& rDocSh );
Customization* GetCustomizaton( sal_Int16 index );
CTB* GetCustomizationData( const rtl::OUString& name );
void Print( FILE* );
};
class MCD : public TBBase
{
sal_Int8 reserved1; // A signed integer that MUST be 0x56.
sal_uInt8 reserved2; // MUST be 0.
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.
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.
sal_uInt16 reserved3; // An unsigned integer that MUST be 0xFFFF.
sal_uInt32 reserved4; //MUST be ignored.
sal_uInt32 reserved5; //MUST be 0.
sal_uInt32 reserved6; //MUST be ignored.
sal_uInt32 reserved7; //MUST be ignored
MCD(const MCD&);
MCD& operator = ( const MCD&);
public:
MCD();
~MCD(){}
bool Read(SvStream &rS);
void Print( FILE* );
};
class PlfMcd : public Tcg255SubStruct
{
sal_Int32 iMac;
MCD* rgmcd; // array of MCD's
PlfMcd(const PlfMcd&);
PlfMcd& operator = ( const PlfMcd&);
public:
PlfMcd( bool bReadId = true );
~PlfMcd();
bool Read(SvStream &rS);
void Print( FILE* );
};
class Acd : public TBBase
{
sal_Int16 ibst;
sal_uInt16 fciBasedOnABC; // fciBasedOn(13 bits) A(1bit)B(1bit)C(1Bit)
Acd(const Acd&);
Acd& operator = ( const Acd&);
public:
Acd();
~Acd(){}
bool Read(SvStream &rS);
void Print( FILE* );
};
class PlfAcd: public Tcg255SubStruct
{
sal_Int32 iMac;
Acd* rgacd;
PlfAcd(const PlfAcd&);
PlfAcd& operator = ( const PlfAcd&);
public:
PlfAcd( bool bReadId = true );
~PlfAcd();
bool Read(SvStream &rS);
void Print(FILE*);
};
class Kme : public TBBase
{
sal_Int16 reserved1; //MUST be zero.
sal_Int16 reserved2; //MUST be zero.
sal_uInt16 kcm1; //A Kcm that specifies the primary shortcut key.
sal_uInt16 kcm2; //A Kcm that specifies the secondary shortcut key, or 0x00FF if there is no secondary shortcut key.
sal_uInt16 kt; //A Kt that specifies the type of action to be taken when the key combination is pressed.
sal_uInt32 param; //The meaning of this field depends on the value of kt
Kme(const Kme&);
Kme& operator = ( const Kme&);
public:
Kme();
~Kme();
bool Read(SvStream &rS);
void Print( FILE* );
};
class PlfKme : public Tcg255SubStruct
{
sal_Int32 iMac;
Kme* rgkme;
PlfKme(const PlfKme&);
PlfKme& operator = ( const PlfKme&);
public:
PlfKme( bool bReadId = true );
~PlfKme();
bool Read(SvStream &rS);
void Print( FILE* );
};
class TcgSttbfCore : public TBBase
{
struct SBBItem
{
sal_uInt16 cchData;
rtl::OUString data;
sal_uInt16 extraData;
SBBItem() : cchData(0), extraData(0){}
};
sal_uInt16 fExtend;
sal_uInt16 cData;
sal_uInt16 cbExtra;
SBBItem* dataItems;
TcgSttbfCore(const TcgSttbfCore&);
TcgSttbfCore& operator = ( const TcgSttbfCore&);
public:
TcgSttbfCore();
~TcgSttbfCore();
bool Read(SvStream &rS);
void Print( FILE* fp );
};
class TcgSttbf : public Tcg255SubStruct
{
TcgSttbfCore sttbf;
TcgSttbf(const TcgSttbf&);
TcgSttbf& operator = ( const TcgSttbf&);
public:
TcgSttbf( bool bReadId = true );
~TcgSttbf(){}
bool Read(SvStream &rS);
void Print( FILE* fp );
};
class Xstz : public TBBase
{
Xst xst; //An Xst specifying the string with its pre-pended length.
sal_uInt16 chTerm;
Xstz(const Xstz&);
Xstz& operator = ( const Xstz&);
public:
Xstz();
~Xstz(){}
bool Read(SvStream &rS);
void Print( FILE* fp );
};
class MacroName : public TBBase
{
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.
Xstz xstz;
MacroName(const MacroName&);
MacroName& operator = ( const MacroName&);
public:
MacroName();
~MacroName(){}
bool Read(SvStream &rS);
void Print( FILE* );
};
class MacroNames : public Tcg255SubStruct
{
sal_uInt16 iMac; //An unsigned integer that specifies the number of MacroName structures in rgNames.
MacroName* rgNames;
MacroNames(const MacroNames&);
MacroNames& operator = ( const MacroNames&);
public:
MacroNames( bool bReadId = true );
~MacroNames();
bool Read(SvStream &rS);
void Print( FILE* );
};
class Tcg255 : public TBBase
{
std::vector< Tcg255SubStruct* > rgtcgData; // array of sub structures
Tcg255(const Tcg255&);
Tcg255& operator = ( const Tcg255&);
bool processSubStruct( sal_uInt8 nId, SvStream& );
public:
Tcg255();
~Tcg255();
bool Read(SvStream &rS);
void Print( FILE* );
bool ImportCustomToolBar( SfxObjectShell& rDocSh );
};
class Tcg: public TBBase
{
sal_Int8 nTcgVer;
std::auto_ptr< Tcg255 > tcg;
Tcg(const Tcg&);
Tcg& operator = ( const Tcg&);
public:
Tcg();
~Tcg(){}
bool Read(SvStream &rS);
bool ImportCustomToolBar( SfxObjectShell& rDocSh );
void Print( FILE* );
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|