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 10cdf0e10cSrcweir * 11*38d50f7bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 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. 19cdf0e10cSrcweir * 20*38d50f7bSAndrew Rist *************************************************************/ 21*38d50f7bSAndrew Rist 22*38d50f7bSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SC_SCGLOB_HXX 25cdf0e10cSrcweir #define SC_SCGLOB_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "address.hxx" 28cdf0e10cSrcweir #include <i18npool/lang.h> 29cdf0e10cSrcweir #include <tools/stream.hxx> 30cdf0e10cSrcweir #include <osl/endian.h> 31cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx> 32cdf0e10cSrcweir #include "scdllapi.h" 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <hash_map> 35cdf0e10cSrcweir 36cdf0e10cSrcweir class ImageList; 37cdf0e10cSrcweir class Bitmap; 38cdf0e10cSrcweir class SfxItemSet; 39cdf0e10cSrcweir class Color; 40cdf0e10cSrcweir 41cdf0e10cSrcweir // Macro fuer den Call-Profiler unter WinNT 42cdf0e10cSrcweir // mit S_CAP kann eine Messung gestarted, mit E_CAP wieder gestoppt werden 43cdf0e10cSrcweir #if defined( WNT ) && defined( PROFILE ) 44cdf0e10cSrcweir 45cdf0e10cSrcweir extern "C" { 46cdf0e10cSrcweir void StartCAP(); 47cdf0e10cSrcweir void StopCAP(); 48cdf0e10cSrcweir void DumpCAP(); 49cdf0e10cSrcweir }; 50cdf0e10cSrcweir 51cdf0e10cSrcweir #define S_CAP StartCAP(); 52cdf0e10cSrcweir #define E_CAP StopCAP(); DumpCAP(); 53cdf0e10cSrcweir 54cdf0e10cSrcweir #endif 55cdf0e10cSrcweir 56cdf0e10cSrcweir #if 0 57cdf0e10cSrcweir // I18N doesn't get this right, can't specify more than one to ignore 58cdf0e10cSrcweir #define SC_COLLATOR_IGNORES ( \ 59cdf0e10cSrcweir ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE | \ 60cdf0e10cSrcweir ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_KANA | \ 61cdf0e10cSrcweir ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_WIDTH ) 62cdf0e10cSrcweir #else 63cdf0e10cSrcweir #define SC_COLLATOR_IGNORES ( \ 64cdf0e10cSrcweir ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE ) 65cdf0e10cSrcweir #endif 66cdf0e10cSrcweir #if 0 67cdf0e10cSrcweir // #107998# Don't ignore Width and Kana. The issue was mainly with AutoInput, 68cdf0e10cSrcweir // but affects also comparison of names in general. 69cdf0e10cSrcweir #define SC_TRANSLITERATION_IGNORECASE ( \ 70cdf0e10cSrcweir ::com::sun::star::i18n::TransliterationModules_IGNORE_CASE | \ 71cdf0e10cSrcweir ::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | \ 72cdf0e10cSrcweir ::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH ) 73cdf0e10cSrcweir #define SC_TRANSLITERATION_CASESENSE ( \ 74cdf0e10cSrcweir ::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | \ 75cdf0e10cSrcweir ::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH ) 76cdf0e10cSrcweir #else 77cdf0e10cSrcweir #define SC_TRANSLITERATION_IGNORECASE ( \ 78cdf0e10cSrcweir ::com::sun::star::i18n::TransliterationModules_IGNORE_CASE ) 79cdf0e10cSrcweir #define SC_TRANSLITERATION_CASESENSE 0 80cdf0e10cSrcweir #endif 81cdf0e10cSrcweir 82cdf0e10cSrcweir //------------------------------------------------------------------------ 83cdf0e10cSrcweir 84cdf0e10cSrcweir // die 1000 Namen des Calc... 85cdf0e10cSrcweir // Clipboard-Namen sind jetzt in so3/soapp.hxx 86cdf0e10cSrcweir // STRING_SCAPP war "scalc3", "scalc4", jetzt nur noch "scalc" 87cdf0e10cSrcweir 88cdf0e10cSrcweir #define STRING_SCAPP "scalc" 89cdf0e10cSrcweir #define STRING_SCSTREAM "StarCalcDocument" 90cdf0e10cSrcweir 91cdf0e10cSrcweir #define STRING_STANDARD "Standard" 92cdf0e10cSrcweir 93cdf0e10cSrcweir // characters ----------------------------------------------------------------- 94cdf0e10cSrcweir 95cdf0e10cSrcweir // '\r' geht auf'm Mac nicht... 96cdf0e10cSrcweir #define CHAR_CR char(13) 97cdf0e10cSrcweir 98cdf0e10cSrcweir const sal_Unicode CHAR_NBSP = 0x00A0; 99cdf0e10cSrcweir const sal_Unicode CHAR_SHY = 0x00AD; 100cdf0e10cSrcweir const sal_Unicode CHAR_ZWSP = 0x200B; 101cdf0e10cSrcweir const sal_Unicode CHAR_LRM = 0x200E; 102cdf0e10cSrcweir const sal_Unicode CHAR_RLM = 0x200F; 103cdf0e10cSrcweir const sal_Unicode CHAR_NBHY = 0x2011; 104cdf0e10cSrcweir const sal_Unicode CHAR_ZWNBSP = 0x2060; 105cdf0e10cSrcweir 106cdf0e10cSrcweir // ---------------------------------------------------------------------------- 107cdf0e10cSrcweir 108cdf0e10cSrcweir #define MINDOUBLE 1.7e-307 109cdf0e10cSrcweir #define MAXDOUBLE 1.7e307 110cdf0e10cSrcweir 111cdf0e10cSrcweir #define MINZOOM 20 112cdf0e10cSrcweir #define MAXZOOM 400 113cdf0e10cSrcweir 114cdf0e10cSrcweir #ifdef SC_ROWLIMIT_TYPECONVERSION_NOCONVPASS 115cdf0e10cSrcweir const size_t MAXSUBTOTAL = 3; 116cdf0e10cSrcweir const size_t MAXQUERY = 8; 117cdf0e10cSrcweir #else 118cdf0e10cSrcweir const SCSIZE MAXSUBTOTAL = 3; 119cdf0e10cSrcweir const SCSIZE MAXQUERY = 8; 120cdf0e10cSrcweir #endif 121cdf0e10cSrcweir 122cdf0e10cSrcweir #define SC_START_INDEX_DB_COLL 50000 123cdf0e10cSrcweir // Oberhalb dieser Grenze liegen 124cdf0e10cSrcweir // die Indizes fuer DBBereiche 125cdf0e10cSrcweir 126cdf0e10cSrcweir /* 127cdf0e10cSrcweir #ifdef OS2 128cdf0e10cSrcweir #define PIXEL_PER_INCH 72.0 129cdf0e10cSrcweir #else 130cdf0e10cSrcweir #define PIXEL_PER_INCH 96.0 131cdf0e10cSrcweir #endif 132cdf0e10cSrcweir */ 133cdf0e10cSrcweir 134cdf0e10cSrcweir #define PIXEL_PER_INCH 96.0 135cdf0e10cSrcweir 136cdf0e10cSrcweir #define CM_PER_INCH 2.54 137cdf0e10cSrcweir #define POINTS_PER_INCH 72.27 138cdf0e10cSrcweir #define PIXEL_PER_POINT (PIXEL_PER_INCH / POINTS_PER_INCH) 139cdf0e10cSrcweir #define INCHT_PER_CM (1.0 / CM_PER_INCH) 140cdf0e10cSrcweir #define POINTS_PER_CM (POINTS_PER_INCH / CM_PER_INCH) 141cdf0e10cSrcweir #define TWIPS_PER_POINT 20.0 142cdf0e10cSrcweir #define TWIPS_PER_INCH (TWIPS_PER_POINT * POINTS_PER_INCH) 143cdf0e10cSrcweir #define TWIPS_PER_CM (TWIPS_PER_INCH / CM_PER_INCH) 144cdf0e10cSrcweir #define CM_PER_TWIPS (CM_PER_INCH / TWIPS_PER_INCH) 145cdf0e10cSrcweir #define TWIPS_PER_PIXEL (TWIPS_PER_INCH / PIXEL_PER_INCH) 146cdf0e10cSrcweir #define TWIPS_PER_CHAR (TWIPS_PER_INCH / 13.6) 147cdf0e10cSrcweir #define PIXEL_PER_TWIPS (PIXEL_PER_INCH / TWIPS_PER_INCH) 148cdf0e10cSrcweir #define HMM_PER_TWIPS (CM_PER_TWIPS * 1000.0) 149cdf0e10cSrcweir 150cdf0e10cSrcweir #define STD_COL_WIDTH 1285 151cdf0e10cSrcweir #define STD_EXTRA_WIDTH 113 // 2mm Extra fuer optimale Breite 152cdf0e10cSrcweir // Standard Zeilenhoehe: Text + Rand - STD_ROWHEIGHT_DIFF 153cdf0e10cSrcweir 154cdf0e10cSrcweir 155cdf0e10cSrcweir #define MAX_EXTRA_WIDTH 23811 // 42cm in TWIPS 156cdf0e10cSrcweir #define MAX_EXTRA_HEIGHT 23811 157cdf0e10cSrcweir #define MAX_COL_WIDTH 56693 // 1m in TWIPS 158cdf0e10cSrcweir #define MAX_COL_HEIGHT 56693 159cdf0e10cSrcweir 160cdf0e10cSrcweir #define STD_ROWHEIGHT_DIFF 23 161cdf0e10cSrcweir #define STD_FONT_HEIGHT 200 // entspricht 10 Punkt 162cdf0e10cSrcweir 163cdf0e10cSrcweir //! statt STD_ROW_HEIGHT ScGlobal::nStdRowHeight benutzen ! 164cdf0e10cSrcweir 165cdf0e10cSrcweir #define STD_ROW_HEIGHT (12.8 * TWIPS_PER_POINT) // 256 Twips, 0.45 cm 166cdf0e10cSrcweir 167cdf0e10cSrcweir // Standardgroesse als Ole-Server (Zellen) 168cdf0e10cSrcweir #define OLE_STD_CELLS_X 4 169cdf0e10cSrcweir #define OLE_STD_CELLS_Y 5 170cdf0e10cSrcweir 171cdf0e10cSrcweir #define SC_SIZE_OPTIMUM 0xFFFF 172cdf0e10cSrcweir 173cdf0e10cSrcweir // Update-Flags 174cdf0e10cSrcweir #define UF_SCROLL_LEFT 1 175cdf0e10cSrcweir #define UF_SCROLL_RIGHT 2 176cdf0e10cSrcweir #define UF_SCROLL_UP 4 177cdf0e10cSrcweir #define UF_SCROLL_DOWN 8 178cdf0e10cSrcweir #define UF_ROW 16 179cdf0e10cSrcweir #define UF_VIEW 32 180cdf0e10cSrcweir 181cdf0e10cSrcweir // Repaint-Flags (fuer Messages) 182cdf0e10cSrcweir #define PAINT_GRID 1 183cdf0e10cSrcweir #define PAINT_TOP 2 184cdf0e10cSrcweir #define PAINT_LEFT 4 185cdf0e10cSrcweir #define PAINT_EXTRAS 8 186cdf0e10cSrcweir #define PAINT_INVERT 16 187cdf0e10cSrcweir #define PAINT_MARKS 32 188cdf0e10cSrcweir #define PAINT_OBJECTS 64 189cdf0e10cSrcweir #define PAINT_SIZE 128 190cdf0e10cSrcweir #define PAINT_ALL ( PAINT_GRID | PAINT_TOP | PAINT_LEFT | PAINT_EXTRAS | PAINT_OBJECTS | PAINT_SIZE ) 191cdf0e10cSrcweir 192cdf0e10cSrcweir 193cdf0e10cSrcweir // Flags fuer Spalten / Zeilen 194cdf0e10cSrcweir // FILTERED immer zusammen mit HIDDEN 195cdf0e10cSrcweir // FILTERED und MANUALSIZE nur fuer Zeilen moeglich 196cdf0e10cSrcweir const sal_uInt8 CR_HIDDEN = 1; 197cdf0e10cSrcweir //const sal_uInt8 CR_MARKED = 2; 198cdf0e10cSrcweir //const sal_uInt8 CR_PAGEBREAK = 4; 199cdf0e10cSrcweir const sal_uInt8 CR_MANUALBREAK = 8; 200cdf0e10cSrcweir const sal_uInt8 CR_FILTERED = 16; 201cdf0e10cSrcweir const sal_uInt8 CR_MANUALSIZE = 32; 202cdf0e10cSrcweir const sal_uInt8 CR_ALL = (CR_HIDDEN | CR_MANUALBREAK | CR_FILTERED | CR_MANUALSIZE); 203cdf0e10cSrcweir 204cdf0e10cSrcweir typedef sal_uInt8 ScBreakType; 205cdf0e10cSrcweir const ScBreakType BREAK_NONE = 0; 206cdf0e10cSrcweir const ScBreakType BREAK_PAGE = 1; 207cdf0e10cSrcweir const ScBreakType BREAK_MANUAL = 2; 208cdf0e10cSrcweir 209cdf0e10cSrcweir // Insert-/Delete-Flags 210cdf0e10cSrcweir const sal_uInt16 IDF_NONE = 0x0000; 211cdf0e10cSrcweir const sal_uInt16 IDF_VALUE = 0x0001; /// Numeric values (and numeric results if IDF_FORMULA is not set). 212cdf0e10cSrcweir const sal_uInt16 IDF_DATETIME = 0x0002; /// Dates, times, datetime values. 213cdf0e10cSrcweir const sal_uInt16 IDF_STRING = 0x0004; /// Strings (and string results if IDF_FORMULA is not set). 214cdf0e10cSrcweir const sal_uInt16 IDF_NOTE = 0x0008; /// Cell notes. 215cdf0e10cSrcweir const sal_uInt16 IDF_FORMULA = 0x0010; /// Formula cells. 216cdf0e10cSrcweir const sal_uInt16 IDF_HARDATTR = 0x0020; /// Hard cell attributes. 217cdf0e10cSrcweir const sal_uInt16 IDF_STYLES = 0x0040; /// Cell styles. 218cdf0e10cSrcweir const sal_uInt16 IDF_OBJECTS = 0x0080; /// Drawing objects. 219cdf0e10cSrcweir const sal_uInt16 IDF_EDITATTR = 0x0100; /// Rich-text attributes. 220cdf0e10cSrcweir const sal_uInt16 IDF_ATTRIB = IDF_HARDATTR | IDF_STYLES; 221cdf0e10cSrcweir const sal_uInt16 IDF_CONTENTS = IDF_VALUE | IDF_DATETIME | IDF_STRING | IDF_NOTE | IDF_FORMULA; 222cdf0e10cSrcweir const sal_uInt16 IDF_ALL = IDF_CONTENTS | IDF_ATTRIB | IDF_OBJECTS; 223cdf0e10cSrcweir const sal_uInt16 IDF_NOCAPTIONS = 0x0200; /// Internal use only (undo etc.): do not copy/delete caption objects of cell notes. 224cdf0e10cSrcweir const sal_uInt16 IDF_ADDNOTES = 0x0400; /// Internal use only (copy from clip): do not delete existing cell contents when pasting notes. 225cdf0e10cSrcweir 226cdf0e10cSrcweir /// Copy flags for auto/series fill functions: do not touch notes and drawing objects. 227cdf0e10cSrcweir const sal_uInt16 IDF_AUTOFILL = IDF_ALL & ~(IDF_NOTE | IDF_OBJECTS); 228cdf0e10cSrcweir 229cdf0e10cSrcweir #define PASTE_NOFUNC 0 230cdf0e10cSrcweir #define PASTE_ADD 1 231cdf0e10cSrcweir #define PASTE_SUB 2 232cdf0e10cSrcweir #define PASTE_MUL 3 233cdf0e10cSrcweir #define PASTE_DIV 4 234cdf0e10cSrcweir 235cdf0e10cSrcweir #define PASTE_NONEMPTY 5 236cdf0e10cSrcweir 237cdf0e10cSrcweir // Bits fuer HasAttr 238cdf0e10cSrcweir #define HASATTR_LINES 1 239cdf0e10cSrcweir #define HASATTR_MERGED 2 240cdf0e10cSrcweir #define HASATTR_OVERLAPPED 4 241cdf0e10cSrcweir #define HASATTR_PROTECTED 8 242cdf0e10cSrcweir #define HASATTR_SHADOW 16 243cdf0e10cSrcweir #define HASATTR_NEEDHEIGHT 32 244cdf0e10cSrcweir #define HASATTR_SHADOW_RIGHT 64 245cdf0e10cSrcweir #define HASATTR_SHADOW_DOWN 128 246cdf0e10cSrcweir #define HASATTR_AUTOFILTER 256 247cdf0e10cSrcweir #define HASATTR_CONDITIONAL 512 248cdf0e10cSrcweir #define HASATTR_ROTATE 1024 249cdf0e10cSrcweir #define HASATTR_NOTOVERLAPPED 2048 250cdf0e10cSrcweir #define HASATTR_RTL 4096 251cdf0e10cSrcweir #define HASATTR_RIGHTORCENTER 8192 // right or centered logical alignment 252cdf0e10cSrcweir 253cdf0e10cSrcweir #define HASATTR_PAINTEXT ( HASATTR_LINES | HASATTR_SHADOW | HASATTR_CONDITIONAL ) 254cdf0e10cSrcweir 255cdf0e10cSrcweir 256cdf0e10cSrcweir #define EMPTY_STRING ScGlobal::GetEmptyString() 257cdf0e10cSrcweir 258cdf0e10cSrcweir // Layer-ID's fuer Drawing 259cdf0e10cSrcweir #define SC_LAYER_FRONT 0 260cdf0e10cSrcweir #define SC_LAYER_BACK 1 261cdf0e10cSrcweir #define SC_LAYER_INTERN 2 262cdf0e10cSrcweir #define SC_LAYER_CONTROLS 3 263cdf0e10cSrcweir #define SC_LAYER_HIDDEN 4 264cdf0e10cSrcweir 265cdf0e10cSrcweir // Tabellen linken 266cdf0e10cSrcweir #define SC_LINK_NONE 0 267cdf0e10cSrcweir #define SC_LINK_NORMAL 1 268cdf0e10cSrcweir #define SC_LINK_VALUE 2 269cdf0e10cSrcweir 270cdf0e10cSrcweir // Eingabe 271cdf0e10cSrcweir #define SC_ENTER_NORMAL 0 272cdf0e10cSrcweir #define SC_ENTER_BLOCK 1 273cdf0e10cSrcweir #define SC_ENTER_MATRIX 2 274cdf0e10cSrcweir 275cdf0e10cSrcweir // Step = 10pt, max. Einzug = 100 Schritte 276cdf0e10cSrcweir #define SC_INDENT_STEP 200 277cdf0e10cSrcweir #define SC_MAX_INDENT 20000 278cdf0e10cSrcweir 279cdf0e10cSrcweir // Szenario-Flags 280cdf0e10cSrcweir #define SC_SCENARIO_COPYALL 1 281cdf0e10cSrcweir #define SC_SCENARIO_SHOWFRAME 2 282cdf0e10cSrcweir #define SC_SCENARIO_PRINTFRAME 4 283cdf0e10cSrcweir #define SC_SCENARIO_TWOWAY 8 284cdf0e10cSrcweir #define SC_SCENARIO_ATTRIB 16 285cdf0e10cSrcweir #define SC_SCENARIO_VALUE 32 286cdf0e10cSrcweir #define SC_SCENARIO_PROTECT 64 287cdf0e10cSrcweir 288cdf0e10cSrcweir 289cdf0e10cSrcweir #ifndef DELETEZ 290cdf0e10cSrcweir #define DELETEZ(pPtr) { delete pPtr; pPtr = 0; } 291cdf0e10cSrcweir #endif 292cdf0e10cSrcweir 293cdf0e10cSrcweir // Ist Bit in Set gesetzt? 294cdf0e10cSrcweir #define IS_SET(bit,set)(((set)&(bit))==(bit)) 295cdf0e10cSrcweir 296cdf0e10cSrcweir #define SEL_ALL -1 // Eingabezeile: alles Selektieren 297cdf0e10cSrcweir #define RES_CANCEL 0 // Resultate der Funk.AutoPilot-Seiten 298cdf0e10cSrcweir #define RES_BACKWARD 1 299cdf0e10cSrcweir #define RES_END 2 300cdf0e10cSrcweir 301cdf0e10cSrcweir enum CellType 302cdf0e10cSrcweir { 303cdf0e10cSrcweir CELLTYPE_NONE, 304cdf0e10cSrcweir CELLTYPE_VALUE, 305cdf0e10cSrcweir CELLTYPE_STRING, 306cdf0e10cSrcweir CELLTYPE_FORMULA, 307cdf0e10cSrcweir CELLTYPE_NOTE, 308cdf0e10cSrcweir CELLTYPE_EDIT, 309cdf0e10cSrcweir CELLTYPE_SYMBOLS // fuer Laden/Speichern 310cdf0e10cSrcweir #if DBG_UTIL 311cdf0e10cSrcweir ,CELLTYPE_DESTROYED 312cdf0e10cSrcweir #endif 313cdf0e10cSrcweir }; 314cdf0e10cSrcweir 315cdf0e10cSrcweir enum DelCellCmd 316cdf0e10cSrcweir { 317cdf0e10cSrcweir DEL_CELLSUP, 318cdf0e10cSrcweir DEL_CELLSLEFT, 319cdf0e10cSrcweir DEL_DELROWS, 320cdf0e10cSrcweir DEL_DELCOLS, 321cdf0e10cSrcweir DEL_NONE 322cdf0e10cSrcweir }; 323cdf0e10cSrcweir 324cdf0e10cSrcweir enum InsCellCmd 325cdf0e10cSrcweir { 326cdf0e10cSrcweir INS_CELLSDOWN, 327cdf0e10cSrcweir INS_CELLSRIGHT, 328cdf0e10cSrcweir INS_INSROWS, 329cdf0e10cSrcweir INS_INSCOLS, 330cdf0e10cSrcweir INS_NONE 331cdf0e10cSrcweir }; 332cdf0e10cSrcweir 333cdf0e10cSrcweir enum UpdateRefMode 334cdf0e10cSrcweir { 335cdf0e10cSrcweir URM_INSDEL, 336cdf0e10cSrcweir URM_COPY, 337cdf0e10cSrcweir URM_MOVE, 338cdf0e10cSrcweir URM_REORDER 339cdf0e10cSrcweir }; 340cdf0e10cSrcweir 341cdf0e10cSrcweir enum FillDir 342cdf0e10cSrcweir { 343cdf0e10cSrcweir FILL_TO_BOTTOM, 344cdf0e10cSrcweir FILL_TO_RIGHT, 345cdf0e10cSrcweir FILL_TO_TOP, 346cdf0e10cSrcweir FILL_TO_LEFT 347cdf0e10cSrcweir }; 348cdf0e10cSrcweir 349cdf0e10cSrcweir enum FillCmd 350cdf0e10cSrcweir { 351cdf0e10cSrcweir FILL_SIMPLE, 352cdf0e10cSrcweir FILL_LINEAR, 353cdf0e10cSrcweir FILL_GROWTH, 354cdf0e10cSrcweir FILL_DATE, 355cdf0e10cSrcweir FILL_AUTO 356cdf0e10cSrcweir }; 357cdf0e10cSrcweir 358cdf0e10cSrcweir enum FillDateCmd 359cdf0e10cSrcweir { 360cdf0e10cSrcweir FILL_DAY, 361cdf0e10cSrcweir FILL_WEEKDAY, 362cdf0e10cSrcweir FILL_MONTH, 363cdf0e10cSrcweir FILL_YEAR 364cdf0e10cSrcweir }; 365cdf0e10cSrcweir 366cdf0e10cSrcweir enum ScDirection 367cdf0e10cSrcweir { 368cdf0e10cSrcweir DIR_BOTTOM, 369cdf0e10cSrcweir DIR_RIGHT, 370cdf0e10cSrcweir DIR_TOP, 371cdf0e10cSrcweir DIR_LEFT 372cdf0e10cSrcweir }; 373cdf0e10cSrcweir 374cdf0e10cSrcweir enum ScSizeMode 375cdf0e10cSrcweir { 376cdf0e10cSrcweir SC_SIZE_DIRECT, // set size or hide if value is 0 377cdf0e10cSrcweir SC_SIZE_OPTIMAL, // set optimal size for everything 378cdf0e10cSrcweir SC_SIZE_SHOW, // show with original size 379cdf0e10cSrcweir SC_SIZE_VISOPT, // set optimal size only if visible 380cdf0e10cSrcweir SC_SIZE_ORIGINAL // only set size, don't change visible flag 381cdf0e10cSrcweir }; 382cdf0e10cSrcweir 383cdf0e10cSrcweir enum ScInputMode 384cdf0e10cSrcweir { 385cdf0e10cSrcweir SC_INPUT_NONE, 386cdf0e10cSrcweir SC_INPUT_TYPE, // Eingabe, ohne im Inplace-Modus zu sein 387cdf0e10cSrcweir SC_INPUT_TABLE, // Textcursor in der Tabelle 388cdf0e10cSrcweir SC_INPUT_TOP // Textcursor in der Eingabezeile 389cdf0e10cSrcweir }; 390cdf0e10cSrcweir 391cdf0e10cSrcweir enum ScVObjMode // Ausgabemodi von Objekten auf einer Seite 392cdf0e10cSrcweir { 393cdf0e10cSrcweir VOBJ_MODE_SHOW, 394cdf0e10cSrcweir VOBJ_MODE_HIDE 395cdf0e10cSrcweir // #i80528# VOBJ_MODE_DUMMY removed, no longer supported 396cdf0e10cSrcweir }; 397cdf0e10cSrcweir 398cdf0e10cSrcweir enum ScAnchorType // Verankerung eines Zeichenobjekts 399cdf0e10cSrcweir { 400cdf0e10cSrcweir SCA_CELL, 401cdf0e10cSrcweir SCA_PAGE, 402cdf0e10cSrcweir SCA_DONTKNOW // bei Mehrfachselektion 403cdf0e10cSrcweir }; 404cdf0e10cSrcweir 405cdf0e10cSrcweir enum ScGetDBMode 406cdf0e10cSrcweir { 407cdf0e10cSrcweir SC_DB_MAKE, // wenn noetig, "unbenannt" anlegen 408cdf0e10cSrcweir SC_DB_IMPORT, // wenn noetig, "Importx" anlegen 409cdf0e10cSrcweir SC_DB_OLD // nicht neu anlegen 410cdf0e10cSrcweir }; 411cdf0e10cSrcweir 412cdf0e10cSrcweir /// For ScDBFunc::GetDBData() 413cdf0e10cSrcweir enum ScGetDBSelection 414cdf0e10cSrcweir { 415cdf0e10cSrcweir /** Keep selection as is, expand to used data area if no selection. */ 416cdf0e10cSrcweir SC_DBSEL_KEEP, 417cdf0e10cSrcweir 418cdf0e10cSrcweir /** Shrink selection to sheet's data area. */ 419cdf0e10cSrcweir SC_DBSEL_SHRINK_TO_SHEET_DATA, 420cdf0e10cSrcweir 421cdf0e10cSrcweir /** Shrink selection to actually used data area within the selection. */ 422cdf0e10cSrcweir SC_DBSEL_SHRINK_TO_USED_DATA, 423cdf0e10cSrcweir 424cdf0e10cSrcweir /** If only one row or portion thereof is selected, shrink row to used data 425cdf0e10cSrcweir columns and select further rows down until end of data. If an area is 426cdf0e10cSrcweir selected, shrink rows to actually used columns. Else, no selection, 427cdf0e10cSrcweir expand to used data area. */ 428cdf0e10cSrcweir SC_DBSEL_ROW_DOWN, 429cdf0e10cSrcweir 430cdf0e10cSrcweir /** Behave as if the range corresponding to a ScDBData area was selected, 431cdf0e10cSrcweir for API use. */ 432cdf0e10cSrcweir SC_DBSEL_FORCE_MARK 433cdf0e10cSrcweir }; 434cdf0e10cSrcweir 435cdf0e10cSrcweir enum ScLkUpdMode 436cdf0e10cSrcweir { //Verknuepfungen 437cdf0e10cSrcweir LM_ALWAYS, //immer aktualisieren 438cdf0e10cSrcweir LM_NEVER, //niemals 439cdf0e10cSrcweir LM_ON_DEMAND, //auf nachfrage 440cdf0e10cSrcweir LM_UNKNOWN //Shit happens 441cdf0e10cSrcweir }; 442cdf0e10cSrcweir 443cdf0e10cSrcweir 444cdf0e10cSrcweir // ----------------------------------------------------------------------- 445cdf0e10cSrcweir 446cdf0e10cSrcweir //================================================================== 447cdf0e10cSrcweir 448cdf0e10cSrcweir // ----------------------------------------------------------------------- 449cdf0e10cSrcweir 450cdf0e10cSrcweir // enum with values equal to old DBObject enum from sdb 451cdf0e10cSrcweir enum ScDBObject 452cdf0e10cSrcweir { 453cdf0e10cSrcweir ScDbTable, 454cdf0e10cSrcweir ScDbQuery 455cdf0e10cSrcweir }; 456cdf0e10cSrcweir 457cdf0e10cSrcweir struct ScImportParam 458cdf0e10cSrcweir { 459cdf0e10cSrcweir SCCOL nCol1; 460cdf0e10cSrcweir SCROW nRow1; 461cdf0e10cSrcweir SCCOL nCol2; 462cdf0e10cSrcweir SCROW nRow2; 463cdf0e10cSrcweir sal_Bool bImport; 464cdf0e10cSrcweir String aDBName; // Alias der Datenbank 465cdf0e10cSrcweir String aStatement; 466cdf0e10cSrcweir sal_Bool bNative; 467cdf0e10cSrcweir sal_Bool bSql; // Statement oder Name? 468cdf0e10cSrcweir sal_uInt8 nType; // enum DBObject 469cdf0e10cSrcweir 470cdf0e10cSrcweir ScImportParam(); 471cdf0e10cSrcweir ScImportParam( const ScImportParam& r ); 472cdf0e10cSrcweir ~ScImportParam(); 473cdf0e10cSrcweir 474cdf0e10cSrcweir ScImportParam& operator= ( const ScImportParam& r ); 475cdf0e10cSrcweir sal_Bool operator== ( const ScImportParam& r ) const; 476cdf0e10cSrcweir //UNUSED2009-05 void Clear (); 477cdf0e10cSrcweir }; 478cdf0e10cSrcweir 479cdf0e10cSrcweir struct ScStringHashCode 480cdf0e10cSrcweir { 481cdf0e10cSrcweir size_t operator()( const String& rStr ) const 482cdf0e10cSrcweir { 483cdf0e10cSrcweir return rtl_ustr_hashCode_WithLength( rStr.GetBuffer(), rStr.Len() ); 484cdf0e10cSrcweir } 485cdf0e10cSrcweir }; 486cdf0e10cSrcweir 487cdf0e10cSrcweir // ----------------------------------------------------------------------- 488cdf0e10cSrcweir 489cdf0e10cSrcweir class ScDocument; 490cdf0e10cSrcweir class ScDocShell; 491cdf0e10cSrcweir class ScDocShellRef; 492cdf0e10cSrcweir class SvxSearchItem; 493cdf0e10cSrcweir class ScAutoFormat; 494cdf0e10cSrcweir class FuncCollection; 495cdf0e10cSrcweir class ScUnoAddInCollection; 496cdf0e10cSrcweir class ScUserList; 497cdf0e10cSrcweir class SvxBrushItem; 498cdf0e10cSrcweir class ScFunctionList; 499cdf0e10cSrcweir class ScFunctionMgr; 500cdf0e10cSrcweir class SfxItemPool; 501cdf0e10cSrcweir class SdrModel; 502cdf0e10cSrcweir class EditTextObject; 503cdf0e10cSrcweir class SfxObjectShell; 504cdf0e10cSrcweir class SvNumberFormatter; 505cdf0e10cSrcweir class ScUnitConverter; 506cdf0e10cSrcweir class CharClass; 507cdf0e10cSrcweir class LocaleDataWrapper; 508cdf0e10cSrcweir class SvtSysLocale; 509cdf0e10cSrcweir class CalendarWrapper; 510cdf0e10cSrcweir class CollatorWrapper; 511cdf0e10cSrcweir class IntlWrapper; 512cdf0e10cSrcweir class OutputDevice; 513cdf0e10cSrcweir 514cdf0e10cSrcweir namespace com { namespace sun { namespace star { 515cdf0e10cSrcweir namespace lang { 516cdf0e10cSrcweir struct Locale; 517cdf0e10cSrcweir } 518cdf0e10cSrcweir namespace i18n { 519cdf0e10cSrcweir class XOrdinalSuffix; 520cdf0e10cSrcweir } 521cdf0e10cSrcweir }}} 522cdf0e10cSrcweir namespace utl { 523cdf0e10cSrcweir class TransliterationWrapper; 524cdf0e10cSrcweir } 525cdf0e10cSrcweir 526cdf0e10cSrcweir #ifndef _SCALC_EXE 527cdf0e10cSrcweir class ScGlobal 528cdf0e10cSrcweir { 529cdf0e10cSrcweir static SvxSearchItem* pSearchItem; 530cdf0e10cSrcweir static ScAutoFormat* pAutoFormat; 531cdf0e10cSrcweir static FuncCollection* pFuncCollection; 532cdf0e10cSrcweir static ScUnoAddInCollection* pAddInCollection; 533cdf0e10cSrcweir static ScUserList* pUserList; 534cdf0e10cSrcweir static String** ppRscString; 535cdf0e10cSrcweir static String* pStrScDoc; 536cdf0e10cSrcweir static String* pEmptyString; 537cdf0e10cSrcweir static String* pStrClipDocName; 538cdf0e10cSrcweir static SvxBrushItem* pEmptyBrushItem; 539cdf0e10cSrcweir static SvxBrushItem* pButtonBrushItem; 540cdf0e10cSrcweir static SvxBrushItem* pEmbeddedBrushItem; 541cdf0e10cSrcweir static SvxBrushItem* pProtectedBrushItem; 542cdf0e10cSrcweir 543cdf0e10cSrcweir static ImageList* pOutlineBitmaps; 544cdf0e10cSrcweir static ImageList* pOutlineBitmapsHC; 545cdf0e10cSrcweir 546cdf0e10cSrcweir // static Bitmap* pAnchorBitmap; 547cdf0e10cSrcweir // static Bitmap* pGrayAnchorBitmap; 548cdf0e10cSrcweir 549cdf0e10cSrcweir static ScFunctionList* pStarCalcFunctionList; 550cdf0e10cSrcweir static ScFunctionMgr* pStarCalcFunctionMgr; 551cdf0e10cSrcweir 552cdf0e10cSrcweir static ScUnitConverter* pUnitConverter; 553cdf0e10cSrcweir 554cdf0e10cSrcweir static SvNumberFormatter* pEnglishFormatter; // for UNO / XML export 555cdf0e10cSrcweir 556cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XOrdinalSuffix> xOrdinalSuffix; 557cdf0e10cSrcweir static CalendarWrapper* pCalendar; 558cdf0e10cSrcweir static CollatorWrapper* pCaseCollator; 559cdf0e10cSrcweir static CollatorWrapper* pCollator; 560cdf0e10cSrcweir static ::utl::TransliterationWrapper* pTransliteration; 561cdf0e10cSrcweir static ::utl::TransliterationWrapper* pCaseTransliteration; 562cdf0e10cSrcweir static IntlWrapper* pScIntlWrapper; 563cdf0e10cSrcweir static ::com::sun::star::lang::Locale* pLocale; 564cdf0e10cSrcweir 565cdf0e10cSrcweir public: 566cdf0e10cSrcweir static SvtSysLocale* pSysLocale; 567cdf0e10cSrcweir // for faster access a pointer to the single instance provided by SvtSysLocale 568cdf0e10cSrcweir SC_DLLPUBLIC static const CharClass* pCharClass; 569cdf0e10cSrcweir // for faster access a pointer to the single instance provided by SvtSysLocale 570cdf0e10cSrcweir SC_DLLPUBLIC static const LocaleDataWrapper* pLocaleData; 571cdf0e10cSrcweir SC_DLLPUBLIC static const LocaleDataWrapper* GetpLocaleData(); 572cdf0e10cSrcweir 573cdf0e10cSrcweir static CalendarWrapper* GetCalendar(); 574cdf0e10cSrcweir SC_DLLPUBLIC static CollatorWrapper* GetCollator(); 575cdf0e10cSrcweir static CollatorWrapper* GetCaseCollator(); 576cdf0e10cSrcweir static IntlWrapper* GetScIntlWrapper(); 577cdf0e10cSrcweir static ::com::sun::star::lang::Locale* GetLocale(); 578cdf0e10cSrcweir 579cdf0e10cSrcweir SC_DLLPUBLIC static ::utl::TransliterationWrapper* GetpTransliteration(); //CHINA001 580cdf0e10cSrcweir static ::utl::TransliterationWrapper* GetCaseTransliteration(); 581cdf0e10cSrcweir 582cdf0e10cSrcweir SC_DLLPUBLIC static LanguageType eLnge; 583cdf0e10cSrcweir static sal_Unicode cListDelimiter; 584cdf0e10cSrcweir 585cdf0e10cSrcweir static const String& GetClipDocName(); 586cdf0e10cSrcweir static void SetClipDocName( const String& rNew ); 587cdf0e10cSrcweir SC_DLLPUBLIC static const SvxSearchItem& GetSearchItem(); 588cdf0e10cSrcweir SC_DLLPUBLIC static void SetSearchItem( const SvxSearchItem& rNew ); 589cdf0e10cSrcweir SC_DLLPUBLIC static ScAutoFormat* GetAutoFormat(); 590cdf0e10cSrcweir static void ClearAutoFormat(); //BugId 54209 591cdf0e10cSrcweir static FuncCollection* GetFuncCollection(); 592cdf0e10cSrcweir SC_DLLPUBLIC static ScUnoAddInCollection* GetAddInCollection(); 593cdf0e10cSrcweir SC_DLLPUBLIC static ScUserList* GetUserList(); 594cdf0e10cSrcweir static void SetUserList( const ScUserList* pNewList ); 595cdf0e10cSrcweir SC_DLLPUBLIC static const String& GetRscString( sal_uInt16 nIndex ); 596cdf0e10cSrcweir static void OpenURL( const String& rURL, const String& rTarget ); 597cdf0e10cSrcweir SC_DLLPUBLIC static String GetAbsDocName( const String& rFileName, 598cdf0e10cSrcweir SfxObjectShell* pShell ); 599cdf0e10cSrcweir SC_DLLPUBLIC static String GetDocTabName( const String& rFileName, 600cdf0e10cSrcweir const String& rTabName ); 601cdf0e10cSrcweir SC_DLLPUBLIC static sal_uLong GetStandardFormat( SvNumberFormatter&, 602cdf0e10cSrcweir sal_uLong nFormat, short nType ); 603cdf0e10cSrcweir SC_DLLPUBLIC static sal_uLong GetStandardFormat( double, SvNumberFormatter&, 604cdf0e10cSrcweir sal_uLong nFormat, short nType ); 605cdf0e10cSrcweir 606cdf0e10cSrcweir SC_DLLPUBLIC static double nScreenPPTX; 607cdf0e10cSrcweir SC_DLLPUBLIC static double nScreenPPTY; 608cdf0e10cSrcweir 609cdf0e10cSrcweir static ScDocShellRef* pDrawClipDocShellRef; 610cdf0e10cSrcweir 611cdf0e10cSrcweir static sal_uInt16 nDefFontHeight; 612cdf0e10cSrcweir static sal_uInt16 nStdRowHeight; 613cdf0e10cSrcweir 614cdf0e10cSrcweir SC_DLLPUBLIC static long nLastRowHeightExtra; 615cdf0e10cSrcweir static long nLastColWidthExtra; 616cdf0e10cSrcweir 617cdf0e10cSrcweir static void Init(); // am Anfang 618cdf0e10cSrcweir static void InitAddIns(); 619cdf0e10cSrcweir static void Clear(); // bei Programmende 620cdf0e10cSrcweir 621cdf0e10cSrcweir static void UpdatePPT(OutputDevice* pDev); 622cdf0e10cSrcweir 623cdf0e10cSrcweir static void InitTextHeight(SfxItemPool* pPool); 624cdf0e10cSrcweir static SvxBrushItem* GetEmptyBrushItem() { return pEmptyBrushItem; } 625cdf0e10cSrcweir static SvxBrushItem* GetButtonBrushItem(); 626cdf0e10cSrcweir static SvxBrushItem* GetEmbeddedBrushItem() { return pEmbeddedBrushItem; } 627cdf0e10cSrcweir static SvxBrushItem* GetProtectedBrushItem() { return pProtectedBrushItem; } 628cdf0e10cSrcweir SC_DLLPUBLIC static const String& GetEmptyString(); 629cdf0e10cSrcweir static const String& GetScDocString(); 630cdf0e10cSrcweir 631cdf0e10cSrcweir /** Returns the specified image list with outline symbols. 632cdf0e10cSrcweir @param bHC false = standard symbols; true = high contrast symbols. */ 633cdf0e10cSrcweir static ImageList* GetOutlineSymbols( bool bHC ); 634cdf0e10cSrcweir 635cdf0e10cSrcweir // static const Bitmap& GetAnchorBitmap(); 636cdf0e10cSrcweir // static const Bitmap& GetGrayAnchorBitmap(); 637cdf0e10cSrcweir 638cdf0e10cSrcweir static bool HasStarCalcFunctionList(); 639cdf0e10cSrcweir static ScFunctionList* GetStarCalcFunctionList(); 640cdf0e10cSrcweir static ScFunctionMgr* GetStarCalcFunctionMgr(); 641cdf0e10cSrcweir static void ResetFunctionList(); 642cdf0e10cSrcweir 643cdf0e10cSrcweir static String GetErrorString(sal_uInt16 nErrNumber); 644cdf0e10cSrcweir static String GetLongErrorString(sal_uInt16 nErrNumber); 645cdf0e10cSrcweir static sal_Bool EETextObjEqual( const EditTextObject* pObj1, 646cdf0e10cSrcweir const EditTextObject* pObj2 ); 647cdf0e10cSrcweir static sal_Bool CheckWidthInvalidate( sal_Bool& bNumFormatChanged, 648cdf0e10cSrcweir const SfxItemSet& rNewAttrs, 649cdf0e10cSrcweir const SfxItemSet& rOldAttrs ); 650cdf0e10cSrcweir static sal_Bool HasAttrChanged( const SfxItemSet& rNewAttrs, 651cdf0e10cSrcweir const SfxItemSet& rOldAttrs, 652cdf0e10cSrcweir const sal_uInt16 nWhich ); 653cdf0e10cSrcweir 654cdf0e10cSrcweir static ScUnitConverter* GetUnitConverter(); 655cdf0e10cSrcweir 656cdf0e10cSrcweir /// strchr() functionality on unicode, as long as we need it for ScToken etc. 657cdf0e10cSrcweir static const sal_Unicode* UnicodeStrChr( const sal_Unicode* pStr, sal_Unicode c ); 658cdf0e10cSrcweir 659cdf0e10cSrcweir static inline sal_Unicode ToUpperAlpha( sal_Unicode c ) 660cdf0e10cSrcweir { return ( c >= 'a' && c <= 'z' ) ? ( c-'a'+'A' ) : c; } 661cdf0e10cSrcweir 662cdf0e10cSrcweir /** Adds the string rToken to rTokenList, using a list separator character. 663cdf0e10cSrcweir @param rTokenList The string list where the token will be appended to. 664cdf0e10cSrcweir @param rToken The token string to append to the token list. 665cdf0e10cSrcweir @param cSep The character to separate the tokens. 666cdf0e10cSrcweir @param nSepCount Specifies how often cSep is inserted between two tokens. 667cdf0e10cSrcweir @param bForceSep true = Always insert separator; false = Only, if not at begin or end. */ 668cdf0e10cSrcweir SC_DLLPUBLIC static void AddToken( 669cdf0e10cSrcweir String& rTokenList, const String& rToken, 670cdf0e10cSrcweir sal_Unicode cSep, xub_StrLen nSepCount = 1, 671cdf0e10cSrcweir bool bForceSep = false ); 672cdf0e10cSrcweir 673cdf0e10cSrcweir /** Returns true, if the first and last character of the string is cQuote. */ 674cdf0e10cSrcweir SC_DLLPUBLIC static bool IsQuoted( const String& rString, sal_Unicode cQuote = '\'' ); 675cdf0e10cSrcweir 676cdf0e10cSrcweir /** Inserts the character cQuote at beginning and end of rString. 677cdf0e10cSrcweir @param bEscapeEmbedded If <TRUE/>, embedded quote characters are 678cdf0e10cSrcweir escaped by doubling them. 679cdf0e10cSrcweir */ 680cdf0e10cSrcweir SC_DLLPUBLIC static void AddQuotes( String& rString, sal_Unicode cQuote = '\'', bool bEscapeEmbedded = true ); 681cdf0e10cSrcweir 682cdf0e10cSrcweir /** Erases the character cQuote from rString, if it exists at beginning AND end. 683cdf0e10cSrcweir @param bUnescapeEmbedded If <TRUE/>, embedded doubled quote characters 684cdf0e10cSrcweir are unescaped by replacing them with a 685cdf0e10cSrcweir single instance. 686cdf0e10cSrcweir */ 687cdf0e10cSrcweir SC_DLLPUBLIC static void EraseQuotes( String& rString, sal_Unicode cQuote = '\'', bool bUnescapeEmbedded = true ); 688cdf0e10cSrcweir 689cdf0e10cSrcweir /** Finds an unquoted instance of cChar in rString, starting at 690cdf0e10cSrcweir offset nStart. Unquoted instances may occur when concatenating two 691cdf0e10cSrcweir quoted strings with a separator, for example, 's1':'s2'. Embedded 692cdf0e10cSrcweir quotes have to be escaped by being doubled. Caller must ensure that 693cdf0e10cSrcweir nStart points into an unquoted range or the opening quote. Specialty: 694cdf0e10cSrcweir if cChar==cQuote the first cQuote character from nStart on is found. 695cdf0e10cSrcweir @returns offset if found, else STRING_NOTFOUND 696cdf0e10cSrcweir */ 697cdf0e10cSrcweir SC_DLLPUBLIC static xub_StrLen FindUnquoted( const String& rString, sal_Unicode cChar, xub_StrLen nStart = 0, sal_Unicode cQuote = '\'' ); 698cdf0e10cSrcweir 699cdf0e10cSrcweir /** Finds an unquoted instance of cChar in null-terminated pString. Same 700cdf0e10cSrcweir semantics as FindUnquoted( const String&, ...) 701cdf0e10cSrcweir @returns: pointer to cChar if found, else NULL 702cdf0e10cSrcweir */ 703cdf0e10cSrcweir SC_DLLPUBLIC static const sal_Unicode* FindUnquoted( const sal_Unicode* pString, sal_Unicode cChar, sal_Unicode cQuote = '\'' ); 704cdf0e10cSrcweir 705cdf0e10cSrcweir 706cdf0e10cSrcweir static CharSet GetCharsetValue( const String& rCharSet ); 707cdf0e10cSrcweir static String GetCharsetString( CharSet eVal ); 708cdf0e10cSrcweir 709cdf0e10cSrcweir /// a "ReadOnly" formatter for UNO/XML export 710cdf0e10cSrcweir static SvNumberFormatter* GetEnglishFormatter(); 711cdf0e10cSrcweir 712cdf0e10cSrcweir static sal_Bool IsSystemRTL(); // depending on system language 713cdf0e10cSrcweir static LanguageType GetEditDefaultLanguage(); // for EditEngine::SetDefaultLanguage 714cdf0e10cSrcweir SC_DLLPUBLIC static sal_uInt8 GetDefaultScriptType(); // for all WEAK characters 715cdf0e10cSrcweir /** Map ATTR_((CJK|CTL)_)?FONT_... to proper WhichIDs. 716cdf0e10cSrcweir If more than one SCRIPTTYPE_... values are or'ed together, prefers 717cdf0e10cSrcweir first COMPLEX, then ASIAN */ 718cdf0e10cSrcweir SC_DLLPUBLIC static sal_uInt16 GetScriptedWhichID( sal_uInt8 nScriptType, sal_uInt16 nWhich ); 719cdf0e10cSrcweir 720cdf0e10cSrcweir /** Adds a language item to the item set, if the number format item contains 721cdf0e10cSrcweir a language that differs from its parent's language. */ 722cdf0e10cSrcweir SC_DLLPUBLIC static void AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter ); 723cdf0e10cSrcweir 724cdf0e10cSrcweir /** Obtain the ordinal suffix for a number according to the system locale */ 725cdf0e10cSrcweir static String GetOrdinalSuffix( sal_Int32 nNumber); 726cdf0e10cSrcweir }; 727cdf0e10cSrcweir #endif 728cdf0e10cSrcweir 729cdf0e10cSrcweir //================================================================== 730cdf0e10cSrcweir // evtl. in dbdata.hxx auslagern (?): 731cdf0e10cSrcweir 732cdf0e10cSrcweir enum ScQueryOp 733cdf0e10cSrcweir { 734cdf0e10cSrcweir SC_EQUAL, 735cdf0e10cSrcweir SC_LESS, 736cdf0e10cSrcweir SC_GREATER, 737cdf0e10cSrcweir SC_LESS_EQUAL, 738cdf0e10cSrcweir SC_GREATER_EQUAL, 739cdf0e10cSrcweir SC_NOT_EQUAL, 740cdf0e10cSrcweir SC_TOPVAL, 741cdf0e10cSrcweir SC_BOTVAL, 742cdf0e10cSrcweir SC_TOPPERC, 743cdf0e10cSrcweir SC_BOTPERC, 744cdf0e10cSrcweir SC_CONTAINS, 745cdf0e10cSrcweir SC_DOES_NOT_CONTAIN, 746cdf0e10cSrcweir SC_BEGINS_WITH, 747cdf0e10cSrcweir SC_DOES_NOT_BEGIN_WITH, 748cdf0e10cSrcweir SC_ENDS_WITH, 749cdf0e10cSrcweir SC_DOES_NOT_END_WITH 750cdf0e10cSrcweir }; 751cdf0e10cSrcweir 752cdf0e10cSrcweir // ----------------------------------------------------------------------- 753cdf0e10cSrcweir 754cdf0e10cSrcweir enum ScQueryConnect 755cdf0e10cSrcweir { 756cdf0e10cSrcweir SC_AND, 757cdf0e10cSrcweir SC_OR 758cdf0e10cSrcweir }; 759cdf0e10cSrcweir 760cdf0e10cSrcweir // ----------------------------------------------------------------------- 761cdf0e10cSrcweir 762cdf0e10cSrcweir enum ScSubTotalFunc 763cdf0e10cSrcweir { 764cdf0e10cSrcweir SUBTOTAL_FUNC_NONE = 0, 765cdf0e10cSrcweir SUBTOTAL_FUNC_AVE = 1, 766cdf0e10cSrcweir SUBTOTAL_FUNC_CNT = 2, 767cdf0e10cSrcweir SUBTOTAL_FUNC_CNT2 = 3, 768cdf0e10cSrcweir SUBTOTAL_FUNC_MAX = 4, 769cdf0e10cSrcweir SUBTOTAL_FUNC_MIN = 5, 770cdf0e10cSrcweir SUBTOTAL_FUNC_PROD = 6, 771cdf0e10cSrcweir SUBTOTAL_FUNC_STD = 7, 772cdf0e10cSrcweir SUBTOTAL_FUNC_STDP = 8, 773cdf0e10cSrcweir SUBTOTAL_FUNC_SUM = 9, 774cdf0e10cSrcweir SUBTOTAL_FUNC_VAR = 10, 775cdf0e10cSrcweir SUBTOTAL_FUNC_VARP = 11 776cdf0e10cSrcweir }; 777cdf0e10cSrcweir 778cdf0e10cSrcweir 779cdf0e10cSrcweir // ----------------------------------------------------------------------- 780cdf0e10cSrcweir 781cdf0e10cSrcweir /* 782cdf0e10cSrcweir * Dialog liefert die ausgezeichneten Feldwerte "leer"/"nicht leer" 783cdf0e10cSrcweir * als Konstanten SC_EMPTYFIELDS bzw. SC_NONEMPTYFIELDS in nVal in 784cdf0e10cSrcweir * Verbindung mit dem Schalter bQueryByString auf FALSE. 785cdf0e10cSrcweir */ 786cdf0e10cSrcweir 787cdf0e10cSrcweir #define SC_EMPTYFIELDS ((double)0x0042) 788cdf0e10cSrcweir #define SC_NONEMPTYFIELDS ((double)0x0043) 789cdf0e10cSrcweir 790cdf0e10cSrcweir namespace utl 791cdf0e10cSrcweir { 792cdf0e10cSrcweir class SearchParam; 793cdf0e10cSrcweir class TextSearch; 794cdf0e10cSrcweir } 795cdf0e10cSrcweir 796cdf0e10cSrcweir struct ScQueryEntry 797cdf0e10cSrcweir { 798cdf0e10cSrcweir sal_Bool bDoQuery; 799cdf0e10cSrcweir sal_Bool bQueryByString; 800cdf0e10cSrcweir bool bQueryByDate; 801cdf0e10cSrcweir SCCOLROW nField; 802cdf0e10cSrcweir ScQueryOp eOp; 803cdf0e10cSrcweir ScQueryConnect eConnect; 804cdf0e10cSrcweir String* pStr; 805cdf0e10cSrcweir double nVal; 806cdf0e10cSrcweir utl::SearchParam* pSearchParam; // falls RegExp, nicht gespeichert 807cdf0e10cSrcweir utl::TextSearch* pSearchText; // falls RegExp, nicht gespeichert 808cdf0e10cSrcweir 809cdf0e10cSrcweir ScQueryEntry(); 810cdf0e10cSrcweir ScQueryEntry(const ScQueryEntry& r); 811cdf0e10cSrcweir ~ScQueryEntry(); 812cdf0e10cSrcweir 813cdf0e10cSrcweir // legt ggbf. pSearchParam und pSearchText an, immer RegExp! 814cdf0e10cSrcweir utl::TextSearch* GetSearchTextPtr( sal_Bool bCaseSens ); 815cdf0e10cSrcweir 816cdf0e10cSrcweir void Clear(); 817cdf0e10cSrcweir ScQueryEntry& operator=( const ScQueryEntry& r ); 818cdf0e10cSrcweir sal_Bool operator==( const ScQueryEntry& r ) const; 819cdf0e10cSrcweir }; 820cdf0e10cSrcweir 821cdf0e10cSrcweir // ----------------------------------------------------------------------- 822cdf0e10cSrcweir 823cdf0e10cSrcweir struct SC_DLLPUBLIC ScSubTotalParam 824cdf0e10cSrcweir { 825cdf0e10cSrcweir SCCOL nCol1; // Selektierter Bereich 826cdf0e10cSrcweir SCROW nRow1; 827cdf0e10cSrcweir SCCOL nCol2; 828cdf0e10cSrcweir SCROW nRow2; 829cdf0e10cSrcweir sal_Bool bRemoveOnly; 830cdf0e10cSrcweir sal_Bool bReplace; // vorhandene Ergebnisse ersetzen 831cdf0e10cSrcweir sal_Bool bPagebreak; // Seitenumbruch bei Gruppenwechsel 832cdf0e10cSrcweir sal_Bool bCaseSens; // Gross-/Kleinschreibung 833cdf0e10cSrcweir sal_Bool bDoSort; // vorher sortieren 834cdf0e10cSrcweir sal_Bool bAscending; // aufsteigend sortieren 835cdf0e10cSrcweir sal_Bool bUserDef; // Benutzer-def. Sort.Reihenfolge 836cdf0e10cSrcweir sal_uInt16 nUserIndex; // Index auf Liste 837cdf0e10cSrcweir sal_Bool bIncludePattern; // Formate mit sortieren 838cdf0e10cSrcweir sal_Bool bGroupActive[MAXSUBTOTAL]; // aktive Gruppen 839cdf0e10cSrcweir SCCOL nField[MAXSUBTOTAL]; // zugehoeriges Feld 840cdf0e10cSrcweir SCCOL nSubTotals[MAXSUBTOTAL]; // Anzahl der SubTotals 841cdf0e10cSrcweir SCCOL* pSubTotals[MAXSUBTOTAL]; // Array der zu berechnenden Spalten 842cdf0e10cSrcweir ScSubTotalFunc* pFunctions[MAXSUBTOTAL]; // Array der zugehoerige Funktionen 843cdf0e10cSrcweir 844cdf0e10cSrcweir ScSubTotalParam(); 845cdf0e10cSrcweir ScSubTotalParam( const ScSubTotalParam& r ); 846cdf0e10cSrcweir 847cdf0e10cSrcweir ScSubTotalParam& operator= ( const ScSubTotalParam& r ); 848cdf0e10cSrcweir sal_Bool operator== ( const ScSubTotalParam& r ) const; 849cdf0e10cSrcweir void Clear (); 850cdf0e10cSrcweir void SetSubTotals ( sal_uInt16 nGroup, 851cdf0e10cSrcweir const SCCOL* ptrSubTotals, 852cdf0e10cSrcweir const ScSubTotalFunc* ptrFuncions, 853cdf0e10cSrcweir sal_uInt16 nCount ); 854cdf0e10cSrcweir }; 855cdf0e10cSrcweir 856cdf0e10cSrcweir // ----------------------------------------------------------------------- 857cdf0e10cSrcweir class ScArea; 858cdf0e10cSrcweir 859cdf0e10cSrcweir struct ScConsolidateParam 860cdf0e10cSrcweir { 861cdf0e10cSrcweir SCCOL nCol; // Cursor Position / 862cdf0e10cSrcweir SCROW nRow; // bzw. Anfang des Zielbereiches 863cdf0e10cSrcweir SCTAB nTab; 864cdf0e10cSrcweir ScSubTotalFunc eFunction; // Berechnungsvorschrift 865cdf0e10cSrcweir sal_uInt16 nDataAreaCount; // Anzahl der Datenbereiche 866cdf0e10cSrcweir ScArea** ppDataAreas; // Zeiger-Array auf Datenbereiche 867cdf0e10cSrcweir sal_Bool bByCol; // nach Spalten 868cdf0e10cSrcweir sal_Bool bByRow; // nach Zeilen 869cdf0e10cSrcweir sal_Bool bReferenceData; // Quelldaten referenzieren 870cdf0e10cSrcweir 871cdf0e10cSrcweir ScConsolidateParam(); 872cdf0e10cSrcweir ScConsolidateParam( const ScConsolidateParam& r ); 873cdf0e10cSrcweir ~ScConsolidateParam(); 874cdf0e10cSrcweir 875cdf0e10cSrcweir ScConsolidateParam& operator= ( const ScConsolidateParam& r ); 876cdf0e10cSrcweir sal_Bool operator== ( const ScConsolidateParam& r ) const; 877cdf0e10cSrcweir void Clear (); // = ClearDataAreas()+Members 878cdf0e10cSrcweir void ClearDataAreas (); 879cdf0e10cSrcweir void SetAreas ( ScArea* const* ppAreas, sal_uInt16 nCount ); 880cdf0e10cSrcweir }; 881cdf0e10cSrcweir 882cdf0e10cSrcweir // ----------------------------------------------------------------------- 883cdf0e10cSrcweir extern ::utl::TransliterationWrapper* GetScGlobalpTransliteration();//CHINA001 884cdf0e10cSrcweir extern const LocaleDataWrapper* GetScGlobalpLocaleData(); 885cdf0e10cSrcweir 886cdf0e10cSrcweir #endif 887