LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sw/source/filter/ww8 - ww8toolbar.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 12 22 54.5 %
Date: 2013-07-09 Functions: 14 32 43.8 %
Legend: Lines: hit not hit

          Line data    Source code
       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 _WW8TOOLBAR_HXX
      10             : #define _WW8TOOLBAR_HXX
      11             : 
      12             : #include <filter/msfilter/mstoolbar.hxx>
      13             : 
      14           1 : class Xst : public TBBase
      15             : {
      16             :     OUString sString;
      17             : public:
      18           1 :     Xst(){}
      19             :     bool Read(SvStream &rS);
      20           0 :     OUString getString() { return sString; }
      21             :     void Print( FILE* fp );
      22             : };
      23             : 
      24             : class SwCTBWrapper;
      25           0 : class SwTBC : public TBBase
      26             : {
      27             :     TBCHeader tbch;
      28             :     boost::shared_ptr< sal_uInt32 > cid; // optional
      29             :     boost::shared_ptr<TBCData> tbcd;
      30             : public:
      31             :     SwTBC();
      32             :     ~SwTBC();
      33             :     bool Read(SvStream &rS);
      34             :     void Print( FILE* );
      35             :     bool ImportToolBarControl( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper&, bool );
      36             :     OUString GetCustomText();
      37             : };
      38             : 
      39             : class SwCTB : public TBBase
      40             : {
      41             :     Xst name;
      42             :     sal_Int32 cbTBData;
      43             :     TB tb;
      44             :     std::vector<TBVisualData> rVisualData;
      45             :     sal_Int32 iWCTBl;
      46             :     sal_uInt16 reserved;
      47             :     sal_uInt16 unused;
      48             :     sal_Int32 cCtls;
      49             :     std::vector< SwTBC > rTBC;
      50             : 
      51             :     SwCTB(const SwCTB&);
      52             :     SwCTB& operator = ( const SwCTB&);
      53             : public:
      54             :     SwCTB();
      55             :     ~SwCTB();
      56             :     bool Read(SvStream &rS);
      57             :     void Print( FILE* fp );
      58             :     bool IsMenuToolbar();
      59             :     bool ImportCustomToolBar( SwCTBWrapper&, CustomToolBarImportHelper& );
      60             :     bool ImportMenuTB( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
      61           0 :     OUString GetName() { return tb.getName().getString(); }
      62             : };
      63             : 
      64           0 : class TBDelta : public TBBase
      65             : {
      66             :     sal_uInt8 doprfatendFlags;
      67             : 
      68             :     sal_uInt8 ibts;
      69             :     sal_Int32 cidNext;
      70             :     sal_Int32 cid;
      71             :     sal_Int32 fc;
      72             :     sal_uInt16 CiTBDE; // careful of this ( endian matters etc. )
      73             :     sal_uInt16 cbTBC;
      74             : public:
      75             :     TBDelta();
      76           0 :     ~TBDelta(){}
      77             :     bool Read(SvStream &rS);
      78             :     void Print( FILE* );
      79             :     bool ControlIsModified();
      80             :     bool ControlIsInserted();
      81             :     bool ControlIsChanged();
      82             :     bool ControlDropsToolBar();
      83             :     sal_Int32 TBCStreamOffset();
      84             :     sal_Int16 CustomizationIndex();
      85             : 
      86             : };
      87             : 
      88             : class Tcg255SubStruct : public TBBase
      89             : {
      90             : friend class Tcg255;
      91             :     bool mbReadId;
      92             :     Tcg255SubStruct(const Tcg255SubStruct&);
      93             :     Tcg255SubStruct& operator = ( const Tcg255SubStruct&);
      94             : protected:
      95             :     sal_uInt8 ch;
      96             : public:
      97             :     Tcg255SubStruct( bool bReadId );
      98           5 :     ~Tcg255SubStruct(){}
      99           3 :     virtual sal_uInt8 id() const { return ch; }
     100             :     bool Read(SvStream &rS);
     101             : };
     102             : 
     103             : class SwCTBWrapper;
     104           0 : class Customization : public TBBase
     105             : {
     106             : friend class SwCTBWrapper;
     107             :     sal_Int32 tbidForTBD;
     108             :     sal_uInt16 reserved1;
     109             :     sal_Int16 ctbds;
     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& );
     115             : public:
     116             :     Customization( SwCTBWrapper* rapper );
     117             :     ~Customization();
     118             :     bool Read(SvStream &rS);
     119             :     bool ImportCustomToolBar( SwCTBWrapper&, CustomToolBarImportHelper& );
     120             :     bool ImportMenu( SwCTBWrapper&, CustomToolBarImportHelper& );
     121             :     void Print( FILE* );
     122           0 :     sal_Int32 GetTBIDForTB(){ return tbidForTBD; }
     123           0 :     SwCTB*  GetCustomizationData() { return customizationDataCTB.get(); };
     124             : };
     125             : 
     126             : class SfxObjectShell;
     127             : 
     128             : class SwCTBWrapper : public Tcg255SubStruct
     129             : {
     130             :     // reserved1 is the ch field of Tcg255SubStruct
     131             :     sal_uInt16 reserved2;
     132             :     sal_uInt8 reserved3;
     133             :     sal_uInt16 reserved4;
     134             :     sal_uInt16 reserved5;
     135             : 
     136             :     sal_Int16 cbTBD;
     137             :     sal_Int16 cCust;
     138             : 
     139             :     sal_Int32 cbDTBC;
     140             : 
     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&);
     146             : public:
     147             :     SwCTBWrapper( bool bReadId = true );
     148             :     ~SwCTBWrapper();
     149           0 :     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 );
     153             : 
     154             :     Customization* GetCustomizaton( sal_Int16 index );
     155             :     SwCTB* GetCustomizationData( const OUString& name );
     156             :     void Print( FILE* );
     157             : };
     158             : 
     159           2 : class MCD : public TBBase
     160             : {
     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
     170             : 
     171             : public:
     172             :     MCD();
     173             :     MCD(const MCD&);
     174             :     MCD& operator = ( const MCD&);
     175             :     bool Read(SvStream &rS);
     176             :     void Print( FILE* );
     177             : };
     178             : 
     179           4 : class PlfMcd : public Tcg255SubStruct
     180             : {
     181             :     sal_Int32 iMac;
     182             :     std::vector<MCD> rgmcd; // array of MCD's
     183             :     PlfMcd(const PlfMcd&);
     184             :     PlfMcd& operator = ( const PlfMcd&);
     185             : public:
     186             :     PlfMcd( bool bReadId = true );
     187             :     bool Read(SvStream &rS);
     188             :     void Print( FILE* );
     189             : };
     190             : 
     191             : class Acd : public TBBase
     192             : {
     193             :     sal_Int16 ibst;
     194             :     sal_uInt16 fciBasedOnABC; //  fciBasedOn(13 bits) A(1bit)B(1bit)C(1Bit)
     195             :     Acd(const Acd&);
     196             :     Acd& operator = ( const Acd&);
     197             : public:
     198             :     Acd();
     199           0 :     ~Acd(){}
     200             :     bool Read(SvStream &rS);
     201             :     void Print( FILE* );
     202             : };
     203             : 
     204             : class PlfAcd: public Tcg255SubStruct
     205             : {
     206             :     sal_Int32 iMac;
     207             :     Acd* rgacd;
     208             :     PlfAcd(const PlfAcd&);
     209             :     PlfAcd& operator = ( const PlfAcd&);
     210             : public:
     211             :     PlfAcd( bool bReadId = true );
     212             :     ~PlfAcd();
     213             :     bool Read(SvStream &rS);
     214             :     void Print(FILE*);
     215             : };
     216             : 
     217             : class Kme : public TBBase
     218             : {
     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
     225             : 
     226             :     Kme(const Kme&);
     227             :     Kme& operator = ( const Kme&);
     228             : public:
     229             :     Kme();
     230             :     ~Kme();
     231             :     bool Read(SvStream &rS);
     232             :     void Print( FILE* );
     233             : };
     234             : 
     235             : class PlfKme : public Tcg255SubStruct
     236             : {
     237             :     sal_Int32 iMac;
     238             :     Kme* rgkme;
     239             :     PlfKme(const PlfKme&);
     240             :     PlfKme& operator = ( const PlfKme&);
     241             : public:
     242             :     PlfKme( bool bReadId = true );
     243             :     ~PlfKme();
     244             :     bool Read(SvStream &rS);
     245             :     void Print( FILE* );
     246             : };
     247             : 
     248             : class TcgSttbfCore : public TBBase
     249             : {
     250           2 : struct SBBItem
     251             : {
     252             :     sal_uInt16 cchData;
     253             :     OUString data;
     254             :     sal_uInt16 extraData;
     255           2 :     SBBItem() : cchData(0), extraData(0){}
     256             : };
     257             :     sal_uInt16 fExtend;
     258             :     sal_uInt16 cData;
     259             :     sal_uInt16 cbExtra;
     260             :     SBBItem* dataItems;
     261             :     TcgSttbfCore(const TcgSttbfCore&);
     262             :     TcgSttbfCore& operator = ( const TcgSttbfCore&);
     263             : public:
     264             :     TcgSttbfCore();
     265             :     ~TcgSttbfCore();
     266             :     bool Read(SvStream &rS);
     267             :     void Print( FILE* fp );
     268             : };
     269             : 
     270             : class TcgSttbf : public Tcg255SubStruct
     271             : {
     272             :     TcgSttbfCore sttbf;
     273             :     TcgSttbf(const TcgSttbf&);
     274             :     TcgSttbf& operator = ( const TcgSttbf&);
     275             : public:
     276             :     TcgSttbf( bool bReadId = true );
     277           4 :     ~TcgSttbf(){}
     278             :     bool Read(SvStream &rS);
     279             :     void Print( FILE* fp );
     280             : };
     281             : 
     282             : class Xstz : public TBBase
     283             : {
     284             :     Xst xst; //An Xst specifying the string with its pre-pended length.
     285             :     sal_uInt16 chTerm;
     286             : 
     287             :     Xstz(const Xstz&);
     288             :     Xstz& operator = ( const Xstz&);
     289             : public:
     290             :     Xstz();
     291           1 :     ~Xstz(){}
     292             :     bool Read(SvStream &rS);
     293             :     void Print( FILE* fp );
     294             : };
     295             : 
     296             : class MacroName : public TBBase
     297             : {
     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.
     299             :     Xstz xstz;
     300             :     MacroName(const MacroName&);
     301             :     MacroName& operator = ( const MacroName&);
     302             : public:
     303             :     MacroName();
     304           1 :     ~MacroName(){}
     305             :     bool Read(SvStream &rS);
     306             :     void Print( FILE* );
     307             : };
     308             : 
     309             : class MacroNames : public Tcg255SubStruct
     310             : {
     311             :     sal_uInt16 iMac; //An unsigned integer that specifies the number of MacroName structures in rgNames.
     312             :     MacroName* rgNames;
     313             : 
     314             :     MacroNames(const MacroNames&);
     315             :     MacroNames& operator = ( const MacroNames&);
     316             : public:
     317             :     MacroNames( bool bReadId = true );
     318             :     ~MacroNames();
     319             :     bool Read(SvStream &rS);
     320             :     void Print( FILE* );
     321             : };
     322             : 
     323             : class Tcg255 : public TBBase
     324             : {
     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& );
     329             : public:
     330             :     Tcg255();
     331             :     ~Tcg255();
     332             :     bool Read(SvStream &rS);
     333             :     void Print( FILE* );
     334             :     bool ImportCustomToolBar( SfxObjectShell& rDocSh );
     335             : };
     336             : 
     337             : class Tcg: public TBBase
     338             : {
     339             :     sal_Int8 nTcgVer;
     340             :     std::auto_ptr< Tcg255 > tcg;
     341             :     Tcg(const Tcg&);
     342             :     Tcg& operator = ( const Tcg&);
     343             : public:
     344             :     Tcg();
     345          41 :     ~Tcg(){}
     346             :     bool Read(SvStream &rS);
     347             :     bool ImportCustomToolBar( SfxObjectShell& rDocSh );
     348             :     void Print( FILE* );
     349             : };
     350             : 
     351             : #endif
     352             : 
     353             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10