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

Generated by: LCOV version 1.10