LCOV - code coverage report
Current view: top level - sw/source/filter/ww8 - ww8toolbar.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 11 21 52.4 %
Date: 2012-08-25 Functions: 12 30 40.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 9 38 23.7 %

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

Generated by: LCOV version 1.10