LCOV - code coverage report
Current view: top level - sc/source/filter/inc - xlescher.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 35 35 100.0 %
Date: 2015-06-13 12:38:46 Functions: 9 9 100.0 %
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             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_SC_SOURCE_FILTER_INC_XLESCHER_HXX
      21             : #define INCLUDED_SC_SOURCE_FILTER_INC_XLESCHER_HXX
      22             : 
      23             : #include <tools/gen.hxx>
      24             : #include <tools/mapunit.hxx>
      25             : #include "fapihelper.hxx"
      26             : #include "xladdress.hxx"
      27             : #include "xlstyle.hxx"
      28             : #include "xistream.hxx"
      29             : 
      30             : namespace com { namespace sun { namespace star {
      31             :     namespace drawing { class XShape; }
      32             :     namespace awt { class XControlModel; }
      33             :     namespace script { struct ScriptEventDescriptor; }
      34             : } } }
      35             : 
      36             : class Rectangle;
      37             : 
      38             : // Constants and Enumerations =================================================
      39             : 
      40             : // (0x001C) NOTE --------------------------------------------------------------
      41             : 
      42             : const sal_uInt16 EXC_ID_NOTE                = 0x001C;
      43             : const sal_uInt16 EXC_NOTE_VISIBLE           = 0x0002;
      44             : const sal_uInt16 EXC_NOTE5_MAXLEN           = 2048;
      45             : 
      46             : // (0x005D) OBJ ---------------------------------------------------------------
      47             : 
      48             : const sal_uInt16 EXC_ID_OBJ                 = 0x005D;
      49             : 
      50             : const sal_uInt16 EXC_OBJ_INVALID_ID         = 0;
      51             : 
      52             : // object types
      53             : const sal_uInt16 EXC_OBJTYPE_GROUP          = 0;
      54             : const sal_uInt16 EXC_OBJTYPE_LINE           = 1;
      55             : const sal_uInt16 EXC_OBJTYPE_RECTANGLE      = 2;
      56             : const sal_uInt16 EXC_OBJTYPE_OVAL           = 3;
      57             : const sal_uInt16 EXC_OBJTYPE_ARC            = 4;
      58             : const sal_uInt16 EXC_OBJTYPE_CHART          = 5;
      59             : const sal_uInt16 EXC_OBJTYPE_TEXT           = 6;
      60             : const sal_uInt16 EXC_OBJTYPE_BUTTON         = 7;
      61             : const sal_uInt16 EXC_OBJTYPE_PICTURE        = 8;
      62             : const sal_uInt16 EXC_OBJTYPE_POLYGON        = 9;        // new in BIFF4
      63             : const sal_uInt16 EXC_OBJTYPE_CHECKBOX       = 11;       // new in BIFF5
      64             : const sal_uInt16 EXC_OBJTYPE_OPTIONBUTTON   = 12;
      65             : const sal_uInt16 EXC_OBJTYPE_EDIT           = 13;
      66             : const sal_uInt16 EXC_OBJTYPE_LABEL          = 14;
      67             : const sal_uInt16 EXC_OBJTYPE_DIALOG         = 15;
      68             : const sal_uInt16 EXC_OBJTYPE_SPIN           = 16;
      69             : const sal_uInt16 EXC_OBJTYPE_SCROLLBAR      = 17;
      70             : const sal_uInt16 EXC_OBJTYPE_LISTBOX        = 18;
      71             : const sal_uInt16 EXC_OBJTYPE_GROUPBOX       = 19;
      72             : const sal_uInt16 EXC_OBJTYPE_DROPDOWN       = 20;
      73             : const sal_uInt16 EXC_OBJTYPE_NOTE           = 25;       // new in BIFF8
      74             : const sal_uInt16 EXC_OBJTYPE_DRAWING        = 30;
      75             : const sal_uInt16 EXC_OBJTYPE_UNKNOWN        = 0xFFFF;   /// For internal use only.
      76             : 
      77             : // BIFF3-BIFF5 flags
      78             : const sal_uInt16 EXC_OBJ_HIDDEN             = 0x0100;
      79             : const sal_uInt16 EXC_OBJ_VISIBLE            = 0x0200;
      80             : const sal_uInt16 EXC_OBJ_PRINTABLE          = 0x0400;
      81             : 
      82             : // BIFF5 line formatting
      83             : const sal_uInt8 EXC_OBJ_LINE_AUTOCOLOR      = 64;
      84             : 
      85             : const sal_uInt8 EXC_OBJ_LINE_SOLID          = 0;
      86             : const sal_uInt8 EXC_OBJ_LINE_DASH           = 1;
      87             : const sal_uInt8 EXC_OBJ_LINE_DOT            = 2;
      88             : const sal_uInt8 EXC_OBJ_LINE_DASHDOT        = 3;
      89             : const sal_uInt8 EXC_OBJ_LINE_DASHDOTDOT     = 4;
      90             : const sal_uInt8 EXC_OBJ_LINE_MEDTRANS       = 5;
      91             : const sal_uInt8 EXC_OBJ_LINE_DARKTRANS      = 6;
      92             : const sal_uInt8 EXC_OBJ_LINE_LIGHTTRANS     = 7;
      93             : const sal_uInt8 EXC_OBJ_LINE_NONE           = 255;
      94             : 
      95             : const sal_uInt8 EXC_OBJ_LINE_HAIR           = 0;
      96             : const sal_uInt8 EXC_OBJ_LINE_THIN           = 1;
      97             : const sal_uInt8 EXC_OBJ_LINE_MEDIUM         = 2;
      98             : const sal_uInt8 EXC_OBJ_LINE_THICK          = 3;
      99             : 
     100             : const sal_uInt8 EXC_OBJ_LINE_AUTO           = 0x01;
     101             : 
     102             : const sal_uInt8 EXC_OBJ_ARROW_NONE          = 0;
     103             : const sal_uInt8 EXC_OBJ_ARROW_OPEN          = 1;
     104             : const sal_uInt8 EXC_OBJ_ARROW_FILLED        = 2;
     105             : const sal_uInt8 EXC_OBJ_ARROW_OPENBOTH      = 3;
     106             : const sal_uInt8 EXC_OBJ_ARROW_FILLEDBOTH    = 4;
     107             : 
     108             : const sal_uInt8 EXC_OBJ_ARROW_NARROW        = 0;
     109             : const sal_uInt8 EXC_OBJ_ARROW_MEDIUM        = 1;
     110             : const sal_uInt8 EXC_OBJ_ARROW_WIDE          = 2;
     111             : 
     112             : const sal_uInt8 EXC_OBJ_LINE_TL             = 0;
     113             : const sal_uInt8 EXC_OBJ_LINE_TR             = 1;
     114             : const sal_uInt8 EXC_OBJ_LINE_BR             = 2;
     115             : const sal_uInt8 EXC_OBJ_LINE_BL             = 3;
     116             : 
     117             : // BIFF5 fill formatting
     118             : const sal_uInt8 EXC_OBJ_FILL_AUTOCOLOR      = 65;
     119             : 
     120             : const sal_uInt8 EXC_OBJ_FILL_AUTO           = 0x01;
     121             : 
     122             : // BIFF5 frame formatting
     123             : const sal_uInt16 EXC_OBJ_FRAME_SHADOW       = 0x0002;
     124             : 
     125             : // BIFF5 text objects
     126             : const sal_uInt8 EXC_OBJ_HOR_LEFT            = 1;
     127             : const sal_uInt8 EXC_OBJ_HOR_CENTER          = 2;
     128             : const sal_uInt8 EXC_OBJ_HOR_RIGHT           = 3;
     129             : const sal_uInt8 EXC_OBJ_HOR_JUSTIFY         = 4;
     130             : 
     131             : const sal_uInt8 EXC_OBJ_VER_TOP             = 1;
     132             : const sal_uInt8 EXC_OBJ_VER_CENTER          = 2;
     133             : const sal_uInt8 EXC_OBJ_VER_BOTTOM          = 3;
     134             : const sal_uInt8 EXC_OBJ_VER_JUSTIFY         = 4;
     135             : 
     136             : const sal_uInt16 EXC_OBJ_ORIENT_NONE        = 0;
     137             : const sal_uInt16 EXC_OBJ_ORIENT_STACKED     = 1;        /// Stacked top to bottom.
     138             : const sal_uInt16 EXC_OBJ_ORIENT_90CCW       = 2;        /// 90 degr. counterclockwise.
     139             : const sal_uInt16 EXC_OBJ_ORIENT_90CW        = 3;        /// 90 degr. clockwise.
     140             : 
     141             : const sal_uInt16 EXC_OBJ_TEXT_AUTOSIZE      = 0x0080;
     142             : const sal_uInt16 EXC_OBJ_TEXT_LOCKED        = 0x0200;
     143             : 
     144             : const sal_Int32 EXC_OBJ_TEXT_MARGIN         = 20000;    /// Automatic text margin (EMUs).
     145             : 
     146             : // BIFF5 arc objects
     147             : const sal_uInt8 EXC_OBJ_ARC_TR              = 0;
     148             : const sal_uInt8 EXC_OBJ_ARC_TL              = 1;
     149             : const sal_uInt8 EXC_OBJ_ARC_BL              = 2;
     150             : const sal_uInt8 EXC_OBJ_ARC_BR              = 3;
     151             : 
     152             : // BIFF5 polygon objects
     153             : const sal_uInt16 EXC_OBJ_POLY_CLOSED        = 0x0100;
     154             : 
     155             : // BIFF5 pictures/OLE objects
     156             : const sal_uInt16 EXC_OBJ_PIC_MANUALSIZE     = 0x0001;
     157             : const sal_uInt16 EXC_OBJ_PIC_DDE            = 0x0002;
     158             : const sal_uInt16 EXC_OBJ_PIC_SYMBOL         = 0x0008;
     159             : const sal_uInt16 EXC_OBJ_PIC_CONTROL        = 0x0010;   /// Form control (BIFF8).
     160             : const sal_uInt16 EXC_OBJ_PIC_CTLSSTREAM     = 0x0020;   /// Data in Ctls stream (BIFF8).
     161             : const sal_uInt16 EXC_OBJ_PIC_AUTOLOAD       = 0x0200;   /// Auto-load form control (BIFF8).
     162             : 
     163             : // BIFF5 button objects
     164             : const sal_uInt16 EXC_OBJ_BUTTON_DEFAULT     = 0x0001;
     165             : const sal_uInt16 EXC_OBJ_BUTTON_HELP        = 0x0002;
     166             : const sal_uInt16 EXC_OBJ_BUTTON_CANCEL      = 0x0004;
     167             : const sal_uInt16 EXC_OBJ_BUTTON_CLOSE       = 0x0008;
     168             : 
     169             : // BIFF5 checkboxs, radio buttons
     170             : const sal_uInt16 EXC_OBJ_CHECKBOX_UNCHECKED = 0;
     171             : const sal_uInt16 EXC_OBJ_CHECKBOX_CHECKED   = 1;
     172             : const sal_uInt16 EXC_OBJ_CHECKBOX_TRISTATE  = 2;
     173             : const sal_uInt16 EXC_OBJ_CHECKBOX_FLAT      = 0x0001;
     174             : 
     175             : // BIFF5 editbox objects
     176             : const sal_uInt16 EXC_OBJ_EDIT_TEXT          = 0;
     177             : const sal_uInt16 EXC_OBJ_EDIT_INTEGER       = 1;
     178             : const sal_uInt16 EXC_OBJ_EDIT_DOUBLE        = 2;
     179             : const sal_uInt16 EXC_OBJ_EDIT_REFERENCE     = 3;
     180             : const sal_uInt16 EXC_OBJ_EDIT_FORMULA       = 4;
     181             : 
     182             : // BIFF5 scrollbars/spinbuttons
     183             : const sal_uInt16 EXC_OBJ_SCROLLBAR_MIN      = 0;
     184             : const sal_uInt16 EXC_OBJ_SCROLLBAR_MAX      = 30000;
     185             : 
     186             : const sal_uInt16 EXC_OBJ_SCROLLBAR_HOR      = 0x0001;
     187             : 
     188             : const sal_uInt16 EXC_OBJ_SCROLLBAR_DEFFLAGS = 0x0001;
     189             : const sal_uInt16 EXC_OBJ_SCROLLBAR_FLAT     = 0x0008;
     190             : 
     191             : // BIFF5 listboxes/dropdowns
     192             : const sal_uInt8 EXC_OBJ_LISTBOX_SINGLE      = 0;        /// Single selection.
     193             : const sal_uInt8 EXC_OBJ_LISTBOX_MULTI       = 1;        /// Multi selection.
     194             : const sal_uInt8 EXC_OBJ_LISTBOX_RANGE       = 2;        /// Range selection.
     195             : 
     196             : const sal_uInt16 EXC_OBJ_LISTBOX_EDIT       = 0x0002;
     197             : const sal_uInt16 EXC_OBJ_LISTBOX_FLAT       = 0x0008;
     198             : 
     199             : // BIFF5 dropdown listboxes
     200             : const sal_uInt16 EXC_OBJ_DROPDOWN_LISTBOX   = 0;        /// Listbox, text not editable.
     201             : const sal_uInt16 EXC_OBJ_DROPDOWN_COMBOBOX  = 1;        /// Dropdown listbox with editable text.
     202             : const sal_uInt16 EXC_OBJ_DROPDOWN_SIMPLE    = 2;        /// Dropdown button only, no text area.
     203             : const sal_uInt16 EXC_OBJ_DROPDOWN_MAX       = 3;
     204             : const sal_uInt16 EXC_OBJ_DROPDOWN_FILTERED  = 0x0008;   /// Drowdown style: filtered.
     205             : 
     206             : // BIFF5 groupboxes
     207             : const sal_uInt16 EXC_OBJ_GROUPBOX_FLAT      = 0x0001;
     208             : 
     209             : // BIFF8 sub records
     210             : const sal_uInt16 EXC_ID_OBJEND              = 0x0000;   /// End of OBJ.
     211             : const sal_uInt16 EXC_ID_OBJMACRO            = 0x0004;   /// Macro link.
     212             : const sal_uInt16 EXC_ID_OBJBUTTON           = 0x0005;   /// Button data.
     213             : const sal_uInt16 EXC_ID_OBJGMO              = 0x0006;   /// Group marker.
     214             : const sal_uInt16 EXC_ID_OBJCF               = 0x0007;   /// Clipboard format.
     215             : const sal_uInt16 EXC_ID_OBJFLAGS            = 0x0008;   /// Option flags.
     216             : const sal_uInt16 EXC_ID_OBJPICTFMLA         = 0x0009;   /// OLE link formula.
     217             : const sal_uInt16 EXC_ID_OBJCBLS             = 0x000A;   /// Check box/radio button data.
     218             : const sal_uInt16 EXC_ID_OBJRBO              = 0x000B;   /// Radio button group data.
     219             : const sal_uInt16 EXC_ID_OBJSBS              = 0x000C;   /// Scroll bar data.
     220             : const sal_uInt16 EXC_ID_OBJNTS              = 0x000D;   /// Note data.
     221             : const sal_uInt16 EXC_ID_OBJSBSFMLA          = 0x000E;   /// Scroll bar/list box/combo box cell link.
     222             : const sal_uInt16 EXC_ID_OBJGBODATA          = 0x000F;   /// Group box data.
     223             : const sal_uInt16 EXC_ID_OBJEDODATA          = 0x0010;   /// Edit box data.
     224             : const sal_uInt16 EXC_ID_OBJRBODATA          = 0x0011;   /// Radio button group data.
     225             : const sal_uInt16 EXC_ID_OBJCBLSDATA         = 0x0012;   /// Check box/radio button data.
     226             : const sal_uInt16 EXC_ID_OBJLBSDATA          = 0x0013;   /// List box/combo box data.
     227             : const sal_uInt16 EXC_ID_OBJCBLSFMLA         = 0x0014;   /// Check box/radio button cell link.
     228             : const sal_uInt16 EXC_ID_OBJCMO              = 0x0015;   /// Common object settings.
     229             : const sal_uInt16 EXC_ID_OBJUNKNOWN          = 0xFFFF;   /// For internal use only.
     230             : 
     231             : // BIFF8 OBJCMO: flags
     232             : const sal_uInt16 EXC_OBJCMO_PRINTABLE       = 0x0010;   /// Object printable.
     233             : const sal_uInt16 EXC_OBJCMO_AUTOLINE        = 0x2000;   /// Automatic line formatting.
     234             : const sal_uInt16 EXC_OBJCMO_AUTOFILL        = 0x4000;   /// Automatic fill formatting.
     235             : 
     236             : /** Value binding mode for cells linked to form controls. */
     237             : enum XclCtrlBindMode
     238             : {
     239             :     EXC_CTRL_BINDCONTENT,       /// Binds cell to content of control.
     240             :     EXC_CTRL_BINDPOSITION       /// Binds cell to position in control (e.g. listbox selection index).
     241             : };
     242             : 
     243             : // (0x007F) IMGDATA -----------------------------------------------------------
     244             : 
     245             : const sal_uInt16 EXC_ID3_IMGDATA            = 0x007F;
     246             : const sal_uInt16 EXC_ID8_IMGDATA            = 0x00E9;
     247             : 
     248             : const sal_uInt16 EXC_IMGDATA_WMF            = 2;
     249             : const sal_uInt16 EXC_IMGDATA_BMP            = 9;
     250             : 
     251             : const sal_uInt16 EXC_IMGDATA_WIN            = 1;
     252             : const sal_uInt16 EXC_IMGDATA_MAC            = 2;
     253             : 
     254             : const sal_uInt32 EXC_IMGDATA_MAXREC8        = 0x201C;
     255             : const sal_uInt32 EXC_IMGDATA_MAXCONT8       = 0x2014;
     256             : 
     257             : // (0x00A9) COORDLIST ---------------------------------------------------------
     258             : 
     259             : const sal_uInt16 EXC_ID_COORDLIST           = 0x00A9;
     260             : 
     261             : // (0x00EB) MSODRAWINGGROUP ---------------------------------------------------
     262             : 
     263             : const sal_uInt16 EXC_ID_MSODRAWINGGROUP     = 0x00EB;
     264             : 
     265             : // (0x00EC) MSODRAWING --------------------------------------------------------
     266             : 
     267             : const sal_uInt16 EXC_ID_MSODRAWING          = 0x00EC;
     268             : 
     269             : // additional flags not extant in svx headers
     270             : const sal_uInt16 EXC_ESC_ANCHOR_POSLOCKED   = 0x0001;
     271             : const sal_uInt16 EXC_ESC_ANCHOR_SIZELOCKED  = 0x0002;
     272             : const sal_uInt16 EXC_ESC_ANCHOR_LOCKED      = EXC_ESC_ANCHOR_POSLOCKED|EXC_ESC_ANCHOR_SIZELOCKED;
     273             : 
     274             : // (0x00ED) MSODRAWINGSELECTION -----------------------------------------------
     275             : 
     276             : const sal_uInt16 EXC_ID_MSODRAWINGSEL       = 0x00ED;
     277             : 
     278             : // (0x01B6) TXO ---------------------------------------------------------------
     279             : 
     280             : const sal_uInt16 EXC_ID_TXO                 = 0x01B6;
     281             : 
     282             : // TXO constants are eqzal to BIFF5 OBJ text object flags
     283             : 
     284             : // Structs and classes ========================================================
     285             : 
     286             : /** Represents the position (anchor) of an object in a Calc document. */
     287             : struct XclObjAnchor : public XclRange
     288             : {
     289             :     sal_uInt16          mnLX;       /// X offset in left column (1/1024 of column width).
     290             :     sal_uInt32          mnTY;       /// Y offset in top row (1/256 of row height).
     291             :     sal_uInt16          mnRX;       /// X offset in right column (1/1024 of column width).
     292             :     sal_uInt32          mnBY;       /// Y offset in bottom row (1/256 of row height).
     293             : 
     294             :     explicit            XclObjAnchor();
     295             : 
     296             :     /** Calculates a rectangle from the contained coordinates. */
     297             :     Rectangle           GetRect( const XclRoot& rRoot, SCTAB nScTab, MapUnit eMapUnit ) const;
     298             :     /** Initializes the anchor coordinates for a sheet. */
     299             :     void                SetRect( const XclRoot& rRoot, SCTAB nScTab, const Rectangle& rRect, MapUnit eMapUnit );
     300             : 
     301             :     /** Initializes the anchor coordinates for an embedded draw page. */
     302             :     void                SetRect( const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY,
     303             :                             const Rectangle& rRect, MapUnit eMapUnit, bool bDffAnchor );
     304             : };
     305             : 
     306         135 : inline SvStream& operator>>( SvStream& rStrm, XclObjAnchor& rAnchor )
     307             : {
     308             :     sal_uInt16 tmpFirstRow, tmpTY, tmpLastRow, tmpBY;
     309             : 
     310             :     rStrm
     311         135 :        .ReadUInt16( rAnchor.maFirst.mnCol ).ReadUInt16( rAnchor.mnLX )
     312         135 :        .ReadUInt16( tmpFirstRow ).ReadUInt16( tmpTY )
     313         270 :        .ReadUInt16( rAnchor.maLast.mnCol ).ReadUInt16( rAnchor.mnRX )
     314         135 :        .ReadUInt16( tmpLastRow ).ReadUInt16( tmpBY );
     315             : 
     316         135 :     rAnchor.maFirst.mnRow = static_cast<sal_uInt32> (tmpFirstRow);
     317         135 :     rAnchor.mnTY = static_cast<sal_uInt32> (tmpTY);
     318         135 :     rAnchor.maLast.mnRow = static_cast<sal_uInt32> (tmpLastRow);
     319         135 :     rAnchor.mnBY = static_cast<sal_uInt32> (tmpBY);
     320             : 
     321         135 :     return rStrm;
     322             : }
     323             : 
     324           2 : inline XclImpStream& operator>>( XclImpStream& rStrm, XclObjAnchor& rAnchor )
     325             : {
     326             :     sal_uInt16 tmpFirstRow, tmpTY, tmpLastRow, tmpBY;
     327             : 
     328           2 :     rAnchor.maFirst.mnCol = rStrm.ReaduInt16();
     329           2 :     rAnchor.mnLX = rStrm.ReaduInt16();
     330           2 :     tmpFirstRow = rStrm.ReaduInt16();
     331           2 :     tmpTY = rStrm.ReaduInt16();
     332           2 :     rAnchor.maLast.mnCol = rStrm.ReaduInt16();
     333           2 :     rAnchor.mnRX = rStrm.ReaduInt16();
     334           2 :     tmpLastRow = rStrm.ReaduInt16();
     335           2 :     tmpBY = rStrm.ReaduInt16();
     336             : 
     337           2 :     rAnchor.maFirst.mnRow = static_cast<sal_uInt32> (tmpFirstRow);
     338           2 :     rAnchor.mnTY = static_cast<sal_uInt32> (tmpTY);
     339           2 :     rAnchor.maLast.mnRow = static_cast<sal_uInt32> (tmpLastRow);
     340           2 :     rAnchor.mnBY = static_cast<sal_uInt32> (tmpBY);
     341             : 
     342           2 :     return rStrm;
     343             : }
     344             : 
     345             : template< typename StreamType >
     346             : StreamType& operator<<( StreamType& rStrm, const XclObjAnchor& rAnchor )
     347             : {
     348             :     return rStrm
     349             :         << rAnchor.maFirst.mnCol << rAnchor.mnLX
     350             :         << static_cast<sal_uInt16>(rAnchor.maFirst.mnRow) << static_cast<sal_uInt16>(rAnchor.mnTY)
     351             :         << rAnchor.maLast.mnCol  << rAnchor.mnRX
     352             :         << static_cast<sal_uInt16>(rAnchor.maLast.mnRow)  << static_cast<sal_uInt16>(rAnchor.mnBY);
     353             : }
     354             : 
     355          58 : inline SvStream& WriteXclObjAnchor( SvStream& rStrm, const XclObjAnchor& rAnchor )
     356             : {
     357             :     return rStrm
     358          58 :           .WriteUInt16( rAnchor.maFirst.mnCol ).WriteUInt16( rAnchor.mnLX )
     359         116 :           .WriteUInt16( rAnchor.maFirst.mnRow ).WriteUInt16( rAnchor.mnTY )
     360         116 :           .WriteUInt16( rAnchor.maLast.mnCol ).WriteUInt16( rAnchor.mnRX )
     361         116 :           .WriteUInt16( rAnchor.maLast.mnRow).WriteUInt16(rAnchor.mnBY);
     362             : }
     363             : 
     364             : struct XclObjLineData
     365             : {
     366             :     sal_uInt8           mnColorIdx;
     367             :     sal_uInt8           mnStyle;
     368             :     sal_uInt8           mnWidth;
     369             :     sal_uInt8           mnAuto;
     370             : 
     371             :     explicit            XclObjLineData();
     372             : 
     373           4 :     inline bool         IsAuto() const { return ::get_flag( mnAuto, EXC_OBJ_LINE_AUTO ); }
     374           2 :     inline bool         IsVisible() const { return IsAuto() || (mnStyle != EXC_OBJ_LINE_NONE); }
     375             : };
     376             : 
     377             : XclImpStream& operator>>( XclImpStream& rStrm, XclObjLineData& rLineData );
     378             : 
     379             : struct XclObjFillData
     380             : {
     381             :     sal_uInt8           mnBackColorIdx;
     382             :     sal_uInt8           mnPattColorIdx;
     383             :     sal_uInt8           mnPattern;
     384             :     sal_uInt8           mnAuto;
     385             : 
     386             :     explicit            XclObjFillData();
     387             : 
     388           8 :     inline bool         IsAuto() const { return ::get_flag( mnAuto, EXC_OBJ_FILL_AUTO ); }
     389           6 :     inline bool         IsFilled() const { return IsAuto() || (mnPattern != EXC_PATT_NONE); }
     390             : };
     391             : 
     392             : XclImpStream& operator>>( XclImpStream& rStrm, XclObjFillData& rFillData );
     393             : 
     394             : struct XclObjTextData
     395             : {
     396             :     sal_uInt16          mnTextLen;
     397             :     sal_uInt16          mnFormatSize;
     398             :     sal_uInt16          mnLinkSize;
     399             :     sal_uInt16          mnDefFontIdx;
     400             :     sal_uInt16          mnFlags;
     401             :     sal_uInt16          mnOrient;
     402             :     sal_uInt16          mnButtonFlags;
     403             :     sal_uInt16          mnShortcut;
     404             :     sal_uInt16          mnShortcutEA;
     405             : 
     406             :     explicit            XclObjTextData();
     407             : 
     408             :     /** Reads text data from a BIFF3/BIFF4 OBJ record. */
     409             :     void                ReadObj3( XclImpStream& rStrm );
     410             :     /** Reads text data from a BIFF5 OBJ record. */
     411             :     void                ReadObj5( XclImpStream& rStrm );
     412             :     /** Reads text data from a BIFF8 TXO record. */
     413             :     void                ReadTxo8( XclImpStream& rStrm );
     414             : 
     415          15 :     inline sal_uInt8    GetHorAlign() const { return ::extract_value< sal_uInt8 >( mnFlags, 1, 3 ); }
     416          15 :     inline sal_uInt8    GetVerAlign() const { return ::extract_value< sal_uInt8 >( mnFlags, 4, 3 ); }
     417             : };
     418             : 
     419             : enum XclTbxEventType
     420             : {
     421             :     EXC_TBX_EVENT_ACTION,       /// XActionListener.actionPerformed
     422             :     EXC_TBX_EVENT_MOUSE,        /// XMouseListener.mouseReleased
     423             :     EXC_TBX_EVENT_TEXT,         /// XTextListener.textChanged
     424             :     EXC_TBX_EVENT_VALUE,        /// XAdjustmentListener.adjustmentValueChanged
     425             :     EXC_TBX_EVENT_CHANGE        /// XChangeListener.changed
     426             : };
     427             : 
     428             : /** Provides static helper functions for form controls. */
     429             : class XclControlHelper
     430             : {
     431             : public:
     432             :     /** Returns the API control model from the passed API shape object. */
     433             :     static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
     434             :                         GetControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
     435             : 
     436             :     /** Fills the macro descriptor according to the passed macro name. */
     437             :     static bool         FillMacroDescriptor(
     438             :                             ::com::sun::star::script::ScriptEventDescriptor& rDescriptor,
     439             :                             XclTbxEventType eEventType,
     440             :                             const OUString& rXclMacroName,
     441             :                             SfxObjectShell* pDocShell = 0 );
     442             :     /** Tries to extract an Excel macro name from the passed macro descriptor. */
     443             :     static OUString     ExtractFromMacroDescriptor(
     444             :                             const ::com::sun::star::script::ScriptEventDescriptor& rDescriptor,
     445             :                             XclTbxEventType eEventType, SfxObjectShell* pShell = NULL );
     446             : };
     447             : 
     448             : #endif
     449             : 
     450             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11