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_XLCONST_HXX 25cdf0e10cSrcweir #define SC_XLCONST_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "address.hxx" 28cdf0e10cSrcweir 29cdf0e10cSrcweir // Common ===================================================================== 30cdf0e10cSrcweir 31cdf0e10cSrcweir // BIFF versions -------------------------------------------------------------- 32cdf0e10cSrcweir 33cdf0e10cSrcweir /** An enumeration for all Excel file format types (BIFF types). */ 34cdf0e10cSrcweir enum XclBiff 35cdf0e10cSrcweir { 36cdf0e10cSrcweir EXC_BIFF2 = 0, /// MS Excel 2.1 37cdf0e10cSrcweir EXC_BIFF3, /// MS Excel 3.0 38cdf0e10cSrcweir EXC_BIFF4, /// MS Excel 4.0 39cdf0e10cSrcweir EXC_BIFF5, /// MS Excel 5.0, MS Excel 7.0 (95) 40cdf0e10cSrcweir EXC_BIFF8, /// MS Excel 8.0 (97), 9.0 (2000), 10.0 (XP), 11.0 (2003) 41cdf0e10cSrcweir EXC_BIFF_UNKNOWN /// Unknown BIFF version. 42cdf0e10cSrcweir }; 43cdf0e10cSrcweir 44cdf0e10cSrcweir /** An enumeration for all Excel output format types. */ 45cdf0e10cSrcweir enum XclOutput 46cdf0e10cSrcweir { 47cdf0e10cSrcweir EXC_OUTPUT_BINARY, /// MS Excel binary .xls 48cdf0e10cSrcweir EXC_OUTPUT_XML_2007, /// MS Excel 2007 .xlsx 49cdf0e10cSrcweir }; 50cdf0e10cSrcweir 51cdf0e10cSrcweir // Excel sheet dimensions ----------------------------------------------------- 52cdf0e10cSrcweir 53cdf0e10cSrcweir const SCCOL EXC_MAXCOL2 = 255; 54cdf0e10cSrcweir const SCROW EXC_MAXROW2 = 16383; 55cdf0e10cSrcweir const SCTAB EXC_MAXTAB2 = 0; 56cdf0e10cSrcweir 57cdf0e10cSrcweir const SCCOL EXC_MAXCOL3 = EXC_MAXCOL2; 58cdf0e10cSrcweir const SCROW EXC_MAXROW3 = EXC_MAXROW2; 59cdf0e10cSrcweir const SCTAB EXC_MAXTAB3 = EXC_MAXTAB2; 60cdf0e10cSrcweir 61cdf0e10cSrcweir const SCCOL EXC_MAXCOL4 = EXC_MAXCOL3; 62cdf0e10cSrcweir const SCROW EXC_MAXROW4 = EXC_MAXROW3; 63cdf0e10cSrcweir const SCTAB EXC_MAXTAB4 = 32767; 64cdf0e10cSrcweir 65cdf0e10cSrcweir const SCCOL EXC_MAXCOL5 = EXC_MAXCOL4; 66cdf0e10cSrcweir const SCROW EXC_MAXROW5 = EXC_MAXROW4; 67cdf0e10cSrcweir const SCTAB EXC_MAXTAB5 = EXC_MAXTAB4; 68cdf0e10cSrcweir 69cdf0e10cSrcweir const SCCOL EXC_MAXCOL8 = EXC_MAXCOL5; 70cdf0e10cSrcweir const SCROW EXC_MAXROW8 = 65535; 71cdf0e10cSrcweir const SCTAB EXC_MAXTAB8 = EXC_MAXTAB5; 72cdf0e10cSrcweir 73cdf0e10cSrcweir const sal_uInt16 EXC_NOTAB = SAL_MAX_UINT16; /// An invalid Excel sheet index, for common use. 74cdf0e10cSrcweir const SCTAB SCTAB_INVALID = SCTAB_MAX; /// An invalid Calc sheet index, for common use. 75cdf0e10cSrcweir const SCTAB SCTAB_GLOBAL = SCTAB_MAX; /// A Calc sheet index for the workbook globals. 76cdf0e10cSrcweir 77cdf0e10cSrcweir // Storage/stream names ------------------------------------------------------- 78cdf0e10cSrcweir 79cdf0e10cSrcweir #define EXC_STORAGE_OLE_LINKED CREATE_STRING( "LNK" ) 80cdf0e10cSrcweir #define EXC_STORAGE_OLE_EMBEDDED CREATE_STRING( "MBD" ) 81cdf0e10cSrcweir #define EXC_STORAGE_VBA_PROJECT CREATE_STRING( "_VBA_PROJECT_CUR" ) 82cdf0e10cSrcweir #define EXC_STORAGE_VBA CREATE_STRING( "VBA" ) 83cdf0e10cSrcweir 84cdf0e10cSrcweir #define EXC_STREAM_BOOK CREATE_STRING( "Book" ) 85cdf0e10cSrcweir #define EXC_STREAM_WORKBOOK CREATE_STRING( "Workbook" ) 86cdf0e10cSrcweir #define EXC_STREAM_CTLS CREATE_STRING( "Ctls" ) 87cdf0e10cSrcweir 88cdf0e10cSrcweir // Encoded URLs --------------------------------------------------------------- 89cdf0e10cSrcweir 90cdf0e10cSrcweir const sal_Unicode EXC_URLSTART_ENCODED = '\x01'; /// Encoded URL. 91cdf0e10cSrcweir const sal_Unicode EXC_URLSTART_SELF = '\x02'; /// Reference to own workbook. 92cdf0e10cSrcweir const sal_Unicode EXC_URLSTART_SELFENCODED = '\x03'; /// Encoded self reference. 93cdf0e10cSrcweir const sal_Unicode EXC_URLSTART_OWNDOC = '\x04'; /// Reference to own workbook (BIFF5/BIFF7). 94cdf0e10cSrcweir 95cdf0e10cSrcweir const sal_Unicode EXC_URL_DOSDRIVE = '\x01'; /// DOS drive letter or UNC server name. 96cdf0e10cSrcweir const sal_Unicode EXC_URL_DRIVEROOT = '\x02'; /// Root directory of current drive. 97cdf0e10cSrcweir const sal_Unicode EXC_URL_SUBDIR = '\x03'; /// Directory name delimiter. 98cdf0e10cSrcweir const sal_Unicode EXC_URL_PARENTDIR = '\x04'; /// Parent directory. 99cdf0e10cSrcweir const sal_Unicode EXC_URL_RAW = '\x05'; /// Unencoded URL. 100cdf0e10cSrcweir const sal_Unicode EXC_URL_SHEETNAME = '\x09'; /// Sheet name starts here (BIFF4). 101cdf0e10cSrcweir 102cdf0e10cSrcweir const sal_Unicode EXC_DDE_DELIM = '\x03'; /// DDE application-topic delimiter 103cdf0e10cSrcweir 104cdf0e10cSrcweir // Error codes ---------------------------------------------------------------- 105cdf0e10cSrcweir 106cdf0e10cSrcweir const sal_uInt8 EXC_ERR_NULL = 0x00; 107cdf0e10cSrcweir const sal_uInt8 EXC_ERR_DIV0 = 0x07; 108cdf0e10cSrcweir const sal_uInt8 EXC_ERR_VALUE = 0x0F; 109cdf0e10cSrcweir const sal_uInt8 EXC_ERR_REF = 0x17; 110cdf0e10cSrcweir const sal_uInt8 EXC_ERR_NAME = 0x1D; 111cdf0e10cSrcweir const sal_uInt8 EXC_ERR_NUM = 0x24; 112cdf0e10cSrcweir const sal_uInt8 EXC_ERR_NA = 0x2A; 113cdf0e10cSrcweir 114cdf0e10cSrcweir // Cached values list (EXTERNNAME, ptgArray, ...) ----------------------------- 115cdf0e10cSrcweir 116cdf0e10cSrcweir const sal_uInt8 EXC_CACHEDVAL_EMPTY = 0x00; 117cdf0e10cSrcweir const sal_uInt8 EXC_CACHEDVAL_DOUBLE = 0x01; 118cdf0e10cSrcweir const sal_uInt8 EXC_CACHEDVAL_STRING = 0x02; 119cdf0e10cSrcweir const sal_uInt8 EXC_CACHEDVAL_BOOL = 0x04; 120cdf0e10cSrcweir const sal_uInt8 EXC_CACHEDVAL_ERROR = 0x10; 121cdf0e10cSrcweir 122cdf0e10cSrcweir // RK values ------------------------------------------------------------------ 123cdf0e10cSrcweir 124cdf0e10cSrcweir const sal_Int32 EXC_RK_100FLAG = 0x00000001; 125cdf0e10cSrcweir const sal_Int32 EXC_RK_INTFLAG = 0x00000002; 126cdf0e10cSrcweir const sal_Int32 EXC_RK_VALUEMASK = 0xFFFFFFFC; 127cdf0e10cSrcweir 128cdf0e10cSrcweir const sal_Int32 EXC_RK_DBL = 0x00000000; 129cdf0e10cSrcweir const sal_Int32 EXC_RK_DBL100 = EXC_RK_100FLAG; 130cdf0e10cSrcweir const sal_Int32 EXC_RK_INT = EXC_RK_INTFLAG; 131cdf0e10cSrcweir const sal_Int32 EXC_RK_INT100 = EXC_RK_100FLAG | EXC_RK_INTFLAG; 132cdf0e10cSrcweir 133cdf0e10cSrcweir // Measures ------------------------------------------------------------------- 134cdf0e10cSrcweir 135cdf0e10cSrcweir const sal_Int32 EXC_POINTS_PER_INCH = 72; 136cdf0e10cSrcweir const sal_Int32 EXC_TWIPS_PER_INCH = EXC_POINTS_PER_INCH * 20; 137cdf0e10cSrcweir 138cdf0e10cSrcweir const double EXC_POINTS_PER_HMM = static_cast< double >( EXC_POINTS_PER_INCH ) / 2540.0; 139cdf0e10cSrcweir 140cdf0e10cSrcweir const sal_uInt8 EXC_ORIENT_NONE = 0; /// Text orientation: not rotated. 141cdf0e10cSrcweir const sal_uInt8 EXC_ORIENT_STACKED = 1; /// Text orientation: vertically stacked. 142cdf0e10cSrcweir const sal_uInt8 EXC_ORIENT_90CCW = 2; /// Text orientation: 90 deg counterclockwise. 143cdf0e10cSrcweir const sal_uInt8 EXC_ORIENT_90CW = 3; /// Text orientation: 90 deg clockwise. 144cdf0e10cSrcweir 145cdf0e10cSrcweir const sal_uInt8 EXC_ROT_NONE = 0; /// Text rotation: not rotated. 146cdf0e10cSrcweir const sal_uInt8 EXC_ROT_90CCW = 90; /// Text rotation: 90 deg counterclockwise. 147cdf0e10cSrcweir const sal_uInt8 EXC_ROT_90CW = 180; /// Text rotation: 90 deg clockwise. 148cdf0e10cSrcweir const sal_uInt8 EXC_ROT_STACKED = 255; /// Text rotation: vertically stacked. 149cdf0e10cSrcweir 150cdf0e10cSrcweir // Records (ordered by lowest record ID) ====================================== 151cdf0e10cSrcweir 152cdf0e10cSrcweir // (0x0009, 0x0209, 0x0409, 0x0809) BOF --------------------------------------- 153cdf0e10cSrcweir 154cdf0e10cSrcweir const sal_uInt16 EXC_ID2_BOF = 0x0009; 155cdf0e10cSrcweir const sal_uInt16 EXC_ID3_BOF = 0x0209; 156cdf0e10cSrcweir const sal_uInt16 EXC_ID4_BOF = 0x0409; 157cdf0e10cSrcweir const sal_uInt16 EXC_ID5_BOF = 0x0809; 158cdf0e10cSrcweir 159cdf0e10cSrcweir const sal_uInt16 EXC_BOF_BIFF2 = 0x0200; 160cdf0e10cSrcweir const sal_uInt16 EXC_BOF_BIFF3 = 0x0300; 161cdf0e10cSrcweir const sal_uInt16 EXC_BOF_BIFF4 = 0x0400; 162cdf0e10cSrcweir const sal_uInt16 EXC_BOF_BIFF5 = 0x0500; 163cdf0e10cSrcweir const sal_uInt16 EXC_BOF_BIFF8 = 0x0600; 164cdf0e10cSrcweir 165cdf0e10cSrcweir const sal_uInt16 EXC_BOF_GLOBALS = 0x0005; /// BIFF5-BIFF8 workbook globals. 166cdf0e10cSrcweir const sal_uInt16 EXC_BOF_VBMODULE = 0x0006; /// BIFF5-BIFF8 Visual BASIC module. 167cdf0e10cSrcweir const sal_uInt16 EXC_BOF_SHEET = 0x0010; /// Regular worksheet. 168cdf0e10cSrcweir const sal_uInt16 EXC_BOF_CHART = 0x0020; /// Chart sheet. 169cdf0e10cSrcweir const sal_uInt16 EXC_BOF_MACROSHEET = 0x0040; /// Macro sheet. 170cdf0e10cSrcweir const sal_uInt16 EXC_BOF_WORKSPACE = 0x0100; /// Workspace. 171cdf0e10cSrcweir const sal_uInt16 EXC_BOF_UNKNOWN = 0xFFFF; /// Internal use only. 172cdf0e10cSrcweir 173cdf0e10cSrcweir // (0x000A) EOF --------------------------------------------------------------- 174cdf0e10cSrcweir 175cdf0e10cSrcweir const sal_uInt16 EXC_ID_EOF = 0x000A; 176cdf0e10cSrcweir 177cdf0e10cSrcweir // (0x0012) PROTECT ----------------------------------------------------------- 178cdf0e10cSrcweir 179cdf0e10cSrcweir const sal_uInt16 EXC_ID_PROTECT = 0x0012; 180cdf0e10cSrcweir 181cdf0e10cSrcweir // (0x0013) PASSWORD ---------------------------------------------------------- 182cdf0e10cSrcweir 183cdf0e10cSrcweir const sal_uInt16 EXC_ID_PASSWORD = 0x0013; 184cdf0e10cSrcweir 185cdf0e10cSrcweir // (0x0019) WINDOWPROTECT ----------------------------------------------------- 186cdf0e10cSrcweir 187cdf0e10cSrcweir const sal_uInt16 EXC_ID_WINDOWPROTECT = 0x0019; 188cdf0e10cSrcweir 189cdf0e10cSrcweir // (0x0042) CODEPAGE ---------------------------------------------------------- 190cdf0e10cSrcweir 191cdf0e10cSrcweir const sal_uInt16 EXC_ID_CODEPAGE = 0x0042; 192cdf0e10cSrcweir 193cdf0e10cSrcweir // (0x0081) WSBOOL ------------------------------------------------------------ 194cdf0e10cSrcweir 195cdf0e10cSrcweir const sal_uInt16 EXC_ID_WSBOOL = 0x0081; 196cdf0e10cSrcweir 197cdf0e10cSrcweir const sal_uInt16 EXC_WSBOOL_ROWBELOW = 0x0040; 198cdf0e10cSrcweir const sal_uInt16 EXC_WSBOOL_COLBELOW = 0x0080; 199cdf0e10cSrcweir const sal_uInt16 EXC_WSBOOL_FITTOPAGE = 0x0100; 200cdf0e10cSrcweir 201cdf0e10cSrcweir const sal_uInt16 EXC_WSBOOL_DEFAULTFLAGS = 0x04C1; 202cdf0e10cSrcweir 203cdf0e10cSrcweir // (0x0086) WRITEPROT --------------------------------------------------------- 204cdf0e10cSrcweir 205cdf0e10cSrcweir const sal_uInt16 EXC_ID_WRITEPROT = 0x0086; 206cdf0e10cSrcweir 207cdf0e10cSrcweir // (0x008C) COUNTRY ----------------------------------------------------------- 208cdf0e10cSrcweir 209cdf0e10cSrcweir const sal_uInt16 EXC_ID_COUNTRY = 0x008C; 210cdf0e10cSrcweir 211cdf0e10cSrcweir // (0x009B) FILTERMODE -------------------------------------------------------- 212cdf0e10cSrcweir 213cdf0e10cSrcweir const sal_uInt16 EXC_ID_FILTERMODE = 0x009B; 214cdf0e10cSrcweir 215cdf0e10cSrcweir // (0x009C) FNGROUPCOUNT ------------------------------------------------------ 216cdf0e10cSrcweir 217cdf0e10cSrcweir const sal_uInt16 EXC_ID_FNGROUPCOUNT = 0x009C; 218cdf0e10cSrcweir 219cdf0e10cSrcweir // (0x009D) AUTOFILTERINFO ---------------------------------------------------- 220cdf0e10cSrcweir 221cdf0e10cSrcweir const sal_uInt16 EXC_ID_AUTOFILTERINFO = 0x009D; 222cdf0e10cSrcweir 223cdf0e10cSrcweir // (0x009E) AUTOFILTER -------------------------------------------------------- 224cdf0e10cSrcweir 225cdf0e10cSrcweir const sal_uInt16 EXC_ID_AUTOFILTER = 0x009E; 226cdf0e10cSrcweir 227cdf0e10cSrcweir // (0x00BF, 0x00C0, 0x00C1) TOOLBARHDR, TOOLBAREND, MMS ----------------------- 228cdf0e10cSrcweir 229cdf0e10cSrcweir const sal_uInt16 EXC_ID_TOOLBARHDR = 0x00BF; 230cdf0e10cSrcweir const sal_uInt16 EXC_ID_TOOLBAREND = 0x00C0; 231cdf0e10cSrcweir const sal_uInt16 EXC_ID_MMS = 0x00C1; 232cdf0e10cSrcweir 233cdf0e10cSrcweir // (0x00E1, 0x00E2) INTERFACEHDR, INTERFACEEND -------------------------------- 234cdf0e10cSrcweir 235cdf0e10cSrcweir const sal_uInt16 EXC_ID_INTERFACEHDR = 0x00E1; 236cdf0e10cSrcweir const sal_uInt16 EXC_ID_INTERFACEEND = 0x00E2; 237cdf0e10cSrcweir 238cdf0e10cSrcweir // (0x0160) USESELFS ---------------------------------------------------------- 239cdf0e10cSrcweir 240cdf0e10cSrcweir const sal_uInt16 EXC_ID_USESELFS = 0x0160; 241cdf0e10cSrcweir 242cdf0e10cSrcweir // (0x0161) DSF --------------------------------------------------------------- 243cdf0e10cSrcweir 244cdf0e10cSrcweir const sal_uInt16 EXC_ID_DSF = 0x0161; 245cdf0e10cSrcweir 246cdf0e10cSrcweir // (0x01AA,0x01AB) USERSVIEWBEGIN, USERSVIEWEND ------------------------------- 247cdf0e10cSrcweir 248cdf0e10cSrcweir const sal_uInt16 EXC_ID_USERSVIEWBEGIN = 0x01AA; 249cdf0e10cSrcweir const sal_uInt16 EXC_ID_USERSVIEWEND = 0x01AB; 250cdf0e10cSrcweir 251cdf0e10cSrcweir // (0x01BA) CODENAME ---------------------------------------------------------- 252cdf0e10cSrcweir 253cdf0e10cSrcweir const sal_uInt16 EXC_ID_CODENAME = 0x01BA; 254cdf0e10cSrcweir 255cdf0e10cSrcweir // (0x01C0) XL9FILE ----------------------------------------------------------- 256cdf0e10cSrcweir 257cdf0e10cSrcweir const sal_uInt16 EXC_ID_XL9FILE = 0x01C0; 258cdf0e10cSrcweir 259cdf0e10cSrcweir // (0x8xx) Future records ----------------------------------------------------- 260cdf0e10cSrcweir 261cdf0e10cSrcweir /** Enumerates different header types of future records. */ 262cdf0e10cSrcweir enum XclFutureRecType 263cdf0e10cSrcweir { 264cdf0e10cSrcweir EXC_FUTUREREC_SIMPLE, /// Record identifier and empty flags field. 265cdf0e10cSrcweir EXC_FUTUREREC_UNUSEDREF /// Record identifier, empty flags field, unused range address. 266cdf0e10cSrcweir }; 267cdf0e10cSrcweir 268cdf0e10cSrcweir const sal_uInt16 EXC_FUTUREREC_EMPTYFLAGS = 0x0000; 269cdf0e10cSrcweir const sal_uInt16 EXC_FUTUREREC_HASREF = 0x0001; 270cdf0e10cSrcweir const sal_uInt16 EXC_FUTUREREC_ALERT = 0x0002; 271cdf0e10cSrcweir 272cdf0e10cSrcweir // ============================================================================ 273cdf0e10cSrcweir 274cdf0e10cSrcweir #endif 275cdf0e10cSrcweir 276