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